diff options
author | Eran Ben Elisha <eranbe@mellanox.com> | 2015-10-15 14:44:40 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-10-21 23:16:47 -0400 |
commit | 3ba8e31d5a4343fa042c976a9ce9c3c16946c92d (patch) | |
tree | 7dda8d7b6ad7e20701a4f49aa2d9cd25daacde1c /drivers/infiniband/hw/mlx4/qp.c | |
parent | 74194fb9c80cedb3130d26802c52deec3caebc75 (diff) | |
download | op-kernel-dev-3ba8e31d5a4343fa042c976a9ce9c3c16946c92d.zip op-kernel-dev-3ba8e31d5a4343fa042c976a9ce9c3c16946c92d.tar.gz |
IB/mlx4: Add IB counters table
This is an infrastructure step for allocating and attaching more than
one counter to QPs on the same port. Allocate a counters table and
manage the insertion and removals of the counters in load and unload of
mlx4 IB.
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/qp.c')
-rw-r--r-- | drivers/infiniband/hw/mlx4/qp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 4ad9be3..382913e 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -1460,6 +1460,7 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, int sqd_event; int steer_qp = 0; int err = -EINVAL; + int counter_index; /* APM is not supported under RoCE */ if (attr_mask & IB_QP_ALT_PATH && @@ -1543,9 +1544,10 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp, } if (cur_state == IB_QPS_INIT && new_state == IB_QPS_RTR) { - if (dev->counters[qp->port - 1].index != -1) { - context->pri_path.counter_index = - dev->counters[qp->port - 1].index; + counter_index = + dev->counters_table[qp->port - 1].default_counter; + if (counter_index != -1) { + context->pri_path.counter_index = counter_index; optpar |= MLX4_QP_OPTPAR_COUNTER_INDEX; } else context->pri_path.counter_index = |