Re: [dpdk-dev] [PATCH v9 07/10] app/testpmd: replace POSIX specific code
From: Jie Zhou <hidden>
Date: 2021-05-03 21:41:27
On Mon, May 03, 2021 at 05:37:52PM +0000, Tal Shnaiderman wrote:
quoted
Subject: [PATCH v9 07/10] app/testpmd: replace POSIX specific code External email: Use caution opening links or attachments - Make printf format OS independent - Replace htons with RTE_BE16 - Replace POSIX specific inet_aton with OS independent inet_pton - Replace sleep with rte_delay_us_sleep - Repalce random with rte_rand - #ifndef mman related code for now Signed-off-by: Jie Zhou <redacted> Signed-off-by: Jie Zhou <redacted> --- app/test-pmd/cmdline.c | 3 +-- app/test-pmd/csumonly.c | 2 +- app/test-pmd/icmpecho.c | 4 ++-- app/test-pmd/ieee1588fwd.c | 8 ++++---- app/test-pmd/parameters.c | 10 +++++++--- app/test-pmd/testpmd.c | 21 ++++++++++++++++++++- app/test-pmd/testpmd.h | 2 +- 7 files changed, 36 insertions(+), 14 deletions(-)diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c indexd804ee233..f0636ca9b 100644--- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c<snip>quoted
@@ -8,7 +8,6 @@@@ pmd_test_exit(void) NULL); } } +#endif if (ports != NULL) { no_link_check = 1; RTE_ETH_FOREACH_DEV(pt_id) { @@ -3762,7 +3777,9 @@signal_handler(int signum) f_quit = 1; /* exit with the expected status */ signal(signum, SIG_DFL); +#ifndef RTE_EXEC_ENV_WINDOWS kill(getpid(), signum); +#endifsignal() doesn't need to be inside the ifndef?
Should be. Thanks for spotting that.
quoted
} }@@ -3837,10 +3854,12 @@ main(int argc, char** argv) if (argc > 1) launch_args_parse(argc, argv); +#ifndef RTE_EXEC_ENV_WINDOWS if (do_mlockall && mlockall(MCL_CURRENT | MCL_FUTURE)) { TESTPMD_LOG(NOTICE, "mlockall() failed with error \"%s\"\n", strerror(errno)); } +#endif if (tx_first && interactive) rte_exit(EXIT_FAILURE, "--tx-first cannot be used on "@@ -3961,7 +3980,7 @@ main(int argc, char** argv) } /* Sleep to avoid unnecessary checks */ prev_time = cur_time; - sleep(1); + rte_delay_us_sleep(1000000);Please use US_PER_S
Fix is V10. Thanks.
quoted
} }diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index1d104213b..a4115861b 100644--- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h@@ -763,7 +763,7 @@ inc_tx_burst_stats(struct fwd_stream *fs, uint16_tnb_tx) } /* Prototypes */ -unsigned int parse_item_list(char* str, const char* item_name, +unsigned int parse_item_list(const char *str, const char *item_name, unsigned int max_items, unsigned int *parsed_items, int check_unique_values); void launch_args_parse(int argc, char** argv); -- 2.30.0.vfs.0.2