DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 09/20] testpmd: rename vxlan in outer_ip in csum commands
Date: Fri, 30 Jan 2015 14:16:04 +0100	[thread overview]
Message-ID: <1422623775-8050-10-git-send-email-olivier.matz@6wind.com> (raw)
In-Reply-To: <1422623775-8050-1-git-send-email-olivier.matz@6wind.com>

The tx_checksum command concerns outer IP checksum, not VxLAN checksum.
Actually there is no checkum in VxLAN header, there is one checksum in
outer IP header, and one checksum in outer UDP header. This option only
controls the outer IP checksum.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 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(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 62def61..98f7a1c 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"
 
-			"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"
@@ -2889,8 +2889,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");
 
 	/* display warnings if configuration is not supported by the NIC */
 	rte_eth_dev_info_get(port_id, &dev_info);
@@ -2944,8 +2944,8 @@ cmd_csum_parsed(void *parsed_result,
 			mask = TESTPMD_TX_OFFLOAD_TCP_CKSUM;
 		} else if (!strcmp(res->proto, "sctp")) {
 			mask = TESTPMD_TX_OFFLOAD_SCTP_CKSUM;
-		} else if (!strcmp(res->proto, "vxlan")) {
-			mask = TESTPMD_TX_OFFLOAD_VXLAN_CKSUM;
+		} else if (!strcmp(res->proto, "outer-ip")) {
+			mask = TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM;
 		}
 
 		if (hw)
@@ -2964,7 +2964,7 @@ cmdline_parse_token_string_t cmd_csum_mode =
 				mode, "set");
 cmdline_parse_token_string_t cmd_csum_proto =
 	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 =
 	TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
 				hwsw, "hw#sw");
@@ -2976,7 +2976,7 @@ cmdline_parse_inst_t cmd_csum_set = {
 	.f = cmd_csum_parsed,
 	.data = NULL,
 	.help_str = "enable/disable hardware calculation of L3/L4 checksum when "
-		"using csum forward engine: csum set ip|tcp|udp|sctp|vxlan hw|sw <port>",
+		"using csum forward engine: csum set ip|tcp|udp|sctp|outer-ip hw|sw <port>",
 	.tokens = {
 		(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 = 0;
 		ol_flags |= PKT_TX_OUTER_IPV4;
 
-		if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_VXLAN_CKSUM)
+		if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM)
 			ol_flags |= PKT_TX_OUTER_IP_CKSUM;
 		else
 			ipv4_hdr->hdr_checksum = 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 |= PKT_TX_OUTER_IPV6;
 
+	/* outer UDP checksum is always done in software as we have no
+	 * hardware supporting it today, and no API for it. */
+
 	udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + outer_l3_len);
 	/* do not recalculate udp cksum if it was 0 */
 	if (udp_hdr->dgram_cksum != 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) */
 
 		if (tunnel == 1) {
-			if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_VXLAN_CKSUM) {
+			if (testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM) {
 				m->outer_l2_len = outer_l2_len;
 				m->outer_l3_len = outer_l3_len;
 				m->l2_len = l4_tun_len + l2_len;
 				m->l3_len = l3_len;
 			}
 			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 = 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=%d\n",
 					m->l2_len, m->l3_len, m->l4_len);
 			if ((tunnel == 1) &&
-				(testpmd_ol_flags & TESTPMD_TX_OFFLOAD_VXLAN_CKSUM))
+				(testpmd_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM))
 				printf("tx: m->outer_l2_len=%d m->outer_l3_len=%d\n",
 					m->outer_l2_len, m->outer_l3_len);
 			if (tso_segsz != 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 tunnels */
+#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.4

  parent reply	other threads:[~2015-01-30 13:16 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 23:36 [dpdk-dev] [RFC 00/16] enhance checksum offload API Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 01/16] mbuf: remove PKT_TX_IPV4_CSUM Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 02/16] mbuf: enhance the API documentation of offload flags Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 03/16] i40e: call i40e_txd_enable_checksum only for offloaded packets Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 04/16] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT flag Olivier Matz
