From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: [PATCH v2 1/2] ethdev: add SCTP Rx checksum offload support Date: Tue, 2 Oct 2018 16:21:41 +0530 Message-ID: <20181002105142.24333-1-jerin.jacob@caviumnetworks.com> References: <20180913134707.23698-1-jerin.jacob@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, Jerin Jacob To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Return-path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0045.outbound.protection.outlook.com [104.47.34.45]) by dpdk.org (Postfix) with ESMTP id E580B2BFA for ; Tue, 2 Oct 2018 12:52:35 +0200 (CEST) In-Reply-To: <20180913134707.23698-1-jerin.jacob@caviumnetworks.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Added SCTP Rx checksum offload support Signed-off-by: Jerin Jacob --- v2: - Fix printf formatting error(Ferruh Yigit) --- app/test-pmd/config.c | 9 +++++++++ doc/guides/nics/features.rst | 4 ++-- lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_ethdev/rte_ethdev.h | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 794aa5268..1adc9b94b 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -576,6 +576,15 @@ port_offload_cap_display(portid_t port_id) printf("off\n"); } + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCTP_CKSUM) { + printf("RX SCTP checksum: "); + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_SCTP_CKSUM) + printf("on\n"); + else + printf("off\n"); + } + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) { printf("RX Outer IPv4 checksum: "); if (ports[port_id].dev_conf.rxmode.offloads & diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index b085bda86..d42489b6d 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -576,7 +576,7 @@ L4 checksum offload Supports L4 checksum offload. -* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``. +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM,DEV_RX_OFFLOAD_SCTP_CKSUM``. * **[uses] rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``. * **[uses] mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``, ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` | @@ -584,7 +584,7 @@ Supports L4 checksum offload. * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_L4_CKSUM_UNKNOWN`` | ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` | ``PKT_RX_L4_CKSUM_NONE``. -* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``, +* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM,DEV_RX_OFFLOAD_SCTP_CKSUM``, ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``. .. _nic_features_hw_timestamp: diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index ef99f7068..e9a82fe7f 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -126,6 +126,7 @@ static const struct { RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP), RTE_RX_OFFLOAD_BIT2STR(SECURITY), RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC), + RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM), }; #undef RTE_RX_OFFLOAD_BIT2STR diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 012577b0a..d02db14ad 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -888,6 +888,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000 #define DEV_RX_OFFLOAD_SECURITY 0x00008000 #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 +#define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \ -- 2.19.0