[MLX4] fixed a bug in "livefish" mode. [mlnx: 3091]
[mirror/winof/.git] / hw / mlx4 / kernel_patches / mlx4_0045_qp_flags.patch
1 mlx4: Add creation flags to mlx4 QPs
2
3 The core passes creation flags and mlx4 saves them for later
4 reference.
5
6 rev 2: 
7 changed flags field to int
8 moved setting flags to qp_create_common.
9
10 Signed-off-by: Eli Cohen <eli@mellanox.co.il>
11 Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
12
13 ---
14
15 Index: ofed_kernel/drivers/infiniband/hw/mlx4/mlx4_ib.h
16 ===================================================================
17 --- ofed_kernel.orig/drivers/infiniband/hw/mlx4/mlx4_ib.h       2008-01-23 13:15:31.282457000 +0200
18 +++ ofed_kernel/drivers/infiniband/hw/mlx4/mlx4_ib.h    2008-01-23 15:58:48.546092000 +0200
19 @@ -110,6 +110,10 @@ struct mlx4_ib_wq {
20         unsigned                tail;
21  };
22  
23 +enum qp_flags {
24 +       MLX4_QP_LSO = 1 << 0
25 +};
26 +
27  struct mlx4_ib_qp {
28         struct ib_qp            ibqp;
29         struct mlx4_qp          mqp;
30 @@ -133,6 +137,7 @@ struct mlx4_ib_qp {
31         u8                      resp_depth;
32         u8                      sq_no_prefetch;
33         u8                      state;
34 +       int                     flags;
35  };
36  
37  struct mlx4_ib_srq {
38 Index: ofed_kernel/drivers/infiniband/hw/mlx4/qp.c
39 ===================================================================
40 --- ofed_kernel.orig/drivers/infiniband/hw/mlx4/qp.c    2008-01-23 13:15:31.287456000 +0200
41 +++ ofed_kernel/drivers/infiniband/hw/mlx4/qp.c 2008-01-23 16:00:38.734097000 +0200
42 @@ -238,9 +238,13 @@ static int set_rq_size(struct mlx4_ib_de
43         return 0;
44  }
45  
46 -static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
47 -                             enum ib_qp_type type, struct mlx4_ib_qp *qp)
48 +static int set_kernel_sq_size(struct mlx4_ib_dev *dev,
49 +                             struct ib_qp_init_attr *init_attr,
50 +                             struct mlx4_ib_qp *qp)
51  {
52 +       struct ib_qp_cap *cap = &init_attr->cap;
53 +       enum ib_qp_type type = init_attr->qp_type;
54 +
55         /* Sanity check SQ size before proceeding */
56         if (cap->max_send_wr     > dev->dev->caps.max_wqes  ||
57             cap->max_send_sge    > dev->dev->caps.max_sq_sg ||
58 @@ -328,6 +332,9 @@ static int create_qp_common(struct mlx4_
59         qp->sq.head         = 0;
60         qp->sq.tail         = 0;
61  
62 +       if (init_attr->create_flags & QP_CREATE_LSO)
63 +               qp->flags |= MLX4_QP_LSO;
64 +
65         err = set_rq_size(dev, &init_attr->cap, !!pd->uobject, !!init_attr->srq, qp);
66         if (err)
67                 goto err;
68 @@ -371,7 +378,7 @@ static int create_qp_common(struct mlx4_
69         } else {
70                 qp->sq_no_prefetch = 0;
71  
72 -               err = set_kernel_sq_size(dev, &init_attr->cap, init_attr->qp_type, qp);
73 +               err = set_kernel_sq_size(dev, init_attr, qp);
74                 if (err)
75                         goto err;
76