From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43368C76191 for ; Tue, 16 Jul 2019 03:07:38 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 0306F20659 for ; Tue, 16 Jul 2019 03:07:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0306F20659 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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