From: Wei Lin Guay Date: Wed, 27 Jan 2016 12:18:08 +0000 (+0100) Subject: RDS: add flow control info to rds_info_rdma_connection X-Git-Tag: v4.1.12-92~173^2~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9e6041df15a3d5ede00ef423515ad2bf49329fe2;p=users%2Fjedix%2Flinux-maple.git RDS: add flow control info to rds_info_rdma_connection Added per connection flow_ctl_post_credit and flow_ctl_send_credit to rds-info. These info help in debugging RDS IB flow control. The newly added attributes are placed at the bottom of the data structure to ensure backward compatibility. Orabug: 22306628 Reviewed-by: HÃ¥kon Bugge Reviewed-by: Santosh Shilimkar Signed-off-by: Wei Lin Guay --- diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h index aa796039498d..902894edecc7 100644 --- a/include/uapi/linux/rds.h +++ b/include/uapi/linux/rds.h @@ -244,6 +244,8 @@ struct rds_info_rdma_connection { uint8_t sl; uint32_t cache_allocs; uint32_t frag; + uint16_t flow_ctl_post_credit; + uint16_t flow_ctl_send_credit; }; /* diff --git a/net/rds/ib.c b/net/rds/ib.c index fb05fd99ebd7..fb232b1f49e8 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -394,6 +394,10 @@ static int rds_ib_conn_info_visitor(struct rds_connection *conn, iinfo->max_send_wr = ic->i_send_ring.w_nr; iinfo->max_recv_wr = ic->i_recv_ring.w_nr; iinfo->max_send_sge = rds_ibdev->max_sge; + iinfo->flow_ctl_post_credit = + IB_GET_POST_CREDITS(atomic_read(&ic->i_credits)); + iinfo->flow_ctl_send_credit = + IB_GET_SEND_CREDITS(atomic_read(&ic->i_credits)); rds_ib_get_mr_info(rds_ibdev, iinfo); iinfo->cache_allocs = atomic_read(&ic->i_cache_allocs); }