2015-01-23  8:06   ` Liu, Jijiang
2015-01-23  8:47     ` Zhang, Helin
2015-01-23  9:06       ` Olivier MATZ
2015-01-21 23:36 ` [dpdk-dev] [RFC 05/16] mbuf: remove " Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 06/16] ethdev: add outer IP offload capability flag Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 07/16] i40e: advertise outer IPv4 checksum capability Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 08/16] testpmd: replace tx_checksum command by csum Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 09/16] testpmd: move csum_show in a function Olivier Matz
2015-01-23 11:03   ` Liu, Jijiang
2015-01-23 17:53     ` Olivier MATZ
2015-01-21 23:36 ` [dpdk-dev] [RFC 10/16] testpmd: add csum parse_tunnel command Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 11/16] testpmd: rename vxlan in outer_ip in csum commands Olivier Matz
2015-01-23 11:21   ` Liu, Jijiang
2015-01-23 17:49     ` Olivier MATZ
2015-01-21 23:36 ` [dpdk-dev] [RFC 12/16] testpmd: introduce parse_ipv* in csum fwd engine Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 13/16] testpmd: use a structure to store offload info " Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 14/16] testpmd: introduce parse_vxlan " Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 15/16] testpmd: support gre tunnels " Olivier Matz
2015-01-21 23:36 ` [dpdk-dev] [RFC 16/16] testpmd: support ipip tunnel in csum forward engine Olivier Matz
2015-01-21 23:41 ` [dpdk-dev] [RFC 00/16] enhance checksum offload API Olivier MATZ
2015-01-22 10:00   ` Thomas Monjalon
2015-01-22  1:01 ` Stephen Hemminger
2015-01-23  9:52   ` Olivier MATZ
2015-01-23  7:54 ` Liu, Jijiang
2015-01-30 13:15 ` [dpdk-dev] [PATCH 00/20] enhance tx " Olivier Matz
2015-01-30 13:15   ` [dpdk-dev] [PATCH 01/20] mbuf: remove PKT_TX_IPV4_CSUM Olivier Matz
2015-01-30 13:15   ` [dpdk-dev] [PATCH 02/20] mbuf: enhance the API documentation of offload flags Olivier Matz
2015-01-30 13:15   ` [dpdk-dev] [PATCH 03/20] i40e: call i40e_txd_enable_checksum only for offloaded packets Olivier Matz
2015-01-30 13:15   ` [dpdk-dev] [PATCH 04/20] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT flag Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 05/20] mbuf: remove " Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 06/20] testpmd: replace tx_checksum command by csum Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 07/20] testpmd: move csum_show in a function Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 08/20] testpmd: add csum parse_tunnel command Olivier Matz
2015-01-30 13:16   ` Olivier Matz [this message]
2015-01-30 13:16   ` [dpdk-dev] [PATCH 10/20] testpmd: introduce parse_ipv* in csum fwd engine Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 11/20] testpmd: use a structure to store offload info " Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 12/20] testpmd: introduce parse_vxlan " Olivier Matz
2015-02-02  1:49     ` Liu, Jijiang
2015-01-30 13:16   ` [dpdk-dev] [PATCH 13/20] testpmd: support gre tunnels " Olivier Matz
2015-02-02  3:04     ` Liu, Jijiang
2015-01-30 13:16   ` [dpdk-dev] [PATCH 14/20] testpmd: support ipip tunnel in csum forward engine Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 15/20] ethdev: add outer IP offload capability flag Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 16/20] i40e: advertise outer IPv4 checksum capability Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 17/20] testpmd: add a warning if outer ip cksum requested but not supported Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 18/20] testpmd: fix TSO when using outer checksum offloads Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 19/20] i40e: fix offloading of outer checksum for ip in ip tunnels Olivier Matz
2015-01-30 13:16   ` [dpdk-dev] [PATCH 20/20] i40e: add debug logs for tx context descriptors Olivier Matz
2015-02-04  9:25   ` [dpdk-dev] [PATCH v2 00/20] enhance tx checksum offload API Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 01/20] mbuf: remove PKT_TX_IPV4_CSUM Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 02/20] mbuf: enhance the API documentation of offload flags Olivier Matz
2015-02-10  5:38       ` Zhang, Helin
2015-02-10 16:54         ` Olivier MATZ
2015-02-11  7:15         ` Liu, Jijiang
2015-02-11 15:15           ` Olivier MATZ
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 03/20] i40e: call i40e_txd_enable_checksum only for offloaded packets Olivier Matz
2015-02-10  6:03       ` Zhang, Helin
2015-02-10 17:06         ` Olivier MATZ
2015-02-11  5:32           ` Zhang, Helin
2015-02-11 17:13             ` Olivier MATZ
2015-02-13  2:25               ` Zhang, Helin
2015-02-13  8:41                 ` Olivier MATZ
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 04/20] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT flag Olivier Matz
2015-02-10  6:40       ` Zhang, Helin
2015-02-10 17:08         ` Olivier MATZ
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 05/20] mbuf: remove " Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 06/20] testpmd: replace tx_checksum command by csum Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 07/20] testpmd: move csum_show in a function Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 08/20] testpmd: add csum parse_tunnel command Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 09/20] testpmd: rename vxlan in outer_ip in csum commands Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 10/20] testpmd: introduce parse_ipv* in csum fwd engine Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 11/20] testpmd: use a structure to store offload info " Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 12/20] testpmd: introduce parse_vxlan " Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 13/20] testpmd: support gre tunnels " Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 14/20] testpmd: support ipip tunnel in csum forward engine Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 15/20] ethdev: add outer IP offload capability flag Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 16/20] i40e: advertise outer IPv4 checksum capability Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 17/20] testpmd: add a warning if outer ip cksum requested but not supported Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 18/20] testpmd: fix TSO when using outer checksum offloads Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 19/20] i40e: fix offloading of outer checksum for ip in ip tunnels Olivier Matz
2015-02-04  9:25     ` [dpdk-dev] [PATCH v2 20/20] i40e: add debug logs for tx context descriptors Olivier Matz
2015-02-09  1:10     ` [dpdk-dev] [PATCH v2 00/20] enhance tx checksum offload API Liu, Jijiang
2015-02-13  9:22     ` [dpdk-dev] [PATCH v3 " Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 01/20] mbuf: remove PKT_TX_IPV4_CSUM Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 02/20] mbuf: enhance the API documentation of offload flags Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 03/20] i40e: call i40e_txd_enable_checksum only for offloaded packets Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 04/20] i40e: remove the use of PKT_TX_UDP_TUNNEL_PKT flag Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 05/20] mbuf: remove " Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 06/20] testpmd: replace tx_checksum command by csum Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 07/20] testpmd: move csum_show in a function Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 08/20] testpmd: add csum parse_tunnel command Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 09/20] testpmd: rename vxlan in outer_ip in csum commands Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 10/20] testpmd: introduce parse_ipv* in csum fwd engine Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 11/20] testpmd: use a structure to store offload info " Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 12/20] testpmd: introduce parse_vxlan " Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 13/20] testpmd: support gre tunnels " Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 14/20] testpmd: support ipip tunnel in csum forward engine Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 15/20] ethdev: add outer IP offload capability flag Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 16/20] i40e: advertise outer IPv4 checksum capability Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 17/20] testpmd: add a warning if outer ip cksum requested but not supported Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 18/20] testpmd: fix TSO when using outer checksum offloads Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 19/20] i40e: fix offloading of outer checksum for ip in ip tunnels Olivier Matz
2015-02-13  9:22       ` [dpdk-dev] [PATCH v3 20/20] i40e: add debug logs for tx context descriptors Olivier Matz
2015-02-15  6:22       ` [dpdk-dev] [PATCH v3 00/20] enhance tx checksum offload API Liu, Jijiang
2015-02-16 18:23         ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1422623775-8050-10-git-send-email-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).