On Wed, May 05, 2021 at 09:09:20AM -0700, Jie Zhou wrote: > On Wed, May 05, 2021 at 08:34:34AM +0000, Tal Shnaiderman wrote: > > > Subject: [PATCH v10 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 > > > > Do you think we can reduce the number of ifndefs by using the functions > > rte_mem_map, rte_mem_lock? > > I used rte_mem_xxx APIs in V3. DmitryK pointed out that Apps except unit > tests should not use these internal APIs, and also rte_mem_map does not > support hugepage with different sized. Given that, decided to work on the > mman related part in a future separate patch. > > > > > > > > > Signed-off-by: Jie Zhou <j...@microsoft.com> > > > Signed-off-by: Jie Zhou <j...@linux.microsoft.com> > > > --- > > > 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(-) > > > > > > > <snip> > > > > > @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf, > > > } > > > } > > > > > > +#ifndef RTE_EXEC_ENV_WINDOWS > > > err: > > > if (rte_mp == NULL) { > > > rte_exit(EXIT_FAILURE, > > > @@ -1065,6 +1077,7 @@ mbuf_pool_create(uint16_t mbuf_seg_size, > > > unsigned nb_mbuf, > > > } else if (verbose_level > 0) { > > > rte_mempool_dump(stdout, rte_mp); > > > } > > > +#endif > > > > Why do we need the err flow ifndef'ed? Isn't it needed in the > > MP_ALLOC_NATIVE case? >
You are right. Will fix in V11. To avoid the unused err: lable warning, just need to ifndef the err: lable instead of the whole err flow. My mistake. > > > > return rte_mp; > > > } > > >