From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AFDBEA0A0C for ; Tue, 3 Aug 2021 14:22:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A984F411CF; Tue, 3 Aug 2021 14:22:36 +0200 (CEST) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mails.dpdk.org (Postfix) with ESMTP id D3EC5411D1 for ; Tue, 3 Aug 2021 14:22:35 +0200 (CEST) Received: by mail-wr1-f47.google.com with SMTP id m12so20319223wru.12 for ; Tue, 03 Aug 2021 05:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4l7qx/fESCAKWXMrQMuMrKeoQy3KaOBY4s7MhVCz3Dk=; b=NnYcuzG8c9NJFI8J1eqZSRH5TcRpVvs5Dw42Z8ucVYjStoTPKc+LEFxTCbrBzjP3ne OqZh3sxd37NpaC9ZAU2M1NXVX35Od2TG2QnHb0TG6o/NZTphB9Z4FxNkTGhKGzKs8WMw 0AM83BP1qlLrwm/Va8o4+7SgNPqwauAbiyfTb5OjZXrbgH1jrf3XhFzpavA55a7Z4bAI 95TAFhfi5kWBqOUUvHTjMdk6E/mlikMab82jgFrlqoCR3BQv5fL+JuZ0cJPREMOgU2f6 BP3M/y/e2tb2SWcBKXaXe94CWxvR99yurlDO1nSn6K+jjX4oNZZkLr8ZWVxbqCjcREkW pQ5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4l7qx/fESCAKWXMrQMuMrKeoQy3KaOBY4s7MhVCz3Dk=; b=ArsDZ6mselP5hP9+jCXqA07RnCZ+BivXSxZE3inLtnBiJiOHpP21pM+WSjHH6ib7M1 AfbLo5r9d56x5LNIge+mQBHEEZmPA14vv6OrE3wGscm1z9t1WjZUaVX7kX0qJFSE8LU0 aLYnmB3FqmP1VKPj+OG/ShA17ZKaO2FGZj2egAgnJQZ2E9/TGmIkpxCI2YaCL4QT0qI3 KswUqT8fBQ22V6cvCNXj4dibXPGuUP40zc4TvFzBQnV9gph4pYILNFWyHBFRnSKLFGTE u02sVHnt4QdE3OBUZ/G/OeysFGmKpqFD/cg6Sww9KvhaZnCyRUEiSfmvHR1vFtrUoWAw ZcEQ== X-Gm-Message-State: AOAM532qltkkQAS2vmPRJtoMbTFZ17Gmeep4d1O7oo7PB5TMrXtZCMFw 3QxCvOSWZZEjgTvBav5jfCs= X-Google-Smtp-Source: ABdhPJyKTlUKuaeMFRcQgpWsjYtqHwnrLjGN4XRbmyje0F2LbHyjNh19ZDqmppUf+YGkeFtndydLTQ== X-Received: by 2002:adf:e94b:: with SMTP id m11mr22236063wrn.339.1627993355661; Tue, 03 Aug 2021 05:22:35 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id 19sm2387659wmj.48.2021.08.03.05.22.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 05:22:35 -0700 (PDT) From: luca.boccassi@gmail.com To: Bing Zhao Cc: Viacheslav Ovsiienko , dpdk stable Date: Tue, 3 Aug 2021 13:21:56 +0100 Message-Id: <20210803122214.1094992-7-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210803122214.1094992-1-luca.boccassi@gmail.com> References: <20210726135322.149850-59-luca.boccassi@gmail.com> <20210803122214.1094992-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix queue leaking in hairpin auto bind check' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/05/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/f67d7c848e2d9124197326cbed5616ac11f1a705 Thanks. Luca Boccassi --- >From f67d7c848e2d9124197326cbed5616ac11f1a705 Mon Sep 17 00:00:00 2001 From: Bing Zhao Date: Sat, 24 Jul 2021 16:27:11 +0300 Subject: [PATCH] net/mlx5: fix queue leaking in hairpin auto bind check [ upstream commit 75f166c20ffca1dd28184f8196fbfe90ebafb6ac ] During the start up stage, the hairpin auto bind was executed for each port. All the Tx and Rx queues configured for this port should be checked to confirm if the auto bind of hairpin is needed. 1. The queue is hairpin queue. 2. The peer port is the same one and the peer queue should also be with hairpin type. 3. The manual bind attribute is not set for this queue. If the queue is not a hairpin queue or it doesn't need to be bound automatically, the reference count should be decreased by 1 since the count was increased when calling the mlx5_*xq_get(). When the peer port is not the same, it means that no auto bind is supported and the mlx5_*xq_release() was missed in the current implementation. By calling the release function before continue, the count is correct when calling the device close. Fixes: aa8bea0e3455 ("net/mlx5: add conditional hairpin auto bind") Signed-off-by: Bing Zhao Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_trigger.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index 0c267dce06..33a98ee50c 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -226,12 +226,11 @@ mlx5_hairpin_auto_bind(struct rte_eth_dev *dev) txq_ctrl = mlx5_txq_get(dev, i); if (!txq_ctrl) continue; - if (txq_ctrl->type != MLX5_TXQ_TYPE_HAIRPIN) { + if (txq_ctrl->type != MLX5_TXQ_TYPE_HAIRPIN || + txq_ctrl->hairpin_conf.peers[0].port != self_port) { mlx5_txq_release(dev, i); continue; } - if (txq_ctrl->hairpin_conf.peers[0].port != self_port) - continue; if (txq_ctrl->hairpin_conf.manual_bind) { mlx5_txq_release(dev, i); return 0; @@ -245,13 +244,12 @@ mlx5_hairpin_auto_bind(struct rte_eth_dev *dev) txq_ctrl = mlx5_txq_get(dev, i); if (!txq_ctrl) continue; - if (txq_ctrl->type != MLX5_TXQ_TYPE_HAIRPIN) { - mlx5_txq_release(dev, i); - continue; - } /* Skip hairpin queues with other peer ports. */ - if (txq_ctrl->hairpin_conf.peers[0].port != self_port) + if (txq_ctrl->type != MLX5_TXQ_TYPE_HAIRPIN || + txq_ctrl->hairpin_conf.peers[0].port != self_port) { + mlx5_txq_release(dev, i); continue; + } if (!txq_ctrl->obj) { rte_errno = ENOMEM; DRV_LOG(ERR, "port %u no txq object found: %d", -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-08-03 12:35:08.514105892 +0100 +++ 0007-net-mlx5-fix-queue-leaking-in-hairpin-auto-bind-chec.patch 2021-08-03 12:35:08.186818169 +0100 @@ -1 +1 @@ -From 75f166c20ffca1dd28184f8196fbfe90ebafb6ac Mon Sep 17 00:00:00 2001 +From f67d7c848e2d9124197326cbed5616ac11f1a705 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 75f166c20ffca1dd28184f8196fbfe90ebafb6ac ] + @@ -25 +26,0 @@ -Cc: stable@dpdk.org @@ -34 +35 @@ -index a9d5d58fd9..54173bfacb 100644 +index 0c267dce06..33a98ee50c 100644 @@ -37 +38 @@ -@@ -228,12 +228,11 @@ mlx5_hairpin_auto_bind(struct rte_eth_dev *dev) +@@ -226,12 +226,11 @@ mlx5_hairpin_auto_bind(struct rte_eth_dev *dev) @@ -52 +53 @@ -@@ -247,13 +246,12 @@ mlx5_hairpin_auto_bind(struct rte_eth_dev *dev) +@@ -245,13 +244,12 @@ mlx5_hairpin_auto_bind(struct rte_eth_dev *dev)