All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Support generic tunnel TX csum and TSO
@ 2018-01-09 14:11 Xueming Li
  2018-01-09 14:11 ` [PATCH 1/6] net/mlx5: support tx swp tunnel offloading Xueming Li
                   ` (5 more replies)
  0 siblings, 6 replies; 82+ messages in thread
From: Xueming Li @ 2018-01-09 14:11 UTC (permalink / raw)
  To: Olivier MATZ, Thomas Monjalon, Jingjing Wu, Yongseok Koh
  Cc: Xueming Li, Shahaf Shuler, dev

This patchset add new HW TX capability of generic tunnel checksum and TSO
offloads, HW supporting generic tunnel offloading could handle new tunnel 
type offloading w/o upgrading HW. 

This is achieved by informing HW offsets and types of headers, HW would 
do calculation and TSO segments based on packet inner and outer headers offset
regardless of tunnel type.

Xueming Li (6):
  net/mlx5: support tx swp tunnel offloading
  net/mlx5: allow max 192B WQE TSO inline header length
  net/mlx5: add SWP PCI parameter for TX common tunnel offloads
  ethdev: introduce TX common tunnel offloads
  net/mlx5: support TX common tunnel offloads
  app/testpmd: testpmd support TX common tunnel offloads

 app/test-pmd/cmdline.c         |   9 ++-
 app/test-pmd/config.c          |   9 +++
 drivers/net/mlx5/mlx5.c        |   7 ++
 drivers/net/mlx5/mlx5.h        |   1 +
 drivers/net/mlx5/mlx5_defs.h   |   2 +-
 drivers/net/mlx5/mlx5_ethdev.c |   3 +-
 drivers/net/mlx5/mlx5_prm.h    |  12 +++
 drivers/net/mlx5/mlx5_rxtx.c   | 163 ++++++++++++++++++++++++++---------------
 drivers/net/mlx5/mlx5_rxtx.h   |  94 +++++++++++++++++++-----
 drivers/net/mlx5/mlx5_txq.c    |   4 +
 lib/librte_ether/rte_ethdev.h  |   9 +++
 11 files changed, 234 insertions(+), 79 deletions(-)

-- 
2.13.3

^ permalink raw reply	[flat|nested] 82+ messages in thread
* [PATCH v5 1/2] ethdev: introduce generic IP/UDP tunnel checksum and TSO
  2018-04-09 12:10 ` [PATCH v1 1/2] ethdev: add supported hash function check Xueming Li
@ 2018-04-20 13:06 Xueming Li
  2018-04-09 12:10 ` [PATCH v1 1/2] ethdev: add supported hash function check Xueming Li
  0 siblings, 1 reply; 82+ messages in thread
From: Xueming Li @ 2018-04-20 13:06 UTC (permalink / raw)
  To: Shahaf Shuler, Nelio Laranjeiro, Wenzhuo Lu, Jingjing Wu,
	Thomas Monjalon, Adrien Mazarguil
  Cc: Xueming Li, dev

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

^ permalink raw reply related	[flat|nested] 82+ messages in thread

end of thread, other threads:[~2018-04-23 16:17 UTC | newest]

