[Openib-windows] [PATCH] dev_id + vstat

Yossi Leybovich sleybo at mellanox.co.il
Thu Oct 6 00:17:39 PDT 2005


Fab

attached is patch that fix the dev id report in query_ca . It appears that
the low level driver did not distinguish between Arbel 25208 and Tavor 23108
devices, and handle the both devices as Tavor
This patch fix this.

I also made some clean up in the vstat tool ( remove unsupported fields and
add other fields that were not reported)

pls review and apply

10x 
Yossi 

Singed-off-by: Yossi Leybovich (sleybo at mellanox.co.il)

Index: hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdCard.h
===================================================================
--- hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdCard.h	(revision 531)
+++ hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdCard.h	(working copy)
@@ -497,7 +497,7 @@
 		/* for TAVOR_SD */
 		{ L"5A5A", "mt%d_pci%d", "mt%d_pci%d", 	MD_DEV_ID_TAVOR_SD,
MD_DEV_IX_TAVOR_SD, TRUE, 	0x00100000, 0x01000000, 0x00000000,
167000000, 	4, 0 },
 		/* for TAVOR_SD */
-		{ L"6278", "InfiniHost%d", "InfiniHosA%d",
MD_DEV_ID_ARBEL_TM, MD_DEV_IX_ARBEL_TM, TRUE, 	0x00100000, 0x01000000,
0x00000000, 167000000, 	4, 0 },
+		{ L"6278", "InfiniHostEx%d", "InfiniHosEx%d",
MD_DEV_ID_ARBEL_TM, MD_DEV_IX_ARBEL_TM, TRUE, 	0x00100000, 0x01000000,
0x00000000, 167000000, 	4, 0 },
 	};
 
 #else
Index: hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdConf.c
===================================================================
--- hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdConf.c	(revision 531)
+++ hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdConf.c	(working copy)
@@ -586,7 +586,8 @@
 
 	} /* fix HCA command register from SHRIMP */
 
-	if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR	) 
+	if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR 
+		|| pi_pMdDevContext->m_eDevType ==MD_DEV_IX_ARBEL_TM) 
 	{ /* fix command register for TAVOR */
 
 		l_pInterface = &pi_pMdDevContext->m_Interface;
@@ -680,7 +681,8 @@
 			return l_Status;
 		}	
 		else
-		if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR) {
+		if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR || 
+			pi_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM)
{
 
 	    		/* protect */
 			KSEM_ACQ(&pi_pMdDevContext->m_Sem);
@@ -849,7 +851,8 @@
 
  	}
  	else
