From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org, techboard@dpdk.org, thomas@monjalon.net,
mb@smartsharesystems.com, stephen@networkplumber.org
Subject: Re: [RFC v3 1/3] uapi: introduce kernel uAPI headers import
Date: Tue, 8 Oct 2024 18:56:26 +0200 [thread overview]
Message-ID: <004b8cbe-7169-485a-858a-43895211b351@redhat.com> (raw)
In-Reply-To: <CAJFAV8x3UWMy5b0ScKGYbdOtSjpWqKq4YRhPBXvaev3Bu02MoQ@mail.gmail.com>
On 9/17/24 13:36, David Marchand wrote:
> On Wed, Sep 11, 2024 at 9:32 PM Maxime Coquelin
> <maxime.coquelin@redhat.com> wrote:
>>
>> This patch introduces uAPI headers import 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.
>>
>> Guidelines are provided in the documentation, and helper
>> scripts are also provided to ensure proper importation of the
>> header (unmodified content from a released Kernel version):
>> - import-linux-uapi.sh: used to add and update headers and
>> their dependencies to linux-headers/uapi/
>> - check-linux-uapi.sh: used to check all headers are valid
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> I have been trying this script to import linux/vfio.h and cleanup its
> usage in DPDK.
>
> There is one issue that was raised.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/vfio.h#n1573
>
> struct vfio_bitmap {
> __u64 pgsize; /* page size for bitmap in bytes */
> __u64 size; /* in bytes */
> __u64 __user *data; /* one bit per page */
> };
>
> The __user annotation is sanitized by the headers install script in
> the kernel, but the dpdk import script is missing this part.
> Such sanitizations breaks the check script.
>
> We could invert the logic in the check script: instead of "restoring"
> an imported header, the check would convert a freshly downloaded
> header and compare it against the imported header in dpdk.
> One thing though is that we would need a copy of the "conversion"
> function in the two scripts.
>
> One idea.. can we have a single script?
>
> # Interactive mode, with questions about what to import if dependencies exist:
> $ devtools/linux-uapi.sh import linux/vfio.h v6.10
>
> # Non interactive mode, the script uses the version file and imported headers:
> $ devtools/linux-uapi.sh check
>
>
> Regardless of this suggestion, I have some nits about the shell scripts below:
>
>> ---
>> devtools/check-linux-uapi.sh | 85 ++++++++++++++++++
>> devtools/import-linux-uapi.sh | 119 +++++++++++++++++++++++++
>> doc/guides/contributing/index.rst | 1 +
>> doc/guides/contributing/linux_uapi.rst | 71 +++++++++++++++
>> linux-headers/uapi/.gitignore | 4 +
>> linux-headers/uapi/version | 1 +
>> meson.build | 8 +-
>> 7 files changed, 287 insertions(+), 2 deletions(-)
>> create mode 100755 devtools/check-linux-uapi.sh
>> create mode 100755 devtools/import-linux-uapi.sh
>> create mode 100644 doc/guides/contributing/linux_uapi.rst
>> create mode 100644 linux-headers/uapi/.gitignore
>> create mode 100644 linux-headers/uapi/version
>>
Thanks for the deep review!
I think I addressed all the comments in upcoming V1
Maxime
next prev parent reply other threads:[~2024-10-08 16:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 19:32 [RFC v3 0/3] Import Kernel uAPI header files Maxime Coquelin
2024-09-11 19:32 ` [RFC v3 1/3] uapi: introduce kernel uAPI headers import Maxime Coquelin
2024-09-17 11:36 ` David Marchand
2024-09-17 14:32 ` Maxime Coquelin
2024-10-08 16:56 ` Maxime Coquelin [this message]
2024-09-19 8:39 ` Thomas Monjalon
2024-10-08 16:57 ` Maxime Coquelin
2024-09-11 19:32 ` [RFC v3 2/3] uapi: import VDUSE header Maxime Coquelin
2024-09-11 19:32 ` [RFC v3 3/3] vduse: use imported VDUSE uAPI header Maxime Coquelin
2024-09-12 8:30 ` [RFC v3 0/3] Import Kernel uAPI header files Ferruh Yigit
2024-09-12 12:08 ` Maxime Coquelin
2024-09-12 13:16 ` Ferruh Yigit
2024-09-12 13:47 ` 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=004b8cbe-7169-485a-858a-43895211b351@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=mb@smartsharesystems.com \
--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).