From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CAA23A0471 for ; Tue, 16 Jul 2019 05:07:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 11B212C18; Tue, 16 Jul 2019 05:07:37 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 2D11B2082 for ; Tue, 16 Jul 2019 05:07:34 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2019 20:07:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,496,1557212400"; d="scan'208";a="172413055" Received: from dpdk6.bj.intel.com ([172.16.182.192]) by orsmga006.jf.intel.com with ESMTP; 15 Jul 2019 20:07:32 -0700 From: Wei Zhao To: dev@dpdk.org Cc: qi.z.zhang@intel.com, wei zhao Date: Tue, 16 Jul 2019 10:36:38 +0800 Message-Id: <1563244598-63808-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1563242909-62810-1-git-send-email-wei.zhao1@intel.com> References: <1563242909-62810-1-git-send-email-wei.zhao1@intel.com> Subject: [dpdk-dev] [PATCH v3] net/ice: fix item number when pattern has ETH 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" When pattern has ETH, maybe it will contain MAC and ethertype two kinds of lookup parameters, so add more item number for memory malloc in order to reserve one more memory slot for ETH which may consume 2 lookup items. Fixes: 24dc00c30907 ("net/ice: enable switch filter") Signed-off-by: wei zhao --- drivers/net/ice/ice_switch_filter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index 5424223..b88b4f5 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -435,6 +435,11 @@ ice_create_switch_filter(struct ice_pf *pf, tun_type = ICE_SW_TUN_VXLAN; if (item->type == RTE_FLOW_ITEM_TYPE_NVGRE) tun_type = ICE_SW_TUN_NVGRE; + /* reserve one more memory slot for ETH which may + * consume 2 lookup items. + */ + if (item->type == RTE_FLOW_ITEM_TYPE_ETH) + item_num++; } rule_info.tun_type = tun_type; -- 2.7.5