All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net-next] net: increase the size of priv_flags and add IFF_OVS_DATAPATH
@ 2010-08-24  2:26 Simon Horman
  2010-08-24  3:44 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2010-08-24  2:26 UTC (permalink / raw)
  To: netdev; +Cc: Jesse Gross, David S. Miller

IFF_OVS_DATAPATH is a place-holder for the Open vSwitch datapath
which I am preparing to submit for merging.

As all 16 bits of priv_flags are already assigned flags, also increase
the size of priv_flags to 32 bits.

Unfortunately, by my calculations this increases the size of
struct net_device by 4 bytes on 32bit architectures and
8 bytes on 64 bit architectures. I couldn't see an obvious
way to avoid that.

Cc: Jesse Gross <jesse@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

I had hoped this patch would be much cleaner :^)

Index: nf-next-2.6/include/linux/if.h
===================================================================
--- nf-next-2.6.orig/include/linux/if.h	2010-08-24 10:29:41.000000000 +0900
+++ nf-next-2.6/include/linux/if.h	2010-08-24 11:11:39.000000000 +0900
@@ -75,6 +75,8 @@
 #define IFF_DISABLE_NETPOLL	0x2000	/* disable netpoll at run-time */
 #define IFF_MACVLAN_PORT	0x4000	/* device used as macvlan port */
 #define IFF_BRIDGE_PORT	0x8000		/* device used as bridge port */
+#define IFF_OVS_DATAPATH	0x10000	/* device used as Open vSwitch
+					 * dapath port */
 
 #define IF_GET_IFACE	0x0001		/* for querying only */
 #define IF_GET_PROTO	0x0002
