[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CO6PR18MB38730409D799C0A44769C417B0AC9@CO6PR18MB3873.namprd18.prod.outlook.com>
Date: Sun, 10 Jan 2021 17:53:17 +0000
From: Stefan Chulski <stefanc@...vell.com>
To: Andrew Lunn <andrew@...n.ch>
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>,
"linux@...linux.org.uk" <linux@...linux.org.uk>,
"mw@...ihalf.com" <mw@...ihalf.com>,
"rmk+kernel@...linux.org.uk" <rmk+kernel@...linux.org.uk>,
"atenart@...nel.org" <atenart@...nel.org>
Subject: RE: [EXT] Re: [PATCH RFC net-next 14/19] net: mvpp2: add ethtool
flow control configuration support
> > @@ -5373,6 +5402,30 @@ static int
> mvpp2_ethtool_set_pause_param(struct net_device *dev,
> > struct ethtool_pauseparam *pause) {
> > struct mvpp2_port *port = netdev_priv(dev);
> > + int i;
> > +
> > + if (pause->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);
> > + }
> > + }
>
>
> This looks wrong. Flow control is normally the result of auto negotiation. Both
> ends need to agree to it. Which is why
> mvpp2_ethtool_set_pause_param() passes the users request onto phylink.
> phylink will handle the autoneg and then ask the MAC to setup flow control
> depending on the result in mvpp2_mac_link_up().
>
> Andrew
Ok, I would move it to mvpp2_mac_link_up.
Stefan,
Thanks.
Powered by blists - more mailing lists