[Openib-windows] [PATCH] wr_type

Yossi Leybovich sleybo at mellanox.co.il
Wed Sep 14 07:12:46 PDT 2005


Fab

Attached patch of one of our verification team eng.
this patch enable to convert wr_type enum to string
Its also include bug fix of the async_event enum to string function and typo
in ib_type.h 

pls apply

10x
Yossi 


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

Index: core/al/ib_statustext.c
===================================================================
--- core/al/ib_statustext.c	(revision 357)
+++ core/al/ib_statustext.c	(working copy)
@@ -114,6 +114,7 @@
 /* ib_async_event_t values above converted to text for easier printing. */
 const char* ib_async_event_str[] =
 {
+	"IB_AE_DUMMY",		/*place holder*/
 	"IB_AE_SQ_ERROR",
 	"IB_AE_SQ_DRAINED",
 	"IB_AE_RQ_ERROR",
@@ -202,3 +203,26 @@
 		wc_type = IB_WC_UNKNOWN;
 	return( ib_wc_type_str[wc_type] );
 }
+
+
+
+static const char* const __ib_wr_type_str[] =
+{
+	"WR_SEND",
+	"WR_RDMA_WRITE",
+	"WR_RDMA_READ",
+	"WR_COMPARE_SWAP",
+	"WR_FETCH_ADD",
+	"WR_UNKNOWN"
+};
+
+
+const char* 
+ib_get_wr_type_str(
+	IN				uint8_t
wr_type )
+{
+	if( wr_type > WR_UNKNOWN )
+		wr_type = WR_UNKNOWN;
+	return( __ib_wr_type_str[wr_type] );
+}
+
Index: inc/iba/ib_types.h
===================================================================
--- inc/iba/ib_types.h	(revision 357)
+++ inc/iba/ib_types.h	(working copy)
@@ -1665,7 +1665,7 @@
 }
 /*
 * PARAMETERS
-*	node_type
+*	port_state
 *		[in] Encoded port state as returned in the PortInfo
attribute.
 
 * RETURN VALUES
@@ -8292,12 +8292,41 @@
 	WR_RDMA_WRITE,
 	WR_RDMA_READ,
 	WR_COMPARE_SWAP,
-	WR_FETCH_ADD
+	WR_FETCH_ADD,
+	WR_UNKNOWN
 
 }	ib_wr_type_t;
 /*****/
 
 
+/****f* IBA Base: Types/ib_get_wr_type_str
+* NAME
+*	ib_get_wr_type_str
+*
+* DESCRIPTION
+*	Returns a string for the specified work request type
+*
+* SYNOPSIS
+*/
+AL_EXPORT const char* AL_API
+ib_get_wr_type_str(
+	IN				uint8_t
wr_type );
+
+/*
+* PARAMETERS
+*	wr_type
+*		[in] Encoded work request type as defined in the
+work request attribute.
+
+* RETURN VALUES
+*	Pointer to the work request type string.
+*
+* NOTES
+*
+* SEE ALSO
+* ib_wr_type_t
+*********/
+
 /****s* Access Layer/ib_local_ds_t
 * NAME
 *	ib_local_ds_t

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20050914/24fc3349/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wr_type.patch
Type: application/octet-stream
Size: 1859 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20050914/24fc3349/attachment.obj>


More information about the ofw mailing list