aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2010-06-01 17:52:08 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-02 10:11:15 -0400
commitab95bfe01f9872459c8678572ccadbf646badad0 (patch)
tree8e11f94077c9a80f7af52ce3dd50591a686561d7 /include/linux/netdevice.h
parent20c59de2e6b6bc74bbf714dcd4e720afe8d516cf (diff)
net: replace hooks in __netif_receive_skb V5
What this patch does is it removes two receive frame hooks (for bridge and for macvlan) from __netif_receive_skb. These are replaced them with a single hook for both. It only supports one hook per device because it makes no sense to do bridging and macvlan on the same device. Then a network driver (of virtual netdev like macvlan or bridge) can register an rx_handler for needed net device. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index bd6b75317d5f..5156b806924c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -381,6 +381,8 @@ enum gro_result {
381}; 381};
382typedef enum gro_result gro_result_t; 382typedef enum gro_result gro_result_t;
383 383
384typedef struct sk_buff *rx_handler_func_t(struct sk_buff *skb);
385
384extern void __napi_schedule(struct napi_struct *n); 386extern void __napi_schedule(struct napi_struct *n);
385 387
386static inline int napi_disable_pending(struct napi_struct *n) 388static inline int napi_disable_pending(struct napi_struct *n)
@@ -957,6 +959,7 @@ struct net_device {
957#endif 959#endif
958 960
959 struct netdev_queue rx_queue; 961 struct netdev_queue rx_queue;
962 rx_handler_func_t *rx_handler;
960 963
961 struct netdev_queue *_tx ____cacheline_aligned_in_smp; 964 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
962 965
@@ -1689,6 +1692,10 @@ static inline void napi_free_frags(struct napi_struct *napi)
1689 napi->skb = NULL; 1692 napi->skb = NULL;
1690} 1693}
1691 1694
1695extern int netdev_rx_handler_register(struct net_device *dev,
1696 rx_handler_func_t *rx_handler);
1697extern void netdev_rx_handler_unregister(struct net_device *dev);
1698
1692extern void netif_nit_deliver(struct sk_buff *skb); 1699extern void netif_nit_deliver(struct sk_buff *skb);
1693extern int dev_valid_name(const char *name); 1700extern int dev_valid_name(const char *name);
1694extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 1701extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);