netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
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
Date: Wed, 7 Dec 2022 16:33:12 +0100	[thread overview]
Message-ID: <Y5CyOLlsB0/ZdyDS@nanopsycho> (raw)
In-Reply-To: <20221207101017.533-2-ehakim@nvidia.com>

Wed, Dec 07, 2022 at 11:10:17AM CET, ehakim@nvidia.com wrote:
>From: Emeel Hakim <ehakim@nvidia.com>
>
>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 <raeds@nvidia.com>
>Signed-off-by: Emeel Hakim <ehakim@nvidia.com>
>---
> 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
>

  reply	other threads:[~2022-12-07 15:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 10:10 [PATCH net-next v3 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink ehakim
2022-12-07 10:10 ` [PATCH net-next 2/2] macsec: dump IFLA_MACSEC_OFFLOAD attribute as part of macsec dump ehakim
2022-12-07 15:33   ` Jiri Pirko [this message]
2022-12-07 15:35 ` [PATCH net-next v3 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink Jiri Pirko
2022-12-07 15:45 ` Sabrina Dubroca
2022-12-07 15:52   ` Emeel Hakim
2022-12-07 22:03     ` Sabrina Dubroca
2022-12-08  6:53       ` Emeel Hakim
2022-12-08 10:37         ` Sabrina Dubroca
2022-12-08 11:14           ` Emeel Hakim
  -- strict thread matches above, loose matches on Subject: below --
2022-12-27  8:25 [PATCH net-next " ehakim
2022-12-27  8:25 ` [PATCH net-next 2/2] macsec: dump IFLA_MACSEC_OFFLOAD attribute as part of macsec dump ehakim
2023-01-04  7:46 [PATCH net-next 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink ehakim
2023-01-04  7:46 ` [PATCH net-next 2/2] macsec: dump IFLA_MACSEC_OFFLOAD attribute as part of macsec dump ehakim

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=Y5CyOLlsB0/ZdyDS@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=atenart@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ehakim@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=raeds@nvidia.com \
    --cc=sd@queasysnail.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).