components/open-fabrics/libmlx4/patches/004-libmlx4-remove-xrc.patch
changeset 7865 22ec3267b2a3
parent 7864 f11e8d81786a
child 7875 fdce0f6fd2bd
equal deleted inserted replaced
7864:f11e8d81786a 7865:22ec3267b2a3
     1 #This patch was developed both in-house and from outside. We plan to submit it
       
     2 #upstream, but do not yet have a target date for doing so
       
     3 #
       
     4 # HG changeset patch
       
     5 # Parent  56ebd417e6ed24cfa11c23bd564417ec7d2e5812
       
     6 Disable xrc routines in libmlx4
       
     7 
       
     8 diff -r 56ebd417e6ed src/srq.c
       
     9 --- a/src/srq.c	Wed Dec 02 15:27:52 2015 -0800
       
    10 +++ b/src/srq.c	Wed Dec 02 15:47:02 2015 -0800
       
    11 @@ -286,6 +286,13 @@
       
    12  struct ibv_srq *mlx4_create_xrc_srq(struct ibv_context *context,
       
    13  				    struct ibv_srq_init_attr_ex *attr_ex)
       
    14  {
       
    15 +#if defined(__SVR4) && defined(__sun)
       
    16 +	/*
       
    17 +	 * Not supported by Solaris kernel driver.  When/if supported
       
    18 +	 * this routine will need to be ported.
       
    19 +	 */
       
    20 +	return NULL;
       
    21 +#else
       
    22  	struct mlx4_create_xsrq cmd;
       
    23  	struct mlx4_create_srq_resp resp;
       
    24  	struct mlx4_srq *srq;
       
    25 @@ -362,10 +369,18 @@
       
    26  err:
       
    27  	free(srq);
       
    28  	return NULL;
       
    29 +#endif
       
    30  }
       
    31  
       
    32  int mlx4_destroy_xrc_srq(struct ibv_srq *srq)
       
    33  {
       
    34 +#if defined(__SVR4) && defined(__sun)
       
    35 +        /*
       
    36 +         * Not supported by Solaris kernel driver.  When/if supported
       
    37 +         * this routine will need to be ported.
       
    38 +         */
       
    39 +        return NULL;
       
    40 +#else
       
    41  	struct mlx4_context *mctx = to_mctx(srq->context);
       
    42  	struct mlx4_srq *msrq = to_msrq(srq);
       
    43  	struct mlx4_cq *mcq;
       
    44 @@ -391,4 +406,5 @@
       
    45  	free(msrq);
       
    46  
       
    47  	return 0;
       
    48 +#endif
       
    49  }
       
    50 diff -r 56ebd417e6ed src/verbs.c
       
    51 --- a/src/verbs.c	Wed Dec 02 15:27:52 2015 -0800
       
    52 +++ b/src/verbs.c	Wed Dec 02 15:47:02 2015 -0800
       
    53 @@ -151,6 +151,13 @@
       
    54  struct ibv_xrcd *mlx4_open_xrcd(struct ibv_context *context,
       
    55  				struct ibv_xrcd_init_attr *attr)
       
    56  {
       
    57 +#if defined(__SVR4) && defined(__sun)
       
    58 +        /*
       
    59 +         * Not supported by Solaris kernel driver.  When/if supported
       
    60 +         * this routine will need to be ported.
       
    61 +         */
       
    62 +        return NULL;
       
    63 +#else
       
    64  	struct ibv_open_xrcd cmd;
       
    65  	struct ibv_open_xrcd_resp resp;
       
    66  	struct verbs_xrcd *xrcd;
       
    67 @@ -170,10 +177,18 @@
       
    68  err:
       
    69  	free(xrcd);
       
    70  	return NULL;
       
    71 +#endif
       
    72  }
       
    73  
       
    74  int mlx4_close_xrcd(struct ibv_xrcd *ib_xrcd)
       
    75  {
       
    76 +#if defined(__SVR4) && defined(__sun)
       
    77 +        /*
       
    78 +         * Not supported by Solaris kernel driver.  When/if supported
       
    79 +         * this routine will need to be ported.
       
    80 +         */
       
    81 +        return NULL;
       
    82 +#else
       
    83  	struct verbs_xrcd *xrcd = container_of(ib_xrcd, struct verbs_xrcd, xrcd);
       
    84  	int ret;
       
    85  
       
    86 @@ -182,6 +197,7 @@
       
    87  		free(xrcd);
       
    88  
       
    89  	return ret;
       
    90 +#endif
       
    91  }
       
    92  
       
    93  struct ibv_mr *mlx4_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
       
    94 @@ -1031,6 +1047,13 @@
       
    95  
       
    96  struct ibv_qp *mlx4_open_qp(struct ibv_context *context, struct ibv_qp_open_attr *attr)
       
    97  {
       
    98 +#if defined(__SVR4) && defined(__sun)
       
    99 +        /*
       
   100 +         * Not supported by Solaris kernel driver.  When/if supported
       
   101 +         * this routine will need to be ported.
       
   102 +         */
       
   103 +        return NULL;
       
   104 +#else
       
   105  	struct ibv_open_qp cmd;
       
   106  	struct ibv_create_qp_resp resp;
       
   107  	struct mlx4_qp *qp;
       
   108 @@ -1050,6 +1073,7 @@
       
   109  err:
       
   110  	free(qp);
       
   111  	return NULL;
       
   112 +#endif
       
   113  }
       
   114  
       
   115  int mlx4_query_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr,