diff options
author | Moni Shoua <monis@mellanox.com> | 2015-12-23 15:56:57 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-12-23 18:39:53 +0300 |
commit | bee3c3c91865d520cb692689500df051e4ca3dd6 (patch) | |
tree | 2c71f5b0509d57e49f9bbd46c3fc3994c662dd72 /drivers/infiniband/core/multicast.c | |
parent | 25f40220e56b507fce186985c0ed2967b7f04596 (diff) | |
download | linux-bee3c3c91865d520cb692689500df051e4ca3dd6.tar.xz |
IB/cma: Join and leave multicast groups with IGMP
Since RoCEv2 is a protocol over IP header it is required to send IGMP
join and leave requests to the network when joining and leaving
multicast groups.
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/multicast.c')
-rw-r--r-- | drivers/infiniband/core/multicast.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c index 6911ae68e8d8..250937cb9a1a 100644 --- a/drivers/infiniband/core/multicast.c +++ b/drivers/infiniband/core/multicast.c @@ -723,14 +723,27 @@ EXPORT_SYMBOL(ib_sa_get_mcmember_rec); int ib_init_ah_from_mcmember(struct ib_device *device, u8 port_num, struct ib_sa_mcmember_rec *rec, + struct net_device *ndev, + enum ib_gid_type gid_type, struct ib_ah_attr *ah_attr) { int ret; u16 gid_index; u8 p; - ret = ib_find_cached_gid(device, &rec->port_gid, IB_GID_TYPE_IB, - NULL, &p, &gid_index); + if (rdma_protocol_roce(device, port_num)) { + ret = ib_find_cached_gid_by_port(device, &rec->port_gid, + gid_type, port_num, + ndev, + &gid_index); + } else if (rdma_protocol_ib(device, port_num)) { + ret = ib_find_cached_gid(device, &rec->port_gid, + IB_GID_TYPE_IB, NULL, &p, + &gid_index); + } else { + ret = -EINVAL; + } + if (ret) return ret; |