Skip to content

Commit a72175c

Browse files
Sathesh B Edarakuba-moo
authored andcommitted
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. Fixes: cde29af ("octeon_ep: add PF-VF mailbox communication") Signed-off-by: Sathesh B Edara <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent dc5f94b commit a72175c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ static void octep_pfvf_get_mac_addr(struct octep_device *oct, u32 vf_id,
196196
vf_id);
197197
return;
198198
}
199+
ether_addr_copy(oct->vf_info[vf_id].mac_addr, rsp->s_set_mac.mac_addr);
199200
rsp->s_set_mac.type = OCTEP_PFVF_MBOX_TYPE_RSP_ACK;
200201
}
201202

@@ -205,6 +206,8 @@ static void octep_pfvf_dev_remove(struct octep_device *oct, u32 vf_id,
205206
{
206207
int err;
207208

209+
/* Reset VF-specific information maintained by the PF */
210+
memset(&oct->vf_info[vf_id], 0, sizeof(struct octep_pfvf_info));
208211
err = octep_ctrl_net_dev_remove(oct, vf_id);
209212
if (err) {
210213
rsp->s.type = OCTEP_PFVF_MBOX_TYPE_RSP_NACK;

0 commit comments

Comments
 (0)