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:   Fri, 13 Jan 2017 00:20:37 -0600
From:   Timur Tabi <timur@...eaurora.org>
To:     David Miller <davem@...emloft.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        netdev@...r.kernel.org, Alok Chauhan <alokc@...eaurora.org>
Subject: Re: [PATCH] [v2] net: qcom/emac: add ethtool support

Timur Tabi wrote:
> +static void emac_get_pauseparam(struct net_device *netdev,
> +				struct ethtool_pauseparam *pause)
> +{
> +	struct phy_device *phydev = netdev->phydev;
> +
> +	if (phydev) {
> +		if (phydev->autoneg)
> +			pause->autoneg = 1;
> +		if (phydev->pause)
> +			pause->rx_pause = 1;
> +		if (phydev->pause != phydev->asym_pause)
> +			pause->tx_pause = 1;
> +	}
> +}

I finally figured out why this code was bothering me.

This function works, as long as I do NOT implement set_pauseparam. 
That's because the driver always matches the pause frame support in the 
MAC with whatever the PHY is doing.  Since the MAC and PHY are always in 
sync, I can use the PHY settings for get_pauseparam.

However, technically this is not correct.  get_pauseparam is supposed to 
return the setting of the MAC, not the PHY.  If I also implement 
set_pauseparam, which can force the MAC to ignore the PHY and 
enable/disable pause frames arbitrarily, then the above function is wrong.

Do I finally understand this correctly?

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