Message ID | 1421883395-27235-5-git-send-email-olivier.matz@6wind.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id E7A565AAB; Thu, 22 Jan 2015 00:36:54 +0100 (CET) Received: from mail-we0-f179.google.com (mail-we0-f179.google.com [74.125.82.179]) by dpdk.org (Postfix) with ESMTP id D0C195A98 for <dev@dpdk.org>; Thu, 22 Jan 2015 00:36:50 +0100 (CET) Received: by mail-we0-f179.google.com with SMTP id q59so22435317wes.10 for <dev@dpdk.org>; Wed, 21 Jan 2015 15:36:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R1Ma5FmmSLD/sUwMadWnC0CaeTUVrENDcAtz19qZUng=; b=VL4AYw1gn0xEQQRE3cIHoLZSZEr+5V2FGXAvtMmYdMW/WWKx0iOox+NgM+wudtz+0C zhNGRuY/MWYGtqShSO9VgeYRgzoMTUJ2VZsZW+Fun+fJtvcYRW4x7Iy+Vp+dYV1UV1Qe RUJNLMn9Kf5D3XxSkl0kF06s4gQ7XGiWXAxmXJ4ZPNkxpwEZCb//eju01hrxTwGDqv77 S5X78hxC5b916y8oLuOZx9bDAgqz5HlSsKwiOfETHcg04oReJzkE+Wmn/JSgpmWuC1hV 1z/0O1ZAA3uSUYZF/BUX5bE0Il282l5DcKUtR78rPAHC2HxKMa1mKaLg0MAATCu2st6Z pCng== X-Gm-Message-State: ALoCoQnKuF22o3vd+/ZdSwaZIw8nQOqhSXERpNkkKHFwgO7kVRwVpQC6Nm4zg0TtM8Zf7XUGgyCe X-Received: by 10.180.206.165 with SMTP id lp5mr61451317wic.83.1421883410630; Wed, 21 Jan 2015 15:36:50 -0800 (PST) Received: from glumotte.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id wa5sm1710761wjc.8.2015.01.21.15.36.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Jan 2015 15:36:50 -0800 (PST) From: Olivier Matz <olivier.matz@6wind.com> To: dev@dpdk.org Date: Thu, 22 Jan 2015 00:36:23 +0100 Message-Id: <1421883395-27235-5-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1421883395-27235-1-git-send-email-olivier.matz@6wind.com> References: <1421883395-27235-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [RFC 04/16] 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 <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> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Olivier Matz
Jan. 21, 2015, 11:36 p.m. UTC
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)
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
required to specify the tunnel type in the register. However, some tests
(see [1]) showed that it also works without this flag.
Moreover, it is not explained how the hardware use this
information. From a network perspective, this information is useless for
calculating the outer IP checksum as it does not depend on the payload.
Having this flag in the API would force the application to specify the
tunnel type for something that looks only useful for this PMD. It will
limit the number of possible tunnel types (we would need a flag for each
tunnel type) and therefore prevent to support outer IP checksum for
proprietary tunnels.
Finally, if a hardware advertises "I support outer IP checksum", it must
be supported for any payload types.
[1] http://dpdk.org/ml/archives/dev/2015-January/011380.html
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_pmd_i40e/i40e_rxtx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Comments
Hi, > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Thursday, January 22, 2015 7:36 AM > To: dev@dpdk.org > Cc: olivier.matz@6wind.com; Ananyev, Konstantin; Liu, Jijiang > Subject: [RFC 04/16] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT flag > > 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) > > 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 required > to specify the tunnel type in the register. However, some tests (see [1]) > showed that it also works without this flag. > > Moreover, it is not explained how the hardware use this information. From a > network perspective, this information is useless for calculating the outer IP > checksum as it does not depend on the payload. > > Having this flag in the API would force the application to specify the tunnel > type for something that looks only useful for this PMD. It will limit the > number of possible tunnel types (we would need a flag for each tunnel type) > and therefore prevent to support outer IP checksum for proprietary tunnels. > > Finally, if a hardware advertises "I support outer IP checksum", it must be > supported for any payload types. > > [1] http://dpdk.org/ml/archives/dev/2015-January/011380.html > > Signed-off-by: Olivier Matz <olivier.matz@6wind.com> > --- > lib/librte_pmd_i40e/i40e_rxtx.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.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, > } > > /* UDP tunneling packet TX checksum offload */ > - if (unlikely(ol_flags & PKT_TX_UDP_TUNNEL_PKT)) { > + if (unlikely(ol_flags & PKT_TX_OUTER_IP_CKSUM)) { This way will disable FVL TX checksum offload capability of inner IP and inner L4 using B.1 method. Again, the B.1 in http://dpdk.org/ml/archives/dev/2014-December/009213.html should be supported and allowed. Helin, you are i40e maintainer, what's your point? > *td_offset |= (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 |= (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; > > @@ -1165,8 +1164,7 @@ i40e_calc_context_desc(uint64_t flags) { > uint64_t mask = 0ULL; > > - if (flags | PKT_TX_UDP_TUNNEL_PKT) > - mask |= PKT_TX_UDP_TUNNEL_PKT; > + mask |= PKT_TX_OUTER_IP_CKSUM; > > #ifdef RTE_LIBRTE_IEEE1588 > mask |= PKT_TX_IEEE1588_TMST; > -- > 2.1.3
Hi guys > -----Original Message----- > From: Liu, Jijiang > Sent: Friday, January 23, 2015 4:06 PM > To: Olivier Matz; Zhang, Helin > Cc: Ananyev, Konstantin; dev@dpdk.org > Subject: RE: [RFC 04/16] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT > flag > > Hi, > > > -----Original Message----- > > From: Olivier Matz [mailto:olivier.matz@6wind.com] > > Sent: Thursday, January 22, 2015 7:36 AM > > To: dev@dpdk.org > > Cc: olivier.matz@6wind.com; Ananyev, Konstantin; Liu, Jijiang > > Subject: [RFC 04/16] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT > > flag > > > > 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) > > > > 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 > > required to specify the tunnel type in the register. However, some > > tests (see [1]) showed that it also works without this flag. > > > > Moreover, it is not explained how the hardware use this information. > > From a network perspective, this information is useless for > > calculating the outer IP checksum as it does not depend on the payload. > > > > Having this flag in the API would force the application to specify the > > tunnel type for something that looks only useful for this PMD. It will > > limit the number of possible tunnel types (we would need a flag for > > each tunnel type) and therefore prevent to support outer IP checksum for > proprietary tunnels. > > > > Finally, if a hardware advertises "I support outer IP checksum", it > > must be supported for any payload types. > > > > [1] http://dpdk.org/ml/archives/dev/2015-January/011380.html > > > > Signed-off-by: Olivier Matz <olivier.matz@6wind.com> > > --- > > lib/librte_pmd_i40e/i40e_rxtx.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c > > b/lib/librte_pmd_i40e/i40e_rxtx.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, > > } > > > > /* UDP tunneling packet TX checksum offload */ > > - if (unlikely(ol_flags & PKT_TX_UDP_TUNNEL_PKT)) { > > + if (unlikely(ol_flags & PKT_TX_OUTER_IP_CKSUM)) { > > This way will disable FVL TX checksum offload capability of inner IP and inner > L4 using B.1 method. > > Again, the B.1 in > http://dpdk.org/ml/archives/dev/2014-December/009213.html should be > supported and allowed. > > Helin, you are i40e maintainer, what's your point? Can we list all the possible checksum cases (with or without hardware offloads)? 1. Outer IP (hw csum) + inner IP (hw csum) + L4 (hw csum) 2. Outer IP (hw csum) + inner IP (hw csum) + L4 (sw csum) 3. Outer IP (hw csum) + inner IP (sw csum) + L4 (hw csum) 4. Outer IP (hw csum) + inner IP (sw csum) + L4 (sw csum) 5. Outer IP (sw csum) + inner IP (hw csum) + L4 (hw csum) 6. Outer IP (sw csum) + inner IP (hw csum) + L4 (sw csum) 7. Outer IP (sw csum) + inner IP (sw csum) + L4 (hw csum) 8. Outer IP (sw csum) + inner IP (sw csum) + L4 (sw csum) Does any hardware support all of these cases? If yes, I think we should to have a solution to support all of them. > > > > *td_offset |= (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 |= (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; > > > > > > > @@ -1165,8 +1164,7 @@ i40e_calc_context_desc(uint64_t flags) { > > uint64_t mask = 0ULL; > > > > - if (flags | PKT_TX_UDP_TUNNEL_PKT) > > - mask |= PKT_TX_UDP_TUNNEL_PKT; > > + mask |= PKT_TX_OUTER_IP_CKSUM; > > > > #ifdef RTE_LIBRTE_IEEE1588 > > mask |= PKT_TX_IEEE1588_TMST; > > -- > > 2.1.3
Hi Helin, On 01/23/2015 09:47 AM, Zhang, Helin wrote: >>> diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c >>> b/lib/librte_pmd_i40e/i40e_rxtx.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, >>> } >>> >>> /* UDP tunneling packet TX checksum offload */ >>> - if (unlikely(ol_flags & PKT_TX_UDP_TUNNEL_PKT)) { >>> + if (unlikely(ol_flags & PKT_TX_OUTER_IP_CKSUM)) { >> >> This way will disable FVL TX checksum offload capability of inner IP and inner >> L4 using B.1 method. >> >> Again, the B.1 in >> http://dpdk.org/ml/archives/dev/2014-December/009213.html should be >> supported and allowed. >> >> Helin, you are i40e maintainer, what's your point? > > Can we list all the possible checksum cases (with or without hardware offloads)? > 1. Outer IP (hw csum) + inner IP (hw csum) + L4 (hw csum) > 2. Outer IP (hw csum) + inner IP (hw csum) + L4 (sw csum) > 3. Outer IP (hw csum) + inner IP (sw csum) + L4 (hw csum) case 6 in [1] > 4. Outer IP (hw csum) + inner IP (sw csum) + L4 (sw csum) case 1 in [1] > 5. Outer IP (sw csum) + inner IP (hw csum) + L4 (hw csum) > 6. Outer IP (sw csum) + inner IP (hw csum) + L4 (sw csum) > 7. Outer IP (sw csum) + inner IP (sw csum) + L4 (hw csum) case 3 and 4 in [1] > 8. Outer IP (sw csum) + inner IP (sw csum) + L4 (sw csum) no hardware offload Removing the PKT_TX_UDP_TUNNEL_PKT does not prevent to do an operation from the user point of view. In i40e, there are 2 ways to calculate the inner checksums. The idea is to have only one in the mbuf API, and to let the driver decide how to talk to the hardware, but it's not the user problem. Regards, Olivier [1] http://dpdk.org/ml/archives/dev/2015-January/011127.html
diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.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, } /* UDP tunneling packet TX checksum offload */ - if (unlikely(ol_flags & PKT_TX_UDP_TUNNEL_PKT)) { + if (unlikely(ol_flags & PKT_TX_OUTER_IP_CKSUM)) { *td_offset |= (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 |= (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; @@ -1165,8 +1164,7 @@ i40e_calc_context_desc(uint64_t flags) { uint64_t mask = 0ULL; - if (flags | PKT_TX_UDP_TUNNEL_PKT) - mask |= PKT_TX_UDP_TUNNEL_PKT; + mask |= PKT_TX_OUTER_IP_CKSUM; #ifdef RTE_LIBRTE_IEEE1588 mask |= PKT_TX_IEEE1588_TMST;