[ofw] [PATCH] Change CEP DREP API

Fab Tillier ftillier at windows.microsoft.com
Thu Jul 10 17:48:35 PDT 2008


The al_cep_drep API currently takes the ib_cm_drep_t structure.  This structure is passed in the IOCTL.  It has en embedded pointer that isn't used since the private data is copied into the IOCTL structure.

This patch removes the ib_cm_drep_t structure from the IOCTL structure, and passes the private data buffer and length in explicitly.

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

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\al_cm_cep.h trunk\core\al\al_cm_cep.h
--- old\core\al\al_cm_cep.h     Wed Jul 09 09:44:27 2008
+++ trunk\core\al\al_cm_cep.h   Thu Jul 10 16:03:06 2008
@@ -238,7 +238,8 @@ ib_api_status_t
 al_cep_drep(
        IN                              ib_al_handle_t                          h_al,
        IN                              net32_t                                         cid,
-       IN              const   ib_cm_drep_t* const                     p_cm_drep );
+       IN              const   uint8_t* const                          p_pdata OPTIONAL,
+       IN              const   uint8_t                                         pdata_len );


 ib_api_status_t
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\al_cm_qp.c trunk\core\al\al_cm_qp.c
--- old\core\al\al_cm_qp.c      Thu Jul 10 12:08:29 2008
+++ trunk\core\al\al_cm_qp.c    Thu Jul 10 17:44:52 2008
@@ -386,7 +386,7 @@ __proc_dconn_timeout(

 static void
 __proc_failed_send(
-       IN                              ib_qp_handle_t FUNC_PTR64                               h_qp,
+       IN                              ib_qp_handle_t                          h_qp,
        IN              const   ib_mad_t* const                         p_mad )
 {
        AL_ENTER( AL_DBG_CM );
@@ -1621,7 +1621,8 @@ ib_cm_drep(
                return IB_INVALID_PARAMETER;
        }

-       status = al_cep_drep( h_cm_dreq.h_al, h_cm_dreq.cid, p_cm_drep );
+       status = al_cep_drep( h_cm_dreq.h_al, h_cm_dreq.cid,
+               p_cm_drep->p_drep_pdata, p_cm_drep->drep_length );
        switch( status )
        {
        case IB_INVALID_SETTING:
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\al_dev.h trunk\core\al\al_dev.h
--- old\core\al\al_dev.h        Wed Jul 09 09:44:27 2008
+++ trunk\core\al\al_dev.h      Thu Jul 10 17:13:00 2008
@@ -55,7 +55,7 @@
 #define AL_DEVICE_NAME L"\\Device\\ibal"
 #define        ALDEV_KEY               (0x3B)  /* Matches FILE_DEVICE_INFINIBAND from wdm.h */

-#define AL_IOCTL_VERSION                       (8)
+#define AL_IOCTL_VERSION                       (9)

 /* max number of devices with non-default pkey */
 #define        MAX_NUM_PKEY    16
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\kernel\al_cm_cep.c trunk\core\al\kernel\al_cm_cep.c
--- old\core\al\kernel\al_cm_cep.c      Wed Jul 09 09:44:26 2008
+++ trunk\core\al\kernel\al_cm_cep.c    Thu Jul 10 16:03:06 2008
@@ -3393,6 +3393,7 @@ __complete_ndi_irp(
        ib_put_mad( p_mad );
 }

+
 /* Called with the CEP and CEP manager locks held */
 static ib_api_status_t
 __cep_queue_mad(
@@ -5827,7 +5828,8 @@ ib_api_status_t
 al_cep_drep(
        IN                              ib_al_handle_t                          h_al,
        IN                              net32_t                                         cid,
-       IN              const   ib_cm_drep_t* const                     p_cm_drep )
+       IN              const   uint8_t* const                          p_pdata OPTIONAL,
+       IN              const   uint8_t                                         pdata_len )
 {
        ib_api_status_t         status;
        kcep_t                          *p_cep;
@@ -5855,8 +5857,8 @@ al_cep_drep(
                if( status != IB_SUCCESS )
                        break;

-               status = __format_drep( p_cep, p_cm_drep->p_drep_pdata,
-                       p_cm_drep->drep_length, (mad_cm_drep_t*)p_mad->p_mad_buf );
+               status = __format_drep( p_cep, p_pdata,
+                       pdata_len, (mad_cm_drep_t*)p_mad->p_mad_buf );
                if( status != IB_SUCCESS )
                        break;

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\kernel\al_proxy_cep.c trunk\core\al\kernel\al_proxy_cep.c
--- old\core\al\kernel\al_proxy_cep.c   Wed Jul 09 09:44:26 2008
+++ trunk\core\al\kernel\al_proxy_cep.c Thu Jul 10 17:17:26 2008
@@ -718,10 +718,8 @@ proxy_cep_drep(
                return CL_INVALID_PARAMETER;
        }

-       p_ioctl->cm_drep.p_drep_pdata = p_ioctl->pdata;
-
        (*(ib_api_status_t*)cl_ioctl_out_buf( h_ioctl )) = al_cep_drep(
-               p_context->h_al, p_ioctl->cid, &p_ioctl->cm_drep );
+               p_context->h_al, p_ioctl->cid, p_ioctl->pdata, p_ioctl->pdata_len );

        *p_ret_bytes = sizeof(ib_api_status_t);

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\user\ual_cm_cep.c trunk\core\al\user\ual_cm_cep.c
--- old\core\al\user\ual_cm_cep.c       Wed Jul 09 09:44:27 2008
+++ trunk\core\al\user\ual_cm_cep.c     Thu Jul 10 17:46:40 2008
@@ -1196,7 +1196,8 @@ ib_api_status_t
 al_cep_drep(
        IN                              ib_al_handle_t                          h_al,
        IN                              net32_t                                         cid,
-       IN              const   ib_cm_drep_t* const                     p_cm_drep )
+       IN              const   uint8_t* const                          p_pdata OPTIONAL,
+       IN              const   uint8_t                                         pdata_len )
 {
        ib_api_status_t                 status;
        ual_cep_drep_ioctl_t    ioctl;
@@ -1210,26 +1211,23 @@ al_cep_drep(
                return IB_INVALID_HANDLE;
        }

-       if( !p_cm_drep )
-       {
-               AL_EXIT( AL_DBG_CM );
-               return IB_INVALID_HANDLE;
-       }
-    cl_memclr(&ioctl, sizeof(ioctl));
        ioctl.cid = cid;
-       ioctl.cm_drep = *p_cm_drep;
        /* Copy private data, if any. */
-       if( p_cm_drep->p_drep_pdata )
+       if( p_pdata )
        {
-               if( p_cm_drep->drep_length > IB_DREP_PDATA_SIZE )
+               if( pdata_len > IB_DREP_PDATA_SIZE )
                {
                        AL_PRINT_EXIT(TRACE_LEVEL_ERROR ,AL_DBG_ERROR,
                                ("private data larger than DREP private data.\n") );
                        return IB_INVALID_SETTING;
                }

-               cl_memcpy(
-                       ioctl.pdata, p_cm_drep->p_drep_pdata, p_cm_drep->drep_length );
+               cl_memcpy( ioctl.pdata, p_pdata, pdata_len );
+               ioctl.pdata_len = pdata_len;
+       }
+       else
+       {
+               ioctl.pdata_len = 0;
        }

        if( !DeviceIoControl( g_al_device, UAL_CEP_DREP, &ioctl,
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\inc\iba\ib_al_ioctl.h trunk\inc\iba\ib_al_ioctl.h
--- old\inc\iba\ib_al_ioctl.h   Wed Jul 09 09:44:27 2008
+++ trunk\inc\iba\ib_al_ioctl.h Thu Jul 10 17:12:44 2008
@@ -3030,7 +3030,7 @@ typedef struct _ual_cep_dreq_ioctl
 typedef struct _ual_cep_drep_ioctl
 {
        net32_t                                         cid;
-       ib_cm_drep_t                            cm_drep;
+       uint8_t                                         pdata_len;
        uint8_t                                         pdata[IB_DREP_PDATA_SIZE];

 }      ual_cep_drep_ioctl_t;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: drep.patch
Type: application/octet-stream
Size: 5283 bytes
Desc: drep.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080710/cecb8cd1/attachment.obj>


More information about the ofw mailing list