netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@dev.mellanox.co.il>
To: Ben Hutchings <ben@decadent.org.uk>, Amir Vadai <amirv@mellanox.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Yevgeny Petrilin <yevgenyp@mellanox.com>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: Re: [PATCH net-next 05/13] ethtool,net/mlx4_en: Add 100M, 20G, 56G speeds ethtool reporting support
Date: Mon, 10 Nov 2014 12:30:02 +0200	[thread overview]
Message-ID: <546093AA.8050005@dev.mellanox.co.il> (raw)
In-Reply-To: <1415227117.3398.31.camel@decadent.org.uk>


On 11/6/2014 12:38 AM, Ben Hutchings wrote:
> On Mon, 2014-10-27 at 11:37 +0200, Amir Vadai wrote:
>> From: Saeed Mahameed <saeedm@mellanox.com>
>>
>> Added 100M, 20G and 56G ethtool speed reporting support.
>> Update mlx4_en_test_speed self test with the new speeds.
>>
>> Defined new link speeds in include/uapi/linux/ethtool.h:
>> +#define SPEED_20000	20000
>> +#define SPEED_40000	40000
>> +#define SPEED_56000	56000
>>
>> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
>> Signed-off-by: Amir Vadai <amirv@mellanox.com>
> [...]
>> --- a/include/uapi/linux/ethtool.h
>> +++ b/include/uapi/linux/ethtool.h
>> @@ -1213,6 +1213,10 @@ enum ethtool_sfeatures_retval_bits {
>>   #define SUPPORTED_40000baseCR4_Full	(1 << 24)
>>   #define SUPPORTED_40000baseSR4_Full	(1 << 25)
>>   #define SUPPORTED_40000baseLR4_Full	(1 << 26)
>> +#define SUPPORTED_56000baseKR4_Full	(1 << 27)
>> +#define SUPPORTED_56000baseCR4_Full	(1 << 28)
>> +#define SUPPORTED_56000baseSR4_Full	(1 << 29)
>> +#define SUPPORTED_56000baseLR4_Full	(1 << 30)
>>   
>>   #define ADVERTISED_10baseT_Half		(1 << 0)
>>   #define ADVERTISED_10baseT_Full		(1 << 1)
>> @@ -1241,6 +1245,10 @@ enum ethtool_sfeatures_retval_bits {
>>   #define ADVERTISED_40000baseCR4_Full	(1 << 24)
>>   #define ADVERTISED_40000baseSR4_Full	(1 << 25)
>>   #define ADVERTISED_40000baseLR4_Full	(1 << 26)
>> +#define ADVERTISED_56000baseKR4_Full	(1 << 27)
>> +#define ADVERTISED_56000baseCR4_Full	(1 << 28)
>> +#define ADVERTISED_56000baseSR4_Full	(1 << 29)
>> +#define ADVERTISED_56000baseLR4_Full	(1 << 30)
> Can these modes be auto-negotiated?  If not then they don't need
> advertised/supported bits.
Hi Ben,
At least 56000baseKR4_Full and 56000baseCR4_Full can be negotiated for sure,
regarding SR and LR i will check with arch team.
>>   /* The following are all involved in forcing a particular link
>>    * mode for the device for setting things.  When getting the
>> @@ -1248,12 +1256,16 @@ enum ethtool_sfeatures_retval_bits {
>>    * it was forced up into this mode or autonegotiated.
>>    */
>>   
>> -/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
>> +/* The forced speed, 10Mb, 100Mb, gigabit, [2.5|10|20|40|56]GbE. */
>>   #define SPEED_10		10
>>   #define SPEED_100		100
>>   #define SPEED_1000		1000
>>   #define SPEED_2500		2500
>>   #define SPEED_10000		10000
>> +#define SPEED_20000		20000
>> +#define SPEED_40000		40000
>> +#define SPEED_56000		56000
> We shouldn't add new SPEED macros.  The speed is just a number of Mbit/s
> and we don't need to enumerate the possible values.
It is a little bit confusing that some speeds still use the defines 
above, and new speeds should be hardcoded.
Why those speeds still there? is it some kind of work that need to be 
done (i.e remove all of those defines) or are they needed in other 
situations.
I thought it is nice that well-known speeds are organized in such MACROs 
and this will prevent drivers from using magic numbers in their code.

Thanks for your time,
-Saeed.

>
> Ben.
>
>>   #define SPEED_UNKNOWN		-1
>>   
>>   /* Duplex, half or full. */

  reply	other threads:[~2014-11-10 10:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27  9:37 [PATCH net-next 00/13] Mellanox ethernet driver update Oct-27-2014 Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 01/13] net/mlx4_core: Introduce mlx4_get_module_info for cable module info reading Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 02/13] ethtool,net/mlx4_en: Cable info, get_module_info/eeprom ethtool support Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 03/13] net/mlx4_core: Introduce ACCESS_REG CMD and eth_prot_ctrl dev cap Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 04/13] net/mlx4_core: Add ethernet backplane autoneg device capability Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 05/13] ethtool,net/mlx4_en: Add 100M, 20G, 56G speeds ethtool reporting support Amir Vadai
2014-11-05 22:38   ` Ben Hutchings
2014-11-10 10:30     ` Saeed Mahameed [this message]
2014-10-27  9:37 ` [PATCH net-next 06/13] net/mlx4_en: Use PTYS register to query ethtool settings Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 07/13] net/mlx4_en: Use PTYS register to set ethtool settings (Speed) Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 08/13] net/mlx4_en: Add support for setting rxvlan offload OFF/ON Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 09/13] net/mlx4_en: Add ethtool support for [rx|tx]vlan offload set to OFF/ON Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 10/13] net/mlx4_en: Cleanups suggested by clang static checker Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 11/13] net/mlx4_en: Call napi_synchronize on stop_port Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 12/13] net/mlx4_en: Move spinlocks and work initalizations to beginning of init_netdev Amir Vadai
2014-10-27  9:37 ` [PATCH net-next 13/13] net/mlx4_en: Report actual number of rings in indirection table Amir Vadai
2014-10-28 21:22 ` [PATCH net-next 00/13] Mellanox ethernet driver update Oct-27-2014 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=546093AA.8050005@dev.mellanox.co.il \
    --to=saeedm@dev.mellanox.co.il \
    --cc=amirv@mellanox.com \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=yevgenyp@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).