From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 546D0A2EDB for ; Tue, 1 Oct 2019 05:59:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8094F5B3A; Tue, 1 Oct 2019 05:59:46 +0200 (CEST) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id 0819B2C2B for ; Tue, 1 Oct 2019 05:59:45 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id c25so44181430iot.12 for ; Mon, 30 Sep 2019 20:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=No7rTtoyIrYtA4BfdeaLe2cC2vBRsJXGzq+4rF5hi1Y=; b=t3qxWZtzIlPRbIs9V3KW17KdFVviTXyystCy5t2wsB0QsrRf4Nx+v1EdgGxutqnds9 i5ufd5jKkdP/BZnymd7SM56qon87lJadLaDIE16SaHqYTRnRjcxsNVsiF29/ZslvMIrd 19uvD+zo2GahJo8IdPCg9RWF8pmK14j517nyZO6z6E/8FErpwTm5piEY8LIcaPMFCTFB 1X18Czt77g324m0B0aLaxS+6NIbQA1vDnM3GViRTSWYImf8mxt14eNFXH1z3AdGdjoo9 JgOqpO8c0x+V/8SIsSmxmW1EDW9ul35TDB67k5idZYIciju3/SF2NW2Tr/ZSIr3W8Yjj WB1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=No7rTtoyIrYtA4BfdeaLe2cC2vBRsJXGzq+4rF5hi1Y=; b=GgrSpNNKeMq74t/WGL3Kw0t65v7Lm8QAIybLdw5Ec2gNh3Uw4j8T25pgIUhGTUtb9j J6eZQLSESaSz9jwrv58dls37J1J+wytWKpy/0ccLJ3Yxlo0YwFLdnCTo0cBDW1gnTeBt rZQVX8ZErWZg9x7/F46U3whAye2IhFzsyaq60AMTcj6ChCp3geJPKmZBUan2s9G2NeAz F7ojLrrpzqI6vDaLXFqxhmuE2CihpN9lRNE/N4nLTlAKvFAhiLHQCZUa0YROYPZQa3J8 IFViOyj41nf3JX474cGtOnvukq/E2sa3iqZGcpcWaJiJfmyxmT7UNbYBFKahF9gvaB9z yS/Q== X-Gm-Message-State: APjAAAU6O5bXTI0u4EYg6alTZJU+Jytk+wn0SdbLmcH4CTucfs7pLX6s 03FJHCSS7xi3BrtfoaYdooaDgVlo/R8DNlDBFyk= X-Google-Smtp-Source: APXvYqx2iiYgnUtIk2cOi3cFaw0MDA6fbh/J41OiSwi5qlcNWGfSgigYVe79tATbOtKRktlqE/bDesZn4t5Pf2xSE/k= X-Received: by 2002:a05:6638:3d4:: with SMTP id r20mr23126349jaq.104.1569902384118; Mon, 30 Sep 2019 20:59:44 -0700 (PDT) MIME-Version: 1.0 References: <20190930170934.9680-1-pallavi.kadam@intel.com> In-Reply-To: <20190930170934.9680-1-pallavi.kadam@intel.com> From: Jerin Jacob Date: Tue, 1 Oct 2019 09:29:33 +0530 Message-ID: To: Pallavi Kadam Cc: dpdk-dev , Thomas Monjalon , Harini.Ramakrishnan@microsoft.com, "Wiles, Keith" , "Richardson, Bruce" , "Menon, Ranjit" , "Kolar, Antara Ganesh" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] eal: move rte_cpu definitions to os specific files X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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, Sep 30, 2019 at 11:04 PM Pallavi Kadam wrote: > > Moving RTE_CPU* definitions from the common code to the > Linux, FreeBSD rte_os.h file to avoid #ifdef clutter. > > Signed-off-by: Pallavi Kadam > Signed-off-by: Antara Ganesh Kolar > Reviewed-by: Ranjit Menon Nit: [master][dpdk.org] $ ./devtools/check-git-log.sh Wrong headline format: eal: move rte_cpu definitions to os specific files probably, we could fix the above warning with following or similar headline eal: move OS-specific CPU operations from common code With check-git-log.sh fix: Reviewed-by: Jerin Jacob > --- > lib/librte_eal/common/include/rte_lcore.h | 44 --------------------- > lib/librte_eal/freebsd/eal/include/rte_os.h | 27 +++++++++++++ > lib/librte_eal/linux/eal/include/rte_os.h | 19 +++++++++ > 3 files changed, 46 insertions(+), 44 deletions(-) > > diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h > index c86f72eb1..63ad4af13 100644 > --- a/lib/librte_eal/common/include/rte_lcore.h > +++ b/lib/librte_eal/common/include/rte_lcore.h > @@ -22,50 +22,6 @@ extern "C" { > > #define LCORE_ID_ANY UINT32_MAX /**< Any lcore. */ > > -#if defined(__linux__) > -typedef cpu_set_t rte_cpuset_t; > -#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) > -#define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2) > -#define RTE_CPU_FILL(set) do \ > -{ \ > - unsigned int i; \ > - CPU_ZERO(set); \ > - for (i = 0; i < CPU_SETSIZE; i++) \ > - CPU_SET(i, set); \ > -} while (0) > -#define RTE_CPU_NOT(dst, src) do \ > -{ \ > - cpu_set_t tmp; \ > - RTE_CPU_FILL(&tmp); \ > - CPU_XOR(dst, &tmp, src); \ > -} while (0) > -#elif defined(__FreeBSD__) > -#include > -typedef cpuset_t rte_cpuset_t; > -#define RTE_CPU_AND(dst, src1, src2) do \ > -{ \ > - cpuset_t tmp; \ > - CPU_COPY(src1, &tmp); \ > - CPU_AND(&tmp, src2); \ > - CPU_COPY(&tmp, dst); \ > -} while (0) > -#define RTE_CPU_OR(dst, src1, src2) do \ > -{ \ > - cpuset_t tmp; \ > - CPU_COPY(src1, &tmp); \ > - CPU_OR(&tmp, src2); \ > - CPU_COPY(&tmp, dst); \ > -} while (0) > -#define RTE_CPU_FILL(set) CPU_FILL(set) > -#define RTE_CPU_NOT(dst, src) do \ > -{ \ > - cpuset_t tmp; \ > - CPU_FILL(&tmp); \ > - CPU_NAND(&tmp, src); \ > - CPU_COPY(&tmp, dst); \ > -} while (0) > -#endif > - > /** > * Structure storing internal configuration (per-lcore) > */ > diff --git a/lib/librte_eal/freebsd/eal/include/rte_os.h b/lib/librte_eal/freebsd/eal/include/rte_os.h > index 49cd4d4d9..b414f6989 100644 > --- a/lib/librte_eal/freebsd/eal/include/rte_os.h > +++ b/lib/librte_eal/freebsd/eal/include/rte_os.h > @@ -11,4 +11,31 @@ > * freebsd OS. Functions will be added in future releases. > */ > > +#include > +#include > + > +typedef cpuset_t rte_cpuset_t; > +#define RTE_CPU_AND(dst, src1, src2) do \ > +{ \ > + cpuset_t tmp; \ > + CPU_COPY(src1, &tmp); \ > + CPU_AND(&tmp, src2); \ > + CPU_COPY(&tmp, dst); \ > +} while (0) > +#define RTE_CPU_OR(dst, src1, src2) do \ > +{ \ > + cpuset_t tmp; \ > + CPU_COPY(src1, &tmp); \ > + CPU_OR(&tmp, src2); \ > + CPU_COPY(&tmp, dst); \ > +} while (0) > +#define RTE_CPU_FILL(set) CPU_FILL(set) > +#define RTE_CPU_NOT(dst, src) do \ > +{ \ > + cpuset_t tmp; \ > + CPU_FILL(&tmp); \ > + CPU_NAND(&tmp, src); \ > + CPU_COPY(&tmp, dst); \ > +} while (0) > + > #endif /* _RTE_OS_H_ */ > diff --git a/lib/librte_eal/linux/eal/include/rte_os.h b/lib/librte_eal/linux/eal/include/rte_os.h > index bc6ad14d2..dd487a830 100644 > --- a/lib/librte_eal/linux/eal/include/rte_os.h > +++ b/lib/librte_eal/linux/eal/include/rte_os.h > @@ -11,4 +11,23 @@ > * linux OS. Functions will be added in future releases. > */ > > +#include > + > +typedef cpu_set_t rte_cpuset_t; > +#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) > +#define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2) > +#define RTE_CPU_FILL(set) do \ > +{ \ > + unsigned int i; \ > + CPU_ZERO(set); \ > + for (i = 0; i < CPU_SETSIZE; i++) \ > + CPU_SET(i, set); \ > +} while (0) > +#define RTE_CPU_NOT(dst, src) do \ > +{ \ > + cpu_set_t tmp; \ > + RTE_CPU_FILL(&tmp); \ > + CPU_XOR(dst, &tmp, src); \ > +} while (0) > + > #endif /* _RTE_OS_H_ */ > -- > 2.18.0.windows.1 >