netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Olivier Crameri" <olivier.crameri@gmail.com>
To: netdev@vger.kernel.org
Cc: "Yoshio Turner" <yoshiotu@hpl.hp.com>,
	"Santos, Jose Renato G" <joserenato.santos@hp.com>,
	"Janakiraman, John" <john.janakiraman@hp.com>
Subject: Re: Offloading features in VLAN interfaces
Date: Fri, 29 Sep 2006 17:25:35 -0700	[thread overview]
Message-ID: <b54af0b00609291725t55ac0a84pf86525ef0a31f44e@mail.gmail.com> (raw)
In-Reply-To: <b54af0b00609291721u16acb2f1ma918adec9b2e782b@mail.gmail.com>

[-- 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:

  reply	other threads:[~2006-09-30  0:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-30  0:21 Offloading features in VLAN interfaces Olivier Crameri
2006-09-30  0:25 ` Olivier Crameri [this message]
2006-09-30  3:33   ` Stephen Hemminger
2006-10-05 16:25   ` Ben Greear

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b54af0b00609291725t55ac0a84pf86525ef0a31f44e@mail.gmail.com \
    --to=olivier.crameri@gmail.com \
    --cc=john.janakiraman@hp.com \
    --cc=joserenato.santos@hp.com \
    --cc=netdev@vger.kernel.org \
    --cc=olivier.crameri@epfl.ch \
    --cc=yoshiotu@hpl.hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).