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 2ABFBA0C47; Wed, 11 Aug 2021 00:33:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A06134067A; Wed, 11 Aug 2021 00:33:29 +0200 (CEST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mails.dpdk.org (Postfix) with ESMTP id 273244003C for ; Wed, 11 Aug 2021 00:33:28 +0200 (CEST) Received: by mail-lf1-f41.google.com with SMTP id w20so1141882lfu.7 for ; Tue, 10 Aug 2021 15:33:28 -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=EHkci0Q/DIm1OtqUv1K7/ROOb9gxzc1TEhjUKeGF8LI=; b=lW71DxDRVttmOLbgq0rk6dWz8z2Y2PGRL+EGCl1yZ2hAfr8eQzS7BhMsfba9Rf7hYS E8DyRFNxM2wTHipcs/oP315Ac9DYqEs1oKsGiQ2eYLnjxAwmYY+XJQIipMyYVODutyHt MB5/8n8FQduHc9esvU8+kuUotvqI+mD9oNoiG42DnJnJj/+C9d5ZxM9H3qnfTP+2oOX/ ys8977tx26mrnpjA3HokygxpUoQDm1Om3aD6jLoEZQmnFW9igfFXF4erxL8c9c62XXYO tAFLi4vte5NAWK2zFz+5RVA7ipzJ0mu6Pjoam/e/VmnyQEd25GXb2Z4BNN7LfjuuyN7/ eWKQ== 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=EHkci0Q/DIm1OtqUv1K7/ROOb9gxzc1TEhjUKeGF8LI=; b=O8FmNxVdtNphY1KHp2mlb7hC9QrZ28/5Q9nDTmL7FbHZzsHODdRZJkvOAs6zoDEe3g H7k0m5z7h+WEZdJgWZYsFVuRHHFUudifeejD4sO+JzFiOQ09PdjD579A/OZlQcfiTA5T TRNkfH4dbM0XinBdSwWOxvH7RpX35GYtx+UxuD9E5pd5/Cb+ZxRFEi4kMZTT9tr0exXg 2MvJ9T+3J4+kNxKLM3bZH1gqlOYhi+IX4bUhww9GKmLp+uCwMAi4VS/pWQVMxv2EFQMJ BsAbhuV00PoEvblEuuiEezzuWh/j4pC44FO0SX3DzPz6Ie0JVw9g58m+9fR8I+C7543p fXsA== X-Gm-Message-State: AOAM530piT54OfUhlMPPvwLIwTfljPppswY+7IxO9mNBtmIVoYtujrEz ezT6If71W+UJnaNSWPV7dXY= X-Google-Smtp-Source: ABdhPJxjNHe6yvb4P2tYl/0nKWn1y4Zs/ZzwwcgqLt8pqexkhbsRRgblxUiduEzI06hvagGPeMhHFw== X-Received: by 2002:a05:6512:556:: with SMTP id h22mr22931329lfl.461.1628634807578; Tue, 10 Aug 2021 15:33:27 -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 m3sm1648401ljc.70.2021.08.10.15.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 15:33:26 -0700 (PDT) Date: Wed, 11 Aug 2021 01:33:25 +0300 From: Dmitry Kozlyuk To: Nick Connolly Cc: William Tu , dev@dpdk.org, sergey.madaminov@gmail.com Message-ID: <20210811013325.34c36220@sovereign> In-Reply-To: References: <20210805173345.1085-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] eal/windows: add 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" 2021-08-10 22:05 (UTC+0100), Nick Connolly: > > diff --git a/lib/eal/windows/include/meson.build b/lib/eal/windows/include/meson.build > > index b3534b025f..875cc1cf0d 100644 > > --- a/lib/eal/windows/include/meson.build > > +++ b/lib/eal/windows/include/meson.build > > @@ -8,3 +8,7 @@ headers += files( > > 'rte_virt2phys.h', > > 'rte_windows.h', > > ) > > + > > +sys_headers = [] > > +subdir('sys') > > +install_headers(sys_headers, subdir: 'sys') > > diff --git a/lib/eal/windows/include/sys/meson.build b/lib/eal/windows/include/sys/meson.build > > new file mode 100644 > > index 0000000000..6896cbf678 > > --- /dev/null > > +++ b/lib/eal/windows/include/sys/meson.build > > @@ -0,0 +1,6 @@ > > +# SPDX-License-Identifier: BSD-3-Clause > > +# Copyright 2021 VMware, Inc > > + > > +sys_headers += files( > > + 'queue.h', > > +) > > Hi William, > > If I've understood this change correctly it will create a sys/queue.h > header in the build/include folder. > This seems like a reasonable approach to handle missing functionality, > but unfortunately it is problematic. > > An application that links against DPDK is likely to be dealing with > similar issues with missing functionality > and providing a definition in the DPDK includes can conflict with the > approach taken by the application > (in this instance there could be two versions of sys/queue.h in the > include paths leading to ambiguity). > > After discussion, the approach adopted by the DPDK community is that: > > * DPDK should depend only on the C library and not require POSIX > functionality from the underlying > system (headers, definitions etc). Missing functionality should be > implemented within the DPDK > code. > * DPDK should not export POSIX functionality into the environment > (symbols, macros, headers etc) > to avoid these definitions clashing with the application. > > In this instance, it seems that rte_log.h depends upon the system having > sys/queue.h which is not > a standard C dependency. The appropriate response here (based on the > above approach) is to remove > the sys/queue.h dependency from rte_log.h and ensure that it only > depends upon rte_* definitions > contained within the DPDK. Hi William and Nick, rte_log.h doesn't need sys/queue.h include at all. Unfortunately, other public headers need it. Worse, they use TAILQ_ENTRY in structures and TAILQ_FOREACH in macros. We discussed this offline with Tyler and he approved installing , but it is right that doing so would be against the policy. What we can do: 1. Introduce `rte_queue.h` (name can be better) that is env-specific: 1.1. For Linux and FreeBSD it just includes and renames a few macros that are used in headers to RTE_xxx. 1.2. For Windows it defines the same RTE_xxx macros in a way compatible with the version used to build DPDK. 2. Add #include in : Linux and FreeBSD will include a system header, Windows will use the bundled one. This way application are not exposed to non-RTE symbols, at the same time RTE_xxx are binary-compatible with what DPDK implementation expects (and outside of Windows there is no change in fact).