[ofw] [PATCH] Remove listen error callback

Fab Tillier ftillier at windows.microsoft.com
Wed Jul 9 09:55:37 PDT 2008


The listen error callback is the vestigial tail of IBAL...  At some point in the distant past, it served a function, though a dubious one at best given the implementation of the listen error callbacks in client code that all effectively generate some output but really ignore the event.

This patch eliminates the listen error callback, its associated callback record, and all the no-op handlers in the various clients.

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

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      Wed Jul 09 09:44:27 2008
+++ trunk\core\al\al_cm_qp.c    Wed Jul 09 09:51:50 2008
@@ -1811,7 +1811,6 @@ static ib_api_status_t
 __cep_listen(
        IN              const   ib_al_handle_t                          h_al,
        IN              const   ib_cm_listen_t* const           p_cm_listen,
-       IN              const   ib_pfn_listen_err_cb_t          pfn_listen_err_cb,
        IN              const   void* const                                     listen_context,
                OUT                     ib_listen_handle_t* const       ph_cm_listen )
 {
@@ -1821,8 +1820,6 @@ __cep_listen(

        AL_ENTER( AL_DBG_CM );

-       UNUSED_PARAM( pfn_listen_err_cb );
-
        /* Allocate the listen object. */
        p_listen = (al_listen_t*)cl_zalloc( sizeof(al_listen_t) );
        if( !p_listen )
@@ -1900,7 +1897,6 @@ ib_api_status_t
 ib_cm_listen(
        IN              const   ib_al_handle_t                          h_al,
        IN              const   ib_cm_listen_t* const           p_cm_listen,
-       IN              const   ib_pfn_listen_err_cb_t          pfn_listen_err_cb,
        IN              const   void* const                                     listen_context,
                OUT                     ib_listen_handle_t* const       ph_cm_listen )
 {
@@ -1913,14 +1909,13 @@ ib_cm_listen(
                AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );
                return IB_INVALID_AL_HANDLE;
        }
-       if( !p_cm_listen || !pfn_listen_err_cb || !ph_cm_listen )
+       if( !p_cm_listen || !ph_cm_listen )
        {
                AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );
                return IB_INVALID_PARAMETER;
        }

-       status = __cep_listen(h_al, p_cm_listen, pfn_listen_err_cb, listen_context,
-               ph_cm_listen );
+       status = __cep_listen(h_al, p_cm_listen, listen_context, ph_cm_listen );

        AL_EXIT( AL_DBG_CM );
        return status;
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\inc\iba\ib_al.h trunk\inc\iba\ib_al.h
--- old\inc\iba\ib_al.h Tue Jul 01 09:31:01 2008
+++ trunk\inc\iba\ib_al.h       Wed Jul 09 09:51:50 2008
@@ -5835,68 +5835,6 @@ typedef struct _ib_cm_drep
 *****/


-/****s* Access Layer/ib_listen_err_rec_t
-* NAME
-*      ib_listen_err_rec_t
-*
-* DESCRIPTION
-*      Information returned to the user when an error occurs on a listen request.
-*
-* SYNOPSIS
-*/
-typedef struct _ib_listen_err_rec
-{
-       TO_LONG_PTR(void* ,                                                             listen_context) ;
-       ib_api_status_t                                                         reason;
-TO_LONG_PTR(   ib_listen_handle_t ,                                                    h_cm_listen) ;
-
-}      ib_listen_err_rec_t;
-/*
-* FIELDS
-*      listen_context
-*              User-defined context information associated with the listen request
-*              through the ib_cm_listen call.
-*
-*      reason
-*              A status that identifies the reason for error being reported.
-*
-*      h_cm_listen
-*              The handle for the listen request.  This handle will match the handle
-*              returned by ib_cm_listen call.  It is provided in case an error event
-*              occurs before a client's call to ib_cm_listen can return.
-*
-* SEE ALSO
-*      ib_pfn_listen_err_cb_t, ib_api_status_t
-*****/
-
-
-/****f* Access Layer/ib_pfn_listen_err_cb_t
-* NAME
-*      ib_pfn_listen_err_cb_t
-*
-* DESCRIPTION
-*      A user-specified callback that is invoked after an error has occurred on
-*      a listen request.
-*
-* SYNOPSIS
-*/
-typedef void
-(AL_API * FUNC_PTR64 ib_pfn_listen_err_cb_t)(
-       IN                              ib_listen_err_rec_t                     *p_listen_err_rec );
-/*
-* PARAMETERS
-*      p_listen_err_rec
-*              [in] Error information returned to the user, indicating the reason
-*              for the error and associated context information.
-*
-* NOTES
-*      This callback is invoked within a system thread context in the kernel.
-*
-* SEE ALSO
-*      p_listen_err_rec
-*****/
-
-
 /****f* Access Layer/ib_cm_listen
 * NAME
 *      ib_cm_listen
@@ -5911,7 +5849,6 @@ AL_EXPORT ib_api_status_t AL_API
 ib_cm_listen(
        IN              const   ib_al_handle_t                          h_al,
        IN              const   ib_cm_listen_t* const           p_cm_listen,
-       IN              const   ib_pfn_listen_err_cb_t          pfn_listen_err_cb,
        IN              const   void* const                                     listen_context,
                OUT                     ib_listen_handle_t* const       ph_cm_listen );
 /*
@@ -5923,10 +5860,6 @@ ib_cm_listen(
 *              [in] Information used to direct the listen request to match incoming
 *              connection requests.
 *
-*      pfn_listen_err_cb
-*              [in] User-specified error callback routine to invoke if an error
-*              occurs while listening.
-*
 *      listen_context
 *              User-specified context information that is returned as a part of all
 *              connection requests through the pfn_cm_req_cb routine.  The context is
@@ -5983,7 +5916,7 @@ ib_cm_listen(
 *      thread.
 *
 * SEE ALSO
-*      ib_cm_listen_t, ib_pfn_listen_err_cb_t
+*      ib_cm_listen_t
 *****/


diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\inc\kernel\iba\ib_al_ifc.h trunk\inc\kernel\iba\ib_al_ifc.h
--- old\inc\kernel\iba\ib_al_ifc.h      Tue Jul 01 09:31:00 2008
+++ trunk\inc\kernel\iba\ib_al_ifc.h    Wed Jul 09 09:51:50 2008
@@ -419,7 +419,6 @@ typedef ib_api_status_t
 (*ib_pfn_cm_listen_t)(
        IN              const   ib_al_handle_t                          h_al,
        IN              const   ib_cm_listen_t* const           p_cm_listen,
-       IN              const   ib_pfn_listen_err_cb_t          listen_err_cb,
        IN              const   void* const                                     listen_context,
                OUT                     ib_listen_handle_t* const       ph_cm_listen );

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\tests\alts\cmtests.c trunk\tests\alts\cmtests.c
--- old\tests\alts\cmtests.c    Tue Jul 01 09:31:00 2008
+++ trunk\tests\alts\cmtests.c  Wed Jul 09 09:51:50 2008
@@ -1972,17 +1972,6 @@ alts_cm_mra_cb(
        ALTS_EXIT( ALTS_DBG_VERBOSE);
 }

-void
-alts_cm_err_cb(
-       IN                              ib_listen_err_rec_t                     *p_err_rec )
-{
-       ALTS_ENTER( ALTS_DBG_VERBOSE );
-
-       UNUSED_PARAM( p_err_rec );
-
-       ALTS_EXIT( ALTS_DBG_VERBOSE);
-}
-

 void
 alts_cm_rtu_cb(
@@ -2210,8 +2199,7 @@ alts_cm_client_server(
        p_listen->pkey = p_ca_obj->p_dest_port_attr->p_pkey_table[0];
        p_listen->pfn_cm_req_cb = alts_cm_req_cb;

-       ib_status = ib_cm_listen(h_al, p_listen, alts_cm_err_cb,
-               p_ca_obj, &p_ca_obj->h_cm_listen );
+       ib_status = ib_cm_listen(h_al, p_listen, p_ca_obj, &p_ca_obj->h_cm_listen );
        if(ib_status != IB_SUCCESS)
        {
                ALTS_PRINT( ALTS_DBG_ERROR,
@@ -2225,8 +2213,7 @@ alts_cm_client_server(
                p_listen->svc_id = 2;
                p_ca_obj->handoff_svc_id = 2;

-               ib_status = ib_cm_listen(h_al, p_listen, alts_cm_err_cb,
-                       p_ca_obj, &p_ca_obj->h_cm_listen_handoff );
+               ib_status = ib_cm_listen(h_al, p_listen, p_ca_obj, &p_ca_obj->h_cm_listen_handoff );
                if(ib_status != IB_SUCCESS)
                {
                        ALTS_PRINT( ALTS_DBG_ERROR,
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\tests\cmtest\user\cmtest_main.c trunk\tests\cmtest\user\cmtest_main.c
--- old\tests\cmtest\user\cmtest_main.c Tue Jul 01 09:30:59 2008
+++ trunk\tests\cmtest\user\cmtest_main.c       Wed Jul 09 09:51:50 2008
@@ -675,18 +675,6 @@ __ca_async_event_cb(


 static void AL_API
-__cm_listen_err_cb(
-       IN                              ib_listen_err_rec_t                     *p_listen_err_rec )
-{
-       CL_ENTER( CMT_DBG_VERBOSE, cmt_dbg_lvl );
-       if( !p_listen_err_rec )
-               printf( "%s NULL p_listen_err_rec\n", __FUNCTION__ );
-       CL_EXIT( CMT_DBG_VERBOSE, cmt_dbg_lvl );
-}
-
-
-
-static void AL_API
 __cancel_listen_cb(
        IN                              void                                            *context )
 {
@@ -1520,7 +1508,6 @@ __listen()

        status = ib_cm_listen( g_root.h_al,
                                                   &cm_listen,
-                                                  __cm_listen_err_cb,
                                                   &g_root,
                                                   &g_root.h_listen );
        if( status != IB_SUCCESS )
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\ulp\dapl\dapl\ibal\dapl_ibal_cm.c trunk\ulp\dapl\dapl\ibal\dapl_ibal_cm.c
--- old\ulp\dapl\dapl\ibal\dapl_ibal_cm.c       Thu Jun 26 20:35:12 2008
+++ trunk\ulp\dapl\dapl\ibal\dapl_ibal_cm.c     Wed Jul 09 09:51:50 2008
@@ -590,15 +590,6 @@ dapli_ib_sa_query_cb (
     }
 }

-
-static void
-dapli_ibal_listen_err_cb (
-        IN    ib_listen_err_rec_t          *p_listen_err_rec )
-{
-    UNUSED_PARAM( p_listen_err_rec );
-    dapl_dbg_log (DAPL_DBG_TYPE_CM, "--> DiLEcb: CM callback listen error\n");
-}
-
 static void
 dapli_ib_cm_apr_cb (
         IN    ib_cm_apr_rec_t          *p_cm_apr_rec )
@@ -1480,7 +1471,6 @@ dapls_ib_setup_conn_listener (

     ib_status = ib_cm_listen ( dapl_ibal_root.h_al,
                                &cm_listen,
-                               dapli_ibal_listen_err_cb,
                                (void *) sp_ptr,
                                &sp_ptr->cm_srvc_handle);

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\ulp\dapl2\dapl\ibal\dapl_ibal_cm.c trunk\ulp\dapl2\dapl\ibal\dapl_ibal_cm.c
--- old\ulp\dapl2\dapl\ibal\dapl_ibal_cm.c      Thu Jun 26 20:35:13 2008
+++ trunk\ulp\dapl2\dapl\ibal\dapl_ibal_cm.c    Wed Jul 09 09:51:50 2008
@@ -79,16 +79,6 @@ dapli_ib_cm_event_str(ib_cm_events_t e)


 static void
-dapli_ibal_listen_err_cb (
-        IN    ib_listen_err_rec_t          *p_listen_err_rec )
-{
-    UNUSED_PARAM( p_listen_err_rec );
-
-    dapl_dbg_log (DAPL_DBG_TYPE_CM, "--> %s: CM callback listen error\n",
-                  "DiLEcb");
-}
-
-static void
 dapli_ib_cm_apr_cb (
         IN    ib_cm_apr_rec_t          *p_cm_apr_rec )
 {
@@ -1174,7 +1164,6 @@ dapls_ib_setup_conn_listener (

     ib_status = ib_cm_listen ( dapl_ibal_root.h_al,
                                &cm_listen,
-                               dapli_ibal_listen_err_cb,
                                (void *) sp_ptr,
                                &sp_ptr->cm_srvc_handle );

Only in old\ulp\ipoib\kernel: ipoib_driver.rej.c
diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\ulp\wsd\user\ib_cm.c trunk\ulp\wsd\user\ib_cm.c
--- old\ulp\wsd\user\ib_cm.c    Mon Jun 30 11:07:49 2008
+++ trunk\ulp\wsd\user\ib_cm.c  Wed Jul 09 09:51:50 2008
@@ -43,7 +43,6 @@ static void AL_API cm_rtu_callback(IN ib
 static void AL_API cm_rej_callback(IN ib_cm_rej_rec_t * p_cm_rej_rec);
 static void AL_API cm_mra_callback(IN ib_cm_mra_rec_t * p_cm_mra_rec);
 static void AL_API cm_dreq_callback(IN ib_cm_dreq_rec_t * p_cm_dreq_rec);
-static void AL_API listen_err_callback(IN ib_listen_err_rec_t * p_listen_err_rec);
 static void AL_API cm_apr_callback(IN ib_cm_apr_rec_t * p_cm_apr_rec);


@@ -583,27 +582,6 @@ cm_drep_callback(


 /*
- * A user-specified callback that is invoked after an error has occurred on
- * a listen request.
- */
-static void AL_API
-listen_err_callback(
-       IN                              ib_listen_err_rec_t                     *p_listen_err_rec )
-{
-       /* TODO */
-       IBSP_ENTER( IBSP_DBG_CM );
-
-       UNUSED_PARAM( p_listen_err_rec );
-
-       IBSP_ERROR( ("not implemented") );
-
-       CL_ASSERT( 0 );
-
-       IBSP_EXIT( IBSP_DBG_CM );
-}
-
-
-/*
  * A user-specified callback that is invoked after receiving a load
  * alternate path response message.
  */
@@ -688,7 +666,7 @@ ib_listen(

        param.qp_type = IB_QPT_RELIABLE_CONN;

-       status = ib_cm_listen( g_ibsp.al_handle, &param, listen_err_callback, socket_info,      /* context */
+       status = ib_cm_listen( g_ibsp.al_handle, &param, socket_info,   /* context */
                &socket_info->listen.handle );

        if( status != IB_SUCCESS )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listen.patch
Type: application/octet-stream
Size: 10786 bytes
Desc: listen.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080709/4e39444b/attachment.obj>


More information about the ofw mailing list