Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1058297rwb; Wed, 7 Dec 2022 08:09:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf60REORWtYSnC7pv9C3zmmgnAI51sg7kIVCH0iYsxAK+xaKHjiZXfEW38AGZwklhAwbTwri X-Received: by 2002:a05:6a02:187:b0:46f:38ad:de99 with SMTP id bj7-20020a056a02018700b0046f38adde99mr32486304pgb.218.1670429362225; Wed, 07 Dec 2022 08:09:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670429362; cv=none; d=google.com; s=arc-20160816; b=AW7jORN8IlQZ0ZefsUfitgOGIBS2EInk72dUT+OC/I0aM6zXvto0pK6sBA/vdz0pSg rBHFz42nrBg2UBv0Ivb8e9KIakOFS4GQMpcZY4aI9cuSIF+SSAhhNe5jsYgCvxznwkVX /F3t+zmKTItKQxYJT7sa1xLuhS5lIoTFzZs6hkc0TMMg1+uUBXLUG48paa2pbPCMguDH aOuzlawezDsM63pHOMfZTLSbO6X0zq6gEkhZtmkUmx+umuoZAcEyCbkFxATFtIl3i68o MNegHrRszJLR4mpGQcR0AMSbt+tkm2z0Yicob7PiDu6OvPMIbK2YeF8CMiCD5bS4oZ78 V2+w== 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:dkim-signature; bh=LwrUVb9xSURXqii8hhhP6vjXiWv8GEEp5vfAQ1wLtCk=; b=0stMs4ZWKSOths3yjQu6zeiy9FNfjLBvhURjE5YZQr5y2bs1KVXKKjn8Yc4O0cI2wa cmzn4dwIs+djlFk186+vqzASsgecUkkf+HB0En3DDRZoqj3/pexaHzNESdsAW/D9c8ug hxQzQelc4e4zPMd3DO8EhL6kmq5T22zpEA60anF5llseYaqrJ3y2UVnBz0Zpt+S9DlTc NXiWgXcK8z7xXqxp3Ule6FAaUlUmZY8VW0m+4P9+K4RzuE7c11YoCR/akehuA2vJOGsR 92KuMbMLHujPQterIQERky1Ftqr3jVimfXOXlPWP7oR0JH8v41wt2GGcBbIsPoMGfEPR WgiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20210112.gappssmtp.com header.s=20210112 header.b=QuaimEhC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id co16-20020a17090afe9000b0020053614bd0si1732964pjb.148.2022.12.07.08.09.11; Wed, 07 Dec 2022 08:09:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20210112.gappssmtp.com header.s=20210112 header.b=QuaimEhC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229658AbiLGPdT (ORCPT + 76 others); Wed, 7 Dec 2022 10:33:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbiLGPdR (ORCPT ); Wed, 7 Dec 2022 10:33:17 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8356C5E9D0 for ; Wed, 7 Dec 2022 07:33:15 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id c17so16832018edj.13 for ; Wed, 07 Dec 2022 07:33:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=LwrUVb9xSURXqii8hhhP6vjXiWv8GEEp5vfAQ1wLtCk=; b=QuaimEhCdfsub+L2H5uXjfZi+XE6U9sSBvyt8pqyP1McpoPW3Of7RAiBdotiqP+ohm eeXuS4XeNOmTyGtCwffJVhZv4DotkrmsEOhu1cr2kqRWHq+PylSAENYSiXTdIj4NDbBz R1+WTIT6ueiARDqNTaEFocunpxSqxtRIkoLFBym52RKVtBhJdSjg0bjhdE21itfPV7jz o7Crq5vsapbf2ZlH3gURsWW2coe9vo0tcU6QWi3d9APVQ1GMcdZKNuuK0ORHBfKOiTIj /p/uYFF9P0pwExq73u9JLjdtGAJf93KNifYFlz4Eht1uHG7SAliXu9qK0FmVbQjbIfb7 BXig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=LwrUVb9xSURXqii8hhhP6vjXiWv8GEEp5vfAQ1wLtCk=; b=aRNbsLcFM6jiNd/mn2CHQsa+jKGkap9HjFsrTrFbPsgCcWZhblv/e1/f1pLH1sxCGV arKa1DD8B47FtZiNMJwR8TSrKWAX7IQcpsEB90mtBz4Jk9TIHaSbD554MfyO08Ds8XXn jZEXpLzxcGYbcGldnhlXJB/594w7vm0ZbffMDaRF9eDrqibN7kjFlrh7Qn8o2CNuB9Mh bwuVDIdlRKUN1o5fIMWVRaag35TULW5A3r0VyQZILzaQfgZGX/8KIo/dm1UDSRxdAmcP I9O0PTyyexgDCj4r6wTaI8gLDMccTdhkOk+tWOycPqKq35vxPeKCUSpsChF/b6U4nB80 Ts8A== X-Gm-Message-State: ANoB5pkFeBabQUUi3MFj5benTvjFRP3DgYXKqJuAoc9djUoFzKRjLwMZ 51IRuhhSN6dv6qAgwZfUv/kcuQ== X-Received: by 2002:a05:6402:48d:b0:461:c3d9:c6a3 with SMTP id k13-20020a056402048d00b00461c3d9c6a3mr64263633edv.154.1670427194077; Wed, 07 Dec 2022 07:33:14 -0800 (PST) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id s26-20020a056402015a00b00461bacee867sm2337366edu.25.2022.12.07.07.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 07:33:13 -0800 (PST) Date: Wed, 7 Dec 2022 16:33:12 +0100 From: Jiri Pirko To: ehakim@nvidia.com Cc: linux-kernel@vger.kernel.org, raeds@nvidia.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, sd@queasysnail.net, atenart@kernel.org Subject: Re: [PATCH net-next 2/2] macsec: dump IFLA_MACSEC_OFFLOAD attribute as part of macsec dump Message-ID: References: <20221207101017.533-1-ehakim@nvidia.com> <20221207101017.533-2-ehakim@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221207101017.533-2-ehakim@nvidia.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wed, Dec 07, 2022 at 11:10:17AM CET, ehakim@nvidia.com wrote: >From: Emeel Hakim > >consider IFLA_MACSEC_OFFLOAD in macsec's device dump, Sentense starts with capital letter. >this mandates a change at macsec_get_size to consider the >additional attribute. I'm unable to understand what you mean by this description. What should the codebase consider and why? Code looks fine. > >Reviewed-by: Raed Salem >Signed-off-by: Emeel Hakim >--- > drivers/net/macsec.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > >diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c >index 1850a1ee4380..0b8613576383 100644 >--- a/drivers/net/macsec.c >+++ b/drivers/net/macsec.c >@@ -4257,16 +4257,22 @@ static size_t macsec_get_size(const struct net_device *dev) > nla_total_size(1) + /* IFLA_MACSEC_SCB */ > nla_total_size(1) + /* IFLA_MACSEC_REPLAY_PROTECT */ > nla_total_size(1) + /* IFLA_MACSEC_VALIDATION */ >+ nla_total_size(1) + /* IFLA_MACSEC_OFFLOAD */ > 0; > } > > static int macsec_fill_info(struct sk_buff *skb, > const struct net_device *dev) > { >- struct macsec_secy *secy = &macsec_priv(dev)->secy; >- struct macsec_tx_sc *tx_sc = &secy->tx_sc; >+ struct macsec_tx_sc *tx_sc; >+ struct macsec_dev *macsec; >+ struct macsec_secy *secy; > u64 csid; > >+ macsec = macsec_priv(dev); >+ secy = &macsec->secy; >+ tx_sc = &secy->tx_sc; >+ > switch (secy->key_len) { > case MACSEC_GCM_AES_128_SAK_LEN: > csid = secy->xpn ? MACSEC_CIPHER_ID_GCM_AES_XPN_128 : MACSEC_DEFAULT_CIPHER_ID; >@@ -4291,6 +4297,7 @@ static int macsec_fill_info(struct sk_buff *skb, > nla_put_u8(skb, IFLA_MACSEC_SCB, tx_sc->scb) || > nla_put_u8(skb, IFLA_MACSEC_REPLAY_PROTECT, secy->replay_protect) || > nla_put_u8(skb, IFLA_MACSEC_VALIDATION, secy->validate_frames) || >+ nla_put_u8(skb, IFLA_MACSEC_OFFLOAD, macsec->offload) || > 0) > goto nla_put_failure; > >-- >2.21.3 >