Thread (73 messages) 73 messages, 10 authors, 2024-04-08

Re: [RFC PATCH net-next v6 12/15] tcp: RX path for devmem TCP

From: "Arnd Bergmann" <arnd@arndb.de>
Date: 2024-03-05 19:40:07
Also in: bpf, dri-devel, linux-alpha, linux-arch, linux-doc, linux-kselftest, linux-media, linux-mips, lkml, netdev, sparclinux

On Tue, Mar 5, 2024, at 20:22, Mina Almasry wrote:
On Tue, Mar 5, 2024 at 12:42 AM Arnd Bergmann [off-list ref] wrote:
quoted
On Tue, Mar 5, 2024, at 03:01, Mina Almasry wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help