From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1B8B5A0540; Wed, 6 Jul 2022 04:59:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B465B40687; Wed, 6 Jul 2022 04:59:54 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 080EB40395 for ; Wed, 6 Jul 2022 04:59:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657076393; x=1688612393; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jlXrIX7RoD7fM6b91JO9i2bOK2JXZbpniJuXtQI5920=; b=hebemr8yQ2UdUrMGZlbmfajKrDq47sSi1dWc6d16Bhll+RhdUGh2nS6I zTpdpZd5uGMKPGbARSNUNKv3A+Ql0NViRPTbxP4Gyhc2i5N9vESHX/skF 6CH+cwxX2LzYK+xFsb2Jk35WUIxQULJDbDeONOaiZghdyBfR4cjunGCTX w3ZY3pt4qG7fZjvky36GYt5ykGZrasJffn5QIEgocWHYXjETaOwR9zHv8 4BTLP6nFidp4bC6c1xMIyVq6/aUaDiuNr+YmY10kuBGPl0DHMP0bswmkk 9k9JHrtov5vPFjpBze8q5MNLtCTB+REfAF4Lm7h2kCDiMg6K2OWHVT3JU g==; X-IronPort-AV: E=McAfee;i="6400,9594,10399"; a="263413763" X-IronPort-AV: E=Sophos;i="5.92,248,1650956400"; d="scan'208";a="263413763" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 19:59:52 -0700 X-IronPort-AV: E=Sophos;i="5.92,248,1650956400"; d="scan'208";a="650454255" Received: from unknown (HELO localhost.localdomain) ([10.239.252.3]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 19:59:49 -0700 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 Message-Id: <20220706025626.1070737-1-wenxuanx.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220705100949.1060962-1-wenxuanx.wu@intel.com> References: <20220705100949.1060962-1-wenxuanx.wu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Wenxuan Wu 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 --- 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