netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emeel Hakim <ehakim@nvidia.com>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Raed Salem <raeds@nvidia.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"atenart@kernel.org" <atenart@kernel.org>
Subject: RE: [PATCH net-next v6 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink
Date: Sun, 8 Jan 2023 09:46:26 +0000	[thread overview]
Message-ID: <IA1PR12MB6353B1E92F98FEC8B1B04F8EABF99@IA1PR12MB6353.namprd12.prod.outlook.com> (raw)
In-Reply-To: <Y7n6hF3voEe8Hv+5@hog>



> -----Original Message-----
> From: Sabrina Dubroca <sd@queasysnail.net>
> Sent: Sunday, 8 January 2023 1:05
> To: Emeel Hakim <ehakim@nvidia.com>
> Cc: netdev@vger.kernel.org; Raed Salem <raeds@nvidia.com>;
> davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com; atenart@kernel.org
> Subject: Re: [PATCH net-next v6 1/2] macsec: add support for
> IFLA_MACSEC_OFFLOAD in macsec_changelink
> 
> External email: Use caution opening links or attachments
> 
> 
> 2023-01-06, 15:35:50 +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 net_device *dev;
> > +     int ret;
> > +
> > +     if (!attrs[MACSEC_ATTR_IFINDEX])
> > +             return -EINVAL;
> > +
> > +     if (!attrs[MACSEC_ATTR_OFFLOAD])
> > +             return -EINVAL;
> > +
> > +     if (nla_parse_nested_deprecated(tb_offload, MACSEC_OFFLOAD_ATTR_MAX,
> > +                                     attrs[MACSEC_ATTR_OFFLOAD],
> > +                                     macsec_genl_offload_policy, NULL))
> > +             return -EINVAL;
> > +
> > +     dev = get_dev_from_nl(genl_info_net(info), attrs);
> > +     if (IS_ERR(dev))
> > +             return PTR_ERR(dev);
> > +
> > +     if (!tb_offload[MACSEC_OFFLOAD_ATTR_TYPE])
> > +             return -EINVAL;
> > +
> > +     offload = nla_get_u8(tb_offload[MACSEC_OFFLOAD_ATTR_TYPE]);
> > +
> > +     rtnl_lock();
> 
> Why are you putting rtnl_lock() back down here? You just moved it above
> get_dev_from_nl with commit f3b4a00f0f62 ("net: macsec: fix net device access
> prior to holding a lock"), now you're pretty much reverting that fix.

Ack will fix.

> > +
> > +     ret = macsec_update_offload(dev, offload);
> >
> > -rollback:
> > -     macsec->offload = prev_offload;
> > -out:
> >       rtnl_unlock();
> > +
> >       return ret;
> >  }
> >
> 
> --
> Sabrina


  reply	other threads:[~2023-01-08  9:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 13:35 [PATCH net-next v6 0/2] Add support to offload macsec using netlink update ehakim
2023-01-06 13:35 ` [PATCH net-next v6 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink ehakim
2023-01-07 23:04   ` Sabrina Dubroca
2023-01-08  9:46     ` Emeel Hakim [this message]
2023-01-06 13:35 ` [PATCH net-next v6 2/2] macsec: dump IFLA_MACSEC_OFFLOAD attribute as part of macsec dump ehakim
  -- strict thread matches above, loose matches on Subject: below --
2023-01-05  8:04 [PATCH net-next 0/2] Add support to offload macsec using netlink update ehakim
2023-01-05  8:04 ` [PATCH net-next v6 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink ehakim
2023-01-05  7:57 [PATCH net-next v6 0/2] Add support to offload macsec using netlink update ehakim
2023-01-05  7:57 ` [PATCH net-next v6 1/2] macsec: add support for IFLA_MACSEC_OFFLOAD in macsec_changelink 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=IA1PR12MB6353B1E92F98FEC8B1B04F8EABF99@IA1PR12MB6353.namprd12.prod.outlook.com \
    --to=ehakim@nvidia.com \
    --cc=atenart@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@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).