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 AD30D45A74; Tue, 1 Oct 2024 08:01:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6683940A72; Tue, 1 Oct 2024 08:01:18 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5874F409FA for ; Tue, 1 Oct 2024 08:01:17 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49103hPh022637 for ; Mon, 30 Sep 2024 23:01:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=W G/++B/AhpFOKCi2jgRWlHdXZGv8QPvawaGf/JChDww=; b=ciD+iWnzWGeJ7HOBj PudXouctPYatI4Af5yWwDg83h3JqJSFysaDAH00j4QGxq1LRMbDtJP+9tOvrz9MM QbRjtkJHhb8z+PdZcObwlLwDMmXElpdtA/F35V6lnpjL88QVLwfkS5IAc1IEus6U BOCoP4k0xPCrpOQutEyp3W31aMufdqOJMfDIcRTnJpvTSlvn6wM6H3JAv13SrDP+ oGh+pEWALxEEAHpPEMdk4bvpV3QPVh6MD/M09IVfRfd11/xYfrUOk4//vfUJQOHy ewBi0oxomvk9h5wq1PqvKU9IVx+pfcfFkkUPCdR0OBXSju9EO4xw8RcLTKkignhz KO/QA== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 41yt6gbxju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 30 Sep 2024 23:01:16 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 30 Sep 2024 23:01:15 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 30 Sep 2024 23:01:15 -0700 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id E82025C68E3; Mon, 30 Sep 2024 23:01:11 -0700 (PDT) From: Nithin Dabilpuram To: , Nithin Dabilpuram , "Kiran Kumar K" , Sunil Kumar Kori , Satha Rao , Harman Kalra CC: , Rakesh Kudurumalla Subject: [PATCH v2 05/17] net/cnxk: update mbuf and rearm data for Rx inject packets Date: Tue, 1 Oct 2024 11:30:43 +0530 Message-ID: <20241001060055.3747591-5-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241001060055.3747591-1-ndabilpuram@marvell.com> References: <20241001060055.3747591-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: lIYQd8JVt4z6nMDaRFdhhAH9h-MrylYd X-Proofpoint-ORIG-GUID: lIYQd8JVt4z6nMDaRFdhhAH9h-MrylYd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_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 From: Rakesh Kudurumalla When nix receives second pass packets injected to CPT next segments of primary mbuf are accessed directly using mbuf next pointer since we do not know at what offset mbuf is available.To achieve this we do no update mbut next pointer to NULL for Rx injected packets. Signed-off-by: Rakesh Kudurumalla --- drivers/net/cnxk/cn10k_rx.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h index 9dde2bea57..990dfbee3e 100644 --- a/drivers/net/cnxk/cn10k_rx.h +++ b/drivers/net/cnxk/cn10k_rx.h @@ -709,6 +709,7 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf, uint16_t later_skip = 0; struct rte_mbuf *head; const rte_iova_t *eol; + bool rx_inj = false; uint64_t cq_w5 = 0; uint16_t ihl = 0; uint64_t fsz = 0; @@ -729,7 +730,9 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf, /* Rx Inject packet must have Match ID 0xFFFF and for this * wqe will get from address stored at mbuf+1 location */ - if ((flags & NIX_RX_REAS_F) && hdr->w0.match_id == 0xFFFFU) + rx_inj = ((flags & NIX_RX_REAS_F) && ((hdr->w0.match_id == 0xFFFFU) || + (hdr->w0.cookie == 0xFFFFFFFFU))); + if (rx_inj) wqe = (const uint64_t *)*((uint64_t *)(mbuf + 1)); else wqe = (const uint64_t *)(mbuf + 1); @@ -786,7 +789,8 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf, later_skip = (uintptr_t)mbuf->buf_addr - (uintptr_t)mbuf; while (nb_segs) { - mbuf->next = (struct rte_mbuf *)(*iova_list - later_skip); + if (!(flags & NIX_RX_REAS_F) || !rx_inj) + mbuf->next = (struct rte_mbuf *)(*iova_list - later_skip); mbuf = mbuf->next; RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); @@ -804,7 +808,8 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf, mbuf->data_len = sg_len; sg = sg >> 16; p = (uintptr_t)&mbuf->rearm_data; - *(uint64_t *)p = rearm & ~0xFFFF; + if (!(flags & NIX_RX_REAS_F) || !rx_inj) + *(uint64_t *)p = rearm & ~0xFFFF; nb_segs--; iova_list++; @@ -1259,7 +1264,6 @@ cn10k_nix_rx_inj_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd) slist++; } m_next = m->next; - m->next = NULL; m = m_next; } while (nb_segs); -- 2.34.1