πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14056

Re: [PATCH net-next 4/5] net: rnpgbe: Allow changing the primary MAC address

#14056
From: netdev-bot+sashiko
Date: Tue, 10 Nov 2026 16:55
65 lines
10402 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 commit 'net: rnpgbe: Allow changing the primary MAC address'
  adds two entries to rnpgbe_netdev_ops in…

--

net: rnpgbe: Allow changing the primary MAC address

This commit adds ndo_set_mac_address support to the rnpgbe driver, so the
primary MAC address can be changed while the interface is up or down. The
new address is validated with eth_prepare_mac_addr_change(), written to
RAR 0, and then committed to the netdev.

> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
> index 31871b244882d..09d499dc10eeb 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
> @@ -160,6 +160,8 @@ static const struct net_device_ops rnpgbe_netdev_ops = {
>  	.ndo_stop		 = rnpgbe_close,
>  	.ndo_start_xmit		 = rnpgbe_xmit_frame,
>  	.ndo_set_rx_mode_async = rnpgbe_set_rx_mode,
>  	.ndo_set_mac_address	 = rnpgbe_set_mac_address,
> +	.ndo_validate_addr	 = eth_validate_addr,

[Severity: Low]
This isn't a bug, but should the commit message also mention the
ndo_validate_addr hook added to rnpgbe_netdev_ops?

The commit message only covers ndo_set_mac_address:

  Add ndo_set_mac_address support to change the primary MAC address
  while the interface is up or down. Validate the new address with the
  standard Ethernet helpers, then update the primary receive address
  filter and the netdev address.

The "Validate the new address" sentence refers to the
eth_prepare_mac_addr_change() call in rnpgbe_set_mac_address().

eth_validate_addr is a separate change. __dev_open() calls it on every
ifup, so opening the device can now fail with -EADDRNOTAVAIL if
netdev->dev_addr is not a valid unicast address. Before this patch, open
did no such check.

As far as I can tell this check cannot fire today. In
rnpgbe_add_adapter(), probe either sets a firmware MAC that has already
passed is_valid_ether_addr() in rnpgbe_get_permanent_mac(), or it falls
back to eth_hw_addr_random(). After probe, rnpgbe_set_mac_address()
rejects invalid addresses.

Could the commit message mention the open-time validation, or could the
hook move to its own patch?

>  	.ndo_get_stats64	 = rnpgbe_get_stats64,
>  };

