]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/netdevice.h
gro: Move common completion code into helpers
[mirror_ubuntu-artful-kernel.git] / include / linux / netdevice.h
index f24556813375f0b54ec13066f22c10a40775010a..20419508eec150c1e2420762e6c4d5b54da55043 100644 (file)
@@ -467,7 +467,7 @@ struct netdev_queue {
  *     This function is called when network device transistions to the down
  *     state.
  *
- * int (*ndo_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev);
+ * int (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev);
  *     Called when a packet needs to be transmitted.
  *     Must return NETDEV_TX_OK , NETDEV_TX_BUSY, or NETDEV_TX_LOCKED,
  *     Required can not be NULL.
@@ -795,6 +795,7 @@ struct net_device
               NETREG_UNREGISTERING,    /* called unregister_netdevice */
               NETREG_UNREGISTERED,     /* completed unregister todo */
               NETREG_RELEASED,         /* called free_netdev */
+              NETREG_DUMMY,            /* dummy device for NAPI poll */
        } reg_state;
 
        /* Called from unregister, can be used to call free_netdev */
@@ -1077,6 +1078,8 @@ extern void               free_netdev(struct net_device *dev);
 extern void            synchronize_net(void);
 extern int             register_netdevice_notifier(struct notifier_block *nb);
 extern int             unregister_netdevice_notifier(struct notifier_block *nb);
+extern int             init_dummy_netdev(struct net_device *dev);
+
 extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
 extern struct net_device       *dev_get_by_index(struct net *net, int ifindex);
 extern struct net_device       *__dev_get_by_index(struct net *net, int ifindex);
@@ -1372,12 +1375,15 @@ extern int              netif_receive_skb(struct sk_buff *skb);
 extern void            napi_gro_flush(struct napi_struct *napi);
 extern int             dev_gro_receive(struct napi_struct *napi,
                                        struct sk_buff *skb);
+extern int             napi_skb_finish(int ret, struct sk_buff *skb);
 extern int             napi_gro_receive(struct napi_struct *napi,
                                         struct sk_buff *skb);
 extern void            napi_reuse_skb(struct napi_struct *napi,
                                       struct sk_buff *skb);
 extern struct sk_buff *        napi_fraginfo_skb(struct napi_struct *napi,
                                          struct napi_gro_fraginfo *info);
+extern int             napi_frags_finish(struct napi_struct *napi,
+                                         struct sk_buff *skb, int ret);
 extern int             napi_gro_frags(struct napi_struct *napi,
                                       struct napi_gro_fraginfo *info);
 extern void            netif_nit_deliver(struct sk_buff *skb);
@@ -1571,56 +1577,6 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
        return (1 << debug_value) - 1;
 }
 
-/* Test if receive needs to be scheduled but only if up */
-static inline int netif_rx_schedule_prep(struct napi_struct *napi)
-{
-       return napi_schedule_prep(napi);
-}
-
-/* Add interface to tail of rx poll list. This assumes that _prep has
- * already been called and returned 1.
- */
-static inline void __netif_rx_schedule(struct napi_struct *napi)
-{
-       __napi_schedule(napi);
-}
-
-/* Try to reschedule poll. Called by irq handler. */
-
-static inline void netif_rx_schedule(struct napi_struct *napi)
-{
-       if (netif_rx_schedule_prep(napi))
-               __netif_rx_schedule(napi);
-}
-
-/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete().  */
-static inline int netif_rx_reschedule(struct napi_struct *napi)
-{
-       if (napi_schedule_prep(napi)) {
-               __netif_rx_schedule(napi);
-               return 1;
-       }
-       return 0;
-}
-
-/* same as netif_rx_complete, except that local_irq_save(flags)
- * has already been issued
- */
-static inline void __netif_rx_complete(struct napi_struct *napi)
-{
-       __napi_complete(napi);
-}
-
-/* Remove interface from poll list: it must be in the poll list
- * on current cpu. This primitive is called by dev->poll(), when
- * it completes the work. The device cannot be out of poll list at this
- * moment, it is BUG().
- */
-static inline void netif_rx_complete(struct napi_struct *napi)
-{
-       napi_complete(napi);
-}
-
 static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)
 {
        spin_lock(&txq->_xmit_lock);