[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ8uoz2iVinaXZZ18Z1G=+bw6Q-JCmvDPiVJd=6ykv-XKseNSg@mail.gmail.com>
Date: Fri, 3 May 2019 08:35:08 +0200
From: Magnus Karlsson <magnus.karlsson@...il.com>
To: "Samudrala, Sridhar" <sridhar.samudrala@...el.com>
Cc: Magnus Karlsson <magnus.karlsson@...el.com>,
Björn Töpel <bjorn.topel@...el.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Network Development <netdev@...r.kernel.org>,
Jesper Dangaard Brouer <brouer@...hat.com>,
bpf@...r.kernel.org, bruce.richardson@...el.com,
ciara.loftus@...el.com,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
Ye Xiaolong <xiaolong.ye@...el.com>,
"Zhang, Qi Z" <qi.z.zhang@...el.com>,
Maxim Mikityanskiy <maximmi@...lanox.com>,
kevin.laatz@...el.com, ilias.apalodimas@...aro.org
Subject: Re: [RFC bpf-next 4/7] netdevice: introduce busy-poll setsockopt for AF_XDP
On Fri, May 3, 2019 at 2:26 AM Samudrala, Sridhar
<sridhar.samudrala@...el.com> wrote:
>
>
>
> On 5/2/2019 1:39 AM, Magnus Karlsson wrote:
> > This patch introduces a new setsockopt that enables busy-poll for XDP
> > sockets. It is called XDP_BUSY_POLL_BATCH_SIZE and takes batch size as
> > an argument. A value between 1 and NAPI_WEIGHT (64) will turn it on, 0
> > will turn it off and any other value will return an error. There is
> > also a corresponding getsockopt implementation.
>
> I think this socket option should also allow specifying a timeout value
> when using blocking poll() calls.
> OR can we use SO_BUSY_POLL to specify this timeout value?
I think you are correct in that we need to be able to specify the
timeout. The current approach of always having a timeout of zero was
optimized for the high throughput case. But Ilias and others often
talk about using AF_XDP for time sensitive networking, and in that
case spinning in the kernel (for a max period of the timeout) waiting
for a packet would provide better latency. And with a configurable
value, we could support both cases, so why not.
I will add the timeout value to the new setsockopt I introduced, so it
will take both a batch size and a timeout value. I will also call it
something else since it should not have batch_size in its name
anymore.
Thanks: Magnus
> >
> > Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
> > ---
> > include/uapi/linux/if_xdp.h | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/include/uapi/linux/if_xdp.h b/include/uapi/linux/if_xdp.h
> > index caed8b1..be28a78 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_BUSY_POLL_BATCH_SIZE 8
> >
> > struct xdp_umem_reg {
> > __u64 addr; /* Start of packet data area */
> >
Powered by blists - more mailing lists