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 <huangdeng...@huawei.com> 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: sta...@dpdk.org >>> >>> Signed-off-by: Dengdui Huang <huangdeng...@huawei.com> >> >> 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?