[2/2] net/nfp: fix VNI of IPv6 NVGRE encap action

Message ID 20230613032036.30968-3-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series fix VNI of NVGRE encap action |

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/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS

Commit Message

Chaoyong He June 13, 2023, 3:20 a.m. UTC
  Complete the missing logic of parse the tunnel id of IPv6 NVGRE tunnel
and send it to the firmware by control message.

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 6aea2b1559..31a21adf15 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -3209,6 +3209,7 @@  nfp_flow_action_nvgre_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
 		struct nfp_fl_tun *tun)
 {
 	uint8_t tos;
+	uint64_t tun_id;
 	const struct rte_ether_hdr *eth;
 	const struct rte_flow_item_ipv6 *ipv6;
 	const struct rte_flow_item_gre *gre;
@@ -3220,6 +3221,7 @@  nfp_flow_action_nvgre_encap_v6(struct nfp_app_fw_flower *app_fw_flower,
 	eth    = (const struct rte_ether_hdr *)raw_encap->data;
 	ipv6   = (const struct rte_flow_item_ipv6 *)(eth + 1);
 	gre    = (const struct rte_flow_item_gre *)(ipv6 + 1);
+	tun_id = rte_be_to_cpu_32(*(const rte_be32_t *)(gre + 1));
 
 	pre_tun = (struct nfp_fl_act_pre_tun *)actions;
 	memset(pre_tun, 0, act_pre_size);
@@ -3228,7 +3230,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 = 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,
+	nfp_flow_set_tun_process(set_tun, NFP_FL_TUN_GRE, tun_id,
 			ipv6->hdr.hop_limits, tos);
 	set_tun->tun_proto = gre->protocol;