From patchwork Fri Jul 10 09:48:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 73717 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 017F5A0529; Fri, 10 Jul 2020 11:49:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 883171DB92; Fri, 10 Jul 2020 11:49:05 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 99B9A1DD74 for ; Fri, 10 Jul 2020 11:49:00 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with SMTP; 10 Jul 2020 12:48:57 +0300 Received: from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx [10.210.17.40]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 06A9mvIS012262; Fri, 10 Jul 2020 12:48:57 +0300 Received: from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id 06A9mvQO024749; Fri, 10 Jul 2020 09:48:57 GMT Received: (from viacheslavo@localhost) by pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id 06A9mvKX024748; Fri, 10 Jul 2020 09:48:57 GMT X-Authentication-Warning: pegasus12.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: matan@mellanox.com, rasland@mellanox.com, thomas@monjalon.net, ferruh.yigit@intel.com Date: Fri, 10 Jul 2020 09:48:38 +0000 Message-Id: <1594374530-24659-4-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1594374530-24659-1-git-send-email-viacheslavo@mellanox.com> References: <1594374530-24659-1-git-send-email-viacheslavo@mellanox.com> Subject: [dpdk-dev] [PATCH v1 04/16] net/mlx5: introduce shared UAR resource 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" This is preparation step before moving the Tx queue creation to the DevX approach. Some features require the shared UAR for Tx queues and scheduling completion queues, the patch manages the shared UAR. Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5.c | 14 ++++++++++++++ drivers/net/mlx5/mlx5.h | 1 + 2 files changed, 15 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 2efbc03..612d38c 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -709,6 +709,12 @@ struct mlx5_dev_ctx_shared * err = ENOMEM; goto error; } + sh->tx_uar = mlx5_glue->devx_alloc_uar(sh->ctx, 0); + if (!sh->tx_uar) { + DRV_LOG(ERR, "Failed to allocate DevX UAR."); + err = ENOMEM; + goto error; + } } sh->flow_id_pool = mlx5_flow_id_pool_alloc ((1 << HAIRPIN_FLOW_ID_BITS) - 1); @@ -767,6 +773,10 @@ struct mlx5_dev_ctx_shared * mlx5_l3t_destroy(sh->cnt_id_tbl); sh->cnt_id_tbl = NULL; } + if (sh->tx_uar) { + mlx5_glue->devx_free_uar(sh->tx_uar); + sh->tx_uar = NULL; + } if (sh->tis) claim_zero(mlx5_devx_cmd_destroy(sh->tis)); if (sh->td) @@ -832,6 +842,10 @@ struct mlx5_dev_ctx_shared * mlx5_l3t_destroy(sh->cnt_id_tbl); sh->cnt_id_tbl = NULL; } + if (sh->tx_uar) { + mlx5_glue->devx_free_uar(sh->tx_uar); + sh->tx_uar = NULL; + } if (sh->pd) claim_zero(mlx5_glue->dealloc_pd(sh->pd)); if (sh->tis) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index d01d7f3..799b8e3 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -586,6 +586,7 @@ struct mlx5_dev_ctx_shared { struct mlx5_devx_obj *tis; /* TIS object. */ struct mlx5_devx_obj *td; /* Transport domain. */ struct mlx5_flow_id_pool *flow_id_pool; /* Flow ID pool. */ + struct mlx5dv_devx_uar *tx_uar; /* Tx/packer pacing shared UAR. */ struct mlx5_dev_shared_port port[]; /* per device port data array. */ };