[v2,1/2] lib/mbuf: add GTP tunnel type flag

Message ID 717d5856d412ae2ce2e304eb903fa8ceca8d8cef.1571647239.git.ting.xu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series support GTP Tx checksum offload |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Xu, Ting Oct. 21, 2019, 10 a.m. UTC
  Add GTP tunnel type flag in mbuf for future use in GTP
Tx checksum offload.

Signed-off-by: Ting Xu <ting.xu@intel.com>
---
 lib/librte_mbuf/rte_mbuf.c | 2 ++
 lib/librte_mbuf/rte_mbuf.h | 2 ++
 2 files changed, 4 insertions(+)
  

Comments

Ferruh Yigit Oct. 23, 2019, 2:56 p.m. UTC | #1
On 10/21/2019 11:00 AM, Ting Xu wrote:
> Add GTP tunnel type flag in mbuf for future use in GTP
> Tx checksum offload.
> 
> Signed-off-by: Ting Xu <ting.xu@intel.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

@Olivier, change looks straightforward and there is a testpmd patch depends
this, merging without waiting your ack, please shout if something is wrong.
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 0236fba76..952f3c52c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -591,6 +591,7 @@  const char *rte_get_tx_ol_flag_name(uint64_t mask)
 	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_GTP: return "PKT_TX_TUNNEL_GTP";
 	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";
@@ -627,6 +628,7 @@  rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		{ PKT_TX_OUTER_IPV4, PKT_TX_OUTER_IPV4, NULL },
 		{ PKT_TX_OUTER_IPV6, PKT_TX_OUTER_IPV6, NULL },
 		{ PKT_TX_TUNNEL_VXLAN, PKT_TX_TUNNEL_MASK, NULL },
+		{ PKT_TX_TUNNEL_GTP, PKT_TX_TUNNEL_MASK, NULL },
 		{ PKT_TX_TUNNEL_GRE, PKT_TX_TUNNEL_MASK, NULL },
 		{ PKT_TX_TUNNEL_IPIP, PKT_TX_TUNNEL_MASK, NULL },
 		{ PKT_TX_TUNNEL_GENEVE, PKT_TX_TUNNEL_MASK, NULL },
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index fb0849ac1..ce1e22544 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -251,6 +251,8 @@  extern "C" {
 /** TX packet with MPLS-in-UDP RFC 7510 header. */
 #define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
 #define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
+#define PKT_TX_TUNNEL_GTP       (0x7ULL << 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.