DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: William Tu <u9012063@gmail.com>
Cc: dev@dpdk.org, nick.connolly@mayadata.io
Subject: Re: [dpdk-dev] [PATCH v6] eal: remove sys/queue.h from public headers.
Date: Wed, 18 Aug 2021 01:06:18 +0300	[thread overview]
Message-ID: <20210818010618.74255cdf@sovereign> (raw)
In-Reply-To: <20210814025154.13430-1-u9012063@gmail.com>

Hi William,
just a few minor corrections remain, please see inline.

2021-08-14 02:51 (UTC+0000), William Tu:
[...]
> diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c
> index 23aaf8b7e4..7edc6798fe 100644
> --- a/lib/eal/common/eal_common_devargs.c
> +++ b/lib/eal/common/eal_common_devargs.c
> @@ -9,6 +9,7 @@
>  #include <stdio.h>
>  #include <string.h>
>  #include <stdarg.h>
> +#include <sys/queue.h>
>  
>  #include <rte_bus.h>
>  #include <rte_class.h>
> @@ -18,6 +19,7 @@
>  #include <rte_errno.h>
>  #include <rte_kvargs.h>
>  #include <rte_log.h>
> +#include <rte_os.h>

Not needed, included by `rte_bus.h` -> `rte_common.h` -> `rte_os.h`.

>  #include <rte_tailq.h>
>  #include "eal_private.h"

If you included <sys/queue.h> from `eal_private.h`,
you would need to modify much fewer files in EAL.

>  
> @@ -291,7 +293,7 @@ rte_devargs_insert(struct rte_devargs **da)
>  	if (*da == NULL || (*da)->bus == NULL)
>  		return -1;
>  
> -	TAILQ_FOREACH_SAFE(listed_da, &devargs_list, next, tmp) {
> +	RTE_TAILQ_FOREACH_SAFE(listed_da, &devargs_list, next, tmp) {
>  		if (listed_da == *da)
>  			/* devargs already in the list */
>  			return 0;
> @@ -358,7 +360,7 @@ rte_devargs_remove(struct rte_devargs *devargs)
>  	if (devargs == NULL || devargs->bus == NULL)
>  		return -1;
>  
> -	TAILQ_FOREACH_SAFE(d, &devargs_list, next, tmp) {
> +	RTE_TAILQ_FOREACH_SAFE(d, &devargs_list, next, tmp) {
>  		if (strcmp(d->bus->name, devargs->bus->name) == 0 &&
>  		    strcmp(d->name, devargs->name) == 0) {
>  			TAILQ_REMOVE(&devargs_list, d, next);
[...]
> diff --git a/lib/eal/windows/include/rte_os.h b/lib/eal/windows/include/rte_os.h
> index 66c711d458..54892ab89c 100644
> --- a/lib/eal/windows/include/rte_os.h
> +++ b/lib/eal/windows/include/rte_os.h
> @@ -18,6 +18,37 @@
>  extern "C" {
>  #endif

Comment about compatibility with the bundled sys/queue.h is lost.

> +#define RTE_TAILQ_HEAD(name, type) \
> +struct name { \
> +	struct type *tqh_first; /* first element */ \
> +	struct type **tqh_last; /* addr of last next element */ \
> +}
> +#define RTE_TAILQ_ENTRY(type) \
> +struct { \
> +	struct type *tqe_next; /* next element */ \
> +	struct type **tqe_prev; /* address of previous next element */ \
> +}
> +#define RTE_TAILQ_FOREACH(var, head, field) \
> +	for ((var) = RTE_TAILQ_FIRST((head)); \
> +	    (var); \
> +	    (var) = RTE_TAILQ_NEXT((var), field))
> +#define RTE_TAILQ_FOREACH_SAFE(var, head, field, tvar) \
> +	for ((var) = TAILQ_FIRST((head)); \
> +	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
> +	    (var) = (tvar))
> +#define RTE_TAILQ_FIRST(head) ((head)->tqh_first)
> +#define RTE_TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
> +#define RTE_STAILQ_HEAD(name, type) \
> +struct name { \
> +	struct type *stqh_first;/* first element */ \
> +	struct type **stqh_last;/* addr of last next element */ \
> +}
> +#define RTE_STAILQ_ENTRY(type) \
> +struct { \
> +	struct type *stqe_next; /* next element */ \
> +}
> +
> +

Redundant newline.

  reply	other threads:[~2021-08-17 22:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 20:46 [dpdk-dev] [PATCHv2] include: fix sys/queue.h William Tu
2021-08-11 15:50 ` Dmitry Kozlyuk
2021-08-11 18:13   ` William Tu
2021-08-12 20:05 ` [dpdk-dev] [PATCHv3] " William Tu
2021-08-12 21:58   ` Dmitry Kozlyuk
2021-08-13  1:02   ` [dpdk-dev] [PATCHv4] eal: remove sys/queue.h from public headers William Tu
2021-08-13  1:11     ` Stephen Hemminger
2021-08-13  1:36       ` William Tu
2021-08-13  3:36     ` [dpdk-dev] [PATCHv5] " William Tu
2021-08-13 18:59       ` Dmitry Kozlyuk
2021-08-14  2:31         ` William Tu
2021-08-14  2:51       ` [dpdk-dev] [PATCH v6] " William Tu
2021-08-17 22:06         ` Dmitry Kozlyuk [this message]
2021-08-18 23:26         ` [dpdk-dev] [PATCH v7] " William Tu
2021-08-19 23:29           ` Dmitry Kozlyuk
2021-08-23 12:34             ` William Tu
2021-08-23 13:03           ` [dpdk-dev] [PATCH v8] " William Tu
2021-08-23 19:14             ` Dmitry Kozlyuk
2021-08-24 16:11               ` William Tu
2021-08-24 16:21             ` [dpdk-dev] [PATCH v9] " William Tu
2021-09-20 20:11               ` Narcisa Ana Maria Vasile
2021-09-30 22:16                 ` William Tu
2021-10-01  7:27                   ` David Marchand
2021-10-01  9:36                     ` Dmitry Kozlyuk
2021-10-01  9:51                       ` Dmitry Kozlyuk
2021-10-01  9:55                         ` David Marchand
2021-10-01 10:12                           ` Bruce Richardson
2021-10-01 10:34                 ` Thomas Monjalon

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=20210818010618.74255cdf@sovereign \
    --to=dmitry.kozliuk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=nick.connolly@mayadata.io \
    --cc=u9012063@gmail.com \
    /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).