app/testpmd: add support for MPLS TTL

Message ID 20230822141754.3310105-1-michaelba@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: add support for MPLS TTL |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Michael Baum Aug. 22, 2023, 2:17 p.m. UTC
Add support for matching "ttl" field in MPLS item.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Singh, Aman Deep Sept. 1, 2023, 12:21 p.m. UTC | #1
On 8/22/2023 7:47 PM, Michael Baum wrote:
> Add support for matching "ttl" field in MPLS item.
>
> Signed-off-by: Michael Baum <michaelba@nvidia.com>

Acked-by: Aman Singh <aman.deep.singh@intel.com>

> ---
>   app/test-pmd/cmdline_flow.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 94827bcc4a..95c0a19beb 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -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",
  
Ferruh Yigit Sept. 21, 2023, 4:24 p.m. UTC | #2
On 9/1/2023 1:21 PM, Singh, Aman Deep wrote:
> 
> On 8/22/2023 7:47 PM, Michael Baum wrote:
>> Add support for matching "ttl" field in MPLS item.
>>
>> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> 
> Acked-by: Aman Singh <aman.deep.singh@intel.com>
> 

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 94827bcc4a..95c0a19beb 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -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",