DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xueming Li <xuemingl@mellanox.com>
To: Shahaf Shuler <shahafs@mellanox.com>,
	Nelio Laranjeiro <notifications@github.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Adrien Mazarguil <adrien.mazarguil@6wind.com>
Cc: Xueming Li <xuemingl@mellanox.com>, dev@dpdk.org
Subject: [dpdk-dev] [PATCH v5 1/2] ethdev: introduce generic IP/UDP tunnel checksum and TSO
Date: Fri, 20 Apr 2018 21:06:42 +0800	[thread overview]
Message-ID: <20180420130643.114699-1-xuemingl@mellanox.com> (raw)
In-Reply-To: <20180409121035.148813-1-xuemingl@mellanox.com>

This patch introduce new TX offload flags for device that supports
IP or UDP tunneled packet L3/L4 checksum and TSO offload.
It will be used for non-standard tunnels.

The support from the device is for inner and outer checksums on
IPV4/TCP/UDP and TSO for *any packet with the following format*:

<some headers> / [optional IPv4/IPv6] / [optional TCP/UDP] / <some
headers> / [optional inner IPv4/IPv6] / [optional TCP/UDP]

For example the following packets can use this feature:

1. eth / ipv4 / udp / VXLAN / ip / tcp
2. eth / ipv4 / GRE / MPLS / ipv4 / udp

