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 E7666A0A02; Wed, 5 May 2021 18:09:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B41441144; Wed, 5 May 2021 18:09:23 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 9426040040; Wed, 5 May 2021 18:09:21 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1061) id BF05A20B7178; Wed, 5 May 2021 09:09:20 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BF05A20B7178 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1620230960; bh=lCiSL1EqhE7vYbDjb/muqxWR/619aKi9ICD5OKNZTwI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IiJwzpW0RINQ0NnX4qJA5CD01xvpSAX0wGqKyLaOplsgtgxkYCO4z1tf/NqB60Gxi 6wZcni/n3VcDVv63YEN1rgHf++IL4y6rTerXBn3xvYDStdUGx+D4lzzPBDsjqHJrnq DrXSs3tn/SouKLA3LOteKgYcgRj5YldIBjnazlBk= Date: Wed, 5 May 2021 09:09:20 -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" , "stable@dpdk.org" Message-ID: <20210505160920.GB22459@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1619805162-10684-1-git-send-email-jizh@linux.microsoft.com> <1620088449-14770-1-git-send-email-jizh@linux.microsoft.com> <1620088449-14770-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 v10 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 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 > > 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(-) > > > > > > > @@ 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? err: is not reachable from the MP_ALLOC_NATIVE. > > return rte_mp; > > } > >