Last active
September 10, 2019 19:24
-
-
Save crazyboycjr/8954822efb0d41d7cacee1e350acbc1f to your computer and use it in GitHub Desktop.
list-mlnx-counters.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
intf="rdma0" | |
if [ $# -gt 0 ] | |
then | |
intf=$1 | |
fi | |
ibdev=`ibdev2netdev | grep $intf | awk '{print $1}'` | |
printf "Will config on interface: %s %s" $intf $ibdev | |
printf "Port Counters:\n" | |
COUNTERS_PATH=/sys/class/infiniband/$ibdev/ports/1/counters | |
for i in `ls $COUNTERS_PATH/`; do | |
printf "%s %s\n" $i `cat $COUNTERS_PATH/$i`; | |
done | column -c 2 -t | |
echo | |
printf "HW Counters (RDMA diagnostics):\n" | |
HW_COUNTERS_PATH=/sys/class/infiniband/$ibdev/ports/1/hw_counters | |
for i in `ls $HW_COUNTERS_PATH/`; do | |
printf "%s %s\n" $i `cat $HW_COUNTERS_PATH/$i`; | |
done | column -c 2 -t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment