]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/netdevice.h
[NET]: Make and use skb_get_queue_mapping
[mirror_ubuntu-artful-kernel.git] / include / linux / netdevice.h
index 5a11f889e56a7f0780eb44572e4b9e2b68239c70..6f85db3535e2f5d57628f03dc8f2ed98b6f09083 100644 (file)
@@ -407,6 +407,24 @@ static inline void napi_enable(struct napi_struct *n)
        clear_bit(NAPI_STATE_SCHED, &n->state);
 }
 
+#ifdef CONFIG_SMP
+/**
+ *     napi_synchronize - wait until NAPI is not running
+ *     @n: napi context
+ *
+ * Wait until NAPI is done being scheduled on this context.
+ * Waits till any outstanding processing completes but
+ * does not disable future activations.
+ */
+static inline void napi_synchronize(const struct napi_struct *n)
+{
+       while (test_bit(NAPI_STATE_SCHED, &n->state))
+               msleep(1);
+}
+#else
+# define napi_synchronize(n)   barrier()
+#endif
+
 /*
  *     The DEVICE structure.
  *     Actually, this whole structure is a big mistake.  It mixes I/O
@@ -827,7 +845,7 @@ static inline int dev_parse_header(const struct sk_buff *skb,
 {
        const struct net_device *dev = skb->dev;
 
-       if (!dev->header_ops->parse)
+       if (!dev->header_ops || !dev->header_ops->parse)
                return 0;
        return dev->header_ops->parse(skb, haddr);
 }
@@ -1294,6 +1312,7 @@ static inline void netif_rx_complete(struct net_device *dev,
 /**
  *     netif_tx_lock - grab network device transmit lock
  *     @dev: network device
+ *     @cpu: cpu number of lock owner
  *
  * Get network device transmit lock
  */