From: Sabrina Dubroca <sd@queasysnail.net>
To: "Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>
Cc: sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com,
hkelam@marvell.com, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, borisp@nvidia.com,
saeedm@nvidia.com, leon@kernel.org, andrew@lunn.ch,
hkallweit1@gmail.com, linux@armlinux.org.uk,
richardcochran@gmail.com, sebastian.tobuschat@oss.nxp.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next v6 08/10] net: phy: nxp-c45-tja11xx: add MACsec support
Date: Mon, 2 Oct 2023 23:08:14 +0200 [thread overview]
Message-ID: <ZRsxPvGXJAbgkzYL@hog> (raw)
In-Reply-To: <20230928084430.1882670-9-radu-nicolae.pirea@oss.nxp.com>
2023-09-28, 11:44:28 +0300, Radu Pirea (NXP OSS) wrote:
> +static int nxp_c45_mdo_upd_secy(struct macsec_context *ctx)
> +{
> + u8 encoding_sa = ctx->secy->tx_sc.encoding_sa;
> + struct phy_device *phydev = ctx->phydev;
> + struct nxp_c45_phy *priv = phydev->priv;
> + struct nxp_c45_secy *phy_secy;
> + struct nxp_c45_sa next_sa;
> + bool can_rx_sc0_impl;
> +
> + phydev_dbg(phydev, "update SecY SCI %016llx\n",
> + sci_to_cpu(ctx->secy->sci));
> +
> + phy_secy = nxp_c45_find_secy(&priv->macsec->secy_list, ctx->secy->sci);
> + if (IS_ERR(phy_secy))
> + return PTR_ERR(phy_secy);
> +
> + if (!nxp_c45_mac_addr_free(ctx))
> + return -EBUSY;
mdo_upd_secy gets called from macsec_set_mac_address, but the error is ignored:
static int macsec_set_mac_address(struct net_device *dev, void *p)
{
[...]
/* If h/w offloading is available, propagate to the device */
if (macsec_is_offloaded(macsec)) {
const struct macsec_ops *ops;
struct macsec_context ctx;
ops = macsec_get_ops(macsec, &ctx);
if (ops) {
ctx.secy = &macsec->secy;
macsec_offload(ops->mdo_upd_secy, &ctx);
}
}
return 0;
}
Should macsec_set_mac_address try to roll back the change when
mdo_upd_secy fails? Otherwise I guess your device doesn't work.
> +static int nxp_c45_mdo_add_txsa(struct macsec_context *ctx)
> +{
...
> + nxp_c45_select_secy(phydev, phy_secy->secy_id);
> + nxp_c45_sa_set_pn(phydev, sa, tx_sa->next_pn, 0);
> + nxp_c45_sa_set_key(ctx, sa->regs, tx_sa->key.salt.bytes, tx_sa->ssci);
> + if (ctx->secy->tx_sc.encoding_sa == sa->an)
nit: double ' ' before '==' (also in nxp_c45_mdo_del_txsa)
--
Sabrina
next prev parent reply other threads:[~2023-10-02 21:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 8:44 [PATCH net-next v6 00/10] Add MACsec support for TJA11XX C45 PHYs Radu Pirea (NXP OSS)
2023-09-28 8:44 ` [PATCH net-next v6 01/10] net: macsec: move sci_to_cpu to macsec header Radu Pirea (NXP OSS)
2023-09-28 8:44 ` [PATCH net-next v6 02/10] net: macsec: documentation for macsec_context and macsec_ops Radu Pirea (NXP OSS)
2023-09-28 8:44 ` [PATCH net-next v6 03/10] net: macsec: indicate next pn update when offloading Radu Pirea (NXP OSS)
2023-09-28 8:44 ` [PATCH net-next v6 04/10] net: macsec: introduce mdo_insert_tx_tag Radu Pirea (NXP OSS)
2023-09-28 8:44 ` [PATCH net-next v6 05/10] octeontx2-pf: mcs: update PN only when update_pn is true Radu Pirea (NXP OSS)
2023-09-29 6:20 ` [EXT] " Subbaraya Sundeep Bhatta
2023-10-03 13:15 ` Sabrina Dubroca
2023-10-04 18:30 ` Radu Pirea (OSS)
2023-09-28 8:44 ` [PATCH net-next v6 06/10] net: phy: mscc: macsec: reject PN update requests Radu Pirea (NXP OSS)
2023-09-28 8:44 ` [PATCH net-next v6 07/10] net/mlx5e: macsec: use update_pn flag instead of PN comparation Radu Pirea (NXP OSS)
2023-09-28 8:44 ` [PATCH net-next v6 08/10] net: phy: nxp-c45-tja11xx: add MACsec support Radu Pirea (NXP OSS)
2023-10-02 21:08 ` Sabrina Dubroca [this message]
2023-09-28 8:44 ` [PATCH net-next v6 09/10] net: phy: nxp-c45-tja11xx: add MACsec statistics Radu Pirea (NXP OSS)
2023-09-28 8:44 ` [PATCH net-next v6 10/10] net: phy: nxp-c45-tja11xx: implement mdo_insert_tx_tag Radu Pirea (NXP OSS)
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=ZRsxPvGXJAbgkzYL@hog \
--to=sd@queasysnail.net \
--cc=andrew@lunn.ch \
--cc=borisp@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkallweit1@gmail.com \
--cc=hkelam@marvell.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=radu-nicolae.pirea@oss.nxp.com \
--cc=richardcochran@gmail.com \
--cc=saeedm@nvidia.com \
--cc=sbhatta@marvell.com \
--cc=sebastian.tobuschat@oss.nxp.com \
--cc=sgoutham@marvell.com \
/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.