[net PATCH v2] octeon_ep: Clear VF info at PF when VF driver is removed

Subsystems: networking drivers, the rest

STALE321d

4 messages, 2 authors, 2025-09-17 · open the first message on its own page

[net PATCH v2] octeon_ep: Clear VF info at PF when VF driver is removed

From: Sathesh B Edara <sedara@marvell.com>
Date: 2025-09-16 13:12:48

When a VF (Virtual Function) driver is removed, the PF (Physical Function)
driver continues to retain stale VF-specific information. This can lead to
inconsistencies or unexpected behavior when the VF is re-initialized or
reassigned.

This patch ensures that the PF driver clears the corresponding VF info
when the VF driver is removed, maintaining a clean state and preventing
potential issues.

Fixes: cde29af9e68e ("octeon_ep: add PF-VF mailbox communication")
Signed-off-by: Sathesh B Edara <sedara@marvell.com>
---
Changes:
V2:
  - Commit header format corrected.

 drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c b/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
index ebecdd29f3bd..f2759d2073d1 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
@@ -205,6 +205,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;
-- 
2.36.0

Re: [net PATCH v2] octeon_ep: Clear VF info at PF when VF driver is removed

From: Simon Horman <horms@kernel.org>
Date: 2025-09-17 11:55:47

On Tue, Sep 16, 2025 at 06:12:25AM -0700, Sathesh B Edara wrote:
When a VF (Virtual Function) driver is removed, the PF (Physical Function)
driver continues to retain stale VF-specific information. This can lead to
inconsistencies or unexpected behavior when the VF is re-initialized or
reassigned.

This patch ensures that the PF driver clears the corresponding VF info
when the VF driver is removed, maintaining a clean state and preventing
potential issues.

Fixes: cde29af9e68e ("octeon_ep: add PF-VF mailbox communication")
Signed-off-by: Sathesh B Edara <sedara@marvell.com>
---
Changes:
V2:
  - Commit header format corrected.
Hi,

I feel that I must be missing something terribly obvious.
But this patch seems to be a subset of the one at the link below.

* [net PATCH v2] octeon_ep: fix VF MAC address lifecycle handling
  https://lore.kernel.org/netdev/20250916133207.21737-1-sedara@marvell.com/
quoted hunk
 drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c b/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
index ebecdd29f3bd..f2759d2073d1 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c
@@ -205,6 +205,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;
-- 
2.36.0

RE: [EXTERNAL] Re: [net PATCH v2] octeon_ep: Clear VF info at PF when VF driver is removed

From: Sathesh B Edara <sedara@marvell.com>
Date: 2025-09-17 12:24:50

On Tue, Sep 16, 2025 at 06:12:25AM -0700, Sathesh B Edara wrote:
quoted
When a VF (Virtual Function) driver is removed, the PF (Physical
Function) driver continues to retain stale VF-specific information.
This can lead to inconsistencies or unexpected behavior when the VF is
re-initialized or reassigned.

This patch ensures that the PF driver clears the corresponding VF info
when the VF driver is removed, maintaining a clean state and
preventing potential issues.

Fixes: cde29af9e68e ("octeon_ep: add PF-VF mailbox communication")
Signed-off-by: Sathesh B Edara <sedara@marvell.com>
---
Changes:
V2:
  - Commit header format corrected.
Hi,

I feel that I must be missing something terribly obvious.
But this patch seems to be a subset of the one at the link below.
You're absolutely right — apologies for the confusion. I mistakenly sent the wrong patch and so marked its state as 'Not Applicable'.
 Please disregard this patch.

Re: [EXTERNAL] Re: [net PATCH v2] octeon_ep: Clear VF info at PF when VF driver is removed

From: Simon Horman <horms@kernel.org>
Date: 2025-09-17 14:39:07

On Wed, Sep 17, 2025 at 12:24:22PM +0000, Sathesh B Edara wrote:
quoted
On Tue, Sep 16, 2025 at 06:12:25AM -0700, Sathesh B Edara wrote:
quoted
When a VF (Virtual Function) driver is removed, the PF (Physical
Function) driver continues to retain stale VF-specific information.
This can lead to inconsistencies or unexpected behavior when the VF is
re-initialized or reassigned.

This patch ensures that the PF driver clears the corresponding VF info
when the VF driver is removed, maintaining a clean state and
preventing potential issues.

Fixes: cde29af9e68e ("octeon_ep: add PF-VF mailbox communication")
Signed-off-by: Sathesh B Edara <sedara@marvell.com>
---
Changes:
V2:
  - Commit header format corrected.
Hi,

I feel that I must be missing something terribly obvious.
But this patch seems to be a subset of the one at the link below.
You're absolutely right — apologies for the confusion. I mistakenly sent the wrong patch and so marked its state as 'Not Applicable'.
 Please disregard this patch.
Thanks, understood.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help