Skip to contentSkip to conversation

octeontx2-af: Send Link events one by one

PATCH Applied Subbaraya Sundeep 4 participants 4 messages May 21, 2025 – May 26, 2025

Subsystems (3)
lore
Share & tools
lore

Subbaraya Sundeep

author maintainer
#0 lore raw

PATCH v3 1/1 octeontx2-af: Send Link events one by one

Send link events one after another otherwise new message is overwriting the message which is being processed by PF.

Fixes a88e0f936ba9 ("octeontx2: Detect the mbox up or down message via register")

---
v3:
Modifid to wait for response at other places mcs_notify_pfvf and rvu_rep_up_notify as suggested by Simon Hormon and Michal Swiatkowski.
v2:
No changes. Added subject prefix net.

 drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c | 2 ++
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c    | 2 ++
 drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c    | 2 ++
 3 files changed, 6 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c +2 -0
index 655dd47..0277d22 100644
@@ -143,6 +143,8 @@ static int mcs_notify_pfvf(struct mcs_intr_event *event, struct rvu *rvu)
 
 	otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pf);
 
+	otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pf);
+
 	mutex_unlock(&rvu->mbox_lock);
 
 	return 0;
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +2 -0
index 992fa0b..ebb56eb 100644
@@ -272,6 +272,8 @@ static void cgx_notify_pfs(struct cgx_link_event *event, struct rvu *rvu)
 
 		otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pfid);
 
+		otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pfid);
+
 		mutex_unlock(&rvu->mbox_lock);
 	} while (pfmap);
 }
drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c +2 -0
index 052ae59..32953cc 100644
@@ -60,6 +60,8 @@ static int rvu_rep_up_notify(struct rvu *rvu, struct rep_event *event)
 
 	otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pf);
 
+	otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pf);
+
 	mutex_unlock(&rvu->mbox_lock);
 	return 0;
 }
Signature · 1 line
2.7.4
Reviewed-by on v3 1/1
#1 lore raw
Quoted 48 lines · Subbaraya Sundeep

Send link events one after another otherwise new message is overwriting the message which is being processed by PF.

Fixes a88e0f936ba9 ("octeontx2: Detect the mbox up or down message via register")

---
v3:
Modifid to wait for response at other places mcs_notify_pfvf and rvu_rep_up_notify as suggested by Simon Hormon and Michal Swiatkowski.
v2:
No changes. Added subject prefix net.

 drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c | 2 ++
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c    | 2 ++
 drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c    | 2 ++
 3 files changed, 6 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/mcs_rvu_if.c +2 -0
index 655dd47..0277d22 100644
@@ -143,6 +143,8 @@ static int mcs_notify_pfvf(struct mcs_intr_event *event, struct rvu *rvu)
 
 	otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pf);
 
+	otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pf);
+
 	mutex_unlock(&rvu->mbox_lock);
 
 	return 0;
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +2 -0
index 992fa0b..ebb56eb 100644
@@ -272,6 +272,8 @@ static void cgx_notify_pfs(struct cgx_link_event *event, struct rvu *rvu)
 
 		otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pfid);
 
+		otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pfid);
+
 		mutex_unlock(&rvu->mbox_lock);
 	} while (pfmap);
 }
drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c +0 -0
index 052ae59..32953cc 100644

drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c static int rvu_rep_up_notify(struct rvu *rvu, struct rep_event *event) · line 66

Quoted 7 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c +2 -0
@@ -60,6 +60,8 @@ static int rvu_rep_up_notify(struct rvu *rvu, struct rep_event *event)
 
 	otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pf);
 
+	otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pf);
+
 	mutex_unlock(&rvu->mbox_lock);
 	return 0;

Thanks for the change

Quoted 4 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c +0 -0
 }
Signature · 1 line
2.7.4
reviewer Reviewed-by on v3 1/1
#2 lore raw
In reply to Subbaraya Sundeep
Quoted 11 lines · Subbaraya Sundeep

Send link events one after another otherwise new message is overwriting the message which is being processed by PF.

Fixes a88e0f936ba9 ("octeontx2: Detect the mbox up or down message via register")

---
v3:
Modifid to wait for response at other places mcs_notify_pfvf and rvu_rep_up_notify as suggested by Simon Hormon and Michal Swiatkowski.
v2:
No changes. Added subject prefix net.

#3 lore raw
In reply to Subbaraya Sundeep
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 5 lines · On Wed, 21 May 2025 16:00:43 +0530 you wrote:

Send link events one after another otherwise new message is overwriting the message which is being processed by PF.

Fixes a88e0f936ba9 ("octeontx2: Detect the mbox up or down message via register")
Quoted 8 lines

---
v3:
Modifid to wait for response at other places mcs_notify_pfvf and rvu_rep_up_notify as suggested by Simon Hormon and Michal Swiatkowski.
v2:
No changes. Added subject prefix net.

[...]

Here is the summary with links:
- [net,v3] octeontx2-af: Send Link events one by one

    https://git.kernel.org/netdev/net/c/ba5cb47b56e5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html