* Re: [PATCH net-next v2 01/13] net: Introduce struct ndo_fdb_parms
[not found] <36a8818d315eaf6de10f97d9f3c691d821664d85.1796041491.git.petrm@nvidia.com>
@ 2026-12-01 13:10 ` netdev-bot+sashiko
2026-12-01 18:12 ` Petr Machata
0 siblings, 1 reply; 3+ messages in thread
From: netdev-bot+sashiko @ 2026-12-01 13:10 UTC (permalink / raw)
To: petrm
Cc: davem, edumazet, kuba, pabeni, horms, netdev, andrew+netdev,
razor, bridge, idosch, aroulin, mlxsw, shuah, linux-kselftest
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] The kernel-doc for the new struct ndo_fdb_parms
(include/linux/netdevice.h) says the struct holds the 'parameters for…
--
net: Introduce struct ndo_fdb_parms
This patch gathers the arguments shared by ndo_fdb_add, ndo_fdb_del and
ndo_fdb_get (device, address, VLAN ID and, for add, the netlink message
flags) into a new struct ndo_fdb_parms. A pointer to that struct is now
passed to the callbacks. rtnetlink and the affected drivers are converted
to the new prototypes.
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 694b6d29f6807..0bfd36057d3a4 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1087,6 +1087,20 @@ struct netdev_net_notifier {
> struct notifier_block *nb;
> };
>
> +/**
> + * struct ndo_fdb_parms - parameters for ndo_fdb_{add,del,get}
> + * @dev: device the FDB entry is added to, deleted from or looked up on
> + * @addr: MAC address of the FDB entry
> + * @vid: VLAN ID of the FDB entry, 0 if none
> + * @flags: netlink message flags (NLM_F_*) of the request
> + */
[Severity: Low]
Does the @flags description match how the struct is filled in for del and
get?
The kernel-doc says the struct carries the parameters for all three
callbacks. It describes @flags as the NLM_F_* flags of the request,
without limiting that to add. Only rtnl_fdb_add() sets the field:
parms = (struct ndo_fdb_parms) {
.dev = dev,
.addr = addr,
.vid = vid,
.flags = nlh->nlmsg_flags,
};
rtnl_fdb_del() and rtnl_fdb_get() in net/core/rtnetlink.c leave .flags
out:
parms = (struct ndo_fdb_parms) {
.dev = dev,
.addr = addr,
.vid = vid,
};
As a result, every ndo_fdb_del and ndo_fdb_get implementation sees
parms->flags == 0, whatever flags the request carried. In rtnl_fdb_del()
that includes NLM_F_BULK, which the function itself reads from
nlh->nlmsg_flags.
No in-tree ndo_fdb_del or ndo_fdb_get implementation reads parms->flags
today. All current users (i40e, ice, macvlan, vxlan_fdb_add(),
br_fdb_add(), ndo_dflt_fdb_add()) are on the add path, so this has no
runtime effect. Later in the series, the del and get initializers gain
.portid but still not .flags, and the kernel-doc stays the same.
Could either .flags = nlh->nlmsg_flags be set in rtnl_fdb_del() and
rtnl_fdb_get(), or @flags be documented as valid only for ndo_fdb_add?
> +struct ndo_fdb_parms {
> + struct net_device *dev;
> + const unsigned char *addr;
> + u16 vid;
> + u16 flags;
> +};
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1796041491.git.petrm%40nvidia.com
^ permalink raw reply [flat|nested] 3+ messages in thread