From: Leon Romanovsky <leonro@xxxxxxxxxxxx> >From Parav, Currently RoCE address and route resolution occurs from 2 different code flow. One is triggered through rdmacm which provides a stable net ns of the originator rdma_cm id. In another path, incoming CM requests in wq context triggers resolving/validating route and destination addresses. In this code flow, consider the net namespace of the netdevice of the GID attribute for which the CM request is received. Given that netdev fields can change while moving netdevice to different net namespace, perform source address resolution under rcu lock so that address resolve functionality is in sync with synchronize_rcu() of net/core/dev.c. This series refactors route resolution for RoCE followed by providing a RCU safe API to access the GID attribute and it finally makes use of it. Thanks Parav Pandit (11): RDMA/core Introduce and use rdma_find_ndev_for_src_ip_rcu RDMA/core: Avoid unnecessary sa_family overwrite RDMA/core: Let protocol specific function typecast sockaddr structure RDMA/core: Introduce and use rdma_set_src_addr() between IPv4 and IPv6 RDMA/core: Rename rdma_copy_addr to rdma_copy_src_l2_addr RDMA/core: Use common code flow for IPv4/6 for addr resolve RDMA/core: Refer to network type instead of device type RDMA/core: Protect against changing dst->dev during destination resolve IB/core: Simplify roce_resolve_route_from_path() IB/core: Introduce rdma_read_gid_attr_ndev_rcu() to check GID attribute RDMA/core: Consider net ns of gid attribute for RoCE drivers/infiniband/core/addr.c | 390 ++++++++++++++++++++++-------------- drivers/infiniband/core/cache.c | 33 +++ drivers/infiniband/core/cma.c | 11 +- drivers/infiniband/core/core_priv.h | 9 +- drivers/infiniband/core/sa_query.c | 40 ---- drivers/infiniband/core/verbs.c | 2 +- include/rdma/ib_addr.h | 7 +- 7 files changed, 295 insertions(+), 197 deletions(-) -- 2.14.4