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 DA2C6A0C4B; Fri, 20 Aug 2021 01:29:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6424F40041; Fri, 20 Aug 2021 01:29:06 +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 9BE4E4003D for ; Fri, 20 Aug 2021 01:29:05 +0200 (CEST) Received: by mail-lj1-f169.google.com with SMTP id y6so14226797lje.2 for ; Thu, 19 Aug 2021 16:29:05 -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=U0XI9Q61zxzjzFqhNCjn8PFJABxzsTyYsTnrn93Pf7w=; b=ikbhL6N2vsq51j4ZUSgPgJj8tCnduLNF+/9ygYZiIxXoQiDz8TTtRRIxc9vElL4ev2 JtDz59i+bQxMHgCH+ae22P7rhP9sy6GDnmfKCf5MvRn4KAgK5c/vAt7SqOKVAHcS/2gz 8f9ql44J/l/gak08Xv6lUrFJjK92nx2J2QAlZ5Gkg7mVBeI4v1bgNwQYmPG1w/CPa0aj +V4rtVH/7ELsFZf9iL2zHTl3HJgfMfxGRobwFgqizay9kNveDRPL69ay/ZLNHS8QbTV4 LqRDgSh9NHqc13UNngqFZSIXCS3+R8IUkkVIQbVejFNV+dxxqw3CTWqiAScP9NRh1Q33 YguA== 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=U0XI9Q61zxzjzFqhNCjn8PFJABxzsTyYsTnrn93Pf7w=; b=MICZSvQlftVqkmuU0GprdnZCy/O7/pVmCWw1ZVPWYUNzy3K/+4OeiPXzMRk7FlAWXs k4AxY3RsU8GP35pl5bLbROclTDNfjGuJiHZ3+0kOAsyxkR9Q0cMLSnUFuFB/7hrQh6l2 VoIx4fo1roLj+fsNdKLi4J+jd74kmipscXfvMChFaLrE93v1LBIWvpGgEqB/H99axZ5V P+8AXLub92I+widHhh8DWDbtpUuZ9vdACu1kzCwe5c4NHvLQrpxd0eCKXe/+TWV+fYH4 v0n4vawYV1LoAHmiwzXE/s5NjS3NlRao0lxcBlrxRBkOpuY8MSS7JnFOxpI1lFmFU4wn 13PA== X-Gm-Message-State: AOAM532lBGdugi1SEzhrugUKztJaagoDY16+ZTYdskSpX85k7g9nbu5x 9yg9FjsvXcXyibVBEj04Whs= X-Google-Smtp-Source: ABdhPJwe2ne1+hMyOmySrTRFvVNE9TeMyADiFERnRiZiWrBJsW3yBdXsShq9i4pazWzACixC1sV7PQ== X-Received: by 2002:a2e:6f15:: with SMTP id k21mr13284935ljc.44.1629415745032; Thu, 19 Aug 2021 16:29:05 -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 z15sm390170ljm.78.2021.08.19.16.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 16:29:04 -0700 (PDT) Date: Fri, 20 Aug 2021 02:29:03 +0300 From: Dmitry Kozlyuk To: William Tu Cc: dev@dpdk.org, nick.connolly@mayadata.io Message-ID: <20210820022903.50d75750@sovereign> In-Reply-To: <20210818232632.7068-1-u9012063@gmail.com> References: <20210814025154.13430-1-u9012063@gmail.com> <20210818232632.7068-1-u9012063@gmail.com> X-Mailer: Claws Mail 3.17.8 (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 v7] eal: remove sys/queue.h from public headers. 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-08-18 23:26 (UTC+0000), William Tu: [...] > diff --git a/lib/eal/linux/include/rte_os.h b/lib/eal/linux/include/rte_os.h > index 1618b4df22..ce5b0aed52 100644 > --- a/lib/eal/linux/include/rte_os.h > +++ b/lib/eal/linux/include/rte_os.h > @@ -11,6 +11,21 @@ > */ > > #include > +#include > + > +/* These macros are compatible with system's sys/queue.h. */ > +#define RTE_TAILQ_HEAD(name, type) TAILQ_HEAD(name, type) > +#define RTE_TAILQ_ENTRY(type) TAILQ_ENTRY(type) > +#define RTE_TAILQ_FOREACH(var, head, field) TAILQ_FOREACH(var, head, field) > +#define RTE_TAILQ_FOREACH_SAFE(var, head, field, tvar) \ > + for ((var) = TAILQ_FIRST((head)); \ > + (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ > + (var) = (tvar)) I made a comment to v5 and you were going to fix it, maybe it got lost? Why duplicate this in rte_os.h (documentation lost, BTW) and add #ifdef? RTE_TAILQ_FOREACH_SAFE is not needed in headers, it can be left [in rte_tailq.h]. The important part is duplication in rte_os.h for each platform and the loss of documentation. I see you already removed #ifdef. > +#define RTE_TAILQ_FIRST(head) TAILQ_FIRST(head) > +#define RTE_TAILQ_NEXT(elem, field) TAILQ_NEXT(elem, field) > +#define RTE_STAILQ_HEAD(name, type) STAILQ_HEAD(name, type) > +#define RTE_STAILQ_ENTRY(type) STAILQ_ENTRY(type) > + > > #ifdef CPU_SETSIZE /* may require _GNU_SOURCE */ > typedef cpu_set_t rte_cpuset_t; > diff --git a/lib/eal/windows/eal_alarm.c b/lib/eal/windows/eal_alarm.c > index e5dc54efb8..103c1f909d 100644 > --- a/lib/eal/windows/eal_alarm.c > +++ b/lib/eal/windows/eal_alarm.c > @@ -4,6 +4,7 @@ > > #include > #include > +#include > > #include > #include > diff --git a/lib/eal/windows/include/rte_os.h b/lib/eal/windows/include/rte_os.h > index 66c711d458..0cbe1dbc1e 100644 > --- a/lib/eal/windows/include/rte_os.h > +++ b/lib/eal/windows/include/rte_os.h > @@ -18,6 +18,37 @@ > extern "C" { > #endif > > +/* These macros are compatible with bundled sys/queue.h. */ > +#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 */ \ > +} > + Please drop the inline comments. They duplicate what's already in sys/queue.h and we're not going to maintain them.