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: <c086a2e5-87e7-4926-bf80-c0b406c2c8e9@lunn.ch>
Date: Tue, 14 May 2024 16:32:34 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Hans Ulli Kroll <ulli.kroll@...glemail.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org
Subject: Re: [PATCH net-next v3 5/5] net: ethernet: cortina: Implement
 .set_pauseparam()

On Tue, May 14, 2024 at 10:55:18AM +0200, Linus Walleij wrote:
> On Mon, May 13, 2024 at 7:22 PM Andrew Lunn <andrew@...n.ch> wrote:
> > On Mon, May 13, 2024 at 03:38:52PM +0200, Linus Walleij wrote:
> > > The Cortina Gemini ethernet can very well set up TX or RX
> > > pausing, so add this functionality to the driver in a
> > > .set_pauseparam() callback.
> > >
> > > Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> > > ---
> > >  drivers/net/ethernet/cortina/gemini.c | 15 +++++++++++++++
> > >  1 file changed, 15 insertions(+)
> > >
> > > diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c
> > > index 85a9777083ba..4ae25a064407 100644
> > > --- a/drivers/net/ethernet/cortina/gemini.c
> > > +++ b/drivers/net/ethernet/cortina/gemini.c
> > > @@ -2146,6 +2146,20 @@ static void gmac_get_pauseparam(struct net_device *netdev,
> > >       pparam->autoneg = true;
> > >  }
> > >
> > > +static int gmac_set_pauseparam(struct net_device *netdev,
> > > +                            struct ethtool_pauseparam *pparam)
> > > +{
> > > +     struct phy_device *phydev = netdev->phydev;
> > > +
> > > +     if (!pparam->autoneg)
> > > +             return -EOPNOTSUPP;
> > > +
> > > +     gmac_set_flow_control(netdev, pparam->tx_pause, pparam->rx_pause);
> >
> > It is not obvious to my why you need this call here?
> 
> I don't know if I don't understand the flow of code here...
> 
> The Datasheet says that these registers shall be programmed to
> match what is set up in the PHY.

I expect the registers should match what the PHY has negotiated, not
what it is advertising. So i would expect to see
gmac_set_flow_control() only in the adjust link callback once
negotiation has completed.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