common/octeontx2: fix link event message size

Due to wrong size of mbox message allocated for sending link status
to the VF, incorrect link status is observed.

Fixes: cb8d769fb6 ("common/octeontx2: send link event to VF")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Harman Kalra 2021-07-30 21:38:06 +05:30 committed by Jerin Jacob
parent 8b9f07b8a4
commit 11bb961c01

View File

@ -172,14 +172,17 @@ af_pf_wait_msg(struct otx2_dev *dev, uint16_t vf, int num_msg)
/* 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,
size);
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));