[ofw] [PATCH] Cleanup XXX_PTR64 macros from perftests
Tzachi Dar
tzachid at mellanox.co.il
Sun Jun 29 06:56:08 PDT 2008
Applied in version 1304.
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 perftests
>
> This patch removes XXX_PTR64 and TO_ULONG_PTR macro use from
> the perf tests.
>
> Signed-off-by: Fab Tillier <ftillier at microsoft.com>
>
> Index: tools/perftests/user/send_bw/send_bw.c
> ===================================================================
> --- tools/perftests/user/send_bw/send_bw.c (revision 1300)
> +++ tools/perftests/user/send_bw/send_bw.c (working copy)
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 Topspin Communications. All rights reserved.
> * Copyright (c) 2005 Mellanox Technologies Ltd. All rights
> reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under a choice of one of two
> * licenses. You may choose to be licensed under the terms
> of the GNU @@ -61,7 +62,7 @@
>
> void
> pp_cq_comp_cb(
> - IN const ib_cq_handle_t FUNC_PTR64
> h_cq,
> + IN const ib_cq_handle_t
> h_cq,
> IN void
> *cq_context )
> {
> UNUSED_PARAM( h_cq );
> @@ -85,7 +86,7 @@
> if (!ctx)
> return NULL;
>
> - ctx->qp = malloc(sizeof (ib_qp_handle_t VOID_PTR64));
> + ctx->qp = malloc(sizeof (ib_qp_handle_t));
> if (!ctx->qp) {
> perror("malloc");
> return NULL;
> @@ -578,7 +579,7 @@
> struct pingpong_dest *rem_dest, int size) {
>
> - ib_qp_handle_t VOID_PTR64 qp;
> + ib_qp_handle_t qp;
> int scnt, ccnt, rcnt;
> ib_recv_wr_t *bad_wr_recv;
> ib_api_status_t ib_status;
> @@ -725,7 +726,7 @@
> struct pingpong_dest *rem_dest, int size) {
>
> - ib_qp_handle_t VOID_PTR64 qp;
> + ib_qp_handle_t qp;
> int scnt, ccnt, rcnt;
> ib_recv_wr_t *bad_wr_recv;
> ib_api_status_t ib_status;
> @@ -984,7 +985,7 @@
> break;
> case 'i':
> ib_port = strtol(optarg, NULL, 0);
> - if (ib_port <= 0) {
> + if (ib_port < 0) {
> usage(argv[0]);
> return 1;
> }
> Index: tools/perftests/user/write_bw/write_bw.c
> ===================================================================
> --- tools/perftests/user/write_bw/write_bw.c (revision 1300)
> +++ tools/perftests/user/write_bw/write_bw.c (working copy)
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 Topspin Communications. All rights reserved.
> * Copyright (c) 2005 Mellanox Technologies Ltd. All rights
> reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under a choice of one of two
> * licenses. You may choose to be licensed under the terms
> of the GNU @@ -58,7 +59,7 @@
>
> void
> pp_cq_comp_cb(
> - IN const ib_cq_handle_t FUNC_PTR64
> h_cq,
> + IN const ib_cq_handle_t
> h_cq,
> IN void
> *cq_context )
> {
> UNUSED_PARAM( h_cq );
> @@ -83,7 +84,7 @@
> ctx->size = size;
> ctx->tx_depth = user_parm->tx_depth;
>
> - ctx->qp = malloc(sizeof (ib_qp_handle_t VOID_PTR64) *
> user_parm->numofqps );
> + ctx->qp = malloc(sizeof (ib_qp_handle_t) *
> user_parm->numofqps
> + );
> if (!ctx->qp) {
> perror("malloc");
> return NULL;
> @@ -529,7 +530,7 @@
> struct pingpong_dest *rem_dest, int size) {
> ib_api_status_t ib_status;
> - ib_qp_handle_t VOID_PTR64 qp;
> + ib_qp_handle_t qp;
> int scnt, ccnt ;
> int index;
> ib_send_wr_t *bad_wr;
> Index: tools/perftests/user/perf_defs.h
> ===================================================================
> --- tools/perftests/user/perf_defs.h (revision 1300)
> +++ tools/perftests/user/perf_defs.h (working copy)
> @@ -1,5 +1,6 @@
> /*
> * Copyright (c) 2005 Mellanox Technologies Ltd. All rights
> reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under a choice of one of two
> * licenses. You may choose to be licensed under the terms
> of the GNU @@ -84,19 +85,19 @@ #endif
>
> struct pingpong_context {
> -TO_LONG_PTR( ib_ca_handle_t , context) ;
> -TO_LONG_PTR( ib_ca_handle_t , ca) ;
> + ib_ca_handle_t context;
> + ib_ca_handle_t ca;
> ib_ca_attr_t *ca_attr;
> -TO_LONG_PTR( ib_al_handle_t , al) ;
> + ib_al_handle_t al;
> //PORTED struct ibv_comp_channel *channel;
> void* channel; //PORTED REMOVE
> -TO_LONG_PTR( ib_pd_handle_t , pd) ;
> -TO_LONG_PTR( ib_mr_handle_t , mr) ;
> + ib_pd_handle_t pd;
> + ib_mr_handle_t mr;
> uint32_t rkey;
> uint32_t lkey;
> -TO_LONG_PTR( ib_cq_handle_t , scq) ;
> -TO_LONG_PTR( ib_cq_handle_t , rcq) ;
> -TO_LONG_PTR( ib_qp_handle_t * , qp) ;
> + ib_cq_handle_t scq;
> + ib_cq_handle_t rcq;
> + ib_qp_handle_t *qp;
> ib_qp_attr_t *qp_attr;
> void *buf;
> unsigned size;
> @@ -107,7 +108,7 @@
> ib_send_wr_t wr;
> ib_recv_wr_t rwr;
>
> -TO_LONG_PTR( ib_av_handle_t , av) ;
> + ib_av_handle_t av;
>
> volatile char *post_buf;
> volatile char *poll_buf;
> Index: tools/perftests/user/send_lat/send_lat.c
> ===================================================================
> --- tools/perftests/user/send_lat/send_lat.c (revision 1300)
> +++ tools/perftests/user/send_lat/send_lat.c (working copy)
> @@ -2,6 +2,7 @@
> * Copyright (c) 2005 Topspin Communications. All rights reserved.
> * Copyright (c) 2005 Mellanox Technologies Ltd. All rights
> reserved.
> * Copyright (c) 2005 Hewlett Packard, Inc (Grant Grundler)
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under a choice of one of two
> * licenses. You may choose to be licensed under the terms
> of the GNU @@ -57,7 +58,7 @@
>
> void
> pp_cq_comp_cb(
> - IN const ib_cq_handle_t FUNC_PTR64
> h_cq,
> + IN const ib_cq_handle_t
> h_cq,
> IN void
> *cq_context )
> {
> UNUSED_PARAM( h_cq );
> @@ -79,7 +80,7 @@
> if (!ctx)
> return NULL;
>
> - ctx->qp = malloc(sizeof (ib_qp_handle_t VOID_PTR64));
> + ctx->qp = malloc(sizeof (ib_qp_handle_t));
> if (!ctx->qp) {
> perror("malloc");
> return NULL;
> @@ -602,7 +603,7 @@
> struct pingpong_dest *rem_dest, int size) {
> ib_api_status_t ib_status;
> - ib_qp_handle_t VOID_PTR64 qp;
> + ib_qp_handle_t qp;
> ib_recv_wr_t rwr;
> ib_recv_wr_t *bad_wr_recv;
> volatile char *poll_buf;
> Index: tools/perftests/user/write_lat/write_lat.c
> ===================================================================
> --- tools/perftests/user/write_lat/write_lat.c (revision 1300)
> +++ tools/perftests/user/write_lat/write_lat.c (working copy)
> @@ -2,6 +2,7 @@
> * Copyright (c) 2005 Topspin Communications. All rights reserved.
> * Copyright (c) 2005 Mellanox Technologies Ltd. All rights
> reserved.
> * Copyright (c) 2005 Hewlett Packard, Inc (Grant Grundler)
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under a choice of one of two
> * licenses. You may choose to be licensed under the terms
> of the GNU @@ -57,7 +58,7 @@
>
> void
> pp_cq_comp_cb(
> - IN const ib_cq_handle_t FUNC_PTR64
> h_cq,
> + IN const ib_cq_handle_t
> h_cq,
> IN void
> *cq_context )
> {
> UNUSED_PARAM( h_cq );
> @@ -84,7 +85,7 @@
> ctx->size = size;
> ctx->tx_depth = user_parm->tx_depth;
>
> - ctx->qp = malloc(sizeof (ib_qp_handle_t VOID_PTR64));
> + ctx->qp = malloc(sizeof (ib_qp_handle_t));
> if (!ctx->qp) {
> perror("malloc");
> return NULL;
> Index: tools/perftests/user/read_bw/read_bw.c
> ===================================================================
> --- tools/perftests/user/read_bw/read_bw.c (revision 1300)
> +++ tools/perftests/user/read_bw/read_bw.c (working copy)
> @@ -1,6 +1,7 @@
> /*
> * Copyright (c) 2005 Topspin Communications. All rights reserved.
> * Copyright (c) 2005 Mellanox Technologies Ltd. All rights
> reserved.
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under a choice of one of two
> * licenses. You may choose to be licensed under the terms
> of the GNU @@ -55,7 +56,7 @@
>
> void
> pp_cq_comp_cb(
> - IN const ib_cq_handle_t FUNC_PTR64
> h_cq,
> + IN const ib_cq_handle_t
> h_cq,
> IN void
> *cq_context )
> {
> UNUSED_PARAM( h_cq );
> @@ -82,7 +83,7 @@
> ctx->size = size;
> ctx->tx_depth = user_parm->tx_depth;
>
> - ctx->qp = malloc(sizeof (ib_qp_handle_t VOID_PTR64));
> + ctx->qp = malloc(sizeof (ib_qp_handle_t));
> if (!ctx->qp) {
> perror("malloc");
> return NULL;
> Index: tools/perftests/user/read_lat/read_lat.c
> ===================================================================
> --- tools/perftests/user/read_lat/read_lat.c (revision 1300)
> +++ tools/perftests/user/read_lat/read_lat.c (working copy)
> @@ -2,6 +2,7 @@
> * Copyright (c) 2005 Topspin Communications. All rights reserved.
> * Copyright (c) 2005 Mellanox Technologies Ltd. All rights
> reserved.
> * Copyright (c) 2005 Hewlett Packard, Inc (Grant Grundler)
> + * Portions Copyright (c) 2008 Microsoft Corporation. All
> rights reserved.
> *
> * This software is available to you under a choice of one of two
> * licenses. You may choose to be licensed under the terms
> of the GNU @@ -59,7 +60,7 @@
>
> void
> pp_cq_comp_cb(
> - IN const ib_cq_handle_t FUNC_PTR64
> h_cq,
> + IN const ib_cq_handle_t
> h_cq,
> IN void
> *cq_context )
> {
> UNUSED_PARAM( h_cq );
> @@ -86,7 +87,7 @@
> ctx->size = size;
> ctx->tx_depth = user_parm->tx_depth;
>
> - ctx->qp = malloc(sizeof (ib_qp_handle_t VOID_PTR64));
> + ctx->qp = malloc(sizeof (ib_qp_handle_t));
> if (!ctx->qp) {
> perror("malloc");
> return NULL;
>
More information about the ofw
mailing list