* [PATCH 1/4] net/nfp: fix the IPv6 flow item
2023-06-08 3:19 [PATCH 0/4] fix the data endian problem in IPv6 logic Chaoyong He
@ 2023-06-08 3:19 ` Chaoyong He
2023-06-08 3:19 ` [PATCH 2/4] net/nfp: fix TOS of IPv6 VXLAN encap flow action Chaoyong He
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Chaoyong He @ 2023-06-08 3:19 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable
When process the IPv6 flow item, the former logic perform the
mask operation between one big endian value and one CPU endian
valude, which cause the match of DSCP filed not work as expect.
Fix it by convert the big endian data into CPU endian and remove
the unneeded mask operation.
Fixes: d96507404463 ("net/nfp: support IPv6 flow item")
Cc: stable@dpdk.org
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
drivers/net/nfp/nfp_flow.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 41b722f4d8..937fb390df 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -1232,6 +1232,7 @@ nfp_flow_merge_ipv6(__rte_unused struct nfp_app_fw_flower *app_fw_flower,
bool is_mask,
bool is_outer_layer)
{
+ uint32_t vtc_flow;
struct nfp_flower_ipv6 *ipv6;
const struct rte_ipv6_hdr *hdr;
struct nfp_flower_meta_tci *meta_tci;
@@ -1255,12 +1256,12 @@ nfp_flow_merge_ipv6(__rte_unused struct nfp_app_fw_flower *app_fw_flower,
hdr = is_mask ? &mask->hdr : &spec->hdr;
+ vtc_flow = rte_be_to_cpu_32(hdr->vtc_flow);
if (ext_meta && (rte_be_to_cpu_32(ext_meta->nfp_flow_key_layer2) &
NFP_FLOWER_LAYER2_GRE)) {
ipv6_gre_tun = (struct nfp_flower_ipv6_gre_tun *)*mbuf_off;
- ipv6_gre_tun->ip_ext.tos = (hdr->vtc_flow &
- RTE_IPV6_HDR_TC_MASK) >> RTE_IPV6_HDR_TC_SHIFT;
+ ipv6_gre_tun->ip_ext.tos = vtc_flow >> RTE_IPV6_HDR_TC_SHIFT;
ipv6_gre_tun->ip_ext.ttl = hdr->hop_limits;
memcpy(ipv6_gre_tun->ipv6.ipv6_src, hdr->src_addr,
sizeof(ipv6_gre_tun->ipv6.ipv6_src));
@@ -1269,8 +1270,7 @@ nfp_flow_merge_ipv6(__rte_unused struct nfp_app_fw_flower *app_fw_flower,
} else {
ipv6_udp_tun = (struct nfp_flower_ipv6_udp_tun *)*mbuf_off;
- ipv6_udp_tun->ip_ext.tos = (hdr->vtc_flow &
- RTE_IPV6_HDR_TC_MASK) >> RTE_IPV6_HDR_TC_SHIFT;
+ ipv6_udp_tun->ip_ext.tos = vtc_flow >> RTE_IPV6_HDR_TC_SHIFT;
ipv6_udp_tun->ip_ext.ttl = hdr->hop_limits;
memcpy(ipv6_udp_tun->ipv6.ipv6_src, hdr->src_addr,
sizeof(ipv6_udp_tun->ipv6.ipv6_src));
@@ -1291,10 +1291,10 @@ nfp_flow_merge_ipv6(__rte_unused struct nfp_app_fw_flower *app_fw_flower,
*mbuf_off += sizeof(struct nfp_flower_tp_ports);
hdr = is_mask ? &mask->hdr : &spec->hdr;
+ vtc_flow = rte_be_to_cpu_32(hdr->vtc_flow);
ipv6 = (struct nfp_flower_ipv6 *)*mbuf_off;
- ipv6->ip_ext.tos = (hdr->vtc_flow & RTE_IPV6_HDR_TC_MASK) >>
- RTE_IPV6_HDR_TC_SHIFT;
+ ipv6->ip_ext.tos = vtc_flow >> RTE_IPV6_HDR_TC_SHIFT;
ipv6->ip_ext.proto = hdr->proto;
ipv6->ip_ext.ttl = hdr->hop_limits;
memcpy(ipv6->ipv6_src, hdr->src_addr, sizeof(ipv6->ipv6_src));
--
2.39.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/4] net/nfp: fix TOS of IPv6 VXLAN encap flow action
2023-06-08 3:19 [PATCH 0/4] fix the data endian problem in IPv6 logic Chaoyong He
2023-06-08 3:19 ` [PATCH 1/4] net/nfp: fix the IPv6 flow item Chaoyong He
@ 2023-06-08 3:19 ` Chaoyong He
2023-06-08 3:19 ` [PATCH 3/4] net/nfp: fix TOS of IPv6 GENEVE " Chaoyong He
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Chaoyong He @ 2023-06-08 3:19 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable
The former logic directly do shift operation on big endian data, fix
it by convert the big endian data into CPU endian firstly.
Fixes: c3b7254093c2 ("net/nfp: support IPv6 VXLAN encap flow action")
Cc: stable@dpdk.org
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
drivers/net/nfp/nfp_flow.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 937fb390df..914afb85e3 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2743,6 +2743,7 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
struct nfp_fl_rule_metadata *nfp_flow_meta,
struct nfp_fl_tun *tun)
{
+ uint8_t tos;
uint64_t tun_id;
struct nfp_fl_act_pre_tun *pre_tun;
struct nfp_fl_act_set_tun *set_tun;
@@ -2763,9 +2764,9 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
set_tun = (struct nfp_fl_act_set_tun *)(act_data + act_pre_size);
memset(set_tun, 0, act_set_size);
tun_id = rte_be_to_cpu_32(vxlan->hdr.vx_vni);
+ tos = rte_be_to_cpu_32(ipv6->hdr.vtc_flow) >> RTE_IPV6_HDR_TC_SHIFT;
nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, tun_id,
- ipv6->hdr.hop_limits,
- (ipv6->hdr.vtc_flow >> RTE_IPV6_HDR_TC_SHIFT) & 0xff);
+ ipv6->hdr.hop_limits, tos);
set_tun->tun_flags = vxlan->hdr.vx_flags;
/* Send the tunnel neighbor cmsg to fw */
--
2.39.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/4] net/nfp: fix TOS of IPv6 GENEVE encap flow action
2023-06-08 3:19 [PATCH 0/4] fix the data endian problem in IPv6 logic Chaoyong He
2023-06-08 3:19 ` [PATCH 1/4] net/nfp: fix the IPv6 flow item Chaoyong He
2023-06-08 3:19 ` [PATCH 2/4] net/nfp: fix TOS of IPv6 VXLAN encap flow action Chaoyong He
@ 2023-06-08 3:19 ` Chaoyong He
2023-06-08 3:19 ` [PATCH 4/4] net/nfp: fix TOS of IPv6 NVGRE " Chaoyong He
2023-06-08 15:43 ` [PATCH 0/4] fix the data endian problem in IPv6 logic Ferruh Yigit
4 siblings, 0 replies; 6+ messages in thread
From: Chaoyong He @ 2023-06-08 3:19 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable
The former logic directly do shift operation on big endian data, fix
it by convert the big endian data into CPU endian firstly.
Fixes: 98fa36eccc4c ("net/nfp: support IPv6 GENEVE encap flow action")
Cc: stable@dpdk.org
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
drivers/net/nfp/nfp_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 914afb85e3..213d0c7935 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -3130,7 +3130,7 @@ nfp_flow_action_geneve_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
set_tun = (struct nfp_fl_act_set_tun *)(act_data + act_pre_size);
memset(set_tun, 0, act_set_size);
- tos = (ipv6->hdr.vtc_flow >> RTE_IPV6_HDR_TC_SHIFT) & 0xff;
+ tos = rte_be_to_cpu_32(ipv6->hdr.vtc_flow) >> RTE_IPV6_HDR_TC_SHIFT;
tun_id = (geneve->vni[0] << 16) | (geneve->vni[1] << 8) | geneve->vni[2];
nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_GENEVE, tun_id,
ipv6->hdr.hop_limits, tos);
--
2.39.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/4] net/nfp: fix TOS of IPv6 NVGRE encap flow action
2023-06-08 3:19 [PATCH 0/4] fix the data endian problem in IPv6 logic Chaoyong He
` (2 preceding siblings ...)
2023-06-08 3:19 ` [PATCH 3/4] net/nfp: fix TOS of IPv6 GENEVE " Chaoyong He
@ 2023-06-08 3:19 ` Chaoyong He
2023-06-08 15:43 ` [PATCH 0/4] fix the data endian problem in IPv6 logic Ferruh Yigit
4 siblings, 0 replies; 6+ messages in thread
From: Chaoyong He @ 2023-06-08 3:19 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable
The former logic directly do shift operation on big endian data, fix
it by convert the big endian data into CPU endian firstly.
Fixes: fff680eef7f9 ("net/nfp: support IPv6 NVGRE encap flow action")
Cc: stable@dpdk.org
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
drivers/net/nfp/nfp_flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 213d0c7935..56ce222c9f 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -3203,7 +3203,7 @@ nfp_flow_action_nvgre_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
set_tun = (struct nfp_fl_act_set_tun *)(act_data + act_pre_size);
memset(set_tun, 0, act_set_size);
- tos = (ipv6->hdr.vtc_flow >> RTE_IPV6_HDR_TC_SHIFT) & 0xff;
+ tos = rte_be_to_cpu_32(ipv6->hdr.vtc_flow) >> RTE_IPV6_HDR_TC_SHIFT;
nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_GRE, 0,
ipv6->hdr.hop_limits, tos);
set_tun->tun_proto = gre->protocol;
--
2.39.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] fix the data endian problem in IPv6 logic
2023-06-08 3:19 [PATCH 0/4] fix the data endian problem in IPv6 logic Chaoyong He
` (3 preceding siblings ...)
2023-06-08 3:19 ` [PATCH 4/4] net/nfp: fix TOS of IPv6 NVGRE " Chaoyong He
@ 2023-06-08 15:43 ` Ferruh Yigit
4 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2023-06-08 15:43 UTC (permalink / raw)
To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund
On 6/8/2023 4:19 AM, Chaoyong He wrote:
> This patch series fix the data endian problem in the logics related with
> rte_flow of IPv6.
>
> Chaoyong He (4):
> net/nfp: fix the IPv6 flow item
> net/nfp: fix TOS of IPv6 VXLAN encap flow action
> net/nfp: fix TOS of IPv6 GENEVE encap flow action
> net/nfp: fix TOS of IPv6 NVGRE encap flow action
>
> drivers/net/nfp/nfp_flow.c | 21 +++++++++++----------
> 1 file changed, 11 insertions(+), 10 deletions(-)
>
Series applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread