From patchwork Sun Jul 4 14:13:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Senin X-Patchwork-Id: 110155 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o64EC5QV010299 for ; Sun, 4 Jul 2010 14:13:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757395Ab0GDONs (ORCPT ); Sun, 4 Jul 2010 10:13:48 -0400 Received: from fwil.voltaire.com ([193.47.165.2]:32865 "EHLO exil.voltaire.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756883Ab0GDONs (ORCPT ); Sun, 4 Jul 2010 10:13:48 -0400 Received: from [172.25.5.76] ([172.25.5.76]) by exil.voltaire.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 4 Jul 2010 17:13:45 +0300 Message-ID: <4C309718.40100@senin.name> Date: Sun, 04 Jul 2010 17:13:44 +0300 From: Aleksey Senin User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Aleksey Senin CC: linux-rdma@vger.kernel.org, Roland Dreier , Moni Shoua , Or Gerlitz , Yiftah Shahar , Alex Rosenbaum , "Walukiewicz, Miroslaw" Subject: [PATCH V1 4/4] Add RAW_PACKET to ib_attach/detach mcast calls References: <4C308E07.7050903@senin.name> <4C3092ED.6000701@senin.name> <4C3095CB.2000205@senin.name> <4C3096B0.5030005@senin.name> In-Reply-To: <4C3096B0.5030005@senin.name> X-OriginalArrivalTime: 04 Jul 2010 14:13:45.0023 (UTC) FILETIME=[1CEE34F0:01CB1B83] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 04 Jul 2010 14:13:49 +0000 (UTC) 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);