DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jianfeng Tan <jianfeng.tan@intel.com>
To: dev@dpdk.org
Cc: thomas.monjalon@6wind.com, pablo.de.lara.guarch@intel.com,
	konstantin.ananyev@intel.com, jingjing.wu@intel.com,
	helin.zhang@intel.com, Jianfeng Tan <jianfeng.tan@intel.com>,
	Zhe Tao <zhe.tao@intel.com>
Subject: [dpdk-dev] [PATCH v4 1/3] mbuf: add Tx side tunneling type
Date: Mon,  1 Aug 2016 03:56:53 +0000	[thread overview]
Message-ID: <1470023815-23108-2-git-send-email-jianfeng.tan@intel.com> (raw)
In-Reply-To: <1470023815-23108-1-git-send-email-jianfeng.tan@intel.com>

To support tunneling packet offload capabilities on Tx side, PMDs
(e.g., i40e) need to know what kind of tunneling type of this packet.
Instead of analyzing the packet itself, we depend on applications to
correctly set the tunneling type. These flags are defined inside
rte_mbuf.ol_flags.

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
 lib/librte_mbuf/rte_mbuf.c |  4 ++++
 lib/librte_mbuf/rte_mbuf.h | 17 ++++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 4846b89..4505abb 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -302,6 +302,10 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask)
 	case PKT_TX_OUTER_IP_CKSUM: return "PKT_TX_OUTER_IP_CKSUM";
 	case PKT_TX_OUTER_IPV4: return "PKT_TX_OUTER_IPV4";
 	case PKT_TX_OUTER_IPV6: return "PKT_TX_OUTER_IPV6";
+	case PKT_TX_TUNNEL_VXLAN: return "PKT_TX_TUNNEL_VXLAN";
+	case PKT_TX_TUNNEL_GRE: return "PKT_TX_TUNNEL_GRE";
+	case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP";
+	case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE";
 	default: return NULL;
 	}
 }
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 101485f..0eec112 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -129,6 +129,18 @@ extern "C" {
 /* add new TX flags here */
 
 /**
+ * Bits 45:48 used for the tunnel type.
+ * When doing Tx offload like TSO or checksum, the HW needs to configure the
+ * tunnel type into the HW descriptors.
+ */
+#define PKT_TX_TUNNEL_VXLAN   (0x1ULL << 45)
+#define PKT_TX_TUNNEL_GRE     (0x2ULL << 45)
+#define PKT_TX_TUNNEL_IPIP    (0x3ULL << 45)
+#define PKT_TX_TUNNEL_GENEVE  (0x4ULL << 45)
+/* add new TX TUNNEL type here */
+#define PKT_TX_TUNNEL_MASK    (0xFULL << 45)
+
+/**
  * Second VLAN insertion (QinQ) flag.
  */
 #define PKT_TX_QINQ_PKT    (1ULL << 49)   /**< TX packet with double VLAN inserted. */
@@ -863,7 +875,10 @@ struct rte_mbuf {
 	union {
 		uint64_t tx_offload;       /**< combined for easy fetch */
 		struct {
-			uint64_t l2_len:7; /**< L2 (MAC) Header Length. */
+			uint64_t l2_len:7;
+			/**< L2 (MAC) Header Length for non-tunneling pkt.
+			 * Outer_L4_len + ... + Inner_L2_len for tunneling pkt.
+			 */
 			uint64_t l3_len:9; /**< L3 (IP) Header Length. */
 			uint64_t l4_len:8; /**< L4 (TCP/UDP) Header Length. */
 			uint64_t tso_segsz:16; /**< TCP TSO segment size */
-- 
2.7.4

  reply	other threads:[~2016-08-01  3:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05 20:59 [dpdk-dev] [PATCH v1] i40: fix the VXLAN TSO issue Zhe Tao
2016-07-06  5:38 ` Wu, Jingjing
2016-07-07  4:27 ` [dpdk-dev] [PATCH v2] " Zhe Tao
2016-07-07 10:01   ` Ananyev, Konstantin
2016-07-07 10:50   ` Ananyev, Konstantin
2016-07-07 12:24     ` Ananyev, Konstantin
2016-07-15 15:40       ` Bruce Richardson
2016-07-18  2:57       ` Zhe Tao
2016-07-18 11:56   ` [dpdk-dev] [PATCH v3] " Zhe Tao
2016-07-19 10:29     ` Ananyev, Konstantin
2016-07-26 12:22       ` Tan, Jianfeng
2016-07-29  7:11     ` Tan, Jianfeng
2016-07-29  8:45       ` Ananyev, Konstantin
2016-07-29 10:11         ` Tan, Jianfeng
2016-10-10  3:58   ` [dpdk-dev] [PATCH v2] " Wu, Jingjing
2016-10-10  4:14     ` Yuanhan Liu
2016-08-01  3:56 ` [dpdk-dev] [PATCH v4 0/3] Add TSO on tunneling packet Jianfeng Tan
2016-08-01  3:56   ` Jianfeng Tan [this message]
2016-08-01  3:56   ` [dpdk-dev] [PATCH v4 2/3] net/i40e: add TSO support " Jianfeng Tan
2016-08-01  3:56   ` [dpdk-dev] [PATCH v4 3/3] app/testpmd: fix Tx offload " Jianfeng Tan
2016-09-19 12:09     ` Ananyev, Konstantin
2016-09-21 12:36       ` Tan, Jianfeng
2016-09-21 15:47         ` Ananyev, Konstantin
2016-09-22  1:29           ` Tan, Jianfeng
2016-09-22  9:15             ` Ananyev, Konstantin
     [not found]   ` <ED26CBA2FAD1BF48A8719AEF02201E364E5E09BC@SHSMSX103.ccr.corp.intel.com>
     [not found]     ` <2601191342CEEE43887BDE71AB97725836BA2698@irsmsx105.ger.corp.intel.com>
2016-09-27 17:29       ` [dpdk-dev] [PATCH v4 0/3] Add TSO " Ananyev, Konstantin
2016-09-27 17:52         ` Tan, Jianfeng
2016-09-27 19:47           ` Thomas Monjalon
2016-10-09 21:27         ` Thomas Monjalon
2016-09-26 13:48 ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: support tunneled TSO in csum fwd engine Jianfeng Tan
2016-09-27 17:25   ` Ananyev, Konstantin

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=1470023815-23108-2-git-send-email-jianfeng.tan@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=thomas.monjalon@6wind.com \
    --cc=zhe.tao@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).