mirror of
https://github.com/breeze303/openwrt-ipq.git
synced 2025-12-17 00:21:06 +00:00
60 lines
1.7 KiB
Diff
60 lines
1.7 KiB
Diff
--- a/include/linux/netdevice.h
|
|
+++ b/include/linux/netdevice.h
|
|
@@ -2711,6 +2711,25 @@ netif_napi_add(struct net_device *dev, s
|
|
netif_napi_add_weight(dev, napi, poll, NAPI_POLL_WEIGHT);
|
|
}
|
|
|
|
+
|
|
+static inline void netif_threaded_napi_add_weight(struct net_device *dev,
|
|
+ struct napi_struct *napi,
|
|
+ int (*poll)(struct napi_struct *, int),
|
|
+ int weight)
|
|
+{
|
|
+ netif_napi_add_weight(dev, napi, poll, weight);
|
|
+ if (num_online_cpus() > 1) {
|
|
+ dev_set_threaded(dev, true);
|
|
+ }
|
|
+}
|
|
+
|
|
+static inline void netif_threaded_napi_add(struct net_device *dev,
|
|
+ struct napi_struct *napi,
|
|
+ int (*poll)(struct napi_struct *, int))
|
|
+{
|
|
+ netif_threaded_napi_add_weight(dev, napi, poll, NAPI_POLL_WEIGHT);
|
|
+}
|
|
+
|
|
static inline void
|
|
netif_napi_add_tx_weight(struct net_device *dev,
|
|
struct napi_struct *napi,
|
|
@@ -2721,6 +2740,16 @@ netif_napi_add_tx_weight(struct net_devi
|
|
netif_napi_add_weight(dev, napi, poll, weight);
|
|
}
|
|
|
|
+static inline void
|
|
+netif_threaded_napi_add_tx_weight(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_threaded_napi_add_weight(dev, napi, poll, weight);
|
|
+}
|
|
+
|
|
/**
|
|
* netif_napi_add_tx() - initialize a NAPI context to be used for Tx only
|
|
* @dev: network device
|
|
@@ -2738,6 +2767,13 @@ static inline void netif_napi_add_tx(str
|
|
netif_napi_add_tx_weight(dev, napi, poll, NAPI_POLL_WEIGHT);
|
|
}
|
|
|
|
+static inline void netif_threaded_napi_add_tx(struct net_device *dev,
|
|
+ struct napi_struct *napi,
|
|
+ int (*poll)(struct napi_struct *, int))
|
|
+{
|
|
+ netif_threaded_napi_add_tx_weight(dev, napi, poll, NAPI_POLL_WEIGHT);
|
|
+}
|
|
+
|
|
/**
|
|
* __netif_napi_del - remove a NAPI context
|
|
* @napi: NAPI context
|