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 97A45A0A0E for ; Mon, 10 May 2021 18:16:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9169F40140; Mon, 10 May 2021 18:16:00 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2084.outbound.protection.outlook.com [40.107.223.84]) by mails.dpdk.org (Postfix) with ESMTP id 54D3040140 for ; Mon, 10 May 2021 18:15:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kSFvcQIbDBsKtQxdipQKnehgC9DFxmpd7BhypMI/u1MvkYH8GJp/h/D+mXx1TQlgDFK5eXGdHTVSplAY9NnuE7za9N76yFcV12sYA2MiFvHrhBaAEdIE6envPP0G+xKLxlTPYmRYJjJ4x/i1uk/07x6aqT9zGJz+oyD5nQI5vTg1kPQUg+VBYDfNtCy4zctfm6wz3FLTOrsTwpgcgTgl3y6o8n/bgd6SYpaIVa0aEjxHXFt9F8HkKRzbpE1PeD9Dp8JlDBJNjqQSTcCzg4GwhBO70NK8JZ4my9dM4Cw66Y3Qn6ugZvVftCcevi1Fe1SMdi7T5+2gisF0VUhzdfdK2Q== 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-SenderADCheck; bh=N36lx5FeaXtr/JpVKW61+8pp1sQ3TU18VILia/T7Kig=; b=QXpQxxoIclwAK/lD8GJImiN6r2amkLnn8Uzf4xjb6CjEpcZzhadTrcijxTTVNBR8W07bpWGe8hc2xrrL1OMMcblenj3oCCO0dRldeN4j5yGHFruQx43/i1ENgXAmWBwFhirFeAJVw5aH7rWE+9yauQnqqJLeR787f7eFhLe759WFEUQcX3StXxyvSrhG3Sus5vyFo2IuMSu10bIxb0xQr95nUlxmaVx7sQ3HFkVutH9I24CQT0Rquvp86f62kH20ytn+zzv6xTL3mcAt0f9hwjYl5qaG1YmoAwCPNlf3t5dNxyWfNSMNZy1C89lhlKrqOQ10V2b8hYYgdeI+YompWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=broadcom.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=N36lx5FeaXtr/JpVKW61+8pp1sQ3TU18VILia/T7Kig=; b=P1723QJkKdiSOJCtuShmO8JH2cCvE2k5iGlwMqJTXAzB+eUgl+epYYqI/yVgHlYq2iNZMT15yrs3C+a2OlUCT1kd4NUgS56dFYzO11KP4GTMX0+LhRO+UytXDMMx8LxNVx0cYAFONPRnb7i+NI3PuacRQkEVH71w4xD4EUnGkXKH1aAiXTx0zUo/+zYCWgXFFCGL5HrCSedrqjja/USU/4RusoXL4lM4Givm8jHFp9o0dT374BtDZL7Q8vUCgMdUcYPKyCrtia52zuyptzEZstINCiKtC3jhqXmOSpETZC+9z7dylSJHhb5sEkeJa29JK7W2phSBzaCrVCRncy89dw== Received: from DM5PR11CA0016.namprd11.prod.outlook.com (2603:10b6:3:115::26) by DM6PR12MB4299.namprd12.prod.outlook.com (2603:10b6:5:223::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27; Mon, 10 May 2021 16:15:57 +0000 Received: from DM6NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:3:115:cafe::36) by DM5PR11CA0016.outlook.office365.com (2603:10b6:3:115::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:15:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; broadcom.com; dkim=none (message not signed) header.d=none;broadcom.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 DM6NAM11FT058.mail.protection.outlook.com (10.13.172.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:15:57 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:15:55 +0000 From: Xueming Li To: Thomas Monjalon CC: Luca Boccassi , David Marchand , Ajit Khaparde , dpdk stable Date: Tue, 11 May 2021 00:01:19 +0800 Message-ID: <20210510160258.30982-130-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.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: f0deb6bb-3db2-4bca-16de-08d913cee526 X-MS-TrafficTypeDiagnostic: DM6PR12MB4299: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tle0UktJiLXemRG2Ntvy89+1eWWPN+ZGxGRYsE3ah4F0NvM4dfflmIA9Wv8mBLjTJ10Zd9EgDwROkdhoVQXri76F5l0uUE2b5i4PD4HAjPtY3HUbkNFEbclFTacfeHs8Vhk6QAqGhaZsew7jqfo5g/cpScwXTbYcT8gVTzfPNAciL5XMet4fcywortnRKTcf+mejoJIgJ2HnGkZqmK2YfVwLr7rduh/icQbHh2kYENnS1/inF6zvRlMhma7F/D62zfq5ea7rmfYdeXNkBXH0nv4zWk9s6wcfoQnoSAcS/tFSSoj1s3WydjoS6PBVNjTgSv6jZ2OD7hSdkGCSLZIQ8ABBNYQyuj7nK2HGbrHUetnbsPwWtk1+F1JoTGoGtkOHq1Hdyn06rkLCJoYNR+feIm6pEAJfAWW+XQ1bQnBlsCGBrwWYsgP5H7wxOnkY4Y6/Zcfib7IJ6KLilZgTWX08Efrl4ExiWlZnyo9FbObQFTzG1UB3ZV4x4RwWgxG9okoyAaJ7ebdobAv94JXv5qSi4eeTnnapql3nOyMZFInzW9V3bztAxttHsaXMNdyj1WOSz0ONp6a5Y4/KizogIEEgpmjVfIofJosVzHWCx6Pkp4S9VuyK1YKltBDwGZX6eLHY5bjxApXDDqZmNH0m/SiWeepxG8wpsamj9cYcqXg6eVSYyRq/ZdgqmZcdMT0HDVPCpcJrT7gKMBIY1M7shxvrmO2Bor8hsyFYhsmUhqa6HxIcV6jQuWp7OQXP7FPUxwG3mvXXNsVAD1UIEWrOYEYAdg== 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)(376002)(346002)(39860400002)(136003)(396003)(46966006)(36840700001)(82740400003)(55016002)(83380400001)(7636003)(6916009)(356005)(6286002)(2906002)(7696005)(6666004)(1076003)(8676002)(86362001)(966005)(53546011)(2616005)(8936002)(47076005)(82310400003)(186003)(16526019)(478600001)(26005)(5660300002)(36860700001)(4326008)(70206006)(336012)(70586007)(54906003)(426003)(36906005)(36756003)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:15:57.7165 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0deb6bb-3db2-4bca-16de-08d913cee526 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: DM6NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4299 Subject: [dpdk-stable] patch 'drivers: fix log level after loading' has been queued to stable release 20.11.2 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.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 05/12/21. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/92805a55dad81d908062f91bab14207b006e2d5b Thanks. Xueming Li --- >From 92805a55dad81d908062f91bab14207b006e2d5b Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Tue, 6 Apr 2021 15:22:03 +0200 Subject: [PATCH] drivers: fix log level after loading Cc: Luca Boccassi [ upstream commit 3be42081bae707c4ad53e62a01a4af82151b8019 ] When compiled as a shared object, and loaded at runtime as a plugin, the drivers should get the log level set earlier at EAL init by the user through --log-level option. The function for applying the log level setting is rte_log_register_type_and_pick_level(). It is called by most drivers via RTE_LOG_REGISTER(). The drivers common/mlx5, bcmfs and e1000 were missing, so the user-specified log level was not applied when those drivers were loaded as plugins. The macro RTE_LOG_REGISTER() is used for those drivers. The unnecessary protection for double registration is removed from e1000. Fixes: 9c99878aa1b1 ("log: introduce logtype register macro") Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver") Signed-off-by: Thomas Monjalon Reviewed-by: David Marchand Acked-by: Ajit Khaparde --- drivers/common/mlx5/mlx5_common.c | 9 +----- drivers/crypto/bcmfs/bcmfs_logs.c | 17 ++--------- drivers/net/e1000/e1000_logs.c | 49 ++++--------------------------- drivers/net/e1000/em_ethdev.c | 6 ---- drivers/net/e1000/igb_ethdev.c | 6 ---- 5 files changed, 8 insertions(+), 79 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c index 044513223c..4a0992ac8d 100644 --- a/drivers/common/mlx5/mlx5_common.c +++ b/drivers/common/mlx5/mlx5_common.c @@ -16,8 +16,6 @@ #include "mlx5_malloc.h" #include "mlx5_common_pci.h" -int mlx5_common_logtype; - uint8_t haswell_broadwell_cpu; /* In case this is an x86_64 intel processor to check if @@ -43,12 +41,7 @@ static inline void mlx5_cpu_id(unsigned int level, } #endif -RTE_INIT_PRIO(mlx5_log_init, LOG) -{ - mlx5_common_logtype = rte_log_register("pmd.common.mlx5"); - if (mlx5_common_logtype >= 0) - rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(mlx5_common_logtype, pmd.common.mlx5, NOTICE) static bool mlx5_common_initialized; diff --git a/drivers/crypto/bcmfs/bcmfs_logs.c b/drivers/crypto/bcmfs/bcmfs_logs.c index 86f4ff3b53..701da9ecf3 100644 --- a/drivers/crypto/bcmfs/bcmfs_logs.c +++ b/drivers/crypto/bcmfs/bcmfs_logs.c @@ -8,9 +8,6 @@ #include "bcmfs_logs.h" -int bcmfs_conf_logtype; -int bcmfs_dp_logtype; - int bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title, const void *buf, unsigned int len) @@ -24,15 +21,5 @@ bcmfs_hexdump_log(uint32_t level, uint32_t logtype, const char *title, return 0; } -RTE_INIT(bcmfs_device_init_log) -{ - /* Configuration and general logs */ - bcmfs_conf_logtype = rte_log_register("pmd.bcmfs_config"); - if (bcmfs_conf_logtype >= 0) - rte_log_set_level(bcmfs_conf_logtype, RTE_LOG_NOTICE); - - /* data-path logs */ - bcmfs_dp_logtype = rte_log_register("pmd.bcmfs_fp"); - if (bcmfs_dp_logtype >= 0) - rte_log_set_level(bcmfs_dp_logtype, RTE_LOG_NOTICE); -} +RTE_LOG_REGISTER(bcmfs_conf_logtype, pmd.bcmfs_config, NOTICE) +RTE_LOG_REGISTER(bcmfs_dp_logtype, pmd.bcmfs_fp, NOTICE) diff --git a/drivers/net/e1000/e1000_logs.c b/drivers/net/e1000/e1000_logs.c index 231f5c03ef..d9b8a4672f 100644 --- a/drivers/net/e1000/e1000_logs.c +++ b/drivers/net/e1000/e1000_logs.c @@ -4,53 +4,14 @@ #include "e1000_logs.h" -/* declared as extern in e1000_logs.h */ -int e1000_logtype_init; -int e1000_logtype_driver; - -#ifdef RTE_LIBRTE_E1000_DEBUG_RX -int e1000_logtype_rx; -#endif -#ifdef RTE_LIBRTE_E1000_DEBUG_TX -int e1000_logtype_tx; -#endif -#ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE -int e1000_logtype_tx_free; -#endif - -/* avoids double registering of logs if EM and IGB drivers are in use */ -static int e1000_log_initialized; - -void -e1000_igb_init_log(void) -{ - if (e1000_log_initialized) - return; - - e1000_logtype_init = rte_log_register("pmd.net.e1000.init"); - if (e1000_logtype_init >= 0) - rte_log_set_level(e1000_logtype_init, RTE_LOG_NOTICE); - e1000_logtype_driver = rte_log_register("pmd.net.e1000.driver"); - if (e1000_logtype_driver >= 0) - rte_log_set_level(e1000_logtype_driver, RTE_LOG_NOTICE); - +RTE_LOG_REGISTER(e1000_logtype_init, pmd.net.e1000.init, NOTICE) +RTE_LOG_REGISTER(e1000_logtype_driver, pmd.net.e1000.driver, NOTICE) #ifdef RTE_LIBRTE_E1000_DEBUG_RX - e1000_logtype_rx = rte_log_register("pmd.net.e1000.rx"); - if (e1000_logtype_rx >= 0) - rte_log_set_level(e1000_logtype_rx, RTE_LOG_DEBUG); +RTE_LOG_REGISTER(e1000_logtype_rx, pmd.net.e1000.rx, DEBUG) #endif - #ifdef RTE_LIBRTE_E1000_DEBUG_TX - e1000_logtype_tx = rte_log_register("pmd.net.e1000.tx"); - if (e1000_logtype_tx >= 0) - rte_log_set_level(e1000_logtype_tx, RTE_LOG_DEBUG); +RTE_LOG_REGISTER(e1000_logtype_tx, pmd.net.e1000.tx, DEBUG) #endif - #ifdef RTE_LIBRTE_E1000_DEBUG_TX_FREE - e1000_logtype_tx_free = rte_log_register("pmd.net.e1000.tx_free"); - if (e1000_logtype_tx_free >= 0) - rte_log_set_level(e1000_logtype_tx_free, RTE_LOG_DEBUG); +RTE_LOG_REGISTER(e1000_logtype_tx_free, pmd.net.e1000.tx_free, DEBUG) #endif - - e1000_log_initialized = 1; -} diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index f116063876..35be2d5aa5 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -1850,9 +1850,3 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev, RTE_PMD_REGISTER_PCI(net_e1000_em, rte_em_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_e1000_em, pci_id_em_map); RTE_PMD_REGISTER_KMOD_DEP(net_e1000_em, "* igb_uio | uio_pci_generic | vfio-pci"); - -/* see e1000_logs.c */ -RTE_INIT(igb_init_log) -{ - e1000_igb_init_log(); -} diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 669af23103..2337d5f767 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -5438,9 +5438,3 @@ RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb, "* igb_uio | uio_pci_generic | vfio-pci RTE_PMD_REGISTER_PCI(net_e1000_igb_vf, rte_igbvf_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_e1000_igb_vf, pci_id_igbvf_map); RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb_vf, "* igb_uio | vfio-pci"); - -/* see e1000_logs.c */ -RTE_INIT(e1000_init_log) -{ - e1000_igb_init_log(); -} -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:29.961099100 +0800 +++ 0131-drivers-fix-log-level-after-loading.patch 2021-05-10 23:59:26.530000000 +0800 @@ -1 +1 @@ -From 3be42081bae707c4ad53e62a01a4af82151b8019 Mon Sep 17 00:00:00 2001 +From 92805a55dad81d908062f91bab14207b006e2d5b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 3be42081bae707c4ad53e62a01a4af82151b8019 ] @@ -24 +26,0 @@ -Cc: stable@dpdk.org @@ -38 +40 @@ -index c26a2cfa30..f92f05bda5 100644 +index 044513223c..4a0992ac8d 100644 @@ -41,2 +43,2 @@ -@@ -14,8 +14,6 @@ - #include "mlx5_common_utils.h" +@@ -16,8 +16,6 @@ + #include "mlx5_malloc.h" @@ -50 +52 @@ -@@ -41,12 +39,7 @@ static inline void mlx5_cpu_id(unsigned int level, +@@ -43,12 +41,7 @@ static inline void mlx5_cpu_id(unsigned int level, @@ -160 +162 @@ -index 3c6f643c19..3e7ccdbf09 100644 +index f116063876..35be2d5aa5 100644 @@ -174 +176 @@ -index 17ee6e91a0..a1a72339ba 100644 +index 669af23103..2337d5f767 100644 @@ -177 +179 @@ -@@ -5421,9 +5421,3 @@ RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb, "* igb_uio | uio_pci_generic | vfio-pci +@@ -5438,9 +5438,3 @@ RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb, "* igb_uio | uio_pci_generic | vfio-pci