[ ... ]

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/FB722C2F25FE9005%2B20261106112420.43050-1-dong100%40mucse.com
Technical Details
Message-ID: <179432970545.994134.2511152521699003993@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360451-linux-kernel-netdev=dewy.ru
References: <425F4F0858D134DD+20261106112544.44210-1-dong100@mucse.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360451-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 4/5] net: rnpgbe: Allow changing the primary MAC address
Date: Tue, 10 Nov 2026 16:55:05 +0000
Organization: Usenet Network
Message-ID: <179432970545.994134.2511152521699003993@kernel.org>
References: <425F4F0858D134DD+20261106112544.44210-1-dong100@mucse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="657127"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:iHgCfVQpWTMWFepNO+piliIZGCs= sha256:CLsnK6duXESe/AOyBCnS0BH7fXNuvLnT8vLWkGhwD2o=
	sha1:afk8apKqstOwvEV2UDvHSaxJgmA= sha256:jt5l5oD2pwZEVoFYRHNCJimjRCGrgBzGse49262Y+1w=
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 89C99113C71; Tue, 10 Nov 2026 20:12:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[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 6e6K29YuRbtp;
	Tue, 10 Nov 2026 20:12:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-360451-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 75B58113C73; Tue, 10 Nov 2026 20:11:55 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 58662666131; Tue, 10 Nov 2026 16:56:30 +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=1794329708;
	b=zHmvail+Fpma5BQ8h2v4ulfZAJWSCOnZi24fEFb0e0v31it77LyQB9pZ5Pgbz0IZ9+LP
	 RqF/GQuK7aUESttljvtDqSLKZMZrwC/c6QPzpq1UWoxR6rdvUA4VoUNmlY1m8Ifxo/BaC
	 U3Gdd0cP1bclxWroLO8Wf7cjfysikjskHSP6HNj7DHwbJqQtAVky7q9q9NJHq30f3NGdE
	 kmCNY6ql67UOvRZPQ6qZsfo2PTYgIXp7GIOP7ithnCpnZ053hfZQB9M0MYUWz9VeFlPKm
	 ovbmD2+ExxPv72cz4nNvSSyAiJ/ZwEKxY0a0LjD8/Aq3FyiCPpzXFKc36U0M82XoaMg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794329708;
	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=md+g1Mn70lLLdOLh0WK7BFL83o0AsS7eFKgJ4bZ+xOc=;
	b=26WTxWBBSWf8RaP6bNXE299/bSZd0i0600Rgmy/P41gY2oe+flagdE5yD/Ei0p0TpsPp
	 kMUQ7ZkyO93OP1PTCdW/cwySWA2RP/6mfclE2HITYGbT88H0b1CiIJjY039ID8V14oVYJ
	 s0Xn2M9F9QHcwGYzOwEZpky3fgKRm4OEibV8RJhcThmKlM6RC1vBFwywQjGE7jr6WiQfc
	 5nmvxx3oLB5ICKuvo0774oZQoFVbLm9VQd8oxDDF1Q5efQYwa4RTK+Uabk1ynSOqZ5tIK
	 6eAu1AiHxmMKWN3KupqE15e0tMWPSk9fU5EpaaeCWSayt4VQXZvIh20x6g3ViMPhyHw==
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=Ru3DSI1J;
	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 EE63D60A381D;
	Tue, 10 Nov 2026 16:55:07 +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=Ru3DSI1J
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=1794329707;
	b=jMNJ2Vk1svpqZvsB7n1akCnBibmrHdQpvH3u1wGMWDmYk0gcT4E8iRZ0sr+dyDk0cUxF
	 sdbrer/e+UtHkYsQb9420wWIiiz/wVdZsv2+5/7oXTIX4x4aU9eXYdLnIe0hSVYFmJkdf
	 5HoknrQPAfpEA5cU6gBkY5CYUUgGr6N6mdqMaHQaQ84yKn8rb9IcxJ5O8pdKywEM7zqDk
	 G+jwlYj7bRvLNf5rqcaINVTqvXgfzB9z0G2ZV72pocsx2TsCD2bsuVmrNPFDIJrnC6Udh
	 k/+wUEbbHFBZz2/aTLZH/F9qAv57RdACUCMsWj3ykLTUIbOT3E2xSbZBux6Mi5fgDtg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794329707;
	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=md+g1Mn70lLLdOLh0WK7BFL83o0AsS7eFKgJ4bZ+xOc=;
	b=ISQX0M7vqUfNVg+uPcBTKJbqzVRvm/kJ9jhTO72VnRtfv/4b6dKbd9aoxcczNJCsLU9E
	 6YkNg0V/EeAhDuIn5pPj9ZRynOe76/FUgSnel/8OC3YaQ6n+S3M4JclqFUAVhgu6mKfsp
	 9n7oUd1RS62b7cbB+PmtbzJ6pc0y1iXOv+o6F8SVNjFEq9XlqoGWg7GN1qupv+whSh/Gd
	 hVfsps9VjvK62fNFx6zQAFBzEV9u9q6HTAeC8A1p/gDFcBx3JfCVirP2wpDyUicemJpql
	 sJyWCOuG1A0NPmNPe0fD5eBMzOyRotOH49nuAS/zeVlj+eL6sGrXKqxeIanugfdFg6w==
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=Ru3DSI1J;
	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 D098360A263E;
	Tue, 10 Nov 2026 16:55:06 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E48A61F008A2;
	Tue, 10 Nov 2026 16:55:05 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794329706;
	bh=md+g1Mn70lLLdOLh0WK7BFL83o0AsS7eFKgJ4bZ+xOc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Ru3DSI1JtOvz1pz0p79Q21P9c/g0n6OobX9gSnI2to6yPqXyqv7OClz0s5fQ/RafU
	 Ar5W8KAQkdNyinf3mYJre4tTQkvbrHXpVQ5t+AmEdfcmOMSEFxKH1DIWwZg8x5NdF6
	 wC5JpNUEqCRrl5tl91d+CyoB/rwVuArrsutgzHGAPWdhKQ9OwSlhnh6UYN5fr1TvDQ
	 IoSpAp9Epowf9ReFqyFY9hZtRZStY/T2cqbcdDWr2LJKCGDlf56uZJ5S+wtEh7vEKC
	 h5aKWMYotcL65pKD29f9mGsW4Wo4wTzLlVym0byZox/2z1Tv2D4ei7gWuM3M8mcI6m
	 R05podtcK/jdg==
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
 linux-kernel@vger.kernel.org, netdev@vger.kernel.org, yaojun@mucse.com
X-In-Reply-To: <425F4F0858D134DD+20261106112544.44210-1-dong100@mucse.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