Thread overview: 82+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09 14:11 [PATCH 0/6] Support generic tunnel TX csum and TSO Xueming Li
2018-01-09 14:11 ` [PATCH 1/6] net/mlx5: support tx swp tunnel offloading Xueming Li
2018-01-29 15:08   ` [PATCH v2 1/5] ethdev: introduce Tx generic tunnel offloads Xueming Li
2018-01-29 16:49     ` Ananyev, Konstantin
2018-01-30  3:01       ` Xueming(Steven) Li
2018-01-30 13:28         ` Ananyev, Konstantin
2018-01-30 15:27           ` Xueming(Steven) Li
2018-01-30 15:33             ` Ananyev, Konstantin
2018-01-30 15:47               ` Xueming(Steven) Li
2018-01-30 16:02                 ` Ananyev, Konstantin
2018-01-30 16:10                   ` Xueming(Steven) Li
2018-01-30 17:04                     ` Ananyev, Konstantin
2018-01-30 17:54                       ` Xueming(Steven) Li
2018-01-30 20:21                         ` Thomas Monjalon
2018-01-31 15:20                           ` Xueming(Steven) Li
2018-01-31 15:17                         ` Xueming(Steven) Li
2018-01-29 15:08   ` [PATCH v2 2/5] app/testpmd: testpmd support " Xueming Li
2018-01-29 15:08   ` [PATCH v2 3/5] net/mlx5: separate TSO function in Tx data path Xueming Li
2018-01-29 15:08   ` [PATCH v2 4/5] net/mlx5: support generic tunnel offloading Xueming Li
2018-01-29 15:08   ` [PATCH v2 5/5] net/mlx5: allow max 192B TSO inline header length Xueming Li
2018-03-05 14:51   ` [PATCH v3 0/7] support generic tunnel Tx checksum and TSO Xueming Li
2018-03-05 14:51   ` [PATCH v3 1/7] ethdev: introduce Tx generic tunnel L3/L4 offload Xueming Li
2018-03-21  1:40     ` Yongseok Koh
2018-03-22 13:55       ` Xueming(Steven) Li
2018-03-28 12:52         ` Olivier Matz
2018-04-04  8:20           ` Xueming(Steven) Li
2018-03-05 14:51   ` [PATCH v3 2/7] app/testpmd: testpmd support Tx generic tunnel offloads Xueming Li
2018-03-05 14:51   ` [PATCH v3 3/7] app/testpmd: add more GRE extension to csum engine Xueming Li
2018-03-05 14:51   ` [PATCH v3 4/7] app/testpmd: introduce VXLAN GPE to csum forwarding engine Xueming Li
2018-03-05 14:51   ` [PATCH v3 5/7] net/mlx5: separate TSO function in Tx data path Xueming Li
2018-03-05 14:51   ` [PATCH v3 6/7] net/mlx5: support generic tunnel offloading Xueming Li
2018-03-05 14:51   ` [PATCH v3 7/7] net/mlx5: allow max 192B TSO inline header length Xueming Li
2018-04-08 12:32   ` [PATCH v4 0/4] support Tx generic tunnel checksum and TSO Xueming Li
2018-04-17 14:43     ` [PATCH v5 0/2] " Xueming Li
2018-04-17 14:47     ` [PATCH v5 1/2] ethdev: introduce generic IP/UDP " Xueming Li
2018-04-17 21:21       ` Thomas Monjalon
2018-04-17 14:49     ` [PATCH v5 2/2] app/testpmd: testpmd support Tx generic tunnel offloads Xueming Li
2018-04-18 13:38     ` [PATCH v6 0/2] support Tx generic tunnel checksum and TSO Xueming Li
2018-04-18 13:58     ` [PATCH v6 1/2] ethdev: introduce generic IP/UDP " Xueming Li
2018-04-18 14:28       ` Thomas Monjalon
2018-04-18 16:45         ` Ananyev, Konstantin
2018-04-18 18:02           ` Thomas Monjalon
2018-04-23  9:55             ` Olivier Matz
2018-04-20 12:48       ` [PATCH v7 0/2] support Tx generic " Xueming Li
2018-04-23 11:36         ` [PATCH v8 " Xueming Li
2018-04-23 16:17           ` Ferruh Yigit
2018-04-23 11:36         ` [PATCH v8 1/2] ethdev: introduce generic IP/UDP " Xueming Li
2018-04-23 11:49           ` Xueming Li
2018-04-23 11:36         ` [PATCH v8 2/2] app/testpmd: testpmd support Tx generic tunnel offloads Xueming Li
2018-04-20 12:48       ` [PATCH v7 1/2] ethdev: introduce generic IP/UDP tunnel checksum and TSO Xueming Li
2018-04-23  9:59         ` Olivier Matz
2018-04-20 12:48       ` [PATCH v7 2/2] app/testpmd: testpmd support Tx generic tunnel offloads Xueming Li
2018-04-18 13:59     ` [PATCH v6 " Xueming Li
2018-04-08 12:32   ` [PATCH v4 1/4] ethdev: introduce generic IP/UDP tunnel checksum and TSO Xueming Li
2018-04-16 22:42     ` Thomas Monjalon
2018-04-17  7:53       ` Xueming(Steven) Li
2018-04-17  8:10         ` Thomas Monjalon
2018-04-08 12:32   ` [PATCH v4 2/4] app/testpmd: testpmd support Tx generic tunnel offloads Xueming Li
2018-04-17 14:24     ` Iremonger, Bernard
2018-04-17 15:44       ` Xueming(Steven) Li
2018-04-08 12:32   ` [PATCH v4 3/4] app/testpmd: add more GRE extension to csum engine Xueming Li
2018-04-16 22:45     ` Thomas Monjalon
2018-04-17  5:19       ` Xueming(Steven) Li
2018-04-08 12:32   ` [PATCH v4 4/4] app/testpmd: introduce VXLAN GPE to csum forwarding engine Xueming Li
2018-04-16 22:46     ` Thomas Monjalon
2018-04-17 13:56       ` Iremonger, Bernard
2018-04-17 14:12         ` Xueming(Steven) Li
2018-01-09 14:11 ` [PATCH 2/6] net/mlx5: allow max 192B WQE TSO inline header length Xueming Li
2018-01-09 14:11 ` [PATCH 3/6] net/mlx5: add SWP PCI parameter for TX common tunnel offloads Xueming Li
2018-01-09 14:11 ` [PATCH 4/6] ethdev: introduce " Xueming Li
2018-01-11 18:38   ` Ferruh Yigit
2018-01-16 17:10   ` Olivier Matz
2018-01-16 17:28     ` Xueming(Steven) Li
2018-01-16 19:06       ` Shahaf Shuler
2018-01-22 12:46         ` Olivier Matz
2018-01-22 20:06           ` Shahaf Shuler
2018-01-17  0:50   ` Yongseok Koh
2018-01-09 14:11 ` [PATCH 5/6] net/mlx5: support " Xueming Li
2018-01-09 14:11 ` [PATCH 6/6] app/testpmd: testpmd " Xueming Li
2018-01-16  3:09   ` Lu, Wenzhuo
2018-04-20 13:06 [PATCH v5 1/2] ethdev: introduce generic IP/UDP tunnel checksum and TSO Xueming Li
2018-04-09 12:10 ` [PATCH v1 1/2] ethdev: add supported hash function check Xueming Li
2018-04-20 13:06   ` [PATCH v5 2/2] app/testpmd: testpmd support Tx generic tunnel offloads Xueming Li
2018-04-20 14:29     ` Xueming(Steven) Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.