RDMA/core: Allow detaching gid attribute netdevice for RoCE
authorParav Pandit <parav@mellanox.com>
Thu, 2 May 2019 07:48:07 +0000 (10:48 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 3 May 2019 14:10:03 +0000 (11:10 -0300)
commit943bd984b108b3bb778790c2da4ae8d186b547e6
treeaad82acd480dd5ede4446830524e0dc0faec1fb0
parent5102eca9039ba1df6d2e8756b0c030676021f56b
RDMA/core: Allow detaching gid attribute netdevice for RoCE

When there is active traffic through a GID, a QP/AH holds reference to
this GID entry. RoCE GID entry holds reference to its attached
netdevice. Due to this when netdevice is deleted by admin user, its
refcount is not dropped.

Therefore, while deleting RoCE GID, wait for all GID attribute's netdev
users to finish accessing netdev in rcu context.  Once all users done
accessing it, release the netdev refcount.

Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cache.c
drivers/infiniband/core/sysfs.c
include/rdma/ib_verbs.h