lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZIhIRyFxM7Uz81og@boxer>
Date: Tue, 13 Jun 2023 12:43:19 +0200
From: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
CC: <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>,
	<anthony.l.nguyen@...el.com>, <magnus.karlsson@...el.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next] ice: use ice_down_up() where
 applicable

On Tue, Jun 13, 2023 at 12:25:08PM +0200, Przemek Kitszel wrote:
> On 6/12/23 16:17, Maciej Fijalkowski wrote:
> > ice_change_mtu() is currently using a separate ice_down() and ice_up()
> > calls to reflect changed MTU. ice_down_up() serves this purpose, so do
> > the refactoring here.
> > 
> > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
> > ---
> >   drivers/net/ethernet/intel/ice/ice_main.c | 12 ++----------
> >   1 file changed, 2 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> > index a1f7c8edc22f..609df077c314 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_main.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> > @@ -7634,17 +7634,9 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu)
> >   	/* if VSI is up, bring it down and then back up */
> >   	if (!test_and_set_bit(ICE_VSI_DOWN, vsi->state)) {
> 
> I would remove the above if(), as ice_down_up() starts with:
> 	if (test_and_set_bit(ICE_VSI_DOWN, vsi->state))
> 		return 0;
> 
> which, with your change applied would just return 0.

Yes, thanks a lot for paying attention, sending v2 shortly.

> 
> 
> > -		err = ice_down(vsi);
> > -		if (err) {
> > -			netdev_err(netdev, "change MTU if_down err %d\n", err);
> > -			return err;
> > -		}
> > -
> > -		err = ice_up(vsi);
> > -		if (err) {
> > -			netdev_err(netdev, "change MTU if_up err %d\n", err);
> > +		err = ice_down_up(vsi);
> > +		if (err)
> >   			return err;
> > -		}
> >   	}
> >   	netdev_dbg(netdev, "changed MTU to %d\n", new_mtu);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