[dpdk-dev] [PATCH v4 09/13] net/mlx5: switch to the shared IB device context

Shahaf Shuler shahafs at mellanox.com
Tue Apr 2 06:49:57 CEST 2019


Slava, 

Wednesday, March 27, 2019 3:16 PM, Viacheslav Ovsiienko:
> Subject: [PATCH v4 09/13] net/mlx5: switch to the shared IB device context
> 
> The code is updated to use the shared IB device context and device handles.
> The IB device context is shared between reprentors created over the single
> multiport IB device. All Verbs and DevX objects will be created whithin this
> shared context.
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo at mellanox.com>
> Acked-by: Shahaf Shuler <shahafs at mellanox.com>
> ---
>  drivers/net/mlx5/mlx5.c            |  3 +--
>  drivers/net/mlx5/mlx5.h            |  1 -
>  drivers/net/mlx5/mlx5_ethdev.c     | 13 +++++++------
>  drivers/net/mlx5/mlx5_flow_dv.c    |  8 ++++----
>  drivers/net/mlx5/mlx5_flow_verbs.c |  6 ++++--
>  drivers/net/mlx5/mlx5_rxq.c        | 23 ++++++++++++-----------
>  drivers/net/mlx5/mlx5_socket.c     |  4 ++--
>  drivers/net/mlx5/mlx5_trigger.c    |  2 +-
>  drivers/net/mlx5/mlx5_txq.c        |  4 ++--
>  9 files changed, 33 insertions(+), 31 deletions(-)
> 
> 
> a/drivers/net/mlx5/mlx5_flow_verbs.c
> b/drivers/net/mlx5/mlx5_flow_verbs.c
> index 6c4f52f..9548d12 100644
> --- a/drivers/net/mlx5/mlx5_flow_verbs.c
> +++ b/drivers/net/mlx5/mlx5_flow_verbs.c
> @@ -56,10 +56,11 @@
>  {
>  #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42)
>  	struct mlx5_priv *priv = dev->data->dev_private;
> +	struct ibv_context ctx = priv->sh->ctx;
>  	struct ibv_counter_set_init_attr init = {
>  			 .counter_set_id = counter->id};
> 
> -	counter->cs = mlx5_glue->create_counter_set(priv->ctx, &init);
> +	counter->cs = mlx5_glue->create_counter_set(ctx, &init);
>  	if (!counter->cs) {
>  		rte_errno = ENOTSUP;
>  		return -ENOTSUP;

This code piece was causing compilation error w/ older rdma-core versions.
It was replaced w/ the below during the merge. 

>   #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42)
>          struct mlx5_priv *priv = dev->data->dev_private;
>  -       struct ibv_context ctx = priv->sh->ctx;
>  +       struct ibv_context *ctx = priv->sh->ctx;
>          struct ibv_counter_set_init_attr init = {
>                           .counter_set_id = counter->id};
>


More information about the dev mailing list