aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/macsec.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-09-23 06:56:12 -0700
committerJakub Kicinski <kuba@kernel.org>2022-09-23 06:56:13 -0700
commitf416bdfb6aa41300321fbfe59db049ffebd6198b (patch)
treef436ee0e16f6e8d438612b105722dd64a11fce87 /drivers/net/macsec.c
parentaacdecda9eb4c65e5ed02c088f8fa4fd50bd327d (diff)
parent99383f1298ee25901b1f6a665bdcc3344acb2382 (diff)
downloadlinux-f416bdfb6aa41300321fbfe59db049ffebd6198b.tar.gz
linux-f416bdfb6aa41300321fbfe59db049ffebd6198b.tar.bz2
linux-f416bdfb6aa41300321fbfe59db049ffebd6198b.zip
Merge branch 'net-macsec-remove-the-preparation-phase-when-offloading-operations'
Antoine Tenart says: ==================== net: macsec: remove the preparation phase when offloading operations It was reported[1] the 2-step phase offloading of MACsec operations did not fit well and device drivers were mostly ignoring the first phase (preparation). In addition the s/w fallback in case h/w rejected an operation, which could have taken advantage of this design, never was implemented and it's probably not a good idea anyway (at least unconditionnally). So let's remove this logic which only makes the code more complex for no advantage, before there are too many drivers providing MACsec offloading. This series removes the first phase (preparation) of the MACsec h/w offloading. The modifications are split per-driver and in a way that makes bissection working with logical steps; but I can squash some patches if needed. This was tested on the MSCC PHY but not on the Altantic nor mlx5e NICs. [1] https://lore.kernel.org/all/166322893264.61080.12133865599607623050@kwain/T/ ==================== Link: https://lore.kernel.org/r/20220921135118.968595-1-atenart@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/macsec.c')
-rw-r--r--drivers/net/macsec.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
index 617f850bdb3a..8193ab39206f 100644
--- a/drivers/net/macsec.c
+++ b/drivers/net/macsec.c
@@ -1663,22 +1663,8 @@ 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);