#!/bin/bash

hca=${dev:="mlx5_0"}
root=/sys/class/infiniband/$hca/mr_cache/
files=$(ls $root | sort -g)
for f in $files; do
    p=$root/$f
    cur=$(cat $p/cur)
    limit=$(cat $p/limit)
    miss=$(cat $p/miss)
    size=$(cat $p/size)
    echo "$f:               $cur    $limit  $miss   $size"
done

