All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: "David S. Miller" <davem@davemloft.net>
Cc: herbert@gondor.apana.org.au, david@davidcoulson.net,
	kaber@trash.net, greearb@candelatech.com, netdev@oss.sgi.com
Subject: Re: skb_checksum_help
Date: Tue, 25 Jan 2005 21:36:07 +0100	[thread overview]
Message-ID: <20050125203607.GG31837@postel.suug.ch> (raw)
In-Reply-To: <20050125143319.GF31837@postel.suug.ch>

* Thomas Graf <20050125143319.GF31837@postel.suug.ch> 2005-01-25 15:33
> * David S. Miller <20050124194328.20a106de.davem@davemloft.net> 2005-01-24 19:43
> > On Tue, 25 Jan 2005 03:24:31 +0100
> > Thomas Graf <tgraf@suug.ch> wrote:
> > 
> > > This of course explains it, didn't think of that. I thought it would
> > > inherit the checksumming features.
> > 
> > It should, but only in very limited cases.
> > 
> > Because it is very chip dependant whether this works or not in
> > any case, we should probably create a special features flag for
> > this.  Something like NETIF_F_VLAN_INHERIT_FEATURES.
> 
> Can't we just use NETIF_F_HW_VLAN_TX for this and inherit
> NETIF_F_HW_CSUM | NETIF_F_IP_CSUM if it is set? I don't have any
> specs at hand though.

Vlan devices don't inherit any features at the moment but it would make
sense to do so.

NETIF_F_SG|NETIF_F_TSO:
  The normal vlan code seems to handle pskbs correctly, we don't gain
  that much though. The big gain would be in the driver specific accel
  code. I assume that the driver specific accel code is aware of
  pskbs if the card can handle it but I haven't checked this yet.

NETIF_F_NO_CSUM:
  Avoid checksumming for vlan devices on loopback interfaces.

NETIF_F_HIGHDMA|NETIF_F_FRAGLIST:
  Didn't find a reason why this would cause problems.

NETIF_F_LLTX:
  vlan code accesses statistic counters so I think we can't
  inherit. It might be worth to make it clean though.

NETIF_F_IP_CSUM|NETIF_F_HW_CSUM:
  Assuming that the vlan accel code can always do the checksumming
  if the card can do it.

Otherwise we need a mask describing which features can be
inherited.

Thoughts?

diff -Nru linux-2.6.11-rc2-bk2.orig/include/linux/if_vlan.h linux-2.6.11-rc2-bk2/include/linux/if_vlan.h
--- linux-2.6.11-rc2-bk2.orig/include/linux/if_vlan.h	2005-01-25 00:49:27.000000000 +0100
+++ linux-2.6.11-rc2-bk2/include/linux/if_vlan.h	2005-01-25 18:51:11.000000000 +0100
@@ -61,6 +61,9 @@
 
 #define VLAN_VID_MASK	0xfff
 
+#define VLAN_COMP_FEATURES(f)	((f) & (NETIF_F_SG|NETIF_F_NO_CSUM| \
+				 NETIF_F_HIGHDMA|NETIF_F_FRAGLIST|NETIF_F_TSO))
+
 /* found in socket.c */
 extern void vlan_ioctl_set(int (*hook)(void __user *));
 
diff -Nru linux-2.6.11-rc2-bk2.orig/net/8021q/vlan.c linux-2.6.11-rc2-bk2/net/8021q/vlan.c
--- linux-2.6.11-rc2-bk2.orig/net/8021q/vlan.c	2005-01-25 00:50:01.000000000 +0100
+++ linux-2.6.11-rc2-bk2/net/8021q/vlan.c	2005-01-25 18:54:45.000000000 +0100
@@ -459,6 +459,8 @@
 	/* TODO: maybe just assign it to be ETHERNET? */
 	new_dev->type = real_dev->type;
 
