diff mbox

macvlan: fix gso_max_size setting

Message ID 4B0A64E2.8090203@trash.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Patrick McHardy Nov. 23, 2009, 10:33 a.m. UTC
Fix macvlan gso_max_size setting. Based on net-next-2.6.git.
commit 198a1fd488e7ebec080d1d2da7947cb9e1aacebf
Author: Patrick McHardy <kaber@trash.net>
Date:   Mon Nov 23 11:28:22 2009 +0100

    macvlan: fix gso_max_size setting
    
    gso_max_size must be set based on the value of the underlying device to
    support devices not using the full 64k.
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

Comments

David Miller Nov. 23, 2009, 6:10 p.m. UTC | #1
From: Patrick McHardy <kaber@trash.net>
Date: Mon, 23 Nov 2009 11:33:06 +0100

> Fix macvlan gso_max_size setting. Based on net-next-2.6.git.

Pretty serious defect, maybe net-2.6 material?

If someone hits this, it's going to trigger something awful.

--
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
Patrick McHardy Nov. 23, 2009, 10:11 p.m. UTC | #2
David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Mon, 23 Nov 2009 11:33:06 +0100
>
>   
>> Fix macvlan gso_max_size setting. Based on net-next-2.6.git.
>
> Pretty serious defect, maybe net-2.6 material?

Sure, please take it in net-2.6.
>
> If someone hits this, it's going to trigger something awful.

Don't drivers simply drop the packet? Otherwise I think you
should be able to trigger the same problem using the TC mirred
action.
--
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 Nov. 23, 2009, 10:22 p.m. UTC | #3
From: Patrick McHardy <kaber@trash.net>
Date: Mon, 23 Nov 2009 23:11:07 +0100

> David Miller wrote:
>> From: Patrick McHardy <kaber@trash.net>
>> Date: Mon, 23 Nov 2009 11:33:06 +0100
>>
>>   
>>> Fix macvlan gso_max_size setting. Based on net-next-2.6.git.
>>
>> Pretty serious defect, maybe net-2.6 material?
> 
> Sure, please take it in net-2.6.

Done, thanks.

>>
>> If someone hits this, it's going to trigger something awful.
> 
> Don't drivers simply drop the packet? Otherwise I think you
> should be able to trigger the same problem using the TC mirred
> action.

I see nothing in the IXGBE driver's transmit code paths which guard
against this.
--
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/drivers/net/macvlan.c b/drivers/net/macvlan.c
index ae2b5c7..7b0ef0c 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -376,6 +376,7 @@  static int macvlan_init(struct net_device *dev)
 	dev->state		= (dev->state & ~MACVLAN_STATE_MASK) |
 				  (lowerdev->state & MACVLAN_STATE_MASK);
 	dev->features 		= lowerdev->features & MACVLAN_FEATURES;
+	dev->gso_max_size	= lowerdev->gso_max_size;
 	dev->iflink		= lowerdev->ifindex;
 	dev->hard_header_len	= lowerdev->hard_header_len;
 
@@ -652,6 +653,7 @@  static int macvlan_device_event(struct notifier_block *unused,
 	case NETDEV_FEAT_CHANGE:
 		list_for_each_entry(vlan, &port->vlans, list) {
 			vlan->dev->features = dev->features & MACVLAN_FEATURES;
+			vlan->dev->gso_max_size = dev->gso_max_size;
 			netdev_features_change(vlan->dev);
 		}
 		break;