All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: netdev@vger.kernel.org
Cc: Leon Romanovsky <leon@kernel.org>,
	Antoine Tenart <atenart@kernel.org>,
	Sabrina Dubroca <sd@queasysnail.net>
Subject: [PATCH net v2 4/5] macsec: fix detection of RXSCs when toggling offloading
Date: Wed, 26 Oct 2022 23:56:26 +0200	[thread overview]
Message-ID: <0f3ab52fc5a5377c02e1f2dfc14a8d087f56124a.1666793468.git.sd@queasysnail.net> (raw)
In-Reply-To: <cover.1666793468.git.sd@queasysnail.net>

macsec_is_configured incorrectly uses secy->n_rx_sc to check if some
RXSCs exist. secy->n_rx_sc only counts the number of active RXSCs, but
there can also be inactive SCs as well, which may be stored in the
driver (in case we're disabling offloading), or would have to be
pushed to the device (in case we're trying to enable offloading).

As long as RXSCs active on creation and never turned off, the issue is
not visible.

Fixes: dcb780fb2795 ("net: macsec: add nla support for changing the offloading selection")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
 drivers/net/macsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 48e2dd2d5778..5a2c1bd65d89 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -2572,7 +2572,7 @@ static bool macsec_is_configured(struct macsec_dev *macsec)
 	struct macsec_tx_sc *tx_sc = &secy->tx_sc;
 	int i;
 
-	if (secy->n_rx_sc > 0)
+	if (secy->rx_sc)
 		return true;
 
 	for (i = 0; i < MACSEC_NUM_AN; i++)
-- 
2.38.0


  parent reply	other threads:[~2022-10-26 21:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 21:56 [PATCH net v2 0/5] macsec: offload-related fixes Sabrina Dubroca
2022-10-26 21:56 ` [PATCH net v2 1/5] Revert "net: macsec: report real_dev features when HW offloading is enabled" Sabrina Dubroca
2022-10-30  8:13   ` Leon Romanovsky
2022-10-30 11:54     ` Raed Salem
2022-10-30 15:02       ` Raed Salem
2022-10-26 21:56 ` [PATCH net v2 2/5] macsec: delete new rxsc when offload fails Sabrina Dubroca
2022-10-30  8:13   ` Leon Romanovsky
2022-10-26 21:56 ` [PATCH net v2 3/5] macsec: fix secy->n_rx_sc accounting Sabrina Dubroca
2022-10-27 18:29   ` Jakub Kicinski
2022-10-30  8:14   ` Leon Romanovsky
2022-10-26 21:56 ` Sabrina Dubroca [this message]
2022-10-30  8:15   ` [PATCH net v2 4/5] macsec: fix detection of RXSCs when toggling offloading Leon Romanovsky
2022-10-26 21:56 ` [PATCH net v2 5/5] macsec: clear encryption keys from the stack after setting up offload Sabrina Dubroca
2022-10-30  8:16   ` Leon Romanovsky
2022-10-27  8:45 ` [PATCH net v2 0/5] macsec: offload-related fixes Antoine Tenart

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=0f3ab52fc5a5377c02e1f2dfc14a8d087f56124a.1666793468.git.sd@queasysnail.net \
    --to=sd@queasysnail.net \
    --cc=atenart@kernel.org \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.