mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: sigefriedhyy@gmail.com
Cc: ajay.kathat@microchip.com, aleksandr.loktionov@intel.com,
	andrew+netdev@lunn.ch, claudiu.beznea@tuxon.dev,
	davem@davemloft.net, dsahern@kernel.org, donald.hunter@gmail.com,
	edumazet@google.com, idosch@nvidia.com, jacob.e.keller@intel.com,
	kuba@kernel.org, johannes@sipsolutions.net, kees@kernel.org,
	kory.maincent@bootlin.com, kuniyu@google.com,
	nicolas.dichtel@6wind.com, nickgarlis@gmail.com,
	pabeni@redhat.com, sd@queasysnail.net, shuah@kernel.org,
	horms@kernel.org, sdf.kernel@gmail.com,
	vadim.fedorenko@linux.dev, willemb@google.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v9 2/6] net: change netdev_hw_addr_list count through helpers
Date: Thu, 01 Oct 2026 23:31:19 +0000	[thread overview]
Message-ID: <179089747937.434549.16341143363097629528@kernel.org> (raw)
In-Reply-To: <20260930112842.21323-3-sigefriedhyy@gmail.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In the commit "net: change netdev_hw_addr_list count through
  helpers", a new comment on struct netdev_hw_addr_list::_count in…

--

net: change netdev_hw_addr_list count through helpers

This patch adds __hw_addr_count_add(), __hw_addr_count_inc(),
__hw_addr_count_dec() and __hw_addr_count_reset() to
net/core/dev_addr_lists.c and uses them for changes to the list count. It
also renames netdev_hw_addr_list.count to _count so that direct writes
stand out. Drivers, mac80211 and the kunit tests that read the field
directly now use the count helpers. This prepares for a later patch that
accounts every change to dev->mc.

> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index d037faff7c44b..97dc053f234cc 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -252,13 +252,14 @@ struct netdev_hw_addr {
>  
>  struct netdev_hw_addr_list {
>  	struct list_head	list;
> -	int			count;
> +	/* Only changed through the __hw_addr_count_* helpers */
> +	int			_count;

[ ... ]

> diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
> index 08528ca0a8b31..23f5db99a702d 100644
> --- a/net/core/dev_addr_lists.c
> +++ b/net/core/dev_addr_lists.c

[ ... ]

> @@ -492,14 +512,14 @@ void __hw_addr_flush(struct netdev_hw_addr_list *list)

[ ... ]

>  void __hw_addr_init(struct netdev_hw_addr_list *list)
>  {
>  	INIT_LIST_HEAD(&list->list);
> -	list->count = 0;
> +	list->_count = 0;

[Severity: Low]
This isn't a bug, but the new comment in struct netdev_hw_addr_list says
_count is "Only changed through the __hw_addr_count_* helpers". However,
__hw_addr_init() still writes it directly, and the write is still there at
the end of the series.

Could the comment name initialization as an exception? For example:

    /* Only changed through the __hw_addr_count_* helpers after
     * __hw_addr_init()
     */

This has no functional effect on the later dev->mc generation counter
patch. dev_mc_init() calls __hw_addr_init() only from alloc_netdev_mqs(),
on a freshly zeroed device, and dev->mc.owner is set only after that call.
Also, by the end of the series __hw_addr_init() sets list->owner = NULL.
So __hw_addr_changed() would do nothing here even if a helper were used.

A related point: the commit message says readers keep using
netdev_hw_addr_list_count(), but two places in this file still read the
raw field:

__hw_addr_splice():
	__hw_addr_count_add(dst, src->_count);

__hw_addr_list_snapshot():
		if (cache->_count) {

Should these use netdev_hw_addr_list_count() too, so they follow the
reader convention in the commit message?

>  	list->tree = RB_ROOT;
>  }
>  EXPORT_SYMBOL(__hw_addr_init);

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260930112842.21323-1-sigefriedhyy%40gmail.com

  parent reply	other threads:[~2026-10-01 23:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 11:28 [PATCH net-next v9 0/6] rtnetlink: dump link-layer multicast addresses Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 1/6] netlink: specs: rt-addr: fix the type of target-netnsid Yuyang Huang
2026-10-01 23:31   ` netdev-bot+sashiko
2026-10-02 10:05     ` Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 2/6] net: change netdev_hw_addr_list count through helpers Yuyang Huang
2026-09-30 13:03   ` Nicolas Dichtel
2026-09-30 13:43     ` Yuyang Huang
2026-09-30 14:08       ` Nicolas Dichtel
2026-09-30 14:13         ` Yuyang Huang
2026-10-01 23:31   ` netdev-bot+sashiko [this message]
2026-10-02 10:06     ` Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 3/6] net: add a generation counter for dev->mc changes Yuyang Huang
2026-09-30 13:04   ` Nicolas Dichtel
2026-09-30 11:28 ` [PATCH net-next v9 4/6] net: add AF_PACKET multicast dumps Yuyang Huang
2026-10-01 23:31   ` netdev-bot+sashiko
2026-10-02 10:12     ` Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 5/6] netlink: specs: rt-addr: document " Yuyang Huang
2026-10-01 23:31   ` netdev-bot+sashiko
2026-10-02 10:13     ` Yuyang Huang
2026-09-30 11:28 ` [PATCH net-next v9 6/6] selftests: net: test " Yuyang Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179089747937.434549.16341143363097629528@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=ajay.kathat@microchip.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=jacob.e.keller@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kees@kernel.org \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nickgarlis@gmail.com \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --cc=sd@queasysnail.net \
    --cc=sdf.kernel@gmail.com \
    --cc=shuah@kernel.org \
    --cc=sigefriedhyy@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®