From nobody Tue Feb 10 09:58:27 2026 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7504B18784A; Tue, 8 Apr 2025 14:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744122764; cv=none; b=DiwY7rVnF9Q39qa4/W8CoFMhXTNI1JyWlu4965v86xGOUiOxIGfdVh5E//kIFVLzMclQhAOstpmBfphulsr5ZDautmfWLj5y2Pok8+GV8WoJhvBpKvi1Qf+92e3CJuB17yHv6FxHLcvFamDUKnkDNLr9NhjR7UGOa/hNEY/oufI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744122764; c=relaxed/simple; bh=2IzeeJjzK/oltC0Tf05JtTXe+LT1f0/5nYgueblLEwI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OFcjrD2cs4VgtX/S5AebxySEPi3xm+kQ+KmX614hVj/1P4fkgC2VEQEgDR4L/Pil2OAH77MJHTo9iF6Q9sBLZ83LvPWZda9cU5svlRcuqoJyuHXFJX9d8HXR9KQJnjoxKs+SdHdevnSndHAFkufpX286FAV/0SwxPbdGaBsSX2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=gY0LVSL8; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="gY0LVSL8" Received: by mail.gandi.net (Postfix) with ESMTPSA id 39810441BF; Tue, 8 Apr 2025 14:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744122754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1zGOv6ApdajX/tkIHkaB/u2JQAUI8IB8rFk0O3gWTbU=; b=gY0LVSL8XLDgWT8RHOu+Vaf3hAW7dFcauVBVXQk6yX04YlKWJKnFBJzhWDN38ZsDoUCQB5 KHhZm3ncFSURZzwhmxi0UGzUCLNNjD9i3xTVT4j9GLvJF6JRuVtq3HwOTF46jQd6PE3OiX JDeQeMkz9xYb5qXTc3QHKtM/7Q3ZMS9UyAc4Q0YHbPplMI18Mnv84TivZml3rHD+Mpv4gN 1kFzrO05SBQ8KtsZpCFQZl7dNZZD5fISZAvWTQrjoyI3k8KaWO3Qqh6ZIxgNddZdqQ1A7G PkXyKbmTOSM4oF7hBvRtfIFULo/YhM2I4EegkDVhIL0fpIqaV37yg7ZpVUdKVA== From: Kory Maincent Date: Tue, 08 Apr 2025 16:32:10 +0200 Subject: [PATCH net-next v7 01/13] net: ethtool: Add support for ethnl_info_init_ntf helper function Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250408-feature_poe_port_prio-v7-1-9f5fc9e329cd@bootlin.com> References: <20250408-feature_poe_port_prio-v7-0-9f5fc9e329cd@bootlin.com> In-Reply-To: <20250408-feature_poe_port_prio-v7-0-9f5fc9e329cd@bootlin.com> To: Andrew Lunn , Oleksij Rempel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Donald Hunter , Rob Herring , Andrew Lunn , Simon Horman , Heiner Kallweit , Russell King , Krzysztof Kozlowski , Conor Dooley Cc: Liam Girdwood , Mark Brown , Thomas Petazzoni , netdev@vger.kernel.org, linux-doc@vger.kernel.org, Kyle Swenson , Dent Project , kernel@pengutronix.de, Maxime Chevallier , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Kory Maincent (Dent Project)" X-Mailer: b4 0.15-dev-8cb71 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdeffeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepmfhorhihucforghinhgtvghnthcuoehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeevgfdvgfektefgfefggeekudfggffhtdfffedtueetheejtddvledvvdelhedtveenucfkphepledtrdekledrudeifedruddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeltddrkeelrdduieefrdduvdejpdhhvghloheplgduvdejrddtrddurddungdpmhgrihhlfhhrohhmpehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvjedprhgtphhtthhopeguvghvihgtvghtrhgvvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehkhihlvgdrshifvghnshhonhesvghsthdrthgvtghhpdhrtghpthhtohepsghrohhonhhivgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepughonhgrlhgurdhhuhhnthgvrhesghhmrghilhdrtghomhdprhgtphhtthhopehordhrvghmphgvlhesphgvnhhguhhtrhhonhhig idruggvpdhrtghpthhtoheplhhinhhugidqughotgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmpdhrtghpthhtohepmhgrgihimhgvrdgthhgvvhgrlhhlihgvrhessghoohhtlhhinhdrtghomh X-GND-Sasl: kory.maincent@bootlin.com From: Kory Maincent (Dent Project) Introduce support for the ethnl_info_init_ntf helper function to enable initialization of ethtool notifications outside of the netlink.c file. This change allows for more flexible notification handling. Signed-off-by: Kory Maincent (Dent Project) --- Changes in v4: - Use the new helper in ethnl_default_notify function. Changes in v2: - new patch. --- net/ethtool/netlink.c | 7 ++++++- net/ethtool/netlink.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c index a163d40c6431..970bd115b40d 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -769,7 +769,7 @@ static void ethnl_default_notify(struct net_device *dev= , unsigned int cmd, int reply_len; int ret; =20 - genl_info_init_ntf(&info, ðtool_genl_family, cmd); + ethnl_info_init_ntf(&info, cmd); =20 if (WARN_ONCE(cmd > ETHTOOL_MSG_KERNEL_MAX || !ethnl_default_notify_ops[cmd], @@ -838,6 +838,11 @@ static void ethnl_default_notify(struct net_device *de= v, unsigned int cmd, typedef void (*ethnl_notify_handler_t)(struct net_device *dev, unsigned in= t cmd, const void *data); =20 +void ethnl_info_init_ntf(struct genl_info *info, u8 cmd) +{ + genl_info_init_ntf(info, ðtool_genl_family, cmd); +} + static const ethnl_notify_handler_t ethnl_notify_handlers[] =3D { [ETHTOOL_MSG_LINKINFO_NTF] =3D ethnl_default_notify, [ETHTOOL_MSG_LINKMODES_NTF] =3D ethnl_default_notify, diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h index ec6ab5443a6f..4d4ad3824bbb 100644 --- a/net/ethtool/netlink.h +++ b/net/ethtool/netlink.h @@ -323,6 +323,8 @@ struct ethnl_sock_priv { int ethnl_sock_priv_set(struct sk_buff *skb, struct net_device *dev, u32 p= ortid, enum ethnl_sock_type type); =20 +void ethnl_info_init_ntf(struct genl_info *info, u8 cmd); + /** * struct ethnl_request_ops - unified handling of GET and SET requests * @request_cmd: command id for request (GET) --=20 2.34.1