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 4C2DEA0C43; Wed, 11 Aug 2021 17:50:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15613410EC; Wed, 11 Aug 2021 17:50:21 +0200 (CEST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by mails.dpdk.org (Postfix) with ESMTP id B8A0040C35 for ; Wed, 11 Aug 2021 17:50:20 +0200 (CEST) Received: by mail-lj1-f170.google.com with SMTP id u13so5369542lje.5 for ; Wed, 11 Aug 2021 08:50:20 -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=8HuzfW60UEHAkJZKkA1VYR/+6Y8uYeS/isP3CtmKhZs=; b=E4isJUgg4DpUDQvlR2bCoSU8c4cPXNW/cy4Jki547XsBqwbyPvpIQMnkHzk5GSiOEu lrEBCD86Zfsj+h+i1Yjxmq0uIdjozNuWdD5txjtHo49kXUa+MEu13tvbkrhnbz1/ffm0 vXxP+8nyx1DbnsRiraLW6NrS3N1lQR1rY5yFhtGRVrelUjtnV1j2uk+i0aCcvp/mUPuQ S+3NU7O9P8E0O7aODBu8sNSRmPeVy0uT2w+9rjPq4EujrF7eGIOtLpDEzPSJGddfCQUX CI80WOEbtsf2hhduvi5E2GI8y7oHoNeyQAuRQZbk5JqZVrZCmdBzr6m+MIX9GMlmjVfH MCwA== 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=8HuzfW60UEHAkJZKkA1VYR/+6Y8uYeS/isP3CtmKhZs=; b=Nd0haOVSgtsiWtH01pdIxYCb/6iD1DT1MrDs0PTg91gPhEHpjvtuolLn4KTLKf197I kCmUBjVSNPTg2jgpajaEY9+x0NtNOxG9rj5Y1CvFljxS79nq/thTuIru5uyjcXhWiLuw 1O8S3DVAF/Y+7WxiZjmgxdkDlfZcdi4ohe36mmO3vcJCX5Njf9WAyv7r8eAE1BHskZnf lvE4ATxH8M5JWbLi3gcm+BtMBaCw68c9pdbxny4bRUbPrkhsD0NO6TSR2hw8PFDxGwh9 Z5DSPAuTdlrUiHYfaJ57wEenod0ZbHHXHL/TQni3UZfcn/dYM3Bs/5sWHJxjEISdLcjc xOiw== X-Gm-Message-State: AOAM530ykVRPpQnxlATgmdiejf4pMsqdgvHoa2t7bUsaG0egs/TrL2TQ /cuFcdfc/x/N9ZC7iJniSAk= X-Google-Smtp-Source: ABdhPJz4QRNUdfHOlifvy9xoPQkjS2s/Keirvh6v8bqkyMkNtbbgjxvDqsmd14EIP/W3c45vhiuCyA== X-Received: by 2002:a2e:a883:: with SMTP id m3mr23966311ljq.443.1628697020268; Wed, 11 Aug 2021 08:50:20 -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 l30sm728220lfj.42.2021.08.11.08.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 08:50:19 -0700 (PDT) Date: Wed, 11 Aug 2021 18:50:18 +0300 From: Dmitry Kozlyuk To: William Tu Cc: dev@dpdk.org, nick.connolly@mayadata.io, Bruce Richardson , David Marchand , Ray Kinsella , Tyler Retzlaff Message-ID: <20210811185018.4d363f6c@sovereign> In-Reply-To: <20210811204627.213-1-u9012063@gmail.com> References: <20210811204627.213-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] [PATCHv2] include: fix sys/queue.h. 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" Hi William, 2021-08-11 20:46 (UTC+0000), William Tu: > Currently there are a couple of header files include 'sys/queue.h', > which is a POSIX functionality. When compiling DPDK with OVS on > Windows, we encountered issues such as, found the missing header. > In file included from ../lib/dpdk.c:27: > C:\temp\dpdk\include\rte_log.h:24:10: fatal error: 'sys/queue.h' file > not found > > The patch fixes it by 1) removing the #include from > a couple of headers, replace it with #include , and > 2) include sys/queue.h in the rte_os.h. As a result, for Linux/BSD, > it is using the sys/queue.h from its POSIX library, and for Windows, > DPDK will use the bundled sys/queue.h. > > 1) fixes the case that DPDK library shouldn't export POSIX functionality > into the environment (symbols, macros, headers etc), which cause definitions > clashing with the application. > 2) fixes the case that DPDK should depend only on the C library and not > require POSIX functionality from the underlying system. Sorry, this is not exactly what was suggested here: http://inbox.dpdk.org/dev/20210811013325.34c36220@sovereign/ The point was not to install . Its full content is not needed for DPDK interface, only for implementation. Public headers only need a handful of macros for list/tailq heads and links. Those macros should be provided by DPDK, with RTE_ prefix. For Linux and FreeBSD it will just be: #include #define RTE_TAILQ_ENTRY(type) TAILQ_ENTRY(type) /* ... */ For Windows you would have to copy definitions from to some public header, seems OK. All public headers that need macros must have them replaced with RTE_ version. Implementation remains unchanged. No new files need to be installed, because when DPDK is built on Windows, it uses the bundled , and when it is installed, only RTE_ macros you created are visible. Macro documentation should clearly state that they are compatible with system for Linux and FreeBSD, and for Windows they are compatible with the version used during build. +Bruce, David, Ray, Tyler to confirm/object the idea. > There are still a couple of headers using sys/queue.h, ex: > rte_bus_pci.h. Since it's not been used in Windows yet, we can > fix them later. Another item I think of is a checkpatch rule to prohibit TAILQ_xxx, etc macro in public headers after replacing them all. > Suggested-by: Nick Connolly > Suggested-by: Dmitry Kozliuk > Signed-off-by: William Tu > --- > v1->v2: > - follow the suggestion by Nick and Dmitry > - http://mails.dpdk.org/archives/dev/2021-August/216304.html Please send new versions as replies to the previous ones: git send-email --in-reply-to MSGID ... https://doc.dpdk.org/guides/contributing/patches.html