On 2/8/21 6:58 PM, Taehee Yoo wrote:
> Currently, struct ip6_sf_socklist doesn't use list API so that code
> shape is a little bit different from others.
> So it converts ip6_sf_socklist to use list API so it would
> improve readability.
>
> Signed-off-by: Taehee Yoo <[email protected]>
> ---
> include/net/if_inet6.h | 19 +-
> include/uapi/linux/in.h | 4 +-
> net/ipv6/mcast.c | 387 +++++++++++++++++++++++++---------------
> 3 files changed, 256 insertions(+), 154 deletions(-)
>
> diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
> index babf19c27b29..6885ab8ec2e9 100644
> --- a/include/net/if_inet6.h
> +++ b/include/net/if_inet6.h
> @@ -13,6 +13,7 @@
> #include <net/snmp.h>
> #include <linux/ipv6.h>
> #include <linux/refcount.h>
> +#include <linux/types.h>
>
> /* inet6_dev.if_flags */
>
> @@ -76,23 +77,19 @@ struct inet6_ifaddr {
> };
>
> struct ip6_sf_socklist {
> - unsigned int sl_max;
> - unsigned int sl_count;
> - struct in6_addr sl_addr[];
> + struct list_head list;
> + struct in6_addr sl_addr;
> + struct rcu_head rcu;
> };
>
I dunno about readability, but :
Your patches adds/delete more than 1000 lines, who is really going to review
this ?
You replace dense arrays by lists, so the performance will likely be hurt,
as cpu caches will be poorly used.