[ewg] New RAW ETH QP type v2 [ PATCH 1/1 ]

Aleksey Senin alekseys at voltaire.com
Wed Jun 9 04:28:49 PDT 2010


Previous v1 missed implementation in verbs.c file.

Add RAW ETH functionality to verbs layer. This QP used for creation RAW Ethernet packets 
over iWARP and RDMAOE protocols.



Signed-off-by: Aleksey Senin <alekseys at voltaire.com>
---
 drivers/infiniband/core/verbs.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 881850e..bb4dcd5 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -382,6 +382,7 @@ static const struct {
 				[IB_QPT_UD]  = (IB_QP_PKEY_INDEX		|
 						IB_QP_PORT			|
 						IB_QP_QKEY),
+				[IB_QPT_RAW_ETH] = IB_QP_PORT,
 				[IB_QPT_UC]  = (IB_QP_PKEY_INDEX		|
 						IB_QP_PORT			|
 						IB_QP_ACCESS_FLAGS),
@@ -1004,7 +1005,11 @@ int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid)
 
 	switch (rdma_node_get_transport(qp->device->node_type)) {
 	case RDMA_TRANSPORT_IB:
-		if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
+		if (qp->qp_type == IB_QPT_RAW_ETH) {
+			/* In raw Etherent mgids the 63 msb's should be 0 */
+			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;
 		break;
 	case RDMA_TRANSPORT_IWARP:
@@ -1023,7 +1028,11 @@ int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid)
 
 	switch (rdma_node_get_transport(qp->device->node_type)) {
 	case RDMA_TRANSPORT_IB:
-		if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
+		if (qp->qp_type == IB_QPT_RAW_ETH) {
+			/* In raw Etherent mgids the 63 msb's should be 0 */
+			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;
 		break;
 	case RDMA_TRANSPORT_IWARP:
-- 
1.6.5.2





More information about the ewg mailing list