From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4D94FCE7 for ; Tue, 10 Feb 2015 07:41:28 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 09 Feb 2015 22:41:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,548,1418112000"; d="scan'208";a="525181707" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by orsmga003.jf.intel.com with ESMTP; 09 Feb 2015 22:33:22 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 10 Feb 2015 14:40:53 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.161]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.197]) with mapi id 14.03.0195.001; Tue, 10 Feb 2015 14:40:52 +0800 From: "Zhang, Helin" To: Olivier Matz , "dev@dpdk.org" Thread-Topic: [PATCH v2 04/20] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT flag Thread-Index: AQHQQFyW9pYlndMRlEiQQxfk8EOzcZzpdYNg Date: Tue, 10 Feb 2015 06:40:52 +0000 Message-ID: References: <1422623775-8050-1-git-send-email-olivier.matz@6wind.com> <1423041925-26956-1-git-send-email-olivier.matz@6wind.com> <1423041925-26956-5-git-send-email-olivier.matz@6wind.com> In-Reply-To: <1423041925-26956-5-git-send-email-olivier.matz@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 Subject: Re: [dpdk-dev] [PATCH v2 04/20] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT flag 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: Tue, 10 Feb 2015 06:41:28 -0000 > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Wednesday, February 4, 2015 5:25 PM > To: dev@dpdk.org > Cc: Ananyev, Konstantin; Liu, Jijiang; Zhang, Helin; olivier.matz@6wind.c= om > Subject: [PATCH v2 04/20] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT > flag >=20 > The definition of the flag in rte_mbuf.h was: > TX packet is an UDP tunneled packet. It must be specified when using > outer checksum offload (PKT_TX_OUTER_IP_CKSUM) >=20 > This flag was used to tell the NIC that the offload type is UDP > (I40E_TXD_CTX_UDP_TUNNELING flag). In the datasheet, it says it's require= d > to specify the tunnel type in the register. However, some tests (see [1])= showed > that it also works without this flag. As it was clarified by the datasheet author, we should follow the datasheet= finally. Setting the registers according to what we found will not ensure it is alwa= ys correct, as there will be new firmware releases in the near future. I am OK to do like it at this moment, and wait for the next firmware releas= e. >=20 > Moreover, it is not explained how the hardware use this information. From= a > network perspective, this information is useless for calculating the oute= r IP > checksum as it does not depend on the payload. >=20 > Having this flag in the API would force the application to specify the tu= nnel type > for something that looks only useful for this PMD. It will limit the numb= er of > possible tunnel types (we would need a flag for each tunnel type) and the= refore > prevent to support outer IP checksum for proprietary tunnels. Two or more bits can be allocated later to define several enum tunnel types= in the future. Standard known tunnel types and extended unknown tunnel types can be define= d in it. >=20 > Finally, if a hardware advertises "I support outer IP checksum", it must = be > supported for any payload types. >=20 > This has been validated by [2], knowing that the ipip test case was fixed= after > this test report [3]. >=20 > [1] http://dpdk.org/ml/archives/dev/2015-January/011380.html > [2] http://dpdk.org/ml/archives/dev/2015-January/011475.html > [3] http://dpdk.org/ml/archives/dev/2015-January/011610.html >=20 > Signed-off-by: Olivier Matz > --- > lib/librte_pmd_i40e/i40e_rxtx.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_r= xtx.c > index 9acdeee..0786255 100644 > --- a/lib/librte_pmd_i40e/i40e_rxtx.c > +++ b/lib/librte_pmd_i40e/i40e_rxtx.c > @@ -482,7 +482,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags, > } >=20 > /* UDP tunneling packet TX checksum offload */ > - if (unlikely(ol_flags & PKT_TX_UDP_TUNNEL_PKT)) { > + if (unlikely(ol_flags & PKT_TX_OUTER_IP_CKSUM)) { Unlikely might not be suitable anymore. Regards, Helin >=20 > *td_offset |=3D (outer_l2_len >> 1) > << I40E_TX_DESC_LENGTH_MACLEN_SHIFT; @@ -497,7 > +497,6 @@ i40e_txd_enable_checksum(uint64_t ol_flags, > /* Now set the ctx descriptor fields */ > *cd_tunneling |=3D (outer_l3_len >> 2) << > I40E_TXD_CTX_QW0_EXT_IPLEN_SHIFT | > - I40E_TXD_CTX_UDP_TUNNELING | > (l2_len >> 1) << > I40E_TXD_CTX_QW0_NATLEN_SHIFT; >=20 > @@ -1165,8 +1164,7 @@ i40e_calc_context_desc(uint64_t flags) { > uint64_t mask =3D 0ULL; >=20 > - if (flags | PKT_TX_UDP_TUNNEL_PKT) > - mask |=3D PKT_TX_UDP_TUNNEL_PKT; > + mask |=3D PKT_TX_OUTER_IP_CKSUM; >=20 > #ifdef RTE_LIBRTE_IEEE1588 > mask |=3D PKT_TX_IEEE1588_TMST; > -- > 2.1.4