+	new_dev->features = VLAN_COMP_FEATURES(real_dev->features);
+
 	new_dev->hard_header_len = real_dev->hard_header_len;
 	if (!(real_dev->features & NETIF_F_HW_VLAN_TX)) {
 		/* Regular ethernet + 4 bytes (18 total). */
@@ -477,6 +479,7 @@
 		new_dev->hard_header = real_dev->hard_header;
 		new_dev->hard_start_xmit = vlan_dev_hwaccel_hard_start_xmit;
 		new_dev->rebuild_header = real_dev->rebuild_header;
+		new_dev->features = real_dev->features & (NETIF_F_IP_CSUM | NETIF_F_HW_CSUM);
 	} else {
 		new_dev->hard_header = vlan_dev_hard_header;
 		new_dev->hard_start_xmit = vlan_dev_hard_start_xmit;

  reply	other threads:[~2005-01-25 20:36 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <41F432BD.3000300@davidcoulson.net>
2005-01-24  0:32 ` skb_checksum_help Thomas Graf
2005-01-24  0:49   ` skb_checksum_help Patrick McHardy
2005-01-24  0:53     ` skb_checksum_help Thomas Graf
2005-01-24  1:31       ` skb_checksum_help Herbert Xu
2005-01-24  4:27         ` skb_checksum_help David S. Miller
2005-01-24  4:38           ` skb_checksum_help David S. Miller
2005-01-24  4:46           ` skb_checksum_help Patrick McHardy
2005-01-24  4:56           ` skb_checksum_help Herbert Xu
2005-01-24  5:07             ` skb_checksum_help Patrick McHardy
2005-01-24 12:22               ` skb_checksum_help Thomas Graf
2005-01-24 13:09                 ` skb_checksum_help Patrick McHardy
2005-01-24 14:49                   ` skb_checksum_help David Coulson
2005-01-24 12:16           ` skb_checksum_help Thomas Graf
2005-01-24 14:51             ` skb_checksum_help David Coulson
2005-01-24 15:15               ` skb_checksum_help Thomas Graf
2005-01-24 15:27                 ` skb_checksum_help David Coulson
2005-01-24 22:54                 ` skb_checksum_help Herbert Xu
2005-01-24 23:45                   ` skb_checksum_help Thomas Graf
2005-01-25  0:07                     ` skb_checksum_help Herbert Xu
2005-01-25  0:40                       ` skb_checksum_help David S. Miller
2005-01-25  1:45                         ` skb_checksum_help Thomas Graf
2005-01-25  1:48                           ` skb_checksum_help Herbert Xu
2005-01-25  1:59                             ` skb_checksum_help David Coulson
2005-01-25  2:07                               ` skb_checksum_help Herbert Xu
2005-01-25  2:01                             ` skb_checksum_help Thomas Graf
2005-01-25  2:03                               ` skb_checksum_help David S. Miller
2005-01-25  2:24                                 ` skb_checksum_help Thomas Graf
2005-01-25  3:43                                   ` skb_checksum_help David S. Miller
2005-01-25 12:05                                     ` skb_checksum_help David Coulson
2005-01-25 14:33                                     ` skb_checksum_help Thomas Graf
2005-01-25 20:36                                       ` Thomas Graf [this message]
2005-01-25 20:48                                         ` skb_checksum_help Ben Greear
2005-01-25 21:15                                           ` skb_checksum_help Thomas Graf
2005-01-25 22:14                                             ` skb_checksum_help Ben Greear
2005-01-25 23:31                                               ` skb_checksum_help David S. Miller
2005-01-25 23:30                                             ` skb_checksum_help David S. Miller
2005-01-25 20:50                                         ` skb_checksum_help David S. Miller
2005-01-25  2:02                           ` skb_checksum_help David S. Miller
2005-01-25  2:14                           ` skb_checksum_help Herbert Xu
2005-01-25 11:23                         ` skb_checksum_help Herbert Xu
2005-01-25 20:46                           ` skb_checksum_help David S. Miller
2005-01-25  2:15                   ` skb_checksum_help Patrick McHardy
2005-01-25 14:16                   ` skb_checksum_help David Coulson
2005-01-24  1:31   ` skb_checksum_help David Coulson
2005-01-24 12:31     ` skb_checksum_help Thomas Graf
2005-01-24 14:25       ` skb_checksum_help David Coulson

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=20050125203607.GG31837@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=david@davidcoulson.net \
    --cc=greearb@candelatech.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kaber@trash.net \
    --cc=netdev@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.