Re: [PATCH net-next v3 2/3] xdp: Always use a devmap for XDP_REDIRECT to a device

2019-03-05 Thread Toke Høiland-Jørgensen
Jakub Kicinski writes: > On Mon, 04 Mar 2019 23:28:14 +0100, Toke Høiland-Jørgensen wrote: >> Jakub Kicinski writes: >> > On Mon, 04 Mar 2019 20:05:30 +0100, Toke Høiland-Jørgensen wrote: >> >> > Hm. I think you'll still need a lock (mutex?) on the alloc path, but >> >> > the free path should

Re: [PATCH net-next v3 2/3] xdp: Always use a devmap for XDP_REDIRECT to a device

2019-03-04 Thread Jakub Kicinski
On Mon, 04 Mar 2019 23:28:14 +0100, Toke Høiland-Jørgensen wrote: > Jakub Kicinski writes: > > On Mon, 04 Mar 2019 20:05:30 +0100, Toke Høiland-Jørgensen wrote: > >> > Hm. I think you'll still need a lock (mutex?) on the alloc path, but > >> > the free path should be fine as long as you load th

Re: [PATCH net-next v3 2/3] xdp: Always use a devmap for XDP_REDIRECT to a device

2019-03-04 Thread Toke Høiland-Jørgensen
Jakub Kicinski writes: > On Mon, 04 Mar 2019 20:05:30 +0100, Toke Høiland-Jørgensen wrote: >> > Hm. I think you'll still need a lock (mutex?) on the alloc path, but >> > the free path should be fine as long as you load the map pointer before >> > looking at the refcnt (atomic op ensuring the bar

Re: [PATCH net-next v3 2/3] xdp: Always use a devmap for XDP_REDIRECT to a device

2019-03-04 Thread Jakub Kicinski
On Mon, 04 Mar 2019 20:05:30 +0100, Toke Høiland-Jørgensen wrote: > > Hm. I think you'll still need a lock (mutex?) on the alloc path, but > > the free path should be fine as long as you load the map pointer before > > looking at the refcnt (atomic op ensuring the barrier there). > > Yeah, for

Re: [PATCH net-next v3 2/3] xdp: Always use a devmap for XDP_REDIRECT to a device

2019-03-04 Thread Toke Høiland-Jørgensen
Jakub Kicinski writes: > On Mon, 04 Mar 2019 12:58:51 +0100, Toke Høiland-Jørgensen wrote: >> >> diff --git a/include/net/netns/xdp.h b/include/net/netns/xdp.h >> >> index e5734261ba0a..4935dfe1cf43 100644 >> >> --- a/include/net/netns/xdp.h >> >> +++ b/include/net/netns/xdp.h >> >> @@ -4,10 +4,2

Re: [PATCH net-next v3 2/3] xdp: Always use a devmap for XDP_REDIRECT to a device

2019-03-04 Thread Jakub Kicinski
On Mon, 04 Mar 2019 12:58:51 +0100, Toke Høiland-Jørgensen wrote: > >> diff --git a/include/net/netns/xdp.h b/include/net/netns/xdp.h > >> index e5734261ba0a..4935dfe1cf43 100644 > >> --- a/include/net/netns/xdp.h > >> +++ b/include/net/netns/xdp.h > >> @@ -4,10 +4,21 @@ > >> > >> #include > >>

Re: [PATCH net-next v3 2/3] xdp: Always use a devmap for XDP_REDIRECT to a device

2019-03-04 Thread Toke Høiland-Jørgensen
Hi Jakub Thanks for the review! A few comments/questions below. > On Fri, 01 Mar 2019 15:12:30 +0100, Toke Høiland-Jørgensen wrote: >> An XDP program can redirect packets between interfaces using either the >> xdp_redirect() helper or the xdp_redirect_map() helper. Apart from the >> flexibility o

Re: [PATCH net-next v3 2/3] xdp: Always use a devmap for XDP_REDIRECT to a device

2019-03-01 Thread Jakub Kicinski
On Fri, 01 Mar 2019 15:12:30 +0100, Toke Høiland-Jørgensen wrote: > An XDP program can redirect packets between interfaces using either the > xdp_redirect() helper or the xdp_redirect_map() helper. Apart from the > flexibility of updating maps from userspace, the redirect_map() helper also > uses t

[PATCH net-next v3 2/3] xdp: Always use a devmap for XDP_REDIRECT to a device

2019-03-01 Thread Toke Høiland-Jørgensen
An XDP program can redirect packets between interfaces using either the xdp_redirect() helper or the xdp_redirect_map() helper. Apart from the flexibility of updating maps from userspace, the redirect_map() helper also uses the map structure to batch packets, which results in a significant (around