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 112BDA0032; Thu, 1 Sep 2022 10:28:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B892C40684; Thu, 1 Sep 2022 10:28:25 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2083.outbound.protection.outlook.com [40.107.237.83]) by mails.dpdk.org (Postfix) with ESMTP id BC9AC40395 for ; Thu, 1 Sep 2022 10:28:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJLtLdYdmrgQ/1n3Xv0zNjUN5F9OrMHlsBiqDlw51eqpc2nGF7E6l4XeYoJD0TIp7ZCYKqgtxbWUllz2x+yq33XTXeqLVDSaWWHoXlzkGAZctPghML65G8hDYd1UW8QvDBmN5SCA5nyGXCv2dmxtrpqWpCOR/vQgrqGG1z9TQLHUDd1CTk7i/gBtbRzMTyTFsYZbK/nbowRfpAGE6I0TfbSnxYAEM69qVPg/LczvhUqZ8ELFwEoY4R1yWYtOAmXbpIFyA7ReoZfKBxgkknJw5Ur6EfKBewuPX7xUXtbFnpuVgL3BzsGz0umAcM7qR8GsplXRCwExnq/gvHTbYtWWug== 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=swZv0skmMC7ve3UpdrOIkWD4xKwpHN4k9GGOvnImVlI=; b=B4ijhfroU9/uv6tEAlhpTZuOQy5xMPK0kxyE/MqeUdvRMEYO2JiGXDcIiR063OekhctCBMsrB+1jebUidqC02qQOU6xiiV9Lgz/tPGQ/AgWxwHDdxkx/Nif9Q2RKRrcfHbEZ4JILeXkwZX562rQqahUxzv0xVgn3J78f4apkDWFNTWNbgUAHZIJQ9MlKajxRVf+1FMoM3wxpOc6Ay+hAgfHr++vst7fOOu2yatQWUI2XTn1/3rtNdSwy1rGm88LdPNaAQeu7moVvrBZh3x5qqCbFp/xFL9nsnQvwP6nAzAN9I6RjHFunrlWkIUu9rRjisKmWg0/ZI1cgDp/Yf8k5Sg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=swZv0skmMC7ve3UpdrOIkWD4xKwpHN4k9GGOvnImVlI=; b=Cq2WQjR8X43GY1o+kM04/WpcOcdbuNL/WjUqxjEveExJbyE32Ec7TWpDBs0g6sXmFsSpH3NEqdtGvCfPCTs36VFwyjEvpwEgBua63bhglzK6yUX9GlHBHFBz7gx203GWmJiwwkBDMDubLR4MNs0czPIlH2Ag4TjhqQ5Zj/PDoIbP6OxfMPBFMykFV8uiUiG/ExYR/urT5TYK0ZnbevDvr5qqrbQInp8bFUvpmgqSUUrtQnHJrygRjsqxqEJldNs/IWjL6GFgdrk4bOmnfLsEdMMfIopQqBZOypgn/wFGohuKL57Chq+mi8qegO0Q4pyaCmQXbMAPjSjnVGxVzs/9mA== Received: from BN9PR03CA0661.namprd03.prod.outlook.com (2603:10b6:408:10e::6) by MN0PR12MB6175.namprd12.prod.outlook.com (2603:10b6:208:3c4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Thu, 1 Sep 2022 08:28:22 +0000 Received: from BN8NAM11FT105.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10e:cafe::da) by BN9PR03CA0661.outlook.office365.com (2603:10b6:408:10e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Thu, 1 Sep 2022 08:28:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT105.mail.protection.outlook.com (10.13.176.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5588.10 via Frontend Transport; Thu, 1 Sep 2022 08:28:22 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Thu, 1 Sep 2022 08:28:21 +0000 Received: from nvidia.com (10.126.231.35) 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.29; Thu, 1 Sep 2022 01:28:19 -0700 From: Gerry Gribbon To: CC: , , Ori Kam Subject: [PATCH] regex/mlx5: add check for nb max matches Date: Thu, 1 Sep 2022 08:28:02 +0000 Message-ID: <20220901082802.2434855-1-ggribbon@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3c0876f9-177e-432e-1620-08da8bf3eeb2 X-MS-TrafficTypeDiagnostic: MN0PR12MB6175:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g/MutjsuuZ8vkJNmGWQjC6kcwhnXSElnPytyjLZPH+t34FuXKkdwTsg+ITMlcWdTEn0D++cLYVRoLrbGlivGE+9++CjUMiKCOdVzUAUwyw8hx//OryKOA8mNGqn5H6lUsM0cC2Ct76R16Plj8dGUFHLetLWh2pPd8UO9Ald3ad4H6wn8Ladav39UDQ0iht8rlDLoj6RiUM7JGRvOYt0SpJUfURpsGWsPMgdbEXUI8futWg3s8uZS/yWAQ9unAWX7UF78XvHDNZifzgk3cGKf9fvEkdCffMq/V15FRn7qMFiUER0g/59F2T+ZWthqD2djr5xGC3JyKXw8+NSnRC4FQ/x2DuxPn5BJZPB8vSKHycxQFx+ZYiNEFRqdounbSSnbt6/YguutQuQSAms6v3Nf/0P8DP1nxCi7Xh/o+aNwQh5DJx7e4j/0bV/KEqIhArM4kNqfK9EHDHxWNc5s7xS0VwaAB8TXEFVVg6uM2VUziYT6dJW5D71jMhw7JIpssqSO9lSnJqAoGMP60VRaDbNMvgr3kzoISdvx+QA1sRKWrDwwTHEKF4fduoDCp8cyFnbicVoHLQ8NCbAcbTRDpjZNbdBfRh7lo/Q7LJV1rv5YW//fGealWnTl6g7aTDpglBpfrF0QOXDyGfRT7h8Uq/ndlLG7uoKHuB+2OLpnp37Jhyf2UvW1gcsqDga3k8N6JaSHSVmY6rJ/ffbgV0XSHUTUbmYjy999qMnS5CYCbuv7kpLMQgl+mi75H1hvTmePNr1uhevCSIi0GXKjXkxtVd2NlYRWiJ0twLGugn0Ud3liiHuPe8HVFkRpt6EMRZPGm2qS X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(376002)(346002)(396003)(136003)(39860400002)(36840700001)(40470700004)(46966006)(336012)(6666004)(4744005)(2616005)(6286002)(26005)(82740400003)(82310400005)(426003)(7696005)(47076005)(2906002)(55016003)(16526019)(186003)(1076003)(40460700003)(36860700001)(40480700001)(4326008)(6916009)(316002)(8676002)(70206006)(70586007)(107886003)(5660300002)(41300700001)(356005)(81166007)(36756003)(54906003)(86362001)(478600001)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2022 08:28:22.2277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c0876f9-177e-432e-1620-08da8bf3eeb2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT105.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6175 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Added check so user gets error if they try to configure the nb_max_matches value when using rte_regexdev_configure(). Signed-off-by: Gerry Gribbon Acked-by: Ori Kam --- drivers/regex/mlx5/mlx5_rxp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/regex/mlx5/mlx5_rxp.c b/drivers/regex/mlx5/mlx5_rxp.c index ed3af15e40..47d32b7dd7 100644 --- a/drivers/regex/mlx5/mlx5_rxp.c +++ b/drivers/regex/mlx5/mlx5_rxp.c @@ -144,6 +144,11 @@ mlx5_regex_configure(struct rte_regexdev *dev, if (priv->prog_mode == MLX5_RXP_MODE_NOT_DEFINED) return -1; + if (cfg->nb_max_matches != MLX5_REGEX_MAX_MATCHES) { + DRV_LOG(ERR, "nb_max_matches is not configurable."); + rte_errno = EINVAL; + return -rte_errno; + } priv->nb_queues = cfg->nb_queue_pairs; dev->data->dev_conf.nb_queue_pairs = priv->nb_queues; priv->qps = rte_zmalloc(NULL, sizeof(struct mlx5_regex_qp) * -- 2.25.1