* [PATCH net-next] net: macb: implement live mac addr change
@ 2022-11-04 20:48 Roman Gushchin
2022-11-07 6:53 ` Leon Romanovsky
2022-11-08 2:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Roman Gushchin @ 2022-11-04 20:48 UTC (permalink / raw)
To: netdev, Claudiu Beznea, Nicolas Ferre
Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
linux-kernel, Roman Gushchin
Implement live mac addr change for the macb ethernet driver.
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
---
drivers/net/ethernet/cadence/macb_main.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 4f63f1ba3161..991d5041c836 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -2947,6 +2947,18 @@ static int macb_change_mtu(struct net_device *dev, int new_mtu)
return 0;
}
+static int macb_set_mac_addr(struct net_device *dev, void *addr)
+{
+ int err;
+
+ err = eth_mac_addr(dev, addr);
+ if (err < 0)
+ return err;
+
+ macb_set_hwaddr(netdev_priv(dev));
+ return 0;
+}
+
static void gem_update_stats(struct macb *bp)
{
struct macb_queue *queue;
@@ -3786,7 +3798,7 @@ static const struct net_device_ops macb_netdev_ops = {
.ndo_eth_ioctl = macb_ioctl,
.ndo_validate_addr = eth_validate_addr,
.ndo_change_mtu = macb_change_mtu,
- .ndo_set_mac_address = eth_mac_addr,
+ .ndo_set_mac_address = macb_set_mac_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = macb_poll_controller,
#endif
@@ -4049,6 +4061,8 @@ static int macb_init(struct platform_device *pdev)
dev->ethtool_ops = &macb_ethtool_ops;
}
+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
+
/* Set features */
dev->hw_features = NETIF_F_SG;
--
2.37.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: macb: implement live mac addr change
2022-11-04 20:48 [PATCH net-next] net: macb: implement live mac addr change Roman Gushchin
@ 2022-11-07 6:53 ` Leon Romanovsky
2022-11-08 2:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2022-11-07 6:53 UTC (permalink / raw)
To: Roman Gushchin
Cc: netdev, Claudiu Beznea, Nicolas Ferre, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-kernel
On Fri, Nov 04, 2022 at 01:48:37PM -0700, Roman Gushchin wrote:
> Implement live mac addr change for the macb ethernet driver.
>
> Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
> ---
> drivers/net/ethernet/cadence/macb_main.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: macb: implement live mac addr change
2022-11-04 20:48 [PATCH net-next] net: macb: implement live mac addr change Roman Gushchin
2022-11-07 6:53 ` Leon Romanovsky
@ 2022-11-08 2:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-08 2:30 UTC (permalink / raw)
To: Roman Gushchin
Cc: netdev, claudiu.beznea, nicolas.ferre, davem, edumazet, kuba,
pabeni, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 4 Nov 2022 13:48:37 -0700 you wrote:
> Implement live mac addr change for the macb ethernet driver.
>
> Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
> ---
> drivers/net/ethernet/cadence/macb_main.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
Here is the summary with links:
- [net-next] net: macb: implement live mac addr change
https://git.kernel.org/netdev/net-next/c/14ef5c39891e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-08 2:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04 20:48 [PATCH net-next] net: macb: implement live mac addr change Roman Gushchin
2022-11-07 6:53 ` Leon Romanovsky
2022-11-08 2:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).