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;
+
+ /* Get the link status */
+ if (dev->ops && dev->ops->link_status_get)
+ dev->ops->link_status_get(dev, &linfo);
+
+ /* Prepare the message to be sent */
+ vf_msg = otx2_mbox_alloc_msg(&dev->mbox_vfpf_up, vf,
+ size);
+ 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);
struct otx2_dev;
-/* Link status callback */
-typedef void (*otx2_link_status_t)(struct otx2_dev *dev,
+/* Link status update callback */
+typedef void (*otx2_link_status_update_t)(struct otx2_dev *dev,
struct cgx_link_user_info *link);
/* PTP info callback */
typedef int (*otx2_ptp_info_t)(struct otx2_dev *dev, bool ptp_en);
+/* Link status get callback */
+typedef void (*otx2_link_status_get_t)(struct otx2_dev *dev,
+ struct cgx_link_user_info *link);
struct otx2_dev_ops {
- otx2_link_status_t link_status_update;
+ otx2_link_status_update_t link_status_update;
otx2_ptp_info_t ptp_info_update;
+ otx2_link_status_get_t link_status_get;
};
#define OTX2_DEV \