[v7,2/2] app/testpmd: support matching the reserved filed for VXLAN
Checks
Commit Message
Add a new testpmd pattern field 'last_rsvd' that supports the
last 8-bits matching of VXLAN header.
The examples for the "last_rsvd" pattern field are as below:
1. ...pattern eth / ipv4 / udp / vxlan last_rsvd is 0x80 / end ...
This flow will exactly match the last 8-bits to be 0x80.
2. ...pattern eth / ipv4 / udp / vxlan last_rsvd spec 0x80
vxlan mask 0x80 / end ...
This flow will only match the MSB of the last 8-bits to be 1.
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
app/test-pmd/cmdline_flow.c | 10 ++++++++++
app/test-pmd/util.c | 5 +++--
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 1 +
3 files changed, 14 insertions(+), 2 deletions(-)
Comments
> -----Original Message-----
> From: Rongwei Liu <rongweil@nvidia.com>
> Sent: Tuesday, July 13, 2021 3:09 PM
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-
> Thomas Monjalon <thomas@monjalon.net>; Xiaoyun Li
> <xiaoyun.li@intel.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: [PATCH v7 2/2] app/testpmd: support matching the reserved filed
> for VXLAN
>
> Add a new testpmd pattern field 'last_rsvd' that supports the
> last 8-bits matching of VXLAN header.
>
> The examples for the "last_rsvd" pattern field are as below:
>
> 1. ...pattern eth / ipv4 / udp / vxlan last_rsvd is 0x80 / end ...
>
> This flow will exactly match the last 8-bits to be 0x80.
>
> 2. ...pattern eth / ipv4 / udp / vxlan last_rsvd spec 0x80
> vxlan mask 0x80 / end ...
>
> This flow will only match the MSB of the last 8-bits to be 1.
>
> Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
You should have kept my Ack from previous version in general,
But this is for future,
For this thank you:
Acked-by: Raslan Darawsheh <rasland@nvidia.com>
Kindest regards,
Raslan Darawsheh
> -----Original Message-----
> From: Raslan Darawsheh
> Sent: Tuesday, July 13, 2021 3:55 PM
> To: Rongwei Liu <rongweil@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Ori Kam
> <orika@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; Xiaoyun Li <xiaoyun.li@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v7 2/2] app/testpmd: support matching the reserved
> filed for VXLAN
@Andrew Rybchenko
I've just noticed there is a typo in the title when I pulled this to next-net-mlx from next-net:
Typo: filed -> field ?
Kindest regards,
Raslan Darawsheh
>
>
> > -----Original Message-----
> > From: Rongwei Liu <rongweil@nvidia.com>
> > Sent: Tuesday, July 13, 2021 3:09 PM
> > To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> > <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-
> > Thomas Monjalon <thomas@monjalon.net>; Xiaoyun Li
> > <xiaoyun.li@intel.com>
> > Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> > Subject: [PATCH v7 2/2] app/testpmd: support matching the reserved
> > filed for VXLAN
> >
> > Add a new testpmd pattern field 'last_rsvd' that supports the last
> > 8-bits matching of VXLAN header.
> >
> > The examples for the "last_rsvd" pattern field are as below:
> >
> > 1. ...pattern eth / ipv4 / udp / vxlan last_rsvd is 0x80 / end ...
> >
> > This flow will exactly match the last 8-bits to be 0x80.
> >
> > 2. ...pattern eth / ipv4 / udp / vxlan last_rsvd spec 0x80 vxlan mask
> > 0x80 / end ...
> >
> > This flow will only match the MSB of the last 8-bits to be 1.
> >
> > Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> You should have kept my Ack from previous version in general, But this is for
> future, For this thank you:
> Acked-by: Raslan Darawsheh <rasland@nvidia.com>
>
> Kindest regards,
> Raslan Darawsheh
HI Raslan:
Yes, you are right.
Forgot to correct the typo when addressing your comment to change the title.
BR
Rongwei
> -----Original Message-----
> From: Raslan Darawsheh <rasland@nvidia.com>
> Sent: Tuesday, July 13, 2021 11:34 PM
> To: Rongwei Liu <rongweil@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> Slava Ovsiienko <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>;
> NBU-Contact-Thomas Monjalon <thomas@monjalon.net>; Xiaoyun Li
> <xiaoyun.li@intel.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v7 2/2] app/testpmd: support matching the reserved
> filed for VXLAN
>
>
> > -----Original Message-----
> > From: Raslan Darawsheh
> > Sent: Tuesday, July 13, 2021 3:55 PM
> > To: Rongwei Liu <rongweil@nvidia.com>; Matan Azrad
> <matan@nvidia.com>;
> > Slava Ovsiienko <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>;
> > NBU-Contact-Thomas Monjalon <thomas@monjalon.net>; Xiaoyun Li
> > <xiaoyun.li@intel.com>
> > Cc: dev@dpdk.org
> > Subject: RE: [PATCH v7 2/2] app/testpmd: support matching the reserved
> > filed for VXLAN
> @Andrew Rybchenko
> I've just noticed there is a typo in the title when I pulled this to next-net-mlx
> from next-net:
> Typo: filed -> field ?
>
> Kindest regards,
> Raslan Darawsheh
> >
> >
> > > -----Original Message-----
> > > From: Rongwei Liu <rongweil@nvidia.com>
> > > Sent: Tuesday, July 13, 2021 3:09 PM
> > > To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> > > <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-
> > > Thomas Monjalon <thomas@monjalon.net>; Xiaoyun Li
> > > <xiaoyun.li@intel.com>
> > > Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> > > Subject: [PATCH v7 2/2] app/testpmd: support matching the reserved
> > > filed for VXLAN
> > >
> > > Add a new testpmd pattern field 'last_rsvd' that supports the last
> > > 8-bits matching of VXLAN header.
> > >
> > > The examples for the "last_rsvd" pattern field are as below:
> > >
> > > 1. ...pattern eth / ipv4 / udp / vxlan last_rsvd is 0x80 / end ...
> > >
> > > This flow will exactly match the last 8-bits to be 0x80.
> > >
> > > 2. ...pattern eth / ipv4 / udp / vxlan last_rsvd spec 0x80 vxlan
> > > mask
> > > 0x80 / end ...
> > >
> > > This flow will only match the MSB of the last 8-bits to be 1.
> > >
> > > Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> > > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> > You should have kept my Ack from previous version in general, But this
> > is for future, For this thank you:
> > Acked-by: Raslan Darawsheh <rasland@nvidia.com>
> >
> > Kindest regards,
> > Raslan Darawsheh
@@ -205,6 +205,7 @@ enum index {
ITEM_SCTP_CKSUM,
ITEM_VXLAN,
ITEM_VXLAN_VNI,
+ ITEM_VXLAN_LAST_RSVD,
ITEM_E_TAG,
ITEM_E_TAG_GRP_ECID_B,
ITEM_NVGRE,
@@ -1127,6 +1128,7 @@ static const enum index item_sctp[] = {
static const enum index item_vxlan[] = {
ITEM_VXLAN_VNI,
+ ITEM_VXLAN_LAST_RSVD,
ITEM_NEXT,
ZERO,
};
@@ -2839,6 +2841,14 @@ static const struct token token_list[] = {
item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan, vni)),
},
+ [ITEM_VXLAN_LAST_RSVD] = {
+ .name = "last_rsvd",
+ .help = "VXLAN last reserved bits",
+ .next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
+ rsvd1)),
+ },
[ITEM_E_TAG] = {
.name = "e_tag",
.help = "match E-Tag header",
@@ -266,8 +266,9 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
vx_vni = rte_be_to_cpu_32(vxlan_hdr->vx_vni);
MKDUMPSTR(print_buf, buf_size, cur_len,
" - VXLAN packet: packet type =%d, "
- "Destination UDP port =%d, VNI = %d",
- packet_type, udp_port, vx_vni >> 8);
+ "Destination UDP port =%d, VNI = %d, "
+ "last_rsvd = %d", packet_type,
+ udp_port, vx_vni >> 8, vx_vni & 0xff);
}
}
MKDUMPSTR(print_buf, buf_size, cur_len,
@@ -3694,6 +3694,7 @@ This section lists supported pattern items and their attributes, if any.
- ``vxlan``: match VXLAN header.
- ``vni {unsigned}``: VXLAN identifier.
+ - ``last_rsvd {unsigned}``: VXLAN last reserved 8-bits.
- ``e_tag``: match IEEE 802.1BR E-Tag header.