diff options
-rw-r--r-- | drivers/infiniband/hw/cxgb4/provider.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index 81e127713675..f66dd8bf5128 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c | |||
@@ -391,7 +391,17 @@ static ssize_t show_board(struct device *dev, struct device_attribute *attr, | |||
391 | static int c4iw_get_mib(struct ib_device *ibdev, | 391 | static int c4iw_get_mib(struct ib_device *ibdev, |
392 | union rdma_protocol_stats *stats) | 392 | union rdma_protocol_stats *stats) |
393 | { | 393 | { |
394 | return -ENOSYS; | 394 | struct tp_tcp_stats v4, v6; |
395 | struct c4iw_dev *c4iw_dev = to_c4iw_dev(ibdev); | ||
396 | |||
397 | cxgb4_get_tcp_stats(c4iw_dev->rdev.lldi.pdev, &v4, &v6); | ||
398 | memset(stats, 0, sizeof *stats); | ||
399 | stats->iw.tcpInSegs = v4.tcpInSegs + v6.tcpInSegs; | ||
400 | stats->iw.tcpOutSegs = v4.tcpOutSegs + v6.tcpOutSegs; | ||
401 | stats->iw.tcpRetransSegs = v4.tcpRetransSegs + v6.tcpRetransSegs; | ||
402 | stats->iw.tcpOutRsts = v4.tcpOutRsts + v6.tcpOutSegs; | ||
403 | |||
404 | return 0; | ||
395 | } | 405 | } |
396 | 406 | ||
397 | static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); | 407 | static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); |