linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: bonding: use new api ethtool_{get|set}_link_ksettings
@ 2016-10-25 16:41 Philippe Reynes
  2016-10-26 18:00 ` Jay Vosburgh
  2016-10-30 21:23 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Philippe Reynes @ 2016-10-25 16:41 UTC (permalink / raw)
  To: j.vosburgh, vfalico, andy, davem; +Cc: netdev, linux-kernel, Philippe Reynes

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
 drivers/net/bonding/bond_main.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index c9944d8..5708f17 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4080,16 +4080,16 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	return ret;
 }
 
-static int bond_ethtool_get_settings(struct net_device *bond_dev,
-				     struct ethtool_cmd *ecmd)
+static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
+					   struct ethtool_link_ksettings *cmd)
 {
 	struct bonding *bond = netdev_priv(bond_dev);
 	unsigned long speed = 0;
 	struct list_head *iter;
 	struct slave *slave;
 
-	ecmd->duplex = DUPLEX_UNKNOWN;
-	ecmd->port = PORT_OTHER;
+	cmd->base.duplex = DUPLEX_UNKNOWN;
+	cmd->base.port = PORT_OTHER;
 
 	/* Since bond_slave_can_tx returns false for all inactive or down slaves, we
 	 * do not need to check mode.  Though link speed might not represent
@@ -4100,12 +4100,12 @@ static int bond_ethtool_get_settings(struct net_device *bond_dev,
 		if (bond_slave_can_tx(slave)) {
 			if (slave->speed != SPEED_UNKNOWN)
 				speed += slave->speed;
-			if (ecmd->duplex == DUPLEX_UNKNOWN &&
+			if (cmd->base.duplex == DUPLEX_UNKNOWN &&
 			    slave->duplex != DUPLEX_UNKNOWN)
-				ecmd->duplex = slave->duplex;
+				cmd->base.duplex = slave->duplex;
 		}
 	}
-	ethtool_cmd_speed_set(ecmd, speed ? : SPEED_UNKNOWN);
+	cmd->base.speed = speed ? : SPEED_UNKNOWN;
 
 	return 0;
 }
@@ -4121,8 +4121,8 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
 
 static const struct ethtool_ops bond_ethtool_ops = {
 	.get_drvinfo		= bond_ethtool_get_drvinfo,
-	.get_settings		= bond_ethtool_get_settings,
 	.get_link		= ethtool_op_get_link,
+	.get_link_ksettings	= bond_ethtool_get_link_ksettings,
 };
 
 static const struct net_device_ops bond_netdev_ops = {
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: bonding: use new api ethtool_{get|set}_link_ksettings
  2016-10-25 16:41 [PATCH] net: bonding: use new api ethtool_{get|set}_link_ksettings Philippe Reynes
@ 2016-10-26 18:00 ` Jay Vosburgh
  2016-10-26 21:12   ` Philippe Reynes
  2016-10-30 21:23 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Jay Vosburgh @ 2016-10-26 18:00 UTC (permalink / raw)
  To: Philippe Reynes; +Cc: vfalico, andy, davem, netdev, linux-kernel

Philippe Reynes <tremyfr@gmail.com> wrote:

>The ethtool api {get|set}_settings is deprecated.
>We move this driver to new api {get|set}_link_ksettings.

	This is just an API change, i.e., no change to functionality?

	-J

>Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
>---
> drivers/net/bonding/bond_main.c |   16 ++++++++--------
> 1 files changed, 8 insertions(+), 8 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index c9944d8..5708f17 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -4080,16 +4080,16 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
> 	return ret;
> }
> 
>-static int bond_ethtool_get_settings(struct net_device *bond_dev,
>-				     struct ethtool_cmd *ecmd)
>+static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
>+					   struct ethtool_link_ksettings *cmd)
> {
> 	struct bonding *bond = netdev_priv(bond_dev);
> 	unsigned long speed = 0;
> 	struct list_head *iter;
> 	struct slave *slave;
> 
>-	ecmd->duplex = DUPLEX_UNKNOWN;
>-	ecmd->port = PORT_OTHER;
>+	cmd->base.duplex = DUPLEX_UNKNOWN;
>+	cmd->base.port = PORT_OTHER;
> 
> 	/* Since bond_slave_can_tx returns false for all inactive or down slaves, we
> 	 * do not need to check mode.  Though link speed might not represent
>@@ -4100,12 +4100,12 @@ static int bond_ethtool_get_settings(struct net_device *bond_dev,
> 		if (bond_slave_can_tx(slave)) {
> 			if (slave->speed != SPEED_UNKNOWN)
> 				speed += slave->speed;
>-			if (ecmd->duplex == DUPLEX_UNKNOWN &&
>+			if (cmd->base.duplex == DUPLEX_UNKNOWN &&
> 			    slave->duplex != DUPLEX_UNKNOWN)
>-				ecmd->duplex = slave->duplex;
>+				cmd->base.duplex = slave->duplex;
> 		}
> 	}
>-	ethtool_cmd_speed_set(ecmd, speed ? : SPEED_UNKNOWN);
>+	cmd->base.speed = speed ? : SPEED_UNKNOWN;
> 
> 	return 0;
> }
>@@ -4121,8 +4121,8 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
> 
> static const struct ethtool_ops bond_ethtool_ops = {
> 	.get_drvinfo		= bond_ethtool_get_drvinfo,
>-	.get_settings		= bond_ethtool_get_settings,
> 	.get_link		= ethtool_op_get_link,
>+	.get_link_ksettings	= bond_ethtool_get_link_ksettings,
> };
> 
> static const struct net_device_ops bond_netdev_ops = {
>-- 
>1.7.4.4

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: bonding: use new api ethtool_{get|set}_link_ksettings
  2016-10-26 18:00 ` Jay Vosburgh
