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 6302F43DD5; Tue, 9 Apr 2024 04:50:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE047402B9; Tue, 9 Apr 2024 04:50:27 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id B1DAE4027B for ; Tue, 9 Apr 2024 04:50:26 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1e3c7549078so21088425ad.0 for ; Mon, 08 Apr 2024 19:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712631026; x=1713235826; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=CsoG8vKuWdR6OnoxFoKVm8YPcLLKryWFC+MobiPjvyY=; b=1SNNmcYkinLeKn7ShBWI8vbjrV7ue035NFm/22YHnncdHBbCMO7mRY/9u65kQU5e1c c2Abkfqn7w0dVCvrIHoReJn94o3ouZfOZdNaXI/jow86d1bnWWqrgJOKZOkoH6LgDD3E 5hAF7p4623XifbLYHzDGCbmj+bfr/1d8N8JYkQVvfJGgC8Vvt0QR6KFecsetcsr+YcCz jOJ/6RW8qbYmvPDW/7jSAxSdrZ66KgkP6LfOk3EUjDpWnlaJoS7opniPvUXcDw1QH5bc X3DvksWNDJl1IxFvf1ajfiI320nH6f1Sz3dIr+EvPTYprksBg0EltG34Xr6Dxs+Up66F 2Kwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712631026; x=1713235826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CsoG8vKuWdR6OnoxFoKVm8YPcLLKryWFC+MobiPjvyY=; b=XR7ZC/nZ4SrxZAsL0aSf1TZzvRz6R9p7uiYLQB/XZuagspnBiKGm88kacfL2wecFxV 6Xm4euL5b5CY75iPy9h/GeXhE0aUig7ylflb0yVmqvZQxtALShI1R+52dv563Uhqe+lq AYwXx2h498x9XkaqNkgHM1FSbuVM9G2hxEq7s8doAUt8uuruuJlgm3CHYwzrqaDqNaAp hHd6vMwQQZpcx7mj1lVnPPwiuWzcF/vmHCBJG4WyXIpXfY3OxyFQGpaF24JL84AknknE QU22T9ogh/eYsz6ibSitSa37BZVxOxKnmnH0OlyRvmGf/r0ERk+qX+HvUQNgwC3vAsuk ypkQ== X-Forwarded-Encrypted: i=1; AJvYcCWo5nuaFxkfWohm2TDl0wTUM3mSCwV1oQlmWeL6qNjliJ8Q3Z/RmPw04i5kawAhJWv/PrjNRscULbmlUl0= X-Gm-Message-State: AOJu0YwCCWmlLsJGYEHXtysfHGfQ9l8IVPmgMn1tcjCVg47g6rsR/Jyp Rl4V7Ieb6wutWdtQAfbdDOyywYVqVD3GRlVxP3mfVavaqszPrNpSWIZGGJ+91mk= X-Google-Smtp-Source: AGHT+IHtq/P0Cw8pE+/ArTYzFZQZPJ0ZMYRy+SQ72pd2I/9JAopGdE/zkv7dprdCE0T+i7PKeiP+Xg== X-Received: by 2002:a17:903:22d1:b0:1e4:52c2:d05c with SMTP id y17-20020a17090322d100b001e452c2d05cmr2205817plg.29.1712631025677; Mon, 08 Apr 2024 19:50:25 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id kw8-20020a170902f90800b001e21ddacb20sm7780767plb.297.2024.04.08.19.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 19:50:25 -0700 (PDT) Date: Mon, 8 Apr 2024 19:50:23 -0700 From: Stephen Hemminger To: huangdengdui Cc: Ferruh Yigit , , , , David Marchand , Thomas Monjalon Subject: Re: [PATCH] app/testpmd: handle IEEE1588 init fail Message-ID: <20240408195023.5be4fed5@hermes.local> In-Reply-To: <74224bdc-e865-4d5a-94fc-fdd6adb74558@huawei.com> References: <20240330074409.273916-1-huangdengdui@huawei.com> <20240405094427.32d19496@hermes.local> <74224bdc-e865-4d5a-94fc-fdd6adb74558@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Tue, 9 Apr 2024 10:06:01 +0800 huangdengdui wrote: > On 2024/4/8 16:45, Ferruh Yigit wrote: > > On 4/8/2024 6:52 AM, huangdengdui wrote: > >> > >> > >> On 2024/4/6 0:44, Stephen Hemminger wrote: > >>> On Sat, 30 Mar 2024 15:44:09 +0800 > >>> Dengdui Huang wrote: > >>> > >>>> When the port's timestamping function failed to initialize > >>>> (for example, the device does not support PTP), the packets > >>>> received by the hardware do not contain the timestamp. > >>>> In this case, IEEE1588 packet forwarding should not start. > >>>> This patch fix it. > >>>> > >>>> Plus, adding a failure message when failed to disable PTP. > >>>> > >>>> Fixes: a78040c990cb ("app/testpmd: update forward engine beginning") > >>>> Cc: stable@dpdk.org > >>>> > >>>> Signed-off-by: Dengdui Huang > >>> > >>> Noticed that ieee1588 part is printing errors to stdout, > >>> but other parts of test-pmd are using stderr or TEST_PMD_LOG. > >>> > >>> It would be good to decide on one good way to handle this > >>> across all of testpmd. > >> > >> Yeah, it's a bit of a mess. Is it better to use TEST_PMD_LOG? > >> But this is a test app, and modifying it seems unnecessary. > >> What should we do next? > >> > > > > 'TESTPMD_LOG' exists and used in a few places, but still most of the > > logging done with 'printf/fprintf'. > > > > Agree to have an agreement what to use, document it, and stick to it. > > > > > > For some cases, like 'usage()' output (testpmd supported parameters), or > > cmdline prompt we always want to have output, so 'printf' suits well. > > > > Not sure where 'TESTPMD_LOG' is needed and what is the benefit. I don't > > remember many cases that I want to refine testpmd app level output. > > Maybe a case can be packet verbose output, but it also has its specific > > command to control it. > > > > So should we continue to 'printf/fprintf', is there any disadvantage to > > do so? > OK, 'printf/fprintf' is really necessary. Am I to understand it as follows? > > 'TESTPMD_LOG' is more suitable for printing app runtime context logs, > such as initialization logs and uninstallation logs. > > 'printf' is suitable for normal interaction with the user, such as > show port info > > When should we print to stderr? Any Unix convention is that any error message should go to stderr. For test-pmd, using TESTPMD_LOG has benefits and problems. The benefit is following a convention across all the startup and error codes. And with the color log patches, errors are highlighted. But the current way rte_log works, the testpmd stuff ends up going to syslog/journal which is not necessary and overly chatty.