From patchwork Thu Feb 21 09:02:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Slava Ovsiienko X-Patchwork-Id: 50412 X-Patchwork-Delegate: shahafs@mellanox.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B41312B93; Thu, 21 Feb 2019 10:02:29 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 4A0052B93 for ; Thu, 21 Feb 2019 10:02:27 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 21 Feb 2019 11:02:26 +0200 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 x1L92PKr002160; Thu, 21 Feb 2019 11:02:25 +0200 From: Viacheslav Ovsiienko To: shahafs@mellanox.com Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 21 Feb 2019 09:02:16 +0000 Message-Id: <1550739736-5620-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix Verbs errors treatment in prio probing 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 mlx5 PMD probes the Verbs flow priorities supported with ibv_create_flow() function. If rdma-core or kernel fails for some reason, the returned error causes the drop queue is not destroyed, and pd is locked by not freed resource. Also the mlx5_flow_discover_priorities() returned negative value as error, and this code was reported "as is", without sign changing (eventually causing assert(err > 0)). Fixes: 2815702baea7 ("net/mlx5: replace verbs priorities by flow") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5.c | 4 +++- drivers/net/mlx5/mlx5_flow.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index df71707..6679676 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1243,8 +1243,10 @@ priv->config = config; /* Supported Verbs flow priority number detection. */ err = mlx5_flow_discover_priorities(eth_dev); - if (err < 0) + if (err < 0) { + err = -err; goto error; + } priv->config.flow_prio = err; /* * Once the device is added to the list of memory event diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 11213e2..97af57b 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -350,6 +350,7 @@ struct mlx5_flow_tunnel_info { claim_zero(mlx5_glue->destroy_flow(flow)); priority = vprio[i]; } + mlx5_hrxq_drop_release(dev); switch (priority) { case 8: priority = RTE_DIM(priority_map_3); @@ -361,10 +362,9 @@ struct mlx5_flow_tunnel_info { rte_errno = ENOTSUP; DRV_LOG(ERR, "port %u verbs maximum priority: %d expected 8/16", - dev->data->port_id, vprio[i]); + dev->data->port_id, priority); return -rte_errno; } - mlx5_hrxq_drop_release(dev); DRV_LOG(INFO, "port %u flow maximum priority: %d", dev->data->port_id, priority); return priority;