mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
RDMA/core: Assign device ifindex before publishing the device
Even though device->ifindex is assigned before adding the device in the list which is read by netlink flow, it is better to assign rdma device index before publishing the device in the system to users and clients. Signed-off-by: Parav Pandit <[email protected]> Reviewed-by: Daniel Jurgens <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
This commit is contained in:
parent
c715a39541
commit
273993509f
1 changed files with 2 additions and 1 deletions
|
|
@ -525,6 +525,8 @@ int ib_register_device(struct ib_device *device,
|
|||
goto port_cleanup;
|
||||
}
|
||||
|
||||
device->index = __dev_new_index();
|
||||
|
||||
ret = ib_device_register_rdmacg(device);
|
||||
if (ret) {
|
||||
pr_warn("Couldn't register device with rdma cgroup\n");
|
||||
|
|
@ -551,7 +553,6 @@ int ib_register_device(struct ib_device *device,
|
|||
if (!add_client_context(device, client) && client->add)
|
||||
client->add(device);
|
||||
|
||||
device->index = __dev_new_index();
|
||||
down_write(&lists_rwsem);
|
||||
list_add_tail(&device->core_list, &device_list);
|
||||
up_write(&lists_rwsem);
|
||||
|
|
|
|||
Loading…
Reference in a new issue