net/iavf: fix gtpu extension flow error

Message ID 20220705100949.1060962-1-wenxuanx.wu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix gtpu extension flow error |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Wu, WenxuanX July 5, 2022, 10:09 a.m. UTC
  From: Wenxuan Wu <wenxuanx.wu@intel.com>

Due to the change of struct rte_gtp_psc_generic_hdr, firmware can
not handle gtp_psc properly, we induce a new structure to fix this
gap between firmware and struct rte_gtp_psc_generic_hdr.

Fixes: d5eb3e600d9e ("net/iavf: support flow director basic rule")
Cc: simei.su@intel.com
Cc: stable@dpdk.com

Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
---
 drivers/net/iavf/iavf_fdir.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
  

Comments

Qi Zhang July 5, 2022, 11:52 a.m. UTC | #1
> -----Original Message-----
> From: wenxuanx.wu@intel.com <wenxuanx.wu@intel.com>
> Sent: Tuesday, July 5, 2022 6:10 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhou, YidingX
> <yidingx.zhou@intel.com>; Wu, WenxuanX <wenxuanx.wu@intel.com>; Su,
> Simei <simei.su@intel.com>; stable@dpdk.com
> Subject: [PATCH] net/iavf: fix gtpu extension flow error
> 
> From: Wenxuan Wu <wenxuanx.wu@intel.com>
> 
> Due to the change of struct rte_gtp_psc_generic_hdr, firmware can not handle
> gtp_psc properly, we induce a new structure to fix this gap between firmware
> and struct rte_gtp_psc_generic_hdr.

Why this is related firmware?  iavf rte_flow is not related with firmware, it is about virtchnl between VF and PF
  

Patch

diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index f236260502..5ac4e88728 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -1300,8 +1300,22 @@  iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
 										 GTPU_DWN, QFI);
 				}
 
-				rte_memcpy(hdr->buffer, gtp_psc_spec,
-					sizeof(*gtp_psc_spec));
+				/*
+				 * New structure to fix gap between firmware and
+				 * rte_gtp_psc_generic_hdr.
+				 */
+				struct iavf_gtp_psc_spec_hdr {
+					uint8_t len;
+					uint8_t qfi:6;
+					uint8_t type:4;
+					uint8_t next;
+				} psc;
+				psc.len = gtp_psc_spec->hdr.ext_hdr_len;
+				psc.qfi = gtp_psc_spec->hdr.qfi;
+				psc.type = gtp_psc_spec->hdr.type;
+				psc.next = 0;
+				rte_memcpy(hdr->buffer, &psc,
+					sizeof(struct iavf_gtp_psc_spec_hdr));
 			}
 
 			hdrs->count = ++layer;