From: sleybo Date: Wed, 7 Feb 2007 13:03:37 +0000 (+0000) Subject: [MTHCA, TOOLS] fix printing of port capabilities , fix compilation bug X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d2842c7d64c6bf58ffb3ea51adad3c14771f143c;p=~shefty%2Frdma-win.git [MTHCA, TOOLS] fix printing of port capabilities , fix compilation bug git-svn-id: svn://openib.tc.cornell.edu/gen1@583 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/hw/mthca/kernel/hca_data.c b/trunk/hw/mthca/kernel/hca_data.c index 5e639a33..f8e5b7a6 100644 --- a/trunk/hw/mthca/kernel/hca_data.c +++ b/trunk/hw/mthca/kernel/hca_data.c @@ -214,18 +214,31 @@ mthca_port_cap_to_ibal( IN u32 mthca_port_cap, OUT ib_port_cap_t *ibal_port_cap_p) { - if (mthca_port_cap & IB_PORT_CM_SUP) - ibal_port_cap_p->cm = TRUE; - if (mthca_port_cap & IB_PORT_SNMP_TUNNEL_SUP) - ibal_port_cap_p->snmp = TRUE; - if (mthca_port_cap & IB_PORT_DEVICE_MGMT_SUP) - ibal_port_cap_p->dev_mgmt = TRUE; - if (mthca_port_cap & IB_PORT_VENDOR_CLASS_SUP) - ibal_port_cap_p->vend = TRUE; - if (mthca_port_cap & IB_PORT_SM_DISABLED) - ibal_port_cap_p->sm_disable = TRUE; - if (mthca_port_cap & IB_PORT_SM) - ibal_port_cap_p->sm = TRUE; +#define SET_CAP(flag,cap) if (mthca_port_cap & flag) ibal_port_cap_p->cap = TRUE + + SET_CAP(IB_PORT_CM_SUP,cm); + SET_CAP(IB_PORT_SNMP_TUNNEL_SUP,snmp); + SET_CAP(IB_PORT_DEVICE_MGMT_SUP,dev_mgmt); + SET_CAP(IB_PORT_VENDOR_CLASS_SUP,vend); + SET_CAP(IB_PORT_SM_DISABLED,sm_disable); + SET_CAP(IB_PORT_SM,sm); + SET_CAP(IB_PORT_NOTICE_SUP,notice); + SET_CAP(IB_PORT_TRAP_SUP,trap); + SET_CAP(IB_PORT_AUTO_MIGR_SUP,apm); + SET_CAP(IB_PORT_SL_MAP_SUP,slmap); + SET_CAP(IB_PORT_LED_INFO_SUP,ledinfo); + SET_CAP(IB_PORT_CAP_MASK_NOTICE_SUP,capm_notice); + SET_CAP(IB_PORT_CLIENT_REG_SUP,client_reregister); + SET_CAP(IB_PORT_SYS_IMAGE_GUID_SUP,sysguid); + SET_CAP(IB_PORT_BOOT_MGMT_SUP,boot_mgmt); + SET_CAP(IB_PORT_DR_NOTICE_SUP,dr_notice); + SET_CAP(IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP,pkey_switch_ext_port); + SET_CAP(IB_PORT_LINK_LATENCY_SUP,link_rtl); + SET_CAP(IB_PORT_REINIT_SUP,reinit); + SET_CAP(IB_PORT_OPT_IPD_SUP,ipd); + SET_CAP(IB_PORT_MKEY_NVRAM,mkey_nvram); + SET_CAP(IB_PORT_PKEY_NVRAM,pkey_nvram); + // there no MTHCA flags for qkey_ctr, pkey_ctr, port_active, bm IBAL capabilities; } diff --git a/trunk/hw/mthca/kernel/mthca_doorbell.h b/trunk/hw/mthca/kernel/mthca_doorbell.h index c873c9c9..92cfb3fd 100644 --- a/trunk/hw/mthca/kernel/mthca_doorbell.h +++ b/trunk/hw/mthca/kernel/mthca_doorbell.h @@ -48,7 +48,7 @@ enum { #define MTHCA_DECLARE_DOORBELL_LOCK(name) -#define MTHCA_INIT_DOORBELL_LOCK(ptr) do { } while (0) +#define MTHCA_INIT_DOORBELL_LOCK(ptr) #define MTHCA_GET_DOORBELL_LOCK(ptr) (NULL) static inline void mthca_write64_raw(__be64 val, void __iomem *dest) diff --git a/trunk/tools/vstat/user/vstat_main.c b/trunk/tools/vstat/user/vstat_main.c index 465e7fae..391aeea2 100644 --- a/trunk/tools/vstat/user/vstat_main.c +++ b/trunk/tools/vstat/user/vstat_main.c @@ -143,6 +143,33 @@ void printPortMTU(int mtu){ //TODO: check that these are all the options and tha } } +void printPortCaps(ib_port_cap_t *ibal_port_cap_p) +{ +#define PRINT_CAP(cap, name) if (ibal_port_cap_p->cap) printf( #name "," ) + + printf("\t\tcapabilities: "); + PRINT_CAP(cm, CM); + PRINT_CAP(snmp, SNMP_TUNNEL); + PRINT_CAP(dev_mgmt, DEVICE_MGMT); + PRINT_CAP(sm_disable, SM_DISABLED); + PRINT_CAP(sm, SM); + PRINT_CAP(vend, VENDOR_CLASS); + PRINT_CAP(notice, NOTICE); + PRINT_CAP(trap, TRAP); + PRINT_CAP(apm, APM); + PRINT_CAP(slmap, SL_MAP); + PRINT_CAP(ledinfo, LED_INFO); + PRINT_CAP(client_reregister, CLIENT_REG); + PRINT_CAP(sysguid, SYSGUID); + PRINT_CAP(boot_mgmt, BOOT_MGMT); + PRINT_CAP(pkey_switch_ext_port, PKEY_SW_EXT_PORT_TRAP); + PRINT_CAP(link_rtl, LINK_LATENCY); + PRINT_CAP(reinit, REINIT); + PRINT_CAP(ipd, OPT_IPD); + PRINT_CAP(mkey_nvram, MKEY_NVRAM); + PRINT_CAP(pkey_nvram, PKEY_NVRAM); + printf("\n"); +} void printPortInfo(ib_port_attr_t* portPtr, BOOLEAN fullPrint){ printf("\t\tport=%d\n", portPtr->port_num); printPortLinkState(portPtr->link_state); @@ -152,7 +179,7 @@ void printPortInfo(ib_port_attr_t* portPtr, BOOLEAN fullPrint){ printPortMTU(portPtr->mtu); if(fullPrint){ printf("\t\tmax_msg_sz=0x%x (Max message size)\n", portPtr->max_msg_size); - printf("\t\tcapability_mask=0x%x (Port capability mask)\n", portPtr->cap); + printPortCaps( &portPtr->cap ); printf("\t\tmax_vl_num=0x%x (Maximum number of VL supported by this port)\n", portPtr->max_vls); printf("\t\tbad_pkey_counter=0x%x (Bad PKey counter)\n", portPtr->pkey_ctr); printf("\t\tqkey_viol_counter=0x%x (QKey violation counter)\n", portPtr->qkey_ctr);