From patchwork Fri Jul 30 16:08:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 96470 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0AD55A0C40; Fri, 30 Jul 2021 18:08:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7DD8340040; Fri, 30 Jul 2021 18:08:19 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id D059F4003F for ; Fri, 30 Jul 2021 18:08:17 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16UG6GLL002356 for ; Fri, 30 Jul 2021 09:08:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=n2uH1jhx3utYo2Om0xa1zrsY4mNR+LYKDMfUhz2leu0=; b=K5ekIL0D/OWq8ZsyZuYXmNqCNiYnAf7fBJaRJ3OqRpLOkIzElEeeAz0mKb/VI5n1Ez5U wyG1waIH6eHwtksZIwiQRJroRHY5l1CsAqa8b4cLUN1O7qB9pdS++Kjg0qxkojRoAg3k upf+vtXO88KPwpGOaRGpTc245aNgZW1agebgACTU4T7tGPZtO3M/ZffXigq1LLm+21Os moF3DXp7PKalHZDlYfphutaSk9cE2om6aQa8NEZ9Xklq/dmTnAmkRwFNj3a+A9xtF3aj u76G9BSXbjYiBmtslJRt+Eke16dbmfv0aSnDYY4QY14W3lNx7fNHdVfRIEgEegckANfA 8g== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3a4866trw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 30 Jul 2021 09:08:16 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 30 Jul 2021 09:08:15 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 30 Jul 2021 09:08:15 -0700 Received: from localhost.localdomain (unknown [10.29.52.211]) by maili.marvell.com (Postfix) with ESMTP id EB6143F7068; Fri, 30 Jul 2021 09:08:13 -0700 (PDT) From: Harman Kalra To: Jerin Jacob , Nithin Dabilpuram CC: , Harman Kalra Date: Fri, 30 Jul 2021 21:38:06 +0530 Message-ID: <20210730160806.13394-1-hkalra@marvell.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Proofpoint-GUID: PNVUt-SrEdv_zFenuubYG1jK9QEUZVm2 X-Proofpoint-ORIG-GUID: PNVUt-SrEdv_zFenuubYG1jK9QEUZVm2 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-30_11:2021-07-30, 2021-07-30 signatures=0 Subject: [dpdk-dev] [PATCH] common/octeontx2: fix link event message size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Due to wrong size of mbox message allocated for sending link status to the VF, incorrect link status is observed. Fixes: cb8d769fb6fe ("common/octeontx2: send link event to VF") Signed-off-by: Harman Kalra Acked-by: Jerin Jacob --- drivers/common/octeontx2/otx2_dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/common/octeontx2/otx2_dev.c b/drivers/common/octeontx2/otx2_dev.c index 1485e2b357..ce4f0e7ca9 100644 --- a/drivers/common/octeontx2/otx2_dev.c +++ b/drivers/common/octeontx2/otx2_dev.c @@ -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));