Commit d0290214de712150b118a532ded378a29255893b
Committed by
David S. Miller
1 parent
8e2f1a63f2
Exists in
master
and in
13 other branches
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>
Showing 3 changed files with 10 additions and 0 deletions Side-by-side Diff
include/linux/netdev_features.h
... | ... | @@ -63,6 +63,7 @@ |
63 | 63 | NETIF_F_HW_VLAN_STAG_RX_BIT, /* Receive VLAN STAG HW acceleration */ |
64 | 64 | NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ |
65 | 65 | NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ |
66 | + NETIF_F_BUSY_POLL_BIT, /* Busy poll */ | |
66 | 67 | |
67 | 68 | /* |
68 | 69 | * Add your fresh new feature above and remember to update |
... | ... | @@ -118,6 +119,7 @@ |
118 | 119 | #define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) |
119 | 120 | #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) |
120 | 121 | #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) |
122 | +#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) | |
121 | 123 | |
122 | 124 | /* Features valid for ethtool to change */ |
123 | 125 | /* = all defined minus driver/device-class-related */ |
net/core/dev.c
... | ... | @@ -5696,6 +5696,13 @@ |
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 | 5706 | return features; |
5700 | 5707 | } |
5701 | 5708 |
net/core/ethtool.c
... | ... | @@ -97,6 +97,7 @@ |
97 | 97 | [NETIF_F_RXFCS_BIT] = "rx-fcs", |
98 | 98 | [NETIF_F_RXALL_BIT] = "rx-all", |
99 | 99 | [NETIF_F_HW_L2FW_DOFFLOAD_BIT] = "l2-fwd-offload", |
100 | + [NETIF_F_BUSY_POLL_BIT] = "busy-poll", | |
100 | 101 | }; |
101 | 102 | |
102 | 103 | static int ethtool_get_features(struct net_device *dev, void __user *useraddr) |