[ewg] [PATCH v4] IB Core: RAW ETH support
Eli Cohen
eli at dev.mellanox.co.il
Mon Jun 14 01:57:09 PDT 2010
Vlad,
please push to OFED.
On Mon, Jun 14, 2010 at 11:48 AM, Alekseys Senin <alekseys at voltaire.com> wrote:
> 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 0000000..ae43298
> --- /dev/null
> +++ b/kernel_patches/fixes/core_0560_raw_eth_common.patch
> @@ -0,0 +1,63 @@
> + Add new RAW_ETH QP type in order to build RAW Ethernet packets
> + over iWARP and RoCEE.
> +
> +
> +Signed-off-by: Aleksey Senin <alekseys at voltaire.com>
> +---
> + 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 at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg
>
> _______________________________________________
> ewg mailing list
> ewg at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg
>
More information about the ewg
mailing list