[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <IA1PR12MB6353C094EFC78F8FAEE41519ABFC9@IA1PR12MB6353.namprd12.prod.outlook.com>
Date: Wed, 11 Jan 2023 13:38:13 +0000
From: Emeel Hakim <ehakim@...dia.com>
To: Sabrina Dubroca <sd@...asysnail.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Raed Salem <raeds@...dia.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"atenart@...nel.org" <atenart@...nel.org>
Subject: RE: [PATCH net-next v8 1/2] macsec: add support for
IFLA_MACSEC_OFFLOAD in macsec_changelink
> -----Original Message-----
> From: Sabrina Dubroca <sd@...asysnail.net>
> Sent: Wednesday, 11 January 2023 15:35
> To: Emeel Hakim <ehakim@...dia.com>
> Cc: netdev@...r.kernel.org; Raed Salem <raeds@...dia.com>;
> davem@...emloft.net; edumazet@...gle.com; kuba@...nel.org;
> pabeni@...hat.com; atenart@...nel.org
> Subject: Re: [PATCH net-next v8 1/2] macsec: add support for
> IFLA_MACSEC_OFFLOAD in macsec_changelink
>
> External email: Use caution opening links or attachments
>
>
> Sorry to delay this again, there's something to fix in this version.
> I hope you're not too frustrated by the review process.
all good thanks for the effort!
I will fix ASAP.
> 2023-01-11, 10:11:11 +0200, ehakim@...dia.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.
Ack
> (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.
Ack
> > /* 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
Powered by blists - more mailing lists