From patchwork Tue Apr 6 13:22:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 90671 X-Patchwork-Delegate: david.marchand@redhat.com 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 38E8DA0546; Tue, 6 Apr 2021 15:22:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8579140F6A; Tue, 6 Apr 2021 15:22:10 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 1EDD8406A2 for ; Tue, 6 Apr 2021 15:22:09 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id ABFFE5C00AF; Tue, 6 Apr 2021 09:22:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 06 Apr 2021 09:22:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=MJVgljBApXwK/ MhTUayjGp+zHf4Z7cO/yb3mZ7b8p/k=; b=luwfq4xEY2iOHkxjgvUbaTuCl2dn8 eNfnjUXnUi1f+H6jPZFN6JFYEiuF3w5314UUkwMEVvC4Bn9xdPUroNU51NXr8zpT q9HpmO/f6VFTi+aOlERikdSkV1STVkwyJHaMXZP0YAzSfo8Vdqta86cYLcZHMmhf kjJPKkJroO/Jr+JaxAQgkxHHOwcMSfYnEAC/b6NApgfQhug45Tz52Mt2obJPcojM C9mSEuvMWJaBeaqg0eBDGn0UaGJ4QfB6u0+UKggP40spL6jSAgPIskcwJdBbKW4N PlnSZfiXaLidLZgMYKCrfMbG5qWCilSd1ZmppTjhiKVHzZAaqB620Dmhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=MJVgljBApXwK/MhTUayjGp+zHf4Z7cO/yb3mZ7b8p/k=; b=UDfPL6Pi qQJM5Kn9iR29cCH1oAeQ+Yg83HLif5WoYCOaeRR3gt14yjXQCUVw8pFW4FJkWyGP tFpkNpkpjD0y5HhC5nbDeBp4IfzRYWVZt6cZR752zwMMLi6IMVAAub/qx/LVNusi i4IvusDUDBtZ+kmviiYIY2aGf07iM06QScBUg0pVLSfluWi2OT60gHkegHzlhvbL IyH5jeEQpVY7QqneABGM4md7CzAoCO5IP6RYQLTO7sSzoEb2Z8Yf7EeF6ET1mQ5n hD+JIt5MalnFkEWLjwf/ybA7tBOWMSF1xI1/vkSY//Q7NLZhfwUEeUbD5xkP4en0 hXHF7oImp+r9Iw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejhedguddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpedvhefgiedvjeegtdevhe efhfetleefgfeivefgffevfeejgedtgfeutdehtdegveenucfkphepjeejrddufeegrddv tdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 3F91D24005C; Tue, 6 Apr 2021 09:22:08 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: david.marchand@redhat.com Date: Tue, 6 Apr 2021 15:22:02 +0200 Message-Id: <20210406132204.1818522-2-thomas@monjalon.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210406132204.1818522-1-thomas@monjalon.net> References: <20210310140107.2730088-1-thomas@monjalon.net> <20210406132204.1818522-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 1/3] log: choose EAL log type on registration failure 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" In the unlikely case where something goes wrong while registering a log type, the fallback is to use the EAL log type. Signed-off-by: Thomas Monjalon Reviewed-by: David Marchand Reviewed-by: Andrew Rybchenko --- lib/librte_eal/include/rte_log.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h index 173004fd71..21a7d16340 100644 --- a/lib/librte_eal/include/rte_log.h +++ b/lib/librte_eal/include/rte_log.h @@ -380,6 +380,8 @@ RTE_INIT(__##type) \ { \ type = rte_log_register_type_and_pick_level(RTE_STR(name), \ RTE_LOG_##level); \ + if (type < 0) \ + type = RTE_LOGTYPE_EAL; \ } #ifdef __cplusplus