From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id EE13E231C for ; Thu, 27 Nov 2014 09:50:49 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 27 Nov 2014 00:48:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,468,1413270000"; d="scan'208";a="644406461" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by orsmga002.jf.intel.com with ESMTP; 27 Nov 2014 00:50:46 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 27 Nov 2014 16:50:46 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.86]) with mapi id 14.03.0195.001; Thu, 27 Nov 2014 16:50:44 +0800 From: "Liu, Jijiang" To: "Ananyev, Konstantin" , Olivier MATZ , Thomas Monjalon , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 0/3] i40e VXLAN TX checksum rework Thread-Index: AQHQChvO5Hbj694uHUagPyQ5KbGpNZx0KW9g Date: Thu, 27 Nov 2014 08:50:43 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC01D9EDBC@SHSMSX101.ccr.corp.intel.com> References: <1417076319-629-1-git-send-email-jijiang.liu@intel.com> In-Reply-To: <1417076319-629-1-git-send-email-jijiang.liu@intel.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 0/3] i40e VXLAN TX checksum rework 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: Thu, 27 Nov 2014 08:50:50 -0000 Could you review this patch today ?=20 If possible, I hope this patch set can be included RC2. > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jijiang Liu > Sent: Thursday, November 27, 2014 4:19 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH 0/3] i40e VXLAN TX checksum rework >=20 > We have got some feedback about backward compatibility of VXLAN TX checks= um > offload API with 1G/10G NIC after the i40e VXLAN TX checksum codes were > applied, so we have to rework the APIs on i40e, including the changes of = mbuf, > i40e PMD and csum engine. >=20 > The main changes in mbuf are as follows, In place of removing > PKT_TX_VXLAN_CKSUM, we introducing 2 new flags: PKT_TX_OUT_IP_CKSUM, > PKT_TX_UDP_TUNNEL_PKT, and a new field: l4_tun_len. > Replace the inner_l2_len and the inner_l3_len field with the outer_l2_len= and > outer_l3_len field. >=20 > The existing flags are listed below, > PKT_TX_IP_CKSUM: HW IPv4 checksum for non-tunnelling packet/ HW inner > IPv4 checksum for tunnelling packet > PKT_TX_TCP_CKSUM: HW TCP checksum for non-tunnelling packet/ HW inner > TCP checksum for tunnelling packet > PKT_TX_SCTP_CKSUM: HW SCTP checksum for non-tunnelling packet/ HW inner > SCTP checksum for tunnelling packet > PKT_TX_UDP_CKSUM: HW SCTP checksum for non-tunnelling packet/ HW inner > SCTP checksum for tunnelling packet > PKT_TX_IPV4: IPv4 with no HW checksum offload for non-tunnelling > packet/inner IPv4 with no HW checksum offload for tunnelling packet > PKT_TX_IPV6: IPv6 non-tunnelling packet/ inner IPv6 with no HW che= cksum > offload for tunnelling packet >=20 > let's use a few examples to demonstrate how to use these flags: > Let say we have a tunnel packet: > eth_hdr_out/ipv4_hdr_out/udp_hdr_out/vxlan_hdr/ehtr_hdr_in/ipv4_hdr_in/tc= p > _hdr_in.There could be several scenarios: >=20 > A) User requests HW offload for ipv4_hdr_out checksum. > He doesn't care is it a tunnelled packet or not. > So he sets: >=20 > mb->l2_len =3D eth_hdr_out; > mb->l3_len =3D ipv4_hdr_out; > mb->ol_flags |=3D PKT_TX_IPV4_CSUM; >=20 > B) User is aware that it is a tunnelled packet and requests HW offload fo= r > ipv4_hdr_in and tcp_hdr_in *only*. > He doesn't care about outer IP checksum offload. > In that case, for FVL he has 2 choices: > 1. Treat that packet as a 'proper' tunnelled packet, and fill all the = fields: > mb->l2_len =3D eth_hdr_in; > mb->l3_len =3D ipv4_hdr_in; > mb->outer_l2_len =3D eth_hdr_out; > mb->outer_l3_len =3D ipv4_hdr_out; > mb->l4tun_len =3D vxlan_hdr; > mb->ol_flags |=3D PKT_TX_UDP_TUNNEL_PKT | PKT_TX_IP_CKSUM | > PKT_TX_TCP_CKSUM; >=20 > 2. As user doesn't care about outer IP hdr checksum, he can treat ever= ything > before ipv4_hdr_in as L2 header. > So he knows, that it is a tunnelled packet, but makes HW to treat it a= s ordinary > (non-tunnelled) packet: > mb->l2_len =3D eth_hdr_out + ipv4_hdr_out + udp_hdr_out + vxlan_hdr = + > ehtr_hdr_in; > mb->l3_len =3D ipv4_hdr_in; > mb->ol_flags |=3D PKT_TX_IP_CKSUM | PKT_TX_TCP_CKSUM; >=20 > i40e PMD will support both B.1 and B.2. > ixgbe/igb/em PMD supports only B.2. > if HW supports both - it will be up to user app which method to choose. > tespmd will support both methods, and it should be configurable by user w= hich > approach to use (cmdline parameter). > So the user can try/test both methods and select an appropriate for him. >=20 > Now, B.2 is exactly what Oliver suggested. > I think it has few important advantages over B.1: > First of all - compatibility. It works across all HW we currently support > (i40e/ixgbe/igb/em). > Second - it is probably faster even on FVL, as for it we have to fill onl= y TXD, while > with approach #2 we have to fill both TCD and TXD. >=20 > C) User knows that is a tunnelled packet, and wants HW offload for all 3 > checksums: outer IP hdr checksum, inner IP checksum, inner TCP checksum. > Then he has to setup all TX checksum fields: > mb->l2_len =3D eth_hdr_in; > mb->l3_len =3D ipv4_hdr_in; > mb->outer_l2_len =3D eth_hdr_out; > mb->outer_l3_len =3D ipv4_hdr_out; > mb->l4tun_len =3D vxlan_hdr; > mb->ol_flags |=3D PKT_TX_OUT_IP_CKSUM | PKT_TX_UDP_TUNNEL | > PKT_TX_IP_CKSUM | PKT_TX_TCP_CKSUM; >=20 > Jijiang Liu (3): > mbuf change > i40e PMD change in i40e_rxtx.c > rework csum forward engine >=20 > app/test-pmd/csumonly.c | 55 +++++++++++++++++++++------------= ----- > lib/librte_mbuf/rte_mbuf.c | 2 +- > lib/librte_mbuf/rte_mbuf.h | 23 ++++++++++------ > lib/librte_pmd_i40e/i40e_rxtx.c | 40 ++++++++++++--------------- > 4 files changed, 63 insertions(+), 57 deletions(-) >=20 > -- > 1.7.7.6