From: Sabrina Dubroca <sd@queasysnail.net>
To: ehakim@nvidia.com
Cc: netdev@vger.kernel.org, raeds@nvidia.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
atenart@kernel.org
Subject: Re: [PATCH net-next v8 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink
Date: Wed, 11 Jan 2023 14:34:42 +0100 [thread overview]
Message-ID: <Y7668voOCFqWXmdF@hog> (raw)
In-Reply-To: <20230111081112.21067-2-ehakim@nvidia.com>
Sorry to delay this again, there's something to fix in this version.
I hope you're not too frustrated by the review process.
2023-01-11, 10:11:11 +0200, ehakim@nvidia.com wrote:
> +static int macsec_upd_offload(struct sk_buff *skb, struct genl_info *info)
> +{
> + struct nlattr *tb_offload[MACSEC_OFFLOAD_ATTR_MAX + 1];
> + struct nlattr **attrs = info->attrs;
> + enum macsec_offload offload;
> + struct macsec_dev *macsec;
> + struct net_device *dev;
> + int ret;
int ret = 0;
Otherwise we can return with ret uninitialized when macsec->offload ==
offload.
(unfortunately the compiler warning is disabled in the kernel Makefile)
[...]
> @@ -3840,8 +3837,17 @@ static int macsec_changelink(struct net_device *dev, struct nlattr *tb[],
> if (ret)
> goto cleanup;
>
> + if (data[IFLA_MACSEC_OFFLOAD]) {
> + offload = nla_get_u8(data[IFLA_MACSEC_OFFLOAD]);
> + if (macsec->offload != offload) {
> + macsec_offload_state_change = true;
> + ret = macsec_update_offload(dev, offload);
> + if (ret)
> + goto cleanup;
> + }
> + }
nit: there was a blank line here in the previous version, please bring it back.
> /* If h/w offloading is available, propagate to the device */
> - if (macsec_is_offloaded(macsec)) {
> + if (!macsec_offload_state_change && macsec_is_offloaded(macsec)) {
> const struct macsec_ops *ops;
> struct macsec_context ctx;
Thanks.
--
Sabrina
next prev parent reply other threads:[~2023-01-11 13:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 8:11 [PATCH net-next v8 0/2] Add support to offload macsec using netlink update ehakim
2023-01-11 8:11 ` [PATCH net-next v8 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink ehakim
2023-01-11 13:34 ` Sabrina Dubroca [this message]
2023-01-11 13:38 ` Emeel Hakim
2023-01-11 13:49 ` kernel test robot
2023-01-11 8:11 ` [PATCH net-next v8 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=Y7668voOCFqWXmdF@hog \
--to=sd@queasysnail.net \
--cc=atenart@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ehakim@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=raeds@nvidia.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 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).