πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25282

Re: [PATCH net-next v2 01/13] net: Introduce struct ndo_fdb_parms

#25282
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 13:10
85 lines
10772 bytes
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
Technical Details
Message-ID: <179613062858.3146.7650139922533019233@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375089-linux-kernel-netdev=dewy.ru
References: <36a8818d315eaf6de10f97d9f3c691d821664d85.1796041491.git.petrm@nvidia.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375089-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 01/13] net: Introduce struct ndo_fdb_parms
Date: Tue, 01 Dec 2026 13:10:28 +0000
Organization: Usenet Network
Message-ID: <179613062858.3146.7650139922533019233@kernel.org>
References: <36a8818d315eaf6de10f97d9f3c691d821664d85.1796041491.git.petrm@nvidia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1718438"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ybhicRbciDUy93t6gtt2xMUVC48= sha256:Bp8xQ6vASLJYM2TKl6OsKREowge0bOlC5KskKP4WIpk=
	sha1:h/QlFHAJoBcRGVfEYg8qWVj/CcA= sha256:xFLhNzmia40w1jRXtf1fk4ut07JBolfrqh+CITkHqxk=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 752891173B1; Tue,  1 Dec 2026 16:10:50 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id EI-ioSXHMoU4;
	Tue,  1 Dec 2026 16:10:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-375089-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 73AF61173AC; Tue,  1 Dec 2026 16:10:37 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id D10C2237A8; Tue,  1 Dec 2026 13:10:33 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796130631;
	b=Igkz5g7mgEmObLHCgP26T0jHNlFf3Zpt1gdmsTV1ui6QxRn1cZTsemTJE7mPEFNNbVCw
	 RRW5KQkLn/PsuK3ymDoG6J2k9HFL5JrTnzLFIfS9bvv888dK11bXBCQ9kcTv6+Vo6YRZl
	 ij6PvaMXZ0hhpZt3yCRWS4xFeqIM2fP+dmT2aGZp6wi8E6jIfc7aaEAgDUmdec/iqpY5+
	 Ug6gx+l6D7PoG8P5iPTmmp9Cres7p0V5UTI5kK14ZYIHEeampjkj6EN6Chs1IEsPPyd0Q
	 AA2wvCiPaPnkVTT69KF9ziEUyW6cvUpw25sWFcfpVM0zUr72kKkcMIsx3vsrhise7dg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796130631;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=D7VeqERR7suQ8HYoyXM6BC/yUhu5QT86Hepswf53vkQ=;
	b=nPZjq3eyCbBHUVl6TrElrfIXz9BjSUysOvoDS3cI0477LJwF82InDTNu3iEC3VwouMZG
	 MkhXQgtgStjyx2eCp+dODwDIl2FHPWLRMaprPM+FOBkM3/I5tGgPxRRqqovdRxSLvjv9J
	 cIsxIpEFAHc4txVyuZH3AF+LLHz6RJKebYGewD0ZDPMU+R6ZQXLjUXThn0LGE3/6gcZ69
	 8NK8vxkm/KBLDfdlD7G4eRRqxdTCbX9WIZ2DtPgquYPFzEheTiwZSWMOWSqSJ/wbY63qy
	 BOAKwetNuB3jZJi/MAZt8NvRYpTojbW7zv1MaBiWhUBMh582f/jnUMgMraDXo3kwgCg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=knuUvCa+;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 748F2606A69B;
	Tue,  1 Dec 2026 13:10:31 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=knuUvCa+
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796130630;
	b=V4lmleEnQJCDOZ2+mRBgkvfX5YGLz9DfQYHrHtjDu6YOz4yiyqbhqc7uy5k3sdgw6Nms
	 AmSiI7w3N4/FRZp7M6S7UxUOAhq3YEVaW//P40vGNev7NiYTqNpiUncWYSZKtGr+i52H8
	 YiH7GLXFV3soTWIQ0Mqn1MSrPosPl1mgie7mg2qkoEjb5y+s0ZlNdrqRsFbrnw/vzxPcn
	 hnd+O/bWIlIfUTBvKZMyZX13g7yp0JL86ISP6566PWFbwAGN2mKINLrHlKDVV6gF1hCeC
	 dXQR5d6IEMB+dVm6SW5rBsjQLIiXKeqfuKxUaVhkr/FdabF0njyZDk725I9P6Y6/D4w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796130630;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=D7VeqERR7suQ8HYoyXM6BC/yUhu5QT86Hepswf53vkQ=;
	b=m23CIMKK1MIytqpTqnVtQPriK5MBGLalxUUUeg+S1zNQ5XCa5WKD+BmNAefwFnep5rYV
	 lItfehJqzZPMehxMuqiEe/IUAx5Ko9UnSKqWrbUo2xJUg+Ln1jFdygUcjtvSTc2TYCr4a
	 d6Ox2YmWo8w5RQOshjGH3HO9lqx7WpD0wKV+i86uvn6rBVby8ULW8oBC3Wh57fdujx7kM
	 x62lXXkQvqTsfGg4zkHkFba29UXDQ8NLovmof7nC86zaPpByskzlBQc85ITG+RWG4Fmxy
	 fYFL7rhXaFRrqlJVefr63JHf02gOcgAL9YABOfRa6KSYIqSieg79JseYuqUb1+mysfQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=knuUvCa+;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95B8F606A331;
	Tue,  1 Dec 2026 13:10:30 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C4421F0092C;
	Tue,  1 Dec 2026 13:10:28 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796130629;
	bh=D7VeqERR7suQ8HYoyXM6BC/yUhu5QT86Hepswf53vkQ=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=knuUvCa+ERnk2rRK3g0RQxxLuEnIBy8MaJiOJfDWGXugs2Jt+kO2sV2dmx2K8ON9R
	 s6Rp1fsUEFeZ8QtULA1jg83mGfXf/zwdB+ki6fIQ4bYG80IZO0tk+ZXvzQNgeTT3hi
	 zW2kQ/VpV4IKjs2N0bPE4xpyoaMS7/mHk2cLCof9ADU+qlfgrpe0RQGXS22/fE6FzB
	 /lA794x4RD3q3vFtGECGM4lZE2U85bZ1qltaAWZ95M4MqLwd/hZulQAUh9UHreSDbI
	 XWdFsQS59FOtCkJPJh/jfayYCInpHRto0gc1Zk99eYmIh1716OSr2mdp76E76RqQAs
	 KZD/HN/rEWikw==
X-Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
 pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org,
 andrew+netdev@lunn.ch, razor@blackwall.org, bridge@lists.linux.dev,
 idosch@nvidia.com, aroulin@nvidia.com, mlxsw@nvidia.com, shuah@kernel.org,
 linux-kselftest@vger.kernel.org
X-In-Reply-To: <36a8818d315eaf6de10f97d9f3c691d821664d85.1796041491.git.petrm@nvidia.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list