Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1576155rdb; Mon, 2 Oct 2023 14:08:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHstWqMuHvIwj8PjevVT+cV5RsQlbfxTnzOkzTgC7E8OgmSfr++ZVAHX8PmLoP7QR7HbFfI X-Received: by 2002:a05:6358:9217:b0:14c:79ec:1b86 with SMTP id d23-20020a056358921700b0014c79ec1b86mr12602591rwb.24.1696280938589; Mon, 02 Oct 2023 14:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696280938; cv=none; d=google.com; s=arc-20160816; b=bcsobiZm/DUP2/ffhJH+oyvaPa64g0KmEulrqi3PMog8Iu89jubXAXrBH1L0YQ4eQB d2gpaXq3CPf3MeGjjOc8EjSpzovglDxzWw73gB4DC6cN5FYCQIUzf/4jAxZatEKyThi3 JFymlgVry5MxfS6rAK/rUD3rLguqhbpPuqsczH9WYkV4SiDkG320VbR53KsnFmPdB0aY PHmKYxWS1xg4bIpUJm6E6dTqOEJrb+m53kdlgWMfXkPcIqZsBOrPQEO2yKRe2LdFUzcO 8flgPAIGbaqdWXsmA11oIekRy6BOD2gt/DSKRZKRNHTLFRP+nqc7vDtS/p9beyhMpz3T RSKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=I6d9gH1zBTipAxG3DHkp930xlCxjW6uqL2/oBggb2Qo=; fh=y96JFWngBmfj7ulcV8TFzfmoGqoRNykxRIW0LozX898=; b=or36IG27yJezEaEz2yLpVFcS4ijfowL/z/t8P0S8dBjJZe3JlKPnZJy6uFzWcK8s1W VNGcGgzb1uGNycX1K+olOCRftRqHVDeKiGjF1vMgcjq8Qhfz9sreUTtrT+yMfqL1QGH2 3JUcYC3NVTVjUDRqywLjyiUoYSfjF4CS1509KnEzAPnkjcXo4MGVHDrmWeINDvgCvMT4 D7XwKozcOB3lQehPZ8OUN+m1CaNz48loM+zqkRt0eANQ/zrVrV4phRcjMaNCn89KrJof fdR/ael82RdbQ0xSx7o9FkL34KY+pBxYdS5k2D90RpKyV3StR1UHDCaSYLV1qyQvnNWu D1gQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id v202-20020a6361d3000000b005891f742953si1718213pgb.29.2023.10.02.14.08.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 14:08:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5BC6D81552FE; Mon, 2 Oct 2023 14:08:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbjJBVIq (ORCPT + 99 others); Mon, 2 Oct 2023 17:08:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbjJBVIp (ORCPT ); Mon, 2 Oct 2023 17:08:45 -0400 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8E6B8E for ; Mon, 2 Oct 2023 14:08:42 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-390-81ZDJZC5NGOH4LIxnAQpBQ-1; Mon, 02 Oct 2023 17:08:21 -0400 X-MC-Unique: 81ZDJZC5NGOH4LIxnAQpBQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 776A3811621; Mon, 2 Oct 2023 21:08:20 +0000 (UTC) Received: from hog (unknown [10.45.224.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 521022156A27; Mon, 2 Oct 2023 21:08:16 +0000 (UTC) Date: Mon, 2 Oct 2023 23:08:14 +0200 From: Sabrina Dubroca To: "Radu Pirea (NXP OSS)" 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 Message-ID: References: <20230928084430.1882670-1-radu-nicolae.pirea@oss.nxp.com> <20230928084430.1882670-9-radu-nicolae.pirea@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230928084430.1882670-9-radu-nicolae.pirea@oss.nxp.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 02 Oct 2023 14:08:56 -0700 (PDT) 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