* [PATCH v1] app/testpmd: set srv6 header without any TLV
@ 2023-03-28 9:36 Rongwei Liu
2023-03-28 10:18 ` Thomas Monjalon
0 siblings, 1 reply; 6+ messages in thread
From: Rongwei Liu @ 2023-03-28 9:36 UTC (permalink / raw)
To: dev, matan, viacheslavo, orika, thomas; +Cc: Aman Singh, Yuying Zhang
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(+)
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);
--
2.27.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] app/testpmd: set srv6 header without any TLV
2023-03-28 9:36 [PATCH v1] app/testpmd: set srv6 header without any TLV Rongwei Liu
@ 2023-03-28 10:18 ` Thomas Monjalon
2023-03-28 12:27 ` [PATCH v2] " Rongwei Liu
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2023-03-28 10:18 UTC (permalink / raw)
To: matan, viacheslavo, orika, Rongwei Liu; +Cc: dev, Aman Singh, Yuying Zhang
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/ ?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] app/testpmd: set srv6 header without any TLV
2023-03-28 10:18 ` Thomas Monjalon
@ 2023-03-28 12:27 ` Rongwei Liu
2023-05-26 3:21 ` Rongwei Liu
0 siblings, 1 reply; 6+ messages in thread
From: Rongwei Liu @ 2023-03-28 12:27 UTC (permalink / raw)
To: dev, matan, viacheslavo, orika, thomas
Cc: Aman Singh, Yuying Zhang, Olivier Matz
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>
v2: add macro definition for segment routing header.
---
app/test-pmd/cmdline_flow.c | 3 +++
lib/net/rte_ip.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 5fbc450849..09f417b76e 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 == RTE_IPV6_SRCRT_TYPE_4)
+ ext->hdr.last_entry = ext->hdr.segments_left - 1;
} else {
size = sizeof(struct rte_ipv6_routing_ext) +
(ext->hdr.hdr_len << 3);
diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h
index 337fad15d7..cfdbfb86ba 100644
--- a/lib/net/rte_ip.h
+++ b/lib/net/rte_ip.h
@@ -540,6 +540,9 @@ struct rte_ipv6_hdr {
uint8_t dst_addr[16]; /**< IP address of destination host(s). */
} __rte_packed;
+/* IPv6 routing extension type definition. */
+#define RTE_IPV6_SRCRT_TYPE_4 4
+
/**
* IPv6 Routing Extension Header
*/
--
2.27.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH v2] app/testpmd: set srv6 header without any TLV
2023-03-28 12:27 ` [PATCH v2] " Rongwei Liu
@ 2023-05-26 3:21 ` Rongwei Liu
2023-05-28 14:39 ` Ori Kam
0 siblings, 1 reply; 6+ messages in thread
From: Rongwei Liu @ 2023-05-26 3:21 UTC (permalink / raw)
To: Rongwei Liu, dev, Matan Azrad, Slava Ovsiienko, Ori Kam,
NBU-Contact-Thomas Monjalon (EXTERNAL),
Andrew Rybchenko
Cc: Aman Singh, Yuying Zhang, Olivier Matz
HI @Ori Kam @NBU-Contact-Thomas Monjalon (EXTERNAL) @Andrew Rybchenko
Can you share some comments on this?
Thanks.
BR
Rongwei
> -----Original Message-----
> From: Rongwei Liu <rongweil@nvidia.com>
> Sent: Tuesday, March 28, 2023 20:28
> To: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-
> Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>
> Cc: Aman Singh <aman.deep.singh@intel.com>; Yuying Zhang
> <yuying.zhang@intel.com>; Olivier Matz <olivier.matz@6wind.com>
> Subject: [PATCH v2] app/testpmd: set srv6 header without any TLV
>
> External email: Use caution opening links or attachments
>
>
> 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>
>
> v2: add macro definition for segment routing header.
> ---
> app/test-pmd/cmdline_flow.c | 3 +++
> lib/net/rte_ip.h | 3 +++
> 2 files changed, 6 insertions(+)
>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 5fbc450849..09f417b76e 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 == RTE_IPV6_SRCRT_TYPE_4)
> + ext->hdr.last_entry =
> + ext->hdr.segments_left - 1;
> } else {
> size = sizeof(struct rte_ipv6_routing_ext) +
> (ext->hdr.hdr_len << 3); diff --git a/lib/net/rte_ip.h
> b/lib/net/rte_ip.h index 337fad15d7..cfdbfb86ba 100644
> --- a/lib/net/rte_ip.h
> +++ b/lib/net/rte_ip.h
> @@ -540,6 +540,9 @@ struct rte_ipv6_hdr {
> uint8_t dst_addr[16]; /**< IP address of destination host(s). */ }
> __rte_packed;
>
> +/* IPv6 routing extension type definition. */ #define
> +RTE_IPV6_SRCRT_TYPE_4 4
> +
> /**
> * IPv6 Routing Extension Header
> */
> --
> 2.27.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH v2] app/testpmd: set srv6 header without any TLV
2023-05-26 3:21 ` Rongwei Liu
@ 2023-05-28 14:39 ` Ori Kam
2023-06-02 18:15 ` Ferruh Yigit
0 siblings, 1 reply; 6+ messages in thread
From: Ori Kam @ 2023-05-28 14:39 UTC (permalink / raw)
To: Rongwei Liu, dev, Matan Azrad, Slava Ovsiienko,
NBU-Contact-Thomas Monjalon (EXTERNAL),
Andrew Rybchenko
Cc: Aman Singh, Yuying Zhang, Olivier Matz
Hi Rongwei,
> -----Original Message-----
> From: Rongwei Liu <rongweil@nvidia.com>
> Sent: Friday, May 26, 2023 6:22 AM
>
> HI @Ori Kam @NBU-Contact-Thomas Monjalon (EXTERNAL) @Andrew
> Rybchenko
> Can you share some comments on this?
> Thanks.
>
> BR
> Rongwei
>
> > -----Original Message-----
> > From: Rongwei Liu <rongweil@nvidia.com>
> > Sent: Tuesday, March 28, 2023 20:28
> > To: dev@dpdk.org; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> > <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-
> > Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>
> > Cc: Aman Singh <aman.deep.singh@intel.com>; Yuying Zhang
> > <yuying.zhang@intel.com>; Olivier Matz <olivier.matz@6wind.com>
> > Subject: [PATCH v2] app/testpmd: set srv6 header without any TLV
> >
> > External email: Use caution opening links or attachments
> >
> >
> > 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>
> >
> > v2: add macro definition for segment routing header.
> > ---
> > app/test-pmd/cmdline_flow.c | 3 +++
> > lib/net/rte_ip.h | 3 +++
> > 2 files changed, 6 insertions(+)
> >
> > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> > index 5fbc450849..09f417b76e 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 == RTE_IPV6_SRCRT_TYPE_4)
> > + ext->hdr.last_entry =
> > + ext->hdr.segments_left - 1;
> > } else {
> > size = sizeof(struct rte_ipv6_routing_ext) +
> > (ext->hdr.hdr_len << 3); diff --git a/lib/net/rte_ip.h
> > b/lib/net/rte_ip.h index 337fad15d7..cfdbfb86ba 100644
> > --- a/lib/net/rte_ip.h
> > +++ b/lib/net/rte_ip.h
> > @@ -540,6 +540,9 @@ struct rte_ipv6_hdr {
> > uint8_t dst_addr[16]; /**< IP address of destination host(s). */ }
> > __rte_packed;
> >
> > +/* IPv6 routing extension type definition. */ #define
> > +RTE_IPV6_SRCRT_TYPE_4 4
> > +
> > /**
> > * IPv6 Routing Extension Header
> > */
> > --
> > 2.27.0
Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] app/testpmd: set srv6 header without any TLV
2023-05-28 14:39 ` Ori Kam
@ 2023-06-02 18:15 ` Ferruh Yigit
0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2023-06-02 18:15 UTC (permalink / raw)
To: Ori Kam, Rongwei Liu, dev, Matan Azrad, Slava Ovsiienko,
NBU-Contact-Thomas Monjalon (EXTERNAL),
Andrew Rybchenko
Cc: Aman Singh, Yuying Zhang, Olivier Matz
On 5/28/2023 3:39 PM, Ori Kam wrote:
>>>
>>> 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>
>>>
>
> Acked-by: Ori Kam <orika@nvidia.com>
>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-06-02 18:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28 9:36 [PATCH v1] app/testpmd: set srv6 header without any TLV Rongwei Liu
2023-03-28 10:18 ` Thomas Monjalon
2023-03-28 12:27 ` [PATCH v2] " Rongwei Liu
2023-05-26 3:21 ` Rongwei Liu
2023-05-28 14:39 ` Ori Kam
2023-06-02 18:15 ` Ferruh Yigit
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).