[ofw] [PATCH] Add uverbs version
Reuven Amitai
reuven at mellanox.co.il
Wed Mar 26 00:39:22 PDT 2008
Hi,
The patch adds version to uvp interface the same way the kvp has (
inc\iba\ib_ci.h ).
It also adds checking for the returned version of the uvp.
comments / suggestions are welcome.
Reuven.
Index: core/al/user/ual_ci_ca.c
===================================================================
--- core/al/user/ual_ci_ca.c (revision 992)
+++ core/al/user/ual_ci_ca.c (working copy)
@@ -162,6 +162,17 @@
add_ci_ca( p_ci_ca );
open_vendor_lib( ca_guid, &p_ci_ca->verbs );
+ /* Check vendor lib version */
+ if (p_ci_ca->verbs.user_verbs.version != UVERBS_VERSION)
+ {
+ p_ci_ca->obj.pfn_destroy( &p_ci_ca->obj, NULL );
+ AL_PRINT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,
+ ("Unsupported uvp interface version, "
+ "expected = 0x%x, actual = 0x%x.\n",
+ UVERBS_VERSION, p_ci_ca->verbs.user_verbs.version) );
+ return IB_UNSUPPORTED;
+ }
+
/* Now open the UAL CA to be assigned to p_ci_ca */
status = ib_open_ca( h_al, ca_guid, ca_event_cb, p_ci_ca,
&p_ci_ca->h_ca );
Index: hw/mthca/user/mlnx_ual_main.c
===================================================================
--- hw/mthca/user/mlnx_ual_main.c (revision 992)
+++ hw/mthca/user/mlnx_ual_main.c (working copy)
@@ -143,7 +143,7 @@
/*
* Version of the header file this interface export can handle
*/
- p_uvp->version = 0x101;
+ p_uvp->version = UVERBS_VERSION;
p_uvp->guid = 0x12345678;
/*
Index: inc/user/iba/ib_uvp.h
===================================================================
--- inc/user/iba/ib_uvp.h (revision 992)
+++ inc/user/iba/ib_uvp.h (working copy)
@@ -116,6 +116,17 @@
*
*/
+/*
+ * Version that identifies this version of the header file for
interface
+ * definition.
+ */
+#define UVERBS_MAJOR_VER (0x0002)
+#define UVERBS_MINOR_VER (0x0000)
+
+#define UVERBS_VERSION (((UVERBS_MAJOR_VER) << 16) |
(UVERBS_MINOR_VER))
+#define MK_UVERBS_VERSION(maj,min) ((((maj) & 0xFFFF) << 16) | \
+ ((min) & 0xFFFF))
+
/******/
/******/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080326/64d9c547/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uverbs_version.patch
Type: application/octet-stream
Size: 1841 bytes
Desc: uverbs_version.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080326/64d9c547/attachment.obj>
More information about the ofw
mailing list