diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-10-02 02:11:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-05 03:23:44 -0400 |
commit | 24824a09e35402b8d58dcc5be803a5ad3937bdba (patch) | |
tree | 65c5fa4046646623b130702c9abc92c485ec575b /include | |
parent | 0bd9e6a964d86a19f54a9ba31168a37d64e451d1 (diff) |
net: dynamic ingress_queue allocation
ingress being not used very much, and net_device->ingress_queue being
quite a big object (128 or 256 bytes), use a dynamic allocation if
needed (tc qdisc add dev eth0 ingress ...)
dev_ingress_queue(dev) helper should be used only with RTNL taken.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 2 | ||||
-rw-r--r-- | include/linux/rtnetlink.h | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ceed3474014a..92d81edd5808 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -986,7 +986,7 @@ struct net_device { | |||
986 | rx_handler_func_t *rx_handler; | 986 | rx_handler_func_t *rx_handler; |
987 | void *rx_handler_data; | 987 | void *rx_handler_data; |
988 | 988 | ||
989 | struct netdev_queue ingress_queue; /* use two cache lines */ | 989 | struct netdev_queue __rcu *ingress_queue; |
990 | 990 | ||
991 | /* | 991 | /* |
992 | * Cache lines mostly used on transmit path | 992 | * Cache lines mostly used on transmit path |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 68c436bddc88..0bb7b48632bd 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/if_link.h> | 6 | #include <linux/if_link.h> |
7 | #include <linux/if_addr.h> | 7 | #include <linux/if_addr.h> |
8 | #include <linux/neighbour.h> | 8 | #include <linux/neighbour.h> |
9 | #include <linux/netdevice.h> | ||
9 | 10 | ||
10 | /* rtnetlink families. Values up to 127 are reserved for real address | 11 | /* rtnetlink families. Values up to 127 are reserved for real address |
11 | * families, values above 128 may be used arbitrarily. | 12 | * families, values above 128 may be used arbitrarily. |
@@ -769,6 +770,13 @@ extern int lockdep_rtnl_is_held(void); | |||
769 | #define rtnl_dereference(p) \ | 770 | #define rtnl_dereference(p) \ |
770 | rcu_dereference_check(p, lockdep_rtnl_is_held()) | 771 | rcu_dereference_check(p, lockdep_rtnl_is_held()) |
771 | 772 | ||
773 | static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev) | ||
774 | { | ||
775 | return rtnl_dereference(dev->ingress_queue); | ||
776 | } | ||
777 | |||
778 | extern struct netdev_queue *dev_ingress_queue_create(struct net_device *dev); | ||
779 | |||
772 | extern void rtnetlink_init(void); | 780 | extern void rtnetlink_init(void); |
773 | extern void __rtnl_unlock(void); | 781 | extern void __rtnl_unlock(void); |
774 | 782 | ||