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 21355A0C43; Wed, 20 Oct 2021 13:13:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D8A6411F8; Wed, 20 Oct 2021 13:13:01 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2064.outbound.protection.outlook.com [40.107.237.64]) by mails.dpdk.org (Postfix) with ESMTP id E7CC7411F7 for ; Wed, 20 Oct 2021 13:12:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mxpn6J/hhqBpLdO19T+O3rBEgJVgUr1VcXdiNkF/zE6SThqnMIgxAmRStJCjUyTcy9pHpSzpfv/RcgVY0w+gv2UPnG56k8rSr48EOW0XD7tP5y7h7P/f68OxgROv6DuOrrFt+gjyJKOVmrzRjF6DOQ3VeNoaxc0t5YbBoMbC/TT8k6kEUuTabA6HcVYozAiOrQhJPX4QxHD3XCye883XVwhhNTMILT19nsgIWPncFUguNb7Oh8ChA3f30rq/4pMj1B4VwZpioyxjWmTLGlkc4wAoQ6p57vswz04CTmHSvkCHHRj3KrcmIKDUVFQcbaa+lF9TO7utnQh21keB5rmcPA== 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=4KAr2LwsyxrUUvrTws8k1F5IP+hGZvUFWm83+R5viwk=; b=P08eicn5yliiOJj0q2phMtiXlKzfDQdIkwzzvI+uovG1VX5CSYqUslzPJ8UabJfMjZ26/cprdeef2H/XYeR0FpZgdU42L7MFrO2iCmV1ldlLm5Pokmj1cAD+rWjrEV7yzYsvc0SRVWPZz0Ge7FmtsW2Uv8qK72xPu2FHNnUFC+IYe2zp7z6wFjg2QjB4IlfSDnAbJ1Pla1z1eQDR+0qH8/W3AcHqwwhOwS+QKKg5CLfH5BgE4tHK8oEsqz+j8wS4lObLcvsmgYApKKVHJUXX9ssaV0ECzMVrGi8rbkCJ1TzMKDws7IjsqrbpfOZT+6zSwKFTkSTfyic4pxmqTqGgSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=4KAr2LwsyxrUUvrTws8k1F5IP+hGZvUFWm83+R5viwk=; b=KoGreNOS0Ut6/5ZCeAx/XB6m9jvvaKjgZ1xf2ExklUJxtyJ9o+pTwxSY0Askyw7x07j/oiAnQIzfPp1LOwI2EtmU6hX3PcloqWzl5unmxIhZDqAsgTX0SjBqQJnJ6YVtUXOI06BVptQYqoPe9m9t1Ojz7g2fEiCLgWX82rnW4la/PxF0FUCjMU6cKXsUnNOJw3tghxIWXg8mJbaLljuUobdCRdGqFbtbjldXmds/DjoPzk2hbCZDi/2OrhIx2cpg2qWZCWZOxm9UPPDn/CwS7sBWDkUrUINfJnDZv3o5DgaCxCGW0SGp8pYC1KQZtt7Kn5Ri00YUBlSLpE/+sCRKMA== Received: from MWHPR11CA0026.namprd11.prod.outlook.com (2603:10b6:300:115::12) by BN8PR12MB3617.namprd12.prod.outlook.com (2603:10b6:408:47::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Wed, 20 Oct 2021 11:12:54 +0000 Received: from CO1NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:300:115:cafe::c1) by MWHPR11CA0026.outlook.office365.com (2603:10b6:300:115::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Wed, 20 Oct 2021 11:12:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT055.mail.protection.outlook.com (10.13.175.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4628.16 via Frontend Transport; Wed, 20 Oct 2021 11:12:50 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 20 Oct 2021 11:12:45 +0000 From: Xueming Li To: , Gaetan Rivet , David Marchand CC: , Thomas Monjalon , "Lior Margalit" Date: Wed, 20 Oct 2021 19:12:29 +0800 Message-ID: <20211020111230.2441949-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211020111230.2441949-1-xuemingl@nvidia.com> References: <20211005123012.264727-1-xuemingl@nvidia.com> <20211020111230.2441949-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c763f7e8-4140-4593-55e2-08d993ba8e2a X-MS-TrafficTypeDiagnostic: BN8PR12MB3617: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1443; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JT4wH0tl60SuMgjhk28HZBW57Xhb5TXlO7Wud53DVdO1UELTtMPXbcq0WhPwPfWh4dIyZYgNydTpxuTrUxxy5ZdAGT1p24EffLUw3Y3kOz4818Wax0pH4RCCvSQQH1DDjS6p3stJlapiZAH8lHn5vnQawqtZhx3Z0nIgiil6Br8RT29Rug0GxYJwRmRKH3heIHwsKH0mjCArZlNi8kpocZOYRulXSzc1sBL9nbZ2J357aNXf91mEm7qHWIRq5ieLRlzYB9dZ71JVU7Gy/s+pqrt9ta+mhNbPjZZkYZHS+0qliYg2wC5tDCkzqh88sdUPs/S3PltehOFLkh6i5g15Byf1iE5weiWFYtPvkKevqvoREhjjOstaUahdmG9AKX6GyADWM2GLZZb638gZGEFobM4czy8NsMmr5+3Qv5FLbo6u5xnf9/5ExfUUhqN3UAohqPgnLNSxE10IAm8e3euv5paF3O12aXs5DotxWNKXX4AplbFC86bwueuRamor3C9Tl0HbS/iv7b8AwnRIZ4XcIDRGC9/KUZjrthcQeWih0hagEMhxOGy3fX0i7veQeJyneNGl5PD0iy0o0P2/1KvmzU49mud3U/r5EaQzon8F54BlanRHuz7Zss/vO/uOEVr0yBd2ZsuMHi/UQe8KDH+ppnjTI3jezPxretT0ai8VYh/KrSHajE7DFK9ATTZCDX7lKeWoIh0fvXyCvEyjDmBE8w== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(107886003)(5660300002)(16526019)(6286002)(186003)(110136005)(55016002)(426003)(54906003)(86362001)(2906002)(36756003)(26005)(316002)(36860700001)(8936002)(2616005)(4326008)(83380400001)(1076003)(356005)(6666004)(7696005)(70206006)(82310400003)(70586007)(508600001)(336012)(7636003)(47076005)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2021 11:12:50.3607 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c763f7e8-4140-4593-55e2-08d993ba8e2a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3617 Subject: [dpdk-dev] [PATCH v4 2/3] devargs: make bus key parsing optional 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" Global devargs syntax is used as device iteration filter like "class=vdpa", a devargs without bus args is valid from parsing perspective. This patch makes bus args optional. Fixes: d2a66ad79480 ("bus: add device arguments name parsing") Signed-off-by: Xueming Li Reviewed-by: Gaetan Rivet --- drivers/bus/pci/pci_params.c | 8 +++----- lib/eal/common/eal_common_devargs.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c index 21c2e1d0368..60b424b8297 100644 --- a/drivers/bus/pci/pci_params.c +++ b/drivers/bus/pci/pci_params.c @@ -87,11 +87,10 @@ rte_pci_devargs_parse(struct rte_devargs *da) struct rte_kvargs *kvargs; const char *addr_str; struct rte_pci_addr addr; - int ret; + int ret = 0; - if (da == NULL) + if (da == NULL || da->bus_str == NULL) return 0; - RTE_ASSERT(da->bus_str != NULL); kvargs = rte_kvargs_parse(da->bus_str, NULL); if (kvargs == NULL) { @@ -103,9 +102,8 @@ rte_pci_devargs_parse(struct rte_devargs *da) addr_str = rte_kvargs_get(kvargs, pci_params_keys[RTE_PCI_PARAM_ADDR]); if (addr_str == NULL) { - RTE_LOG(ERR, EAL, "No PCI address specified using '%s=' in: %s\n", + RTE_LOG(DEBUG, EAL, "No PCI address specified using '%s=' in: %s\n", pci_params_keys[RTE_PCI_PARAM_ADDR], da->bus_str); - ret = -ENODEV; goto out; } diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c index d673598032d..8c7650cf6c2 100644 --- a/lib/eal/common/eal_common_devargs.c +++ b/lib/eal/common/eal_common_devargs.c @@ -39,7 +39,7 @@ devargs_bus_parse_default(struct rte_devargs *devargs, /* Parse devargs name from bus key-value list. */ name = rte_kvargs_get(bus_args, "name"); if (name == NULL) { - RTE_LOG(INFO, EAL, "devargs name not found: %s\n", + RTE_LOG(DEBUG, EAL, "devargs name not found: %s\n", devargs->data); return 0; } -- 2.33.0