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 0EA8EA0562; Mon, 3 May 2021 23:41:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 896B740150; Mon, 3 May 2021 23:41:26 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 416B74014E for ; Mon, 3 May 2021 23:41:24 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1061) id 79F9120B7188; Mon, 3 May 2021 14:41:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 79F9120B7188 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1620078083; bh=gzZj0J2nJoXgUmqWsuHMdftC2Z8gA9qtYBKZP5oxEsA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LFf/5+HUJw0Wp928ZRRhbfcfHcRl/NVXQaak+jECZAu13kAz9YvvKLPSyQUh10AtR KBA4LH0mVdNehVJOKQBMN8s05LuH1cMkus7aAo4oX+gK/8uj0apQ44BUFErr4gBrWV caNRYOtvcpls2bJXbN/kiC0NLTC3A6pJbP6R5T5Q= Date: Mon, 3 May 2021 14:41:23 -0700 From: Jie Zhou To: Tal Shnaiderman Cc: "dev@dpdk.org" , "dmitry.kozliuk@gmail.com" , "xiaoyun.li@intel.com" , "roretzla@microsoft.com" , "pallavi.kadam@intel.com" , NBU-Contact-Thomas Monjalon , "bruce.richardson@intel.com" , "ferruh.yigit@intel.com" , "konstantin.ananyev@intel.com" Message-ID: <20210503214123.GA9146@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1619553721-5220-1-git-send-email-jizh@linux.microsoft.com> <1619805162-10684-1-git-send-email-jizh@linux.microsoft.com> <1619805162-10684-8-git-send-email-jizh@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH v9 07/10] app/testpmd: replace POSIX specific code 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" On Mon, May 03, 2021 at 05:37:52PM +0000, Tal Shnaiderman wrote: > > 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 > > Signed-off-by: Jie Zhou > > --- > > 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 index > > d804ee233..f0636ca9b 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > > > > @@ -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); > > +#endif > > signal() doesn't need to be inside the ifndef? Should be. Thanks for spotting that. > > > } > > } > > > > @@ -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. > > > } > > } > > > > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index > > 1d104213b..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_t > > nb_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