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 BDBD1428F8 for ; Sun, 9 Apr 2023 17:31:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B89FE41149; Sun, 9 Apr 2023 17:31:20 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2067.outbound.protection.outlook.com [40.107.237.67]) by mails.dpdk.org (Postfix) with ESMTP id 61C2A40A80 for ; Sun, 9 Apr 2023 17:31:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j0CJuWTfBpppN96FPfd7MSjwds3qBNZAi5YpTXYkNQl4l61eeqz/4B69Iw/9U0HaDxQ/2wnc5gX1hbQ86ohgX1Dpreb1CL4memrdHf31x5DtvcPXaaq7NQi9btG9JXf42W6O+1DTjDpdq5JdxPp5JT6cN0xAILqnlbmnVB+0jIb1NOCMk3gfm8uABCBp8p/+VPevULj7+2i6+0ZCaS7q17s3QRgwPPGb0NSIdmGeQJUHZMNGD/4m1sghe92vUMXnCreOPqutdyr+Fy2jtbMYda5mKKkKOn4oI2bOefv3FSstrQmzA4FImCADkEpUs8xHFKVlpfHdrINwNT+JIiRnhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BUtil91B9fmDuaalbyk2whLOJqs/vTLjTlr4Yi79fqs=; b=CnwTD38BfdjqKb98QTL33RFfMc/GO13Ray2VqPjXGJyU3kk4gp5LUNCI+7qWsLe1GZg55E5NmSOMx8AzwvTW7GzgOuR1zevbGaZ2XrvEV0vQuyu5nGO9KZ32ITP3wmbpYhcTp2OperzSo2vFr6j/on7/vS/9UQL1V90Rf6U0QRIbq7eWZ3aDygU8f2s8FfoOboPIr9d+DUCHs6/SqzyBLG4/ADFode23xkUvRbm/jT0+IYybyw5zF9zk6RCMl3HODREFnqpiZFtxB2M5xiylcVLuvvDxx0gS7BulKjm9Qv5EVu4C86MW9dSHZ4UiFytJTV+HETd7c078ZBGap4sAgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BUtil91B9fmDuaalbyk2whLOJqs/vTLjTlr4Yi79fqs=; b=Sg8MOeFqpUHNm+xPz+SU8pUphQRMvOAMG5Xxt/Z9vVYSsbAKpng23t+m9Q648GbR3Qj7l40DDmh4hrJLhEHMKjwushBOQY/yRrn9RsCpRR0O0mlNi7qFgtBL16Ky0poeSCD6UgVtZI5EA78s9IheX1WXAMJZfZ82gjutapDQxoYE5csBgVPsWHV3qsj40l9HubNFf6BC6vS4k+uqv7i2KN4vpwMLpU5A1xwwqzr74E2ACKEudIf5+WgciBHUAQ4hICXkTpJVdwnaJcT1ejiNoLUVDKCvOIyjuPTvxhKUmii5yX+abhAUVJHCL/+qP4+4IkehUeCD+Wargy4qb/ByEA== Received: from DS7PR05CA0016.namprd05.prod.outlook.com (2603:10b6:5:3b9::21) by CY8PR12MB8315.namprd12.prod.outlook.com (2603:10b6:930:7e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Sun, 9 Apr 2023 15:31:16 +0000 Received: from DM6NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b9:cafe::ff) by DS7PR05CA0016.outlook.office365.com (2603:10b6:5:3b9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.26 via Frontend Transport; Sun, 9 Apr 2023 15:31:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT034.mail.protection.outlook.com (10.13.173.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.25 via Frontend Transport; Sun, 9 Apr 2023 15:31:16 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 9 Apr 2023 08:30:55 -0700 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 9 Apr 2023 08:30:54 -0700 From: Xueming Li To: Gerry Gribbon CC: dpdk stable Subject: patch 'regex/mlx5: utilize all available queue pairs' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:24:11 +0800 Message-ID: <20230409152529.5308-64-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT034:EE_|CY8PR12MB8315:EE_ X-MS-Office365-Filtering-Correlation-Id: d47d0571-73c4-425a-99a2-08db390f7587 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DB0uTJwlhdnlotp50169L8e87CwVjttxR3eb6wW25+R8/1Poxmlf2JjTNYALWRA6cXl6E8kQcLmDvj+R4GRfWdViWFrECpdXW9Vc1HZPFKGZg0PR7FgRHRuFKFe5Qznf7TnyK/CXCFhWxhGbEIv48+VZ0+PvBSPShTi4zxSLZXCo46yUjiFLVzn0eG2Y4ehyJQygtoV5cKHshJscQ/Xull1B+coK8Xp+fZi19smTvU0ZAalTWf0eIy/UrOP2aYwMVdOH5eSDxdFkfJJSyuo+W+eoH2fbwD8+P5rdp/7e8k0KG1qeP9s1/uqjPexRAMlXnrGldC0+y83UyhCEI8JiWoy01MazItuODtl+WOnbaUqDhm4AJ3PfGhcynHGE84fgYVRrM8hu8YY4znkpip+x3JjHtdcnxJ6e1YR8TPXQaukskG7Z4oGnlDvPEcs8/yYxn7ifofelhgtfbH7LwYOCPwdjYHwnuhLKWTvX0GnyPdsVkz6rhcOp59SGuodr2ILk91zs7is17TOubfXhsHIn87wIkqUGtukBD39VPV6usopuLwpvOTCIaYf4j9m7+LmH4x49QbK4SMbItO3VLRcVhkrYcADChjNqKhJasNsSlIUptlHXfWLODwPrcM0J048lPbpPWjpMBisjz8iSdRC/LOOYGgNpLvqyNifMOAeatUi0dxDCLSTwzJ1J2IVSh0rhBNuAlk47TFgCKMARueuSNIth2CZYsqZyZSx8CBxdF6hszX01TG/ntTXSChf5Z+dEWNZA61lZmcjicoLoUEyQ4vhkPcbqcvWoWsd4NcrsogWjN1XvGX/ywM5tY9MtCLRAIB6duHQFeMGTiAS8jUswUwycwngHbruJQzw1QVMxso8= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199021)(36840700001)(40470700004)(46966006)(7696005)(478600001)(86362001)(55016003)(40480700001)(83380400001)(47076005)(36756003)(40460700003)(82740400003)(7636003)(356005)(2616005)(36860700001)(426003)(336012)(6666004)(966005)(2906002)(6636002)(316002)(37006003)(16526019)(6286002)(186003)(1076003)(53546011)(26005)(8676002)(41300700001)(6862004)(8936002)(5660300002)(82310400005)(4326008)(70586007)(70206006)(131093003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:31:16.0764 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d47d0571-73c4-425a-99a2-08db390f7587 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8315 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 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/11/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/b5512d3186fac7391068f825896c8b63d83ee3d7 Thanks. Xueming Li --- >From b5512d3186fac7391068f825896c8b63d83ee3d7 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 Cc: Xueming Li [ 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 b8554fd1cf..481f6fc59f 100644 --- a/drivers/regex/mlx5/mlx5_regex.h +++ b/drivers/regex/mlx5/mlx5_regex.h @@ -37,7 +37,7 @@ struct mlx5_regex_qp { struct mlx5_regex_hw_qp *qps; /* Pointer to qp array. */ 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; struct ibv_mr *outputs; diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c index 143c7d7cdf..6c87afa923 100644 --- a/drivers/regex/mlx5/mlx5_regex_fastpath.c +++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c @@ -417,7 +417,7 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id, return 0; #endif - 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]; nb_desc = get_free(qp_obj, priv->has_umr); @@ -426,7 +426,7 @@ mlx5_regexdev_enqueue_gga(struct rte_regexdev *dev, uint16_t qp_id, if (nb_desc > nb_left) 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); send_doorbell(priv, qp_obj); @@ -456,7 +456,7 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id, return 0; #endif - 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]; while (get_free(qp_obj, priv->has_umr)) { @@ -470,7 +470,7 @@ mlx5_regexdev_enqueue(struct rte_regexdev *dev, uint16_t qp_id, goto out; } } - queue->free_qps &= ~(1 << hw_qpid); + queue->free_qps &= ~(1ULL << hw_qpid); send_doorbell(priv, qp_obj); } @@ -603,7 +603,7 @@ mlx5_regexdev_dequeue(struct rte_regexdev *dev, uint16_t qp_id, cq->ci = (cq->ci + 1) & 0xffffff; 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); } out: @@ -642,7 +642,7 @@ setup_qps(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *queue) (uintptr_t)job->output); wqe += 64; } - queue->free_qps |= 1 << hw_qpid; + queue->free_qps |= 1ULL << hw_qpid; } } -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:40.396606800 +0800 +++ 0063-regex-mlx5-utilize-all-available-queue-pairs.patch 2023-04-09 21:45:38.669042200 +0800 @@ -1 +1 @@ -From 2fa696a2e93c57f22a6640987b5f4378fb5de899 Mon Sep 17 00:00:00 2001 +From b5512d3186fac7391068f825896c8b63d83ee3d7 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 2fa696a2e93c57f22a6640987b5f4378fb5de899 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org