[ofw] [PATCH] Cleanup XXX_PTR64 macros from IPoIB

Tzachi Dar tzachid at mellanox.co.il
Sat Jun 28 11:45:54 PDT 2008


Hi Fab,

This patch seems fine, but my patch program has failed to apply it.
It succeeded in all files except for ipoib_port.c

I have tried working with the version that comes with tortoise SVN as
well as the patch file that comes from win32gnu. Please let me know
which version have you been using to apply this patch.

Please also apply the patch yourself to save time.

Thanks
Tzachi 

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Fab Tillier
> Sent: Friday, June 27, 2008 9:52 AM
> To: ofw at lists.openfabrics.org
> Subject: [ofw] [PATCH] Cleanup XXX_PTR64 macros from IPoIB
> 
> This patch removes XXX_PTR64 and TO_ULONG_PTR macro use from IPoIB.
> 
> Signed-off-by: Fab Tillier <ftillier at microsoft.com>
> 
> Index: ulp/ipoib/kernel/ipoib_ibat.c
> ===================================================================
> --- ulp/ipoib/kernel/ipoib_ibat.c       (revision 1300)
> +++ ulp/ipoib/kernel/ipoib_ibat.c       (working copy)
> @@ -1,6 +1,7 @@
>  /*
>   * Copyright (c) 2005 Mellanox Technologies.  All rights reserved.
>   * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -546,25 +547,25 @@
> 
>         switch( pIoStack->Parameters.DeviceIoControl.IoControlCode )
>         {
> -       case IOCTL_IBAT_PORTS: //check_done, fixed print_ips
> +       case IOCTL_IBAT_PORTS:
>                 IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,
>                         ("IOCTL_IBAT_PORTS received\n") );
>                 status = __ibat_get_ports( pIrp, pIoStack );
>                 break;
> 
> -       case IOCTL_IBAT_IP_ADDRESSES: //check_done, fixed 
> query_ip_address,CProvider::QueryAddressList,print_ips
> +       case IOCTL_IBAT_IP_ADDRESSES:
>                 IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,
>                         ("IOCTL_IBAT_IP_ADDRESSES received\n" ));
>                 status = __ibat_get_ips( pIrp, pIoStack );
>                 break;
> 
> -       case IOCTL_IBAT_MAC_TO_GID: //check_done, fixed 
> remote_ip, SdpArp::DestPortGidFromMac
> +       case IOCTL_IBAT_MAC_TO_GID:
>                 IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,
>                         ("IOCTL_IBAT_MAC_TO_GID received\n" ));
>                 status = __ibat_mac_to_gid( pIrp, pIoStack );
>                 break;
> 
> -       case IOCTL_IBAT_IP_TO_PORT: //check_done, fixed 
> CProvider::OpenAdapter
> +       case IOCTL_IBAT_IP_TO_PORT:
>                 IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,
>                         ("IOCTL_IBAT_IP_TO_PORT received\n" ));
>                 status = __ibat_ip_to_port( pIrp, pIoStack );
> Index: ulp/ipoib/kernel/ipoib_adapter.c
> ===================================================================
> --- ulp/ipoib/kernel/ipoib_adapter.c    (revision 1300)
> +++ ulp/ipoib/kernel/ipoib_adapter.c    (working copy)
> @@ -1,6 +1,7 @@
>  /*
>   * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.
>   * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -783,7 +784,7 @@
>         IN                              ipoib_adapter_t* 
> const          p_adapter )
>  {
>         ib_api_status_t         status;
> -       ib_pnp_handle_t VOID_PTR64              h_pnp;
> +       ib_pnp_handle_t         h_pnp;
> 
>         IPOIB_ENTER( IPOIB_DBG_INIT );
> 
> Index: ulp/ipoib/kernel/ipoib_endpoint.c 
> ===================================================================
> --- ulp/ipoib/kernel/ipoib_endpoint.c   (revision 1300)
> +++ ulp/ipoib/kernel/ipoib_endpoint.c   (working copy)
> @@ -1,6 +1,7 @@
>  /*
>   * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.
>   * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -58,10 +59,10 @@
> 
>  static ib_api_status_t
>  __create_mcast_av(
> -       IN                              ib_pd_handle_t 
> FUNC_PTR64                               h_pd,
> +       IN                              ib_pd_handle_t        
>                   h_pd,
>         IN                              uint8_t               
>                           port_num,
>         IN                              ib_member_rec_t* 
> const          p_member_rec,
> -               OUT                     ib_av_handle_t* 
> FUNC_PTR64 const                ph_av );
> +               OUT                     ib_av_handle_t* const 
>           ph_av );
> 
>  static inline ipoib_port_t*
>  __endpt_parent(
> @@ -112,10 +113,10 @@
> 
>  static ib_api_status_t
>  __create_mcast_av(
> -       IN                              ib_pd_handle_t 
> FUNC_PTR64                               h_pd,
> +       IN                              ib_pd_handle_t        
>                   h_pd,
>         IN                              uint8_t               
>                           port_num,
>         IN                              ib_member_rec_t* 
> const          p_member_rec,
> -               OUT                     ib_av_handle_t* 
> FUNC_PTR64 const                ph_av )
> +               OUT                     ib_av_handle_t* const 
>           ph_av )
>  {
>         ib_av_attr_t    av_attr;
>         uint32_t                flow_lbl;
> @@ -158,7 +159,7 @@
>  ib_api_status_t
>  ipoib_endpt_set_mcast(
>         IN                              ipoib_endpt_t* const  
>           p_endpt,
> -       IN                              ib_pd_handle_t 
> FUNC_PTR64                               h_pd,
> +       IN                              ib_pd_handle_t        
>                   h_pd,
>         IN                              uint8_t               
>                           port_num,
>         IN                              ib_mcast_rec_t* const 
>           p_mcast_rec )
>  {
> @@ -355,7 +356,7 @@
> 
>         IPOIB_ENTER( IPOIB_DBG_ENDPT );
> 
> -       p_endpt = 
> (ipoib_endpt_t*VOID_PTR64)p_query_rec->query_context;
> +       p_endpt = (ipoib_endpt_t*)p_query_rec->query_context;
>         p_port = __endpt_parent( p_endpt );
> 
>         cl_obj_lock( &p_endpt->obj );
> Index: ulp/ipoib/kernel/ipoib_port.c
> ===================================================================
> --- ulp/ipoib/kernel/ipoib_port.c       (revision 1300)
> +++ ulp/ipoib/kernel/ipoib_port.c       (working copy)
> @@ -1,6 +1,7 @@
>  /*
>   * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.
>   * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -208,7 +209,7 @@
> 
>  static void
>  __recv_cb(
> -       IN              const   ib_cq_handle_t FUNC_PTR64     
>                           h_cq,
> +       IN              const   ib_cq_handle_t                
>           h_cq,
>         IN                              void                  
>                           *cq_context );
> 
>  static void
> @@ -321,7 +322,7 @@
> 
>  static void
>  __send_cb(
> -       IN              const   ib_cq_handle_t FUNC_PTR64     
>                           h_cq,
> +       IN              const   ib_cq_handle_t                
>           h_cq,
>         IN                              void                  
>                           *cq_context );
> 
> 
> @@ -1582,7 +1583,7 @@
> 
>  static void
>  __recv_cb(
> -       IN              const   ib_cq_handle_t FUNC_PTR64     
>                           h_cq,
> +       IN              const   ib_cq_handle_t                
>           h_cq,
>         IN                              void                  
>                           *cq_context )
>  {
>         ipoib_port_t            *p_port;
> @@ -3933,7 +3934,7 @@
> 
>  static void
>  __send_cb(
> -       IN              const   ib_cq_handle_t FUNC_PTR64     
>                           h_cq,
> +       IN              const   ib_cq_handle_t                
>           h_cq,
>         IN                              void                  
>                           *cq_context )
>  {
>         ipoib_port_t            *p_port;
> @@ -4826,7 +4827,7 @@
> 
>         IPOIB_ENTER( IPOIB_DBG_INIT );
> 
> -       p_port = (ipoib_port_t* VOID_PTR64)p_query_rec->query_context;
> +       p_port = (ipoib_port_t*)p_query_rec->query_context;
> 
>         cl_obj_lock( &p_port->obj );
>         p_port->ib_mgr.h_query = NULL;
> @@ -4983,7 +4984,7 @@
> 
>         IPOIB_ENTER( IPOIB_DBG_INIT );
> 
> -       p_port = (ipoib_port_t* VOID_PTR64)p_query_rec->query_context;
> +       p_port = (ipoib_port_t*)p_query_rec->query_context;
> 
>         cl_obj_lock( &p_port->obj );
>         p_port->ib_mgr.h_query = NULL;
> @@ -5256,7 +5256,7 @@
> 
>         IPOIB_ENTER( IPOIB_DBG_INIT );
> 
> -       p_port = (ipoib_port_t* VOID_PTR64)p_mcast_rec->mcast_context;
> +       p_port = (ipoib_port_t*)p_mcast_rec->mcast_context;
> 
>         cl_obj_lock( &p_port->obj );
>         if( p_port->state != IB_QPS_INIT ) @@ -5376,7 +5376,7 @@  {
>         UNUSED_PARAM( p_event_rec );
>         CL_ASSERT( p_event_rec->context );
> -       ((ipoib_port_t* 
> VOID_PTR64)p_event_rec->context)->p_adapter->hung = TRUE;
> +       ((ipoib_port_t*)p_event_rec->context)->p_adapter->hung = TRUE;
>  }
> 
> 
> @@ -5386,7 +5386,7 @@
>  {
>         UNUSED_PARAM( p_event_rec );
>         CL_ASSERT( p_event_rec->context );
> -       ((ipoib_port_t* 
> VOID_PTR64)p_event_rec->context)->p_adapter->hung = TRUE;
> +       ((ipoib_port_t*)p_event_rec->context)->p_adapter->hung = TRUE;
>  }
> 
> 
> @@ -5575,7 +5575,7 @@
> 
>         IPOIB_ENTER( IPOIB_DBG_MCAST );
> 
> -       p_port = (ipoib_port_t* VOID_PTR64)p_mcast_rec->mcast_context;
> +       p_port = (ipoib_port_t*)p_mcast_rec->mcast_context;
> 
>         cl_obj_lock( &p_port->obj );
>         if( p_port->state != IB_QPS_RTS ) @@ -5675,7 +5675,7 @@
> 
>         IPOIB_ENTER( IPOIB_DBG_MCAST );
> 
> -       p_port = (ipoib_port_t* VOID_PTR64)context;
> +       p_port = (ipoib_port_t*)context;
> 
>         IPOIB_PRINT( TRACE_LEVEL_VERBOSE, 
> IPOIB_DBG_MCAST,("p_port->mcast_cnt = %d\n", p_port->mcast_cnt));
> 
> @@ -5703,7 +5703,7 @@
> 
>         IPOIB_ENTER( IPOIB_DBG_MCAST );
> 
> -       p_port = (ipoib_port_t* VOID_PTR64)context;
> +       p_port = (ipoib_port_t*)context;
> 
>         ipoib_port_deref( p_port, ref_leave_mcast);
>         IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,
> Index: ulp/ipoib/kernel/ipoib_adapter.h
> ===================================================================
> --- ulp/ipoib/kernel/ipoib_adapter.h    (revision 1300)
> +++ ulp/ipoib/kernel/ipoib_adapter.h    (working copy)
> @@ -1,6 +1,7 @@
>  /*
>   * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.
>   * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -141,8 +142,8 @@
> 
>         cl_list_item_t                  entry;
> 
> -TO_LONG_PTR(   ib_al_handle_t  ,                       h_al) ;
> -TO_LONG_PTR(   ib_pnp_handle_t ,                       h_pnp) ;
> +       ib_al_handle_t                  h_al;
> +       ib_pnp_handle_t                 h_pnp;
> 
>         ib_pnp_event_t                  state;
>         boolean_t                               hung;
> Index: ulp/ipoib/kernel/ipoib_endpoint.h 
> ===================================================================
> --- ulp/ipoib/kernel/ipoib_endpoint.h   (revision 1300)
> +++ ulp/ipoib/kernel/ipoib_endpoint.h   (working copy)
> @@ -1,6 +1,7 @@
>  /*
>   * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.
>   * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -52,13 +53,13 @@
>         cl_map_item_t                   mac_item;
>         cl_fmap_item_t                  gid_item;
>         cl_map_item_t                   lid_item;
> -TO_LONG_PTR(   ib_query_handle_t ,             h_query) ;
> -TO_LONG_PTR(   ib_mcast_handle_t ,             h_mcast) ;
> +       ib_query_handle_t               h_query;
> +       ib_mcast_handle_t               h_mcast;
>         mac_addr_t                              mac;
>         ib_gid_t                                dgid;
>         net16_t                                 dlid;
>         net32_t                                 qpn;
> -TO_LONG_PTR(   ib_av_handle_t ,                        h_av) ;
> +       ib_av_handle_t                  h_av;
>         boolean_t                               expired;
>         ib_al_ifc_t                             *p_ifc;
> 
> @@ -121,7 +122,7 @@
>  ib_api_status_t
>  ipoib_endpt_set_mcast(
>         IN                              ipoib_endpt_t* const  
>           p_endpt,
> -       IN                              ib_pd_handle_t 
> FUNC_PTR64                               h_pd,
> +       IN                              ib_pd_handle_t        
>                   h_pd,
>         IN                              uint8_t               
>                           port_num,
>         IN                              ib_mcast_rec_t* const 
>           p_mcast_rec );
> 
> Index: ulp/ipoib/kernel/ipoib_port.h
> ===================================================================
> --- ulp/ipoib/kernel/ipoib_port.h       (revision 1300)
> +++ ulp/ipoib/kernel/ipoib_port.h       (working copy)
> @@ -1,6 +1,7 @@
>  /*
>   * Copyright (c) 2005 SilverStorm Technologies.  All rights reserved.
>   * Copyright (c) 2006 Mellanox Technologies.  All rights reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation.  All 
> rights reserved.
>   *
>   * This software is available to you under the OpenIB.org BSD license
>   * below:
> @@ -80,15 +81,15 @@
> 
>  typedef struct _ipoib_ib_mgr
>  {
> -TO_LONG_PTR(   ib_ca_handle_t ,                        h_ca) ;
> -TO_LONG_PTR(   ib_pd_handle_t ,                        h_pd) ;
> -TO_LONG_PTR(   ib_cq_handle_t ,                        h_recv_cq) ;
> -TO_LONG_PTR(   ib_cq_handle_t ,                        h_send_cq) ;
> -TO_LONG_PTR(   ib_qp_handle_t ,                        h_qp) ;
> -TO_LONG_PTR(   ib_query_handle_t ,             h_query) ;
> +       ib_ca_handle_t                  h_ca;
> +       ib_pd_handle_t                  h_pd;
> +       ib_cq_handle_t                  h_recv_cq;
> +       ib_cq_handle_t                  h_send_cq;
> +       ib_qp_handle_t                  h_qp;
> +       ib_query_handle_t               h_query;
>         net32_t                                 qpn;
> 
> -TO_LONG_PTR(   ib_mr_handle_t ,                        h_mr) ;
> +       ib_mr_handle_t                  h_mr;
>         net32_t                                 lkey;
> 
>         uint8_t                                 rate;
> 



More information about the ofw mailing list