From nobody Wed Dec 17 07:32:15 2025 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 6C08721146F; Wed, 16 Apr 2025 13:44:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744811097; cv=none; b=GMbxhIvi3Byt9selxqvWwiko/VKDgQQHSv/cs3GbOcvsNRtas8WEemCxB4pMc+NQmOm+6ckm2iQbAfG4rnDW4a3Zo48ZBfRq2ouhGlU9GasXJ1cu/ZEHRKoUxMJG4as+YBl3rDohdMUqyU9YyTrEzd2g6DPHio8HLLeKQvlj6Ic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744811097; c=relaxed/simple; bh=df+71usUeRt26Limx1euNtmayGjcmNOWE6vhlwxoFrI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ByT5OpcAW9U9T5zQUIbw0RC3Ru8HN7TRdhePKHrmZWu69tdVyqMBBKtJVPQk+rLohw5EOEmfPqDjwtx5CKWFKLg+3QI0NHuNNCJsK4c1EXcXkSzX+t38xaekYkdILbD6UT492obypzuuJARqtQ1eTL+VGqPXOj4J1ap0PRAsOUM= 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=ZMgjL+u6; arc=none smtp.client-ip=217.70.183.200 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="ZMgjL+u6" Received: by mail.gandi.net (Postfix) with ESMTPSA id 8439C4390E; Wed, 16 Apr 2025 13:44:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744811086; 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=QkwnrTW3AGm6/c1sg2YnWGt1nX5AkVzIP4B2TZQ9DJs=; b=ZMgjL+u6kSWTFWUakWTa9lFhDrLTC+LH3YTQ89NLY+U0XOb1Jd3W+/tJmR4tvdTXt/tHPd g6tWDp8dPMkI3rCOu/sZBr1cBy5Ih+IomFPDkA7e/USzP4px+ZgQlJ1UEzXAsET0JDjUJM 3OpIHH4fCJwf3WaeLQZgoi831WGVOJ6ab533abZuefQxZlzhHQz9Zgcp7tAOkL9R3rvKiE wfjJg+NVjU5Sg3By/ptIJudz64GubweZak2RDGoex0wukgxsp+kQGr3x7UOMKPRkrVe8hk 2o9d6OVKfNeAJKVgDbl488fFwQWsLNn4RRCi470+9e55OEgyTVCAE+5wMbcGnw== From: Kory Maincent Date: Wed, 16 Apr 2025 15:44:16 +0200 Subject: [PATCH net-next v8 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: <20250416-feature_poe_port_prio-v8-1-446c39dc3738@bootlin.com> References: <20250416-feature_poe_port_prio-v8-0-446c39dc3738@bootlin.com> In-Reply-To: <20250416-feature_poe_port_prio-v8-0-446c39dc3738@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: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdeiheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeenucfhrhhomhepmfhorhihucforghinhgtvghnthcuoehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeevgfdvgfektefgfefggeekudfggffhtdfffedtueetheejtddvledvvdelhedtveenucfkphepledtrdekledrudeifedruddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeltddrkeelrdduieefrdduvdejpdhhvghloheplgduvdejrddtrddurddungdpmhgrihhlfhhrohhmpehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvjedprhgtphhtthhopehrohgshheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegurghvvghmsegurghvvghmlhhofhhtrdhnvghtpdhrtghpthhtohephhhkrghllhifvghithdusehgmhgrihhlrdgtohhmpdhrtghpthhtohepkhgvrhhnvghlsehpvghnghhuthhrohhnihigrdguvgdprhgtphhtthhopehhohhrmhhssehkvghrn hgvlhdrohhrghdprhgtphhtthhopehordhrvghmphgvlhesphgvnhhguhhtrhhonhhigidruggvpdhrtghpthhtohepughonhgrlhgurdhhuhhnthgvrhesghhmrghilhdrtghomh 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) Reviewed-by: Oleksij Rempel --- 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 977beeaaa2f9..4e8cdc070291 100644 --- a/net/ethtool/netlink.c +++ b/net/ethtool/netlink.c @@ -770,7 +770,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], @@ -840,6 +840,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