From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9A1DAA0545; Tue, 11 Oct 2022 14:01:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A07D542DC1; Tue, 11 Oct 2022 14:01:51 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 58B8542D42; Tue, 11 Oct 2022 14:01:49 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29BA3Alj015818; Tue, 11 Oct 2022 05:01:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Ntc489pNC7JjSUMQoYBkkzSAzqmE6yJxhwiU9B1tDrk=; b=RQxUaJrVTYcMb8DOsc2+nwHgm022PU6QCLLLg2Vjw8KjxP4jRBxy6sGDwvHJWeeSEuEl oUsyW4wMewM12kfJtyeYqItiOxI3zWyt0shku/EgL3LKj7V4oinc5wkTNKdseu6IkvEQ 4Dg23ivtLzf18pwDHi3PAsP1qw672YcXmkUKmH98wGcUuZtH1cSUMlK970uTkPFlfTXa m1Y31WwK53bE100kz/d2UA6KhK0uTIypq9lq25rmxnYul9MssjsX05FYwiUFVSin/SJc veUJhm6NOybAJq0vbrEpW+D3qEtMh1/ocKzUnqdb+nqGbDhGStuIQy1PJzdzgc41iaNl LA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3k40g4y26s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 11 Oct 2022 05:01:48 -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.18; Tue, 11 Oct 2022 05:01:46 -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; Tue, 11 Oct 2022 05:01:46 -0700 Received: from localhost.localdomain (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 202813F7040; Tue, 11 Oct 2022 05:01:43 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Subject: [PATCH 03/13] net/cnxk: fix later skip to include mbuf priv Date: Tue, 11 Oct 2022 17:31:25 +0530 Message-ID: <20221011120135.45846-3-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221011120135.45846-1-ndabilpuram@marvell.com> References: <20221011120135.45846-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: FclyulrGNngZApqFW869Mt1X_G4fRPVO X-Proofpoint-GUID: FclyulrGNngZApqFW869Mt1X_G4fRPVO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-11_07,2022-10-11_02,2022-06-22_01 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 Fix later skip to include mbuf priv data as mbuf->buf_addr is populated based on calculation including per-mbuf priv area. Fixes: 706eeae60757 ("net/cnxk: add multi-segment Rx for CN10K") cc: stable@dpdk.org Signed-off-by: Nithin Dabilpuram --- drivers/net/cnxk/cn10k_rx.h | 4 +++- drivers/net/cnxk/cnxk_ethdev.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h index 46488d442e..cf390a0361 100644 --- a/drivers/net/cnxk/cn10k_rx.h +++ b/drivers/net/cnxk/cn10k_rx.h @@ -682,6 +682,7 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf, uint64_t rearm, const uint16_t flags) { const rte_iova_t *iova_list; + uint16_t later_skip = 0; struct rte_mbuf *head; const rte_iova_t *eol; uint8_t nb_segs; @@ -720,10 +721,11 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf, nb_segs--; rearm = rearm & ~0xFFFF; + later_skip = (uintptr_t)mbuf->buf_addr - (uintptr_t)mbuf; head = mbuf; while (nb_segs) { - mbuf->next = ((struct rte_mbuf *)*iova_list) - 1; + mbuf->next = (struct rte_mbuf *)(*iova_list - later_skip); mbuf = mbuf->next; RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index 2cb48ba152..8fe996b2d9 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -620,7 +620,7 @@ cnxk_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid, first_skip += RTE_PKTMBUF_HEADROOM; first_skip += rte_pktmbuf_priv_size(mp); rq->first_skip = first_skip; - rq->later_skip = sizeof(struct rte_mbuf); + rq->later_skip = sizeof(struct rte_mbuf) + rte_pktmbuf_priv_size(mp); rq->lpb_size = mp->elt_size; if (roc_errata_nix_no_meta_aura()) rq->lpb_drop_ena = !(dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY); -- 2.25.1