* [PATCH] net/nfp: fix VNI of VXLAN encap action
@ 2023-06-13 3:15 Chaoyong He
2023-06-19 17:23 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Chaoyong He @ 2023-06-13 3:15 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable
The 'vx_vni' field of VXLAN header is contain 24 bits of VNI and
8 bits of reserved. After convert into CPU endian, the reserved
8 bits should be shifted, or the VNI value will be not correct.
Fixes: 861949032d0f ("net/nfp: fix VNI of VXLAN encap 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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 5acb7f6ff3..ac4b15c763 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2747,7 +2747,7 @@ nfp_flow_action_vxlan_encap_v4(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);
+ tun_id = rte_be_to_cpu_32(vxlan->hdr.vx_vni) >> 8;
nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_VXLAN, tun_id,
ipv4->hdr.time_to_live, ipv4->hdr.type_of_service);
set_tun->tun_flags = vxlan->hdr.vx_flags;
@@ -2785,7 +2785,7 @@ 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);
+ tun_id = rte_be_to_cpu_32(vxlan->hdr.vx_vni) >> 8;
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, tos);
--
2.39.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net/nfp: fix VNI of VXLAN encap action
2023-06-13 3:15 [PATCH] net/nfp: fix VNI of VXLAN encap action Chaoyong He
@ 2023-06-19 17:23 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2023-06-19 17:23 UTC (permalink / raw)
To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund, stable
On 6/13/2023 4:15 AM, Chaoyong He wrote:
> The 'vx_vni' field of VXLAN header is contain 24 bits of VNI and
> 8 bits of reserved. After convert into CPU endian, the reserved
> 8 bits should be shifted, or the VNI value will be not correct.
>
> Fixes: 861949032d0f ("net/nfp: fix VNI of VXLAN encap action")
> Cc: stable@dpdk.org
>
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-19 17:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-13 3:15 [PATCH] net/nfp: fix VNI of VXLAN encap action Chaoyong He
2023-06-19 17:23 ` 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).