Skip to content

Commit fe3475a

Browse files
Zhu Yanjundavem330
authored andcommitted
net: rds: add per rds connection cache statistics
The variable cache_allocs is to indicate how many frags (KiB) are in one rds connection frag cache. The command "rds-info -Iv" will output the rds connection cache statistics as below: " RDS IB Connections: LocalAddr RemoteAddr Tos SL LocalDev RemoteDev 1.1.1.14 1.1.1.14 58 255 fe80::2:c903:a:7a31 fe80::2:c903:a:7a31 send_wr=256, recv_wr=1024, send_sge=8, rdma_mr_max=4096, rdma_mr_size=257, cache_allocs=12 " This means that there are about 12KiB frag in this rds connection frag cache. Since rds.h in rds-tools is not related with the kernel rds.h, the change in kernel rds.h does not affect rds-tools. rds-info in rds-tools 2.0.5 and 2.0.6 is tested with this commit. It works well. Signed-off-by: Zhu Yanjun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dceebd4 commit fe3475a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/uapi/linux/rds.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ struct rds_info_rdma_connection {
250250
__u32 rdma_mr_max;
251251
__u32 rdma_mr_size;
252252
__u8 tos;
253+
__u32 cache_allocs;
253254
};
254255

255256
struct rds6_info_rdma_connection {
@@ -264,6 +265,7 @@ struct rds6_info_rdma_connection {
264265
__u32 rdma_mr_max;
265266
__u32 rdma_mr_size;
266267
__u8 tos;
268+
__u32 cache_allocs;
267269
};
268270

269271
/* RDS message Receive Path Latency points */

net/rds/ib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ static int rds_ib_conn_info_visitor(struct rds_connection *conn,
318318
iinfo->max_recv_wr = ic->i_recv_ring.w_nr;
319319
iinfo->max_send_sge = rds_ibdev->max_sge;
320320
rds_ib_get_mr_info(rds_ibdev, iinfo);
321+
iinfo->cache_allocs = atomic_read(&ic->i_cache_allocs);
321322
}
322323
return 1;
323324
}
@@ -351,6 +352,7 @@ static int rds6_ib_conn_info_visitor(struct rds_connection *conn,
351352
iinfo6->max_recv_wr = ic->i_recv_ring.w_nr;
352353
iinfo6->max_send_sge = rds_ibdev->max_sge;
353354
rds6_ib_get_mr_info(rds_ibdev, iinfo6);
355+
iinfo6->cache_allocs = atomic_read(&ic->i_cache_allocs);
354356
}
355357
return 1;
356358
}

0 commit comments

Comments
 (0)