netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* getsockopt(XDP_MMAP_OFFSETS) syscall ABI breakage?
@ 2019-12-19 21:46 Alex Forster
  2019-12-20  9:40 ` Magnus Karlsson
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Forster @ 2019-12-19 21:46 UTC (permalink / raw)
  To: bpf; +Cc: netdev

The getsockopt(XDP_MMAP_OFFSETS) socket option returns a struct
xdp_mmap_offsets (from uapi/linux/if_xdp.h) which is defined as:

    struct xdp_mmap_offsets {
        struct xdp_ring_offset rx;
        struct xdp_ring_offset tx;
        struct xdp_ring_offset fr; /* Fill */
        struct xdp_ring_offset cr; /* Completion */
    };

Prior to kernel 5.4, struct xdp_ring_offset (from the same header) was
defined as:

    struct xdp_ring_offset {
        __u64 producer;
        __u64 consumer;
        __u64 desc;
    };

A few months ago, in 77cd0d7, it was changed to the following:

    struct xdp_ring_offset {
        __u64 producer;
        __u64 consumer;
        __u64 desc;
        __u64 flags;
    };

I believe this constitutes a syscall ABI breakage, which I did not
think was allowed. Have I misunderstood the current stability
guarantees for AF_XDP?

Alex Forster

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: getsockopt(XDP_MMAP_OFFSETS) syscall ABI breakage?
  2019-12-19 21:46 getsockopt(XDP_MMAP_OFFSETS) syscall ABI breakage? Alex Forster
@ 2019-12-20  9:40 ` Magnus Karlsson
  0 siblings, 0 replies; 2+ messages in thread
From: Magnus Karlsson @ 2019-12-20  9:40 UTC (permalink / raw)
  To: Alex Forster; +Cc: bpf, Network Development

On Thu, Dec 19, 2019 at 10:47 PM Alex Forster <aforster@cloudflare.com> wrote:
>
> The getsockopt(XDP_MMAP_OFFSETS) socket option returns a struct
> xdp_mmap_offsets (from uapi/linux/if_xdp.h) which is defined as:
>
>     struct xdp_mmap_offsets {
>         struct xdp_ring_offset rx;
>         struct xdp_ring_offset tx;
>         struct xdp_ring_offset fr; /* Fill */
>         struct xdp_ring_offset cr; /* Completion */
>     };
>
> Prior to kernel 5.4, struct xdp_ring_offset (from the same header) was
> defined as:
>
>     struct xdp_ring_offset {
>         __u64 producer;
>         __u64 consumer;
>         __u64 desc;
>     };
>
> A few months ago, in 77cd0d7, it was changed to the following:
>
>     struct xdp_ring_offset {
>         __u64 producer;
>         __u64 consumer;
>         __u64 desc;
>         __u64 flags;
>     };
>
> I believe this constitutes a syscall ABI breakage, which I did not
> think was allowed. Have I misunderstood the current stability
> guarantees for AF_XDP?

Version 5.4 and above supports both the old definition and the new. If
you enter the size of the old struct xdp_mmap_offsets into the
getsockopt, you get the results in the form that was there before 5.4.
If you enter the size of the new struct, you get the results in the
new form introduced in commit 77cd0d7.

> Alex Forster

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-20  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 21:46 getsockopt(XDP_MMAP_OFFSETS) syscall ABI breakage? Alex Forster
2019-12-20  9:40 ` Magnus Karlsson

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).