From patchwork Tue Jul 5 10:09:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, WenxuanX" X-Patchwork-Id: 113674 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 00DA8A0542; Tue, 5 Jul 2022 12:13:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E804B40691; Tue, 5 Jul 2022 12:13:04 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 0038C4021D for ; Tue, 5 Jul 2022 12:13:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657015983; x=1688551983; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=z9LFtnAEvpvME1C3eQVI1nqm2DGVvgd4UgFnE5EA7eM=; b=b2d39CuBTm7NPqbFWKOGHVmITR3CFPmNypNZwWCOY/8OeXg5TtXpGlFu rhxayE+xTuOAwK10blont2NdQHxL4tZ43PLnBhn7wXWPKu7N7CEOTWkhg 71vMjbRXMfyU1mK5SBLCHX7Xju1PfF+xVA/jD/Ueo4uRGZPcwlzgzeWak TC10jPHS93aNAgQ7F9fg6qGx7oWOTW0GgW/BGVevbZ074Cmu3XhQ1Z8Ym H8UD/FVVo7OfFee849+MVvOmOj2DlPzMKICO4TRMpVwX6/P0DIDA1oGJY +kxYje0k1ugiIy6qAMUOqrTOayE9BzSTzwPchk0wS+pMRAFIsRqFr78od A==; X-IronPort-AV: E=McAfee;i="6400,9594,10398"; a="272091071" X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="272091071" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 03:13:02 -0700 X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="650058603" 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 03:12:59 -0700 From: wenxuanx.wu@intel.com To: jingjing.wu@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] net/iavf: fix gtpu extension flow error Date: Tue, 5 Jul 2022 18:09:49 +0800 Message-Id: <20220705100949.1060962-1-wenxuanx.wu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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, 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 --- 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..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;