@ 2016-10-26 21:12   ` Philippe Reynes
  0 siblings, 0 replies; 4+ messages in thread
From: Philippe Reynes @ 2016-10-26 21:12 UTC (permalink / raw)
  To: Jay Vosburgh
  Cc: vfalico, Andy Gospodarek, David S. Miller, netdev, linux-kernel

Hi Jay,

On Wed, Oct 26, 2016 at 8:00 PM, Jay Vosburgh
<jay.vosburgh@canonical.com> wrote:
> Philippe Reynes <tremyfr@gmail.com> wrote:
>
>>The ethtool api {get|set}_settings is deprecated.
>>We move this driver to new api {get|set}_link_ksettings.
>
>         This is just an API change, i.e., no change to functionality?

Yes, it's juste an API change.


Philippe


>         -J
>
>>Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
>>---
>> drivers/net/bonding/bond_main.c |   16 ++++++++--------
>> 1 files changed, 8 insertions(+), 8 deletions(-)
>>
>>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>>index c9944d8..5708f17 100644
>>--- a/drivers/net/bonding/bond_main.c
>>+++ b/drivers/net/bonding/bond_main.c
>>@@ -4080,16 +4080,16 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
>>       return ret;
>> }
>>
>>-static int bond_ethtool_get_settings(struct net_device *bond_dev,
>>-                                   struct ethtool_cmd *ecmd)
>>+static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
>>+                                         struct ethtool_link_ksettings *cmd)
>> {
>>       struct bonding *bond = netdev_priv(bond_dev);
>>       unsigned long speed = 0;
>>       struct list_head *iter;
>>       struct slave *slave;
>>
>>-      ecmd->duplex = DUPLEX_UNKNOWN;
>>-      ecmd->port = PORT_OTHER;
>>+      cmd->base.duplex = DUPLEX_UNKNOWN;
>>+      cmd->base.port = PORT_OTHER;
>>
>>       /* Since bond_slave_can_tx returns false for all inactive or down slaves, we
>>        * do not need to check mode.  Though link speed might not represent
>>@@ -4100,12 +4100,12 @@ static int bond_ethtool_get_settings(struct net_device *bond_dev,
>>               if (bond_slave_can_tx(slave)) {
>>                       if (slave->speed != SPEED_UNKNOWN)
>>                               speed += slave->speed;
>>-                      if (ecmd->duplex == DUPLEX_UNKNOWN &&
>>+                      if (cmd->base.duplex == DUPLEX_UNKNOWN &&
>>                           slave->duplex != DUPLEX_UNKNOWN)
>>-                              ecmd->duplex = slave->duplex;
>>+                              cmd->base.duplex = slave->duplex;
>>               }
>>       }
>>-      ethtool_cmd_speed_set(ecmd, speed ? : SPEED_UNKNOWN);
>>+      cmd->base.speed = speed ? : SPEED_UNKNOWN;
>>
>>       return 0;
>> }
>>@@ -4121,8 +4121,8 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
>>
>> static const struct ethtool_ops bond_ethtool_ops = {
>>       .get_drvinfo            = bond_ethtool_get_drvinfo,
>>-      .get_settings           = bond_ethtool_get_settings,
>>       .get_link               = ethtool_op_get_link,
>>+      .get_link_ksettings     = bond_ethtool_get_link_ksettings,
>> };
>>
>> static const struct net_device_ops bond_netdev_ops = {
>>--
>>1.7.4.4
>
> ---
>         -Jay Vosburgh, jay.vosburgh@canonical.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: bonding: use new api ethtool_{get|set}_link_ksettings
  2016-10-25 16:41 [PATCH] net: bonding: use new api ethtool_{get|set}_link_ksettings Philippe Reynes
  2016-10-26 18:00 ` Jay Vosburgh
@ 2016-10-30 21:23 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2016-10-30 21:23 UTC (permalink / raw)
  To: tremyfr; +Cc: j.vosburgh, vfalico, andy, netdev, linux-kernel

From: Philippe Reynes <tremyfr@gmail.com>
Date: Tue, 25 Oct 2016 18:41:31 +0200

> The ethtool api {get|set}_settings is deprecated.
> We move this driver to new api {get|set}_link_ksettings.
> 
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-30 21:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25 16:41 [PATCH] net: bonding: use new api ethtool_{get|set}_link_ksettings Philippe Reynes
2016-10-26 18:00 ` Jay Vosburgh
2016-10-26 21:12   ` Philippe Reynes
2016-10-30 21:23 ` David Miller

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).