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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 26 Apr 2012 18:24:36 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Somnath Kotur <Somnath.Kotur@...lex.com>
CC:	<netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 3/5] be2net: Fix to apply duplex value as
 unknown when link is down.

On Thu, 2012-04-26 at 19:58 +0530, Somnath Kotur wrote:
> From: Somnath Kotur <somnath.kotur@...lex.com>
> 
> 
> Signed-off-by: Somnath Kotur <somnath.kotur@...lex.com>
> ---
>  drivers/net/ethernet/emulex/benet/be_ethtool.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
> index 5296df5..bb2add7 100644
> --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
> +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
> @@ -618,7 +618,7 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
>  		ecmd->supported = adapter->phy.supported;
>  	}
>  
> -	ecmd->duplex = DUPLEX_FULL;
> +	ecmd->duplex = netif_carrier_ok(netdev) ? DUPLEX_FULL : -1;
>  	ecmd->phy_address = adapter->port_num;
>  
>  	return 0;

I don't see any problem with reporting full-duplex all the time if you
don't support any half-duplex link modes.  But we don't yet have
consistency between drivers in speed/duplex reporting while the link is
down, so I won't insist that that is the right thing to do.

However you should use DUPLEX_UNKNOWN rather than -1.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