Re: [ewg] [PATCH v3] IB Core: RAW ETH support

2010-06-14 Thread Or Gerlitz
Alekseys Senin wrote:
> + Add new RAW_ETY QP type in order to build RAW Ethernet packets over iWARP 
> and RoCEE.

> +--- a/include/rdma/ib_verbs.h
>  b/include/rdma/ib_verbs.h
> +@@ -571,6 +571,7 @@ enum ib_qp_type {
> + IB_QPT_UD,
> + IB_QPT_XRC,
> + IB_QPT_RAW_IPV6,
> ++IB_QPT_RAW_ETH,
> + IB_QPT_RAW_ETY

I got confused here, the change log say you add RAW_ETY wheres the patch adds 
RAW_ETH, which is correct? can you please fix that.

Or.
___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg


[ewg] [PATCH v3] IB Core: RAW ETH support

2010-06-14 Thread Alekseys Senin
This patch adds support to RAW ETH QP in ib core.

diff --git a/kernel_patches/fixes/core_0560_raw_eth_common.patch 
b/kernel_patches/fixes/core_0560_raw_eth_common.patch
new file mode 100644
index 000..ae43298
--- /dev/null
+++ b/kernel_patches/fixes/core_0560_raw_eth_common.patch
@@ -0,0 +1,63 @@
+ Add new RAW_ETY QP type in order to build RAW Ethernet packets
+ over iWARP and RoCEE.
+
+
+Signed-off-by: Aleksey Senin 
+---
+ drivers/infiniband/core/verbs.c |   13 +++--
+ include/rdma/ib_verbs.h |1 +
+ 2 files changed, 12 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:
+diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
+index 3a5a40f..2162253 100644
+--- a/include/rdma/ib_verbs.h
 b/include/rdma/ib_verbs.h
+@@ -571,6 +571,7 @@ enum ib_qp_type {
+   IB_QPT_UD,
+   IB_QPT_XRC,
+   IB_QPT_RAW_IPV6,
++  IB_QPT_RAW_ETH,
+   IB_QPT_RAW_ETY
+ };
+ 
+-- 
+1.6.5.2
+


___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg