diff mbox

[v3,3/4] Add RAW_PACKET to verbs attach/detach multicast

Message ID 4CFC92AF.8070009@voltaire.com (mailing list archive)
State New, archived
Headers show

Commit Message

Aleksey Senin Dec. 6, 2010, 7:37 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 611c13c..9e4998c 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -904,7 +904,10 @@  int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid)
 {
 	if (!qp->device->attach_mcast)
 		return -ENOSYS;
-	if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
+	if (qp->qp_type == IB_QPT_RAW_PACKET) {
+		if (gid->global.subnet_prefix & cpu_to_be64(~1ULL))
+			return -EINVAL;
+	} else if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
 		return -EINVAL;
 
 	return qp->device->attach_mcast(qp, gid, lid);
@@ -915,7 +918,10 @@  int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid)
 {
 	if (!qp->device->detach_mcast)
 		return -ENOSYS;
-	if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
+	if (qp->qp_type == IB_QPT_RAW_PACKET) {
+		if (gid->global.subnet_prefix & cpu_to_be64(~1ULL))
+			return -EINVAL;
+	} else if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
 		return -EINVAL;
 
 	return qp->device->detach_mcast(qp, gid, lid);