aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/multicast.c
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2015-12-23 14:56:57 +0200
committerDoug Ledford <dledford@redhat.com>2015-12-23 10:39:53 -0500
commitbee3c3c91865d520cb692689500df051e4ca3dd6 (patch)
tree2c71f5b0509d57e49f9bbd46c3fc3994c662dd72 /drivers/infiniband/core/multicast.c
parentIB/core: Initialize UD header structure with IP and UDP headers (diff)
downloadlinux-dev-bee3c3c91865d520cb692689500df051e4ca3dd6.tar.xz
linux-dev-bee3c3c91865d520cb692689500df051e4ca3dd6.zip
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.c17
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;