Introduce biased busy-polling
Subsystems (30)
cover Introduce biased busy-polling
Jakub suggested in [1] a "strict busy-polling mode with out interrupts". This is a first stab at that.
This series adds a new NAPI mode, called biased busy-polling, which is an extension to the existing busy-polling mode. The new mode is enabled on the socket layer, where a socket setting this option "promisies" to busy-poll the NAPI context via a system call. When this mode is enabled, the NAPI context will operate in a mode with interrupts disabled. The kernel monitors that the busy-polling promise is fulfilled by an internal watchdog. If the socket fail/stop performing the busy-polling, the mode will be disabled.
Biased busy-polling follows the same mechanism as the existing busy-poll; The napi_id is reported to the socket via the skbuff. Later commits will extend napi_id reporting to XDP, in order to work correctly with XDP sockets.
Let us walk through a flow of execution:
1. A socket sets the new SO_BIAS_BUSY_POLL socket option to true. The socket now shows an intent of doing busy-polling. No data has been received to the socket, so the napi_id of the socket is still 0 (non-valid). As usual for busy-polling, the SO_BUSY_POLL option also has to be non-zero for biased busy-polling.
2. Data is received on the socket changing the napi_id to non-zero.
3. The socket does a system call that has the busy-polling logic wired up, e.g. recvfrom() for UDP sockets. The NAPI context is now marked as biased busy-poll. The kernel watchdog is armed. If the NAPI context is already running, it will try to finish as soon as possible and move to busy-polling. If the NAPI context is not running, it will execute the NAPI poll function for the corresponding napi_id.
4. Goto 3, or wait until the watchdog timeout.
The series is outlined as following:
Patch 1-2: Biased busy-polling, and option to set busy-poll budget. Patch 3-6: Busy-poll plumbing for XDP sockets
Patch 7-9: Add busy-polling support to the xdpsock sample
Performance UDP sockets:
I hacked netperf to use non-blocking sockets, and looping over recvfrom(). The following command-line was used:
$ netperf -H 192.168.1.1 -l 30 -t UDP_RR -v 2 -- \
-o min_latency,mean_latency,max_latency,stddev_latency,transaction_rateNon-blocking:
16,18.45,195,0.94,54070.369
Non-blocking with biased busy-polling:
15,16.59,38,0.70,60086.313
Performance XDP sockets:
Today, running XDP sockets sample on the same core as the softirq handling, performance tanks mainly because we do not yield to user-space when the XDP socket Rx queue is full.
# taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r Rx: 64Kpps
# # biased busy-polling, budget 8
# taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r -B -b 8 Rx 9.9Mpps # # biased busy-polling, budget 64 # taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r -B -b 64 Rx: 19.3Mpps # # biased busy-polling, budget 256 # taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r -B -b 256 Rx: 21.4Mpps # # biased busy-polling, budget 512 # taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r -B -b 512 Rx: 21.4Mpps
Compared to the two-core case:
# taskset -c 4 ./xdpsock -i ens785f1 -q 20 -n 1 -r Rx: 20.7Mpps
We're getting better single-core performance than two, for this na?ve drop scenario.
The above tests was done for the 'ice' driver.
Some outstanding questions:
* Does biased busy-polling make sense for non-XDP sockets? For a dedicated queue, biased busy-polling has a strong case. When the NAPI is shared with other sockets, it can affect the latencies of sockets that were not explicity busy-poll enabled. Note that this true for regular busy-polling as well, but the biased version is stricter.
* Currently busy-polling for UDP/TCP is only wired up in the recvmsg() path. Does it make sense to extend that to sendmsg() as well?
* Biased busy-polling only makes sense for non-blocking sockets. Reject enabling of biased busy-polling unless the socket is non-blocking?
* The watchdog is 200 ms. Should it be configurable?
* Extending xdp_rxq_info_reg() with napi_id touches a lot of drivers, and I've only verified the Intel ones. Some drivers initialize NAPI (generating the napi_id) after the xdp_rxq_info_reg() call, which maybe would open up for another API? I did not send this RFC to all the driver authors. I'll do that for a patch proper series.
* Today, enabling busy-polling require CAP_NET_ADMIN. For a NAPI context that services multiple socket, this makes sense because one socket can affect performance of other sockets. Now, for a *dedicated* queue for say XDP socket, would it be OK to drop CAP_NET_ADMIN, because it cannot affect other sockets/users?
@Jakub Thanks for the early comments. I left the check in napi_schedule_prep(), because I hit that for the Intel i40e driver; forcing busy-polling on a core outside the interrupt affinity mask.
[1] https://lore.kernel.org/netdev/20200925120652.10b8d7c5 at kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/
Bj?rn T?pel (9):
net: introduce biased busy-polling
net: add SO_BUSY_POLL_BUDGET socket option
xsk: add support for recvmsg()
xsk: check need wakeup flag in sendmsg()
xsk: add busy-poll support for {recv,send}msg()
xsk: propagate napi_id to XDP socket Rx path samples/bpf: use recvfrom() in xdpsock samples/bpf: add busy-poll support to xdpsock samples/bpf: add option to set the busy-poll budget
arch/alpha/include/uapi/asm/socket.h | 3 + arch/mips/include/uapi/asm/socket.h | 3 + arch/parisc/include/uapi/asm/socket.h | 3 + arch/sparc/include/uapi/asm/socket.h | 3 + drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- .../ethernet/cavium/thunder/nicvf_queues.c | 2 +- .../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_base.c | 4 +- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- drivers/net/ethernet/marvell/mvneta.c | 2 +- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 +- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +- .../ethernet/netronome/nfp/nfp_net_common.c | 2 +- drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +- drivers/net/ethernet/sfc/rx_common.c | 2 +- drivers/net/ethernet/socionext/netsec.c | 2 +- drivers/net/ethernet/ti/cpsw_priv.c | 2 +- drivers/net/hyperv/netvsc.c | 2 +- drivers/net/tun.c | 2 +- drivers/net/veth.c | 2 +- drivers/net/virtio_net.c | 2 +- drivers/net/xen-netfront.c | 2 +- fs/eventpoll.c | 3 +- include/linux/netdevice.h | 33 +++--- include/net/busy_poll.h | 42 +++++-- include/net/sock.h | 4 + include/net/xdp.h | 3 +- include/uapi/asm-generic/socket.h | 3 + net/core/dev.c | 111 +++++++++++++++--- net/core/sock.c | 19 +++ net/core/xdp.c | 3 +- net/xdp/xsk.c | 36 +++++- net/xdp/xsk_buff_pool.c | 13 +- samples/bpf/xdpsock_user.c | 53 +++++++-- 37 files changed, 296 insertions(+), 85 deletions(-)
base-commit: 3cb12d27ff655e57e8efe3486dca2a22f4e30578
Signature · 1 line
2.27.0
RFC PATCH 1/9 net: introduce biased busy-polling
From: Bj?rn T?pel <[email protected]>
This change adds a new NAPI mode, called biased busy-polling, which is an extension to the existing busy-polling mode. The new mode is enabled on the socket layer, where a socket setting this option "promisies" to busy-poll the NAPI context via a system call. When this mode is enabled, the NAPI context will operate in a mode with interrupts disabled. The kernel monitors that the busy-polling promise is fulfilled by an internal watchdog. If the socket fail/stop performing the busy-polling, the mode will be disabled. The watchdog is currently 200 ms.
Biased busy-polling follows the same mechanism as the existing busy-poll; The napi_id is reported to the socket via the skbuff. Later commits will extend napi_id reporting to XDP, in order to work correctly with XDP sockets.
Let us walk through a flow of execution:
1. A socket sets the new SO_BIAS_BUSY_POLL socket option to true. The socket now shows an intent of doing busy-polling. No data has been received to the socket, so the napi_id of the socket is still 0 (non-valid). As usual for busy-polling, the SO_BUSY_POLL option also has to be non-zero for biased busy-polling.
2. Data is received on the socket changing the napi_id to non-zero.
3. The socket does a system call that has the busy-polling logic wired up, e.g. recvfrom() for UDP sockets. The NAPI context is now marked as biased busy-poll. The kernel watchdog is armed. If the NAPI context is already running, it will try to finish as soon as possible and move to busy-polling. If the NAPI context is not running, it will execute the NAPI poll function for the corresponding napi_id.
4. Goto 3, or wait until the watchdog timeout.
Given the nature of busy-polling, this mode only make sense for non-blocking sockets.
When the NAPI context is in biased busy-polling mode, it will not allow a NAPI to be scheduled using the napi_schedule_prep()/napi_scheduleXXX() combo.
--- arch/alpha/include/uapi/asm/socket.h | 2 + arch/mips/include/uapi/asm/socket.h | 2 + arch/parisc/include/uapi/asm/socket.h | 2 + arch/sparc/include/uapi/asm/socket.h | 2 + include/linux/netdevice.h | 33 +++++----- include/net/busy_poll.h | 17 ++++- include/net/sock.h | 3 + include/uapi/asm-generic/socket.h | 2 + net/core/dev.c | 89 +++++++++++++++++++++++++-- net/core/sock.c | 9 +++ 10 files changed, 140 insertions(+), 21 deletions(-)
arch/alpha/include/uapi/asm/socket.h +2 -0
@@ -124,6 +124,8 @@#define SO_DETACH_REUSEPORT_BPF 68 +#define SO_BIAS_BUSY_POLL 69 +#if !defined(__KERNEL__)#if __BITS_PER_LONG ==64
arch/mips/include/uapi/asm/socket.h +2 -0
@@ -135,6 +135,8 @@#define SO_DETACH_REUSEPORT_BPF 68 +#define SO_BIAS_BUSY_POLL 69 +#if !defined(__KERNEL__)#if __BITS_PER_LONG ==64
arch/parisc/include/uapi/asm/socket.h +2 -0
@@ -116,6 +116,8 @@#define SO_DETACH_REUSEPORT_BPF 0x4042 +#define SO_BIAS_BUSY_POLL 0x4043 +#if !defined(__KERNEL__)#if __BITS_PER_LONG ==64
arch/sparc/include/uapi/asm/socket.h +2 -0
@@ -117,6 +117,8 @@#define SO_DETACH_REUSEPORT_BPF 0x0047 +#define SO_BIAS_BUSY_POLL 0x0048 +#if !defined(__KERNEL__)
include/linux/netdevice.h +19 -14
@@ -344,29 +344,32 @@ struct napi_struct {struct list_head rx_list;/* Pending GRO_NORMAL skbs */ int rx_count;/* length of rx_list */ struct hrtimer timer; +struct hrtimer bp_watchdog;struct list_head dev_list;struct hlist_node napi_hash_node;unsigned int napi_id; };enum { -NAPI_STATE_SCHED ,/* Poll is scheduled */ -NAPI_STATE_MISSED ,/* reschedule a napi */ -NAPI_STATE_DISABLE ,/* Disable pending */ -NAPI_STATE_NPSVC ,/* Netpoll - don't dequeue from poll_list */ -NAPI_STATE_LISTED ,/* NAPI added to system lists */ -NAPI_STATE_NO_BUSY_POLL ,/* Do not add in napi_hash, no busy polling */ -NAPI_STATE_IN_BUSY_POLL ,/* sk_busy_loop() owns this NAPI */ +NAPI_STATE_SCHED ,/* Poll is scheduled */ +NAPI_STATE_MISSED ,/* reschedule a napi */ +NAPI_STATE_DISABLE ,/* Disable pending */ +NAPI_STATE_NPSVC ,/* Netpoll - don't dequeue from poll_list */ +NAPI_STATE_LISTED ,/* NAPI added to system lists */ +NAPI_STATE_NO_BUSY_POLL ,/* Do not add in napi_hash, no busy polling */ +NAPI_STATE_IN_BUSY_POLL ,/* sk_busy_loop() owns this NAPI */ +NAPI_STATE_BIAS_BUSY_POLL ,/* biased busy-polling */ };enum { -NAPIF_STATE_SCHED =BIT (NAPI_STATE_SCHED ), -NAPIF_STATE_MISSED =BIT (NAPI_STATE_MISSED ), -NAPIF_STATE_DISABLE =BIT (NAPI_STATE_DISABLE ), -NAPIF_STATE_NPSVC =BIT (NAPI_STATE_NPSVC ), -NAPIF_STATE_LISTED =BIT (NAPI_STATE_LISTED ), -NAPIF_STATE_NO_BUSY_POLL =BIT (NAPI_STATE_NO_BUSY_POLL ), -NAPIF_STATE_IN_BUSY_POLL =BIT (NAPI_STATE_IN_BUSY_POLL ), +NAPIF_STATE_SCHED =BIT (NAPI_STATE_SCHED ), +NAPIF_STATE_MISSED =BIT (NAPI_STATE_MISSED ), +NAPIF_STATE_DISABLE =BIT (NAPI_STATE_DISABLE ), +NAPIF_STATE_NPSVC =BIT (NAPI_STATE_NPSVC ), +NAPIF_STATE_LISTED =BIT (NAPI_STATE_LISTED ), +NAPIF_STATE_NO_BUSY_POLL =BIT (NAPI_STATE_NO_BUSY_POLL ), +NAPIF_STATE_IN_BUSY_POLL =BIT (NAPI_STATE_IN_BUSY_POLL ), +NAPIF_STATE_BIAS_BUSY_POLL =BIT (NAPI_STATE_BIAS_BUSY_POLL ), };enum gro_result {
@@ -555,6 +558,8 @@ static inline bool napi_if_scheduled_mark_missed(struct napi_struct *n)return true; } +void napi_bias_busy_poll (unsigned int napi_id); +enum netdev_queue_state_t { __QUEUE_STATE_DRV_XOFF, __QUEUE_STATE_STACK_XOFF,
include/net/busy_poll.h +16 -1
@@ -23,6 +23,9 @@*/ #define MIN_NAPI_ID ((unsigned int)(NR_CPUS + 1)) +/* Biased busy-poll watchdog timeout in ms */ +#define BIASED_BUSY_POLL_TIMEOUT 200 +#ifdef CONFIG_NET_RX_BUSY_POLL struct napi_struct ;
@@ -99,13 +102,25 @@ static inline bool sk_busy_loop_timeout(struct sock *sk,return true; } +#ifdef CONFIG_NET_RX_BUSY_POLL +static inline void __sk_bias_busy_poll (struct sock *sk,unsigned int napi_id) +{ +if (likely (!READ_ONCE (sk->sk_bias_busy_poll))) +return ; + +napi_bias_busy_poll (napi_id); +} +#endif +static inline void sk_busy_loop (struct sock *sk,int nonblock) {#ifdef CONFIG_NET_RX_BUSY_POLL unsigned int napi_id =READ_ONCE (sk->sk_napi_id); -if (napi_id >=MIN_NAPI_ID ) +if (napi_id >=MIN_NAPI_ID ) { +__sk_bias_busy_poll (sk, napi_id);napi_busy_loop (napi_id, nonblock ?NULL : sk_busy_loop_end, sk); + }#endif }
include/net/sock.h +3 -0
@@ -479,6 +479,9 @@ struct sock {u32 sk_ack_backlog;u32 sk_max_ack_backlog;kuid_t sk_uid; +#ifdef CONFIG_NET_RX_BUSY_POLL +u8 sk_bias_busy_poll; +#endif struct pid *sk_peer_pid;const struct cred *sk_peer_cred;long sk_rcvtimeo;
include/uapi/asm-generic/socket.h +2 -0
@@ -119,6 +119,8 @@#define SO_DETACH_REUSEPORT_BPF 68 +#define SO_BIAS_BUSY_POLL 69 +#if !defined(__KERNEL__)#if __BITS_PER_LONG ==64 || (defined(__x86_64__) && defined(__ILP32__))
net/core/dev.c +83 -6
147 lines not on this page · raw message
net/core/sock.c +9 -0
@@ -1159,6 +1159,12 @@ int sock_setsockopt(struct socket *sock, int level, int optname, sk->sk_ll_usec = val; }break ; +case SO_BIAS_BUSY_POLL : +if (valbool && !capable (CAP_NET_ADMIN )) + ret = -EPERM ; +else + sk->sk_bias_busy_poll = valbool; +break ;#endif case SO_MAX_PACING_RATE :
@@ -1523,6 +1529,9 @@ int sock_getsockopt(struct socket *sock, int level, int optname,case SO_BUSY_POLL : v.val = sk->sk_ll_usec;break ; +case SO_BIAS_BUSY_POLL : + v.val = sk->sk_bias_busy_poll; +break ;#endif case SO_MAX_PACING_RATE :
Signature · 1 line
2.27.0
RFC PATCH 2/9 net: add SO_BUSY_POLL_BUDGET socket option
In reply to Björn TöpelFrom: Bj?rn T?pel <[email protected]>
This option lets a user set a per socket NAPI budget for busy-polling. If the options is not set, it will use the default of 8.
--- arch/alpha/include/uapi/asm/socket.h | 1 + arch/mips/include/uapi/asm/socket.h | 1 + arch/parisc/include/uapi/asm/socket.h | 1 + arch/sparc/include/uapi/asm/socket.h | 1 + fs/eventpoll.c | 3 ++- include/net/busy_poll.h | 6 ++++-- include/net/sock.h | 1 + include/uapi/asm-generic/socket.h | 1 + net/core/dev.c | 20 +++++++++----------- net/core/sock.c | 10 ++++++++++ 10 files changed, 31 insertions(+), 14 deletions(-)
arch/alpha/include/uapi/asm/socket.h +1 -0
@@ -125,6 +125,7 @@#define SO_DETACH_REUSEPORT_BPF 68#define SO_BIAS_BUSY_POLL 69 +#define SO_BUSY_POLL_BUDGET 70#if !defined(__KERNEL__)
arch/mips/include/uapi/asm/socket.h +1 -0
@@ -136,6 +136,7 @@#define SO_DETACH_REUSEPORT_BPF 68#define SO_BIAS_BUSY_POLL 69 +#define SO_BUSY_POLL_BUDGET 70#if !defined(__KERNEL__)
arch/parisc/include/uapi/asm/socket.h +1 -0
@@ -117,6 +117,7 @@#define SO_DETACH_REUSEPORT_BPF 0x4042#define SO_BIAS_BUSY_POLL 0x4043 +#define SO_BUSY_POLL_BUDGET 0x4044#if !defined(__KERNEL__)
arch/sparc/include/uapi/asm/socket.h +1 -0
@@ -118,6 +118,7 @@#define SO_DETACH_REUSEPORT_BPF 0x0047#define SO_BIAS_BUSY_POLL 0x0048 +#define SO_BUSY_POLL_BUDGET 0x0049#if !defined(__KERNEL__)
fs/eventpoll.c +2 -1
@@ -397,7 +397,8 @@ static void ep_busy_loop(struct eventpoll *ep, int nonblock)unsigned int napi_id =READ_ONCE (ep->napi_id);if ((napi_id >=MIN_NAPI_ID ) &&net_busy_loop_on ()) -napi_busy_loop (napi_id, nonblock ?NULL : ep_busy_loop_end, ep); +napi_busy_loop (napi_id, nonblock ?NULL : ep_busy_loop_end, ep, +BUSY_POLL_BUDGET ); }static inline void ep_reset_busy_poll_napi_id (struct eventpoll *ep)
include/net/busy_poll.h +4 -2
@@ -25,6 +25,7 @@/* Biased busy-poll watchdog timeout in ms */ #define BIASED_BUSY_POLL_TIMEOUT 200 +#define BUSY_POLL_BUDGET 8#ifdef CONFIG_NET_RX_BUSY_POLL
@@ -46,7 +47,7 @@ bool sk_busy_loop_end(void *p, unsigned long start_time);void napi_busy_loop (unsigned int napi_id,bool (*loop_end)(void *,unsigned long ), -void *loop_end_arg); +void *loop_end_arg,u16 budget);#else /* CONFIG_NET_RX_BUSY_POLL */ static inline unsigned long net_busy_loop_on (void )
@@ -119,7 +120,8 @@ static inline void sk_busy_loop(struct sock *sk, int nonblock)if (napi_id >=MIN_NAPI_ID ) {__sk_bias_busy_poll (sk, napi_id); -napi_busy_loop (napi_id, nonblock ?NULL : sk_busy_loop_end, sk); +napi_busy_loop (napi_id, nonblock ?NULL : sk_busy_loop_end, sk, + sk->sk_busy_poll_budget ?:BUSY_POLL_BUDGET ); }#endif }
include/net/sock.h +1 -0
@@ -481,6 +481,7 @@ struct sock {kuid_t sk_uid;#ifdef CONFIG_NET_RX_BUSY_POLL u8 sk_bias_busy_poll; +u16 sk_busy_poll_budget;#endif struct pid *sk_peer_pid;const struct cred *sk_peer_cred;
include/uapi/asm-generic/socket.h +1 -0
@@ -120,6 +120,7 @@#define SO_DETACH_REUSEPORT_BPF 68#define SO_BIAS_BUSY_POLL 69 +#define SO_BUSY_POLL_BUDGET 70#if !defined(__KERNEL__)
net/core/dev.c +9 -11
@@ -6496,9 +6496,7 @@ static struct napi_struct *napi_by_id(unsigned int napi_id)#if defined(CONFIG_NET_RX_BUSY_POLL ) -#define BUSY_POLL_BUDGET 8 - -static void busy_poll_stop (struct napi_struct *napi,void *have_poll_lock) +static void busy_poll_stop (struct napi_struct *napi,void *have_poll_lock,u16 budget) {int rc;
@@ -6530,14 +6528,14 @@ static void busy_poll_stop(struct napi_struct *napi, void *have_poll_lock)/* All we really want here is to re-enable device interrupts. * Ideally, a new ndo_busy_poll_stop() could avoid another round. */ - rc = napi->poll (napi,BUSY_POLL_BUDGET ); + rc = napi->poll (napi, budget);/* We can't gro_normal_list() here, because napi->poll() might have * rearmed the napi (napi_complete_done()) in which case it could * already be running on another CPU. */ -trace_napi_poll (napi, rc,BUSY_POLL_BUDGET ); +trace_napi_poll (napi, rc, budget);netpoll_poll_unlock (have_poll_lock); -if (rc ==BUSY_POLL_BUDGET ) { +if (rc == budget) {/* As the whole budget was spent, we still own the napi so can * safely handle the rx_list. */
@@ -6549,7 +6547,7 @@ static void busy_poll_stop(struct napi_struct *napi, void *have_poll_lock)void napi_busy_loop (unsigned int napi_id,bool (*loop_end)(void *,unsigned long ), -void *loop_end_arg) +void *loop_end_arg,u16 budget) {unsigned long start_time = loop_end ?busy_loop_current_time () :0 ;int (*napi_poll)(struct napi_struct *napi,int budget);
@@ -6591,8 +6589,8 @@ void napi_busy_loop(unsigned int napi_id, HRTIMER_MODE_REL_PINNED); } } - work =napi_poll (napi,BUSY_POLL_BUDGET ); -trace_napi_poll (napi, work,BUSY_POLL_BUDGET ); + work =napi_poll (napi, budget); +trace_napi_poll (napi, work, budget);gro_normal_list (napi); count:if (work >0 )
@@ -6605,7 +6603,7 @@ void napi_busy_loop(unsigned int napi_id,if (unlikely (need_resched ())) {if (napi_poll) -busy_poll_stop (napi, have_poll_lock); +busy_poll_stop (napi, have_poll_lock, budget);preempt_enable ();rcu_read_unlock ();cond_resched ();
@@ -6616,7 +6614,7 @@ void napi_busy_loop(unsigned int napi_id,cpu_relax (); }if (napi_poll) -busy_poll_stop (napi, have_poll_lock); +busy_poll_stop (napi, have_poll_lock, budget);preempt_enable (); out:rcu_read_unlock ();
net/core/sock.c +10 -0
@@ -1165,6 +1165,16 @@ int sock_setsockopt(struct socket *sock, int level, int optname, else sk->sk_bias_busy_poll = valbool;break ; +case SO_BUSY_POLL_BUDGET : +if ((val > sk->sk_busy_poll_budget) && !capable (CAP_NET_ADMIN )) + ret = -EPERM ; +else { +if (val <0 ) + ret = -EINVAL ; +else + sk->sk_busy_poll_budget = val; + } +break ;#endif case SO_MAX_PACING_RATE :
Signature · 1 line
2.27.0
RFC PATCH 3/9 xsk: add support for recvmsg()
In reply to Björn TöpelFrom: Bj?rn T?pel <[email protected]>
Add support for non-blocking recvmsg() to XDP sockets. Previously, only sendmsg() was supported by XDP socket. Now, for symmetry and the upcoming busy-polling support, recvmsg() is added.
--- net/xdp/xsk.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
net/xdp/xsk.c +21 -1
@@ -474,6 +474,26 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)return __xsk_sendmsg (sk); } +static int xsk_recvmsg (struct socket *sock,struct msghdr *m,size_t len,int flags) +{ +bool need_wait = !(flags &MSG_DONTWAIT ); +struct sock *sk = sock->sk; +struct xdp_sock *xs =xdp_sk (sk); + +if (unlikely (!(xs->dev->flags &IFF_UP ))) +return -ENETDOWN ; +if (unlikely (!xs->rx)) +return -ENOBUFS ; +if (unlikely (!xsk_is_bound (xs))) +return -ENXIO ; +if (unlikely (need_wait)) +return -EOPNOTSUPP ; + +if (xs->pool->cached_need_wakeup &XDP_WAKEUP_RX && xs->zc) +return xsk_wakeup (xs,XDP_WAKEUP_RX ); +return 0 ; +} +static __poll_t xsk_poll (struct file *file,struct socket *sock,struct poll_table_struct *wait) {
@@ -1134,7 +1154,7 @@ static const struct proto_ops xsk_proto_ops = { .setsockopt = xsk_setsockopt, .getsockopt = xsk_getsockopt, .sendmsg = xsk_sendmsg, - .recvmsg = sock_no_recvmsg, + .recvmsg = xsk_recvmsg, .mmap = xsk_mmap, .sendpage = sock_no_sendpage, };
Signature · 1 line
2.27.0
RFC PATCH 4/9 xsk: check need wakeup flag in sendmsg()
In reply to Björn TöpelFrom: Bj?rn T?pel <[email protected]>
Add a check for need wake up in sendmsg(), so that if a user calls sendmsg() when no wakeup is needed, do not trigger a wakeup.
To simplify the need wakeup check in the syscall, unconditionally enable the need wakeup flag for Tx. This has a side-effect for poll(); If poll() is called for a socket without enabled need wakeup, a Tx wakeup is unconditionally performed.
The wakeup matrix for AF_XDP now looks like:
need wakeup | poll() | sendmsg() | recvmsg()
------------+------------------------+---------------------+---------------------
disabled | wake Tx | wake Tx | nop enabled | check flag; wake Tx/Rx | check flag; wake Tx | check flag; wake Rx
--- net/xdp/xsk.c | 6 +++++- net/xdp/xsk_buff_pool.c | 13 ++++++------- 2 files changed, 11 insertions(+), 8 deletions(-)
net/xdp/xsk.c +5 -1
@@ -465,13 +465,17 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)bool need_wait = !(m->msg_flags &MSG_DONTWAIT );struct sock *sk = sock->sk;struct xdp_sock *xs =xdp_sk (sk); +struct xsk_buff_pool *pool;if (unlikely (!xsk_is_bound (xs)))return -ENXIO ;if (unlikely (need_wait))return -EOPNOTSUPP ; -return __xsk_sendmsg (sk); + pool = xs->pool; +if (pool->cached_need_wakeup &XDP_WAKEUP_TX ) +return __xsk_sendmsg (sk); +return 0 ; }static int xsk_recvmsg (struct socket *sock,struct msghdr *m,size_t len,int flags)
net/xdp/xsk_buff_pool.c +6 -7
@@ -144,14 +144,13 @@ static int __xp_assign_dev(struct xsk_buff_pool *pool,if (err)return err; -if (flags &XDP_USE_NEED_WAKEUP ) { +if (flags &XDP_USE_NEED_WAKEUP ) pool->uses_need_wakeup = true; -/* Tx needs to be explicitly woken up the first time. -* Also for supporting drivers that do not implement this -* feature. They will always have to call sendto(). -*/ - pool->cached_need_wakeup =XDP_WAKEUP_TX ; - } +/* Tx needs to be explicitly woken up the first time. Also +* for supporting drivers that do not implement this +* feature. They will always have to call sendto() or poll(). +*/ + pool->cached_need_wakeup =XDP_WAKEUP_TX ;dev_hold (netdev);
Signature · 1 line
2.27.0
RFC PATCH 5/9 xsk: add busy-poll support for {recv,send}msg()
In reply to Björn TöpelFrom: Bj?rn T?pel <[email protected]>
Wire-up XDP socket busy-poll support for recvmsg() and sendmsg().
--- net/xdp/xsk.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/xdp/xsk.c +7 -0
@@ -23,6 +23,7 @@#include <linux/netdevice.h> #include <linux/rculist.h> #include <net/xdp_sock_drv.h> +#include <net/busy_poll.h> #include <net/xdp.h> #include "xsk_queue.h"
@@ -472,6 +473,9 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)if (unlikely (need_wait))return -EOPNOTSUPP ; +if (sk_can_busy_loop (sk)) +sk_busy_loop (sk,1 );/* only support non-blocking sockets */ + pool = xs->pool;if (pool->cached_need_wakeup &XDP_WAKEUP_TX )return __xsk_sendmsg (sk);
@@ -493,6 +497,9 @@ static int xsk_recvmsg(struct socket *sock, struct msghdr *m, size_t len, int flif (unlikely (need_wait))return -EOPNOTSUPP ; +if (sk_can_busy_loop (sk)) +sk_busy_loop (sk,1 );/* only support non-blocking sockets */ +if (xs->pool->cached_need_wakeup &XDP_WAKEUP_RX && xs->zc)return xsk_wakeup (xs,XDP_WAKEUP_RX );return 0 ;
Signature · 1 line
2.27.0
RFC PATCH 6/9 xsk: propagate napi_id to XDP socket Rx path
In reply to Björn TöpelFrom: Bj?rn T?pel <[email protected]>
Add napi_id to the xdp_rxq_info structure, and make sure the XDP socket pick up the napi_id in the Rx path. The napi_id is used to find the corresponding NAPI structure for socket busy polling.
TODO: Only verified by for the Intel drivers. I'll reach out to the
driver authors for a potential non-RFC version.
--- drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- .../ethernet/cavium/thunder/nicvf_queues.c | 2 +- .../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_base.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- drivers/net/ethernet/marvell/mvneta.c | 2 +- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 ++-- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +- .../ethernet/netronome/nfp/nfp_net_common.c | 2 +- drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +- drivers/net/ethernet/sfc/rx_common.c | 2 +- drivers/net/ethernet/socionext/netsec.c | 2 +- drivers/net/ethernet/ti/cpsw_priv.c | 2 +- drivers/net/hyperv/netvsc.c | 2 +- drivers/net/tun.c | 2 +- drivers/net/veth.c | 2 +- drivers/net/virtio_net.c | 2 +- drivers/net/xen-netfront.c | 2 +- include/net/busy_poll.h | 19 +++++++++++++++---- include/net/xdp.h | 3 ++- net/core/dev.c | 2 +- net/core/xdp.c | 3 ++- net/xdp/xsk.c | 1 + 26 files changed, 44 insertions(+), 30 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +1 -1
@@ -416,7 +416,7 @@ static int ena_xdp_register_rxq_info(struct ena_ring *rx_ring) {int rc; - rc =xdp_rxq_info_reg (&rx_ring->xdp_rxq, rx_ring->netdev, rx_ring->qid); + rc =xdp_rxq_info_reg (&rx_ring->xdp_rxq, rx_ring->netdev, rx_ring->qid,0 );if (rc) { netif_err(rx_ring->adapter, ifup, rx_ring->netdev,
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -1
@@ -2894,7 +2894,7 @@ static int bnxt_alloc_rx_rings(struct bnxt *bp)if (rc)return rc; - rc =xdp_rxq_info_reg (&rxr->xdp_rxq, bp->dev, i); + rc =xdp_rxq_info_reg (&rxr->xdp_rxq, bp->dev, i,0 );if (rc <0 )return rc;
drivers/net/ethernet/cavium/thunder/nicvf_queues.c +1 -1
@@ -770,7 +770,7 @@ static void nicvf_rcv_queue_config(struct nicvf *nic, struct queue_set *qs, rq->caching =1 ;/* Driver have no proper error path for failed XDP RX-queue info reg */ -WARN_ON (xdp_rxq_info_reg (&rq->xdp_rxq, nic->netdev, qidx) <0 ); +WARN_ON (xdp_rxq_info_reg (&rq->xdp_rxq, nic->netdev, qidx,0 ) <0 );/* Send a mailbox msg to PF to config RQ */ mbx.rq.msg =NIC_MBOX_MSG_RQ_CFG ;
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +1 -1
@@ -3334,7 +3334,7 @@ static int dpaa2_eth_setup_rx_flow(struct dpaa2_eth_priv *priv,return 0 ; err =xdp_rxq_info_reg (&fq->channel->xdp_rxq, priv->net_dev, - fq->flowid); + fq->flowid,0 );if (err) {dev_err (dev,"xdp_rxq_info_reg failed\n" );return err;
drivers/net/ethernet/intel/i40e/i40e_txrx.c +1 -1
@@ -1436,7 +1436,7 @@ int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring)/* XDP RX-queue info only needed for RX rings exposed to XDP */ if (rx_ring->vsi->type ==I40E_VSI_MAIN ) { err =xdp_rxq_info_reg (&rx_ring->xdp_rxq, rx_ring->netdev, - rx_ring->queue_index); + rx_ring->queue_index, rx_ring->q_vector->napi.napi_id);if (err <0 )return err; }
drivers/net/ethernet/intel/ice/ice_base.c +2 -2
@@ -306,7 +306,7 @@ int ice_setup_rx_ctx(struct ice_ring *ring)if (!xdp_rxq_info_is_reg (&ring->xdp_rxq))/* coverity[check_return] */ xdp_rxq_info_reg (&ring->xdp_rxq, ring->netdev, - ring->q_index); + ring->q_index, ring->q_vector->napi.napi_id); ring->xsk_pool =ice_xsk_pool (ring);if (ring->xsk_pool) {
@@ -333,7 +333,7 @@ int ice_setup_rx_ctx(struct ice_ring *ring)/* coverity[check_return] */ xdp_rxq_info_reg (&ring->xdp_rxq, ring->netdev, - ring->q_index); + ring->q_index, ring->q_vector->napi.napi_id); err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq, MEM_TYPE_PAGE_SHARED,
drivers/net/ethernet/intel/ice/ice_txrx.c +1 -1
@@ -483,7 +483,7 @@ int ice_setup_rx_ring(struct ice_ring *rx_ring)if (rx_ring->vsi->type ==ICE_VSI_PF && !xdp_rxq_info_is_reg (&rx_ring->xdp_rxq))if (xdp_rxq_info_reg (&rx_ring->xdp_rxq, rx_ring->netdev, - rx_ring->q_index)) + rx_ring->q_index, rx_ring->q_vector->napi.napi_id)) goto err;return 0 ;
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +1 -1
@@ -6577,7 +6577,7 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,/* XDP RX-queue info */ if (xdp_rxq_info_reg (&rx_ring->xdp_rxq, adapter->netdev, - rx_ring->queue_index) <0 ) + rx_ring->queue_index, rx_ring->q_vector->napi.napi_id) <0 ) goto err; rx_ring->xdp_prog = adapter->xdp_prog;
drivers/net/ethernet/marvell/mvneta.c +1 -1
@@ -3219,7 +3219,7 @@ static int mvneta_create_page_pool(struct mvneta_port *pp,return err; } - err =xdp_rxq_info_reg (&rxq->xdp_rxq, pp->dev, rxq->id); + err =xdp_rxq_info_reg (&rxq->xdp_rxq, pp->dev, rxq->id,0 );if (err <0 ) goto err_free_pp;
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +2 -2
@@ -2606,11 +2606,11 @@ static int mvpp2_rxq_init(struct mvpp2_port *port,mvpp2_rxq_status_update (port, rxq->id,0 , rxq->size);if (priv->percpu_pools) { - err =xdp_rxq_info_reg (&rxq->xdp_rxq_short, port->dev, rxq->id); + err =xdp_rxq_info_reg (&rxq->xdp_rxq_short, port->dev, rxq->id,0 );if (err <0 ) goto err_free_dma; - err =xdp_rxq_info_reg (&rxq->xdp_rxq_long, port->dev, rxq->id); + err =xdp_rxq_info_reg (&rxq->xdp_rxq_long, port->dev, rxq->id,0 );if (err <0 ) goto err_unregister_rxq_short;
drivers/net/ethernet/mellanox/mlx4/en_rx.c +1 -1
@@ -283,7 +283,7 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv, ring->log_stride =ffs (ring->stride) -1 ; ring->buf_size = ring->size * ring->stride +TXBB_SIZE ; -if (xdp_rxq_info_reg (&ring->xdp_rxq, priv->dev, queue_index) <0 ) +if (xdp_rxq_info_reg (&ring->xdp_rxq, priv->dev, queue_index,0 ) <0 ) goto err_ring; tmp = size * roundup_pow_of_two(MLX4_EN_MAX_RX_FRAGS *
drivers/net/ethernet/netronome/nfp/nfp_net_common.c +1 -1
@@ -2533,7 +2533,7 @@ nfp_net_rx_ring_alloc(struct nfp_net_dp *dp, struct nfp_net_rx_ring *rx_ring)if (dp->netdev) { err =xdp_rxq_info_reg (&rx_ring->xdp_rxq, dp->netdev, - rx_ring->idx); + rx_ring->idx, rx_ring->r_vec->napi.napi_id);if (err <0 )return err; }
drivers/net/ethernet/qlogic/qede/qede_main.c +1 -1
@@ -1762,7 +1762,7 @@ static void qede_init_fp(struct qede_dev *edev)/* Driver have no error path from here */ WARN_ON (xdp_rxq_info_reg (&fp->rxq->xdp_rxq, edev->ndev, - fp->rxq->rxq_id) <0 ); + fp->rxq->rxq_id. 0) < 0); if (xdp_rxq_info_reg_mem_model(&fp->rxq->xdp_rxq, MEM_TYPE_PAGE_ORDER0,
drivers/net/ethernet/sfc/rx_common.c +1 -1
@@ -262,7 +262,7 @@ void efx_init_rx_queue(struct efx_rx_queue *rx_queue)/* Initialise XDP queue information */ rc =xdp_rxq_info_reg (&rx_queue->xdp_rxq_info, efx->net_dev, - rx_queue->core_index); + rx_queue->core_index,0 );if (rc) { netif_err(efx, rx_err, efx->net_dev,
drivers/net/ethernet/socionext/netsec.c +1 -1
@@ -1304,7 +1304,7 @@ static int netsec_setup_rx_dring(struct netsec_priv *priv) goto err_out; } - err =xdp_rxq_info_reg (&dring->xdp_rxq, priv->ndev,0 ); + err =xdp_rxq_info_reg (&dring->xdp_rxq, priv->ndev,0 ,0 );if (err) goto err_out;
drivers/net/ethernet/ti/cpsw_priv.c +1 -1
@@ -1189,7 +1189,7 @@ static int cpsw_ndev_create_xdp_rxq(struct cpsw_priv *priv, int ch) pool = cpsw->page_pool[ch]; rxq = &priv->xdp_rxq[ch]; - ret =xdp_rxq_info_reg (rxq, priv->ndev, ch); + ret =xdp_rxq_info_reg (rxq, priv->ndev, ch,0 );if (ret)return ret;
drivers/net/hyperv/netvsc.c +1 -1
@@ -1499,7 +1499,7 @@ struct netvsc_device *netvsc_device_add(struct hv_device *device,u64_stats_init (&nvchan->tx_stats.syncp);u64_stats_init (&nvchan->rx_stats.syncp); - ret =xdp_rxq_info_reg (&nvchan->xdp_rxq, ndev, i); + ret =xdp_rxq_info_reg (&nvchan->xdp_rxq, ndev, i,0 );if (ret) {netdev_err (ndev,"xdp_rxq_info_reg fail: %d\n" , ret);
drivers/net/tun.c +1 -1
@@ -791,7 +791,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file, }else {/* Setup XDP RX-queue info, for new tfile getting attached */ err =xdp_rxq_info_reg (&tfile->xdp_rxq, - tun->dev, tfile->queue_index); + tun->dev, tfile->queue_index,0 );if (err <0 ) goto out; err = xdp_rxq_info_reg_mem_model(&tfile->xdp_rxq,
drivers/net/veth.c +1 -1
@@ -926,7 +926,7 @@ static int veth_enable_xdp(struct net_device *dev)for (i =0 ; i < dev->real_num_rx_queues; i++) {struct veth_rq *rq = &priv->rq[i]; - err =xdp_rxq_info_reg (&rq->xdp_rxq, dev, i); + err =xdp_rxq_info_reg (&rq->xdp_rxq, dev, i,0 );if (err <0 ) goto err_rxq_reg;
drivers/net/virtio_net.c +1 -1
@@ -1485,7 +1485,7 @@ static int virtnet_open(struct net_device *dev)if (!try_fill_recv (vi, &vi->rq[i],GFP_KERNEL ))schedule_delayed_work (&vi->refill,0 ); - err =xdp_rxq_info_reg (&vi->rq[i].xdp_rxq, dev, i); + err =xdp_rxq_info_reg (&vi->rq[i].xdp_rxq, dev, i,0 );if (err <0 )return err;
drivers/net/xen-netfront.c +1 -1
@@ -2014,7 +2014,7 @@ static int xennet_create_page_pool(struct netfront_queue *queue) } err =xdp_rxq_info_reg (&queue->xdp_rxq, queue->info->netdev, - queue->id); + queue->id,0 );if (err) {netdev_err (queue->info->netdev,"xdp_rxq_info_reg failed\n" ); goto err_free_pp;
include/net/busy_poll.h +15 -4
@@ -148,14 +148,25 @@ static inline void sk_mark_napi_id(struct sock *sk, const struct sk_buff *skb) sk_rx_queue_set(sk, skb); } -/* variant used for unconnected sockets */ -static inline void sk_mark_napi_id_once (struct sock *sk, -const struct sk_buff *skb) +static inline void __sk_mark_napi_id_once_xdp (struct sock *sk,unsigned int napi_id) {#ifdef CONFIG_NET_RX_BUSY_POLL if (!READ_ONCE (sk->sk_napi_id)) -WRITE_ONCE (sk->sk_napi_id, skb->napi_id); +WRITE_ONCE (sk->sk_napi_id, napi_id);#endif } +/* variant used for unconnected sockets */ +static inline void sk_mark_napi_id_once (struct sock *sk, +const struct sk_buff *skb) +{ +__sk_mark_napi_id_once_xdp (sk, skb->napi_id); +} + +static inline void sk_mark_napi_id_once_xdp (struct sock *sk, +const struct xdp_buff *xdp) +{ +__sk_mark_napi_id_once_xdp (sk, xdp->rxq->napi_id); +} +#endif /* _LINUX_NET_BUSY_POLL_H */
include/net/xdp.h +2 -1
@@ -59,6 +59,7 @@ struct xdp_rxq_info {u32 queue_index;u32 reg_state;struct xdp_mem_info mem; +unsigned int napi_id; }____cacheline_aligned ;/* perf critical, avoid false-sharing */ struct xdp_txq_info {
@@ -211,7 +212,7 @@ static inline void xdp_release_frame(struct xdp_frame *xdpf) }int xdp_rxq_info_reg (struct xdp_rxq_info *xdp_rxq, -struct net_device *dev,u32 queue_index); +struct net_device *dev,u32 queue_index,unsigned int napi_id);void xdp_rxq_info_unreg (struct xdp_rxq_info *xdp_rxq);void xdp_rxq_info_unused (struct xdp_rxq_info *xdp_rxq);bool xdp_rxq_info_is_reg (struct xdp_rxq_info *xdp_rxq);
net/core/dev.c +1 -1
@@ -9834,7 +9834,7 @@ static int netif_alloc_rx_queues(struct net_device *dev) rx[i].dev = dev;/* XDP RX-queue setup */ - err =xdp_rxq_info_reg (&rx[i].xdp_rxq, dev, i); + err =xdp_rxq_info_reg (&rx[i].xdp_rxq, dev, i,0 );if (err <0 ) goto err_rxq_info; }
net/core/xdp.c +2 -1
@@ -158,7 +158,7 @@ static void xdp_rxq_info_init(struct xdp_rxq_info *xdp_rxq)/* Returns 0 on success, negative on failure */ int xdp_rxq_info_reg (struct xdp_rxq_info *xdp_rxq, -struct net_device *dev,u32 queue_index) +struct net_device *dev,u32 queue_index,unsigned int napi_id) {if (xdp_rxq->reg_state ==REG_STATE_UNUSED ) {WARN (1 ,"Driver promised not to register this" );
@@ -179,6 +179,7 @@ int xdp_rxq_info_reg(struct xdp_rxq_info *xdp_rxq,xdp_rxq_info_init (xdp_rxq); xdp_rxq->dev = dev; xdp_rxq->queue_index = queue_index; + xdp_rxq->napi_id = napi_id; xdp_rxq->reg_state =REG_STATE_REGISTERED ;return 0 ;
net/xdp/xsk.c +1 -0
@@ -233,6 +233,7 @@ static int xsk_rcv(struct xdp_sock *xs, struct xdp_buff *xdp,if (xs->dev != xdp->rxq->dev || xs->queue_id != xdp->rxq->queue_index)return -EINVAL ; +sk_mark_napi_id_once_xdp (&xs->sk, xdp); len = xdp->data_end - xdp->data; return xdp->rxq->mem.type == MEM_TYPE_XSK_BUFF_POOL ?
Signature · 1 line
2.27.0
kernel test robot
build botRe: [Intel-wired-lan] [RFC PATCH bpf-next 6/9] xsk: propagate napi_id to XDP socket Rx path
reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install mips cross compiling tool for…
Hi "Björn,
[FYI, it's a private test report for your RFC patch.] [auto build test ERROR on 3cb12d27ff655e57e8efe3486dca2a22f4e30578]
url: https://github.com/0day-ci/linux/commits/Bj-rn-T-pel/Introduce-biased-busy-polling/20201028-213715 base: 3cb12d27ff655e57e8efe3486dca2a22f4e30578 config: mips-randconfig-r016-20201028 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 50dfa19cc799ae7cddd39a95dbfce675a12672ad)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://github.com/0day-ci/linux/commit/1afaaf92cb23b16994ac438c36d00ee0b2f1aa4d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bj-rn-T-pel/Introduce-biased-busy-polling/20201028-213715 git checkout 1afaaf92cb23b16994ac438c36d00ee0b2f1aa4d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
All error/warnings (new ones prefixed by >>):
>> drivers/net/ethernet/intel/igb/igb_main.c:4355:29: error: too few arguments to function call, expected 4, have 3
rx_ring->queue_index) < 0)
^
include/net/xdp.h:214:5: note: 'xdp_rxq_info_reg' declared here
int xdp_rxq_info_reg(struct xdp_rxq_info *xdp_rxq,
^
>> drivers/net/ethernet/intel/igb/igb_main.c:6021:14: warning: division by zero is undefined [-Wdivision-by-zero]
cmd_type |= IGB_SET_FLAG(tx_flags, IGB_TX_FLAGS_VLAN,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6011:26: note: expanded from macro 'IGB_SET_FLAG'
((u32)(_input & _flag) / (_flag / _result)))
^ ~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6025:14: warning: division by zero is undefined [-Wdivision-by-zero]
cmd_type |= IGB_SET_FLAG(tx_flags, IGB_TX_FLAGS_TSO,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6011:26: note: expanded from macro 'IGB_SET_FLAG'
((u32)(_input & _flag) / (_flag / _result)))
^ ~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6029:14: warning: division by zero is undefined [-Wdivision-by-zero]
cmd_type |= IGB_SET_FLAG(tx_flags, IGB_TX_FLAGS_TSTAMP,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6011:26: note: expanded from macro 'IGB_SET_FLAG'
((u32)(_input & _flag) / (_flag / _result)))
^ ~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6033:14: warning: division by zero is undefined [-Wdivision-by-zero]
cmd_type ^= IGB_SET_FLAG(skb->no_fcs, 1, E1000_ADVTXD_DCMD_IFCS);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6011:26: note: expanded from macro 'IGB_SET_FLAG'
((u32)(_input & _flag) / (_flag / _result)))
^ ~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6049:19: warning: division by zero is undefined [-Wdivision-by-zero]
olinfo_status |= IGB_SET_FLAG(tx_flags,
^~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6011:26: note: expanded from macro 'IGB_SET_FLAG'
((u32)(_input & _flag) / (_flag / _result)))
^ ~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6054:19: warning: division by zero is undefined [-Wdivision-by-zero]
olinfo_status |= IGB_SET_FLAG(tx_flags,
^~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igb/igb_main.c:6011:26: note: expanded from macro 'IGB_SET_FLAG'
((u32)(_input & _flag) / (_flag / _result)))
^ ~~~~~~~~~~~~~~~~~6 warnings and 1 error generated.
vim +4355 drivers/net/ethernet/intel/igb/igb_main.c
85b430b47736d1 drivers/net/igb/igb_main.c Alexander Duyck 2009-10-27 4319
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4320 /**
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4321 * igb_setup_rx_resources - allocate Rx resources (Descriptors)
b980ac18c95f32 drivers/net/ethernet/intel/igb/igb_main.c Jeff Kirsher 2013-02-23 4322 * @rx_ring: Rx descriptor ring (for a specific queue) to setup
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4323 *
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4324 * Returns 0 on success, negative on failure
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4325 **/
80785298aa5b6f drivers/net/igb/igb_main.c Alexander Duyck 2009-10-27 4326 int igb_setup_rx_resources(struct igb_ring *rx_ring)
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4327 {
9cbc948b5a20c9 drivers/net/ethernet/intel/igb/igb_main.c Sven Auhagen 2020-09-02 4328 struct igb_adapter *adapter = netdev_priv(rx_ring->netdev);
59d71989352deb drivers/net/igb/igb_main.c Alexander Duyck 2010-04-27 4329 struct device *dev = rx_ring->dev;
f33005a637bffc drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2012-09-13 4330 int size;
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4331
0603464956e863 drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2011-08-26 4332 size = sizeof(struct igb_rx_buffer) * rx_ring->count;
f33005a637bffc drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2012-09-13 4333
d2bead576e67c3 drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2017-02-06 4334 rx_ring->rx_buffer_info = vmalloc(size);
0603464956e863 drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2011-08-26 4335 if (!rx_ring->rx_buffer_info)
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4336 goto err;
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4337
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4338 /* Round up to nearest 4K */
f33005a637bffc drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2012-09-13 4339 rx_ring->size = rx_ring->count * sizeof(union e1000_adv_rx_desc);
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4340 rx_ring->size = ALIGN(rx_ring->size, 4096);
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4341
5536d2102a2d37 drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2012-09-25 4342 rx_ring->desc = dma_alloc_coherent(dev, rx_ring->size,
5536d2102a2d37 drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2012-09-25 4343 &rx_ring->dma, GFP_KERNEL);
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4344 if (!rx_ring->desc)
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4345 goto err;
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4346
cbc8e55f6fdae2 drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2012-09-25 4347 rx_ring->next_to_alloc = 0;
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4348 rx_ring->next_to_clean = 0;
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4349 rx_ring->next_to_use = 0;
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4350
9cbc948b5a20c9 drivers/net/ethernet/intel/igb/igb_main.c Sven Auhagen 2020-09-02 4351 rx_ring->xdp_prog = adapter->xdp_prog;
9cbc948b5a20c9 drivers/net/ethernet/intel/igb/igb_main.c Sven Auhagen 2020-09-02 4352
9cbc948b5a20c9 drivers/net/ethernet/intel/igb/igb_main.c Sven Auhagen 2020-09-02 4353 /* XDP RX-queue info */
9cbc948b5a20c9 drivers/net/ethernet/intel/igb/igb_main.c Sven Auhagen 2020-09-02 4354 if (xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev,
9cbc948b5a20c9 drivers/net/ethernet/intel/igb/igb_main.c Sven Auhagen 2020-09-02 @4355 rx_ring->queue_index) < 0)
9cbc948b5a20c9 drivers/net/ethernet/intel/igb/igb_main.c Sven Auhagen 2020-09-02 4356 goto err;
9cbc948b5a20c9 drivers/net/ethernet/intel/igb/igb_main.c Sven Auhagen 2020-09-02 4357
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4358 return 0;
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4359
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4360 err:
0603464956e863 drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2011-08-26 4361 vfree(rx_ring->rx_buffer_info);
0603464956e863 drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2011-08-26 4362 rx_ring->rx_buffer_info = NULL;
f33005a637bffc drivers/net/ethernet/intel/igb/igb_main.c Alexander Duyck 2012-09-13 4363 dev_err(dev, "Unable to allocate memory for the Rx descriptor ring\n");
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4364 return -ENOMEM;
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4365 }
9d5c824399dea8 drivers/net/igb/igb_main.c Auke Kok 2008-01-24 4366 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botRe: [Intel-wired-lan] [RFC PATCH bpf-next 6/9] xsk: propagate napi_id to XDP socket Rx path
In reply to Björn Töpelreproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install x86_64 cross compiling tool for…
Hi "Björn,
[FYI, it's a private test report for your RFC patch.] [auto build test WARNING on 3cb12d27ff655e57e8efe3486dca2a22f4e30578]
url: https://github.com/0day-ci/linux/commits/Bj-rn-T-pel/Introduce-biased-busy-polling/20201028-213715 base: 3cb12d27ff655e57e8efe3486dca2a22f4e30578 config: x86_64-randconfig-r005-20201028 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 50dfa19cc799ae7cddd39a95dbfce675a12672ad)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/1afaaf92cb23b16994ac438c36d00ee0b2f1aa4d
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bj-rn-T-pel/Introduce-biased-busy-polling/20201028-213715 git checkout 1afaaf92cb23b16994ac438c36d00ee0b2f1aa4d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:3496:29: error: too few arguments to function call, expected 4, have 3
rx_ring->queue_index) < 0)
^
include/net/xdp.h:214:5: note: 'xdp_rxq_info_reg' declared here
int xdp_rxq_info_reg(struct xdp_rxq_info *xdp_rxq,
^
>> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:4529:45: warning: shift count >= width of type [-Wshift-count-overflow]
if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~1 warning and 1 error generated.
vim +4529 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4504
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4505 /**
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4506 * ixgbevf_probe - Device Initialization Routine
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4507 * @pdev: PCI device information struct
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4508 * @ent: entry in ixgbevf_pci_tbl
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4509 *
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4510 * Returns 0 on success, negative on failure
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4511 *
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4512 * ixgbevf_probe initializes an adapter identified by a pci_dev structure.
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4513 * The OS initialization, configuring of the adapter private structure,
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4514 * and a hardware reset occur.
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4515 **/
1dd06ae8db716e drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Greg Kroah-Hartman 2012-12-06 4516 static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4517 {
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4518 struct net_device *netdev;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4519 struct ixgbevf_adapter *adapter = NULL;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4520 struct ixgbe_hw *hw = NULL;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4521 const struct ixgbevf_info *ii = ixgbevf_info_tbl[ent->driver_data];
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4522 int err, pci_using_dac;
0333464f5f7c33 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Emil Tantilov 2014-12-05 4523 bool disable_dev = false;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4524
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4525 err = pci_enable_device(pdev);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4526 if (err)
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4527 return err;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4528
53567aa4e00399 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Russell King 2013-06-10 @4529 if (!dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64))) {
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4530 pci_using_dac = 1;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4531 } else {
53567aa4e00399 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Russell King 2013-06-10 4532 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4533 if (err) {
dec0d8e462322a drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Jeff Kirsher 2015-02-10 4534 dev_err(&pdev->dev, "No usable DMA configuration, aborting\n");
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4535 goto err_dma;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4536 }
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4537 pci_using_dac = 0;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4538 }
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4539
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4540 err = pci_request_regions(pdev, ixgbevf_driver_name);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4541 if (err) {
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4542 dev_err(&pdev->dev, "pci_request_regions failed 0x%x\n", err);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4543 goto err_pci_reg;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4544 }
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4545
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4546 pci_set_master(pdev);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4547
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4548 netdev = alloc_etherdev_mq(sizeof(struct ixgbevf_adapter),
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4549 MAX_TX_QUEUES);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4550 if (!netdev) {
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4551 err = -ENOMEM;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4552 goto err_alloc_etherdev;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4553 }
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4554
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4555 SET_NETDEV_DEV(netdev, &pdev->dev);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4556
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4557 adapter = netdev_priv(netdev);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4558
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4559 adapter->netdev = netdev;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4560 adapter->pdev = pdev;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4561 hw = &adapter->hw;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4562 hw->back = adapter;
b3f4d5990bfc8b drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c stephen hemminger 2012-03-13 4563 adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4564
dec0d8e462322a drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Jeff Kirsher 2015-02-10 4565 /* call save state here in standalone driver because it relies on
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4566 * adapter struct to exist, and needs to call netdev_priv
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4567 */
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4568 pci_save_state(pdev);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4569
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4570 hw->hw_addr = ioremap(pci_resource_start(pdev, 0),
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4571 pci_resource_len(pdev, 0));
dbf8b0d891bd3e drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Mark Rustad 2014-03-04 4572 adapter->io_addr = hw->hw_addr;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4573 if (!hw->hw_addr) {
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4574 err = -EIO;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4575 goto err_ioremap;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4576 }
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4577
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4578 ixgbevf_assign_netdev_ops(netdev);
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4579
dec0d8e462322a drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Jeff Kirsher 2015-02-10 4580 /* Setup HW API */
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4581 memcpy(&hw->mac.ops, ii->mac_ops, sizeof(hw->mac.ops));
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4582 hw->mac.type = ii->mac;
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4583
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4584 memcpy(&hw->mbx.ops, &ixgbevf_mbx_ops,
f416dfc0e07120 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2011-06-08 4585 sizeof(struct ixgbe_mbx_operations));
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4586
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4587 /* setup the private structure */
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4588 err = ixgbevf_sw_init(adapter);
1a0d6ae5795c37 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Danny Kukawka 2012-02-09 4589 if (err)
1a0d6ae5795c37 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Danny Kukawka 2012-02-09 4590 goto err_sw_init;
1a0d6ae5795c37 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Danny Kukawka 2012-02-09 4591
1a0d6ae5795c37 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Danny Kukawka 2012-02-09 4592 /* The HW MAC address was set and/or determined in sw_init */
1a0d6ae5795c37 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Danny Kukawka 2012-02-09 4593 if (!is_valid_ether_addr(netdev->dev_addr)) {
1a0d6ae5795c37 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Danny Kukawka 2012-02-09 4594 pr_err("invalid MAC address\n");
1a0d6ae5795c37 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Danny Kukawka 2012-02-09 4595 err = -EIO;
1a0d6ae5795c37 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Danny Kukawka 2012-02-09 4596 goto err_sw_init;
1a0d6ae5795c37 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Danny Kukawka 2012-02-09 4597 }
92915f71201b43 drivers/net/ixgbevf/ixgbevf_main.c Greg Rose 2010-01-09 4598
471a76ded87d33 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Michał Mirosław 2011-06-08 4599 netdev->hw_features = NETIF_F_SG |
471a76ded87d33 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Michał Mirosław 2011-06-08 4600 NETIF_F_TSO |
471a76ded87d33 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Michał Mirosław 2011-06-08 4601 NETIF_F_TSO6 |
cb2b3edbece804 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Alexander Duyck 2016-01-13 4602 NETIF_F_RXCSUM |
cb2b3edbece804 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Alexander Duyck 2016-01-13 4603 NETIF_F_HW_CSUM |
cb2b3edbece804 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Alexander Duyck 2016-01-13 4604 NETIF_F_SCTP_CRC;471a76ded87d33 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c Michał Mirosław 2011-06-08 4605
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
RFC PATCH 7/9 samples/bpf: use recvfrom() in xdpsock
In reply to Björn TöpelFrom: Bj?rn T?pel <[email protected]>
Start using recvfrom() the rxdrop scenario.
--- samples/bpf/xdpsock_user.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
samples/bpf/xdpsock_user.c +4 -4
@@ -1172,7 +1172,7 @@ static inline void complete_tx_only(struct xsk_socket_info *xsk, } } -static void rx_drop (struct xsk_socket_info *xsk,struct pollfd *fds) +static void rx_drop (struct xsk_socket_info *xsk) {unsigned int rcvd, i;u32 idx_rx =0 , idx_fq =0 ;
@@ -1182,7 +1182,7 @@ static void rx_drop(struct xsk_socket_info *xsk, struct pollfd *fds)if (!rcvd) {if (xsk_ring_prod__needs_wakeup (&xsk->umem->fq)) { xsk->app_stats.rx_empty_polls++; - ret =poll (fds, num_socks, opt_timeout); +recvfrom (xsk_socket__fd (xsk->xsk),NULL ,0 ,MSG_DONTWAIT ,NULL ,NULL ); }return ; }
@@ -1193,7 +1193,7 @@ static void rx_drop(struct xsk_socket_info *xsk, struct pollfd *fds)exit_with_error (-ret);if (xsk_ring_prod__needs_wakeup (&xsk->umem->fq)) { xsk->app_stats.fill_fail_polls++; - ret =poll (fds, num_socks, opt_timeout); +recvfrom (xsk_socket__fd (xsk->xsk),NULL ,0 ,MSG_DONTWAIT ,NULL ,NULL ); } ret =xsk_ring_prod__reserve (&xsk->umem->fq, rcvd, &idx_fq); }
@@ -1235,7 +1235,7 @@ static void rx_drop_all(void) }for (i =0 ; i < num_socks; i++) -rx_drop (xsks[i], fds); +rx_drop (xsks[i]);if (benchmark_done)break ;
Signature · 1 line
2.27.0
RFC PATCH 8/9 samples/bpf: add busy-poll support to xdpsock
In reply to Björn TöpelFrom: Bj?rn T?pel <[email protected]>
Add a new option to xdpsock, 'B', for busy-polling. This option will also set the batching size, 'b' option, to the busy-poll budget.
--- samples/bpf/xdpsock_user.c | 40 +++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-)
samples/bpf/xdpsock_user.c +33 -7
@@ -95,6 +95,7 @@ static int opt_timeout = 1000;static bool opt_need_wakeup = true;static u32 opt_num_xsks =1 ;static u32 prog_id; +static bool opt_busy_poll;struct xsk_ring_stats {unsigned long rx_npkts;
@@ -911,6 +912,7 @@ static struct option long_options[] = { {"quiet", no_argument, 0, 'Q'}, {"app-stats", no_argument, 0, 'a'}, {"irq-string", no_argument, 0, 'I'}, + {"busy-poll", no_argument, 0, 'B'}, {0, 0, 0, 0} };
@@ -949,6 +951,7 @@ static void usage(const char *prog)" -Q, --quiet Do not display any stats.\n" " -a, --app-stats Display application (syscall) statistics.\n" " -I, --irq-string Display driver interrupt statistics for interface associated with irq-string.\n" +" -B, --busy-poll Busy poll.\n" "\n" ; fprintf(stderr, str, prog, XSK_UMEM__DEFAULT_FRAME_SIZE, opt_batch_size, MIN_PKT_SIZE, MIN_PKT_SIZE,
@@ -964,7 +967,7 @@ static void parse_command_line(int argc, char **argv) opterr =0 ;for (;;) { - c =getopt_long (argc, argv,"Frtli:q:pSNn:czf:muMd:b:C:s:P:xQaI:" , + c =getopt_long (argc, argv,"Frtli:q:pSNn:czf:muMd:b:C:s:P:xQaI:B" , long_options, &option_index);if (c ==-1 )break ;
@@ -1062,7 +1065,9 @@ static void parse_command_line(int argc, char **argv)fprintf (stderr,"ERROR: Failed to get irqs for %s\n" , opt_irq_str);usage (basename (argv[0 ])); } - +break ; +case 'B' : + opt_busy_poll =1 ;break ;default :usage (basename (argv[0 ]));
@@ -1132,7 +1137,7 @@ static inline void complete_tx_l2fwd(struct xsk_socket_info *xsk,while (ret != rcvd) {if (ret <0 )exit_with_error (-ret); -if (xsk_ring_prod__needs_wakeup (&umem->fq)) { +if (opt_busy_poll ||xsk_ring_prod__needs_wakeup (&umem->fq)) { xsk->app_stats.fill_fail_polls++; ret =poll (fds, num_socks, opt_timeout); }
@@ -1180,7 +1185,7 @@ static void rx_drop(struct xsk_socket_info *xsk) rcvd =xsk_ring_cons__peek (&xsk->rx, opt_batch_size, &idx_rx);if (!rcvd) { -if (xsk_ring_prod__needs_wakeup (&xsk->umem->fq)) { +if (opt_busy_poll ||xsk_ring_prod__needs_wakeup (&xsk->umem->fq)) { xsk->app_stats.rx_empty_polls++;recvfrom (xsk_socket__fd (xsk->xsk),NULL ,0 ,MSG_DONTWAIT ,NULL ,NULL ); }
@@ -1191,7 +1196,7 @@ static void rx_drop(struct xsk_socket_info *xsk)while (ret != rcvd) {if (ret <0 )exit_with_error (-ret); -if (xsk_ring_prod__needs_wakeup (&xsk->umem->fq)) { +if (opt_busy_poll ||xsk_ring_prod__needs_wakeup (&xsk->umem->fq)) { xsk->app_stats.fill_fail_polls++;recvfrom (xsk_socket__fd (xsk->xsk),NULL ,0 ,MSG_DONTWAIT ,NULL ,NULL ); }
@@ -1342,7 +1347,7 @@ static void l2fwd(struct xsk_socket_info *xsk, struct pollfd *fds) rcvd =xsk_ring_cons__peek (&xsk->rx, opt_batch_size, &idx_rx);if (!rcvd) { -if (xsk_ring_prod__needs_wakeup (&xsk->umem->fq)) { +if (opt_busy_poll ||xsk_ring_prod__needs_wakeup (&xsk->umem->fq)) { xsk->app_stats.rx_empty_polls++; ret =poll (fds, num_socks, opt_timeout); }
@@ -1354,7 +1359,7 @@ static void l2fwd(struct xsk_socket_info *xsk, struct pollfd *fds)if (ret <0 )exit_with_error (-ret);complete_tx_l2fwd (xsk, fds); -if (xsk_ring_prod__needs_wakeup (&xsk->tx)) { +if (opt_busy_poll ||xsk_ring_prod__needs_wakeup (&xsk->tx)) { xsk->app_stats.tx_wakeup_sendtos++;kick_tx (xsk); }
@@ -1461,6 +1466,24 @@ static void enter_xsks_into_map(struct bpf_object *obj) } } +static void apply_setsockopt (struct xsk_socket_info *xsk) +{ +int sock_opt; + +if (!opt_busy_poll) +return ; + + sock_opt =1 ; +if (setsockopt (xsk_socket__fd (xsk->xsk),SOL_SOCKET ,SO_BIAS_BUSY_POLL , + (void *)&sock_opt,sizeof (sock_opt)) <0 ) +exit_with_error (errno); + + sock_opt =20 ;// randomly picked :-P +if (setsockopt (xsk_socket__fd (xsk->xsk),SOL_SOCKET ,SO_BUSY_POLL , + (void *)&sock_opt,sizeof (sock_opt)) <0 ) +exit_with_error (errno); +} +int main (int argc,char **argv) {struct rlimit r = {RLIM_INFINITY ,RLIM_INFINITY };
@@ -1502,6 +1525,9 @@ int main(int argc, char **argv)for (i =0 ; i < opt_num_xsks; i++) xsks[num_socks++] =xsk_configure_socket (umem, rx, tx); +for (i =0 ; i < opt_num_xsks; i++) +apply_setsockopt (xsks[i]); +if (opt_bench ==BENCH_TXONLY ) {gen_eth_hdr_data ();
Signature · 1 line
2.27.0
RFC PATCH 9/9 samples/bpf: add option to set the busy-poll budget
In reply to Björn TöpelFrom: Bj?rn T?pel <[email protected]>
Support for the SO_BUSY_POLL_BUDGET setsockopt, via the batching option ('b').
--- samples/bpf/xdpsock_user.c | 5 +++++ 1 file changed, 5 insertions(+)
samples/bpf/xdpsock_user.c +5 -0
@@ -1482,6 +1482,11 @@ static void apply_setsockopt(struct xsk_socket_info *xsk)if (setsockopt (xsk_socket__fd (xsk->xsk),SOL_SOCKET ,SO_BUSY_POLL , (void *)&sock_opt,sizeof (sock_opt)) <0 )exit_with_error (errno); + + sock_opt = opt_batch_size; +if (setsockopt (xsk_socket__fd (xsk->xsk),SOL_SOCKET ,SO_BUSY_POLL_BUDGET , + (void *)&sock_opt,sizeof (sock_opt)) <0 ) +exit_with_error (errno); }int main (int argc,char **argv)
Signature · 1 line
2.27.0
Quoted 47 lines · Bj?rn T?pel
Jakub suggested in [1] a "strict busy-polling mode with out interrupts". This is a first stab at that.
This series adds a new NAPI mode, called biased busy-polling, which is an extension to the existing busy-polling mode. The new mode is enabled on the socket layer, where a socket setting this option "promisies" to busy-poll the NAPI context via a system call. When this mode is enabled, the NAPI context will operate in a mode with interrupts disabled. The kernel monitors that the busy-polling promise is fulfilled by an internal watchdog. If the socket fail/stop performing the busy-polling, the mode will be disabled.
Biased busy-polling follows the same mechanism as the existing busy-poll; The
napi_idis reported to the socket via the skbuff. Later commits will extendnapi_idreporting to XDP, in order to work correctly with XDP sockets.Let us walk through a flow of execution:
1. A socket sets the new
SO_BIAS_BUSY_POLLsocket option to true. The socket now shows an intent of doing busy-polling. No data has been received to the socket, so thenapi_idof the socket is still 0 (non-valid). As usual for busy-polling, theSO_BUSY_POLLoption also has to be non-zero for biased busy-polling.2. Data is received on the socket changing the
napi_idto non-zero.3. The socket does a system call that has the busy-polling logic wired up, e.g.
recvfrom()for UDP sockets. The NAPI context is now marked as biased busy-poll. The kernel watchdog is armed. If the NAPI context is already running, it will try to finish as soon as possible and move to busy-polling. If the NAPI context is not running, it will execute the NAPI poll function for the correspondingnapi_id.4. Goto 3, or wait until the watchdog timeout.
The series is outlined as following:
Patch 1-2: Biased busy-polling, and option to set busy-poll budget. Patch 3-6: Busy-poll plumbing for XDP sockets
Patch 7-9: Add busy-polling support to the xdpsock samplePerformance UDP sockets:
I hacked netperf to use non-blocking sockets, and looping over
recvfrom(). The following command-line was used:
Quoted 8 lines
$ netperf -H 192.168.1.1 -l 30 -t UDP_RR -v 2 -- \ -o min_latency,mean_latency,max_latency,stddev_latency,transaction_rateNon-blocking:
16,18.45,195,0.94,54070.369
Non-blocking with biased busy-polling:
15,16.59,38,0.70,60086.313
But a fair comparison should be done using current busy-polling mode, which does not require netperf to use non-blocking mode in the first place ?
Would disabling/rearming interrupts about 60,000 times per second bring any benefit ?
Additional questions :
- What happens to the gro_flush_timeout and accumulated TCP segments in GRO engine
while the biased busy-polling is in use ?
- What mechanism would avoid a potential 200 ms latency when the application wants to exit cleanly ?
Presumably when/if SO_BIAS_BUSY_POLL is used to clearsk->sk_bias_busy_poll we need
to make sure device interrupts are re-enabled.
Quoted 120 lines
Performance XDP sockets:
Today, running XDP sockets sample on the same core as the softirq handling, performance tanks mainly because we do not yield to user-space when the XDP socket Rx queue is full.
# taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r Rx: 64Kpps# # biased busy-polling, budget 8
# taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r -B -b 8 Rx 9.9Mpps # # biased busy-polling, budget 64 # taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r -B -b 64 Rx: 19.3Mpps # # biased busy-polling, budget 256 # taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r -B -b 256 Rx: 21.4Mpps # # biased busy-polling, budget 512 # taskset -c 5 ./xdpsock -i ens785f1 -q 5 -n 1 -r -B -b 512 Rx: 21.4MppsCompared to the two-core case:
# taskset -c 4 ./xdpsock -i ens785f1 -q 20 -n 1 -r Rx: 20.7MppsWe're getting better single-core performance than two, for this na?ve drop scenario.
The above tests was done for the 'ice' driver.
Some outstanding questions:
* Does biased busy-polling make sense for non-XDP sockets? For a dedicated queue, biased busy-polling has a strong case. When the NAPI is shared with other sockets, it can affect the latencies of sockets that were not explicity busy-poll enabled. Note that this true for regular busy-polling as well, but the biased version is stricter.
* Currently busy-polling for UDP/TCP is only wired up in the
recvmsg()path. Does it make sense to extend that tosendmsg()as well?* Biased busy-polling only makes sense for non-blocking sockets. Reject enabling of biased busy-polling unless the socket is non-blocking?
* The watchdog is 200 ms. Should it be configurable?
* Extending
xdp_rxq_info_reg()withnapi_idtouches a lot of drivers, and I've only verified the Intel ones. Some drivers initialize NAPI (generating thenapi_id) after thexdp_rxq_info_reg()call, which maybe would open up for another API? I did not send this RFC to all the driver authors. I'll do that for a patch proper series.* Today, enabling busy-polling require
CAP_NET_ADMIN. For a NAPI context that services multiple socket, this makes sense because one socket can affect performance of other sockets. Now, for a *dedicated* queue for say XDP socket, would it be OK to dropCAP_NET_ADMIN, because it cannot affect other sockets/users?@Jakub Thanks for the early comments. I left the check in
napi_schedule_prep(), because I hit that for the Intel i40e driver; forcing busy-polling on a core outside the interrupt affinity mask.[1] https://lore.kernel.org/netdev/20200925120652.10b8d7c5 at kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/
Bj?rn T?pel (9):
net: introduce biased busy-polling
net: addSO_BUSY_POLL_BUDGETsocket option
xsk: add support forrecvmsg()
xsk: check need wakeup flag insendmsg()
xsk: add busy-poll support for {recv,send}msg()
xsk: propagatenapi_idto XDP socket Rx pathsamples/bpf: userecvfrom()in xdpsocksamples/bpf: add busy-poll support to xdpsocksamples/bpf: add option to set the busy-poll budgetarch/alpha/include/uapi/asm/socket.h | 3 + arch/mips/include/uapi/asm/socket.h | 3 + arch/parisc/include/uapi/asm/socket.h | 3 + arch/sparc/include/uapi/asm/socket.h | 3 + drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- .../ethernet/cavium/thunder/nicvf_queues.c | 2 +- .../net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_base.c | 4 +- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- drivers/net/ethernet/marvell/mvneta.c | 2 +- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 +- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +- .../ethernet/netronome/nfp/nfp_net_common.c | 2 +- drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +- drivers/net/ethernet/sfc/rx_common.c | 2 +- drivers/net/ethernet/socionext/netsec.c | 2 +- drivers/net/ethernet/ti/cpsw_priv.c | 2 +- drivers/net/hyperv/netvsc.c | 2 +- drivers/net/tun.c | 2 +- drivers/net/veth.c | 2 +- drivers/net/virtio_net.c | 2 +- drivers/net/xen-netfront.c | 2 +- fs/eventpoll.c | 3 +- include/linux/netdevice.h | 33 +++--- include/net/busy_poll.h | 42 +++++-- include/net/sock.h | 4 + include/net/xdp.h | 3 +- include/uapi/asm-generic/socket.h | 3 + net/core/dev.c | 111 +++++++++++++++--- net/core/sock.c | 19 +++ net/core/xdp.c | 3 +- net/xdp/xsk.c | 36 +++++- net/xdp/xsk_buff_pool.c | 13 +- samples/bpf/xdpsock_user.c | 53 +++++++-- 37 files changed, 296 insertions(+), 85 deletions(-)base-commit:
3cb12d27ff655e57e8efe3486dca2a22f4e30578--
2.27.0
cover Introduce biased busy-polling
Quoted 1 line · Eric Dumazet
On Wed, Oct 28, 2020 at 2:35 PM Bj?rn T?pel <[email protected]> wrote:
[...]
Quoted 7 lines
Quoted 7 lines
Performance UDP sockets:
I hacked netperf to use non-blocking sockets, and looping over
recvfrom(). The following command-line was used:$ netperf -H 192.168.1.1 -l 30 -t UDP_RR -v 2 -- \ -o min_latency,mean_latency,max_latency,stddev_latency,transaction_rate
Quoted 9 lines
Quoted 5 lines
Non-blocking:
16,18.45,195,0.94,54070.369 Non-blocking with biased busy-polling: 15,16.59,38,0.70,60086.313But a fair comparison should be done using current busy-polling mode, which does not require netperf to use non-blocking mode in the first place ?
Yeah, good point! I'll make sure to add that.
One difference between biased/regular is that for elephant flows, regular falls back to softirq processing, where as the biased stay in "busy-polling mode". Further, if the softirq is really busy due to heavy load (traffic) busy-polling will never be entered.
Quoted 3 lines
Would disabling/rearming interrupts about 60,000 times per second bring any benefit ?
Not following, Eric. Wdym?
Quoted 7 lines
Additional questions :
- What happens to the
gro_flush_timeoutand accumulated TCP segments in GRO engine
while the biased busy-polling is in use ?
Quoted 6 lines
- What mechanism would avoid a potential 200 ms latency when the application wants to exit cleanly ?
Presumably when/ifSO_BIAS_BUSY_POLLis used to clearsk->sk_bias_busy_pollwe need
to make sure device interrupts are re-enabled.
Yes, good questions/input. I'll look into the first one. As for the second one; I'd say this should be implemented! Thanks!
Cheers,
Bj?rn