[v1] app/testpmd: set srv6 header without any TLV

Message ID 20230328093633.619965-1-rongweil@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v1] app/testpmd: set srv6 header without any TLV |

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-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Rongwei Liu March 28, 2023, 9:36 a.m. UTC
  When the type field of the IPv6 routing extension is 4, it means
segment routing header.

In this case, set the last_entry to be segment_left minus 1 if the
user doesn't specify the header length explicitly.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Thomas Monjalon March 28, 2023, 10:18 a.m. UTC | #1
28/03/2023 11:36, Rongwei Liu:
> When the type field of the IPv6 routing extension is 4, it means
> segment routing header.

Can we replace this raw value with a #define in lib/net/ ?
  

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 5fbc450849..64549c037d 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -12817,6 +12817,9 @@  cmd_set_raw_parsed(const struct buffer *in)
 				size = sizeof(struct rte_ipv6_routing_ext) +
 					(ext->hdr.segments_left << 4);
 				ext->hdr.hdr_len = ext->hdr.segments_left << 1;
+				/* Srv6 without TLV. */
+				if (ext->hdr.type == 4)
+					ext->hdr.last_entry = ext->hdr.segments_left - 1;
 			} else {
 				size = sizeof(struct rte_ipv6_routing_ext) +
 					(ext->hdr.hdr_len << 3);