Tariq Toukan
21b172ee11
net/xdp: Fix suspicious RCU usage warning
...
Fix the warning below by calling rhashtable_lookup_fast.
Also, make some code movements for better quality and human
readability.
[ 342.450870] WARNING: suspicious RCU usage
[ 342.455856] 4.18.0-rc2+ #17 Tainted: G O
[ 342.462210] -----------------------------
[ 342.467202] ./include/linux/rhashtable.h:481 suspicious rcu_dereference_check() usage!
[ 342.476568]
[ 342.476568] other info that might help us debug this:
[ 342.476568]
[ 342.486978]
[ 342.486978] rcu_scheduler_active = 2, debug_locks = 1
[ 342.495211] 4 locks held by modprobe/3934:
[ 342.500265] #0 : 00000000e23116b2 (mlx5_intf_mutex){+.+.}, at:
mlx5_unregister_interface+0x18/0x90 [mlx5_core]
[ 342.511953] #1 : 00000000ca16db96 (rtnl_mutex){+.+.}, at: unregister_netdev+0xe/0x20
[ 342.521109] #2 : 00000000a46e2c4b (&priv->state_lock){+.+.}, at: mlx5e_close+0x29/0x60
[mlx5_core]
[ 342.531642] #3 : 0000000060c5bde3 (mem_id_lock){+.+.}, at: xdp_rxq_info_unreg+0x93/0x6b0
[ 342.541206]
[ 342.541206] stack backtrace:
[ 342.547075] CPU: 12 PID: 3934 Comm: modprobe Tainted: G O 4.18.0-rc2+ #17
[ 342.556621] Hardware name: Dell Inc. PowerEdge R730/0H21J3, BIOS 1.5.4 10/002/2015
[ 342.565606] Call Trace:
[ 342.568861] dump_stack+0x78/0xb3
[ 342.573086] xdp_rxq_info_unreg+0x3f5/0x6b0
[ 342.578285] ? __call_rcu+0x220/0x300
[ 342.582911] mlx5e_free_rq+0x38/0xc0 [mlx5_core]
[ 342.588602] mlx5e_close_channel+0x20/0x120 [mlx5_core]
[ 342.594976] mlx5e_close_channels+0x26/0x40 [mlx5_core]
[ 342.601345] mlx5e_close_locked+0x44/0x50 [mlx5_core]
[ 342.607519] mlx5e_close+0x42/0x60 [mlx5_core]
[ 342.613005] __dev_close_many+0xb1/0x120
[ 342.617911] dev_close_many+0xa2/0x170
[ 342.622622] rollback_registered_many+0x148/0x460
[ 342.628401] ? __lock_acquire+0x48d/0x11b0
[ 342.633498] ? unregister_netdev+0xe/0x20
[ 342.638495] rollback_registered+0x56/0x90
[ 342.643588] unregister_netdevice_queue+0x7e/0x100
[ 342.649461] unregister_netdev+0x18/0x20
[ 342.654362] mlx5e_remove+0x2a/0x50 [mlx5_core]
[ 342.659944] mlx5_remove_device+0xe5/0x110 [mlx5_core]
[ 342.666208] mlx5_unregister_interface+0x39/0x90 [mlx5_core]
[ 342.673038] cleanup+0x5/0xbfc [mlx5_core]
[ 342.678094] __x64_sys_delete_module+0x16b/0x240
[ 342.683725] ? do_syscall_64+0x1c/0x210
[ 342.688476] do_syscall_64+0x5a/0x210
[ 342.693025] entry_SYSCALL_64_after_hwframe+0x49/0xbe
Fixes: 8d5d88527587 ("xdp: rhashtable with allocator ID to pointer mapping")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-08-16 21:55:21 +02:00
..
2018-07-30 09:10:25 -07:00
2018-04-19 12:58:20 -04:00
2018-07-24 11:36:15 -07:00
2018-08-09 14:25:06 -07:00
2018-07-12 17:37:13 -07:00
2017-11-21 15:57:07 -08:00
2018-03-05 12:52:45 -05:00
2018-08-03 21:12:12 +02:00
2018-07-16 00:12:09 -07:00
2018-05-28 22:59:54 -04:00
2018-03-29 14:10:30 -04:00
2018-07-30 09:44:06 -07:00
2018-08-14 10:11:26 -07:00
2018-08-07 12:22:14 -07:00
2018-08-11 12:37:10 -07:00
2018-07-04 14:44:45 +09:00
2017-11-02 11:10:55 +01:00
2016-05-25 12:35:09 -07:00
2018-01-23 19:43:30 -05:00
2018-08-07 11:02:05 -07:00
2017-08-07 14:16:22 -07:00
2018-05-28 22:59:54 -04:00
2018-07-24 14:10:43 -07:00
2018-07-20 23:44:36 -07:00
2018-05-16 07:24:30 +02:00
2018-08-09 14:25:06 -07:00
2017-11-02 11:10:55 +01:00
2018-05-24 23:01:15 -04:00
2017-07-21 11:14:51 -04:00
2017-11-08 11:13:54 +01:00
2017-12-13 13:18:46 -05:00
2018-07-19 23:23:01 -07:00
2018-07-27 09:33:37 -07:00
2015-11-03 11:08:22 -05:00
2016-12-29 11:38:31 -05:00
2018-07-29 12:57:26 -07:00
2017-03-02 08:42:29 +01:00
2017-06-08 10:53:29 -04:00
2018-08-10 16:12:20 +02:00
2018-08-14 10:01:24 -07:00
2018-08-11 01:58:46 +02:00
2018-08-06 10:42:48 -07:00
2018-02-11 14:34:03 -08:00
2018-04-05 21:36:27 -07:00
2017-11-02 11:10:55 +01:00
2018-08-04 13:05:39 -07:00
2018-08-16 21:55:21 +02:00