[ofw] [PATCH 10/12] uvp/av: complete all processing in pre_create/destroy_av() calls

Sean Hefty sean.hefty at intel.com
Mon Jul 21 09:33:33 PDT 2008


According to the documentation, if a UVP returns IB_VERBS_PROCESSING_DONE
from a pre() IOCTL call, then all verbs related processing has completed.
The mthca pre_create_av() and pre_destroy_av() uvp implementation can
both return IB_VERBS_PROCESSING_DONE, but requires that users still call
post_create_av() and post_destroy_av().  Fix the mthca UVP to complete all
processing in the pre() IOCTL calls when returning IB_VERBS_PROCESSING_DONE,
and update IBAL to remove unnecessary post() IOCTL calls.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
diff -up -r -X trunk\docs\dontdiff.txt -I '\$Id:' trunk/core/al/user/ual_av.c branches\winverbs/core/al/user/ual_av.c
--- trunk/core/al/user/ual_av.c	2008-05-05 09:47:13.014000000 -0700
+++ branches\winverbs/core/al/user/ual_av.c	2008-05-05 11:03:27.249375000 -0700
@@ -67,21 +67,10 @@ ual_create_av(
 	{
 		status = uvp_intf.pre_create_av( h_pd->h_ci_pd,
 			p_av_attr, &ioctl_buf.in.umv_buf, &h_av->h_ci_av );
-		if( status == IB_VERBS_PROCESSING_DONE )
+		if( status != IB_SUCCESS )
 		{
-			/* Creation is done entirely in user mode.  Issue the post call */
-			if( uvp_intf.post_create_av )
-			{
-				uvp_intf.post_create_av( h_pd->h_ci_pd,
-					IB_SUCCESS, &h_av->h_ci_av, &ioctl_buf.in.umv_buf );
-			}
 			AL_EXIT( AL_DBG_AV );
-			return IB_SUCCESS;
-		}
-		else if( status != IB_SUCCESS )
-		{
-			AL_EXIT( AL_DBG_AV );
-			return status;
+			return (status == IB_VERBS_PROCESSING_DONE) ? IB_SUCCESS : status;
 		}
 	}
 
@@ -185,19 +174,10 @@ ual_destroy_av(
 		status = uvp_intf.pre_destroy_av( h_av->h_ci_av );
 		CL_ASSERT( (status == IB_SUCCESS) ||
 			(status == IB_VERBS_PROCESSING_DONE) );
-		if( status == IB_VERBS_PROCESSING_DONE )
-		{
-			/* Destruction is done in user mode. Issue the post call */
-			if( uvp_intf.post_destroy_av )
-				uvp_intf.post_destroy_av( h_av->h_ci_av, IB_SUCCESS );
-
-			AL_EXIT( AL_DBG_AV );
-			return IB_SUCCESS;
-		}
-		else if( status != IB_SUCCESS )
+		if( status != IB_SUCCESS )
 		{
 			AL_EXIT( AL_DBG_AV );
-			return status;
+			return (status == IB_VERBS_PROCESSING_DONE) ? IB_SUCCESS : status;
 		}
 	}
 
diff -up -r -X trunk\docs\dontdiff.txt -I '\$Id:' trunk/hw/mthca/user/mlnx_ual_av.c branches\winverbs/hw/mthca/user/mlnx_ual_av.c
--- trunk/hw/mthca/user/mlnx_ual_av.c	2008-05-05 09:47:16.185875000 -0700
+++ branches\winverbs/hw/mthca/user/mlnx_ual_av.c	2008-05-13 19:39:18.163625000 -0700
@@ -39,6 +39,13 @@
 #include "mlnx_ual_av.tmh"
 #endif
 
+static void
+__post_create_av (
+	IN		const ib_pd_handle_t	h_uvp_pd,
+	IN		ib_api_status_t			ioctl_status,
+	IN OUT	ib_av_handle_t			*ph_uvp_av,
+	IN OUT	ci_umv_buf_t			*p_umv_buf);
+
 
 uint8_t
 gid_to_index_lookup (
@@ -193,9 +200,10 @@ __pre_create_av (
 		p_create_av->mr.access_flags = 0;	//local read
 		status = IB_SUCCESS;
 	}
-	else
+	else {
+		__post_create_av(h_uvp_pd, IB_SUCCESS, ph_uvp_av, p_umv_buf);
 		status = IB_VERBS_PROCESSING_DONE;
-
+	}
 	goto end;
 
 err_mem:	
@@ -352,8 +360,11 @@ __pre_destroy_av (
 	UVP_ENTER(UVP_DBG_AV);
 	if (mthca_ah->in_kernel)
 		status = IB_SUCCESS;
-	else
+	else {
+		mthca_free_av(mthca_ah);
+		cl_free(mthca_ah);
 		status = IB_VERBS_PROCESSING_DONE;
+	}
 	UVP_EXIT(UVP_DBG_AV);
 	return status;
 }





More information about the ofw mailing list