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 52E9CA0524; Tue, 13 Apr 2021 22:10:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 150CF1612B4; Tue, 13 Apr 2021 22:10:04 +0200 (CEST) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by mails.dpdk.org (Postfix) with ESMTP id D8AEA1612B3 for ; Tue, 13 Apr 2021 22:10:02 +0200 (CEST) Received: by mail-lj1-f169.google.com with SMTP id a1so20829819ljp.2 for ; Tue, 13 Apr 2021 13:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kZgOAj/yCyqySCagMxLKUeria3wmogJJlYGkKsnECfQ=; b=MO8+VzlCavqlAfNpilroQId0kXzeStZrVTt70oG23+QHg8z2wB6l7/B0FA6gPYCfCJ eVSnLcfKabtRnncSNxcEEEFd2Sl+SPHadmYQWY4gcIEBZyo4LxnD7thBFAC54hiL4J1T aSDU46j5N6+VCi0SsdITF/6KL97rOuEVQF1YOThPrVPx1rx9G6eDRZXQq9aGOOf5OEY4 o8HRMolixM3IGa0hySm3CGRa3awkYtcilSrHEs+oOtxXh2ohwTh8S92s31aFMkcWqiG6 Qj0FM/i1aFkoknZlDPwcMNujbmu3lCbAuGujdMutXqlASEsgIeCLJ/ntUsKXk8mbMswC stuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kZgOAj/yCyqySCagMxLKUeria3wmogJJlYGkKsnECfQ=; b=GLAFdTgDcaLxlmAiI/qt7/u1XIjQdovW+3e/h88tN9QlOIZKKwWn3QgIMuVUW0xLqM lxhwsRH2lRqPKUUjp7Uq7cimJ7ghNsq2APCXqXnrMkliCq9/cN3QGzZOf2pKxK1lxjcR I5/TfoE6e7FUN4Wv3IoiDqcEX46TMJ9n3C07UHM09G/IA+fpuY/ohkVK2UkmCV9zeUWC PKXFCQiSRLLMs5pnliZhisMgTc0yaGE3vQkikEEdKXyvsuMzDN4XDmlbBQOXgrGr4lUK Jay6Qiu4/RJttVsVSJYEMxE9n4VST6WwjCPTewPQNrUbbgDYSFzRbdHRDSAQ6uIF9A1h J+UA== X-Gm-Message-State: AOAM53362RSmEFRtSQB/Y2xv1YF7ZVNCdrKOHb32VZaIG3TOBmAfUiqf 2aNhE4liW58KiP1VBWnw5Q4= X-Google-Smtp-Source: ABdhPJxTqvanUiK7UV2u6WDelgtZJOwgE4F//2Ecl6fmtARZO5zaJOdMRhdOM9LbGYvvGYIH+T5m/g== X-Received: by 2002:a2e:8713:: with SMTP id m19mr11443374lji.207.1618344602362; Tue, 13 Apr 2021 13:10:02 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id i22sm3413506lfv.120.2021.04.13.13.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 13:10:01 -0700 (PDT) Date: Tue, 13 Apr 2021 23:10:00 +0300 From: Dmitry Kozlyuk To: Jie Zhou Cc: dev@dpdk.org, xiaoyun.li@intel.com, roretzla@microsoft.com, pallavi.kadam@intel.com, thomas@monjalon.net, bruce.richardson@intel.com, ferruh.yigit@intel.com Message-ID: <20210413231000.2c7f706b@sovereign> In-Reply-To: <1618334363-15147-7-git-send-email-jizh@linux.microsoft.com> References: <1616172695-28505-1-git-send-email-jizh@linux.microsoft.com> <1618334363-15147-1-git-send-email-jizh@linux.microsoft.com> <1618334363-15147-7-git-send-email-jizh@linux.microsoft.com> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 6/6] app/testpmd: enable testpmd on Windows 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" 2021-04-13 10:19 (UTC-0700), Jie Zhou: [...] > diff --git a/app/meson.build b/app/meson.build > index 50a53dbde..b40b04ca7 100644 > --- a/app/meson.build > +++ b/app/meson.build > @@ -1,10 +1,6 @@ > # SPDX-License-Identifier: BSD-3-Clause > # Copyright(c) 2017-2019 Intel Corporation > > -if is_windows > - subdir_done() > -endif > - > apps = [ > 'pdump', > 'proc-info', > @@ -19,7 +15,11 @@ apps = [ > 'test-pipeline', > 'test-pmd', > 'test-regex', > - 'test-sad'] > + 'test-sad' > +] > + > +# for BSD only > +lib_execinfo = cc.find_library('execinfo', required: false) Why is this needed? > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index f44116b08..335ed534d 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -8,12 +8,14 @@ > #include > #include > #include > + > +#ifndef RTE_EXEC_ENV_WINDOWS > #include > +#endif You seem to have missed my comment to v2, that #include line can just be removed, because provide everything necessary. [...] > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index fb7a3a8bd..9945adcf1 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -31,6 +31,12 @@ > > #include "testpmd.h" > > +#ifdef RTE_EXEC_ENV_WINDOWS > +#ifndef IPDEFTTL > +#define IPDEFTTL 64 > +#endif > +#endif > + > /** Parser token indices. */ > enum index { > /* Special tokens. */ IPDEFTTL is used in some other apps and examples. If you follow Tal's advice and base your work on "Do not expose POSIX symbols" series, then please move this to . > diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build > index 7e9c7bdd6..02aea0255 100644 > --- a/app/test-pmd/meson.build > +++ b/app/test-pmd/meson.build > @@ -4,6 +4,10 @@ > # override default name to drop the hyphen > name = 'testpmd' > cflags += '-Wno-deprecated-declarations' > + > +# Enable using internal APIs in testpmd > +cflags += ['-DALLOW_INTERNAL_API'] Apps except unit tests should not use internal API, which is for DPDK components only. See below about memory mapping API. [...] > @@ -688,13 +691,11 @@ alloc_mem(size_t memsz, size_t pgsz, bool huge) > int flags; > > /* allocate anonymous hugepages */ > - flags = MAP_ANONYMOUS | MAP_PRIVATE; > + flags = RTE_MAP_ANONYMOUS | RTE_MAP_PRIVATE; > if (huge) > flags |= HUGE_FLAG | pagesz_flags(pgsz); It is incorrect to mix RTE_ and POSIX flags. I suggest leaving "extmem" part Unix-only for now an not change it. [...] > @@ -3824,8 +3827,8 @@ main(int argc, char** argv) > latencystats_enabled = 0; > #endif > > - /* on FreeBSD, mlockall() is disabled by default */ > -#ifdef RTE_EXEC_ENV_FREEBSD > + /* on FreeBSD and Window, mlockall() is disabled by default */ > +#if (defined(RTE_EXEC_ENV_FREEBSD) || defined (RTE_EXEC_ENV_WINDOWS)) > do_mlockall = 0; > #else > do_mlockall = 1; Redundant braces and a typo: "Window". [...] > @@ -3971,10 +3978,11 @@ main(int argc, char** argv) > return 1; > } > > +#ifndef RTE_EXEC_ENV_WINDOWS > ret = rte_eal_cleanup(); > if (ret != 0) > rte_exit(EXIT_FAILURE, > "EAL cleanup failed: %s\n", strerror(-ret)); > - > +#endif You seem to have missed my comment on v2 that bypassing cleanup is no longer required after b2f24588b5 ("mem: fix cleanup when multi-process is disabled"). > diff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h > index 60a623d4c..095f5f13b 100644 > --- a/lib/librte_eal/windows/include/rte_os.h > +++ b/lib/librte_eal/windows/include/rte_os.h > @@ -24,6 +24,14 @@ extern "C" { > #define PATH_MAX _MAX_PATH > #endif > > +#define strcasecmp _stricmp > +#define open _open > +#define read _read > + > +#ifndef S_ISREG > +#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) > +#endif > + > #ifndef sleep > #define sleep(x) Sleep(1000 * (x)) > #endif This duplicates patch 3/6, doesn't it?