[ofw] [Patch 27/62] Reference implementation of NDv2

Fab Tillier ftillier at microsoft.com
Wed Feb 20 17:56:49 PST 2013


Don't hard code versions when querying for interfaces.

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

diff -dwup3 -X excl.txt -r c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\bus\kernel\bus_pnp.c .\core\bus\kernel\bus_pnp.c
--- c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\bus\kernel\bus_pnp.c	Tue Aug 07 11:28:12 2012
+++ .\core\bus\kernel\bus_pnp.c	Thu Jul 26 16:20:52 2012
@@ -1454,7 +1454,7 @@ __query_cm_ifc(
 
 	BUS_ENTER( BUS_DBG_PNP );
 
-	if( p_io_stack->Parameters.QueryInterface.Version != IbaCmVersion(1, 1) )
+	if( p_io_stack->Parameters.QueryInterface.Version != INFINIBAND_INTERFACE_CM_VERSION )
 	{
 		BUS_TRACE_EXIT( BUS_DBG_PNP, ("Incorrect interface version (%d)\n",
 			p_io_stack->Parameters.QueryInterface.Version ) );
@@ -1473,7 +1473,7 @@ __query_cm_ifc(
 	p_ifc = (INFINIBAND_INTERFACE_CM*)p_io_stack->Parameters.QueryInterface.Interface;
 
 	p_ifc->InterfaceHeader.Size = sizeof(INFINIBAND_INTERFACE_CM);
-	p_ifc->InterfaceHeader.Version = IbaCmVersion(1, 1);
+	p_ifc->InterfaceHeader.Version = INFINIBAND_INTERFACE_CM_VERSION;
 	p_ifc->InterfaceHeader.Context = p_dev_obj;
 	p_ifc->InterfaceHeader.InterfaceReference = al_ref_cm_ifc;
 	p_ifc->InterfaceHeader.InterfaceDereference = al_deref_cm_ifc;
diff -dwup3 -X excl.txt -r c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\winmad\kernel\wm_driver.c .\core\winmad\kernel\wm_driver.c
--- c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\winmad\kernel\wm_driver.c	Fri Aug 03 17:30:49 2012
+++ .\core\winmad\kernel\wm_driver.c	Tue Aug 07 11:46:17 2012
@@ -352,8 +352,7 @@ static NTSTATUS WmPowerD0Entry(WDFDEVICE
 
 	status = WdfFdoQueryForInterface(Device, &GUID_RDMA_INTERFACE_VERBS,
 									 (PINTERFACE) &dev->VerbsInterface,
-									 sizeof(dev->VerbsInterface), 
-									 VerbsVersion(VERBS_MAJOR_VER, VERBS_MINOR_VER), 
+									 sizeof(dev->VerbsInterface), RDMA_INTERFACE_VERBS_VERSION,
 									 NULL);
 	if ( status == STATUS_NOT_SUPPORTED ) {
 		status = STATUS_SUCCESS;
@@ -363,10 +362,10 @@ static NTSTATUS WmPowerD0Entry(WDFDEVICE
 	if (!NT_SUCCESS(status)) {
 		goto exit;
 	} else {
-		if( VerbsVersion(VERBS_MAJOR_VER, VERBS_MINOR_VER) != dev->VerbsInterface.InterfaceHeader.Version )
+		if( RDMA_INTERFACE_VERBS_VERSION != dev->VerbsInterface.InterfaceHeader.Version )
 		{
 			WmDbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,"WinMad: GUID_RDMA_INTERFACE_VERBS version mismatch: requested version=%d, returned version=%d.\n",
-				VerbsVersion(VERBS_MAJOR_VER, VERBS_MINOR_VER), dev->VerbsInterface.InterfaceHeader.Version);
+				RDMA_INTERFACE_VERBS_VERSION, dev->VerbsInterface.InterfaceHeader.Version);
 	
 			dev->VerbsInterface.InterfaceHeader.InterfaceDereference(dev->VerbsInterface.InterfaceHeader.Context);
 			status = STATUS_NOT_SUPPORTED;
diff -dwup3 -X excl.txt -r c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\winverbs\kernel\wv_driver.c .\core\winverbs\kernel\wv_driver.c
--- c:\dev\openib\ofw\gen1\branches\mlx4_30\trunk\core\winverbs\kernel\wv_driver.c	Fri Aug 03 17:54:45 2012
+++ .\core\winverbs\kernel\wv_driver.c	Tue Aug 07 11:45:42 2012
@@ -520,8 +520,7 @@ static NTSTATUS WvPowerD0Entry(WDFDEVICE
 
 	status = WdfFdoQueryForInterface(Device, &GUID_RDMA_INTERFACE_VERBS,
 									 (PINTERFACE) &dev->Interface,
-									 sizeof(dev->Interface), 
-							 		 VerbsVersion(VERBS_MAJOR_VER, VERBS_MINOR_VER), 
+									 sizeof(dev->Interface), RDMA_INTERFACE_VERBS_VERSION,
 									 NULL);
 	if ( status == STATUS_NOT_SUPPORTED ) {
 		status = STATUS_SUCCESS;
@@ -531,10 +530,10 @@ static NTSTATUS WvPowerD0Entry(WDFDEVICE
 	if (!NT_SUCCESS(status)) {
 		goto exit;
 	} else {
-		if( VerbsVersion(VERBS_MAJOR_VER, VERBS_MINOR_VER) != dev->Interface.InterfaceHeader.Version )
+		if( RDMA_INTERFACE_VERBS_VERSION != dev->Interface.InterfaceHeader.Version )
 		{
 			WvDbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,"WinVerbs: GUID_RDMA_INTERFACE_VERBS version mismatch: requested version=%d, returned version=%d.\n",
-				VerbsVersion(VERBS_MAJOR_VER, VERBS_MINOR_VER), dev->Interface.InterfaceHeader.Version);
+				RDMA_INTERFACE_VERBS_VERSION, dev->Interface.InterfaceHeader.Version);
 	
 			dev->Interface.InterfaceHeader.InterfaceDereference(dev->Interface.InterfaceHeader.Context);
 			status = STATUS_NOT_SUPPORTED;
@@ -555,17 +554,17 @@ static NTSTATUS WvPowerD0Entry(WDFDEVICE
 	status = WdfFdoQueryForInterface(Device, &GUID_INFINIBAND_INTERFACE_CM,
 									 (PINTERFACE) &dev->IbCmInterface,
 									 sizeof(dev->IbCmInterface),
-									 IbaCmVersion(1, 1), NULL);
+									 INFINIBAND_INTERFACE_CM_VERSION, NULL);
 	if( NT_SUCCESS( status ) ) 
 	{
-		if( IbaCmVersion(1, 1) != dev->IbCmInterface.InterfaceHeader.Version )
+		if( INFINIBAND_INTERFACE_CM_VERSION != dev->IbCmInterface.InterfaceHeader.Version )
 		{
 			WvDbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,"WinVerbs: GUID_INFINIBAND_INTERFACE_CM version mismatch: requested version=%d, returned version=%d.\n",
-				IbaCmVersion(1, 1), dev->IbCmInterface.InterfaceHeader.Version);
+				INFINIBAND_INTERFACE_CM_VERSION, dev->IbCmInterface.InterfaceHeader.Version);
 	
+			dev->IbCmInterface.InterfaceHeader.InterfaceDereference(dev->IbCmInterface.InterfaceHeader.Context);
 			dev->Interface.InterfaceHeader.InterfaceDereference(dev->Interface.InterfaceHeader.Context);
 			dev->InterfaceTaken = FALSE;
-			dev->IbCmInterface.InterfaceHeader.InterfaceDereference(dev->IbCmInterface.InterfaceHeader.Context);
 			status = STATUS_NOT_SUPPORTED;
 			goto exit;
 		}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ndv2.27.patch
Type: application/octet-stream
Size: 5494 bytes
Desc: ndv2.27.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20130221/2b52577f/attachment.obj>


More information about the ofw mailing list