From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH 4/4] ethdev: add Tx offload outer L4 checksum definitions Date: Tue, 2 Oct 2018 15:22:40 +0530 Message-ID: <20181002095238.GA26866@jerin> References: <20180913134707.23698-1-jerin.jacob@caviumnetworks.com> <20180913134707.23698-4-jerin.jacob@caviumnetworks.com> <13368ba5-599c-792a-23b5-9b8832083c18@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic , Thomas Monjalon , Andrew Rybchenko , Olivier Matz , dev@dpdk.org, shahafs@mellanox.com To: Ferruh Yigit Return-path: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700068.outbound.protection.outlook.com [40.107.70.68]) by dpdk.org (Postfix) with ESMTP id A84F43195 for ; Tue, 2 Oct 2018 11:53:05 +0200 (CEST) Content-Disposition: inline In-Reply-To: <13368ba5-599c-792a-23b5-9b8832083c18@intel.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" -----Original Message----- > Date: Mon, 1 Oct 2018 14:45:39 +0100 > From: Ferruh Yigit > To: Jerin Jacob , Wenzhuo Lu > , Jingjing Wu , Bernard > Iremonger , John McNamara > , Marko Kovacevic , > Thomas Monjalon , Andrew Rybchenko > , Olivier Matz > CC: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 4/4] ethdev: add Tx offload outer L4 > checksum definitions > User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 > Thunderbird/52.9.1 > > On 9/13/2018 2:47 PM, Jerin Jacob wrote: > > Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM, DEV_TX_OFFLOAD_OUTER_TCP_CKSUM > > and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM offload flags and > > > > PKT_TX_OUTER_L4_NO_CKSUM, PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM > > and PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer L4 checksum > > offload. > > > > To use hardware Tx outer L4 checksum offload, the user needs to. > > # enable following in mbuff: > > - fill outer_l2_len and outer_l3_len in mbuf > > - set the flags PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM or > > PKT_TX_OUTER_UDP_CKSUM > > - set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6 > > > > # configure DEV_TX_OFFLOAD_OUTER_* offload flags in slow path. > > > > Signed-off-by: Jerin Jacob > > --- > > app/test-pmd/config.c | 27 +++++++++++++++++++++++++++ > > doc/guides/nics/features.rst | 6 ++++++ > > lib/librte_ethdev/rte_ethdev.c | 3 +++ > > lib/librte_ethdev/rte_ethdev.h | 6 ++++++ > > lib/librte_mbuf/rte_mbuf.c | 5 +++++ > > lib/librte_mbuf/rte_mbuf.h | 23 ++++++++++++++++++++++- > > 6 files changed, 69 insertions(+), 1 deletion(-) > > > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > > index 92a177e29..85f832bf0 100644 > > --- a/app/test-pmd/config.c > > +++ b/app/test-pmd/config.c > > @@ -773,6 +773,33 @@ port_offload_cap_display(portid_t port_id) > > else > > printf("off\n"); > > } > > + > > + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) { > > + printf("TX Outer UDP checksum: "); > > + if (ports[port_id].dev_conf.txmode.offloads & > > + DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) > > + printf("on\n"); > > + else > > + printf("off\n"); > > + } > > + > > + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_TCP_CKSUM) { > > + printf("TX Outer TCP checksum: "); > > + if (ports[port_id].dev_conf.txmode.offloads & > > + DEV_TX_OFFLOAD_OUTER_TCP_CKSUM) > > + printf("on\n"); > > + else > > + printf("off\n"); > > + } > > + > > + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM) { > > + printf("TX Outer SCTP checksum: "); > > + if (ports[port_id].dev_conf.txmode.offloads & > > + DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM) > > + printf("on\n"); > > + else > > + printf("off\n"); > > + } > > } > > There is also "csum show", "csum set" functions, can you please check that too? + Shahaf I checked the details. It is for "csumonly.c" forward engine to select various Tx checksum in HW or SW(provide fallback SW implementation) for testing purpose. If I need to implement this support for this release, I will reduce the scope to DEV_TX_OFFLOAD_OUTER_UDP_CKSUM and DEV_RX_OFFLOAD_OUTER_UDP_CKSUM. Since there is NO real world non encrypted TCP/SCTP based tunnel protocols(Based on http://patches.dpdk.org/patch/44692/ discussions) I will limit the offload definition only to DEV_?X_OFFLOAD_OUTER_UDP_CKSUM and associated test code in "csumonly.c" forward engine in v2. Thoughts? I will split 1/4 and 2/4 as separate patch series and and rework 3/4 and 4/4 as separate series to make forward progress. > And I am not sure why those functions seems only concerned about Tx csum offloads. It does check for errors in Rx checksum too. See rx_bad_ip_csum, rx_bad_l4_csum