Dima Chumak
a3e5fd9314
net/mlx5e: Fix page reclaim for dead peer hairpin
When adding a hairpin flow, a firmware-side send queue is created for
the peer net device, which claims some host memory pages for its
internal ring buffer. If the peer net device is removed/unbound before
the hairpin flow is deleted, then the send queue is not destroyed which
leads to a stack trace on pci device remove:
[ 748.005230] mlx5_core 0000:08:00.2: wait_func:1094:(pid 12985): MANAGE_PAGES(0x108) timeout. Will cause a leak of a command resource
[ 748.005231] mlx5_core 0000:08:00.2: reclaim_pages:514:(pid 12985): failed reclaiming pages: err -110
[ 748.001835] mlx5_core 0000:08:00.2: mlx5_reclaim_root_pages:653:(pid 12985): failed reclaiming pages (-110) for func id 0x0
[ 748.002171] ------------[ cut here ]------------
[ 748.001177] FW pages counter is 4 after reclaiming all pages
[ 748.001186] WARNING: CPU: 1 PID: 12985 at drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:685 mlx5_reclaim_startup_pages+0x34b/0x460 [mlx5_core] [ +0.002771] Modules linked in: cls_flower mlx5_ib mlx5_core ptp pps_core act_mirred sch_ingress openvswitch nsh xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 br_netfilter rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi rdma_cm ib_umad ib_ipoib iw_cm ib_cm ib_uverbs ib_core overlay fuse [last unloaded: pps_core]
[ 748.007225] CPU: 1 PID: 12985 Comm: tee Not tainted 5.12.0+ #1
[ 748.001376] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
[ 748.002315] RIP: 0010:mlx5_reclaim_startup_pages+0x34b/0x460 [mlx5_core]
[ 748.001679] Code: 28 00 00 00 0f 85 22 01 00 00 48 81 c4 b0 00 00 00 31 c0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 48 c7 c7 40 cc 19 a1 e8 9f 71 0e e2 <0f> 0b e9 30 ff ff ff 48 c7 c7 a0 cc 19 a1 e8 8c 71 0e e2 0f 0b e9
[ 748.003781] RSP: 0018:ffff88815220faf8 EFLAGS: 00010286
[ 748.001149] RAX: 0000000000000000 RBX: ffff8881b4900280 RCX: 0000000000000000
[ 748.001445] RDX: 0000000000000027 RSI: 0000000000000004 RDI: ffffed102a441f51
[ 748.001614] RBP: 00000000000032b9 R08: 0000000000000001 R09: ffffed1054a15ee8
[ 748.001446] R10: ffff8882a50af73b R11: ffffed1054a15ee7 R12: fffffbfff07c1e30
[ 748.001447] R13: dffffc0000000000 R14: ffff8881b492cba8 R15: 0000000000000000
[ 748.001429] FS: 00007f58bd08b580(0000) GS:ffff8882a5080000(0000) knlGS:0000000000000000
[ 748.001695] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 748.001309] CR2: 000055a026351740 CR3: 00000001d3b48006 CR4: 0000000000370ea0
[ 748.001506] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 748.001483] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 748.001654] Call Trace:
[ 748.000576] ? mlx5_satisfy_startup_pages+0x290/0x290 [mlx5_core]
[ 748.001416] ? mlx5_cmd_teardown_hca+0xa2/0xd0 [mlx5_core]
[ 748.001354] ? mlx5_cmd_init_hca+0x280/0x280 [mlx5_core]
[ 748.001203] mlx5_function_teardown+0x30/0x60 [mlx5_core]
[ 748.001275] mlx5_uninit_one+0xa7/0xc0 [mlx5_core]
[ 748.001200] remove_one+0x5f/0xc0 [mlx5_core]
[ 748.001075] pci_device_remove+0x9f/0x1d0
[ 748.000833] device_release_driver_internal+0x1e0/0x490
[ 748.001207] unbind_store+0x19f/0x200
[ 748.000942] ? sysfs_file_ops+0x170/0x170
[ 748.001000] kernfs_fop_write_iter+0x2bc/0x450
[ 748.000970] new_sync_write+0x373/0x610
[ 748.001124] ? new_sync_read+0x600/0x600
[ 748.001057] ? lock_acquire+0x4d6/0x700
[ 748.000908] ? lockdep_hardirqs_on_prepare+0x400/0x400
[ 748.001126] ? fd_install+0x1c9/0x4d0
[ 748.000951] vfs_write+0x4d0/0x800
[ 748.000804] ksys_write+0xf9/0x1d0
[ 748.000868] ? __x64_sys_read+0xb0/0xb0
[ 748.000811] ? filp_open+0x50/0x50
[ 748.000919] ? syscall_enter_from_user_mode+0x1d/0x50
[ 748.001223] do_syscall_64+0x3f/0x80
[ 748.000892] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 748.001026] RIP: 0033:0x7f58bcfb22f7
[ 748.000944] Code: 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
[ 748.003925] RSP: 002b:00007fffd7f2aaa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 748.001732] RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007f58bcfb22f7
[ 748.001426] RDX: 000000000000000d RSI: 00007fffd7f2abc0 RDI: 0000000000000003
[ 748.001746] RBP: 00007fffd7f2abc0 R08: 0000000000000000 R09: 0000000000000001
[ 748.001631] R10: 00000000000001b6 R11: 0000000000000246 R12: 000000000000000d
[ 748.001537] R13: 00005597ac2c24a0 R14: 000000000000000d R15: 00007f58bd084700
[ 748.001564] irq event stamp: 0
[ 748.000787] hardirqs last enabled at (0): [<0000000000000000>] 0x0
[ 748.001399] hardirqs last disabled at (0): [<ffffffff813132cf>] copy_process+0x146f/0x5eb0
[ 748.001854] softirqs last enabled at (0): [<ffffffff8131330e>] copy_process+0x14ae/0x5eb0
[ 748.013431] softirqs last disabled at (0): [<0000000000000000>] 0x0
[ 748.001492] ---[ end trace a6fabd773d1c51ae ]---
Fix by destroying the send queue of a hairpin peer net device that is
being removed/unbound, which returns the allocated ring buffer pages to
the host.
Fixes: 4d8fcf216c ("net/mlx5e: Avoid unbounded peer devices when unpairing TC hairpin rules")
Signed-off-by: Dima Chumak <dchumak@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
2021-06-09 17:20:03 -07:00
..
2021-04-26 16:32:11 -07:00
2021-06-04 07:37:49 -07:00
2021-04-27 14:10:15 -07:00
2021-04-30 13:04:30 -07:00
2021-05-05 12:39:29 -07:00
2020-12-15 16:18:23 -08:00
2021-04-26 12:30:36 -07:00
2021-04-28 15:59:13 -07:00
2021-06-09 17:20:03 -07:00
2021-04-23 09:29:49 +02:00
2021-04-16 20:30:54 +02:00
2021-04-26 18:16:56 +02:00
2021-05-03 23:04:01 +02:00
2021-04-26 03:20:07 +02:00
2021-04-26 18:16:56 +02:00
2021-04-26 18:16:56 +02:00
2021-04-22 02:03:01 +02:00
2021-05-07 14:49:18 -07:00
2021-04-08 13:26:22 -07:00
2021-04-23 13:18:35 +01:00
2021-05-21 06:12:52 -10:00
2021-05-18 17:24:52 +01:00
2021-05-07 11:23:41 -07:00
2021-05-19 15:24:52 +02:00
2021-04-29 11:57:23 -07:00
2021-04-26 17:04:27 +02:00
2021-05-06 19:24:11 -07:00
2021-04-07 11:14:55 +02:00
2021-04-07 16:33:20 +01:00
2021-04-09 14:54:23 -07:00
2021-04-14 16:30:30 +03:00
2019-05-24 17:27:11 +02:00
2021-05-07 00:26:33 -07:00
2021-05-08 21:49:48 -06:00
2021-05-07 00:34:51 -07:00
2021-05-06 19:24:12 -07:00
2021-05-22 15:09:07 -10:00
2021-04-21 22:59:17 -04:00
2021-05-15 08:52:30 -07:00
2021-05-03 11:56:23 +02:00
2021-04-29 11:57:23 -07:00
2021-05-05 11:27:24 -07:00
2021-04-15 17:04:24 +01:00
2020-10-25 14:51:49 -07:00
2021-04-08 16:04:20 -07:00
2021-05-24 12:45:26 -04:00
2021-05-24 12:45:26 -04:00
2021-04-07 11:05:44 -07:00
2021-04-07 16:33:20 +01:00
2021-05-01 10:14:08 -07:00
2021-05-05 11:27:24 -07:00
2021-05-05 11:27:24 -07:00
2021-05-21 06:12:52 -10:00
2021-04-08 16:04:20 -07:00
2021-04-08 16:04:20 -07:00
2021-04-30 11:20:35 -07:00
2021-04-25 05:26:10 +09:00
2021-05-07 00:26:34 -07:00
2021-05-13 11:00:18 -07:00
2021-05-22 15:09:07 -10:00
2021-05-05 22:54:12 +02:00
2021-05-04 11:24:46 -07:00
2021-04-07 19:26:44 +02:00
2021-04-29 11:41:43 -07:00
2021-05-06 19:24:12 -07:00
2021-05-06 19:24:11 -07:00
2021-04-15 22:36:45 -04:00
2020-09-15 13:51:08 +02:00
2021-04-16 17:06:34 +02:00
2021-05-07 00:26:32 -07:00
2021-04-19 13:13:26 -04:00
2021-04-22 08:20:15 +02:00
2021-04-08 12:21:13 +02:00
2018-03-16 19:58:27 +01:00
2021-05-13 20:50:23 +02:00
2020-08-06 16:13:13 +02:00
2021-05-11 08:12:14 -06:00
2021-04-25 05:25:42 +09:00
2017-11-02 11:10:55 +01:00
2018-01-01 12:40:27 -07:00
2021-04-16 16:59:20 -07:00
2021-04-16 00:13:04 -04:00
2021-04-12 15:04:23 +02:00
2021-04-08 19:12:20 +02:00
2017-11-02 11:10:55 +01:00
2021-05-07 00:26:34 -07:00
2021-04-23 10:14:32 +01:00
2021-04-23 10:14:32 +01:00
2021-05-10 16:22:27 +02:00
2021-05-20 07:59:35 -06:00
2021-05-07 00:26:34 -07:00
2021-05-07 00:26:34 -07:00
2021-05-07 00:26:33 -07:00
2021-04-29 21:44:07 +02:00
2021-05-05 11:27:27 -07:00
2021-05-05 11:27:21 -07:00
2021-05-05 11:27:22 -07:00
2021-04-28 17:22:10 -07:00
2021-04-10 21:59:21 +02:00
2021-04-19 12:50:15 +02:00
2021-05-06 19:24:11 -07:00
2021-04-08 16:04:20 -07:00
2021-05-07 00:26:33 -07:00
2021-04-08 19:09:02 +02:00
2021-04-07 11:55:47 +02:00
2021-04-11 19:30:41 -06:00
2021-04-30 11:20:39 -07:00
2021-04-07 10:56:53 +02:00
2021-04-30 11:20:40 -07:00
2021-05-04 08:54:29 -07:00
2021-04-16 17:20:45 +02:00
2021-04-26 15:03:23 -07:00
2021-04-26 10:25:03 -07:00
2021-05-05 12:39:29 -07:00
2021-04-08 14:05:19 +02:00
2021-04-30 11:20:41 -07:00
2021-05-09 00:29:45 +09:00
2017-11-02 11:10:55 +01:00
2020-12-15 16:19:31 +01:00
2021-05-08 10:00:11 -07:00
2021-05-05 22:54:12 +02:00
2021-05-12 12:37:14 -07:00
2021-04-13 09:16:12 -06:00
2021-04-08 16:04:22 -07:00
2020-05-08 00:12:42 +02:00
2021-04-28 12:37:53 -07:00
2021-05-01 18:50:44 -07:00
2021-05-01 18:50:44 -07:00
2021-04-20 16:27:54 -07:00
2021-04-12 10:36:00 -06:00
2021-04-27 14:13:24 -07:00
2021-05-05 11:27:23 -07:00
2021-05-05 11:27:26 -07:00
2021-05-05 11:27:26 -07:00
2021-05-05 11:27:26 -07:00
2021-04-09 18:48:22 +05:30
2021-05-05 11:27:26 -07:00
2021-05-22 15:09:07 -10:00
2021-05-14 19:41:32 -07:00
2021-05-14 19:41:32 -07:00
2020-12-19 11:18:37 -08:00
2021-05-07 00:26:33 -07:00
2021-04-08 16:04:20 -07:00
2020-11-25 15:45:11 +01:00
2021-04-09 14:54:23 -07:00
2018-03-24 11:25:35 -05:00
2021-04-20 14:11:22 +01:00
2021-04-08 22:18:36 -07:00
2021-02-11 13:24:44 -08:00
2021-04-07 14:43:28 -07:00
2021-04-23 10:14:32 +01:00
2021-04-19 15:41:28 -07:00
2021-04-13 10:04:05 -04:00
2021-05-07 11:23:41 -07:00
2021-04-13 09:41:16 -04:00
2021-04-13 10:04:05 -04:00
2020-10-16 11:11:18 -07:00
2021-04-13 14:35:02 -07:00
2021-04-21 10:24:41 -05:00
2021-04-26 08:51:23 -07:00
2019-06-05 17:30:29 +02:00
2021-04-30 11:20:42 -07:00
2021-05-14 19:41:32 -07:00
2021-04-30 11:20:41 -07:00
2021-02-03 19:05:50 +01:00
2017-11-02 11:10:55 +01:00
2021-04-16 11:34:17 -05:00
2021-05-05 13:24:11 -07:00
2021-05-01 10:14:08 -07:00
2021-05-07 00:26:34 -07:00
2021-05-26 13:15:55 -07:00
2021-04-08 19:14:46 +02:00
2021-05-10 19:14:01 +02:00
2021-04-28 15:43:58 -07:00
2021-05-06 19:24:11 -07:00
2019-06-15 12:25:49 +02:00
2021-05-06 19:24:11 -07:00
2021-04-21 12:20:04 -04:00
2021-04-07 16:33:07 +01:00
2021-04-09 14:17:03 +02:00
2021-04-12 14:49:31 +02:00
2021-05-11 09:56:11 +02:00
2021-04-28 12:00:13 -07:00
2021-05-05 13:24:11 -07:00
2019-09-16 11:43:38 -05:00
2021-05-05 11:27:26 -07:00
2021-05-01 18:50:44 -07:00
2021-04-27 15:50:15 -07:00
2019-06-05 17:36:37 +02:00
2021-04-22 12:04:26 +02:00
2021-04-11 16:34:56 -07:00
2021-05-05 11:27:23 -07:00
2021-05-21 06:12:52 -10:00
2021-04-25 18:02:32 -07:00
2021-05-09 13:07:03 -07:00
2021-04-26 13:04:19 -07:00
2020-03-18 09:50:20 +00:00
2021-03-10 15:52:31 +01:00
2018-10-09 11:20:55 +02:00
2021-04-19 16:03:15 +02:00
2021-04-28 12:37:53 -07:00
2021-04-22 15:02:40 -07:00
2021-02-26 09:41:04 -08:00
2018-04-28 15:01:14 -07:00
2021-05-06 19:24:11 -07:00
2021-05-01 18:50:44 -07:00
2021-04-11 19:30:25 -06:00
2021-04-22 13:14:09 +02:00
2021-04-16 21:03:50 +02:00
2021-04-07 16:33:20 +01:00
2021-01-06 16:24:59 -08:00
2017-11-02 11:10:55 +01:00
2021-04-14 16:30:30 +03:00
2020-11-10 20:39:40 -05:00
2021-04-10 10:36:34 +02:00
2021-04-15 10:32:17 +02:00
2021-04-26 22:55:12 +01:00
2021-04-09 16:00:00 +02:00
2021-04-29 11:06:13 -07:00
2021-05-05 11:27:22 -07:00
2021-05-03 04:55:53 -04:00
2021-05-04 04:19:59 -04:00
2021-05-05 11:27:25 -07:00
2021-05-07 00:26:35 -07:00
2021-04-30 11:20:37 -07:00
2021-05-03 04:55:53 -04:00
2021-05-05 22:54:11 +02:00
2021-01-19 10:20:07 -05:00
2020-06-05 16:19:28 -07:00
2021-04-16 15:31:02 -07:00
2021-03-30 13:42:33 -04:00