From 755fd7b22da9115fc6682c2cf9e9268bb26bfb38 Mon Sep 17 00:00:00 2001 From: Wenxuan Wu Date: Wed, 6 Jul 2022 10:56:26 +0800 Subject: [PATCH] net/iavf: fix GTP-U extension flow Due to the change of struct rte_gtp_psc_generic_hdr, kernel driver can not handle gtp_psc properly, we introduce a new structure to fix this gap between kernel driver and struct rte_gtp_psc_generic_hdr. Fixes: d5eb3e600d9e ("net/iavf: support flow director basic rule") Cc: stable@dpdk.org Signed-off-by: Wenxuan Wu Tested-by: Zhimin Huang Acked-by: Qiming Yang --- drivers/net/iavf/iavf_fdir.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c index f236260502..4789d46ab2 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 kernel driver 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; -- 2.39.5