netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] macvlan: add support for ethtool get settings
@ 2008-10-29 19:53 Stephen Hemminger
  2008-10-29 19:59 ` [PATCH 2/2] macvlan: propogate mtu changes Stephen Hemminger
  2008-10-29 21:01 ` [PATCH 1/2] macvlan: add support for ethtool get settings Patrick McHardy
  0 siblings, 2 replies; 8+ messages in thread
From: Stephen Hemminger @ 2008-10-29 19:53 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netdev

If macvlan's are used, it is useful to propgate speed and other settings
from underlying device up for application usage.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/drivers/net/macvlan.c	2008-10-29 09:42:06.000000000 -0700
+++ b/drivers/net/macvlan.c	2008-10-29 09:52:11.000000000 -0700
@@ -333,10 +333,34 @@ static u32 macvlan_ethtool_get_rx_csum(s
 	return lowerdev->ethtool_ops->get_rx_csum(lowerdev);
 }
 
+static int macvlan_ethtool_get_settings(struct net_device *dev,
+					struct ethtool_cmd *cmd)
+{
+	const struct macvlan_dev *vlan = netdev_priv(dev);
+	struct net_device *lowerdev = vlan->lowerdev;
+
+	if (!lowerdev->ethtool_ops->get_settings)
+		return -EOPNOTSUPP;
+
+	return lowerdev->ethtool_ops->get_settings(lowerdev, cmd);
+}
+
+static u32 macvlan_ethtool_get_flags(struct net_device *dev)
+{
+	const struct macvlan_dev *vlan = netdev_priv(dev);
+	struct net_device *lowerdev = vlan->lowerdev;
+
+	if (!lowerdev->ethtool_ops->get_flags)
+		return 0;
+	return lowerdev->ethtool_ops->get_flags(lowerdev);
+}
+
 static const struct ethtool_ops macvlan_ethtool_ops = {
 	.get_link		= ethtool_op_get_link,
+	.get_settings		= macvlan_ethtool_get_settings,
 	.get_rx_csum		= macvlan_ethtool_get_rx_csum,
 	.get_drvinfo		= macvlan_ethtool_get_drvinfo,
+	.get_flags		= macvlan_ethtool_get_flags,
 };
 
 static void macvlan_setup(struct net_device *dev)

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

* [PATCH 2/2] macvlan: propogate mtu changes
  2008-10-29 19:53 [PATCH 1/2] macvlan: add support for ethtool get settings Stephen Hemminger
@ 2008-10-29 19:59 ` Stephen Hemminger
  2008-10-29 21:02   ` Patrick McHardy
  2008-10-29 21:01 ` [PATCH 1/2] macvlan: add support for ethtool get settings Patrick McHardy
  1 sibling, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2008-10-29 19:59 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netdev

If MTU of underlying real device is changed, propogate up to macvlan
pseudo devices.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/drivers/net/macvlan.c	2008-10-29 09:53:00.000000000 -0700
+++ b/drivers/net/macvlan.c	2008-10-29 12:58:40.000000000 -0700
@@ -537,6 +537,19 @@ static int macvlan_device_event(struct n
 		list_for_each_entry_safe(vlan, next, &port->vlans, list)
 			macvlan_dellink(vlan->dev);
 		break;
+	case NETDEV_CHANGEMTU:
+		list_for_each_entry(vlan, &port->vlans, list) {
+			int err, oldmtu = vlan->dev->mtu;
+
+			err = dev_set_mtu(vlan->dev, dev->mtu);
+			if (err) {
+				list_for_each_entry_continue_reverse(vlan,
+								     &port->vlans,
+								     list)
+					dev_set_mtu(vlan->dev, oldmtu);
+				return notifier_from_errno(err);
+			}
+		}
 	}
 	return NOTIFY_DONE;
 }

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

* Re: [PATCH 1/2] macvlan: add support for ethtool get settings
  2008-10-29 19:53 [PATCH 1/2] macvlan: add support for ethtool get settings Stephen Hemminger
  2008-10-29 19:59 ` [PATCH 2/2] macvlan: propogate mtu changes Stephen Hemminger
@ 2008-10-29 21:01 ` Patrick McHardy
  2008-10-29 22:32   ` David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2008-10-29 21:01 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Stephen Hemminger wrote:
> If macvlan's are used, it is useful to propgate speed and other settings
> from underlying device up for application usage.
>   

Acked-by: Patrick McHardy <kaber@trash.net>

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

