From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140078.outbound.protection.outlook.com [40.107.14.78]) by dpdk.org (Postfix) with ESMTP id 153FF1B4EF for ; Thu, 21 Mar 2019 13:15:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yr2py7phtIC7ONnELMauHT0CrQHJ2/AnjP+qTSOp6yk=; b=ju86doEpTZ9hkz5ukGmD/L2E85H2iXzSSOANzu0PAWNCzFxgBQBeAO0c2pt4IVRsVq+Kj1PqcDQgZ9t8yX0nH5e2wuPzxga7E727zlUrCcmVBCBG0jb8EVTVBZH1MAx+/bceC5RZvONIgO/I3dbLFwFcZa4EEnY5gP4VMG33UVA= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3827.eurprd05.prod.outlook.com (52.133.47.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.15; Thu, 21 Mar 2019 12:14:59 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003%2]) with mapi id 15.20.1730.013; Thu, 21 Mar 2019 12:14:59 +0000 From: Shahaf Shuler To: Slava Ovsiienko , "dev@dpdk.org" Thread-Topic: [PATCH 10/14] net/mlx5: switch to the shared IB device context Thread-Index: AQHU373a57aAAMtXBUuTEqfVeUJ24aYV95+w Date: Thu, 21 Mar 2019 12:14:59 +0000 Message-ID: References: <1551376985-11096-1-git-send-email-viacheslavo@mellanox.com> <1553155888-27498-1-git-send-email-viacheslavo@mellanox.com> <1553155888-27498-11-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1553155888-27498-11-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cc83b60f-75f5-4d10-d00c-08d6adf6d6c0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3827; x-ms-traffictypediagnostic: AM0PR0502MB3827: x-microsoft-antispam-prvs: x-forefront-prvs: 0983EAD6B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(39860400002)(136003)(376002)(189003)(199004)(81166006)(97736004)(33656002)(68736007)(74316002)(25786009)(7736002)(305945005)(110136005)(316002)(14454004)(2906002)(446003)(2501003)(14444005)(52536014)(11346002)(476003)(71190400001)(256004)(5024004)(86362001)(486006)(99286004)(186003)(5660300002)(66066001)(26005)(7696005)(53936002)(76176011)(102836004)(55016002)(9686003)(6436002)(71200400001)(229853002)(3846002)(8676002)(8936002)(81156014)(478600001)(6246003)(30864003)(106356001)(6506007)(6116002)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3827; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: MUA4yDyLq9Eow27ORto6ySD65OYAOSa9rkRPWNjYEONfhfJ78BdkTYshkUyTdrO+6bnIBQ8yEQdrKoWdTe6CRbqDYjAASRAusaH2NDd+ZNaU9Jo/42V+MAeo6llYHxwM7fUxYR6cC6KJBT8JWEMq9Z36WNXDWWTFvOhGwoNiQF3VqpOKLfALWeHfaypKfk5iYNE+KwKsl/fFtkxvcv31cGVneKE5Ftip3sswIevYwQ6xaXzRj1gGx92Sqz3Tl2xjiedXq660NMLsWhmDIsqTtP1mKYSbXN+4v9/5tdTJ7qASft/Y7AHo/6Z6Yhgk5srexrr3BpemxUvyrUaUYZWaFWG5AiC232H5K2RrMTyZ1UYJkebaCmPpedNCl8lRw7NYWz3ehHwp12SgPM1bvzv2REINUCzD0tRc3bskuoQw5go= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc83b60f-75f5-4d10-d00c-08d6adf6d6c0 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2019 12:14:59.4903 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3827 Subject: Re: [dpdk-dev] [PATCH 10/14] net/mlx5: switch to the shared IB device context X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2019 12:15:01 -0000 Thursday, March 21, 2019 10:11 AM, Viacheslav Ovsiienko: > Subject: [PATCH 10/14] net/mlx5: switch to the shared IB device context >=20 > The code is updated to use the shared IB device context and device handle= s. > The IB device context is shared between reprentors created over the singl= e > multiport IB device. All Verbs and DevX objects will be created whithin t= his > shared context. >=20 > Signed-off-by: Viacheslav Ovsiienko Acked-by: Shahaf Shuler > --- > drivers/net/mlx5/mlx5.c | 7 +++---- > drivers/net/mlx5/mlx5.h | 1 - > drivers/net/mlx5/mlx5_ethdev.c | 13 +++++++------ > drivers/net/mlx5/mlx5_flow_dv.c | 9 +++++---- > 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, 36 insertions(+), 33 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > a0f224b..312c42b 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -407,7 +407,7 @@ struct mlx5_dev_spawn_data { >=20 > DRV_LOG(DEBUG, "port %u closing device \"%s\"", > dev->data->port_id, > - ((priv->ctx !=3D NULL) ? priv->ctx->device->name : "")); > + ((priv->sh->ctx !=3D NULL) ? priv->sh->ctx->device->name : > "")); > /* In case mlx5_dev_stop() has not been called. */ > mlx5_dev_interrupt_handler_uninstall(dev); > mlx5_traffic_disable(dev); > @@ -1111,7 +1111,6 @@ struct mlx5_dev_spawn_data { > goto error; > } > priv->sh =3D sh; > - priv->ctx =3D sh->ctx; > priv->ibv_port =3D spawn->ibv_port; > priv->mtu =3D ETHER_MTU; > #ifndef RTE_ARCH_64 > @@ -1349,7 +1348,7 @@ struct mlx5_dev_spawn_data { > } > } > #ifdef HAVE_MLX5DV_DR > - ns =3D mlx5dv_dr_create_ns(ctx, > + ns =3D mlx5dv_dr_create_ns(sh->ctx, >=20 > MLX5DV_DR_NS_DOMAIN_INGRESS_BYPASS); > if (ns =3D=3D NULL) { > DRV_LOG(ERR, "mlx5dv_dr_create_ns failed"); @@ - > 1357,7 +1356,7 @@ struct mlx5_dev_spawn_data { > goto error; > } > priv->rx_ns =3D ns; > - ns =3D mlx5dv_dr_create_ns(ctx, > + ns =3D mlx5dv_dr_create_ns(sh->ctx, >=20 > MLX5DV_DR_NS_DOMAIN_EGRESS_BYPASS); > if (ns =3D=3D NULL) { > DRV_LOG(ERR, "mlx5dv_dr_create_ns failed"); diff -- > git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > efa3a3c..d816d24 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -226,7 +226,6 @@ struct mlx5_priv { > struct rte_eth_dev_data *dev_data; /* Pointer to device data. */ > struct mlx5_ibv_shared *sh; /* Shared IB device context. */ > uint32_t ibv_port; /* IB device port number. */ > - struct ibv_context *ctx; /* Verbs context. */ > struct ether_addr mac[MLX5_MAX_MAC_ADDRESSES]; /* MAC > addresses. */ > BITFIELD_DECLARE(mac_own, uint64_t, > MLX5_MAX_MAC_ADDRESSES); > /* Bit-field of MAC addresses owned by the PMD. */ diff --git > a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index > 69f238b..1b2173b 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -1055,7 +1055,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, > char *fw_ver, size_t fw_size) > } > /* Read all message and acknowledge them. */ > for (;;) { > - if (mlx5_glue->get_async_event(priv->ctx, &event)) > + if (mlx5_glue->get_async_event(priv->sh->ctx, &event)) > break; > if ((event.event_type =3D=3D IBV_EVENT_PORT_ACTIVE || > event.event_type =3D=3D IBV_EVENT_PORT_ERR) && > @@ -1142,12 +1142,13 @@ int mlx5_fw_version_get(struct rte_eth_dev > *dev, char *fw_ver, size_t fw_size) > mlx5_dev_interrupt_handler_install(struct rte_eth_dev *dev) { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct ibv_context *ctx =3D priv->sh->ctx; > int ret; > int flags; >=20 > - assert(priv->ctx->async_fd > 0); > - flags =3D fcntl(priv->ctx->async_fd, F_GETFL); > - ret =3D fcntl(priv->ctx->async_fd, F_SETFL, flags | O_NONBLOCK); > + assert(ctx->async_fd > 0); > + flags =3D fcntl(ctx->async_fd, F_GETFL); > + ret =3D fcntl(ctx->async_fd, F_SETFL, flags | O_NONBLOCK); > if (ret) { > DRV_LOG(INFO, > "port %u failed to change file descriptor async event" > @@ -1158,7 +1159,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, > char *fw_ver, size_t fw_size) > } > if (dev->data->dev_conf.intr_conf.lsc || > dev->data->dev_conf.intr_conf.rmv) { > - priv->intr_handle.fd =3D priv->ctx->async_fd; > + priv->intr_handle.fd =3D ctx->async_fd; > priv->intr_handle.type =3D RTE_INTR_HANDLE_EXT; > rte_intr_callback_register(&priv->intr_handle, > mlx5_dev_interrupt_handler, dev); > @@ -1303,7 +1304,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, > char *fw_ver, size_t fw_size) > struct ibv_device_attr device_attr; > struct mlx5_priv *priv =3D dev->data->dev_private; >=20 > - if (mlx5_glue->query_device(priv->ctx, &device_attr) =3D=3D EIO) > + if (mlx5_glue->query_device(priv->sh->ctx, &device_attr) =3D=3D EIO) > return 1; > return 0; > } > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c index 44b36ee..b8943da 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -840,7 +840,7 @@ struct field_modify_info modify_tcp[] =3D { > *cache_resource =3D *resource; > cache_resource->verbs_action =3D > mlx5_glue->dv_create_flow_action_packet_reformat > - (priv->ctx, cache_resource->reformat_type, > + (priv->sh->ctx, cache_resource->reformat_type, > cache_resource->ft_type, ns, cache_resource- > >flags, > cache_resource->size, > (cache_resource->size ? cache_resource->buf : > NULL)); @@ -1569,7 +1569,8 @@ struct field_modify_info modify_tcp[] =3D { > *cache_resource =3D *resource; > cache_resource->verbs_action =3D > mlx5_glue->dv_create_flow_action_modify_header > - (priv->ctx, cache_resource->ft_type, > + (priv->sh->ctx, > + cache_resource->ft_type, > ns, 0, > cache_resource->actions_num * > sizeof(cache_resource->actions[0]), > @@ -1629,7 +1630,7 @@ struct field_modify_info modify_tcp[] =3D { > ret =3D -ENOMEM; > goto error_exit; > } > - ret =3D mlx5_devx_cmd_flow_counter_alloc(priv->ctx, dcs); > + ret =3D mlx5_devx_cmd_flow_counter_alloc(priv->sh->ctx, dcs); > if (ret) > goto error_exit; > struct mlx5_flow_counter tmpl =3D { > @@ -2982,7 +2983,7 @@ struct field_modify_info modify_tcp[] =3D { > if (matcher->egress) > dv_attr.flags |=3D IBV_FLOW_ATTR_FLAGS_EGRESS; > cache_matcher->matcher_object =3D > - mlx5_glue->dv_create_flow_matcher(priv->ctx, &dv_attr, > + mlx5_glue->dv_create_flow_matcher(priv->sh->ctx, > &dv_attr, > tbl->obj); > if (!cache_matcher->matcher_object) { > rte_free(cache_matcher); > diff --git 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 =3D dev->data->dev_private; > + struct ibv_context ctx =3D priv->sh->ctx; > struct ibv_counter_set_init_attr init =3D { > .counter_set_id =3D counter->id}; >=20 > - counter->cs =3D mlx5_glue->create_counter_set(priv->ctx, &init); > + counter->cs =3D mlx5_glue->create_counter_set(ctx, &init); > if (!counter->cs) { > rte_errno =3D ENOTSUP; > return -ENOTSUP; > @@ -67,12 +68,13 @@ > return 0; > #elif defined(HAVE_IBV_DEVICE_COUNTERS_SET_V45) > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct ibv_context *ctx =3D priv->sh->ctx; > struct ibv_counters_init_attr init =3D {0}; > struct ibv_counter_attach_attr attach; > int ret; >=20 > memset(&attach, 0, sizeof(attach)); > - counter->cs =3D mlx5_glue->create_counters(priv->ctx, &init); > + counter->cs =3D mlx5_glue->create_counters(ctx, &init); > if (!counter->cs) { > rte_errno =3D ENOTSUP; > return -ENOTSUP; > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index fd1c3a2..dcb97c2 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -799,7 +799,7 @@ struct mlx5_rxq_ibv * > } > tmpl->rxq_ctrl =3D rxq_ctrl; > if (rxq_ctrl->irq) { > - tmpl->channel =3D mlx5_glue->create_comp_channel(priv- > >ctx); > + tmpl->channel =3D mlx5_glue->create_comp_channel(priv- > >sh->ctx); > if (!tmpl->channel) { > DRV_LOG(ERR, "port %u: comp channel creation > failure", > dev->data->port_id); > @@ -848,7 +848,7 @@ struct mlx5_rxq_ibv * > } > #endif > tmpl->cq =3D mlx5_glue->cq_ex_to_cq > - (mlx5_glue->dv_create_cq(priv->ctx, &attr.cq.ibv, > + (mlx5_glue->dv_create_cq(priv->sh->ctx, &attr.cq.ibv, > &attr.cq.mlx5)); > if (tmpl->cq =3D=3D NULL) { > DRV_LOG(ERR, "port %u Rx queue %u CQ creation failure", > @@ -905,10 +905,10 @@ struct mlx5_rxq_ibv * > .two_byte_shift_en =3D > MLX5_MPRQ_TWO_BYTE_SHIFT, > }; > } > - tmpl->wq =3D mlx5_glue->dv_create_wq(priv->ctx, &attr.wq.ibv, > + tmpl->wq =3D mlx5_glue->dv_create_wq(priv->sh->ctx, &attr.wq.ibv, > &attr.wq.mlx5); > #else > - tmpl->wq =3D mlx5_glue->create_wq(priv->ctx, &attr.wq.ibv); > + tmpl->wq =3D mlx5_glue->create_wq(priv->sh->ctx, &attr.wq.ibv); > #endif > if (tmpl->wq =3D=3D NULL) { > DRV_LOG(ERR, "port %u Rx queue %u WQ creation failure", > @@ -1643,7 +1643,7 @@ struct mlx5_ind_table_ibv * > for (j =3D 0; i !=3D (unsigned int)(1 << wq_n); ++i, ++j) > wq[i] =3D wq[j]; > ind_tbl->ind_table =3D mlx5_glue->create_rwq_ind_table > - (priv->ctx, > + (priv->sh->ctx, > &(struct ibv_rwq_ind_table_init_attr){ > .log_ind_tbl_size =3D wq_n, > .ind_tbl =3D wq, > @@ -1817,7 +1817,7 @@ struct mlx5_hrxq * > } > #endif > qp =3D mlx5_glue->dv_create_qp > - (priv->ctx, > + (priv->sh->ctx, > &(struct ibv_qp_init_attr_ex){ > .qp_type =3D IBV_QPT_RAW_PACKET, > .comp_mask =3D > @@ -1836,7 +1836,7 @@ struct mlx5_hrxq * > &qp_init_attr); > #else > qp =3D mlx5_glue->create_qp_ex > - (priv->ctx, > + (priv->sh->ctx, > &(struct ibv_qp_init_attr_ex){ > .qp_type =3D IBV_QPT_RAW_PACKET, > .comp_mask =3D > @@ -1988,20 +1988,21 @@ struct mlx5_rxq_ibv * > mlx5_rxq_ibv_drop_new(struct rte_eth_dev *dev) { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct ibv_context *ctx =3D priv->sh->ctx; > struct ibv_cq *cq; > struct ibv_wq *wq =3D NULL; > struct mlx5_rxq_ibv *rxq; >=20 > if (priv->drop_queue.rxq) > return priv->drop_queue.rxq; > - cq =3D mlx5_glue->create_cq(priv->ctx, 1, NULL, NULL, 0); > + cq =3D mlx5_glue->create_cq(ctx, 1, NULL, NULL, 0); > if (!cq) { > DEBUG("port %u cannot allocate CQ for drop queue", > dev->data->port_id); > rte_errno =3D errno; > goto error; > } > - wq =3D mlx5_glue->create_wq(priv->ctx, > + wq =3D mlx5_glue->create_wq(ctx, > &(struct ibv_wq_init_attr){ > .wq_type =3D IBV_WQT_RQ, > .max_wr =3D 1, > @@ -2078,7 +2079,7 @@ struct mlx5_ind_table_ibv * > if (!rxq) > return NULL; > tmpl.ind_table =3D mlx5_glue->create_rwq_ind_table > - (priv->ctx, > + (priv->sh->ctx, > &(struct ibv_rwq_ind_table_init_attr){ > .log_ind_tbl_size =3D 0, > .ind_tbl =3D &rxq->wq, > @@ -2145,7 +2146,7 @@ struct mlx5_hrxq * > ind_tbl =3D mlx5_ind_table_ibv_drop_new(dev); > if (!ind_tbl) > return NULL; > - qp =3D mlx5_glue->create_qp_ex(priv->ctx, > + qp =3D mlx5_glue->create_qp_ex(priv->sh->ctx, > &(struct ibv_qp_init_attr_ex){ > .qp_type =3D IBV_QPT_RAW_PACKET, > .comp_mask =3D > diff --git a/drivers/net/mlx5/mlx5_socket.c > b/drivers/net/mlx5/mlx5_socket.c index 41cac3c..8fa6430 100644 > --- a/drivers/net/mlx5/mlx5_socket.c > +++ b/drivers/net/mlx5/mlx5_socket.c > @@ -185,9 +185,9 @@ > assert(cmsg !=3D NULL); > cmsg->cmsg_level =3D SOL_SOCKET; > cmsg->cmsg_type =3D SCM_RIGHTS; > - cmsg->cmsg_len =3D CMSG_LEN(sizeof(priv->ctx->cmd_fd)); > + cmsg->cmsg_len =3D CMSG_LEN(sizeof(priv->sh->ctx->cmd_fd)); > fd =3D (int *)CMSG_DATA(cmsg); > - *fd =3D priv->ctx->cmd_fd; > + *fd =3D priv->sh->ctx->cmd_fd; > ret =3D sendmsg(conn_sock, &msg, 0); > if (ret < 0) > DRV_LOG(WARNING, "port %u cannot send response", diff - > -git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c > index 2137bdc..d13a1a1 100644 > --- a/drivers/net/mlx5/mlx5_trigger.c > +++ b/drivers/net/mlx5/mlx5_trigger.c > @@ -58,7 +58,7 @@ > goto error; > } > } > - ret =3D mlx5_tx_uar_remap(dev, priv->ctx->cmd_fd); > + ret =3D mlx5_tx_uar_remap(dev, priv->sh->ctx->cmd_fd); > if (ret) { > /* Adjust index for rollback. */ > i =3D priv->txqs_n - 1; > diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c > index 10a3040..25305b6 100644 > --- a/drivers/net/mlx5/mlx5_txq.c > +++ b/drivers/net/mlx5/mlx5_txq.c > @@ -392,7 +392,7 @@ struct mlx5_txq_ibv * > ((desc / MLX5_TX_COMP_THRESH) - 1) : 1; > if (is_empw_burst_func(tx_pkt_burst)) > cqe_n +=3D MLX5_TX_COMP_THRESH_INLINE_DIV; > - tmpl.cq =3D mlx5_glue->create_cq(priv->ctx, cqe_n, NULL, NULL, 0); > + tmpl.cq =3D mlx5_glue->create_cq(priv->sh->ctx, cqe_n, NULL, NULL, > 0); > if (tmpl.cq =3D=3D NULL) { > DRV_LOG(ERR, "port %u Tx queue %u CQ creation failure", > dev->data->port_id, idx); > @@ -435,7 +435,7 @@ struct mlx5_txq_ibv * > attr.init.max_tso_header =3D txq_ctrl->max_tso_header; > attr.init.comp_mask |=3D > IBV_QP_INIT_ATTR_MAX_TSO_HEADER; > } > - tmpl.qp =3D mlx5_glue->create_qp_ex(priv->ctx, &attr.init); > + tmpl.qp =3D mlx5_glue->create_qp_ex(priv->sh->ctx, &attr.init); > if (tmpl.qp =3D=3D NULL) { > DRV_LOG(ERR, "port %u Tx queue %u QP creation failure", > dev->data->port_id, idx); > -- > 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 9001DA00E6 for ; Thu, 21 Mar 2019 13:15:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3AE1A1B4F1; Thu, 21 Mar 2019 13:15:04 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140078.outbound.protection.outlook.com [40.107.14.78]) by dpdk.org (Postfix) with ESMTP id 153FF1B4EF for ; Thu, 21 Mar 2019 13:15:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yr2py7phtIC7ONnELMauHT0CrQHJ2/AnjP+qTSOp6yk=; b=ju86doEpTZ9hkz5ukGmD/L2E85H2iXzSSOANzu0PAWNCzFxgBQBeAO0c2pt4IVRsVq+Kj1PqcDQgZ9t8yX0nH5e2wuPzxga7E727zlUrCcmVBCBG0jb8EVTVBZH1MAx+/bceC5RZvONIgO/I3dbLFwFcZa4EEnY5gP4VMG33UVA= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3827.eurprd05.prod.outlook.com (52.133.47.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.15; Thu, 21 Mar 2019 12:14:59 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003%2]) with mapi id 15.20.1730.013; Thu, 21 Mar 2019 12:14:59 +0000 From: Shahaf Shuler To: Slava Ovsiienko , "dev@dpdk.org" Thread-Topic: [PATCH 10/14] net/mlx5: switch to the shared IB device context Thread-Index: AQHU373a57aAAMtXBUuTEqfVeUJ24aYV95+w Date: Thu, 21 Mar 2019 12:14:59 +0000 Message-ID: References: <1551376985-11096-1-git-send-email-viacheslavo@mellanox.com> <1553155888-27498-1-git-send-email-viacheslavo@mellanox.com> <1553155888-27498-11-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1553155888-27498-11-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cc83b60f-75f5-4d10-d00c-08d6adf6d6c0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3827; x-ms-traffictypediagnostic: AM0PR0502MB3827: x-microsoft-antispam-prvs: x-forefront-prvs: 0983EAD6B2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(39860400002)(136003)(376002)(189003)(199004)(81166006)(97736004)(33656002)(68736007)(74316002)(25786009)(7736002)(305945005)(110136005)(316002)(14454004)(2906002)(446003)(2501003)(14444005)(52536014)(11346002)(476003)(71190400001)(256004)(5024004)(86362001)(486006)(99286004)(186003)(5660300002)(66066001)(26005)(7696005)(53936002)(76176011)(102836004)(55016002)(9686003)(6436002)(71200400001)(229853002)(3846002)(8676002)(8936002)(81156014)(478600001)(6246003)(30864003)(106356001)(6506007)(6116002)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3827; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: MUA4yDyLq9Eow27ORto6ySD65OYAOSa9rkRPWNjYEONfhfJ78BdkTYshkUyTdrO+6bnIBQ8yEQdrKoWdTe6CRbqDYjAASRAusaH2NDd+ZNaU9Jo/42V+MAeo6llYHxwM7fUxYR6cC6KJBT8JWEMq9Z36WNXDWWTFvOhGwoNiQF3VqpOKLfALWeHfaypKfk5iYNE+KwKsl/fFtkxvcv31cGVneKE5Ftip3sswIevYwQ6xaXzRj1gGx92Sqz3Tl2xjiedXq660NMLsWhmDIsqTtP1mKYSbXN+4v9/5tdTJ7qASft/Y7AHo/6Z6Yhgk5srexrr3BpemxUvyrUaUYZWaFWG5AiC232H5K2RrMTyZ1UYJkebaCmPpedNCl8lRw7NYWz3ehHwp12SgPM1bvzv2REINUCzD0tRc3bskuoQw5go= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc83b60f-75f5-4d10-d00c-08d6adf6d6c0 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Mar 2019 12:14:59.4903 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3827 Subject: Re: [dpdk-dev] [PATCH 10/14] net/mlx5: switch to the shared IB device context X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190321121459.OAMn6KMNKdXMv4oG1enCWsY24s2VMeHlJ2wRb2vQjIw@z> Thursday, March 21, 2019 10:11 AM, Viacheslav Ovsiienko: > Subject: [PATCH 10/14] net/mlx5: switch to the shared IB device context >=20 > The code is updated to use the shared IB device context and device handle= s. > The IB device context is shared between reprentors created over the singl= e > multiport IB device. All Verbs and DevX objects will be created whithin t= his > shared context. >=20 > Signed-off-by: Viacheslav Ovsiienko Acked-by: Shahaf Shuler > --- > drivers/net/mlx5/mlx5.c | 7 +++---- > drivers/net/mlx5/mlx5.h | 1 - > drivers/net/mlx5/mlx5_ethdev.c | 13 +++++++------ > drivers/net/mlx5/mlx5_flow_dv.c | 9 +++++---- > 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, 36 insertions(+), 33 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > a0f224b..312c42b 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -407,7 +407,7 @@ struct mlx5_dev_spawn_data { >=20 > DRV_LOG(DEBUG, "port %u closing device \"%s\"", > dev->data->port_id, > - ((priv->ctx !=3D NULL) ? priv->ctx->device->name : "")); > + ((priv->sh->ctx !=3D NULL) ? priv->sh->ctx->device->name : > "")); > /* In case mlx5_dev_stop() has not been called. */ > mlx5_dev_interrupt_handler_uninstall(dev); > mlx5_traffic_disable(dev); > @@ -1111,7 +1111,6 @@ struct mlx5_dev_spawn_data { > goto error; > } > priv->sh =3D sh; > - priv->ctx =3D sh->ctx; > priv->ibv_port =3D spawn->ibv_port; > priv->mtu =3D ETHER_MTU; > #ifndef RTE_ARCH_64 > @@ -1349,7 +1348,7 @@ struct mlx5_dev_spawn_data { > } > } > #ifdef HAVE_MLX5DV_DR > - ns =3D mlx5dv_dr_create_ns(ctx, > + ns =3D mlx5dv_dr_create_ns(sh->ctx, >=20 > MLX5DV_DR_NS_DOMAIN_INGRESS_BYPASS); > if (ns =3D=3D NULL) { > DRV_LOG(ERR, "mlx5dv_dr_create_ns failed"); @@ - > 1357,7 +1356,7 @@ struct mlx5_dev_spawn_data { > goto error; > } > priv->rx_ns =3D ns; > - ns =3D mlx5dv_dr_create_ns(ctx, > + ns =3D mlx5dv_dr_create_ns(sh->ctx, >=20 > MLX5DV_DR_NS_DOMAIN_EGRESS_BYPASS); > if (ns =3D=3D NULL) { > DRV_LOG(ERR, "mlx5dv_dr_create_ns failed"); diff -- > git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > efa3a3c..d816d24 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -226,7 +226,6 @@ struct mlx5_priv { > struct rte_eth_dev_data *dev_data; /* Pointer to device data. */ > struct mlx5_ibv_shared *sh; /* Shared IB device context. */ > uint32_t ibv_port; /* IB device port number. */ > - struct ibv_context *ctx; /* Verbs context. */ > struct ether_addr mac[MLX5_MAX_MAC_ADDRESSES]; /* MAC > addresses. */ > BITFIELD_DECLARE(mac_own, uint64_t, > MLX5_MAX_MAC_ADDRESSES); > /* Bit-field of MAC addresses owned by the PMD. */ diff --git > a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index > 69f238b..1b2173b 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -1055,7 +1055,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, > char *fw_ver, size_t fw_size) > } > /* Read all message and acknowledge them. */ > for (;;) { > - if (mlx5_glue->get_async_event(priv->ctx, &event)) > + if (mlx5_glue->get_async_event(priv->sh->ctx, &event)) > break; > if ((event.event_type =3D=3D IBV_EVENT_PORT_ACTIVE || > event.event_type =3D=3D IBV_EVENT_PORT_ERR) && > @@ -1142,12 +1142,13 @@ int mlx5_fw_version_get(struct rte_eth_dev > *dev, char *fw_ver, size_t fw_size) > mlx5_dev_interrupt_handler_install(struct rte_eth_dev *dev) { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct ibv_context *ctx =3D priv->sh->ctx; > int ret; > int flags; >=20 > - assert(priv->ctx->async_fd > 0); > - flags =3D fcntl(priv->ctx->async_fd, F_GETFL); > - ret =3D fcntl(priv->ctx->async_fd, F_SETFL, flags | O_NONBLOCK); > + assert(ctx->async_fd > 0); > + flags =3D fcntl(ctx->async_fd, F_GETFL); > + ret =3D fcntl(ctx->async_fd, F_SETFL, flags | O_NONBLOCK); > if (ret) { > DRV_LOG(INFO, > "port %u failed to change file descriptor async event" > @@ -1158,7 +1159,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, > char *fw_ver, size_t fw_size) > } > if (dev->data->dev_conf.intr_conf.lsc || > dev->data->dev_conf.intr_conf.rmv) { > - priv->intr_handle.fd =3D priv->ctx->async_fd; > + priv->intr_handle.fd =3D ctx->async_fd; > priv->intr_handle.type =3D RTE_INTR_HANDLE_EXT; > rte_intr_callback_register(&priv->intr_handle, > mlx5_dev_interrupt_handler, dev); > @@ -1303,7 +1304,7 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, > char *fw_ver, size_t fw_size) > struct ibv_device_attr device_attr; > struct mlx5_priv *priv =3D dev->data->dev_private; >=20 > - if (mlx5_glue->query_device(priv->ctx, &device_attr) =3D=3D EIO) > + if (mlx5_glue->query_device(priv->sh->ctx, &device_attr) =3D=3D EIO) > return 1; > return 0; > } > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c index 44b36ee..b8943da 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -840,7 +840,7 @@ struct field_modify_info modify_tcp[] =3D { > *cache_resource =3D *resource; > cache_resource->verbs_action =3D > mlx5_glue->dv_create_flow_action_packet_reformat > - (priv->ctx, cache_resource->reformat_type, > + (priv->sh->ctx, cache_resource->reformat_type, > cache_resource->ft_type, ns, cache_resource- > >flags, > cache_resource->size, > (cache_resource->size ? cache_resource->buf : > NULL)); @@ -1569,7 +1569,8 @@ struct field_modify_info modify_tcp[] =3D { > *cache_resource =3D *resource; > cache_resource->verbs_action =3D > mlx5_glue->dv_create_flow_action_modify_header > - (priv->ctx, cache_resource->ft_type, > + (priv->sh->ctx, > + cache_resource->ft_type, > ns, 0, > cache_resource->actions_num * > sizeof(cache_resource->actions[0]), > @@ -1629,7 +1630,7 @@ struct field_modify_info modify_tcp[] =3D { > ret =3D -ENOMEM; > goto error_exit; > } > - ret =3D mlx5_devx_cmd_flow_counter_alloc(priv->ctx, dcs); > + ret =3D mlx5_devx_cmd_flow_counter_alloc(priv->sh->ctx, dcs); > if (ret) > goto error_exit; > struct mlx5_flow_counter tmpl =3D { > @@ -2982,7 +2983,7 @@ struct field_modify_info modify_tcp[] =3D { > if (matcher->egress) > dv_attr.flags |=3D IBV_FLOW_ATTR_FLAGS_EGRESS; > cache_matcher->matcher_object =3D > - mlx5_glue->dv_create_flow_matcher(priv->ctx, &dv_attr, > + mlx5_glue->dv_create_flow_matcher(priv->sh->ctx, > &dv_attr, > tbl->obj); > if (!cache_matcher->matcher_object) { > rte_free(cache_matcher); > diff --git 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 =3D dev->data->dev_private; > + struct ibv_context ctx =3D priv->sh->ctx; > struct ibv_counter_set_init_attr init =3D { > .counter_set_id =3D counter->id}; >=20 > - counter->cs =3D mlx5_glue->create_counter_set(priv->ctx, &init); > + counter->cs =3D mlx5_glue->create_counter_set(ctx, &init); > if (!counter->cs) { > rte_errno =3D ENOTSUP; > return -ENOTSUP; > @@ -67,12 +68,13 @@ > return 0; > #elif defined(HAVE_IBV_DEVICE_COUNTERS_SET_V45) > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct ibv_context *ctx =3D priv->sh->ctx; > struct ibv_counters_init_attr init =3D {0}; > struct ibv_counter_attach_attr attach; > int ret; >=20 > memset(&attach, 0, sizeof(attach)); > - counter->cs =3D mlx5_glue->create_counters(priv->ctx, &init); > + counter->cs =3D mlx5_glue->create_counters(ctx, &init); > if (!counter->cs) { > rte_errno =3D ENOTSUP; > return -ENOTSUP; > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index fd1c3a2..dcb97c2 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -799,7 +799,7 @@ struct mlx5_rxq_ibv * > } > tmpl->rxq_ctrl =3D rxq_ctrl; > if (rxq_ctrl->irq) { > - tmpl->channel =3D mlx5_glue->create_comp_channel(priv- > >ctx); > + tmpl->channel =3D mlx5_glue->create_comp_channel(priv- > >sh->ctx); > if (!tmpl->channel) { > DRV_LOG(ERR, "port %u: comp channel creation > failure", > dev->data->port_id); > @@ -848,7 +848,7 @@ struct mlx5_rxq_ibv * > } > #endif > tmpl->cq =3D mlx5_glue->cq_ex_to_cq > - (mlx5_glue->dv_create_cq(priv->ctx, &attr.cq.ibv, > + (mlx5_glue->dv_create_cq(priv->sh->ctx, &attr.cq.ibv, > &attr.cq.mlx5)); > if (tmpl->cq =3D=3D NULL) { > DRV_LOG(ERR, "port %u Rx queue %u CQ creation failure", > @@ -905,10 +905,10 @@ struct mlx5_rxq_ibv * > .two_byte_shift_en =3D > MLX5_MPRQ_TWO_BYTE_SHIFT, > }; > } > - tmpl->wq =3D mlx5_glue->dv_create_wq(priv->ctx, &attr.wq.ibv, > + tmpl->wq =3D mlx5_glue->dv_create_wq(priv->sh->ctx, &attr.wq.ibv, > &attr.wq.mlx5); > #else > - tmpl->wq =3D mlx5_glue->create_wq(priv->ctx, &attr.wq.ibv); > + tmpl->wq =3D mlx5_glue->create_wq(priv->sh->ctx, &attr.wq.ibv); > #endif > if (tmpl->wq =3D=3D NULL) { > DRV_LOG(ERR, "port %u Rx queue %u WQ creation failure", > @@ -1643,7 +1643,7 @@ struct mlx5_ind_table_ibv * > for (j =3D 0; i !=3D (unsigned int)(1 << wq_n); ++i, ++j) > wq[i] =3D wq[j]; > ind_tbl->ind_table =3D mlx5_glue->create_rwq_ind_table > - (priv->ctx, > + (priv->sh->ctx, > &(struct ibv_rwq_ind_table_init_attr){ > .log_ind_tbl_size =3D wq_n, > .ind_tbl =3D wq, > @@ -1817,7 +1817,7 @@ struct mlx5_hrxq * > } > #endif > qp =3D mlx5_glue->dv_create_qp > - (priv->ctx, > + (priv->sh->ctx, > &(struct ibv_qp_init_attr_ex){ > .qp_type =3D IBV_QPT_RAW_PACKET, > .comp_mask =3D > @@ -1836,7 +1836,7 @@ struct mlx5_hrxq * > &qp_init_attr); > #else > qp =3D mlx5_glue->create_qp_ex > - (priv->ctx, > + (priv->sh->ctx, > &(struct ibv_qp_init_attr_ex){ > .qp_type =3D IBV_QPT_RAW_PACKET, > .comp_mask =3D > @@ -1988,20 +1988,21 @@ struct mlx5_rxq_ibv * > mlx5_rxq_ibv_drop_new(struct rte_eth_dev *dev) { > struct mlx5_priv *priv =3D dev->data->dev_private; > + struct ibv_context *ctx =3D priv->sh->ctx; > struct ibv_cq *cq; > struct ibv_wq *wq =3D NULL; > struct mlx5_rxq_ibv *rxq; >=20 > if (priv->drop_queue.rxq) > return priv->drop_queue.rxq; > - cq =3D mlx5_glue->create_cq(priv->ctx, 1, NULL, NULL, 0); > + cq =3D mlx5_glue->create_cq(ctx, 1, NULL, NULL, 0); > if (!cq) { > DEBUG("port %u cannot allocate CQ for drop queue", > dev->data->port_id); > rte_errno =3D errno; > goto error; > } > - wq =3D mlx5_glue->create_wq(priv->ctx, > + wq =3D mlx5_glue->create_wq(ctx, > &(struct ibv_wq_init_attr){ > .wq_type =3D IBV_WQT_RQ, > .max_wr =3D 1, > @@ -2078,7 +2079,7 @@ struct mlx5_ind_table_ibv * > if (!rxq) > return NULL; > tmpl.ind_table =3D mlx5_glue->create_rwq_ind_table > - (priv->ctx, > + (priv->sh->ctx, > &(struct ibv_rwq_ind_table_init_attr){ > .log_ind_tbl_size =3D 0, > .ind_tbl =3D &rxq->wq, > @@ -2145,7 +2146,7 @@ struct mlx5_hrxq * > ind_tbl =3D mlx5_ind_table_ibv_drop_new(dev); > if (!ind_tbl) > return NULL; > - qp =3D mlx5_glue->create_qp_ex(priv->ctx, > + qp =3D mlx5_glue->create_qp_ex(priv->sh->ctx, > &(struct ibv_qp_init_attr_ex){ > .qp_type =3D IBV_QPT_RAW_PACKET, > .comp_mask =3D > diff --git a/drivers/net/mlx5/mlx5_socket.c > b/drivers/net/mlx5/mlx5_socket.c index 41cac3c..8fa6430 100644 > --- a/drivers/net/mlx5/mlx5_socket.c > +++ b/drivers/net/mlx5/mlx5_socket.c > @@ -185,9 +185,9 @@ > assert(cmsg !=3D NULL); > cmsg->cmsg_level =3D SOL_SOCKET; > cmsg->cmsg_type =3D SCM_RIGHTS; > - cmsg->cmsg_len =3D CMSG_LEN(sizeof(priv->ctx->cmd_fd)); > + cmsg->cmsg_len =3D CMSG_LEN(sizeof(priv->sh->ctx->cmd_fd)); > fd =3D (int *)CMSG_DATA(cmsg); > - *fd =3D priv->ctx->cmd_fd; > + *fd =3D priv->sh->ctx->cmd_fd; > ret =3D sendmsg(conn_sock, &msg, 0); > if (ret < 0) > DRV_LOG(WARNING, "port %u cannot send response", diff - > -git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c > index 2137bdc..d13a1a1 100644 > --- a/drivers/net/mlx5/mlx5_trigger.c > +++ b/drivers/net/mlx5/mlx5_trigger.c > @@ -58,7 +58,7 @@ > goto error; > } > } > - ret =3D mlx5_tx_uar_remap(dev, priv->ctx->cmd_fd); > + ret =3D mlx5_tx_uar_remap(dev, priv->sh->ctx->cmd_fd); > if (ret) { > /* Adjust index for rollback. */ > i =3D priv->txqs_n - 1; > diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c > index 10a3040..25305b6 100644 > --- a/drivers/net/mlx5/mlx5_txq.c > +++ b/drivers/net/mlx5/mlx5_txq.c > @@ -392,7 +392,7 @@ struct mlx5_txq_ibv * > ((desc / MLX5_TX_COMP_THRESH) - 1) : 1; > if (is_empw_burst_func(tx_pkt_burst)) > cqe_n +=3D MLX5_TX_COMP_THRESH_INLINE_DIV; > - tmpl.cq =3D mlx5_glue->create_cq(priv->ctx, cqe_n, NULL, NULL, 0); > + tmpl.cq =3D mlx5_glue->create_cq(priv->sh->ctx, cqe_n, NULL, NULL, > 0); > if (tmpl.cq =3D=3D NULL) { > DRV_LOG(ERR, "port %u Tx queue %u CQ creation failure", > dev->data->port_id, idx); > @@ -435,7 +435,7 @@ struct mlx5_txq_ibv * > attr.init.max_tso_header =3D txq_ctrl->max_tso_header; > attr.init.comp_mask |=3D > IBV_QP_INIT_ATTR_MAX_TSO_HEADER; > } > - tmpl.qp =3D mlx5_glue->create_qp_ex(priv->ctx, &attr.init); > + tmpl.qp =3D mlx5_glue->create_qp_ex(priv->sh->ctx, &attr.init); > if (tmpl.qp =3D=3D NULL) { > DRV_LOG(ERR, "port %u Tx queue %u QP creation failure", > dev->data->port_id, idx); > -- > 1.8.3.1