From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5CC6FA0093; Wed, 20 May 2020 14:20:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D8971C235; Wed, 20 May 2020 14:20:57 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id CB4121C1C0 for ; Wed, 20 May 2020 14:20:55 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04KCBATa010687 for ; Wed, 20 May 2020 05:20:55 -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=pfpt0818; bh=VQNtALzN6MA//57z3XcBSOWaN8BbO3IRa5OzrVVr5nE=; b=VKLhtJKx7JbaOdvi1TcmSqcYhzkghVpYxKkHTIfc5X+IoDUTIWgP8kC/RB6AITrfK/dz cHQ9uM3L1gzL3f6C5d/pWkL+YwuP+0XRdkKnhwIcNSTOo2MJxE3hDwsCT8jOX6QElVMG nEEzo9bhxjcPe/3zHqY6xkgCI3wGEKc3HDfRCY7G9lK0wt0EY2S9SDmD6VbbplZl6T0l ybhscAdgQaXrpTbpZEj7iD9VhnfdxPE2loq3vxQYQjx3s/iaerftK4SqyPPurpfjqNod HC/Pif0WXm278YSj6Tpq9L6FuPMteqw1euufUm+WRuuEfHweGwAEO7GOoX5aSHi/DFZM vg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 312fpp893g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 20 May 2020 05:20:55 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 20 May 2020 05:20:52 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 20 May 2020 05:20:52 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 20 May 2020 05:20:52 -0700 Received: from hyd1349.t110.caveonetworks.com (unknown [10.29.45.13]) by maili.marvell.com (Postfix) with ESMTP id 66D053F703F; Wed, 20 May 2020 05:20:50 -0700 (PDT) From: Ankur Dwivedi To: CC: , , , Ankur Dwivedi Date: Wed, 20 May 2020 17:50:10 +0530 Message-ID: <1589977210-31046-1-git-send-email-adwivedi@marvell.com> X-Mailer: git-send-email 1.9.3 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-20_08:2020-05-19, 2020-05-20 signatures=0 Subject: [dpdk-dev] [PATCH] net/octeontx2: fix buffer size assignment X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" The elt_size field in mempool holds the size of one packet buffer. It can be used to set the lpm_sizem1 field in rq context. The lpb_sizem1 field in rq context is 12 bit, direct assignment to it was causing overflow of value. Because of this errors were observed while trying inline inbound with large packets. This patch resolves the errors. Fixes: 094fc8a3a1e2 ("net/octeontx2: add Rx queue setup and release") Signed-off-by: Ankur Dwivedi Reviewed-by: Nithin Kumar Dabilpuram Reviewed-by: Jerin Jacob Kollanukkaran --- drivers/net/octeontx2/otx2_ethdev.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index 3116e5c..3f3f0a6 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -373,10 +373,7 @@ aq->rq.first_skip = first_skip; aq->rq.later_skip = (sizeof(struct rte_mbuf) / 8); aq->rq.flow_tagw = 32; /* 32-bits */ - aq->rq.lpb_sizem1 = rte_pktmbuf_data_room_size(mp); - aq->rq.lpb_sizem1 += rte_pktmbuf_priv_size(mp); - aq->rq.lpb_sizem1 += sizeof(struct rte_mbuf); - aq->rq.lpb_sizem1 /= 8; + aq->rq.lpb_sizem1 = mp->elt_size / 8; aq->rq.lpb_sizem1 -= 1; /* Expressed in size minus one */ aq->rq.ena = 1; aq->rq.pb_caching = 0x2; /* First cache aligned block to LLC */ -- 1.9.3