netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Offloading features in VLAN interfaces
@ 2006-09-30  0:21 Olivier Crameri
  2006-09-30  0:25 ` Olivier Crameri
  0 siblings, 1 reply; 4+ messages in thread
From: Olivier Crameri @ 2006-09-30  0:21 UTC (permalink / raw)
  To: netdev; +Cc: Yoshio Turner, Santos, Jose Renato G, Janakiraman, John

Hi,

after running some experiments, we realised that using VLAN support in
Linux caused some overhead. It turned out to be that the offloading
features of our NIC (tso, sg, checksum offloading) were not beeing
used.

After digging a little bit in the code, we realised that the VLAN code
did not set the features parameter of the net_device structure for the
virtual interface. Attached is a patch with a suggested solution to
this problem.

Please let us know if this is an acceptable patch.

Thanks,
Olivier Crameri, HP Labs

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

* Re: Offloading features in VLAN interfaces
  2006-09-30  0:21 Offloading features in VLAN interfaces Olivier Crameri
@ 2006-09-30  0:25 ` Olivier Crameri
  2006-09-30  3:33   ` Stephen Hemminger
  2006-10-05 16:25   ` Ben Greear
  0 siblings, 2 replies; 4+ messages in thread
From: Olivier Crameri @ 2006-09-30  0:25 UTC (permalink / raw)
  To: netdev; +Cc: Yoshio Turner, Santos, Jose Renato G, Janakiraman, John

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

Same thing but with the patch this time.

Sorry about that,
Olivier Crameri

On 9/29/06, Olivier Crameri <olivier.crameri@gmail.com> wrote:
> Hi,
>
> after running some experiments, we realised that using VLAN support in
> Linux caused some overhead. It turned out to be that the offloading
> features of our NIC (tso, sg, checksum offloading) were not beeing
> used.
>
> After digging a little bit in the code, we realised that the VLAN code
> did not set the features parameter of the net_device structure for the
> virtual interface. Attached is a patch with a suggested solution to
> this problem.
>
> Please let us know if this is an acceptable patch.
>
> Thanks,
> Olivier Crameri, HP Labs
>

[-- Attachment #2: vlan.patch --]
[-- Type: application/octet-stream, Size: 1780 bytes --]

--- net/8021q/vlan.c.orig	2006-09-29 16:20:01.000000000 -0700
+++ net/8021q/vlan.c	2006-09-29 17:16:31.000000000 -0700
@@ -10,7 +10,9 @@
  *              Fix for packet capture - Nick Eggleston <nick@dccinc.com>;
  *		Add HW acceleration hooks - David S. Miller <davem@redhat.com>;
  *		Correct all the locking - David S. Miller <davem@redhat.com>;
- *		Use hash table for VLAN groups - David S. Miller <davem@redhat.com>
+ *		Use hash table for VLAN groups - David S. Miller <davem@redhat.com>;
+ *		Advertise real device's features - Olivier Crameri, Hewlett-Packard 
+ *		<olivier.crameri@epfl.ch>
  *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
@@ -512,6 +514,15 @@ static struct net_device *register_vlan_
 	}
 	new_dev->hard_header_parse = real_dev->hard_header_parse;
 
+	/* Advertise the same offloading features than the real device */
+	new_dev->features = real_dev->features & 
+				(NETIF_F_IP_CSUM |
+				 NETIF_F_NO_CSUM |
+				 NETIF_F_HW_CSUM |
+				 NETIF_F_SG |
+				 NETIF_F_FRAGLIST |
+				 NETIF_F_TSO );
+	
 	VLAN_DEV_INFO(new_dev)->vlan_id = VLAN_ID; /* 1 through VLAN_VID_MASK */
 	VLAN_DEV_INFO(new_dev)->real_dev = real_dev;
 	VLAN_DEV_INFO(new_dev)->dent = NULL;
@@ -663,6 +674,23 @@ static int vlan_device_event(struct noti
 				break;
 		}
 		break;
+	
+	case NETDEV_FEAT_CHANGE:
+		/* Propagate feature changes to VLAN devices */
+		for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+			vlandev = grp->vlan_devices[i];
+			if (!vlandev)
+				continue;
+			vlandev->features = dev->features & ( 
+					NETIF_F_IP_CSUM |
+				 	NETIF_F_NO_CSUM |
+				 	NETIF_F_HW_CSUM |
+				 	NETIF_F_SG |
+				 	NETIF_F_FRAGLIST |
+				 	NETIF_F_TSO );
+		}
+		break;
+
 	};
 
 out:

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

* Re: Offloading features in VLAN interfaces
  2006-09-30  0:25 ` Olivier Crameri
@ 2006-09-30  3:33   ` Stephen Hemminger
  2006-10-05 16:25   ` Ben Greear
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2006-09-30  3:33 UTC (permalink / raw)
  To: olivier.crameri
  Cc: olivier.crameri, netdev, Yoshio Turner, Santos, Jose Renato G,
	Janakiraman, John

On Fri, 29 Sep 2006 17:25:35 -0700
"Olivier Crameri" <olivier.crameri@gmail.com> wrote:

> Same thing but with the patch this time.
> 
> Sorry about that,
> Olivier Crameri
> 
> On 9/29/06, Olivier Crameri <olivier.crameri@gmail.com> wrote:
> > Hi,
> >
> > after running some experiments, we realised that using VLAN support in
> > Linux caused some overhead. It turned out to be that the offloading
> > features of our NIC (tso, sg, checksum offloading) were not beeing
> > used.
> >
> > After digging a little bit in the code, we realised that the VLAN code
> > did not set the features parameter of the net_device structure for the
> > virtual interface. Attached is a patch with a suggested solution to
> > this problem.
> >
> > Please let us know if this is an acceptable patch.
> >
> > Thanks,
> > Olivier Crameri, HP Labs
> >

Patch needs to include "Developer's Certificate of Origin"
see Documentation/SubmittingPatches section 11.

Patch should not be sent as an attachment (if at all possible).

Skip the marque comment. It is standard practice now to use the revision
control system change log for attribution.

Please handle all the current offload features including GSO.

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

* Re: Offloading features in VLAN interfaces
  2006-09-30  0:25 ` Olivier Crameri
  2006-09-30  3:33   ` Stephen Hemminger
@ 2006-10-05 16:25   ` Ben Greear
  1 sibling, 0 replies; 4+ messages in thread
From: Ben Greear @ 2006-10-05 16:25 UTC (permalink / raw)
  To: olivier.crameri
  Cc: netdev, Yoshio Turner, Santos, Jose Renato G, Janakiraman, John

Olivier Crameri wrote:
> Same thing but with the patch this time.
Since the VLAN device's features may also change in the handler, 
shouldn't we check and generate a feature-change
event for the VLAN device(s) as well?

Ben


-- 
Ben Greear <greearb@candelatech.com> 
Candela Technologies Inc  http://www.candelatech.com



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

end of thread, other threads:[~2006-10-05 16:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-30  0:21 Offloading features in VLAN interfaces Olivier Crameri
2006-09-30  0:25 ` Olivier Crameri
2006-09-30  3:33   ` Stephen Hemminger
2006-10-05 16:25   ` Ben Greear

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