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 67DAEA0A03; Mon, 18 Jan 2021 16:27:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28935140F7E; Mon, 18 Jan 2021 16:27:12 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id 8BE05140F7F for ; Mon, 18 Jan 2021 16:27:09 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@nvidia.com) with SMTP; 18 Jan 2021 17:27:04 +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 10IFR4du006946; Mon, 18 Jan 2021 17:27:04 +0200 From: Xueming Li To: Viacheslav Ovsiienko Cc: dev@dpdk.org, Matan Azrad , Shahaf Shuler , Thomas Monjalon , xuemingl@nvidia.com, Asaf Penso Date: Mon, 18 Jan 2021 15:26:46 +0000 Message-Id: <1610983607-7969-2-git-send-email-xuemingl@nvidia.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1610983607-7969-1-git-send-email-xuemingl@nvidia.com> References: <1610983607-7969-1-git-send-email-xuemingl@nvidia.com> In-Reply-To: <1608304614-13908-2-git-send-email-xuemingl@nvidia.com> References: <1608304614-13908-2-git-send-email-xuemingl@nvidia.com> Subject: [dpdk-dev] [PATCH v2 1/2] common/mlx5: support device global syntax 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 Sender: "dev" This patch supports new device global device syntax, resolve class type from "class" section if the devarg is global device syntax: bus=,k=v,,,/class=,k=v,,,/driver=,k=v,,,, To reuse class name of global device 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..c03bdbf4eb 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 != NULL) + /* support new global syntax */ + return class_name_to_value(devargs->cls->name); kvlist = rte_kvargs_parse(devargs->args, NULL); if (kvlist == NULL) return 0; -- 2.25.1