DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, techboard@dpdk.org, david.marchand@redhat.com,
	thomas@monjalon.net
Subject: Re: [RFC 1/3] uapi: introduce kernel uAPI headers importation
Date: Mon, 9 Sep 2024 09:43:17 +0200	[thread overview]
Message-ID: <c9eb2b0d-9e0d-4f27-8e4e-73a22588af2d@redhat.com> (raw)
In-Reply-To: <20240908170246.7606c092@hermes.local>



On 9/9/24 02:02, Stephen Hemminger wrote:
> On Fri,  6 Sep 2024 00:15:26 +0200
> Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
> 
>> This patch introduces uAPI headers importation into the
>> DPDK repository. This import is possible thanks to Linux
>> Kernel licence exception for syscalls:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/LICENSES/exceptions/Linux-syscall-note
>>
>> Header files are have to be explicitly imported, and
>> libraries and drivers have to explicitly enable their
>> inclusion.
>>
>> Guidelines are provided in the documentation, and a helper
>> script is also provided to ensure proper importation of the
>> header (unmodified content from a released Kernel version).
>>
>> Next version will introduce a script to check headers are
>> valids.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>>   devtools/import-linux-uapi.sh          | 48 ++++++++++++++++++++
>>   doc/guides/contributing/index.rst      |  1 +
>>   doc/guides/contributing/linux_uapi.rst | 63 ++++++++++++++++++++++++++
>>   meson.build                            |  4 ++
>>   4 files changed, 116 insertions(+)
>>   create mode 100755 devtools/import-linux-uapi.sh
>>   create mode 100644 doc/guides/contributing/linux_uapi.rst
>>
>> diff --git a/devtools/import-linux-uapi.sh b/devtools/import-linux-uapi.sh
>> new file mode 100755
>> index 0000000000..efeffdd332
>> --- /dev/null
>> +++ b/devtools/import-linux-uapi.sh
>> @@ -0,0 +1,48 @@
>> +#!/bin/sh -e
>> +# SPDX-License-Identifier: BSD-3-Clause
>> +# Copyright (c) 2024 Red Hat, Inc.
>> +
>> +#
>> +# Import Linux Kernel uAPI header file
>> +#
>> +
>> +base_url="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/uapi/"
>> +base_path="linux-headers/uapi/"
> 
> Sorry, not a fan of this.
> 
> This must be optional. Most other projects don't do this and it risks
> incompatibilities with the C library.

QEMU, libgpio at least do this.

Supporting new features is quite a mess in lib Vhost currently, because 
we cannot know what is and what is not defined in the build OS headers.
For example:
https://github.com/DPDK/dpdk/blob/main/lib/vhost/vhost.h#L369

> 
> 
> Did you make sure the headers are exactly the same as the distro uses (for the same kernel version).
> Worried that this is not the exact same process that "make headers_install" might use.

We could have them picked from make headers_install. It would be heavier
to do, but could be done if you see any difference.

> 
> Also, ideally the tool would be selective.
> 
Selective about what?

Note that this current RFC is too simplistic, it misses nested headers
import. Will try to cover this in nect revision.

Thanks,
Maxime


  reply	other threads:[~2024-09-09  7:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 22:15 [RFC 0/3] Import Kernel uAPI header files Maxime Coquelin
2024-09-05 22:15 ` [RFC 1/3] uapi: introduce kernel uAPI headers importation Maxime Coquelin
2024-09-06  6:46   ` Morten Brørup
2024-09-06  7:01     ` Maxime Coquelin
2024-09-06  7:13   ` David Marchand
2024-09-06  8:29     ` Maxime Coquelin
2024-09-09  0:02   ` Stephen Hemminger
2024-09-09  7:43     ` Maxime Coquelin [this message]
2024-09-05 22:15 ` [RFC 2/3] uapi: import VDUSE header Maxime Coquelin
2024-09-05 22:15 ` [RFC 3/3] vduse: use import VDUSE uAPI header Maxime Coquelin

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=c9eb2b0d-9e0d-4f27-8e4e-73a22588af2d@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=techboard@dpdk.org \
    --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).