diff options
author | Jiri Pirko <jiri@resnulli.us> | 2014-04-02 17:09:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-03 14:31:34 -0400 |
commit | d0290214de712150b118a532ded378a29255893b (patch) | |
tree | e27bdd049f71378689f160fdac7693437e5d3a30 /net | |
parent | 8e2f1a63f2217365223026422a2f8ba5967051d6 (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')
-rw-r--r-- | net/core/dev.c | 7 | ||||
-rw-r--r-- | net/core/ethtool.c | 1 |
2 files changed, 8 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, | |||
5696 | } | 5696 | } |
5697 | } | 5697 | } |
5698 | 5698 | ||
5699 | #ifdef CONFIG_NET_RX_BUSY_POLL | ||
5700 | if (dev->netdev_ops->ndo_busy_poll) | ||
5701 | features |= NETIF_F_BUSY_POLL; | ||
5702 | else | ||
5703 | #endif | ||
5704 | features &= ~NETIF_F_BUSY_POLL; | ||
5705 | |||
5699 | return features; | 5706 | return features; |
5700 | } | 5707 | } |
5701 | 5708 | ||
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 30071dec287a..640ba0e5831c 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -97,6 +97,7 @@ static const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] | |||
97 | [NETIF_F_RXFCS_BIT] = "rx-fcs", | 97 | [NETIF_F_RXFCS_BIT] = "rx-fcs", |
98 | [NETIF_F_RXALL_BIT] = "rx-all", | 98 | [NETIF_F_RXALL_BIT] = "rx-all", |
99 | [NETIF_F_HW_L2FW_DOFFLOAD_BIT] = "l2-fwd-offload", | 99 | [NETIF_F_HW_L2FW_DOFFLOAD_BIT] = "l2-fwd-offload", |
100 | [NETIF_F_BUSY_POLL_BIT] = "busy-poll", | ||
100 | }; | 101 | }; |
101 | 102 | ||
102 | static int ethtool_get_features(struct net_device *dev, void __user *useraddr) | 103 | static int ethtool_get_features(struct net_device *dev, void __user *useraddr) |