__napi_schedule(n);
}
+/* Try to reschedule poll. Called by dev->poll() after napi_complete(). */
+static inline int napi_reschedule(struct napi_struct *napi)
+{
+ if (napi_schedule_prep(napi)) {
+ __napi_schedule(napi);
+ return 1;
+ }
+ return 0;
+}
+
/**
* napi_complete - NAPI processing complete
* @n: napi context
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
{
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);
}
* dev_put - release reference to device
* @dev: network device
*
- * Hold reference to device to keep it from being freed.
+ * Release reference to device to allow it to be freed.
*/
static inline void dev_put(struct net_device *dev)
{
* dev_hold - get reference to device
* @dev: network device
*
- * Release reference to device to allow it to be freed.
+ * Hold reference to device to keep it from being freed.
*/
static inline void dev_hold(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
*/