[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220921135118.968595-4-atenart@kernel.org>
Date: Wed, 21 Sep 2022 15:51:14 +0200
From: Antoine Tenart <atenart@...nel.org>
To: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com
Cc: Antoine Tenart <atenart@...nel.org>, sundeep.lkml@...il.com,
saeedm@...dia.com, liorna@...dia.com, dbogdanov@...vell.com,
mstarovoitov@...vell.com, irusskikh@...vell.com,
sd@...asysnail.net, netdev@...r.kernel.org
Subject: [PATCH net-next 3/7] net: macsec: remove the prepare phase when offloading
The hardware offloading in MACsec was initially supported using 2 phases.
This was proposed in the RFC as this could have allowed easier fallback
to the software implementation if the hardware did not support a feature
or had enough entries already. But this fallback wasn't implemented and
might not be a good idea after all. In addition it turned out this logic
didn't mapped well the hardware logic and device drivers were mostly
ignoring the preparation phase.
Let's remove this as it does not offer any advantage and is ignored by
drivers.
Signed-off-by: Antoine Tenart <atenart@...nel.org>
---
drivers/net/macsec.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 830fed3914b6..0e7cf6a68a50 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -1663,22 +1663,9 @@ static int macsec_offload(int (* const func)(struct macsec_context *),
if (ctx->offload == MACSEC_OFFLOAD_PHY)
mutex_lock(&ctx->phydev->lock);
- /* Phase I: prepare. The drive should fail here if there are going to be
- * issues in the commit phase.
- */
- ctx->prepare = true;
- ret = (*func)(ctx);
- if (ret)
- goto phy_unlock;
-
- /* Phase II: commit. This step cannot fail. */
ctx->prepare = false;
ret = (*func)(ctx);
- /* This should never happen: commit is not allowed to fail */
- if (unlikely(ret))
- WARN(1, "MACsec offloading commit failed (%d)\n", ret);
-phy_unlock:
if (ctx->offload == MACSEC_OFFLOAD_PHY)
mutex_unlock(&ctx->phydev->lock);
--
2.37.3
Powered by blists - more mailing lists