Please note that specific tunnel headers that contain payload length,
sequence id or checksum will not be updated.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_ether/rte_ethdev.h | 12 ++++++++++++
 lib/librte_mbuf/rte_mbuf.c    |  6 ++++++
 lib/librte_mbuf/rte_mbuf.h    | 25 +++++++++++++++++++++++++
 3 files changed, 43 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 4f417f573..ef152dec6 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -980,6 +980,18 @@ struct rte_eth_conf {
  *   the same mempool and has refcnt = 1.
  */
 #define DEV_TX_OFFLOAD_SECURITY         0x00020000
+/**
+ * Device supports generic UDP tunneled packet TSO.
+ * Application must set PKT_TX_TUNNEL_UDP and other mbuf fields required
+ * for tunnel TSO.
+ */
+#define DEV_TX_OFFLOAD_UDP_TNL_TSO      0x00040000
+/**
+ * Device supports generic IP tunneled packet TSO.
+ * Application must set PKT_TX_TUNNEL_IP and other mbuf fields required
+ * for tunnel TSO.
+ */
+#define DEV_TX_OFFLOAD_IP_TNL_TSO       0x00080000
 
 /*
  * If new Tx offload capabilities are defined, they also must be
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 3f4c83305..64e960d4c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -390,6 +390,8 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
 	case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
 	case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
 	case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP";
+	case PKT_TX_TUNNEL_IP: return "PKT_TX_TUNNEL_IP";
+	case PKT_TX_TUNNEL_UDP: return "PKT_TX_TUNNEL_UDP";
 	case PKT_TX_MACSEC: return "PKT_TX_MACSEC";
 	case PKT_TX_SEC_OFFLOAD: return "PKT_TX_SEC_OFFLOAD";
 	default: return NULL;
@@ -424,6 +426,10 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		  "PKT_TX_TUNNEL_NONE" },
 		{ PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MASK,
 		  "PKT_TX_TUNNEL_NONE" },
+		{ PKT_TX_TUNNEL_IP, PKT_TX_TUNNEL_MASK,
+		  "PKT_TX_TUNNEL_NONE" },
+		{ PKT_TX_TUNNEL_UDP, PKT_TX_TUNNEL_MASK,
+		  "PKT_TX_TUNNEL_NONE" },
 		{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
 		{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
 	};
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 06eceba37..80595e6e2 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -210,6 +210,31 @@ extern "C" {
 #define PKT_TX_TUNNEL_GENEVE  (0x4ULL << 45)
 /**< TX packet with MPLS-in-UDP RFC 7510 header. */
 #define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
+/**
+ * Generic IP encapsulated tunnel type, used for TSO and checksum offload.
+ * It can be used for tunnels which are not standards or listed above.
+ * It is preferred to use specific tunnel flags like PKT_TX_TUNNEL_GRE
+ * or PKT_TX_TUNNEL_IPIP if possible.
+ * The ethdev must be configured with DEV_TX_OFFLOAD_IP_TNL_TSO.
+ * Outer and inner checksums are done according to the existing flags like
+ * PKT_TX_xxx_CKSUM.
+ * Specific tunnel headers that contain payload length, sequence id
+ * or checksum are not expected to be updated.
+ */
+#define PKT_TX_TUNNEL_IP (0xDULL << 45)
+/**
+ * Generic UDP encapsulated tunnel type, used for TSO and checksum offload.
+ * UDP tunnel type implies outer IP layer.
+ * It can be used for tunnels which are not standards or listed above.
+ * It is preferred to use specific tunnel flags like PKT_TX_TUNNEL_GRE
+ * or PKT_TX_TUNNEL_IPIP if possible.
+ * The ethdev must be configured with DEV_TX_OFFLOAD_UDP_TNL_TSO.
+ * Outer and inner checksums are done according to the existing flags like
+ * PKT_TX_xxx_CKSUM.
+ * Specific tunnel headers that contain payload length, sequence id
+ * or checksum are not expected to be updated.
+ */
+#define PKT_TX_TUNNEL_UDP (0xEULL << 45)
 /* add new TX TUNNEL type here */
 #define PKT_TX_TUNNEL_MASK    (0xFULL << 45)
 
-- 
2.13.3

  parent reply	other threads:[~2018-04-20 13:06 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-18  7:37 [dpdk-dev] [PATCH] net/mlx5: add supported hash function check Xueming Li
2018-03-19  8:29 ` Nélio Laranjeiro
2018-03-22 10:42   ` Xueming(Steven) Li
2018-03-26 11:39     ` Nélio Laranjeiro
2018-04-02 12:41       ` Xueming(Steven) Li
2018-04-04  7:35         ` Nélio Laranjeiro
2018-04-09 12:10 ` [dpdk-dev] [PATCH v1 1/2] ethdev: " Xueming Li
2018-04-16 22:56   ` Thomas Monjalon
2018-04-17 14:24   ` [dpdk-dev] [PATCH v2 " Xueming Li
2018-04-17 22:00     ` Thomas Monjalon
2018-04-18 11:55       ` Xueming(Steven) Li
2018-04-18 12:15         ` Thomas Monjalon
2018-04-17 14:24   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: only config supported RSS hash types Xueming Li
2018-04-18  8:11   ` [dpdk-dev] [PATCH v3 1/2] ethdev: add supported hash function check Xueming Li
2018-04-18  8:11   ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: only config supported RSS hash types Xueming Li
2018-04-18 11:06   ` [dpdk-dev] [PATCH v3 1/2] ethdev: add supported hash function check Xueming Li
2018-04-18 11:06   ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: only config supported RSS hash types Xueming Li
2018-04-18 13:25     ` Adrien Mazarguil
2018-04-18 13:54       ` Xueming(Steven) Li
2018-04-18 14:16         ` Adrien Mazarguil
2018-04-18 14:26           ` Xueming(Steven) Li
2018-04-18 14:47             ` Adrien Mazarguil
2018-04-18 14:10       ` Xueming(Steven) Li
2018-04-18 14:30         ` Adrien Mazarguil
2018-04-19 15:50           ` Xueming(Steven) Li
2018-04-19 15:48   ` [dpdk-dev] [PATCH v4 1/2] ethdev: add supported hash function check Xueming Li
2018-04-20  8:10     ` Adrien Mazarguil
2018-04-19 15:48   ` [dpdk-dev] [PATCH v4 2/2] app/testpmd: new parameter for port config all rss command Xueming Li
2018-04-20  8:10     ` Adrien Mazarguil
2018-04-20 13:06   ` Xueming Li [this message]
2018-04-20 13:48     ` [dpdk-dev] [PATCH v5 1/2] ethdev: introduce generic IP/UDP tunnel checksum and TSO Ferruh Yigit
2018-04-20 14:23       ` Ferruh Yigit
2018-04-20 14:23       ` Xueming(Steven) Li
2018-04-20 13:06   ` [dpdk-dev] [PATCH v5 2/2] app/testpmd: testpmd support Tx generic tunnel offloads Xueming Li
2018-04-20 14:29     ` Xueming(Steven) Li
2018-04-20 14:30   ` [dpdk-dev] [PATCH v5 1/2] ethdev: add supported hash function check Xueming Li
2018-04-20 14:35     ` Ferruh Yigit
2018-04-20 14:44       ` Xueming(Steven) Li
2018-04-23 15:20     ` Thomas Monjalon
2018-04-23 16:07       ` Ferruh Yigit
2018-04-23 16:06     ` Ferruh Yigit
2018-04-23 18:14       ` Thomas Monjalon
2018-05-01 11:04         ` Ferruh Yigit
2018-05-01 14:04           ` Thomas Monjalon
2018-04-20 14:30   ` [dpdk-dev] [PATCH v5 2/2] app/testpmd: new parameter for port config all rss command Xueming Li
2018-04-09 12:10 ` [dpdk-dev] [PATCH v1 2/2] app/testpmd: config all supported RSS functions Xueming Li
2018-04-16 22:53   ` Thomas Monjalon
2018-04-08 12:32 [dpdk-dev] [PATCH v4 0/4] support Tx generic tunnel checksum and TSO Xueming Li
2018-04-17 14:47 ` [dpdk-dev] [PATCH v5 1/2] ethdev: introduce generic IP/UDP " Xueming Li
2018-04-17 21:21   ` 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=20180420130643.114699-1-xuemingl@mellanox.com \
    --to=xuemingl@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=notifications@github.com \
    --cc=shahafs@mellanox.com \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@intel.com \
    /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).