On Mon, Mar 11, 2019 at 02:40:31PM +0200, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > The sysfs layout is created by CM incorrectly presented RDMA devices > with InfiniBand link layer. Layout of such devices represents device > tree of connections. By moving CM statistics to be under relevant port > of IB device, we will fix the following issues: > * Symlink name - It used device name instead of specific identifier. > * Target location - It was supposed to point to PCI-ID/infiniband_cm/ > instead of PCI-ID/infiniband/ > * Target name - It created extra device file under already existing > device folder, e.g. mlx5_0/mlx5_0 > * Splash during boot with RDMA persistent naming patches. > > [ 21.169052] sysfs: cannot create duplicate filename '/class/infiniband_cm/mlx5_0' > [ 21.169597] CPU: 29 PID: 433 Comm: modprobe Not tainted 5.0.0-rc5+ #178 > [ 21.169957] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS ?-20180724_192412-buildhw-07.phx2.fedoraproject.org-1.fc29 04/01/2014 > [ 21.170569] Call Trace: > [ 21.170703] dump_stack+0xcc/0x180 > [ 21.171224] sysfs_warn_dup.cold.3+0x17/0x2d > [ 21.171510] sysfs_do_create_link_sd.isra.2+0xd0/0xf0 > [ 21.171787] device_add+0x7cb/0x1450 > [ 21.173167] device_create_groups_vargs+0x1ae/0x220 > [ 21.173404] device_create+0x93/0xc0 > [ 21.174348] cm_add_one+0x38f/0xf60 [ib_cm] > [ 21.175841] add_client_context+0x167/0x210 [ib_core] > [ 21.176111] enable_device_and_get+0x230/0x3f0 [ib_core] > [ 21.177994] ib_register_device+0x823/0xbf0 [ib_core] > [ 21.178499] __mlx5_ib_add+0x45/0x150 [mlx5_ib] > [ 21.178754] mlx5_ib_add+0x1b3/0x5e0 [mlx5_ib] > [ 21.179821] mlx5_add_device+0x130/0x3a0 [mlx5_core] > [ 21.180649] mlx5_register_interface+0x1a9/0x270 [mlx5_core] > [ 21.181419] do_one_initcall+0x14f/0x5de > [ 21.185096] do_init_module+0x247/0x7c0 > [ 21.185441] load_module+0x4c2f/0x60d0 > [ 21.190521] entry_SYSCALL_64_after_hwframe+0x49/0xbe > [ 21.190706] RIP: 0033:0x7f4ddc24eefd > [ 21.190848] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa > 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f > 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 5b 7f 0c 00 f7 d8 64 89 01 48 > [ 21.191481] RSP: 002b:00007ffd82110ac8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 > [ 21.191771] RAX: ffffffffffffffda RBX: 0000559aaa577980 RCX: 00007f4ddc24eefd > [ 21.192062] RDX: 0000000000000000 RSI: 0000559aa91a4346 RDI: 0000000000000001 > [ 21.192349] RBP: 0000559aa91a4346 R08: 0000000000000000 R09: 0000000000000000 > [ 21.192627] R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000 > [ 21.192905] R13: 0000559aaa577a00 R14: 0000000000040000 R15: 0000000000000000 > > After this change: > [leonro@server ~]$ ls -al /sys/class/infiniband/ibp0s12f0/ports/1/ > drwxr-xr-x 2 root root 0 Mar 11 11:17 cm_rx_duplicates > drwxr-xr-x 2 root root 0 Mar 11 11:17 cm_rx_msgs > drwxr-xr-x 2 root root 0 Mar 11 11:17 cm_tx_msgs > drwxr-xr-x 2 root root 0 Mar 11 11:17 cm_tx_retries > > Fixes: 110cf374a809 ("infiniband: make cm_device use a struct device and not a kobject.") > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> Applied to for-next Thanks, Jason