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 33DF95AF7 for ; Fri, 23 Jan 2015 12:21:39 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 23 Jan 2015 03:15:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,453,1418112000"; d="scan'208";a="655424570" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by fmsmga001.fm.intel.com with ESMTP; 23 Jan 2015 03:21:36 -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; Fri, 23 Jan 2015 19:21:34 +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; Fri, 23 Jan 2015 19:21:27 +0800 From: "Liu, Jijiang" To: Olivier Matz Thread-Topic: [RFC 11/16] testpmd: rename vxlan in outer_ip in csum commands Thread-Index: AQHQNdM9ReH7fDPu8EGkVWblErSf3JzNkZ2g Date: Fri, 23 Jan 2015 11:21:27 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC01DB6402@SHSMSX101.ccr.corp.intel.com> References: <1421883395-27235-1-git-send-email-olivier.matz@6wind.com> <1421883395-27235-12-git-send-email-olivier.matz@6wind.com> In-Reply-To: <1421883395-27235-12-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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [RFC 11/16] testpmd: rename vxlan in outer_ip in csum commands 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: Fri, 23 Jan 2015 11:21:40 -0000 Hi, > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Thursday, January 22, 2015 7:37 AM > To: dev@dpdk.org > Cc: olivier.matz@6wind.com; Ananyev, Konstantin; Liu, Jijiang > Subject: [RFC 11/16] testpmd: rename vxlan in outer_ip in csum commands >=20 > The tx_checksum command concerns outer IP checksum, not VxLAN checksum. > Actually there is no checkum in VxLAN header, there is one checksum in ou= ter IP > header, and one checksum in outer UDP header. This option only controls t= he > outer IP checksum. >=20 > Signed-off-by: Olivier Matz > --- > app/test-pmd/cmdline.c | 16 ++++++++-------- app/test-pmd/csumonly.c |= 25 > ++++++++++++++----------- app/test-pmd/testpmd.h | 4 ++-- > 3 files changed, 24 insertions(+), 21 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 1d294bc..451c728 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -316,12 +316,12 @@ static void cmd_help_long_parsed(void > *parsed_result, > " Disable hardware insertion of a VLAN header in" > " packets sent on a port.\n\n" >=20 > - "csum set (ip|udp|tcp|sctp|vxlan) (hw|sw) (port_id)\n" > + "csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) > (port_id)\n" > " Select hardware or software calculation of the" > " checksum with when transmitting a packet using the" > " csum forward engine.\n" > " ip|udp|tcp|sctp always concern the inner layer.\n" > - " vxlan concerns the outer IP and UDP layer (in" > + " outer-ip concerns the outer IP layer (in" > " case the packet is recognized as a vxlan packet by" > " the forward engine)\n" > " Please check the NIC datasheet for HW limits.\n\n" > @@ -2887,8 +2887,8 @@ csum_show(int port_id) > (ol_flags & TESTPMD_TX_OFFLOAD_TCP_CKSUM) ? "hw" : "sw"); > printf("SCTP checksum offload is %s\n", > (ol_flags & TESTPMD_TX_OFFLOAD_SCTP_CKSUM) ? "hw" : > "sw"); > - printf("VxLAN checksum offload is %s\n", > - (ol_flags & TESTPMD_TX_OFFLOAD_VXLAN_CKSUM) ? "hw" : > "sw"); > + printf("Outer-Ip checksum offload is %s\n", > + (ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) ? "hw" : > "sw"); >=20 > /* display warnings if configuration is not supported by the NIC */ > rte_eth_dev_info_get(port_id, &dev_info); @@ -2942,8 +2942,8 @@ > cmd_csum_parsed(void *parsed_result, > mask =3D TESTPMD_TX_OFFLOAD_TCP_CKSUM; > } else if (!strcmp(res->proto, "sctp")) { > mask =3D TESTPMD_TX_OFFLOAD_SCTP_CKSUM; > - } else if (!strcmp(res->proto, "vxlan")) { > - mask =3D TESTPMD_TX_OFFLOAD_VXLAN_CKSUM; > + } else if (!strcmp(res->proto, "outer-ip")) { > + mask =3D TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM; > } >=20 > if (hw) > @@ -2962,7 +2962,7 @@ cmdline_parse_token_string_t cmd_csum_mode =3D > mode, "set"); > cmdline_parse_token_string_t cmd_csum_proto =3D > TOKEN_STRING_INITIALIZER(struct cmd_csum_result, > - proto, "ip#tcp#udp#sctp#vxlan"); > + proto, "ip#tcp#udp#sctp#outer-ip"); > cmdline_parse_token_string_t cmd_csum_hwsw =3D > TOKEN_STRING_INITIALIZER(struct cmd_csum_result, > hwsw, "hw#sw"); > @@ -2974,7 +2974,7 @@ cmdline_parse_inst_t cmd_csum_set =3D { > .f =3D cmd_csum_parsed, > .data =3D NULL, > .help_str =3D "enable/disable hardware calculation of L3/L4 checksum > when " > - "using csum forward engine: csum set ip|tcp|udp|sctp|vxlan > hw|sw ", > + "using csum forward engine: csum set ip|tcp|udp|sctp|outer-ip > hw|sw > +", > .tokens =3D { > (void *)&cmd_csum_csum, > (void *)&cmd_csum_mode, > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index > 858eb47..3921643 100644 > --- a/app/test-pmd/csumonly.c > +++ b/app/test-pmd/csumonly.c > @@ -259,13 +259,16 @@ process_outer_cksums(void *outer_l3_hdr, uint16_t > outer_ethertype, > ipv4_hdr->hdr_checksum =3D 0; > ol_flags |=3D PKT_TX_OUTER_IPV4; >=20 > - if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_VXLAN_CKSUM) > + if (testpmd_ol_flags & > TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) > ol_flags |=3D PKT_TX_OUTER_IP_CKSUM; > else > ipv4_hdr->hdr_checksum =3D rte_ipv4_cksum(ipv4_hdr); > - } else if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_VXLAN_CKSUM) > + } else if (testpmd_ol_flags & > TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) > ol_flags |=3D PKT_TX_OUTER_IPV6; >=20 > + /* outer UDP checksum is always done in software as we have no > + * hardware supporting it today, and no API for it. */ > + > udp_hdr =3D (struct udp_hdr *)((char *)outer_l3_hdr + outer_l3_len); > /* do not recalculate udp cksum if it was 0 */ > if (udp_hdr->dgram_cksum !=3D 0) { > @@ -300,8 +303,8 @@ process_outer_cksums(void *outer_l3_hdr, uint16_t > outer_ethertype, > * The testpmd command line for this forward engine sets the flags > * TESTPMD_TX_OFFLOAD_* in ports[tx_port].tx_ol_flags. They control > * wether a checksum must be calculated in software or in hardware. The > - * IP, UDP, TCP and SCTP flags always concern the inner layer. The > - * VxLAN flag concerns the outer IP (if packet is recognized as a vxlan = packet). > + * IP, UDP, TCP and SCTP flags always concern the inner layer. The > + * OUTER_IP is only useful for tunnel packets. > */ > static void > pkt_burst_checksum_forward(struct fwd_stream *fs) @@ -432,18 +435,18 @@ > pkt_burst_checksum_forward(struct fwd_stream *fs) > /* step 4: fill the mbuf meta data (flags and header lengths) */ >=20 > if (tunnel =3D=3D 1) { > - if (testpmd_ol_flags & > TESTPMD_TX_OFFLOAD_VXLAN_CKSUM) { > + if (testpmd_ol_flags & > TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) { > m->outer_l2_len =3D outer_l2_len; > m->outer_l3_len =3D outer_l3_len; > m->l2_len =3D l4_tun_len + l2_len; > m->l3_len =3D l3_len; There should be m->l4_len =3D l4_len here. > } > else { > - /* if we don't do vxlan cksum in hw, > - outer checksum will be wrong because > - we changed the ip, but it shows that > - we can process the inner header cksum > - in the nic */ > + /* if there is a outer UDP cksum > + processed in sw and the inner in hw, > + the outer checksum will be wrong as > + the payload will be modified by the > + hardware */ > m->l2_len =3D outer_l2_len + outer_l3_len + > sizeof(struct udp_hdr) + > sizeof(struct vxlan_hdr) + l2_len; @@ - > 502,7 +505,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) > "m->l4_len=3D%d\n", > m->l2_len, m->l3_len, m->l4_len); > if ((tunnel =3D=3D 1) && > - (testpmd_ol_flags & > TESTPMD_TX_OFFLOAD_VXLAN_CKSUM)) > + (testpmd_ol_flags & > TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM)) > printf("tx: m->outer_l2_len=3D%d m- > >outer_l3_len=3D%d\n", > m->outer_l2_len, m->outer_l3_len); > if (tso_segsz !=3D 0) > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index > 36277de..ecb7d38 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -125,8 +125,8 @@ struct fwd_stream { > #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 > +/** Offload outer IP checksum in csum forward engine for recognized tunn= els > */ > +#define TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM 0x0010 > /** Parse tunnel in csum forward engine. If set, dissect tunnel headers > * of rx packets. If not set, treat inner headers as payload. */ > #define TESTPMD_TX_OFFLOAD_PARSE_TUNNEL 0x0020 > -- > 2.1.3