|
@@ -326,7 +326,8 @@ enum {
|
|
|
NAPI_STATE_SCHED, /* Poll is scheduled */
|
|
|
NAPI_STATE_DISABLE, /* Disable pending */
|
|
|
NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */
|
|
|
- NAPI_STATE_HASHED, /* In NAPI hash */
|
|
|
+ NAPI_STATE_HASHED, /* In NAPI hash (busy polling possible) */
|
|
|
+ NAPI_STATE_NO_BUSY_POLL,/* Do not add in napi_hash, no busy polling */
|
|
|
};
|
|
|
|
|
|
enum gro_result {
|
|
@@ -1938,6 +1939,26 @@ static inline void *netdev_priv(const struct net_device *dev)
|
|
|
void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
|
|
|
int (*poll)(struct napi_struct *, int), int weight);
|
|
|
|
|
|
+/**
|
|
|
+ * netif_tx_napi_add - initialize a napi context
|
|
|
+ * @dev: network device
|
|
|
+ * @napi: napi context
|
|
|
+ * @poll: polling function
|
|
|
+ * @weight: default weight
|
|
|
+ *
|
|
|
+ * This variant of netif_napi_add() should be used from drivers using NAPI
|
|
|
+ * to exclusively poll a TX queue.
|
|
|
+ * This will avoid we add it into napi_hash[], thus polluting this hash table.
|
|
|
+ */
|
|
|
+static inline void netif_tx_napi_add(struct net_device *dev,
|
|
|
+ struct napi_struct *napi,
|
|
|
+ int (*poll)(struct napi_struct *, int),
|
|
|
+ int weight)
|
|
|
+{
|
|
|
+ set_bit(NAPI_STATE_NO_BUSY_POLL, &napi->state);
|
|
|
+ netif_napi_add(dev, napi, poll, weight);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* netif_napi_del - remove a napi context
|
|
|
* @napi: napi context
|