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]
Date:   Mon, 24 Oct 2022 12:46:56 +0530
From:   Raju Lakkaraju <Raju.Lakkaraju@...rochip.com>
To:     Andrew Lunn <andrew@...n.ch>
CC:     <netdev@...r.kernel.org>, <davem@...emloft.net>, <kuba@...nel.org>,
        <linux-kernel@...r.kernel.org>, <bryan.whitehead@...rochip.com>,
        <hkallweit1@...il.com>, <pabeni@...hat.com>, <edumazet@...gle.com>,
        <linux@...linux.org.uk>, <UNGLinuxDriver@...rochip.com>,
        <Ian.Saturley@...rochip.com>
Subject: Re: [PATCH net-next 1/2] net: lan743x: Add support for
 get_pauseparam and set_pauseparam

Hi Andrew,

Thank you for review comments.

The 10/21/2022 15:46, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> > +static int lan743x_set_pauseparam(struct net_device *dev,
> > +                               struct ethtool_pauseparam *pause)
> > +{
> > +     struct lan743x_adapter *adapter = netdev_priv(dev);
> > +     struct phy_device *phydev = dev->phydev;
> > +     struct lan743x_phy *phy = &adapter->phy;
> > +
> > +     if (!phydev)
> > +             return -ENODEV;
> > +
> > +     if (!phy_validate_pause(phydev, pause))
> > +             return -EINVAL;
> > +
> > +     phy->fc_request_control = 0;
> > +     if (pause->rx_pause)
> > +             phy->fc_request_control |= FLOW_CTRL_RX;
> > +
> > +     if (pause->tx_pause)
> > +             phy->fc_request_control |= FLOW_CTRL_TX;
> > +
> > +     phy->fc_autoneg = pause->autoneg;
> > +
> > +     phy_set_asym_pause(phydev, pause->rx_pause,  pause->tx_pause);
> > +
> > +     if (pause->autoneg == AUTONEG_DISABLE)
> > +             lan743x_mac_flow_ctrl_set_enables(adapter, pause->tx_pause,
> > +                                               pause->rx_pause);
> 
> pause is not too well defined. But i think phy_set_asym_pause() should
> be in an else clause. If pause autoneg is off, you directly set it in
> the MAC and ignore what is negotiated. If it is enabled, you
> negotiate. As far as i understand, you don't modify your negotiation
> when pause autoneg is off.

O.K. I will change.

> 
>         Andrew

--------
Thanks,
Raju

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