* Re: [PATCH 2/2] macvlan: propogate mtu changes
  2008-10-29 19:59 ` [PATCH 2/2] macvlan: propogate mtu changes Stephen Hemminger
@ 2008-10-29 21:02   ` Patrick McHardy
  2008-10-29 21:05     ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2008-10-29 21:02 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Stephen Hemminger wrote:
> If MTU of underlying real device is changed, propogate up to macvlan
> pseudo devices.

I'm going to do a similar patch for macvlan as I did for VLAN for
the MTU settings (desired MTU/operational MTU).


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

* Re: [PATCH 2/2] macvlan: propogate mtu changes
  2008-10-29 21:02   ` Patrick McHardy
@ 2008-10-29 21:05     ` Patrick McHardy
  2008-10-29 21:05       ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick McHardy @ 2008-10-29 21:05 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Patrick McHardy wrote:
> Stephen Hemminger wrote:
>   
>> If MTU of underlying real device is changed, propogate up to macvlan
>> pseudo devices.
>>     
>
> I'm going to do a similar patch for macvlan as I did for VLAN for
> the MTU settings (desired MTU/operational MTU).

... and add the rollback part from your patch to VLAN as well.


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

* Re: [PATCH 2/2] macvlan: propogate mtu changes
  2008-10-29 21:05     ` Patrick McHardy
@ 2008-10-29 21:05       ` David Miller
  2008-10-29 21:06         ` Patrick McHardy
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2008-10-29 21:05 UTC (permalink / raw)
  To: kaber; +Cc: shemminger, netdev

From: Patrick McHardy <kaber@trash.net>
Date: Wed, 29 Oct 2008 22:05:02 +0100

> Patrick McHardy wrote:
> > Stephen Hemminger wrote:
> >   
> >> If MTU of underlying real device is changed, propogate up to macvlan
> >> pseudo devices.
> >>     
> >
> > I'm going to do a similar patch for macvlan as I did for VLAN for
> > the MTU settings (desired MTU/operational MTU).
> 
> ... and add the rollback part from your patch to VLAN as well.

So you want me to drop this second patch from Stephen from now?

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

* Re: [PATCH 2/2] macvlan: propogate mtu changes
  2008-10-29 21:05       ` David Miller
@ 2008-10-29 21:06         ` Patrick McHardy
  0 siblings, 0 replies; 8+ messages in thread
From: Patrick McHardy @ 2008-10-29 21:06 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, netdev

David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Wed, 29 Oct 2008 22:05:02 +0100
>
>   
>> Patrick McHardy wrote:
>>     
>>> Stephen Hemminger wrote:
>>>   
>>>       
>>>> If MTU of underlying real device is changed, propogate up to macvlan
>>>> pseudo devices.
>>>>     
>>>>         
>>> I'm going to do a similar patch for macvlan as I did for VLAN for
>>> the MTU settings (desired MTU/operational MTU).
>>>       
>> ... and add the rollback part from your patch to VLAN as well.
>>     
>
> So you want me to drop this second patch from Stephen from now?

Yes please, I'll send patches for both VLAN and macvlan MTU settings
later.


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

* Re: [PATCH 1/2] macvlan: add support for ethtool get settings
  2008-10-29 21:01 ` [PATCH 1/2] macvlan: add support for ethtool get settings Patrick McHardy
@ 2008-10-29 22:32   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2008-10-29 22:32 UTC (permalink / raw)
  To: kaber; +Cc: shemminger, netdev

From: Patrick McHardy <kaber@trash.net>
Date: Wed, 29 Oct 2008 22:01:28 +0100

> Stephen Hemminger wrote:
> > If macvlan's are used, it is useful to propgate speed and other settings
> > from underlying device up for application usage.
> >   
> 
> Acked-by: Patrick McHardy <kaber@trash.net>

Applied, thanks everyone.

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

end of thread, other threads:[~2008-10-29 22:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 19:53 [PATCH 1/2] macvlan: add support for ethtool get settings Stephen Hemminger
2008-10-29 19:59 ` [PATCH 2/2] macvlan: propogate mtu changes Stephen Hemminger
2008-10-29 21:02   ` Patrick McHardy
2008-10-29 21:05     ` Patrick McHardy
2008-10-29 21:05       ` David Miller
2008-10-29 21:06         ` Patrick McHardy
2008-10-29 21:01 ` [PATCH 1/2] macvlan: add support for ethtool get settings Patrick McHardy
2008-10-29 22:32   ` 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).