summaryrefslogtreecommitdiff
path: root/drivers/net/macsec.c
diff options
context:
space:
mode:
authorAntoine Tenart <atenart@kernel.org>2022-09-21 16:51:14 +0300
committerJakub Kicinski <kuba@kernel.org>2022-09-23 16:56:08 +0300
commit854c9181738f4f38a406f3941e6797e44c3b42d6 (patch)
treecee75e22ce4ce2761a73f7a47e85293d50f70472 /drivers/net/macsec.c
parent135435f90b94e02842dd52c2cf23b6c2b6a90930 (diff)
downloadlinux-854c9181738f4f38a406f3941e6797e44c3b42d6.tar.xz
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@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/macsec.c')
-rw-r--r--drivers/net/macsec.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 617f850bdb3a..160976929dfe 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);