From patchwork Wed Jun 3 02:39:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 70772 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E8ECA04EF; Wed, 3 Jun 2020 04:38:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6A2CF1C1A9; Wed, 3 Jun 2020 04:36:42 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DCEB21C19B; Wed, 3 Jun 2020 04:36:40 +0200 (CEST) IronPort-SDR: Aw4LRymy9hKBNviX3ma2nRX1kieLVIBpsGvJ5p5q9tlDYBUI0yzqqoKlcMSIzedibtx4GQaVzk CINLqeE6Ndig== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2020 19:36:40 -0700 IronPort-SDR: rv50hDrDLtaMJF0sN9ZQ6BgiwYBgnx283WiLv+iK+33vmVCaiECdzq87uZzEcY9374IZ2lnT0C GJOvo81FTmHQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,466,1583222400"; d="scan'208";a="347613918" Received: from dpdk51.sh.intel.com ([10.67.111.82]) by orsmga001.jf.intel.com with ESMTP; 02 Jun 2020 19:36:38 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang , stable@dpdk.org, Paul M Stillwell Jr Date: Wed, 3 Jun 2020 10:39:34 +0800 Message-Id: <20200603024016.30636-11-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200603024016.30636-1-qi.z.zhang@intel.com> References: <20200603024016.30636-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH 10/52] net/ice/base: fix variable type for ACL X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The commit ef92cee94cdb ("ice-shared: Fix remaining minor casting issues") changed the idx variable within ice_acl_add_entry() from a u16 to a u8. This causes the code to truncate the values greater than 255 to 255 or less when calling ice_aq_program_acl_entry() resulting in the wrong TCAM index being programmed for the specified rule. The result is that the rule action doesn't work correctly (packets don't get routed to the correct queue or dropped if that is the action). Fix the issue by changing the variable to be a u16 again. Fixes: f3202a097f12 ("net/ice/base: add ACL module") Cc: stable@dpdk.org Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_acl_ctrl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_acl_ctrl.c b/drivers/net/ice/base/ice_acl_ctrl.c index e67605141..39b399dd4 100644 --- a/drivers/net/ice/base/ice_acl_ctrl.c +++ b/drivers/net/ice/base/ice_acl_ctrl.c @@ -934,9 +934,10 @@ ice_acl_add_entry(struct ice_hw *hw, struct ice_acl_scen *scen, enum ice_acl_entry_prior prior, u8 *keys, u8 *inverts, struct ice_acl_act_entry *acts, u8 acts_cnt, u16 *entry_idx) { - u8 i, entry_tcam, num_cscd, idx, offset; + u8 i, entry_tcam, num_cscd, offset; struct ice_aqc_acl_data buf; enum ice_status status = ICE_SUCCESS; + u16 idx; if (!scen) return ICE_ERR_DOES_NOT_EXIST;