[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b7ef0a2b-40e8-4fac-8396-fe0f394bf0e3@app.fastmail.com>
Date: Tue, 05 Mar 2024 20:39:44 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Mina Almasry" <almasrymina@...gle.com>
Cc: Netdev <netdev@...r.kernel.org>, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-alpha@...r.kernel.org,
linux-mips@...r.kernel.org, linux-parisc@...r.kernel.org,
sparclinux@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
Linux-Arch <linux-arch@...r.kernel.org>, bpf@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
"David S . Miller" <davem@...emloft.net>,
"Eric Dumazet" <edumazet@...gle.com>, "Jakub Kicinski" <kuba@...nel.org>,
"Paolo Abeni" <pabeni@...hat.com>, "Jonathan Corbet" <corbet@....net>,
"Richard Henderson" <richard.henderson@...aro.org>,
"Ivan Kokshaysky" <ink@...assic.park.msu.ru>,
"Matt Turner" <mattst88@...il.com>,
"Thomas Bogendoerfer" <tsbogend@...ha.franken.de>,
"James E . J . Bottomley" <James.Bottomley@...senpartnership.com>,
"Helge Deller" <deller@....de>, "Andreas Larsson" <andreas@...sler.com>,
"Jesper Dangaard Brouer" <hawk@...nel.org>,
"Ilias Apalodimas" <ilias.apalodimas@...aro.org>,
"Steven Rostedt" <rostedt@...dmis.org>,
"Masami Hiramatsu" <mhiramat@...nel.org>,
"Mathieu Desnoyers" <mathieu.desnoyers@...icios.com>,
"Alexei Starovoitov" <ast@...nel.org>,
"Daniel Borkmann" <daniel@...earbox.net>,
"Andrii Nakryiko" <andrii@...nel.org>,
"Martin KaFai Lau" <martin.lau@...ux.dev>,
"Eduard Zingerman" <eddyz87@...il.com>, "Song Liu" <song@...nel.org>,
"Yonghong Song" <yonghong.song@...ux.dev>,
"John Fastabend" <john.fastabend@...il.com>,
"KP Singh" <kpsingh@...nel.org>, "Stanislav Fomichev" <sdf@...gle.com>,
"Hao Luo" <haoluo@...gle.com>, "Jiri Olsa" <jolsa@...nel.org>,
"David Ahern" <dsahern@...nel.org>,
"Willem de Bruijn" <willemdebruijn.kernel@...il.com>,
shuah <shuah@...nel.org>, "Sumit Semwal" <sumit.semwal@...aro.org>,
Christian König <christian.koenig@....com>,
"Pavel Begunkov" <asml.silence@...il.com>, "David Wei" <dw@...idwei.uk>,
"Jason Gunthorpe" <jgg@...pe.ca>,
"Yunsheng Lin" <linyunsheng@...wei.com>,
"Shailend Chand" <shailend@...gle.com>,
"Harshitha Ramamurthy" <hramamurthy@...gle.com>,
"Shakeel Butt" <shakeelb@...gle.com>,
"Jeroen de Borst" <jeroendb@...gle.com>,
"Praveen Kaligineedi" <pkaligineedi@...gle.com>,
"Willem de Bruijn" <willemb@...gle.com>,
"Kaiyuan Zhang" <kaiyuanz@...gle.com>
Subject: Re: [RFC PATCH net-next v6 12/15] tcp: RX path for devmem TCP
On Tue, Mar 5, 2024, at 20:22, Mina Almasry wrote:
> On Tue, Mar 5, 2024 at 12:42 AM Arnd Bergmann <arnd@...db.de> wrote:
>> On Tue, Mar 5, 2024, at 03:01, Mina Almasry wrote:
>>
>> This structure requires a special compat handler to run
>> x86-32 binaries on x86-64 because of the different alignment
>> requirements. Any uapi-visible structures should be defined
>> to avoid this and just have no holes in them. Maybe extend
>> one of the __u32 members to __u64 or add another 32-bit padding field?
>>
>
> Honestly the 32-bit fields as-is are somewhat comically large. I don't
> think extending the __u32 -> __u64 is preferred because I don't see us
> needing that much, so maybe I can add another 32-bit padding field.
> Does this look good to you?
Having a reserved field works but requires that you check it for
being zero already, so you can detect an incompatible caller.
> struct dmabuf_cmsg {
> __u64 frag_offset;
> __u32 frag_size;
> __u32 frag_token;
> __u32 dmabuf_id;
> __u32 ext; /* reserved for future flags */
> };
Maybe call it 'flags'?
> Another option is to actually compress frag_token & dmabuf_id to be
> 32-bit combined size if that addresses your concern. I prefer that
> less in case they end up being too small for future use cases.
I don't know what either of those fields is. Is dmabuf_id not a
file descriptor? If it is, it has to be 32 bits wide. Otherwise
having two 16-bit fields and a 32-bit field would indeed add up
to a multiple of the structure alignment on all architectures and
solve the problem.
Arnd
Powered by blists - more mailing lists