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 9B1DE4614B; Thu, 30 Jan 2025 12:55:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A0B0402E7; Thu, 30 Jan 2025 12:55:39 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 941ED4025D for ; Thu, 30 Jan 2025 12:55:37 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50U3EXA3029763 for ; Thu, 30 Jan 2025 03:55:36 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=K Ydx2X+Vw4BALEpD08NDVZ3FPA1KqMYYG92ZuNSe3V0=; b=VZIq7f6afwjWSZ+xH dzAEs0JrovRFZHrL5/vTE5Q+qusUT0a0DCasEnKVpbeIUZZRELl0241QvnC0//iP SpnHmN/igyVnGk4Atq1NrXBOXYWYELfi+N8fR4KDuJMZakcZM00ENFfTZ1pLRwjD zinFDwRLs9mlsQly3J1unIZaQQx2pLg0oCzQgKFCHyqSkawj8u+QeRSP0J215TVL 72gjQkcWIxxRFIsX9I1WIcwldM14/WqSXg2Mzc9Yu74MEvlJF2udzlloEqZXqlsL 7Gp6YMzwhJppsnkwdIoD6QzgTx0/SHQfUCiBV4Hpsdu8+1hzrgP4ZUhN6dcMiqcd hhONg== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 44g1aqrn04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 30 Jan 2025 03:55:36 -0800 (PST) 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; Thu, 30 Jan 2025 03:55:35 -0800 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; Thu, 30 Jan 2025 03:55:35 -0800 Received: from localhost.localdomain (unknown [10.28.36.158]) by maili.marvell.com (Postfix) with ESMTP id 6196C3F703F; Thu, 30 Jan 2025 03:55:32 -0800 (PST) From: Rahul Bhansali To: , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra , Pavan Nikhilesh , Jerin Jacob , Rahul Bhansali Subject: [PATCH v2] net/cnxk: fix of NIX send header L3 type Date: Thu, 30 Jan 2025 17:25:26 +0530 Message-ID: <20250130115526.1023855-1-rbhansali@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250127063335.405019-1-rbhansali@marvell.com> References: <20250127063335.405019-1-rbhansali@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 2cuQsAJkZLFJva4iIp395M8ilnmC8OVh X-Proofpoint-GUID: 2cuQsAJkZLFJva4iIp395M8ilnmC8OVh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-30_06,2025-01-30_01,2024-11-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 For small packets less than 55 bytes, SQ error interrupts are observed. When checksum offload flag is enabled and mbuf ol_flags are not set, then default L3 type will be set to IPv6 in vector processing. Based on this, HW will still validate for minimum header size and generate send header error if mismatch. To address this, will set default L3 type to none. Mbuf ol_flags RTE_MBUF_F_TX_IPV6 will set with offload feature TSO or L4 checksum only, so handled in corresponding routine. Fixes: f71b7dbbf04b ("net/cnxk: add vector Tx for CN10K") Fixes: e829e60c6917 ("net/cnxk: support Tx burst vector for CN20K") Fixes: 862e28128707 ("net/cnxk: add vector Tx for CN9K") Signed-off-by: Rahul Bhansali --- Changes in v2: Added fix for cn9k also. drivers/net/cnxk/cn10k_tx.h | 7 +++++-- drivers/net/cnxk/cn20k_tx.h | 7 +++++-- drivers/net/cnxk/cn9k_tx.h | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h index 7d9b259a5f..77f4e54cd8 100644 --- a/drivers/net/cnxk/cn10k_tx.h +++ b/drivers/net/cnxk/cn10k_tx.h @@ -1773,6 +1773,9 @@ cn10k_nix_prepare_tso(struct rte_mbuf *m, union nix_send_hdr_w1_u *w1, w0->lso_mps = m->tso_segsz; w0->lso_format = NIX_LSO_FORMAT_IDX_TSOV4 + !!(ol_flags & RTE_MBUF_F_TX_IPV6); w1->ol4type = NIX_SENDL4TYPE_TCP_CKSUM; + w1->ol3type = ((!!(ol_flags & RTE_MBUF_F_TX_IPV4)) << 1) + + ((!!(ol_flags & RTE_MBUF_F_TX_IPV6)) << 2) + + !!(ol_flags & RTE_MBUF_F_TX_IP_CKSUM); /* Handle tunnel tso */ if ((flags & NIX_TX_OFFLOAD_OL3_OL4_CSUM_F) && @@ -2477,7 +2480,7 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws, */ const uint8x16_t tbl = { /* [0-15] = il4type:il3type */ - 0x04, /* none (IPv6 assumed) */ + 0x00, /* none */ 0x14, /* RTE_MBUF_F_TX_TCP_CKSUM (IPv6 assumed) */ 0x24, /* RTE_MBUF_F_TX_SCTP_CKSUM (IPv6 assumed) */ 0x34, /* RTE_MBUF_F_TX_UDP_CKSUM (IPv6 assumed) */ @@ -2681,7 +2684,7 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws, const uint8x16x2_t tbl = {{ { /* [0-15] = il4type:il3type */ - 0x04, /* none (IPv6) */ + 0x00, /* none */ 0x14, /* RTE_MBUF_F_TX_TCP_CKSUM (IPv6) */ 0x24, /* RTE_MBUF_F_TX_SCTP_CKSUM (IPv6) */ 0x34, /* RTE_MBUF_F_TX_UDP_CKSUM (IPv6) */ diff --git a/drivers/net/cnxk/cn20k_tx.h b/drivers/net/cnxk/cn20k_tx.h index c731406529..8c3ba8326d 100644 --- a/drivers/net/cnxk/cn20k_tx.h +++ b/drivers/net/cnxk/cn20k_tx.h @@ -1733,6 +1733,9 @@ cn20k_nix_prepare_tso(struct rte_mbuf *m, union nix_send_hdr_w1_u *w1, union nix w0->lso_mps = m->tso_segsz; w0->lso_format = NIX_LSO_FORMAT_IDX_TSOV4 + !!(ol_flags & RTE_MBUF_F_TX_IPV6); w1->ol4type = NIX_SENDL4TYPE_TCP_CKSUM; + w1->ol3type = ((!!(ol_flags & RTE_MBUF_F_TX_IPV4)) << 1) + + ((!!(ol_flags & RTE_MBUF_F_TX_IPV6)) << 2) + + !!(ol_flags & RTE_MBUF_F_TX_IP_CKSUM); /* Handle tunnel tso */ if ((flags & NIX_TX_OFFLOAD_OL3_OL4_CSUM_F) && (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)) { @@ -2395,7 +2398,7 @@ cn20k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws, struct rte_mbuf **tx_pk */ const uint8x16_t tbl = { /* [0-15] = il4type:il3type */ - 0x04, /* none (IPv6 assumed) */ + 0x00, /* none */ 0x14, /* RTE_MBUF_F_TX_TCP_CKSUM (IPv6 assumed) */ 0x24, /* RTE_MBUF_F_TX_SCTP_CKSUM (IPv6 assumed) */ 0x34, /* RTE_MBUF_F_TX_UDP_CKSUM (IPv6 assumed) */ @@ -2595,7 +2598,7 @@ cn20k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws, struct rte_mbuf **tx_pk const uint8x16x2_t tbl = {{ { /* [0-15] = il4type:il3type */ - 0x04, /* none (IPv6) */ + 0x00, /* none */ 0x14, /* RTE_MBUF_F_TX_TCP_CKSUM (IPv6) */ 0x24, /* RTE_MBUF_F_TX_SCTP_CKSUM (IPv6) */ 0x34, /* RTE_MBUF_F_TX_UDP_CKSUM (IPv6) */ diff --git a/drivers/net/cnxk/cn9k_tx.h b/drivers/net/cnxk/cn9k_tx.h index 9370985864..902a17860c 100644 --- a/drivers/net/cnxk/cn9k_tx.h +++ b/drivers/net/cnxk/cn9k_tx.h @@ -889,6 +889,9 @@ cn9k_nix_prepare_tso(struct rte_mbuf *m, union nix_send_hdr_w1_u *w1, w0->lso_mps = m->tso_segsz; w0->lso_format = NIX_LSO_FORMAT_IDX_TSOV4 + !!(ol_flags & RTE_MBUF_F_TX_IPV6); w1->ol4type = NIX_SENDL4TYPE_TCP_CKSUM; + w1->ol3type = ((!!(ol_flags & RTE_MBUF_F_TX_IPV4)) << 1) + + ((!!(ol_flags & RTE_MBUF_F_TX_IPV6)) << 2) + + !!(ol_flags & RTE_MBUF_F_TX_IP_CKSUM); /* Handle tunnel tso */ if ((flags & NIX_TX_OFFLOAD_OL3_OL4_CSUM_F) && @@ -1402,7 +1405,7 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts, */ const uint8x16_t tbl = { /* [0-15] = il4type:il3type */ - 0x04, /* none (IPv6 assumed) */ + 0x00, /* none */ 0x14, /* RTE_MBUF_F_TX_TCP_CKSUM (IPv6 assumed) */ 0x24, /* RTE_MBUF_F_TX_SCTP_CKSUM (IPv6 assumed) */ 0x34, /* RTE_MBUF_F_TX_UDP_CKSUM (IPv6 assumed) */ @@ -1606,7 +1609,7 @@ cn9k_nix_xmit_pkts_vector(void *tx_queue, struct rte_mbuf **tx_pkts, const uint8x16x2_t tbl = {{ { /* [0-15] = il4type:il3type */ - 0x04, /* none (IPv6) */ + 0x00, /* none */ 0x14, /* RTE_MBUF_F_TX_TCP_CKSUM (IPv6) */ 0x24, /* RTE_MBUF_F_TX_SCTP_CKSUM (IPv6) */ 0x34, /* RTE_MBUF_F_TX_UDP_CKSUM (IPv6) */ -- 2.25.1