[VSTAT] Display port MTU in human readable format.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 22 Sep 2005 04:55:17 +0000 (04:55 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 22 Sep 2005 04:55:17 +0000 (04:55 +0000)
Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@80 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

tools/vstat/user/vstat_main.c

index 93eb64a..bbcb40f 100644 (file)
@@ -106,13 +106,36 @@ void printPortLinkState(int portState){ //TODO: check that these are all the opt
 }\r
 \r
 \r
+\r
+void printPortMTU(int mtu){ //TODO: check that these are all the options and that they are correct\r
+       switch(mtu){\r
+               case 1:\r
+                       printf("\t\tmax_mtu=256\n");\r
+                       break;\r
+               case 2:\r
+                       printf("\t\tmax_mtu=512\n");\r
+                       break;\r
+               case 3:\r
+                       printf("\t\tmax_mtu=1024\n");\r
+                       break;\r
+               case 4:\r
+                       printf("\t\tmax_mtu=2048\n");\r
+                       break;\r
+               case 5:\r
+                       printf("\t\tmax_mtu=4096\n");\r
+                       break;\r
+               default:\r
+                       printf("\t\tmax_mtu=UNKNOWN\n"); \r
+       }\r
+}\r
+\r
 void printPortInfo(ib_port_attr_t* portPtr, BOOLEAN fullPrint){\r
        printf("\t\tport=%d\n", portPtr->port_num);\r
        printPortLinkState(portPtr->link_state);\r
        printf("\t\tsm_lid=0x%04x\n", cl_ntoh16(portPtr->sm_lid));\r
        printf("\t\tport_lid=0x%04x\n", cl_ntoh16(portPtr->lid));\r
        printf("\t\tport_lmc=0x%x\n", portPtr->lmc);\r
-       printf("\t\tmax_mtu=%d\n", portPtr->mtu);\r
+       printPortMTU(portPtr->mtu);\r
        if(fullPrint){\r
                printf("\t\tmax_msg_sz=0x%x     (Max message size)\n", portPtr->max_msg_size);\r
                printf("\t\tcapability_mask=TBD\n");\r