octeon_ep: fix VF MAC address lifecycle handling
Subsystems (3)
Sathesh B Edara
maintainerPATCH v2 1/1 octeon_ep: fix VF MAC address lifecycle handling
Currently, VF MAC address info is not updated when the MAC address is configured from VF, and it is not cleared when the VF is removed. This leads to stale or missing MAC information in the PF, which may cause incorrect state tracking or inconsistencies when VFs are hot-plugged or reassigned.
Fix this by:
- storing the VF MAC address in the PF when it is set from VF
- clearing the stored VF MAC address when the VF is removed
This ensures that the PF always has correct VF MAC state.
---
Changes:
V2:
- Commit header format corrected.
drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c +3 -0
@@ -196,6 +196,7 @@ static void octep_pfvf_get_mac_addr(struct octep_device *oct, u32 vf_id, vf_id);return ; } +ether_addr_copy (oct->vf_info[vf_id].mac_addr, rsp->s_set_mac.mac_addr); rsp->s_set_mac.type =OCTEP_PFVF_MBOX_TYPE_RSP_ACK ; }
@@ -205,6 +206,8 @@ static void octep_pfvf_dev_remove(struct octep_device *oct, u32 vf_id, {int err; +/* Reset VF-specific information maintained by the PF */ +memset (&oct->vf_info[vf_id],0 ,sizeof (struct octep_pfvf_info )); err =octep_ctrl_net_dev_remove (oct, vf_id);if (err) { rsp->s.type =OCTEP_PFVF_MBOX_TYPE_RSP_NACK ;
Signature · 1 line
2.36.0
Quoted 10 lines · Sathesh B Edara
Currently, VF MAC address info is not updated when the MAC address is configured from VF, and it is not cleared when the VF is removed. This leads to stale or missing MAC information in the PF, which may cause incorrect state tracking or inconsistencies when VFs are hot-plugged or reassigned.
Fix this by:
- storing the VF MAC address in the PF when it is set from VF
- clearing the stored VF MAC address when the VF is removed
Quoted 8 lines
This ensures that the PF always has correct VF MAC state.
Fixes cde29af9e68e ("octeon_ep: add PF-VF mailbox communication")Signed-off-by Sathesh B Edara <[email protected]>---
Changes:
V2:
- Commit header format corrected.
Thanks for the update.
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Tue, 16 Sep 2025 06:32:07 -0700 you wrote:
Currently, VF MAC address info is not updated when the MAC address is configured from VF, and it is not cleared when the VF is removed. This leads to stale or missing MAC information in the PF, which may cause incorrect state tracking or inconsistencies when VFs are hot-plugged or reassigned.
Fix this by:
- storing the VF MAC address in the PF when it is set from VF
- clearing the stored VF MAC address when the VF is removed[...]
Here is the summary with links:
- [net,v2] octeon_ep: fix VF MAC address lifecycle handling
https://git.kernel.org/netdev/net/c/a72175c98513
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html