From patchwork Fri Dec 18 15:16:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xueming Li X-Patchwork-Id: 85475 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3D837A09FD; Fri, 18 Dec 2020 16:18:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 639FDCB7F; Fri, 18 Dec 2020 16:17:20 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 4C2DACB03 for ; Fri, 18 Dec 2020 16:17:10 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@nvidia.com) with SMTP; 18 Dec 2020 17:17:05 +0200 Received: from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0BIFH4qg010856; Fri, 18 Dec 2020 17:17:05 +0200 From: Xueming Li To: Viacheslav Ovsiienko , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Olivier Matz , Matan Azrad Cc: dev@dpdk.org, xuemingl@nvidia.com, Asaf Penso Date: Fri, 18 Dec 2020 15:16:53 +0000 Message-Id: <1608304614-13908-9-git-send-email-xuemingl@nvidia.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1608304614-13908-1-git-send-email-xuemingl@nvidia.com> References: <1608304614-13908-1-git-send-email-xuemingl@nvidia.com> Subject: [dpdk-dev] [RFC 8/9] common/mlx5: support device global syntax 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" This patch support new device global syntax: bus=,k=v,,,/class=,k=v,,,/driver=,k=v,,,, To reuse class name of global syntax, this patch also changes internal class name introduced by commit [1] to algin with RTE class name. [1] 8a41f4deccc3: common/mlx5: introduce layer for multiple class drivers Signed-off-by: Xueming Li --- drivers/common/mlx5/mlx5_common_pci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c index 5208972bb6..b1eda7b3c8 100644 --- a/drivers/common/mlx5/mlx5_common_pci.c +++ b/drivers/common/mlx5/mlx5_common_pci.c @@ -4,6 +4,7 @@ #include #include +#include #include "mlx5_common_utils.h" #include "mlx5_common_pci.h" @@ -26,7 +27,7 @@ static const struct { unsigned int driver_class; } mlx5_classes[] = { { .name = "vdpa", .driver_class = MLX5_CLASS_VDPA }, - { .name = "net", .driver_class = MLX5_CLASS_NET }, + { .name = "eth", .driver_class = MLX5_CLASS_NET }, { .name = "regex", .driver_class = MLX5_CLASS_REGEX }, }; @@ -115,6 +116,9 @@ parse_class_options(const struct rte_devargs *devargs) if (devargs == NULL) return 0; + if (devargs->cls) + /* support new global syntax */ + return class_name_to_value(devargs->cls->name); kvlist = rte_kvargs_parse(devargs->args, NULL); if (kvlist == NULL) return 0;