All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksey Senin <alex-192fA4vuk7xBDLzU/O5InQ@public.gmane.org>
To: Aleksey Senin <alex-192fA4vuk7xBDLzU/O5InQ@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	Moni Shoua <monis-hKgKHo2Ms0F+cjeuK/JdrQ@public.gmane.org>,
	Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org>,
	Yiftah Shahar <yiftahs-smomgflXvOZWk0Htik3J/w@public.gmane.org>,
	Alex Rosenbaum <Alexr-smomgflXvOZWk0Htik3J/w@public.gmane.org>,
	"Walukiewicz,
	Miroslaw"
	<Miroslaw.Walukiewicz-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH V1 4/4] Add RAW_PACKET to ib_attach/detach mcast calls
Date: Sun, 04 Jul 2010 17:13:44 +0300	[thread overview]
Message-ID: <4C309718.40100@senin.name> (raw)
In-Reply-To: <4C3096B0.5030005-192fA4vuk7xBDLzU/O5InQ@public.gmane.org>

Added RAW_PACKET to ib_attach/detach calls

Add iWARP transport to attach/detach mcast.
Differentiate between transport types when dealing with multicast.

Signed-off-by: Aleksey Senin <alekseys-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/core/verbs.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index b04b419..a053c0e 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -903,9 +903,17 @@ 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)
-		return -EINVAL;
 
+	switch (rdma_node_get_transport(qp->device->node_type)) {
+	case RDMA_TRANSPORT_IB:
+		if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
+			return -EINVAL;
+		break;
+	case RDMA_TRANSPORT_IWARP:
+		if (qp->qp_type != IB_QPT_RAW_PACKET)
+			return -EINVAL;
+		break;
+	}
 	return qp->device->attach_mcast(qp, gid, lid);
 }
 EXPORT_SYMBOL(ib_attach_mcast);
@@ -914,9 +922,17 @@ 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)
-		return -EINVAL;
 
+	switch (rdma_node_get_transport(qp->device->node_type)) {
+	case RDMA_TRANSPORT_IB:
+		if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
+			return -EINVAL;
+		break;
+	case RDMA_TRANSPORT_IWARP:
+		if (qp->qp_type != IB_QPT_RAW_PACKET)
+			return -EINVAL;
+		break;
+	}
 	return qp->device->detach_mcast(qp, gid, lid);
 }
 EXPORT_SYMBOL(ib_detach_mcast);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-07-04 14:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-04 13:35 [PATCH V1 0/4] New RAW_PACKET QP type Aleksey Senin
     [not found] ` <4C308E07.7050903-192fA4vuk7xBDLzU/O5InQ@public.gmane.org>
2010-07-04 13:55   ` [PATCH V1 1/4] Rename RAW_ETY to RAW_ETHERTYPE Aleksey Senin
     [not found]     ` <4C3092ED.6000701-192fA4vuk7xBDLzU/O5InQ@public.gmane.org>
2010-07-04 14:08       ` [PATCH V1 2/4] New RAW_PACKET QP type definition Aleksey Senin
     [not found]         ` <4C3095CB.2000205-192fA4vuk7xBDLzU/O5InQ@public.gmane.org>
2010-07-04 14:12           ` [PATCH V1 3/4] Security check on QP type Aleksey Senin
     [not found]             ` <4C3096B0.5030005-192fA4vuk7xBDLzU/O5InQ@public.gmane.org>
2010-07-04 14:13               ` Aleksey Senin [this message]
2010-07-05 13:53           ` [PATCH V1 2/4] New RAW_PACKET QP type definition Steve Wise
     [not found]             ` <4C31E3E4.8020508-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2010-07-05 14:47               ` Aleksey Senin
2010-07-06  6:13               ` Or Gerlitz
2010-08-04 17:44       ` [PATCH V1 1/4] Rename RAW_ETY to RAW_ETHERTYPE Roland Dreier
     [not found]         ` <adaiq3q8e7h.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
2011-01-21 17:12           ` Steve Wise

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C309718.40100@senin.name \
    --to=alex-192fa4vuk7xbdlzu/o5inq@public.gmane.org \
    --cc=Alexr-smomgflXvOZWk0Htik3J/w@public.gmane.org \
    --cc=Miroslaw.Walukiewicz-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=monis-hKgKHo2Ms0F+cjeuK/JdrQ@public.gmane.org \
    --cc=ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org \
    --cc=rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=yiftahs-smomgflXvOZWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.