From patchwork Wed Dec 13 16:35:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 135154 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E553C436E3; Wed, 13 Dec 2023 17:41:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4F6A742F76; Wed, 13 Dec 2023 17:40:17 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 40B3442F19 for ; Wed, 13 Dec 2023 17:40:12 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1d08a924fcfso66508995ad.2 for ; Wed, 13 Dec 2023 08:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1702485611; x=1703090411; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YyBqO/sb6UeQ4NeBuhZ1nXTlTFjLIN4jayiZCG0GWMs=; b=ZJc5XJwm+0GHKncaIENkbodbzpryHVSPi3cVrMPYs4hjGXWGIs4XCF/X3YmiP+EsVe +/mMrgR47vktA/z0nx2p5aZpAeCJaboneHLZfq+x/eSs24A8MVkBSCe0SYD8jLbKNPUu L82RCmJAeobswFgfVR8LCGIQ0UR5b+nW2DWsml4SKqeJZXiaLB3S26jegcuxgmUf0Ddg B+wzD6nd0KaNsBB85KaIlayowFK9DGSs6FLbvPBL/gUG2PZbZY6cbxHOnqiQg86ymhsm 7taSX0rfRuJ3D+Gkc6zPllpfmYTMApJMIw/BFX73NF71RfTvj7qJMyiznIOfUkLvXej0 Fzxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702485611; x=1703090411; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YyBqO/sb6UeQ4NeBuhZ1nXTlTFjLIN4jayiZCG0GWMs=; b=CjRVXw71rAW+nmxYd0iqBR0v8RZT9K8nwUcGjqthlVqW3rvu/jvus8DDPnqPXKpBPQ 5vY4i2JKzfM9cxLty9aEEyO/f9LIXZqRCrVeTfaJi4jJUvOE3RTVhOVE8kAxpMP4vIDj 1Y5R/YW1D6CcALJqHEF1sB5MDJiW9YYMpRytA4jY2lNyAATXZZG8g75vnoW1kLCfIVc6 KNPGcfuSM12yf8dDXdoUS5WJMBpZmHr6TOeqp6feC9Vld0RyOWh88iIe53L0z6Ez1t+H cGZ9SWAOptSX6VvDm0ClPYqsG0z5//SFEOIRyzvytcw1A4NMFRA4Zirk+BsyJaRXpU8O XShw== X-Gm-Message-State: AOJu0YxrZ4HMIKCD6f+g2nUDGEtd8bdHpaQ2rH9Ho+sVfuGZ5/3h9bWV iXEeaHJrs6yYJm8Rz4f1E/+1QSXLHIQBTpg4UY0= X-Google-Smtp-Source: AGHT+IGYM2EKzmOzn+sLjuhwgSNdZvMVjPD4xz2pR8EpYZqvpCqR5KueSfNrWbYffnSQpMmfGZpvPA== X-Received: by 2002:a17:903:24e:b0:1d0:6ffd:e2e8 with SMTP id j14-20020a170903024e00b001d06ffde2e8mr9548743plh.130.1702485611474; Wed, 13 Dec 2023 08:40:11 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id 4-20020a170902c24400b001d0a6f31519sm10749593plg.188.2023.12.13.08.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 08:40:10 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Andrew Rybchenko Subject: [PATCH v3 19/37] common/sfc_efx: remove use of PMD logtype Date: Wed, 13 Dec 2023 08:35:53 -0800 Message-ID: <20231213163820.894987-20-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213163820.894987-1-stephen@networkplumber.org> References: <20231213014408.612051-1-stephen@networkplumber.org> <20231213163820.894987-1-stephen@networkplumber.org> MIME-Version: 1.0 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 This code was implemented in a slightly different manner than all the other logging code (for no good reason). Make it the same and handle errors in same way as other drivers. Signed-off-by: Stephen Hemminger --- drivers/common/sfc_efx/sfc_efx.c | 11 ++--------- drivers/common/sfc_efx/sfc_efx_log.h | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/common/sfc_efx/sfc_efx.c b/drivers/common/sfc_efx/sfc_efx.c index 2dc5545760b8..5eeffb065b0d 100644 --- a/drivers/common/sfc_efx/sfc_efx.c +++ b/drivers/common/sfc_efx/sfc_efx.c @@ -15,7 +15,7 @@ #include "sfc_efx_log.h" #include "sfc_efx.h" -uint32_t sfc_efx_logtype; +int sfc_efx_logtype; static int sfc_efx_kvarg_dev_class_handler(__rte_unused const char *key, @@ -117,11 +117,4 @@ sfc_efx_family(struct rte_pci_device *pci_dev, return rc; } -RTE_INIT(sfc_efx_register_logtype) -{ - int ret; - - ret = rte_log_register_type_and_pick_level("pmd.common.sfc_efx", - RTE_LOG_NOTICE); - sfc_efx_logtype = (ret < 0) ? RTE_LOGTYPE_PMD : ret; -} +RTE_LOG_REGISTER_DEFAULT(sfc_efx_logtype, NOTICE); diff --git a/drivers/common/sfc_efx/sfc_efx_log.h b/drivers/common/sfc_efx/sfc_efx_log.h index 694455c1b14e..1519ebdc175f 100644 --- a/drivers/common/sfc_efx/sfc_efx_log.h +++ b/drivers/common/sfc_efx/sfc_efx_log.h @@ -11,7 +11,7 @@ #define _SFC_EFX_LOG_H_ /** Generic driver log type */ -extern uint32_t sfc_efx_logtype; +extern int sfc_efx_logtype; /** Log message, add a prefix and a line break */ #define SFC_EFX_LOG(level, ...) \