diff mbox

net-next: ethtool: Added port speed macros.

Message ID 1431946907-7808-1-git-send-email-parav.pandit@avagotech.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Parav Pandit May 18, 2015, 11:01 a.m. UTC
Signed-off-by: Parav Pandit <parav.pandit@avagotech.com>
---
 include/uapi/linux/ethtool.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Comments

David Miller May 18, 2015, 3:46 p.m. UTC | #1
From: Parav Pandit <parav.pandit@avagotech.com>
Date: Mon, 18 May 2015 16:31:47 +0530

> Signed-off-by: Parav Pandit <parav.pandit@avagotech.com>

I thought we had decided that we weren't going to keep adding
convenience macros for new speeds, and were simply going to use
the appropriate constants in the future.

Ben?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Parav Pandit May 19, 2015, 4:45 a.m. UTC | #2
On Mon, May 18, 2015 at 9:16 PM, David Miller <davem@davemloft.net> wrote:
> From: Parav Pandit <parav.pandit@avagotech.com>
> Date: Mon, 18 May 2015 16:31:47 +0530
>
>> Signed-off-by: Parav Pandit <parav.pandit@avagotech.com>
>
> I thought we had decided that we weren't going to keep adding
> convenience macros for new speeds, and were simply going to use
> the appropriate constants in the future.
>

I added them to accommodate any speed/PHY interface specific
configuration to make use of it.
If convenience macros are not needed, I will provide the code cleanup
patch to remove existing convenience macros. With that we will have
unified code for old and new constants.
I will anyway let Ben comment on it.

> Ben?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller May 19, 2015, 4:32 p.m. UTC | #3
From: Parav Pandit <parav.pandit@avagotech.com>
Date: Tue, 19 May 2015 10:15:49 +0530

> On Mon, May 18, 2015 at 9:16 PM, David Miller <davem@davemloft.net> wrote:
>> From: Parav Pandit <parav.pandit@avagotech.com>
>> Date: Mon, 18 May 2015 16:31:47 +0530
>>
>>> Signed-off-by: Parav Pandit <parav.pandit@avagotech.com>
>>
>> I thought we had decided that we weren't going to keep adding
>> convenience macros for new speeds, and were simply going to use
>> the appropriate constants in the future.
>>
> 
> I added them to accommodate any speed/PHY interface specific
> configuration to make use of it.
> If convenience macros are not needed, I will provide the code cleanup
> patch to remove existing convenience macros. With that we will have
> unified code for old and new constants.
> I will anyway let Ben comment on it.

You cannot remove the existing macros, because they are exported to
userspace and you'll break application compilation if you do that.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Parav Pandit May 19, 2015, 4:41 p.m. UTC | #4
On Tue, May 19, 2015 at 10:02 PM, David Miller <davem@davemloft.net> wrote:
> From: Parav Pandit <parav.pandit@avagotech.com>
> Date: Tue, 19 May 2015 10:15:49 +0530
>
>> On Mon, May 18, 2015 at 9:16 PM, David Miller <davem@davemloft.net> wrote:
>>> From: Parav Pandit <parav.pandit@avagotech.com>
>>> Date: Mon, 18 May 2015 16:31:47 +0530
>>>
>>>> Signed-off-by: Parav Pandit <parav.pandit@avagotech.com>
>>>
>>> I thought we had decided that we weren't going to keep adding
>>> convenience macros for new speeds, and were simply going to use
>>> the appropriate constants in the future.
>>>
>>
>> I added them to accommodate any speed/PHY interface specific
>> configuration to make use of it.
>> If convenience macros are not needed, I will provide the code cleanup
>> patch to remove existing convenience macros. With that we will have
>> unified code for old and new constants.
>> I will anyway let Ben comment on it.
>
> You cannot remove the existing macros, because they are exported to
> userspace and you'll break application compilation if you do that.

Yes, didn't think about it before.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ben Hutchings May 19, 2015, 5 p.m. UTC | #5
On Mon, 2015-05-18 at 11:46 -0400, David Miller wrote:
> From: Parav Pandit <parav.pandit@avagotech.com>
> Date: Mon, 18 May 2015 16:31:47 +0530
> 
> > Signed-off-by: Parav Pandit <parav.pandit@avagotech.com>
> 
> I thought we had decided that we weren't going to keep adding
> convenience macros for new speeds, and were simply going to use
> the appropriate constants in the future.
> 
> Ben?

That's what I thought, but you accepted commit dcf972a334dd "ethtool,
net/mlx4_en: Add 100M, 20G, 56G speeds ethtool reporting support" not so
long ago.

Ben.
David Miller May 19, 2015, 6:52 p.m. UTC | #6
From: Ben Hutchings <ben@decadent.org.uk>
Date: Tue, 19 May 2015 18:00:35 +0100

> On Mon, 2015-05-18 at 11:46 -0400, David Miller wrote:
>> From: Parav Pandit <parav.pandit@avagotech.com>
>> Date: Mon, 18 May 2015 16:31:47 +0530
>> 
>> > Signed-off-by: Parav Pandit <parav.pandit@avagotech.com>
>> 
>> I thought we had decided that we weren't going to keep adding
>> convenience macros for new speeds, and were simply going to use
>> the appropriate constants in the future.
>> 
>> Ben?
> 
> That's what I thought, but you accepted commit dcf972a334dd "ethtool,
> net/mlx4_en: Add 100M, 20G, 56G speeds ethtool reporting support" not so
> long ago.

Grumble... my bad.

Given that I should probably accept this patch set as well, hopefully
we won't get very many more of these any time soon.

Sorry for creating this mess.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller May 19, 2015, 8:32 p.m. UTC | #7
From: David Miller <davem@davemloft.net>
Date: Tue, 19 May 2015 14:52:02 -0400 (EDT)

> Given that I should probably accept this patch set as well, hopefully
> we won't get very many more of these any time soon.

And that's what I've just done.

Applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 2e49fc8..ae832b4 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1264,15 +1264,19 @@  enum ethtool_sfeatures_retval_bits {
  * it was forced up into this mode or autonegotiated.
  */
 
-/* The forced speed, 10Mb, 100Mb, gigabit, [2.5|10|20|40|56]GbE. */
+/* The forced speed, 10Mb, 100Mb, gigabit, [2.5|5|10|20|25|40|50|56|100]GbE. */
 #define SPEED_10		10
 #define SPEED_100		100
 #define SPEED_1000		1000
 #define SPEED_2500		2500
+#define SPEED_5000		5000
 #define SPEED_10000		10000
 #define SPEED_20000		20000
+#define SPEED_25000		25000
 #define SPEED_40000		40000
+#define SPEED_50000		50000
 #define SPEED_56000		56000
+#define SPEED_100000		100000
 
 #define SPEED_UNKNOWN		-1