From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <konstantin.ananyev@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id B427458F7
 for <dev@dpdk.org>; Thu, 15 Jan 2015 14:32:03 +0100 (CET)
Received: from fmsmga003.fm.intel.com ([10.253.24.29])
 by orsmga103.jf.intel.com with ESMTP; 15 Jan 2015 05:28:19 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="440918783"
Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31])
 by FMSMGA003.fm.intel.com with ESMTP; 15 Jan 2015 05:19:03 -0800
Received: from irsmsx105.ger.corp.intel.com ([169.254.7.195]) by
 IRSMSX106.ger.corp.intel.com ([169.254.8.222]) with mapi id 14.03.0195.001;
 Thu, 15 Jan 2015 13:31:59 +0000
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Liu, Jijiang" <jijiang.liu@intel.com>, Olivier MATZ
 <olivier.matz@6wind.com>
Thread-Topic: [dpdk-dev] [PATCH v3 0/3] enhance TX checksum command and csum
 forwarding engine
Thread-Index: AQHQFSvOf5ZHcwOIQ0S6LPFf4KIhoZyLUqAAgADVrYCAJ+m7AIAAhGKAgAAcY4CAAAaCgIABXQMAgAAfBJCAAZMJAIAEQKUAgACGkwCAAQFCAIAAcvAAgAEemACAAkDH8A==
Date: Thu, 15 Jan 2015 13:31:58 +0000
Message-ID: <2601191342CEEE43887BDE71AB977258213D4FCF@irsmsx105.ger.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>
 <1ED644BD7E0A5F4091CF203DAFB8E4CC01DB0789@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <1ED644BD7E0A5F4091CF203DAFB8E4CC01DB0789@SHSMSX101.ccr.corp.intel.com>
Accept-Language: en-IE, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [163.33.239.181]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: "dev@dpdk.org" <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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Jan 2015 13:32:04 -0000

Hi lads,

> -----Original Message-----
> From: Liu, Jijiang
> Sent: Wednesday, January 14, 2015 3:01 AM
> To: Olivier MATZ
> Cc: dev@dpdk.org; Ananyev, Konstantin
> Subject: RE: [dpdk-dev] [PATCH v3 0/3] enhance TX checksum command and cs=
um forwarding engine
>=20
> Hi Olivier,
>=20
> > -----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
> >
> > Hi Jijiang,
> >
> > 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 packe=
t.
> > >                 tunnel =3D 1;
> > > else
> > >             Csum fwd engine will not analyze if incoming packet is a =
tunneling
> > packet, and treat all the incoming packets as non-tunneling packets.
> > >             It is used for A.
> >
> > What about "recognize-tunnel" instead of "sw-tunnel-mode"?
> > Or "parse-tunnel"?
>=20
> Ok,  "parse-tunnel" or "parse-tunnel-pkt" is better.
> Thanks.
>=20
>=20
> > To me, using "sw-" or "hw-" prefix is confusing because in any case the=
 checksums
> > can be calculated in software or hardware depending on "tx_checksum set=
 outer-
> > ip hw|sw".
> >
> > Moreover, this command has an impact on receive side, but the name is s=
till
> > "tx_checksum". Maybe this is also confusing.
> Ok,  how about this?
>=20
> set  checksum parse-tunnel-pkt on|off  (port-id)
>=20
> > > 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=
 checksum
> > offload.
> > > 	       It is used for B.1
> > >             Else
> > >                        Csum fwd engine doesn't  set PKT_TX_UDP_TUNNEL=
_PKT offload
> > flag, which means  tell HW to treat the packet as ordinary (non-tunnell=
ed) packet.
> > > 	      It is used for B.2
> > > }
> >
> > 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
>=20
> Let me explain that what differences of  TX checksum mechanism between ix=
gbe(82599) and i40e(40G NIC) are.
>=20
> For 82599, there is only one register that is used for L3 checksum offloa=
d. So for tunneling packet, hardware is unable to recognize the
> packet is tunneling packet and  the register cannot be worked for both ou=
ter L3 checksum offload and inner L3 checksum offload at the
> same time,  just for outer or inner.
>=20
> For i40e(40G NIC),  there are two registers that are user for L3 TX check=
sum offload, so for tunneling packet, the outer and inner L3
> checksum offload  can be done by hardware at the same time, but a prerequ=
isite is that we must tell
> Hardware the packet is a tunneling packet by setting a register (PKT_TX_U=
DP_TUNNEL_PKT offload flag is used to indicate to set this
> register.)
>=20
> As for other NIC, I think its working mechanism should be same as the i40=
e if it can recognize tunneling packet.
>=20
> So my idea:
> tx_checksum set tunnel-method  tunnel-pkt on|off
>=20
> or
> tx_checksum set tunnel-pkt on|off
>=20
> What do you think?
>=20
>=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?
>=20
> Currently, if outer l4  will be supported in the future, and we can add o=
uter-udp/tcp option into following command.
> Tx_checksum set outer-ip|ip|sctp|udp|tcp.
>=20
>=20
> > > Yes.
> > > Currently, i40e support outer l3, outer l4, l3 and l4 checksums offlo=
ad at the
> > same time.
> Sorry, my bad.
> I40e just support outer l3, l3 and l4.
>=20
> Fortville can offload the following L3 and L4 integrity checks: IPv4 head=
er(s) checksum for "simple" and tunneled packets, Inner TCP or
> UDP checksum and SCTP CRC integrity. Tunneling UDP headers and GRE header=
 are not offloaded while Fortville leaves their checksum
> field as is. If a checksum is required, software should provide it as wel=
l as the inner checksum value(s) that are required for the outer
> checksum.
>=20
> >
> > >> I have another idea, please let me know if you find it clearer or no=
t.
> > >> The commands format would be:
> > >>
> > >> tx_checksum <pkt-type> <field1> <action1> <field2> <action2> ...
> > >>
> > >> [...]
> > >>
> > >> 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 l=
ine is
> > exact match, so you probably have to add duplicated codes when you want=
 to
> > support a new packet types.
> >
> > I don't think it's really a problem. The cmdline library supports strin=
g list, so can
> > have the following 3 commands definitions:
> >
> > 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 vxla=
n
> > outer-l3 off|sw|hw outer-l4 off|sw|hw
> >
> > Maybe 1 and 2 could be splitted in non-vxlan and vxlan. But only the st=
ructure
> > should be redefined to have a different help string, not the callback f=
unction.
>=20
>=20
> Ok, but I think you probably need to add many string in the list :)
>=20
> > > Other question:
> > >
> > > Currently, the following testpmd flag is for per port, not for per pa=
cket type,
> > when they are set, which will affect whole port, not just for packet ty=
pe or format,
> > if you  add  <pkt-type> option in cmdline, which means you have to othe=
r
> > 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
> >
> > We can add a portid in each command.
>=20
> Ok, but I think your idea will make the csum fwd engine more complicated.
>=20
> > > Of course, it is welcome if you can send this patch set with this ide=
a for
> > community review.
> > Let's first agree on the user API :)
>=20
> If you don't have more comments and questions on my current solution, I w=
ill send new patch set.
> Or you can send your patch.
> Anyway, our goal is the same.

To be honest, there are so many mails around that subject, so I am already =
lost :)
Oliver, as I understand you are not happy with the test-pmd commands Frank =
is proposing.
Both syntax and semantics.
Is that correct?
If so, could you suggest something from your side?
That would allow to configure test-pmd to behave in any of 4 possible ways =
we discussed previously:
http://dpdk.org/ml/archives/dev/2014-December/009213.html
Thanks
Konstantin

>=20
> >
> > Regards,
> > Olivier
> >
> >