Revision fe45386a208277cae4648106133c08246eecd012 authored by Maxim Mikityanskiy on 11 June 2020, 10:55:19 UTC, committed by Saeed Mahameed on 22 September 2020, 00:22:21 UTC
Currently, the RQs are temporarily deactivated while hot-replacing the XDP program, and napi_synchronize is used to make sure rq->xdp_prog is not in use. However, napi_synchronize is not ideal: instead of waiting till the end of a NAPI cycle, it polls and waits until NAPI is not running, sleeping for 1ms between the periodic checks. Under heavy workloads, this loop will never end, which may even lead to a kernel panic if the kernel detects the hangup. Such workloads include XSK TX and possibly also heavy RX (XSK or normal). The fix is inspired by commit 326fe02d1ed6 ("net/mlx4_en: protect ring->xdp_prog with rcu_read_lock"). As mlx5e_xdp_handle is already protected by rcu_read_lock, and bpf_prog_put uses call_rcu to free the program, there is no need for additional synchronization if proper RCU functions are used to access the pointer. This patch converts all accesses to rq->xdp_prog to use RCU functions. Fixes: 86994156c736 ("net/mlx5e: XDP fast RX drop bpf programs support") Fixes: db05815b36cb ("net/mlx5e: Add XSK zero-copy support") Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com> Reviewed-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent cefc235
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 75.2 KB |
Makefile | -rw-r--r-- | 1.2 KB |
calibrate.c | -rw-r--r-- | 8.6 KB |
do_mounts.c | -rw-r--r-- | 14.8 KB |
do_mounts.h | -rw-r--r-- | 908 bytes |
do_mounts_initrd.c | -rw-r--r-- | 3.4 KB |
do_mounts_rd.c | -rw-r--r-- | 7.7 KB |
init_task.c | -rw-r--r-- | 6.0 KB |
initramfs.c | -rw-r--r-- | 13.9 KB |
main.c | -rw-r--r-- | 36.9 KB |
noinitramfs.c | -rw-r--r-- | 813 bytes |
version.c | -rw-r--r-- | 1.3 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...