From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id C0DC658F7 for ; Wed, 14 Jan 2015 04:02:12 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 13 Jan 2015 18:56:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,753,1413270000"; d="scan'208";a="661483815" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by fmsmga002.fm.intel.com with ESMTP; 13 Jan 2015 19:01:51 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 14 Jan 2015 11:01:18 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.64]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.192]) with mapi id 14.03.0195.001; Wed, 14 Jan 2015 11:01:16 +0800 From: "Liu, Jijiang" To: Olivier MATZ Thread-Topic: [dpdk-dev] [PATCH v3 0/3] enhance TX checksum command and csum forwarding engine Thread-Index: AQHQFSv0txinLaq/UEmWgzF3v0CZupyLMv5ggABvM4CAJx3DUIABUNAAgACeQOD//4WHgIAB0/cg//+qC4CAAY+2AIAEp+6QgAAfSgCAAWHEQIAAEm0AgAGBl0A= Date: Wed, 14 Jan 2015 03:01:16 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC01DB0789@SHSMSX101.ccr.corp.intel.com> References: <1418173403-30202-1-git-send-email-jijiang.liu@intel.com> <54896F4A.4070601@6wind.com> <1ED644BD7E0A5F4091CF203DAFB8E4CC01DA1B70@SHSMSX101.ccr.corp.intel.com> <548B18C9.3020408@6wind.com> <1ED644BD7E0A5F4091CF203DAFB8E4CC01DA7699@SHSMSX101.ccr.corp.intel.com> <2601191342CEEE43887BDE71AB977258213D337B@irsmsx105.ger.corp.intel.com> <1ED644BD7E0A5F4091CF203DAFB8E4CC01DA789E@SHSMSX101.ccr.corp.intel.com> <2601191342CEEE43887BDE71AB977258213D34AE@irsmsx105.ger.corp.intel.com> <1ED644BD7E0A5F4091CF203DAFB8E4CC01DA7CC5@SHSMSX101.ccr.corp.intel.com> <2601191342CEEE43887BDE71AB977258213D3897@irsmsx105.ger.corp.intel.com> <54AFB13E.2080200@6wind.com> <1ED644BD7E0A5F4091CF203DAFB8E4CC01DA85A1@SHSMSX101.ccr.corp.intel.com> <54B3B35A.5030803@6wind.com> <1ED644BD7E0A5F4091CF203DAFB8E4CC01DA8E36@SHSMSX101.ccr.corp.intel.com> <54B4EB92.40209@6wind.com> In-Reply-To: <54B4EB92.40209@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v3 0/3] enhance TX checksum command and csum forwarding engine X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2015 03:02:14 -0000 Hi Olivier, > -----Original Message----- > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > Sent: Tuesday, January 13, 2015 5:56 PM > To: Liu, Jijiang > Cc: dev@dpdk.org; Ananyev, Konstantin > Subject: Re: [dpdk-dev] [PATCH v3 0/3] enhance TX checksum command and > csum forwarding engine >=20 > Hi Jijiang, >=20 > On 01/13/2015 04:04 AM, Liu, Jijiang wrote: > > the following two commands are. > > > > 1. tx_checksum set sw-tunnel-mode on/off > > > > 2. tx_checksum set hw-tunnel-mode on/off > > > > For command 1, If the sw-tunnel-mode is set/clear, which will > > set/clear a testpmd flag that is used in the process of analyzing > > incoming packet., the pseudo-codes are list below, > > > > If (sw-tunnel-mode) > > > > Csum fwd engine will analyze if incoming packet is a tunneling packet. > > tunnel =3D 1; > > else > > Csum fwd engine will not analyze if incoming packet is a tu= nneling > packet, and treat all the incoming packets as non-tunneling packets. > > It is used for A. >=20 > What about "recognize-tunnel" instead of "sw-tunnel-mode"? > Or "parse-tunnel"? Ok, "parse-tunnel" or "parse-tunnel-pkt" is better. Thanks. > To me, using "sw-" or "hw-" prefix is confusing because in any case the c= hecksums > can be calculated in software or hardware depending on "tx_checksum set o= uter- > ip hw|sw". >=20 > Moreover, this command has an impact on receive side, but the name is sti= ll > "tx_checksum". Maybe this is also confusing. Ok, how about this? set checksum parse-tunnel-pkt on|off (port-id) > > For command 2, If the hw-tunnel-mode is set/clear, which will > > set/clear a testpmd flag that is used in the process of how to handle > > tunneling packet, the pseudo-codes are list below, > > > > if (tunnel =3D=3D 1) { // this is a tunneling packet > > If (hw-tunnel-mode) > > ol_flags |=3D PKT_TX_UDP_TUNNEL_PKT; > > > > Csum fwd engine set PKT_TX_UDP_TUNNEL_PKT offload flag, which > means to tell HW treat the transmit packet as a tunneling packet to do c= hecksum > offload. > > It is used for B.1 > > Else > > Csum fwd engine doesn't set PKT_TX_UDP_TUNNEL_P= KT offload > flag, which means tell HW to treat the packet as ordinary (non-tunnelled= ) packet. > > It is used for B.2 > > } >=20 > What about: > tx_checksum set tunnel-method normal|outer > It would select if we use lX_len or outer_lX_len. Is it what you mean? =20 tx_checksum set tunnel-method normal|outer Let me explain that what differences of TX checksum mechanism between ixgb= e(82599) and i40e(40G NIC) are. For 82599, there is only one register that is used for L3 checksum offload.= So for tunneling packet, hardware is unable to recognize the packet is tun= neling packet and the register cannot be worked for both outer L3 checksum= offload and inner L3 checksum offload at the same time, just for outer or= inner. For i40e(40G NIC), there are two registers that are user for L3 TX checksu= m offload, so for tunneling packet, the outer and inner L3 checksum offload= can be done by hardware at the same time, but a prerequisite is that we m= ust tell Hardware the packet is a tunneling packet by setting a register (PKT_TX_UDP= _TUNNEL_PKT offload flag is used to indicate to set this register.) As for other NIC, I think its working mechanism should be same as the i40e = if it can recognize tunneling packet. So my idea: tx_checksum set tunnel-method tunnel-pkt on|off or tx_checksum set tunnel-pkt on|off What do you think? = = = = = =20 > And this only makes sense when we use hw checksum right? yes >=20 > >> And will it be possible to support future hardware that will be able > >> to compute both outer l3, outer l4, l3 and l4 checksums? Currently, if outer l4 will be supported in the future, and we can add out= er-udp/tcp option into following command. Tx_checksum set outer-ip|ip|sctp|udp|tcp. > > Yes. > > Currently, i40e support outer l3, outer l4, l3 and l4 checksums offload= at the > same time. Sorry, my bad. I40e just support outer l3, l3 and l4. Fortville can offload the following L3 and L4 integrity checks: IPv4 header= (s) checksum for "simple" and tunneled packets, Inner TCP or UDP checksum a= nd SCTP CRC integrity. Tunneling UDP headers and GRE header are not offload= ed while Fortville leaves their checksum field as is. If a checksum is requ= ired, software should provide it as well as the inner checksum value(s) tha= t are required for the outer checksum. >=20 > >> I have another idea, please let me know if you find it clearer or not. > >> The commands format would be: > >> > >> tx_checksum ... > >> > >> [...] > >> > >> What do you think? > > > > Thanks for your proposal. > > It is clear for me. > > > > But there are two questions for me. > > > > As I know, in current command line framework, the option in command lin= e is > exact match, so you probably have to add duplicated codes when you want t= o > support a new packet types. >=20 > I don't think it's really a problem. The cmdline library supports string = list, so can > have the following 3 commands definitions: >=20 > 1. tx_checksum > ip-udp|ip-tcp|ip-sctp|vxlan-ip-udp|vxlan-ip-tcp|vxlan-ip-sctp l3 > off|sw|hw l4 off|sw|hw > 2. tx_checksum ip-other|vxlan-ip-other l3 off|sw|hw 3. tx_checksum vxlan > outer-l3 off|sw|hw outer-l4 off|sw|hw >=20 > Maybe 1 and 2 could be splitted in non-vxlan and vxlan. But only the stru= cture > should be redefined to have a different help string, not the callback fun= ction. Ok, but I think you probably need to add many string in the list :) > > Other question: > > > > Currently, the following testpmd flag is for per port, not for per pack= et type, > when they are set, which will affect whole port, not just for packet type= or format, > if you add option in cmdline, which means you have to other > changes. > > > > /** Offload IP checksum in csum forward engine */ > > #define TESTPMD_TX_OFFLOAD_IP_CKSUM 0x0001 > > /** Offload UDP checksum in csum forward engine */ > > #define TESTPMD_TX_OFFLOAD_UDP_CKSUM 0x0002 > > /** Offload TCP checksum in csum forward engine */ > > #define TESTPMD_TX_OFFLOAD_TCP_CKSUM 0x0004 > > /** Offload SCTP checksum in csum forward engine */ > > #define TESTPMD_TX_OFFLOAD_SCTP_CKSUM 0x0008 > > /** Offload VxLAN checksum in csum forward engine */ > > #define TESTPMD_TX_OFFLOAD_VXLAN_CKSUM 0x0010 >=20 > We can add a portid in each command. Ok, but I think your idea will make the csum fwd engine more complicated. > > Of course, it is welcome if you can send this patch set with this idea = for > community review. > Let's first agree on the user API :) If you don't have more comments and questions on my current solution, I wil= l send new patch set. Or you can send your patch. Anyway, our goal is the same. >=20 > Regards, > Olivier >=20 >=20