From patchwork Mon Oct 31 06:42:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 119336 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 E1181A034C; Mon, 31 Oct 2022 07:54:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C577940151; Mon, 31 Oct 2022 07:54:07 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 3B0F0400D5 for ; Mon, 31 Oct 2022 07:54:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667199246; x=1698735246; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=njBQIMYjPhOZ9+UiTvtA0ifDENt2RjhKI0wgbY5mpsk=; b=S/BbL9Nqn3tzqrqz17Evs2yzz5kPGkPhKUi8NzD5kDA8DgqfaAGWQ774 rKysmy/+kCb5ok90Y2SLoEYr4OsRYzQ79B0ivx6DmRY8exdr/Px39fWHo SpxhfE7IhqazovaoaM/kryzAztrkLK6gOk4uDVsIYwUX2rABJYrXnnTG2 stWwxMLv+Oj5WpuuOGcgotShhK9TYIKp/ljcdiEvnftbqkT/jHbCo+Rq7 6yuZx3To2z+gPge2bolhrQIy7OxPzIgFoOsFQ4Gd+ccWhCAK+XHg82XFP 51fJhl6xtXfTYdMP4+1SW8mvESzkQXiO78iXLRLKUFPbQ0AP0/AAJV1Ta w==; X-IronPort-AV: E=McAfee;i="6500,9779,10516"; a="289221917" X-IronPort-AV: E=Sophos;i="5.95,227,1661842800"; d="scan'208";a="289221917" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2022 23:54:05 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10516"; a="758738393" X-IronPort-AV: E=Sophos;i="5.95,227,1661842800"; d="scan'208";a="758738393" Received: from intel-cd-odc-steve.cd.intel.com ([10.240.178.189]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2022 23:54:03 -0700 From: Steve Yang To: dev@dpdk.org Cc: jingjing.wu@intel.com, beilei.xing@intel.com, Steve Yang Subject: [PATCH v1] net/iavf: fix refine protocol header error Date: Mon, 31 Oct 2022 06:42:33 +0000 Message-Id: <20221031064233.256917-1-stevex.yang@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 Protocol header count should be changed when tunnel level is larger than 1. Fixes: 13a7dcddd8ee ("net/iavf: fix taninted scalar") Signed-off-by: Steve Yang Acked-by: Qi Zhang --- drivers/net/iavf/iavf_hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index 71c80d2c75..67b05313eb 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -1210,7 +1210,7 @@ iavf_refine_proto_hdrs_by_pattern(struct virtchnl_proto_hdrs *proto_hdrs, struct virtchnl_proto_hdr *hdr2; int i, shift_count = 1; int tun_lvl = proto_hdrs->tunnel_level; - int phdrs_count = proto_hdrs->count; + int phdrs_count = 0; if (!(phint & IAVF_PHINT_GTPU_MSK) && !(phint & IAVF_PHINT_GRE)) return; @@ -1219,6 +1219,7 @@ iavf_refine_proto_hdrs_by_pattern(struct virtchnl_proto_hdrs *proto_hdrs, if (phint & IAVF_PHINT_LAYERS_MSK) shift_count = 2; + phdrs_count = proto_hdrs->count; /* shift headers layer */ for (i = phdrs_count - 1 + shift_count; i > shift_count - 1; i--) {