From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: Pallavi Kadam <pallavi.kadam@intel.com>
Cc: dev@dpdk.org, thomas@monjalon.net,
Harini.Ramakrishnan@microsoft.com, keith.wiles@intel.com,
bruce.richardson@intel.com, david.marchand@redhat.com,
jerinjacobk@gmail.com, ranjit.menon@intel.com,
antara.ganesh.kolar@intel.com
Subject: Re: [dpdk-dev] [PATCH v7 3/9] eal: add additional function overrides in windows header files
Date: Wed, 5 Feb 2020 22:54:52 +0300 [thread overview]
Message-ID: <20200205225452.5fbc970b@Sovereign> (raw)
In-Reply-To: <20200201000406.11060-4-pallavi.kadam@intel.com>
> +#include <Windows.h>
Nit: better use lowercase to support cross-compilation from OS with
case-sensitive FS. It's not directly relevant for this patch.
> +static inline int
> +eal_get_thread_affinity_mask(pthread_t threadID, unsigned long *cpuset)
> +{
> + /* Workaround for the lack of a GetThreadAffinityMask()
> + *API in Windows
> + */
> + /* obtain previous mask by setting dummy mask */
> + DWORD dwPrevAffinityMask =
> + SetThreadAffinityMask((HANDLE) threadID, 0x1);
> + /* set it back! */
> + SetThreadAffinityMask((HANDLE) threadID, dwPrevAffinityMask);
> + *cpuset = dwPrevAffinityMask;
> + return 0;
> +}
Shouldn't EAL implementation follow DPDK code style? If so, "threadID" and
"dwPrevAffinityMask" violate naming convention, also there's a bogus TAB.
> +static inline int
> +eal_create_thread(void *threadID, void *threadfunc, void *args)
> +{
> + HANDLE hThread;
> + hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
> + args, 0, (LPDWORD)threadID);
> + if (hThread) {
> + SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
> + SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL);
> + }
> + return ((hThread != NULL) ? 0 : E_FAIL);
> +}
Duplicates eal_thread_create() from "eal_thread.c", probably
eal_thread_create() should call pthread_create() as in Linux EAL.
> +static inline int
> +pthread_join(pthread_t thread __attribute__((__unused__)),
> + void **value_ptr __attribute__((__unused__)))
> +{
> + return 0;
> +}
If not implemented, should return EINVAL (ENOSUP is not listed as a valid
error code for this function). Even better, implement trivially with
WaitForSingleObject().
> +static inline int
> +asprintf(char **buffer, const char *format, ...)
> +{
> + int size, ret;
> + va_list arg;
> +
> + va_start(arg, format);
> + size = vsnprintf(NULL, 0, format, arg) + 1;
> + va_end(arg);
> +
> + *buffer = malloc(size);
Missing a check for NULL from malloc().
> +
> + va_start(arg, format);
> + ret = vsnprintf(*buffer, size, format, arg);
> + va_end(arg);
> + if (ret != size - 1) {
> + free(*buffer);
> + return -1;
> + }
> + return ret;
> +}
> +static inline int
> +count_cpu(rte_cpuset_t *s)
> +{
> + unsigned int _i;
Why the underscore? It's not a macro, identifiers are function-local.
> +/*
> + * List definitions.
> + */
> +#define LIST_HEAD(name, type) \
> +struct name { \
> + struct type *lh_first; /* first element */ \
> +}
> +
> #define QMD_TRACE_ELEM(elem)
> #define QMD_TRACE_HEAD(head)
> #define TRACEBUF
Probably ouf of scope for this patchset, but DPDK should probably include
the entire FreeBSD <sys/queue.h> so that we won't need to add it
piece-by-piece like so. It's BSD-3-Clause anyway.
--
Dmitry Kozlyuk
next prev parent reply other threads:[~2020-02-05 19:54 UTC|newest]
Thread overview: 149+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-06 22:09 [dpdk-dev] [PATCH 0/9] Windows patchset with additional EAL functionalities Pallavi Kadam
2019-09-06 22:09 ` [dpdk-dev] [PATCH 1/9] eal: eal stub to support parsing feature on windows Pallavi Kadam
2019-09-06 22:09 ` [dpdk-dev] [PATCH 2/9] eal: syslog implementation for windows Pallavi Kadam
2019-09-06 22:09 ` [dpdk-dev] [PATCH 3/9] eal: add windows compatible header files Pallavi Kadam
2019-09-06 22:09 ` [dpdk-dev] [PATCH 4/9] eal: dirent.h implementation for windows Pallavi Kadam
2019-09-06 22:09 ` [dpdk-dev] [PATCH 5/9] eal: add additional function overrides in windows header files Pallavi Kadam
2019-09-06 22:09 ` [dpdk-dev] [PATCH 6/9] eal: getopt implementation for windows Pallavi Kadam
2019-09-06 22:09 ` [dpdk-dev] [PATCH 7/9] eal: add function to detect process type Pallavi Kadam
2019-09-06 22:09 ` [dpdk-dev] [PATCH 8/9] build: add additional common files support Pallavi Kadam
2019-09-06 22:09 ` [dpdk-dev] [PATCH 9/9] eal: add minimum viable code to support parsing Pallavi Kadam
2019-09-09 19:53 ` [dpdk-dev] [PATCH 0/9] Windows patchset with additional EAL functionalities Pallavi Kadam
2019-09-09 19:53 ` [dpdk-dev] [PATCH 1/9] eal: eal stub to support parsing feature on windows Pallavi Kadam
2019-09-09 19:53 ` [dpdk-dev] [PATCH 2/9] eal: syslog implementation for windows Pallavi Kadam
2019-09-10 9:17 ` Stephen Hemminger
2019-09-25 23:38 ` Pallavi Kadam
2019-09-09 19:53 ` [dpdk-dev] [PATCH 3/9] eal: add windows compatible header files Pallavi Kadam
2019-09-10 9:19 ` Stephen Hemminger
2019-09-12 17:11 ` Pallavi Kadam
2019-09-12 21:36 ` Stephen Hemminger
2019-09-09 19:53 ` [dpdk-dev] [PATCH 4/9] eal: dirent.h implementation for windows Pallavi Kadam
2019-09-09 19:54 ` [dpdk-dev] [PATCH 5/9] eal: add additional function overrides in windows header files Pallavi Kadam
2019-09-09 19:54 ` [dpdk-dev] [PATCH 6/9] eal: getopt implementation for windows Pallavi Kadam
2019-09-12 21:40 ` Stephen Hemminger
2019-09-13 9:46 ` Bruce Richardson
2019-09-13 17:23 ` Pallavi Kadam
2019-09-09 19:54 ` [dpdk-dev] [PATCH 7/9] eal: add function to detect process type Pallavi Kadam
2019-09-09 19:54 ` [dpdk-dev] [PATCH 8/9] build: add additional common files support Pallavi Kadam
2019-09-09 19:54 ` [dpdk-dev] [PATCH 9/9] eal: add minimum viable code to support parsing Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 0/9] Windows patchset with additional EAL functionalities Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 1/9] eal: eal stub to support parsing feature on windows Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 2/9] eal: syslog implementation for windows Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 3/9] eal: add windows compatible header files Pallavi Kadam
2019-09-27 7:58 ` Jerin Jacob
2019-09-30 17:49 ` Pallavi Kadam
2019-10-01 5:56 ` Jerin Jacob
2019-10-03 0:40 ` Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 4/9] eal: dirent.h implementation for windows Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 5/9] eal: add additional function overrides in windows header files Pallavi Kadam
2019-09-27 8:06 ` Jerin Jacob
2019-09-30 23:11 ` Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 6/9] eal: getopt implementation for windows Pallavi Kadam
2019-09-26 21:27 ` Stephen Hemminger
2019-09-26 23:26 ` Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 7/9] eal: add function to detect process type Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 8/9] build: add additional common files support Pallavi Kadam
2019-09-26 20:29 ` [dpdk-dev] [PATCH v2 9/9] eal: add minimum viable code to support parsing Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 0/9] Windows patchset with additional EAL functionalities Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 1/9] eal: eal stub to support parsing feature on windows Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 2/9] eal: syslog implementation for windows Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 3/9] eal: add windows compatible header files Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 4/9] eal: dirent.h implementation for windows Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 5/9] eal: add additional function overrides in windows header files Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 6/9] eal: getopt implementation for windows Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 7/9] eal: add function to detect process type Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 8/9] build: add additional common files support Pallavi Kadam
2019-10-22 20:02 ` [dpdk-dev] [PATCH v3 9/9] eal: add minimum viable code to support parsing Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 0/9] Windows patchset with additional EAL functionalities Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 1/9] license: add license exception for windows Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 2/9] eal: dirent.h implementation " Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 3/9] eal: add windows compatible header files Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 4/9] eal: add additional function overrides in windows " Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 5/9] eal: getopt implementation for windows Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 6/9] eal: add function to detect process type Pallavi Kadam
2020-01-09 6:35 ` Stephen Hemminger
2020-01-09 22:18 ` Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 7/9] eal: remove syslog support for windows Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 8/9] build: add additional common files support Pallavi Kadam
2020-01-09 3:13 ` [dpdk-dev] [PATCH v4 9/9] eal: add minimum viable code to support parsing Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 0/9] Windows patchset with additional EAL functionalities Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 1/9] license: add license exception for windows Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 2/9] eal: dirent.h implementation " Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 3/9] eal: add windows compatible header files Pallavi Kadam
2020-01-27 22:41 ` Thomas Monjalon
2020-01-28 23:34 ` Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 4/9] eal: add additional function overrides in windows " Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 5/9] eal: getopt implementation for windows Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 6/9] eal: add function to detect process type Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 7/9] eal: remove syslog support for windows Pallavi Kadam
2020-01-27 22:52 ` Thomas Monjalon
2020-01-28 23:45 ` Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 8/9] build: add additional common files support Pallavi Kadam
2020-01-27 22:55 ` Thomas Monjalon
2020-01-28 23:46 ` Pallavi Kadam
2020-01-13 21:55 ` [dpdk-dev] [PATCH v5 9/9] eal: add minimum viable code to support parsing Pallavi Kadam
2020-01-31 0:02 ` [dpdk-dev] [PATCH v6 00/10] Windows patchset with additional EAL functionalities Pallavi Kadam
2020-01-31 0:02 ` [dpdk-dev] [PATCH v6 01/10] license: add license exception for windows Pallavi Kadam
2020-01-31 0:02 ` [dpdk-dev] [PATCH v6 02/10] eal: dirent.h implementation " Pallavi Kadam
2020-01-31 0:03 ` [dpdk-dev] [PATCH v6 03/10] eal: include filesystem " Pallavi Kadam
2020-01-31 6:04 ` Dmitry Kozliuk
2020-01-31 22:03 ` Pallavi Kadam
2020-01-31 0:03 ` [dpdk-dev] [PATCH v6 04/10] eal: add additional function overrides in windows header files Pallavi Kadam
2020-01-31 0:03 ` [dpdk-dev] [PATCH v6 05/10] eal: getopt implementation for windows Pallavi Kadam
2020-01-31 0:03 ` [dpdk-dev] [PATCH v6 06/10] eal: add function to detect process type Pallavi Kadam
2020-01-31 0:03 ` [dpdk-dev] [PATCH v6 07/10] eal: include SSE4 support for windows Pallavi Kadam
2020-01-31 0:03 ` [dpdk-dev] [PATCH v6 08/10] eal: remove syslog and dlfcn " Pallavi Kadam
2020-01-31 0:03 ` [dpdk-dev] [PATCH v6 09/10] build: add additional common files support Pallavi Kadam
2020-01-31 0:03 ` [dpdk-dev] [PATCH v6 10/10] eal: add minimum viable code to support parsing Pallavi Kadam
2020-02-01 0:03 ` [dpdk-dev] [PATCH v7 0/9] Windows patchset with additional EAL functionalities Pallavi Kadam
2020-02-01 0:03 ` [dpdk-dev] [PATCH v7 1/9] license: add license exception for windows Pallavi Kadam
2020-02-01 0:03 ` [dpdk-dev] [PATCH v7 2/9] eal: dirent.h implementation " Pallavi Kadam
2020-02-01 0:04 ` [dpdk-dev] [PATCH v7 3/9] eal: add additional function overrides in windows header files Pallavi Kadam
2020-02-05 19:54 ` Dmitry Kozlyuk [this message]
2020-02-01 0:04 ` [dpdk-dev] [PATCH v7 4/9] eal: getopt implementation for windows Pallavi Kadam
2020-02-01 0:04 ` [dpdk-dev] [PATCH v7 5/9] eal: add function to detect process type Pallavi Kadam
2020-02-05 20:04 ` Dmitry Kozlyuk
2020-02-06 0:56 ` Pallavi Kadam
2020-02-01 0:04 ` [dpdk-dev] [PATCH v7 6/9] eal: include SSE4 support for windows Pallavi Kadam
2020-02-01 0:04 ` [dpdk-dev] [PATCH v7 7/9] eal: remove syslog and dlfcn " Pallavi Kadam
2020-02-01 0:04 ` [dpdk-dev] [PATCH v7 8/9] build: add additional common files support Pallavi Kadam
2020-02-01 0:04 ` [dpdk-dev] [PATCH v7 9/9] eal: add minimum viable code to support parsing Pallavi Kadam
2020-02-05 19:54 ` Dmitry Kozlyuk
2020-02-06 0:39 ` Pallavi Kadam
2020-02-06 1:39 ` Pallavi Kadam
2020-02-06 2:11 ` Thomas Monjalon
2020-02-06 3:18 ` Pallavi Kadam
2020-02-06 6:41 ` Dmitry Kozlyuk
2020-02-06 9:26 ` Thomas Monjalon
2020-02-07 16:46 ` Ranjit Menon
2020-02-07 17:17 ` Ranjit Menon
2020-02-08 0:43 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-07 3:45 ` [dpdk-dev] " Pallavi Kadam
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 0/9] Windows patchset with additional EAL functionalities Pallavi Kadam
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 1/9] license: add license exception for windows Pallavi Kadam
2020-02-12 0:38 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-12 21:38 ` [dpdk-dev] " Thomas Monjalon
2020-02-12 21:55 ` Ranjit Menon
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 2/9] eal: dirent.h implementation " Pallavi Kadam
2020-02-12 0:40 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 3/9] eal: add additional function overrides in windows header files Pallavi Kadam
2020-02-12 0:40 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 4/9] eal: getopt implementation for windows Pallavi Kadam
2020-02-12 0:41 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 5/9] eal: add function to detect process type Pallavi Kadam
2020-02-12 0:42 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 6/9] eal: include SSE4 support for windows Pallavi Kadam
2020-02-12 0:42 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 7/9] eal: remove syslog and dlfcn " Pallavi Kadam
2020-02-12 0:42 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 8/9] build: add additional common files support Pallavi Kadam
2020-02-12 0:42 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-07 3:14 ` [dpdk-dev] [PATCH v8 9/9] eal: add minimum viable code to support parsing Pallavi Kadam
2020-02-12 0:43 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-07 19:05 ` [dpdk-dev] [PATCH v8 0/9] Windows patchset with additional EAL functionalities Dmitry Kozlyuk
2020-02-12 21:52 ` Thomas Monjalon
2020-02-08 0:36 ` [dpdk-dev] [EXTERNAL] " Narcisa Ana Maria Vasile
2020-02-08 1:04 ` Narcisa Ana Maria Vasile
2020-02-10 20:32 ` Narcisa Ana Maria Vasile
2020-02-10 21:22 ` Narcisa Ana Maria Vasile
2020-02-11 21:25 ` Narcisa Ana Maria Vasile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200205225452.5fbc970b@Sovereign \
--to=dmitry.kozliuk@gmail.com \
--cc=Harini.Ramakrishnan@microsoft.com \
--cc=antara.ganesh.kolar@intel.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jerinjacobk@gmail.com \
--cc=keith.wiles@intel.com \
--cc=pallavi.kadam@intel.com \
--cc=ranjit.menon@intel.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).