X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Focteontx2%2Fotx2_dev.c;h=ce4f0e7ca9830f93ba11e9e507415e9a4b62ffae;hb=a4975cd20dca0aa7f96cd47b79144509e7599c66;hp=6a84df234418b1f9be137a3616c485bc1a4bce35;hpb=0f9ac2afa62ebacd24f36a3b98272b7146be3edd;p=dpdk.git diff --git a/drivers/common/octeontx2/otx2_dev.c b/drivers/common/octeontx2/otx2_dev.c index 6a84df2344..ce4f0e7ca9 100644 --- a/drivers/common/octeontx2/otx2_dev.c +++ b/drivers/common/octeontx2/otx2_dev.c @@ -163,6 +163,35 @@ af_pf_wait_msg(struct otx2_dev *dev, uint16_t vf, int num_msg) rsp->rc = msg->rc; rsp->pcifunc = msg->pcifunc; + /* Whenever a PF comes up, AF sends the link status to it but + * when VF comes up no such event is sent to respective VF. + * Using MBOX_MSG_NIX_LF_START_RX response from AF for the + * purpose and send the link status of PF to VF. + */ + if (msg->id == MBOX_MSG_NIX_LF_START_RX) { + /* Send link status to VF */ + struct cgx_link_user_info linfo; + struct mbox_msghdr *vf_msg; + size_t sz; + + /* Get the link status */ + if (dev->ops && dev->ops->link_status_get) + dev->ops->link_status_get(dev, &linfo); + + sz = RTE_ALIGN(otx2_mbox_id2size( + MBOX_MSG_CGX_LINK_EVENT), MBOX_MSG_ALIGN); + /* Prepare the message to be sent */ + vf_msg = otx2_mbox_alloc_msg(&dev->mbox_vfpf_up, vf, + sz); + otx2_mbox_req_init(MBOX_MSG_CGX_LINK_EVENT, vf_msg); + memcpy((uint8_t *)vf_msg + sizeof(struct mbox_msghdr), + &linfo, sizeof(struct cgx_link_user_info)); + + vf_msg->rc = msg->rc; + vf_msg->pcifunc = msg->pcifunc; + /* Send to VF */ + otx2_mbox_msg_send(&dev->mbox_vfpf_up, vf); + } offset = mbox->rx_start + msg->next_msgoff; } rte_spinlock_unlock(&mdev->mbox_lock);