aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/qp.c
diff options
context:
space:
mode:
authorRon Livne <ronli@voltaire.com>2008-07-15 02:48:48 -0400
committerRoland Dreier <rolandd@cisco.com>2008-07-15 02:48:48 -0400
commit521e575b9a7324a0bca762622139f69582a042bf (patch)
tree5962695835c6d11b424d76c64421ebd436b52a34 /drivers/infiniband/hw/mlx4/qp.c
parent47ee1b9f2e7bf73950602efe0b74fa1a8481f222 (diff)
IB/mlx4: Add support for blocking multicast loopback packets
Add support for handling the IB_QP_CREATE_MULTICAST_BLOCK_LOOPBACK flag by using the per-multicast group loopback blocking feature of mlx4 hardware. Signed-off-by: Ron Livne <ronli@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/qp.c')
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 44bbd6c2e315..91590e7fba0c 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -511,6 +511,9 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
511 } else { 511 } else {
512 qp->sq_no_prefetch = 0; 512 qp->sq_no_prefetch = 0;
513 513
514 if (init_attr->create_flags & IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK)
515 qp->flags |= MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK;
516
514 if (init_attr->create_flags & IB_QP_CREATE_IPOIB_UD_LSO) 517 if (init_attr->create_flags & IB_QP_CREATE_IPOIB_UD_LSO)
515 qp->flags |= MLX4_IB_QP_LSO; 518 qp->flags |= MLX4_IB_QP_LSO;
516 519
@@ -684,10 +687,15 @@ struct ib_qp *mlx4_ib_create_qp(struct ib_pd *pd,
684 struct mlx4_ib_qp *qp; 687 struct mlx4_ib_qp *qp;
685 int err; 688 int err;
686 689
687 /* We only support LSO, and only for kernel UD QPs. */ 690 /*
688 if (init_attr->create_flags & ~IB_QP_CREATE_IPOIB_UD_LSO) 691 * We only support LSO and multicast loopback blocking, and
692 * only for kernel UD QPs.
693 */
694 if (init_attr->create_flags & ~(IB_QP_CREATE_IPOIB_UD_LSO |
695 IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK))
689 return ERR_PTR(-EINVAL); 696 return ERR_PTR(-EINVAL);
690 if (init_attr->create_flags & IB_QP_CREATE_IPOIB_UD_LSO && 697
698 if (init_attr->create_flags &&
691 (pd->uobject || init_attr->qp_type != IB_QPT_UD)) 699 (pd->uobject || init_attr->qp_type != IB_QPT_UD))
692 return ERR_PTR(-EINVAL); 700 return ERR_PTR(-EINVAL);
693 701
@@ -1844,6 +1852,13 @@ done:
1844 1852
1845 qp_init_attr->cap = qp_attr->cap; 1853 qp_init_attr->cap = qp_attr->cap;
1846 1854
1855 qp_init_attr->create_flags = 0;
1856 if (qp->flags & MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK)
1857 qp_init_attr->create_flags |= IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK;
1858
1859 if (qp->flags & MLX4_IB_QP_LSO)
1860 qp_init_attr->create_flags |= IB_QP_CREATE_IPOIB_UD_LSO;
1861
1847out: 1862out:
1848 mutex_unlock(&qp->mutex); 1863 mutex_unlock(&qp->mutex);
1849 return err; 1864 return err;