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 C6D7B436C8; Mon, 11 Dec 2023 18:24:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C137A42D9F; Mon, 11 Dec 2023 18:24:50 +0100 (CET) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mails.dpdk.org (Postfix) with ESMTP id 32729415D7 for ; Mon, 11 Dec 2023 18:24:49 +0100 (CET) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-5c68da9d639so2679046a12.3 for ; Mon, 11 Dec 2023 09:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1702315488; x=1702920288; 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=AdSOLFN0uWyvnObgF5SQIQtC2oO59IGu1ZJzjaCxHHo=; b=piS/E1mz8MgncGPlgSkumWgbeP1TtuR4Lo6JkCJ3/gK7/kbH0ujjDn6BVlqIHPPGEv CmW6sEWsqLXJX2IVYZUkvnEirSWKUfwET8UTBj2LobHFOoPwUOiSwyImfTeevdj1EA49 tdWlya06f5SP/LHCwNDzRZLVQ38VTOQ3GrcHFVUm2awH4NETLjHFgeLxiGfXLlLziRkl R9G9XRW270Y6HXc5pCrmKONnrMutdIFEsev2HR1bBnyjvwSce4dV0Q4LapyP9p52y1xx jRMZhA/CmrWlHZUWIQYl7irjtGpr7Bnysa3WYsDdYlJ3e2uHOnZ97etB5N7Q+ohs/QHF F7IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702315488; x=1702920288; 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=AdSOLFN0uWyvnObgF5SQIQtC2oO59IGu1ZJzjaCxHHo=; b=pmpuqB7Q/p5t850fgprZAJAZh+FqAJQaC6+vJXCt+SN67BbGgjVD/UHcW/rmCcVu/b LRrFnq6zi7SdqDWgbRltwt8EoPOGGMAKKdO0rwZUiWBImilLTbOj8jMUOyL9wnBSb3U6 qagC1oiuGq80IP+a67kfz27gmWRvFPs7maZHlxYWTdCvz4TB4CjCoRX4IGzFuPNIaXZj PLo9l+qAOGgqFXmeElLmqN5sBT/6RyrdlygLaZzMxyFU1aXty5Z0Ysxhup4db9ixgbAt wdBNeZANyRU+GgHpzUGUbTF5dDe9fJfFHrAiY5j1YUUqVxiUrjZ+/MJt8xsBuabLu3yD 1p2Q== X-Gm-Message-State: AOJu0YwJIv5k4pWtfwp2d4PhYTuszboOdV5TSFkKvutgW/OtE3eCXReS Q26dxWjZPfibiYrjLJ42txS6N2DHz3SBL/HXXO9bjQ== X-Google-Smtp-Source: AGHT+IE3OSGZTGbNbzMYVEj7VohlMVAxN3MBcqkiaiZ37h4meu6+vLGAP17fkdyF09Xp9hfcLcbJww== X-Received: by 2002:a05:6a20:a111:b0:190:17a6:24b7 with SMTP id q17-20020a056a20a11100b0019017a624b7mr2666450pzk.19.1702315488316; Mon, 11 Dec 2023 09:24:48 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id f16-20020aa782d0000000b006ce6878b274sm6494425pfn.216.2023.12.11.09.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 09:24:47 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Aman Singh , Yuying Zhang Subject: [PATCH 1/3] testpmd: replace EAL logtype with fprintf Date: Mon, 11 Dec 2023 09:23:23 -0800 Message-ID: <20231211172437.61958-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231211172437.61958-1-stephen@networkplumber.org> References: <20231211172437.61958-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Testpmd is misusing EAL logtype for its own errors. Since the code directly calls fprintf in other places, change to use that everywhere. This has the added benefit of not having testpmd output clutter up syslog(). Signed-off-by: Stephen Hemminger --- app/test-pmd/testpmd.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 9e4e99e53b9a..aa350d61e451 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3413,8 +3413,7 @@ stop_port(portid_t pid) ret = eth_dev_stop_mp(pi); if (ret != 0) { - RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for port %u\n", - pi); + fprintf(stderr, "rte_eth_dev_stop failed for port %u\n", pi); /* Allow to retry stopping the port. */ port->port_status = RTE_PORT_STARTED; continue; @@ -3812,23 +3811,20 @@ pmd_test_exit(void) if (hot_plug) { ret = rte_dev_event_monitor_stop(); if (ret) { - RTE_LOG(ERR, EAL, - "fail to stop device event monitor."); + fprintf(stderr, "fail to stop device event monitor."); return; } ret = rte_dev_event_callback_unregister(NULL, dev_event_callback, NULL); if (ret < 0) { - RTE_LOG(ERR, EAL, - "fail to unregister device event callback.\n"); + fprintf(stderr, "fail to unregister device event callback.\n"); return; } ret = rte_dev_hotplug_handle_disable(); if (ret) { - RTE_LOG(ERR, EAL, - "fail to disable hotplug handling.\n"); + fprintf(stderr, "fail to disable hotplug handling.\n"); return; } } @@ -4062,12 +4058,10 @@ dev_event_callback(const char *device_name, enum rte_dev_event_type type, switch (type) { case RTE_DEV_EVENT_REMOVE: - RTE_LOG(DEBUG, EAL, "The device: %s has been removed!\n", - device_name); + fprintf(stderr, "The device: %s has been removed!\n", device_name); ret = rte_eth_dev_get_port_by_name(device_name, &port_id); if (ret) { - RTE_LOG(ERR, EAL, "can not get port by device %s!\n", - device_name); + fprintf(stderr, "Can not get port by device %s!\n", device_name); return; } /* @@ -4081,12 +4075,10 @@ dev_event_callback(const char *device_name, enum rte_dev_event_type type, */ if (rte_eal_alarm_set(100000, rmv_port_callback, (void *)(intptr_t)port_id)) - RTE_LOG(ERR, EAL, - "Could not set up deferred device removal\n"); + fprintf(stderr, "Could not set up deferred device removal\n"); break; case RTE_DEV_EVENT_ADD: - RTE_LOG(ERR, EAL, "The device: %s has been added!\n", - device_name); + fprintf(stderr, "The device: %s has been added!\n", device_name); /* TODO: After finish kernel driver binding, * begin to attach port. */ @@ -4632,23 +4624,20 @@ main(int argc, char** argv) if (hot_plug) { ret = rte_dev_hotplug_handle_enable(); if (ret) { - RTE_LOG(ERR, EAL, - "fail to enable hotplug handling."); + fprintf(stderr, "fail to enable hotplug handling."); return -1; } ret = rte_dev_event_monitor_start(); if (ret) { - RTE_LOG(ERR, EAL, - "fail to start device event monitoring."); + fprintf(stderr, "fail to start device event monitoring."); return -1; } ret = rte_dev_event_callback_register(NULL, dev_event_callback, NULL); if (ret) { - RTE_LOG(ERR, EAL, - "fail to register device event callback\n"); + fprintf(stderr, "fail to register device event callback\n"); return -1; } } -- 2.42.0