DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wei Zhao <wei.zhao1@intel.com>
To: dev@dpdk.org
Cc: qi.z.zhang@intel.com, nannan.lu@intel.com, yuan.peng@intel.com,
	Wei Zhao <wei.zhao1@intel.com>
Subject: [dpdk-dev] [PATCH 2/3] net/ice/base: add mask check when find switch recipe
Date: Fri, 10 Apr 2020 08:41:56 +0800	[thread overview]
Message-ID: <20200410004157.3032-3-wei.zhao1@intel.com> (raw)
In-Reply-To: <20200410004157.3032-1-wei.zhao1@intel.com>

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 <wei.zhao1@intel.com>
---
 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


  parent reply	other threads:[~2020-04-10  1:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10  0:41 [dpdk-dev] [PATCH 0/3] update ice switch base code Wei Zhao
2020-04-10  0:41 ` [dpdk-dev] [PATCH 1/3] net/ice/base: check the number of recipe when in chain Wei Zhao
2020-04-10  2:05   ` Lu, Nannan
2020-04-10  0:41 ` Wei Zhao [this message]
2020-04-14  3:02   ` [dpdk-dev] [PATCH 2/3] net/ice/base: add mask check when find switch recipe Lu, Nannan
2020-04-10  0:41 ` [dpdk-dev] [PATCH 3/3] net/ice/base: force switch to use different recipe for Wei Zhao
2020-04-10  2:40   ` Peng, Yuan
2020-04-10  1:05 ` [dpdk-dev] [PATCH 0/3] update ice switch base code Zhang, Qi Z
2020-04-15  7:52   ` Ye Xiaolong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200410004157.3032-3-wei.zhao1@intel.com \
    --to=wei.zhao1@intel.com \
    --cc=dev@dpdk.org \
    --cc=nannan.lu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=yuan.peng@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).