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 C7EE1A0577; Tue, 14 Apr 2020 05:02:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A68D01C020; Tue, 14 Apr 2020 05:02:31 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id A734F1C01F for ; Tue, 14 Apr 2020 05:02:29 +0200 (CEST) IronPort-SDR: MZkVu/+Ok1ritlZxMY6160u5SoXw+YeKReIYkPJpYWLu15C2hAQn1E/LWzcTRSzkkMTakMgdvr KGDnwUdB9JHA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 20:02:28 -0700 IronPort-SDR: ZRdMnQcx7+fp6VGi6EfkVL//xlnVxRnBkUI9HmZbJ5JI5nz2BBOb8neHm43CLrs8YkO8zUWw5s lLxN2KrKTORw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,381,1580803200"; d="scan'208";a="241848423" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga007.jf.intel.com with ESMTP; 13 Apr 2020 20:02:28 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Apr 2020 20:02:28 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 14 Apr 2020 11:02:25 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Tue, 14 Apr 2020 11:02:25 +0800 From: "Lu, Nannan" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Peng, Yuan" Thread-Topic: [PATCH 2/3] net/ice/base: add mask check when find switch recipe Thread-Index: AQHWDtPoKs07VO1J5kGtoCt667Ooqqh39I8A Date: Tue, 14 Apr 2020 03:02:25 +0000 Message-ID: References: <20200410004157.3032-1-wei.zhao1@intel.com> <20200410004157.3032-3-wei.zhao1@intel.com> In-Reply-To: <20200410004157.3032-3-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Tested-by: Lu, Nannan -----Original Message----- From: Zhao1, Wei=20 Sent: Friday, April 10, 2020 8:42 AM To: dev@dpdk.org Cc: Zhang, Qi Z ; Lu, Nannan ; P= eng, Yuan ; Zhao1, Wei Subject: [PATCH 2/3] net/ice/base: add mask check when find switch recipe 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 m= asks, 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_s= witch.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 ic= e_prot_lkup_ext *lkup_exts) if (lkup_exts->n_val_words =3D=3D recp[i].lkup_exts.n_val_words) { struct ice_fv_word *a =3D lkup_exts->fv_words; struct ice_fv_word *b =3D recp[i].lkup_exts.fv_words; + u16 *c =3D recp[i].lkup_exts.field_mask; + u16 *d =3D lkup_exts->field_mask; bool found =3D true; u8 p, q; =20 @@ -5019,7 +5021,8 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ic= e_prot_lkup_ext *lkup_exts) for (q =3D 0; q < recp[i].lkup_exts.n_val_words; q++) { if (a[p].off =3D=3D b[q].off && - a[p].prot_id =3D=3D b[q].prot_id) + a[p].prot_id =3D=3D b[q].prot_id && + d[p] =3D=3D c[q]) /* Found the "p"th word in the * given recipe */ -- 2.19.1