Skip to contentSkip to conversation

app/testpmd: add support for MPLS TTL

PATCH Applied Michael Baum 3 participants 3 messages Aug 22, 2023 – Sep 21, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: add support for MPLS TTL

Add support for matching "ttl" field in MPLS item.

---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)
app/test-pmd/cmdline_flow.c +9 -0
index 94827bcc4a..95c0a19beb 100644
@@ -365,6 +365,7 @@ enum index {
 	ITEM_MPLS_LABEL,
 	ITEM_MPLS_TC,
 	ITEM_MPLS_S,
+	ITEM_MPLS_TTL,
 	ITEM_GRE,
 	ITEM_GRE_PROTO,
 	ITEM_GRE_C_RSVD0_VER,
@@ -1712,6 +1713,7 @@ static const enum index item_mpls[] = {
 	ITEM_MPLS_LABEL,
 	ITEM_MPLS_TC,
 	ITEM_MPLS_S,
+	ITEM_MPLS_TTL,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -4650,6 +4652,13 @@ static const struct token token_list[] = {
 						  label_tc_s,
 						  "\x00\x00\x01")),
 	},
+	[ITEM_MPLS_TTL] = {
+		.name = "ttl",
+		.help = "MPLS Time-to-Live",
+		.next = NEXT(item_mpls, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_mpls, ttl)),
+	},
 	[ITEM_GRE] = {
 		.name = "gre",
 		.help = "match GRE header",
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Michael Baum

Add support for matching "ttl" field in MPLS item.

Quoted 38 lines
---
  app/test-pmd/cmdline_flow.c | 9 +++++++++
  1 file changed, 9 insertions(+)
app/test-pmd/cmdline_flow.c +9 -0
index 94827bcc4a..95c0a19beb 100644
@@ -365,6 +365,7 @@ enum index {
  	ITEM_MPLS_LABEL,
  	ITEM_MPLS_TC,
  	ITEM_MPLS_S,
+	ITEM_MPLS_TTL,
  	ITEM_GRE,
  	ITEM_GRE_PROTO,
  	ITEM_GRE_C_RSVD0_VER,
@@ -1712,6 +1713,7 @@ static const enum index item_mpls[] = {
  	ITEM_MPLS_LABEL,
  	ITEM_MPLS_TC,
  	ITEM_MPLS_S,
+	ITEM_MPLS_TTL,
  	ITEM_NEXT,
  	ZERO,
  };
@@ -4650,6 +4652,13 @@ static const struct token token_list[] = {
  						  label_tc_s,
  						  "\x00\x00\x01")),
  	},
+	[ITEM_MPLS_TTL] = {
+		.name = "ttl",
+		.help = "MPLS Time-to-Live",
+		.next = NEXT(item_mpls, NEXT_ENTRY(COMMON_UNSIGNED),
+			     item_param),
+		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_mpls, ttl)),
+	},
  	[ITEM_GRE] = {
  		.name = "gre",
  		.help = "match GRE header",