-	if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR	) {
+	if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR ||
+		pi_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM) {
 	
 		/* 
 		 * HCA device
@@ -936,7 +939,8 @@
 		}
 	}
 	else
-	if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR	) {
+	if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR ||
+		pi_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM) {
 	
 		/* 
 		 * Bridge device
@@ -987,7 +991,8 @@
 			l_Status );
 	}
 	else 
-	if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR) { /* we are
Tavor device */
+	if (pi_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR ||
+		pi_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM) { /* we
are Tavor device */
 		l_Status = PciDevReset(pi_pMdDevContext, l_ResetOffset,
l_ResetValue );
 	}
 	else
Index: hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdIoctl.c
===================================================================
--- hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdIoctl.c	(revision 531)
+++ hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdIoctl.c	(working copy)
@@ -140,6 +140,7 @@
 				
 		case MD_DEV_IX_TAVOR_SD:
 		case MD_DEV_IX_TAVOR:
+		case MD_DEV_IX_ARBEL_TM:
 			l_Status = PciIoctl( l_pMdDevContext, l_pPcs,
l_nIoControlCode, l_pInBuffer, 
 				l_nInBufLength, l_pOutBuffer,
l_nOutBufLength, (PULONG)&pi_pIrp->IoStatus.Information );
 			break;
Index: hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdPnp.c
===================================================================
--- hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdPnp.c	(revision 531)
+++ hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdPnp.c	(working copy)
@@ -939,7 +939,9 @@
 	 * add device to TAVOR
 	 */ 
 
-	if (l_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR	&&
g_pDrvContext->m_fSupportTavor)
+	if ((l_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR	|| 
+		l_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM)
+		&& g_pDrvContext->m_fSupportTavor)
 	{ /* add HCA to Tavor functional DLLs */
 	
 		unsigned char 				l_RevId = 0;
@@ -1135,7 +1137,8 @@
 	// stop the card by sending some commands to it or suspend all new
requests and wait for the end of in-progress ones
 	//
 
-	if (l_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR	&&
g_pDrvContext->m_fSupportTavor)
+	if ((l_pMdDevContext->m_eDevType == MD_DEV_IX_TAVOR	||
+		l_pMdDevContext->m_eDevType == MD_DEV_IX_ARBEL_TM)&&
g_pDrvContext->m_fSupportTavor)
 	{ /* remove HCA from Tavor functional DLLs */
 	
 		HH_ret_t 					l_HhRet;
Index: hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdRdWr.c
===================================================================
--- hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdRdWr.c	(revision 531)
+++ hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdRdWr.c	(working copy)
@@ -103,8 +103,9 @@
 				break;
 				
 			case MD_DEV_IX_TAVOR:
+			case MD_DEV_IX_ARBEL_TM:
 			  // MDCTL
-            PciRelease( l_pMdDevContext, l_pPcs );
+				PciRelease( l_pMdDevContext, l_pPcs );
 				break;
 				
 			case MD_DEV_IX_TAVOR_BD:
Index: hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdUtil.c
===================================================================
--- hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdUtil.c	(revision 531)
+++ hw/mt23108/vapi/mlxsys/os_dep/win/tdriver/MdUtil.c	(working copy)
@@ -447,6 +447,7 @@
 			break;
 
 		case MD_DEV_IX_TAVOR:
+		case MD_DEV_IX_ARBEL_TM:
 			GetRegistryDword( L"DdrMapOffset",
MD_DFLT_CONF_DATA, &l_pMdDevContext->m_ulDdrMapOffset );
 			GetRegistryDword( L"DdrMapSize",
MD_DFLT_CONF_DATA, &l_pMdDevContext->m_ulDdrMapSize );
 			GetRegistryDword( L"ResetCard",
MD_DFLT_CONF_DATA, &l_pMdDevContext->m_PerformReset );
@@ -1415,8 +1416,9 @@
 
 	/* create Control Device names */
 	/* !!! from now on work with ARBEL_TM as with TAVOR */
-	l_pDevInfo = (pi_DevIx == (int)MD_DEV_IX_ARBEL_TM) ?
&g_DevParams[MD_DEV_IX_TAVOR] : &g_DevParams[pi_DevIx];
-	if (l_pDevInfo->m_DevId == MD_DEV_ID_TAVOR)
+	//l_pDevInfo = (pi_DevIx == (int)MD_DEV_IX_ARBEL_TM) ?
&g_DevParams[MD_DEV_IX_TAVOR] : &g_DevParams[pi_DevIx];
+	l_pDevInfo =   &g_DevParams[pi_DevIx];
+	if (l_pDevInfo->m_DevId == MD_DEV_ID_TAVOR || l_pDevInfo->m_DevId ==
MD_DEV_ID_ARBEL_TM)
 		sprintf( l_DevName, l_pDevInfo->m_Format,
g_pDrvContext->m_uCardNo );
 	else
 		sprintf( l_DevName, l_pDevInfo->m_Format,
l_pDevInfo->m_DevId, g_pDrvContext->m_uCardNo );
Index: tools/vstat/user/vstat_main.c
===================================================================
--- tools/vstat/user/vstat_main.c	(revision 101)
+++ tools/vstat/user/vstat_main.c	(working copy)
@@ -139,10 +139,10 @@
 	if(fullPrint){
 		printf("\t\tmax_msg_sz=0x%x	(Max message size)\n",
portPtr->max_msg_size);
 		printf("\t\tcapability_mask=TBD\n");
-		printf("\t\tmax_vl_num=0x%x	(Maximum number of VL
supported by this port)\n", portPtr->max_vls);
+		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);
-		printf("\t\tsm_sl=0x%x	(IB_SL to be used in communication
with subnet manager)\n", portPtr->sm_sl);
+		printf("\t\tsm_sl=0x%x		(IB_SL to be used in
communication with subnet manager)\n", portPtr->sm_sl);
 		printf("\t\tpkey_tbl_len=0x%x	(Current size of pkey
table)\n", portPtr->num_pkeys);
 		printf("\t\tgid_tbl_len=0x%x	(Current size of GID
table)\n", portPtr->num_gids);
 		printf("\t\tsubnet_timeout=0x%x	(Subnet Timeout for this
port (see PortInfo))\n", portPtr->subnet_timeout);
@@ -155,53 +155,51 @@
 
 
 
-void vstat_print_ca_attr(ib_ca_attr_t* ca_attr, BOOLEAN fullPrint){
+void vstat_print_ca_attr(int idx,  ib_ca_attr_t* ca_attr, BOOLEAN
fullPrint){
 	int i;
 	
-	printf("\thca_id=%s\n",
ca_attr->dev_id==0x5a44?"InfiniHost0":"TBD"); //TODO: all HCAs and hadle
multi HCAs 
-	printf("\tpci_location={BUS=TBD,DEV/FUNC=TBD}\n");
+	printf("\thca_idx=%d\n",idx);
+	printf("\tpci_location={BUS=NA,DEV/FUNC=NA}\n");
 	printf("\tvendor_id=0x%04x\n", ca_attr->vend_id);
 	printf("\tvendor_part_id=0x%04x\n", ca_attr->dev_id);
 	printf("\thw_ver=0x%x\n", ca_attr->revision); //TODO: ???
-	printf("\tfw_ver=TBD\n");
-	printf("\tPSID=TBD\n");
+	printf("\tfw_ver=NA\n");
+	printf("\tPSID=NA\n");
 	if(fullPrint){
-		printf("\tnum_phys_ports =	TBD\n");
+		printf("\tnum_phys_ports = %d\n",ca_attr->num_ports);
 		printf("\tmax_num_qp = 0x%x		(Maximum Number of
QPs supported)\n", ca_attr->max_qps);
-		printf("\tmax_qp_ous_wr = 0x%x	(Maximum Number of
oustanding WR on any WQ)\n", ca_attr->max_wrs);
-		printf("\tflags== TBD\n");
+		printf("\tmax_qp_ous_wr = 0x%x		(Maximum Number of
oustanding WR on any WQ)\n", ca_attr->max_wrs);
 		printf("\tmax_num_sg_ent = 0x%x		(Max num of
scatter/gather entries for WQE other than RD)\n", ca_attr->max_sges);
-		printf("\tmax_num_sg_ent_rd =	0x%x	(Max num of
scatter/gather entries for RD WQE)\n",  ca_attr->max_rd_sges);
-		printf("\tmax_num_srq = TBD		(Maximum Number of
SRQs supported)\n");
-		printf("\tmax_wqe_per_srq = TBD	(Maximum Number of
oustanding WR on any SRQ)\n");
-		printf("\tmax_srq_sentries = TBD	(Maximum Number of
scatter entries for SRQ WQE)\n");
-		printf("\tsrq_resize_supported = TBD	(SRQ resize
supported)\n");
-		printf("\tmax_num_cq = 0x%x	(Max num of supported
CQs)\n", ca_attr->max_cqs);
+		printf("\tmax_num_sg_ent_rd = 0x%x		(Max num of
scatter/gather entries for RD WQE)\n",  ca_attr->max_rd_sges);
+		printf("\tmax_num_srq = 0			(Maximum
Number of SRQs supported)\n");
+		printf("\tmax_wqe_per_srq = 0		(Maximum Number of
oustanding WR on any SRQ)\n");
+		printf("\tmax_srq_sentries = 0		(Maximum Number of
scatter entries for SRQ WQE)\n");
+		printf("\tsrq_resize_supported = 0	(SRQ resize
supported)\n");
+		printf("\tmax_num_cq = 0x%x		(Max num of
supported CQs)\n", ca_attr->max_cqs);
 		printf("\tmax_num_ent_cq = 0x%x	(Max num of supported
entries per CQ)\n", ca_attr->max_cqes);
-		printf("\tmax_num_mr = 0x%x	(Maximum number of memory
region supported)\n", ca_attr->init_regions);
+		printf("\tmax_num_mr = 0x%x		(Maximum number of
memory region supported)\n", ca_attr->init_regions);
 		printf("\tmax_mr_size = 0x%x	(Largest contigous block of
memory region in bytes)\n", ca_attr->init_region_size);
-		printf("\tmax_pd_num = 0x%x	(Maximum number of
protection domains supported)\n", ca_attr->max_pds);
-		printf("\tpage_size_cap = TBD	(Largest page size supported
by this HCA)\n");
-		printf("\tmax_pkeys = TBD		(Maximum number of
partitions supported)\n");
+		printf("\tmax_pd_num = 0x%x		(Maximum number of
protection domains supported)\n", ca_attr->max_pds);
+		printf("\tpage_size_cap = 0x%x		(Largest page size
supported by this HCA)\n",ca_attr->p_page_size[ca_attr->num_page_sizes-1]);
 		printGUID(ca_attr->ca_guid);
-		printf("\tlocal_ca_ack_delay = 0x%x	(Log2 4.096usec Max.
RX to ACK or NAK delay)\n", ca_attr->local_ack_delay);
-		printf("\tmax_qp_ous_rd_atom = TBD	(Maximum number of
oust. RDMA read/atomic as target)\n");
-		printf("\tmax_ee_ous_rd_atom = TBD	(EE Maximum number
of outs. RDMA read/atomic as target)\n");
-		printf("\tmax_res_rd_atom = TBD	(Max. Num. of resources used
for RDMA read/atomic as target)\n");
-		printf("\tmax_qp_init_rd_atom = TBD	(Max. Num. of outs.
RDMA read/atomic as initiator)\n");
-		printf("\tmax_ee_init_rd_atom = TBD	(EE Max. Num. of
outs. RDMA read/atomic as initiator)\n");
-		printf("\tatomic_cap = TBD		(Level of Atomicity
supported)\n");
+		printf("\tlocal_ca_ack_delay = 0x%x		(Log2
4.096usec Max. RX to ACK or NAK delay)\n", ca_attr->local_ack_delay);
+		printf("\tmax_qp_ous_rd_atom = 0x%x		(Maximum
number of oust. RDMA read/atomic as target)\n",ca_attr->max_qp_resp_res);
+		printf("\tmax_ee_ous_rd_atom = 0		(EE Maximum
number of outs. RDMA read/atomic as target)\n");
+		printf("\tmax_res_rd_atom = 0x%x		(Max. Num.
of resources used for RDMA read/atomic as target)\n",ca_attr->max_resp_res);
+		printf("\tmax_qp_init_rd_atom = 0x%x	(Max. Num. of outs.
RDMA read/atomic as initiator)\n",ca_attr->max_qp_init_depth);
+		printf("\tmax_ee_init_rd_atom = 0		(EE Max.
Num. of outs. RDMA read/atomic as initiator)\n");
+		printf("\tatomic_cap = %s		(Level of Atomicity
supported)\n",ca_attr->atomicity == IB_ATOMIC_GLOBAL?"GLOBAL":
+
ca_attr->atomicity == IB_ATOMIC_LOCAL?"LOCAL":"NORMAL");
 		printf("\tmax_ee_num = 0x0		(Maximum number of
EEC supported)\n");
 		printf("\tmax_rdd_num = 0x0		(Maximum number of
IB_RDD supported)\n");
-		printf("\tmax_mw_num = 0x%x	(Maximum Number of memory
windows supported)\n", ca_attr->init_windows);
-		printf("\tmax_raw_ipv6_qp = 0x%x	(Maximum number of
Raw IPV6 QPs supported)\n", ca_attr->max_ipv6_qps);
-		printf("\tmax_raw_ethy_qp = 0x%x	(Maximum number of
Raw Ethertypes QPs supported)\n", ca_attr->max_ether_qps);
+		printf("\tmax_mw_num = 0x%x		(Maximum Number of
memory windows supported)\n", ca_attr->init_windows);
+		printf("\tmax_raw_ipv6_qp = 0x%x		(Maximum
number of Raw IPV6 QPs supported)\n", ca_attr->max_ipv6_qps);
+		printf("\tmax_raw_ethy_qp = 0x%x		(Maximum
number of Raw Ethertypes QPs supported)\n", ca_attr->max_ether_qps);
 		printf("\tmax_mcast_grp_num = 0x%x	(Maximum Number of
multicast groups)\n", ca_attr->max_mcast_grps);
-		printf("\tmax_mcast_qp_attach_num = 0x%x(Maximum number of
QP per multicast group)\n", ca_attr->max_qps_per_mcast_grp);
-		printf("\tmax_total_mcast_qp_attach_num = 0x%x(Maximum
number of QPs which can be attached to a mcast grp)\n",
ca_attr->max_mcast_qps);
-		printf("\tmax_ah_num = 0x%x	(Maximum number of address
handles)\n", ca_attr->max_addr_handles);
-		printf("\tmax_num_fmr = TBD		(maximum number
FMRs)\n");
-		printf("\tmax_num_map_per_fmr = TBD	(Maximum number of
(re)maps per FMR before an unmap operation in required)\n");
+		printf("\tmax_mcast_qp_attach_num = 0x%x	(Maximum
number of QP per multicast group)\n", ca_attr->max_qps_per_mcast_grp);
+		printf("\tmax_ah_num = 0x%x		(Maximum number of
address handles)\n", ca_attr->max_addr_handles);
+		printf("\tmax_num_fmr = 0			(Maximum
number FMRs)\n");
+		printf("\tmax_num_map_per_fmr = 0		(Maximum
number of (re)maps per FMR before an unmap operation in required)\n");
 	}else{
 		printf("\tnum_phys_ports=%d\n", 	ca_attr->num_ports);
 	}
@@ -225,7 +223,7 @@
 	size_t 			guid_count;
 	ib_net64_t		*ca_guid_array;
 	ib_ca_attr_t		*vstat_ca_attr;
-	uintn_t 			i;
+	size_t 			i;
 	ib_ca_handle_t 	h_ca = NULL;
 	uint32_t 			bsize;
 	ib_port_attr_mod_t port_attr_mod;
@@ -338,7 +336,7 @@
 
 			/* Print_ca_attributes */
 
-			vstat_print_ca_attr(vstat_ca_attr, fullPrint);
+			vstat_print_ca_attr((int)i,vstat_ca_attr,
fullPrint);
 
 
 			/* Free the memory */



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051006/88759cb1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: device_id.patch
Type: application/octet-stream
Size: 6016 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051006/88759cb1/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vstat2.patch
Type: application/octet-stream
Size: 8307 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20051006/88759cb1/attachment-0001.obj>


More information about the ofw mailing list