DPDK patches and discussions
 help / color / mirror / Atom feed
From: wenxuanx.wu@intel.com
To: qiz.zhang@intel.com, beilei.xing@intel.com, dev@dpdk.org
Cc: qiming.yang@intel.com, yidingx.zhou@intel.com,
	wenxuanx.wu@intel.com, simei.su@intel.com, stable@dpdk.com
Subject: [PATCH v2] net/iavf: fix gtpu extension flow error
Date: Wed,  6 Jul 2022 10:56:26 +0800	[thread overview]
Message-ID: <20220706025626.1070737-1-wenxuanx.wu@intel.com> (raw)
In-Reply-To: <20220705100949.1060962-1-wenxuanx.wu@intel.com>

From: Wenxuan Wu <wenxuanx.wu@intel.com>

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: simei.su@intel.com
Cc: stable@dpdk.com

Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>

---
v2: refine commit log and doc.
---
 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.25.1


  parent reply	other threads:[~2022-07-06  2:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-05 10:09 [PATCH] " wenxuanx.wu
2022-07-05 11:52 ` Zhang, Qi Z
2022-07-06  2:56 ` wenxuanx.wu [this message]
2022-07-07  6:11   ` [PATCH v2] " Huang, ZhiminX
2022-07-07  6:57   ` Yang, Qiming
2022-07-07  7:13     ` Zhang, Qi Z
2022-07-11 15:18       ` Thomas Monjalon
2022-07-06  2:45 wenxuanx.wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220706025626.1070737-1-wenxuanx.wu@intel.com \
    --to=wenxuanx.wu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=qiz.zhang@intel.com \
    --cc=simei.su@intel.com \
    --cc=stable@dpdk.com \
    --cc=yidingx.zhou@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).