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 7ACFFA0548 for ; Wed, 29 Sep 2021 05:26:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 678A4410EA; Wed, 29 Sep 2021 05:26:27 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id E9BBF4068E; Wed, 29 Sep 2021 05:26:24 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10121"; a="204341329" X-IronPort-AV: E=Sophos;i="5.85,331,1624345200"; d="scan'208";a="204341329" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2021 20:26:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,331,1624345200"; d="scan'208";a="707023659" Received: from dpdk-junfengguo-v1.sh.intel.com ([10.67.119.231]) by fmsmga006.fm.intel.com with ESMTP; 28 Sep 2021 20:26:21 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, stable@dpdk.org, ferruh.yigit@intel.com, junfeng.guo@intel.com, lingyu.liu@intel.com Date: Wed, 29 Sep 2021 11:13:07 +0000 Message-Id: <20210929111307.422672-1-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] net/iavf: fix QFI field bit check for GTPU EH X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" If GTPU Extionsion header has no pdu_type setting, the parsed value of gtp_psc_spec->pdu_type will be 0, which is same as IAVF_GTPU_EH_DWLINK. Thus, fot this case, we should check gtp_psc_mask->pdu_type instead, to set QFI field bit of GTPU_EH first. Fixes: 45cc3a5435fc ("net/iavf: fix QFI fields of GTPU UL/DL for FDIR") Cc: stable@dpdk.org Signed-off-by: Junfeng Guo --- drivers/net/iavf/iavf_fdir.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c index 560589a496..227a089ce0 100644 --- a/drivers/net/iavf/iavf_fdir.c +++ b/drivers/net/iavf/iavf_fdir.c @@ -1171,17 +1171,15 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad, if (gtp_psc_spec && gtp_psc_mask) { if (gtp_psc_mask->qfi == UINT8_MAX) { input_set |= IAVF_INSET_GTPU_QFI; - if (gtp_psc_spec->pdu_type == - IAVF_GTPU_EH_UPLINK) + if (!gtp_psc_mask->pdu_type) VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, - GTPU_UP, QFI); - else if (gtp_psc_spec->pdu_type == - IAVF_GTPU_EH_DWLINK) + GTPU_EH, QFI); + else if (gtp_psc_spec->pdu_type == IAVF_GTPU_EH_DWLINK) VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, GTPU_DWN, QFI); - else + else if (gtp_psc_spec->pdu_type == IAVF_GTPU_EH_UPLINK) VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, - GTPU_EH, QFI); + GTPU_UP, QFI); } rte_memcpy(hdr->buffer, gtp_psc_spec, -- 2.25.1