Commit 9bdc47a6 authored by Tomasz Duszynski's avatar Tomasz Duszynski Committed by David S. Miller

octeontx2-af: Mbox communication support btw AF and it's VFs

VFs attached to PFs other than AF can not communicate with AF
directly. Instead they are supposed to first send message to
the PF they are residing on and PF forwards it to the AF.
Responses to messages are handled in the reverse order.

On the other hand if VFs are on AF (PF0) itself then direct mailbox
communication is possible since there's no other PF in the way.

This patch addresses this particular case and adds support for
handling it.
Signed-off-by: default avatarTomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: default avatarMarko Kallio <mkallio@marvell.com>
Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c554f9c1
...@@ -183,6 +183,16 @@ struct rvu_hwinfo { ...@@ -183,6 +183,16 @@ struct rvu_hwinfo {
struct npc_mcam mcam; struct npc_mcam mcam;
}; };
struct mbox_wq_info {
struct otx2_mbox mbox;
struct rvu_work *mbox_wrk;
struct otx2_mbox mbox_up;
struct rvu_work *mbox_wrk_up;
struct workqueue_struct *mbox_wq;
};
struct rvu { struct rvu {
void __iomem *afreg_base; void __iomem *afreg_base;
void __iomem *pfreg_base; void __iomem *pfreg_base;
...@@ -194,11 +204,8 @@ struct rvu { ...@@ -194,11 +204,8 @@ struct rvu {
struct mutex rsrc_lock; /* Serialize resource alloc/free */ struct mutex rsrc_lock; /* Serialize resource alloc/free */
/* Mbox */ /* Mbox */
struct otx2_mbox mbox; struct mbox_wq_info afpf_wq_info;
struct rvu_work *mbox_wrk; struct mbox_wq_info afvf_wq_info;
struct otx2_mbox mbox_up;
struct rvu_work *mbox_wrk_up;
struct workqueue_struct *mbox_wq;
/* PF FLR */ /* PF FLR */
struct rvu_work *flr_wrk; struct rvu_work *flr_wrk;
......
...@@ -27,7 +27,7 @@ static struct _req_type __maybe_unused \ ...@@ -27,7 +27,7 @@ static struct _req_type __maybe_unused \
struct _req_type *req; \ struct _req_type *req; \
\ \
req = (struct _req_type *)otx2_mbox_alloc_msg_rsp( \ req = (struct _req_type *)otx2_mbox_alloc_msg_rsp( \
&rvu->mbox_up, devid, sizeof(struct _req_type), \ &rvu->afpf_wq_info.mbox_up, devid, sizeof(struct _req_type), \
sizeof(struct _rsp_type)); \ sizeof(struct _rsp_type)); \
if (!req) \ if (!req) \
return NULL; \ return NULL; \
...@@ -181,8 +181,8 @@ static void cgx_notify_pfs(struct cgx_link_event *event, struct rvu *rvu) ...@@ -181,8 +181,8 @@ static void cgx_notify_pfs(struct cgx_link_event *event, struct rvu *rvu)
if (!msg) if (!msg)
continue; continue;
msg->link_info = *linfo; msg->link_info = *linfo;
otx2_mbox_msg_send(&rvu->mbox_up, pfid); otx2_mbox_msg_send(&rvu->afpf_wq_info.mbox_up, pfid);
err = otx2_mbox_wait_for_rsp(&rvu->mbox_up, pfid); err = otx2_mbox_wait_for_rsp(&rvu->afpf_wq_info.mbox_up, pfid);
if (err) if (err)
dev_warn(rvu->dev, "notification to pf %d failed\n", dev_warn(rvu->dev, "notification to pf %d failed\n",
pfid); pfid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment