* [PATCH net] ionic: fix persistent MAC address override on PF
@ 2026-03-17 17:08 mheib
2026-03-19 16:25 ` Simon Horman
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: mheib @ 2026-03-17 17:08 UTC (permalink / raw)
To: netdev
Cc: mohamed, brett.creeley, andrew+netdev, davem, edumazet, kuba,
pabeni, sln, Mohammad Heib
From: Mohammad Heib <mheib@redhat.com>
The use of IONIC_CMD_LIF_SETATTR in the MAC address update path causes
the ionic firmware to update the LIF's identity in its persistent state.
Since the firmware state is maintained across host warm boots and driver
reloads, any MAC change on the Physical Function (PF) becomes "sticky.
This is problematic because it causes ethtool -P to report the
user-configured MAC as the permanent factory address, which breaks
system management tools that rely on a stable hardware identity.
While Virtual Functions (VFs) need this hardware-level programming to
properly handle MAC assignments in guest environments, the PF should
maintain standard transient behavior. This patch gates the
ionic_program_mac call using is_virtfn so that PF MAC changes remain
local to the netdev filters and do not overwrite the firmware's
permanent identity block.
Fixes: 19058be7c48c ("ionic: VF initial random MAC address if no assigned mac")
Signed-off-by: Mohammad Heib <mheib@redhat.com>
---
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index 8d040e611d5a..637e635bbf03 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -1719,13 +1719,18 @@ static int ionic_set_mac_address(struct net_device *netdev, void *sa)
if (ether_addr_equal(netdev->dev_addr, mac))
return 0;
- err = ionic_program_mac(lif, mac);
- if (err < 0)
- return err;
+ /* Only program macs for virtual functions to avoid losing the permanent
+ * Mac across warm reset/reboot.
+ */
+ if (lif->ionic->pdev->is_virtfn) {
+ err = ionic_program_mac(lif, mac);
+ if (err < 0)
+ return err;
- if (err > 0)
- netdev_dbg(netdev, "%s: SET and GET ATTR Mac are not equal-due to old FW running\n",
- __func__);
+ if (err > 0)
+ netdev_dbg(netdev, "%s: SET and GET ATTR Mac are not equal-due to old FW running\n",
+ __func__);
+ }
err = eth_prepare_mac_addr_change(netdev, addr);
if (err)
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] ionic: fix persistent MAC address override on PF
2026-03-17 17:08 [PATCH net] ionic: fix persistent MAC address override on PF mheib
@ 2026-03-19 16:25 ` Simon Horman
2026-03-19 16:44 ` Creeley, Brett
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2026-03-19 16:25 UTC (permalink / raw)
To: mheib
Cc: netdev, mohamed, brett.creeley, andrew+netdev, davem, edumazet,
kuba, pabeni, sln
On Tue, Mar 17, 2026 at 07:08:06PM +0200, mheib@redhat.com wrote:
> From: Mohammad Heib <mheib@redhat.com>
>
> The use of IONIC_CMD_LIF_SETATTR in the MAC address update path causes
> the ionic firmware to update the LIF's identity in its persistent state.
> Since the firmware state is maintained across host warm boots and driver
> reloads, any MAC change on the Physical Function (PF) becomes "sticky.
>
> This is problematic because it causes ethtool -P to report the
> user-configured MAC as the permanent factory address, which breaks
> system management tools that rely on a stable hardware identity.
>
> While Virtual Functions (VFs) need this hardware-level programming to
> properly handle MAC assignments in guest environments, the PF should
> maintain standard transient behavior. This patch gates the
> ionic_program_mac call using is_virtfn so that PF MAC changes remain
> local to the netdev filters and do not overwrite the firmware's
> permanent identity block.
>
> Fixes: 19058be7c48c ("ionic: VF initial random MAC address if no assigned mac")
> Signed-off-by: Mohammad Heib <mheib@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] ionic: fix persistent MAC address override on PF
2026-03-17 17:08 [PATCH net] ionic: fix persistent MAC address override on PF mheib
2026-03-19 16:25 ` Simon Horman
@ 2026-03-19 16:44 ` Creeley, Brett
2026-03-19 18:11 ` Creeley, Brett
2026-03-19 22:50 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Creeley, Brett @ 2026-03-19 16:44 UTC (permalink / raw)
To: mheib, netdev
Cc: mohamed, brett.creeley, andrew+netdev, davem, edumazet, kuba,
pabeni, sln
On 3/17/2026 10:08 AM, mheib@redhat.com wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> From: Mohammad Heib <mheib@redhat.com>
>
> The use of IONIC_CMD_LIF_SETATTR in the MAC address update path causes
> the ionic firmware to update the LIF's identity in its persistent state.
> Since the firmware state is maintained across host warm boots and driver
> reloads, any MAC change on the Physical Function (PF) becomes "sticky.
>
> This is problematic because it causes ethtool -P to report the
> user-configured MAC as the permanent factory address, which breaks
> system management tools that rely on a stable hardware identity.
>
> While Virtual Functions (VFs) need this hardware-level programming to
> properly handle MAC assignments in guest environments, the PF should
> maintain standard transient behavior. This patch gates the
> ionic_program_mac call using is_virtfn so that PF MAC changes remain
> local to the netdev filters and do not overwrite the firmware's
> permanent identity block.
>
> Fixes: 19058be7c48c ("ionic: VF initial random MAC address if no assigned mac")
> Signed-off-by: Mohammad Heib <mheib@redhat.com>
> ---
> drivers/net/ethernet/pensando/ionic/ionic_lif.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> index 8d040e611d5a..637e635bbf03 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> @@ -1719,13 +1719,18 @@ static int ionic_set_mac_address(struct net_device *netdev, void *sa)
> if (ether_addr_equal(netdev->dev_addr, mac))
> return 0;
>
> - err = ionic_program_mac(lif, mac);
> - if (err < 0)
> - return err;
> + /* Only program macs for virtual functions to avoid losing the permanent
> + * Mac across warm reset/reboot.
> + */
> + if (lif->ionic->pdev->is_virtfn) {
> + err = ionic_program_mac(lif, mac);
> + if (err < 0)
> + return err;
>
> - if (err > 0)
> - netdev_dbg(netdev, "%s: SET and GET ATTR Mac are not equal-due to old FW running\n",
> - __func__);
> + if (err > 0)
> + netdev_dbg(netdev, "%s: SET and GET ATTR Mac are not equal-due to old FW running\n",
> + __func__);
> + }
I just got back from PTO. I am looking at this and will respond/review ASAP.
Thanks,
Brett
>
> err = eth_prepare_mac_addr_change(netdev, addr);
> if (err)
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] ionic: fix persistent MAC address override on PF
2026-03-17 17:08 [PATCH net] ionic: fix persistent MAC address override on PF mheib
2026-03-19 16:25 ` Simon Horman
2026-03-19 16:44 ` Creeley, Brett
@ 2026-03-19 18:11 ` Creeley, Brett
2026-03-19 22:50 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Creeley, Brett @ 2026-03-19 18:11 UTC (permalink / raw)
To: mheib, netdev
Cc: mohamed, brett.creeley, andrew+netdev, davem, edumazet, kuba,
pabeni, sln
On 3/17/2026 10:08 AM, mheib@redhat.com wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>
>
> From: Mohammad Heib <mheib@redhat.com>
>
> The use of IONIC_CMD_LIF_SETATTR in the MAC address update path causes
> the ionic firmware to update the LIF's identity in its persistent state.
> Since the firmware state is maintained across host warm boots and driver
> reloads, any MAC change on the Physical Function (PF) becomes "sticky.
>
> This is problematic because it causes ethtool -P to report the
> user-configured MAC as the permanent factory address, which breaks
> system management tools that rely on a stable hardware identity.
>
> While Virtual Functions (VFs) need this hardware-level programming to
> properly handle MAC assignments in guest environments, the PF should
> maintain standard transient behavior. This patch gates the
> ionic_program_mac call using is_virtfn so that PF MAC changes remain
> local to the netdev filters and do not overwrite the firmware's
> permanent identity block.
>
> Fixes: 19058be7c48c ("ionic: VF initial random MAC address if no assigned mac")
> Signed-off-by: Mohammad Heib <mheib@redhat.com>
> ---
> drivers/net/ethernet/pensando/ionic/ionic_lif.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> index 8d040e611d5a..637e635bbf03 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> @@ -1719,13 +1719,18 @@ static int ionic_set_mac_address(struct net_device *netdev, void *sa)
> if (ether_addr_equal(netdev->dev_addr, mac))
> return 0;
>
> - err = ionic_program_mac(lif, mac);
> - if (err < 0)
> - return err;
> + /* Only program macs for virtual functions to avoid losing the permanent
> + * Mac across warm reset/reboot.
> + */
> + if (lif->ionic->pdev->is_virtfn) {
> + err = ionic_program_mac(lif, mac);
> + if (err < 0)
> + return err;
>
> - if (err > 0)
> - netdev_dbg(netdev, "%s: SET and GET ATTR Mac are not equal-due to old FW running\n",
> - __func__);
> + if (err > 0)
> + netdev_dbg(netdev, "%s: SET and GET ATTR Mac are not equal-due to old FW running\n",
> + __func__);
> + }
LGTM. Thanks for the fix!
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Brett
>
> err = eth_prepare_mac_addr_change(netdev, addr);
> if (err)
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] ionic: fix persistent MAC address override on PF
2026-03-17 17:08 [PATCH net] ionic: fix persistent MAC address override on PF mheib
` (2 preceding siblings ...)
2026-03-19 18:11 ` Creeley, Brett
@ 2026-03-19 22:50 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-19 22:50 UTC (permalink / raw)
To: mohammad heib
Cc: netdev, mohamed, brett.creeley, andrew+netdev, davem, edumazet,
kuba, pabeni, sln
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 17 Mar 2026 19:08:06 +0200 you wrote:
> From: Mohammad Heib <mheib@redhat.com>
>
> The use of IONIC_CMD_LIF_SETATTR in the MAC address update path causes
> the ionic firmware to update the LIF's identity in its persistent state.
> Since the firmware state is maintained across host warm boots and driver
> reloads, any MAC change on the Physical Function (PF) becomes "sticky.
>
> [...]
Here is the summary with links:
- [net] ionic: fix persistent MAC address override on PF
https://git.kernel.org/netdev/net/c/cbcb3cfcdc43
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] 5+ messages in thread
end of thread, other threads:[~2026-03-19 22:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 17:08 [PATCH net] ionic: fix persistent MAC address override on PF mheib
2026-03-19 16:25 ` Simon Horman
2026-03-19 16:44 ` Creeley, Brett
2026-03-19 18:11 ` Creeley, Brett
2026-03-19 22:50 ` 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