From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <annaemesenyiri@gmail.com>
Cc: <aleksandr.mikhalitsyn@canonical.com>, <alexander@mihalicyn.com>,
<edumazet@google.com>, <kerneljasonxing@gmail.com>,
<kuba@kernel.org>, <linux-kernel@vger.kernel.org>,
<netdev@vger.kernel.org>, <vadim.fedorenko@linux.dev>,
<willemb@google.com>, <kuniyu@amazon.com>
Subject: Re: [PATCH net-next] tools headers: Sync uapi/asm-generic/socket.h with the kernel sources
Date: Fri, 14 Mar 2025 12:45:23 -0700 [thread overview]
Message-ID: <20250314194742.32960-1-kuniyu@amazon.com> (raw)
In-Reply-To: <CAKm6_RsfA_Ygn4aZQdUxfBujxxgdB=PvgymChDtWSVHhhp6WZQ@mail.gmail.com>
From: Anna Nyiri <annaemesenyiri@gmail.com>
Date: Fri, 14 Mar 2025 14:31:34 +0100
> Alexander Mikhalitsyn <alexander@mihalicyn.com> ezt írta (időpont:
> 2025. márc. 10., H, 9:22):
> >
> > Am Mo., 10. März 2025 um 06:33 Uhr schrieb Jason Xing
> > <kerneljasonxing@gmail.com>:
> > >
> > > On Sun, Mar 9, 2025 at 1:15 PM Alexander Mikhalitsyn
> > > <aleksandr.mikhalitsyn@canonical.com> wrote:
> > > >
> > > > This also fixes a wrong definitions for SCM_TS_OPT_ID & SO_RCVPRIORITY.
> > > >
> > > > Accidentally found while working on another patchset.
> > > >
> > > > Cc: linux-kernel@vger.kernel.org
> > > > Cc: netdev@vger.kernel.org
> > > > Cc: Eric Dumazet <edumazet@google.com>
> > > > Cc: Jakub Kicinski <kuba@kernel.org>
> > > > Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>
> > > > Cc: Willem de Bruijn <willemb@google.com>
> > > > Cc: Jason Xing <kerneljasonxing@gmail.com>
> > > > Cc: Anna Emese Nyiri <annaemesenyiri@gmail.com>
> > > > Fixes: a89568e9be75 ("selftests: txtimestamp: add SCM_TS_OPT_ID test")
> > > > Fixes: e45469e594b2 ("sock: Introduce SO_RCVPRIORITY socket option")
> > > > Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
> > >
> >
> > Hi Jason,
> >
> > Thanks for looking into this!
> >
> > > I'm not sure if it's a bug. As you may notice, in
> > > arch/parisc/include/uapi/asm/socket.h, it has its own management of
> > > definitions.
> > >
> > > I'm worried that since this file is uapi, is it allowed to adjust the
> > > number like this patch does if it's not a bug.
The uAPI number definions are different between arch, but strictly,
files under tools/ are not the source of truth.
> >
> > My understanding is that this file (tools/include/uapi/asm-generic/socket.h) is
> > a mirror copy of the actual UAPI file (uapi/asm-generic/socket.h),
> > and definitions need to be in sync with it.
Right.
>
> I don’t completely understand this either—if the definitions need to
> be in sync, why is there a discrepancy?
>
> Specifically, I am referring to the ones that caused the shift in
> numbering in uapi/asm-generic/socket.h:
> #define SO_DEVMEM_LINEAR 78
> #define SCM_DEVMEM_LINEAR SO_DEVMEM_LINEAR
> #define SO_DEVMEM_DMABUF 79
> #define SCM_DEVMEM_DMABUF SO_DEVMEM_DMABUF
> #define SO_DEVMEM_DONTNEED 80
>
> In the case of SO_RCVPRIORITY, I simply continued the numbering
> sequence as it was
This should've followed include/uapi/asm-generic/socket.h.
Otherwise, a program compiled with tools/include/uapi/asm-generic/socket.h
does not work on kernel compiled with include/uapi/asm-generic/socket.h,
and the prog will invoke syscall with an unintentional number.
So, tools/include/uapi must be synced with include/uapi and fixing
up wrong definitions under tools/include/uapi is totally fine, and
this does not cause uAPI breakage, rather it's been broken.
next prev parent reply other threads:[~2025-03-14 19:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-09 12:15 Alexander Mikhalitsyn
2025-03-10 5:32 ` Jason Xing
2025-03-10 8:22 ` Alexander Mikhalitsyn
2025-03-14 13:31 ` Anna Nyiri
2025-03-14 19:45 ` Kuniyuki Iwashima [this message]
2025-03-14 13:52 ` Alexander Mikhalitsyn
2025-03-14 19:52 ` Kuniyuki Iwashima
2025-03-14 21:44 ` Alexander Mikhalitsyn
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=20250314194742.32960-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=aleksandr.mikhalitsyn@canonical.com \
--cc=alexander@mihalicyn.com \
--cc=annaemesenyiri@gmail.com \
--cc=edumazet@google.com \
--cc=kerneljasonxing@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vadim.fedorenko@linux.dev \
--cc=willemb@google.com \
/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
all inboxes | Powered by JetHome®