Skip to content

Commit 79e7fff

Browse files
edumazetdavem330
authored andcommitted
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>
1 parent 7a655c6 commit 79e7fff

4 files changed

Lines changed: 0 additions & 21 deletions

File tree

‎include/linux/netdev_features.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ enum {
7171
NETIF_F_HW_VLAN_STAG_RX_BIT, /* Receive VLAN STAG HW acceleration */
7272
NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */
7373
NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */
74-
NETIF_F_BUSY_POLL_BIT, /* Busy poll */
7574

7675
NETIF_F_HW_TC_BIT, /* Offload TC infrastructure */
7776

@@ -134,7 +133,6 @@ enum {
134133
#define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX)
135134
#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX)
136135
#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD)
137-
#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
138136
#define NETIF_F_HW_TC __NETIF_F(HW_TC)
139137

140138
#define for_each_netdev_feature(mask_addr, bit) \

‎include/linux/netdevice.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,9 +1184,6 @@ struct net_device_ops {
11841184
int (*ndo_netpoll_setup)(struct net_device *dev,
11851185
struct netpoll_info *info);
11861186
void (*ndo_netpoll_cleanup)(struct net_device *dev);
1187-
#endif
1188-
#ifdef CONFIG_NET_RX_BUSY_POLL
1189-
int (*ndo_busy_poll)(struct napi_struct *dev);
11901187
#endif
11911188
int (*ndo_set_vf_mac)(struct net_device *dev,
11921189
int queue, u8 *mac);

‎net/core/dev.c‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4978,7 +4978,6 @@ bool sk_busy_loop(struct sock *sk, int nonblock)
49784978
{
49794979
unsigned long end_time = !nonblock ? sk_busy_loop_end_time(sk) : 0;
49804980
int (*napi_poll)(struct napi_struct *napi, int budget);
4981-
int (*busy_poll)(struct napi_struct *dev);
49824981
void *have_poll_lock = NULL;
49834982
struct napi_struct *napi;
49844983
int rc;
@@ -4993,17 +4992,10 @@ bool sk_busy_loop(struct sock *sk, int nonblock)
49934992
if (!napi)
49944993
goto out;
49954994

4996-
/* Note: ndo_busy_poll method is optional in linux-4.5 */
4997-
busy_poll = napi->dev->netdev_ops->ndo_busy_poll;
4998-
49994995
preempt_disable();
50004996
for (;;) {
50014997
rc = 0;
50024998
local_bh_disable();
5003-
if (busy_poll) {
5004-
rc = busy_poll(napi);
5005-
goto count;
5006-
}
50074999
if (!napi_poll) {
50085000
unsigned long val = READ_ONCE(napi->state);
50095001

@@ -6956,13 +6948,6 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
69566948
features &= ~dev->gso_partial_features;
69576949
}
69586950

6959-
#ifdef CONFIG_NET_RX_BUSY_POLL
6960-
if (dev->netdev_ops->ndo_busy_poll)
6961-
features |= NETIF_F_BUSY_POLL;
6962-
else
6963-
#endif
6964-
features &= ~NETIF_F_BUSY_POLL;
6965-
69666951
return features;
69676952
}
69686953

‎net/core/ethtool.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ static const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN]
102102
[NETIF_F_RXFCS_BIT] = "rx-fcs",
103103
[NETIF_F_RXALL_BIT] = "rx-all",
104104
[NETIF_F_HW_L2FW_DOFFLOAD_BIT] = "l2-fwd-offload",
105-
[NETIF_F_BUSY_POLL_BIT] = "busy-poll",
106105
[NETIF_F_HW_TC_BIT] = "hw-tc-offload",
107106
};
108107

0 commit comments

Comments
 (0)