Skip to contentSkip to conversation

rearrange netdevice structure to save space

PATCH Applied Stephen Hemminger 3 participants 5 messages Mar 9, 2005 – Mar 11, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rearrange netdevice structure to save space

Trivial reordering of netdevice structure to save four bytes.

include/linux/netdevice.h +1 -5
diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h
@@ -328,9 +328,7 @@
 	unsigned short		flags;	/* interface flags (a la BSD)	*/
 	unsigned short		gflags;
         unsigned short          priv_flags; /* Like 'flags' but invisible to userspace. */
-        unsigned short          unused_alignment_fixer; /* Because we need priv_flags,
-                                                         * and we want to be 32-bit aligned.
-                                                         */
+	unsigned short		padded;	/* How much padding added by alloc_netdev() */
 
 	unsigned		mtu;	/* interface MTU value		*/
 	unsigned short		type;	/* interface hardware type	*/
@@ -487,8 +485,6 @@
 
 	/* class/net/name entry */
 	struct class_device	class_dev;
-	/* how much padding had been added by alloc_netdev() */
-	int padded;
 };
 
 #define	NETDEV_ALIGN		32
#1 lore raw

PATCH 1/1 kill ->accept_fastpath hook

Quoted 3 lines · Stephen Hemminger

Trivial reordering of netdevice structure to save four bytes.

If we are twiddling struct net_device, might as well kill this hook. Never called AFAICS, and only assigned -- to a no-op stub -- in one driver.

===== include/linux/netdevice.h 1.99 vs edited =====

include/linux/netdevice.h +0 -1
@@ -469,7 +469,6 @@
 	int			(*hard_header_parse)(struct sk_buff *skb,
 						     unsigned char *haddr);
 	int			(*neigh_setup)(struct net_device *dev, struct neigh_parms *);
-	int			(*accept_fastpath)(struct net_device *, struct dst_entry*);
 #ifdef CONFIG_NETPOLL
 	int			netpoll_rx;
 #endif

===== net/bridge/br_device.c 1.17 vs edited =====

net/bridge/br_device.c +0 -6
@@ -83,11 +83,6 @@
 	return 0;
 }
 
-static int br_dev_accept_fastpath(struct net_device *dev, struct dst_entry *dst)
-{
-	return -1;
-}
-
 void br_dev_setup(struct net_device *dev)
 {
 	memset(dev->dev_addr, 0, ETH_ALEN);
@@ -103,7 +98,6 @@
 	dev->destructor = free_netdev;
 	SET_MODULE_OWNER(dev);
 	dev->stop = br_dev_stop;
-	dev->accept_fastpath = br_dev_accept_fastpath;
 	dev->tx_queue_len = 0;
 	dev->set_mac_address = NULL;
 	dev->priv_flags = IFF_EBRIDGE;
#2 lore raw

Re: [PATCH] kill ->accept_fastpath hook

Quoted 10 lines · On Wed, 09 Mar 2005 13:47:52 -0500 Jeff Garzik <[email protected]> wrote:
Quoted 3 lines · Stephen Hemminger

Trivial reordering of netdevice structure to save four bytes.

If we are twiddling struct net_device, might as well kill this hook. Never called AFAICS, and only assigned -- to a no-op stub -- in one driver.

yes, kill it.

maintainer Applied
#3 lore raw

Re: [PATCH] kill ->accept_fastpath hook

In reply to Jeff Garzik
Quoted 9 lines · On Wed, 09 Mar 2005 13:47:52 -0500 Jeff Garzik <[email protected]> wrote:
Quoted 3 lines · Stephen Hemminger

Trivial reordering of netdevice structure to save four bytes.

If we are twiddling struct net_device, might as well kill this hook. Never called AFAICS, and only assigned -- to a no-op stub -- in one driver.

Applied, thanks Jeff.