Index: nf-next-2.6/include/linux/netdevice.h
===================================================================
--- nf-next-2.6.orig/include/linux/netdevice.h	2010-08-24 10:38:14.000000000 +0900
+++ nf-next-2.6/include/linux/netdevice.h	2010-08-24 11:11:14.000000000 +0900
@@ -907,7 +907,7 @@ struct net_device {
 
 	unsigned int		flags;	/* interface flags (a la BSD)	*/
 	unsigned short		gflags;
-        unsigned short          priv_flags; /* Like 'flags' but invisible to userspace. */
+        unsigned int            priv_flags; /* Like 'flags' but invisible to userspace. */
 	unsigned short		padded;	/* How much padding added by alloc_netdev() */
 
 	unsigned char		operstate; /* RFC2863 operstate */

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

* Re: [patch net-next] net: increase the size of priv_flags and add IFF_OVS_DATAPATH
  2010-08-24  2:26 [patch net-next] net: increase the size of priv_flags and add IFF_OVS_DATAPATH Simon Horman
@ 2010-08-24  3:44 ` David Miller
  2010-08-24  4:53   ` Simon Horman
  2010-08-24  6:48   ` Jay Vosburgh
  0 siblings, 2 replies; 4+ messages in thread
From: David Miller @ 2010-08-24  3:44 UTC (permalink / raw)
  To: horms; +Cc: netdev, jesse

From: Simon Horman <horms@verge.net.au>
Date: Tue, 24 Aug 2010 11:26:41 +0900

> IFF_OVS_DATAPATH is a place-holder for the Open vSwitch datapath
> which I am preparing to submit for merging.
> 
> As all 16 bits of priv_flags are already assigned flags, also increase
> the size of priv_flags to 32 bits.
> 
> Unfortunately, by my calculations this increases the size of
> struct net_device by 4 bytes on 32bit architectures and
> 8 bytes on 64 bit architectures. I couldn't see an obvious
> way to avoid that.
> 
> Cc: Jesse Gross <jesse@nicira.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>

I can't think of a better way out of this, so applied for now.

Maybe somehow some of those bonding specific flags can get put
down into the bonding private structure.  However, that might
not be possible if the sole reason those live in ->priv_flags
is to allow tests of the flags outside of the bonding code.

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

* Re: [patch net-next] net: increase the size of priv_flags and add IFF_OVS_DATAPATH
  2010-08-24  3:44 ` David Miller
@ 2010-08-24  4:53   ` Simon Horman
  2010-08-24  6:48   ` Jay Vosburgh
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2010-08-24  4:53 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, jesse

On Mon, Aug 23, 2010 at 08:44:08PM -0700, David Miller wrote:
> From: Simon Horman <horms@verge.net.au>
> Date: Tue, 24 Aug 2010 11:26:41 +0900
> 
> > IFF_OVS_DATAPATH is a place-holder for the Open vSwitch datapath
> > which I am preparing to submit for merging.
> > 
> > As all 16 bits of priv_flags are already assigned flags, also increase
> > the size of priv_flags to 32 bits.
> > 
> > Unfortunately, by my calculations this increases the size of
> > struct net_device by 4 bytes on 32bit architectures and
> > 8 bytes on 64 bit architectures. I couldn't see an obvious
> > way to avoid that.
> > 
> > Cc: Jesse Gross <jesse@nicira.com>
> > Signed-off-by: Simon Horman <horms@verge.net.au>
> 
> I can't think of a better way out of this, so applied for now.
> 
> Maybe somehow some of those bonding specific flags can get put
> down into the bonding private structure.  However, that might
> not be possible if the sole reason those live in ->priv_flags
> is to allow tests of the flags outside of the bonding code.

Thanks.

It seems to me that there is ample scope to do something.
But nothing seems obviously correct.


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

* Re: [patch net-next] net: increase the size of priv_flags and add IFF_OVS_DATAPATH
  2010-08-24  3:44 ` David Miller
  2010-08-24  4:53   ` Simon Horman
@ 2010-08-24  6:48   ` Jay Vosburgh
  1 sibling, 0 replies; 4+ messages in thread
From: Jay Vosburgh @ 2010-08-24  6:48 UTC (permalink / raw)
  To: David Miller; +Cc: horms, netdev, jesse

David Miller <davem@davemloft.net> wrote:

>From: Simon Horman <horms@verge.net.au>
>Date: Tue, 24 Aug 2010 11:26:41 +0900
>
>> IFF_OVS_DATAPATH is a place-holder for the Open vSwitch datapath
>> which I am preparing to submit for merging.
>> 
>> As all 16 bits of priv_flags are already assigned flags, also increase
>> the size of priv_flags to 32 bits.
>> 
>> Unfortunately, by my calculations this increases the size of
>> struct net_device by 4 bytes on 32bit architectures and
>> 8 bytes on 64 bit architectures. I couldn't see an obvious
>> way to avoid that.
>> 
>> Cc: Jesse Gross <jesse@nicira.com>
>> Signed-off-by: Simon Horman <horms@verge.net.au>
>
>I can't think of a better way out of this, so applied for now.
>
>Maybe somehow some of those bonding specific flags can get put
>down into the bonding private structure.  However, that might
>not be possible if the sole reason those live in ->priv_flags
>is to allow tests of the flags outside of the bonding code.

	That is indeed the case: it's to permit the flags to be tested
primarily in the netif_receive_skb path (inside __skb_bond_should_drop)
without calling into bonding via a hook or the like.  There's also one
check in fcoe to not support fcoe over a subset of bonding modes, from
the looks of it.

	I don't think the bonding tests could be rolled up into a
dev->rx_handler, either, because the bonding stuff has to happen before
any delivery attempts (it may affect skb->dev or packet delivery).

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

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

end of thread, other threads:[~2010-08-24  6:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-24  2:26 [patch net-next] net: increase the size of priv_flags and add IFF_OVS_DATAPATH Simon Horman
2010-08-24  3:44 ` David Miller
2010-08-24  4:53   ` Simon Horman
2010-08-24  6:48   ` Jay Vosburgh

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.