net: remove support for per driver ndo_busy_poll()
We added generic support for busy polling in NAPI layer in linux-4.5 No network driver uses ndo_busy_poll() anymore, we can get rid of the pointer in struct net_device_ops, and its use in sk_busy_loop() Saves NETIF_F_BUSY_POLL features bit. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
7a655c6324
commit
79e7fff47b
@@ -4978,7 +4978,6 @@ bool sk_busy_loop(struct sock *sk, int nonblock)
|
||||
{
|
||||
unsigned long end_time = !nonblock ? sk_busy_loop_end_time(sk) : 0;
|
||||
int (*napi_poll)(struct napi_struct *napi, int budget);
|
||||
int (*busy_poll)(struct napi_struct *dev);
|
||||
void *have_poll_lock = NULL;
|
||||
struct napi_struct *napi;
|
||||
int rc;
|
||||
@@ -4993,17 +4992,10 @@ restart:
|
||||
if (!napi)
|
||||
goto out;
|
||||
|
||||
/* Note: ndo_busy_poll method is optional in linux-4.5 */
|
||||
busy_poll = napi->dev->netdev_ops->ndo_busy_poll;
|
||||
|
||||
preempt_disable();
|
||||
for (;;) {
|
||||
rc = 0;
|
||||
local_bh_disable();
|
||||
if (busy_poll) {
|
||||
rc = busy_poll(napi);
|
||||
goto count;
|
||||
}
|
||||
if (!napi_poll) {
|
||||
unsigned long val = READ_ONCE(napi->state);
|
||||
|
||||
@@ -6956,13 +6948,6 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
|
||||
features &= ~dev->gso_partial_features;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_RX_BUSY_POLL
|
||||
if (dev->netdev_ops->ndo_busy_poll)
|
||||
features |= NETIF_F_BUSY_POLL;
|
||||
else
|
||||
#endif
|
||||
features &= ~NETIF_F_BUSY_POLL;
|
||||
|
||||
return features;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user