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 4605EA0599; Fri, 10 Apr 2020 03:03:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 65FCE1D442; Fri, 10 Apr 2020 03:03:46 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1AD021D429 for ; Fri, 10 Apr 2020 03:03:43 +0200 (CEST) IronPort-SDR: GFAzKoOb5Vc+SDThSzLWjITZIQkyOqeIUFIRafT9K3oLhCHi1bqBUtE7YeFIcO1udD4Loo9A8T +bpCQolPRS3A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2020 18:03:43 -0700 IronPort-SDR: rvuTi3eDOYIXRwGlo/COgubI4U/Si/RaOQnefIX97Wm75hvfpRV5RNLgKhLez2rxPsdzZzIrjd ONKhMyeZmGjA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,364,1580803200"; d="scan'208";a="259525641" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([172.16.182.123]) by orsmga008.jf.intel.com with ESMTP; 09 Apr 2020 18:03:42 -0700 From: Wei Zhao To: dev@dpdk.org Cc: qi.z.zhang@intel.com, nannan.lu@intel.com, yuan.peng@intel.com, Wei Zhao Date: Fri, 10 Apr 2020 08:41:56 +0800 Message-Id: <20200410004157.3032-3-wei.zhao1@intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200410004157.3032-1-wei.zhao1@intel.com> References: <20200410004157.3032-1-wei.zhao1@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/3] net/ice/base: add mask check when find switch recipe 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" In order to find accurate recipe for switch filter, we need to add mask as an element when searching for recipe. If we create different rules with the same input set, but using different masks, then proper recipes should use those different mask. Signed-off-by: Wei Zhao --- drivers/net/ice/base/ice_switch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index c17219274..bc0c368d7 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -5012,6 +5012,8 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts) if (lkup_exts->n_val_words == recp[i].lkup_exts.n_val_words) { struct ice_fv_word *a = lkup_exts->fv_words; struct ice_fv_word *b = recp[i].lkup_exts.fv_words; + u16 *c = recp[i].lkup_exts.field_mask; + u16 *d = lkup_exts->field_mask; bool found = true; u8 p, q; @@ -5019,7 +5021,8 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts) for (q = 0; q < recp[i].lkup_exts.n_val_words; q++) { if (a[p].off == b[q].off && - a[p].prot_id == b[q].prot_id) + a[p].prot_id == b[q].prot_id && + d[p] == c[q]) /* Found the "p"th word in the * given recipe */ -- 2.19.1