summaryrefslogtreecommitdiff
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2014-04-02 23:09:31 +0200
committerDavid S. Miller <davem@davemloft.net>2014-04-03 14:31:34 -0400
commitd0290214de712150b118a532ded378a29255893b (patch)
treee27bdd049f71378689f160fdac7693437e5d3a30 /net/core/dev.c
parent8e2f1a63f2217365223026422a2f8ba5967051d6 (diff)
net: add busy_poll device feature
Currently there is no way how to find out if a device supports busy polling. So add a feature and make it dependent on ndo_busy_poll existence. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 757063420ce0..75e88e0372cb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5696,6 +5696,13 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
}
}
+#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;
}