On Mon, May 06, 2019 at 01:45:40PM +0000, Maxim Mikityanskiy wrote: > On 2019-05-04 20:25, Björn Töpel wrote: > > On Tue, 30 Apr 2019 at 20:12, Maxim Mikityanskiy <maximmi@xxxxxxxxxxxx> wrote: > >> > >> Make it possible for the application to determine whether the AF_XDP > >> socket is running in zero-copy mode. To achieve this, add a new > >> getsockopt option XDP_OPTIONS that returns flags. The only flag > >> supported for now is the zero-copy mode indicator. > >> > >> Signed-off-by: Maxim Mikityanskiy <maximmi@xxxxxxxxxxxx> > >> Reviewed-by: Tariq Toukan <tariqt@xxxxxxxxxxxx> > >> Acked-by: Saeed Mahameed <saeedm@xxxxxxxxxxxx> > >> --- > >> include/uapi/linux/if_xdp.h | 7 +++++++ > >> net/xdp/xsk.c | 22 ++++++++++++++++++++++ > >> tools/include/uapi/linux/if_xdp.h | 7 +++++++ > >> 3 files changed, 36 insertions(+) > >> > >> diff --git a/include/uapi/linux/if_xdp.h b/include/uapi/linux/if_xdp.h > >> index caed8b1614ff..9ae4b4e08b68 100644 > >> --- a/include/uapi/linux/if_xdp.h > >> +++ b/include/uapi/linux/if_xdp.h > >> @@ -46,6 +46,7 @@ struct xdp_mmap_offsets { > >> #define XDP_UMEM_FILL_RING 5 > >> #define XDP_UMEM_COMPLETION_RING 6 > >> #define XDP_STATISTICS 7 > >> +#define XDP_OPTIONS 8 > >> > >> struct xdp_umem_reg { > >> __u64 addr; /* Start of packet data area */ > >> @@ -60,6 +61,12 @@ struct xdp_statistics { > >> __u64 tx_invalid_descs; /* Dropped due to invalid descriptor */ > >> }; > >> > >> +struct xdp_options { > >> + __u32 flags; > >> +}; > >> + > >> +#define XDP_OPTIONS_FLAG_ZEROCOPY (1 << 0) > > > > Nit: The other flags doesn't use "FLAG" in its name, but that doesn't > > really matter. > > > >> + > >> /* Pgoff for mmaping the rings */ > >> #define XDP_PGOFF_RX_RING 0 > >> #define XDP_PGOFF_TX_RING 0x80000000 > >> diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c > >> index b68a380f50b3..998199109d5c 100644 > >> --- a/net/xdp/xsk.c > >> +++ b/net/xdp/xsk.c > >> @@ -650,6 +650,28 @@ static int xsk_getsockopt(struct socket *sock, int level, int optname, > >> > >> return 0; > >> } > >> + case XDP_OPTIONS: > >> + { > >> + struct xdp_options opts; > >> + > >> + if (len < sizeof(opts)) > >> + return -EINVAL; > >> + > >> + opts.flags = 0; > > > > Maybe get rid of this, in favor of "opts = {}" if the structure grows? > > I'm OK with any of these options. Should I respin the series, or can I > follow up with the change in RCs if the series gets to 5.2? > > Alexei, is it even possible to still make changes to this series? The > window appears closed. The series were not applied. Please resubmit addressing all feedback when bpf-next reopens. Likely in ~2 weeks.