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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CO6PR18MB387376F5CA52DEF588D2F4C6B0BE9@CO6PR18MB3873.namprd18.prod.outlook.com>
Date:   Sun, 24 Jan 2021 12:39:56 +0000
From:   Stefan Chulski <stefanc@...vell.com>
To:     Russell King - ARM Linux admin <linux@...linux.org.uk>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "thomas.petazzoni@...tlin.com" <thomas.petazzoni@...tlin.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        Nadav Haklai <nadavh@...vell.com>,
        Yan Markman <ymarkman@...vell.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "mw@...ihalf.com" <mw@...ihalf.com>,
        "andrew@...n.ch" <andrew@...n.ch>,
        "atenart@...nel.org" <atenart@...nel.org>
Subject: RE: [EXT] Re: [PATCH v2 RFC net-next 13/18] net: mvpp2: add ethtool
 flow control configuration support

> 
> ----------------------------------------------------------------------
> On Sun, Jan 24, 2021 at 01:44:02PM +0200, stefanc@...vell.com wrote:
> > @@ -6407,6 +6490,29 @@ static void mvpp2_mac_link_up(struct
> phylink_config *config,
> >  			     val);
> >  	}
> >
> > +	if (tx_pause && port->priv->global_tx_fc) {
> > +		port->tx_fc = true;
> > +		mvpp2_rxq_enable_fc(port);
> > +		if (port->priv->percpu_pools) {
> > +			for (i = 0; i < port->nrxqs; i++)
> > +				mvpp2_bm_pool_update_fc(port, &port-
> >priv->bm_pools[i], true);
> > +		} else {
> > +			mvpp2_bm_pool_update_fc(port, port->pool_long,
> true);
> > +			mvpp2_bm_pool_update_fc(port, port->pool_short,
> true);
> > +		}
> > +
> > +	} else if (port->priv->global_tx_fc) {
> > +		port->tx_fc = false;
> > +		mvpp2_rxq_disable_fc(port);
> > +		if (port->priv->percpu_pools) {
> > +			for (i = 0; i < port->nrxqs; i++)
> > +				mvpp2_bm_pool_update_fc(port, &port-
> >priv->bm_pools[i], false);
> > +		} else {
> > +			mvpp2_bm_pool_update_fc(port, port->pool_long,
> false);
> > +			mvpp2_bm_pool_update_fc(port, port->pool_short,
> false);
> > +		}
> > +	}
> > +
> 
> It seems this can be written more succinctly:
> 
> 	if (port->priv->global_tx_fc) {
> 		port->tx_fc = tx_pause;
> 		if (tx_pause)
> 			mvpp2_rxq_enable_fc(port);
> 		else
> 			mvpp2_rxq_disable_fc(port);
> 		if (port->priv->percpu_pools) {
> 			for (i = 0; i < port->nrxqs; i++)
> 				mvpp2_bm_pool_update_fc(port,
> 						&port->priv->bm_pools[i],
> 						tx_pause);
> 		} else {
> 			mvpp2_bm_pool_update_fc(port, port->pool_long,
> 						tx_pause);
> 			mvpp2_bm_pool_update_fc(port, port->pool_short,
> 						tx_pause);
> 		}
> 	}
> 

Ok, I would update.

Thanks,
Stefan.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