diff options
author | Mark Bloch <markb@mellanox.com> | 2016-06-17 15:10:55 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-06-23 11:39:14 -0400 |
commit | 0837e86a7a3422b85aa45c6f4631f6a3f74cbd01 (patch) | |
tree | cf520ecef75e917f6d7ddcca2598aa6de1c8c223 /drivers/infiniband/hw/mlx5/qp.c | |
parent | af1ba291c5e498973cc325c501dd8da80b234571 (diff) | |
download | linux-0837e86a7a3422b85aa45c6f4631f6a3f74cbd01.tar.gz linux-0837e86a7a3422b85aa45c6f4631f6a3f74cbd01.tar.bz2 linux-0837e86a7a3422b85aa45c6f4631f6a3f74cbd01.zip |
IB/mlx5: Add per port counters
In order to support statistics for ports, we attach
each QP to a counter set which is dedicate to this port.
Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/qp.c')
-rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 9004905d3d93..5ca14a22868f 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -2651,6 +2651,15 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp, else sqd_event = 0; + if (cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) { + u8 port_num = (attr_mask & IB_QP_PORT ? attr->port_num : + qp->port) - 1; + struct mlx5_ib_port *mibport = &dev->port[port_num]; + + context->qp_counter_set_usr_page |= + cpu_to_be32(mibport->q_cnt_id << 16); + } + if (!ibqp->uobject && cur_state == IB_QPS_RESET && new_state == IB_QPS_INIT) context->sq_crq_size |= cpu_to_be16(1 << 4); |