From patchwork Tue Jul 23 03:51:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 56932 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F20E11BF76; Tue, 23 Jul 2019 05:48:52 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 62B5F1BF35; Tue, 23 Jul 2019 05:48:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2019 20:48:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,297,1559545200"; d="scan'208";a="163371715" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by orsmga008.jf.intel.com with ESMTP; 22 Jul 2019 20:48:45 -0700 From: Qi Zhang To: qiming.yang@intel.com, wenzhuo.lu@intel.com Cc: paul.m.stillwell.jr@intel.com, dev@dpdk.org, Qi Zhang , stable@dpdk.org, Dan Nowlin Date: Tue, 23 Jul 2019 11:51:12 +0800 Message-Id: <20190723035115.42664-4-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190723035115.42664-1-qi.z.zhang@intel.com> References: <20190723035115.42664-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH 3/6] net/ice/base: fix ptype variable size 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" Change ptype variable to correctly be 16-bits in ice_prof_map structure. Fixes: 51d04e4933e3 ("net/ice/base: add flexible pipeline module") Cc: stable@dpdk.org Signed-off-by: Dan Nowlin Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_flex_pipe.c | 3 ++- drivers/net/ice/base/ice_flex_type.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c index c1f23ec02..147fa4d01 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -4376,7 +4376,8 @@ ice_add_prof_to_lst(struct ice_hw *hw, enum ice_block blk, p->tcam[i].prof_id = map->prof_id; p->tcam[i].tcam_idx = ICE_INVALID_TCAM; - ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg); + if (ice_ptg_find_ptype(hw, blk, map->ptype[i], &ptg)) + return ICE_ERR_CFG; p->tcam[i].ptg = ptg; } diff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h index dca5cf285..837e1e872 100644 --- a/drivers/net/ice/base/ice_flex_type.h +++ b/drivers/net/ice/base/ice_flex_type.h @@ -526,7 +526,7 @@ struct ice_prof_map { u64 context; u8 prof_id; u8 ptype_count; - u8 ptype[ICE_MAX_PTYPE_PER_PROFILE]; + u16 ptype[ICE_MAX_PTYPE_PER_PROFILE]; }; #define ICE_INVALID_TCAM 0xFFFF