From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1247DA04C3; Wed, 13 Nov 2019 17:24:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4BE672BAE; Wed, 13 Nov 2019 17:24:56 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 18364271 for ; Wed, 13 Nov 2019 17:24:54 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 13 Nov 2019 18:24:54 +0200 Received: from pegasus11.mtr.labs.mlnx (pegasus11.mtr.labs.mlnx [10.210.16.104]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id xADGOrCf008562; Wed, 13 Nov 2019 18:24:53 +0200 Received: from pegasus11.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id xADGOraO023078; Wed, 13 Nov 2019 16:24:53 GMT Received: (from viacheslavo@localhost) by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id xADGOrO2023075; Wed, 13 Nov 2019 16:24:53 GMT X-Authentication-Warning: pegasus11.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, orika@mellanox.com Date: Wed, 13 Nov 2019 16:24:50 +0000 Message-Id: <1573662290-23034-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix environment variable recovery 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" The state of environment variable MLX5_BF_SHUT_UP was not recovered correctly if there was no tx_db_nc devarg specified. Fixes: 8409a28573d3 ("net/mlx5: control transmit doorbell register mapping") Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 6ffe951..bafc84c 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -448,12 +448,9 @@ struct mlx5_flow_id_pool * } static void -mlx5_restore_doorbell_mapping_env(const struct mlx5_dev_config *config, - int value) +mlx5_restore_doorbell_mapping_env(int value) { assert(rte_eal_process_type() == RTE_PROC_PRIMARY); - if (config->dbnc == MLX5_ARG_UNSET) - return; /* Restore the original environment variable state. */ if (value == MLX5_ARG_UNSET) unsetenv(MLX5_SHUT_UP_BF); @@ -530,7 +527,7 @@ struct mlx5_flow_id_pool * sh->devx = 1; DRV_LOG(DEBUG, "DevX is supported"); /* The device is created, no need for environment. */ - mlx5_restore_doorbell_mapping_env(config, dbmap_env); + mlx5_restore_doorbell_mapping_env(dbmap_env); } else { /* The environment variable is still configured. */ sh->ctx = mlx5_glue->open_device(spawn->ibv_dev); @@ -539,10 +536,9 @@ struct mlx5_flow_id_pool * * The environment variable is not needed anymore, * all device creation attempts are completed. */ - mlx5_restore_doorbell_mapping_env(config, dbmap_env); - if (!sh->ctx) { + mlx5_restore_doorbell_mapping_env(dbmap_env); + if (!sh->ctx) goto error; - } DRV_LOG(DEBUG, "DevX is NOT supported"); } err = mlx5_glue->query_device_ex(sh->ctx, NULL, &sh->device_attr); -- 1.8.3.1