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 1820F41E9F for ; Wed, 15 Mar 2023 15:37:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 150A442BAC; Wed, 15 Mar 2023 15:37:24 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 15F23427F2 for ; Wed, 15 Mar 2023 15:37:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678891040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R+t++oJFtLKJ1UdHzTOO/TQkqIYRnSCPKaiAHyU0vsw=; b=HCKaoTqTehP+B3nCkg9l9c97VT7vF1kI1L9rK5a7jo7G3euoD4mJy89EhlZ8iaxdkdwMoE s7WLQ6BwVRhFkJSF0DuhIeZrqkyRkJmLT8BpkgRrxy0bge2ehfmS6PaSDymAxD7b4VKl/Y ILvIQgAmpvNLBq7oCNxMDK4nI/oJ+yw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-457-xJtjF2JOOhOuvyDVciqfAQ-1; Wed, 15 Mar 2023 10:37:18 -0400 X-MC-Unique: xJtjF2JOOhOuvyDVciqfAQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 76F5138149AB; Wed, 15 Mar 2023 14:37:18 +0000 (UTC) Received: from rh.Home (unknown [10.39.192.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5CB540C6E67; Wed, 15 Mar 2023 14:37:17 +0000 (UTC) From: Kevin Traynor To: Gerry Gribbon Cc: dpdk stable Subject: patch 'regex/mlx5: utilize all available queue pairs' has been queued to stable release 21.11.4 Date: Wed, 15 Mar 2023 14:36:25 +0000 Message-Id: <20230315143640.677317-32-ktraynor@redhat.com> In-Reply-To: <20230315143640.677317-1-ktraynor@redhat.com> References: <20230315143640.677317-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 21.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/20/23. 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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/e140c624f60fba5dbed361ab26ac87ac8ac108d7 Thanks. Kevin --- >From e140c624f60fba5dbed361ab26ac87ac8ac108d7 Mon Sep 17 00:00:00 2001 From: Gerry Gribbon Date: Tue, 21 Feb 2023 07:47:28 +0000 Subject: [PATCH] regex/mlx5: utilize all available queue pairs [ upstream commit 2fa696a2e93c57f22a6640987b5f4378fb5de899 ] Fix overflow of free QP mask. Regex used 64 QPs and used a bitmask to select a free QP for use. The bitmask in use was only 32 bits so did not allow half of the QPs to be utilised. Upgraded to 64 bit mask and using ffsll now instead of ffs. Fixes: 270032608503 ("regex/mlx5: refactor HW queue objects") Signed-off-by: Gerry Gribbon --- drivers/regex/mlx5/mlx5_regex.h | 2 +- drivers/regex/mlx5/mlx5_regex_fastpath.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/regex/mlx5/mlx5_regex.h b/drivers/regex/mlx5/mlx5_regex.h index 89495301ac..831eb153eb 100644 --- a/drivers/regex/mlx5/mlx5_regex.h +++ b/drivers/regex/mlx5/mlx5_regex.h @@ -38,5 +38,5 @@ struct mlx5_regex_qp { uint16_t nb_obj; /* Number of qp objects. */ struct mlx5_regex_cq cq; /* CQ struct. */ - uint32_t free_qps; + uint64_t free_qps; struct mlx5_regex_job *jobs; struct ibv_mr *metadata; diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c index 9a2db7e43f..4edd56d045 100644 --- a/drivers/regex/mlx5/mlx5_regex_fastpath.c +++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c @@ -376,5 +376,5 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id, size_t hw_qpid, nb_left = nb_ops, nb_desc; - while ((hw_qpid = ffs(queue->free_qps))) { + while ((hw_qpid = ffsll(queue->free_qps))) { hw_qpid--; /* ffs returns 1 for bit 0 */ qp_obj = &queue->qps[hw_qpid]; @@ -385,5 +385,5 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id, nb_desc = nb_left; else - queue->free_qps &= ~(1 << hw_qpid); + queue->free_qps &= ~(1ULL << hw_qpid); prep_regex_umr_wqe_set(priv, queue, qp_obj, ops, nb_desc); @@ -410,5 +410,5 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id, size_t hw_qpid, job_id, i = 0; - while ((hw_qpid = ffs(queue->free_qps))) { + while ((hw_qpid = ffsll(queue->free_qps))) { hw_qpid--; /* ffs returns 1 for bit 0 */ qp_obj = &queue->qps[hw_qpid]; @@ -424,5 +424,5 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id, } } - queue->free_qps &= ~(1 << hw_qpid); + queue->free_qps &= ~(1ULL << hw_qpid); send_doorbell(priv, qp_obj); } @@ -557,5 +557,5 @@ mlx5_regexdev_dequeue(struct rte_regexdev *dev, uint16_t qp_id, rte_wmb(); cq->cq_obj.db_rec[0] = rte_cpu_to_be_32(cq->ci); - queue->free_qps |= (1 << hw_qpid); + queue->free_qps |= (1ULL << hw_qpid); } @@ -596,5 +596,5 @@ setup_qps(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *queue) wqe += 64; } - queue->free_qps |= 1 << hw_qpid; + queue->free_qps |= 1ULL << hw_qpid; } } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-15 14:30:21.372001865 +0000 +++ 0032-regex-mlx5-utilize-all-available-queue-pairs.patch 2023-03-15 14:30:20.597123742 +0000 @@ -1 +1 @@ -From 2fa696a2e93c57f22a6640987b5f4378fb5de899 Mon Sep 17 00:00:00 2001 +From e140c624f60fba5dbed361ab26ac87ac8ac108d7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2fa696a2e93c57f22a6640987b5f4378fb5de899 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index b8554fd1cf..481f6fc59f 100644 +index 89495301ac..831eb153eb 100644 @@ -33 +34 @@ -index 143c7d7cdf..6c87afa923 100644 +index 9a2db7e43f..4edd56d045 100644 @@ -36,2 +37,2 @@ -@@ -418,5 +418,5 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id, - #endif +@@ -376,5 +376,5 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id, + size_t hw_qpid, nb_left = nb_ops, nb_desc; @@ -43 +44 @@ -@@ -427,5 +427,5 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id, +@@ -385,5 +385,5 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id, @@ -50,2 +51,2 @@ -@@ -457,5 +457,5 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id, - #endif +@@ -410,5 +410,5 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id, + size_t hw_qpid, job_id, i = 0; @@ -57 +58 @@ -@@ -471,5 +471,5 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id, +@@ -424,5 +424,5 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id, @@ -64 +65 @@ -@@ -604,5 +604,5 @@ mlx5_regexdev_dequeue(struct rte_regexdev *dev, uint16_t qp_id, +@@ -557,5 +557,5 @@ mlx5_regexdev_dequeue(struct rte_regexdev *dev, uint16_t qp_id, @@ -71 +72 @@ -@@ -643,5 +643,5 @@ setup_qps(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *queue) +@@ -596,5 +596,5 @@ setup_qps(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *queue)