DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ivan Malov <ivan.malov@oktetlabs.ru>
To: dev@dpdk.org
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Andy Moreton <amoreton@xilinx.com>
Subject: [PATCH 1/4] net/sfc: refine the order of checks on MAE action set attach
Date: Wed, 17 Nov 2021 14:44:35 +0300	[thread overview]
Message-ID: <20211117114438.8347-2-ivan.malov@oktetlabs.ru> (raw)
In-Reply-To: <20211117114438.8347-1-ivan.malov@oktetlabs.ru>

The number of counters being non-zero can be detected before
the action set registry traversal, so move the check outside.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_mae.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 08e28b13c9..73bedf5088 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -763,13 +763,15 @@ sfc_mae_action_set_attach(struct sfc_adapter *sa,
 
 	SFC_ASSERT(sfc_adapter_is_locked(sa));
 
+	/*
+	 * Shared counters are not supported, hence, action
+	 * sets with counters are not attachable.
+	 */
+	if (n_count != 0)
+		return NULL;
+
 	TAILQ_FOREACH(action_set, &mae->action_sets, entries) {
-		/*
-		 * Shared counters are not supported, hence action sets with
-		 * COUNT are not attachable.
-		 */
 		if (action_set->encap_header == encap_header &&
-		    n_count == 0 &&
 		    efx_mae_action_set_specs_equal(action_set->spec, spec)) {
 			sfc_dbg(sa, "attaching to action_set=%p", action_set);
 			++(action_set->refcnt);
-- 
2.30.2


  reply	other threads:[~2021-11-17 11:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 11:44 [PATCH 0/4] net/sfc: support MAC address edits in transfer flows Ivan Malov
2021-11-17 11:44 ` Ivan Malov [this message]
2021-11-17 11:44 ` [PATCH 2/4] net/sfc: organise MAE flow action parsing function arguments Ivan Malov
2021-11-17 11:44 ` [PATCH 3/4] common/sfc_efx/base: support MAC address edit actions in MAE Ivan Malov
2021-11-17 11:44 ` [PATCH 4/4] net/sfc: support MAC address edits in transfer flows Ivan Malov
2021-11-17 13:17 ` [PATCH 0/4] " Ferruh Yigit

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=20211117114438.8347-2-ivan.malov@oktetlabs.ru \
    --to=ivan.malov@oktetlabs.ru \
    --cc=amoreton@xilinx.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    /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).