Re: [PATCH net-next RFC] Generic XDP

2017-04-09 Thread David Miller
From: Johannes Berg Date: Sun, 09 Apr 2017 09:04:07 +0200 > On Sun, 2017-04-09 at 08:25 +0200, Johannes Berg wrote: >> That would also let you use rcu_assign_pointer() which seems like the >> right thing to do here, along with marking the xdp_prog pointer as >> __rcu? That'd also let you use rcu_

Re: [PATCH net-next RFC] Generic XDP

2017-04-09 Thread David Miller
From: Andy Gospodarek Date: Sun, 9 Apr 2017 01:17:26 -0400 > I should be able to run this on Monday and see how the performance > compares to the driver/native XDP case on some bnxt_en-based hardware. Thanks in advance for testing Andy.

Re: [PATCH net-next RFC] Generic XDP

2017-04-09 Thread David Miller
From: Andrew Lunn Date: Sun, 9 Apr 2017 15:46:55 +0200 >> +switch (act) { >> +case XDP_PASS: >> +case XDP_TX: >> +break; >> + >> +default: >> +bpf_warn_invalid_xdp_action(act); > > Hi David > > You might want to put a /* fall through */ comment here, just

Re: [PATCH net-next RFC] Generic XDP

2017-04-09 Thread Andrew Lunn
> + switch (act) { > + case XDP_PASS: > + case XDP_TX: > + break; > + > + default: > + bpf_warn_invalid_xdp_action(act); Hi David You might want to put a /* fall through */ comment here, just to prevent newbies from submitting patches moving the default cla

Re: [PATCH net-next RFC] Generic XDP

2017-04-09 Thread Johannes Berg
On Sun, 2017-04-09 at 08:25 +0200, Johannes Berg wrote: > That would also let you use rcu_assign_pointer() which seems like the > right thing to do here, along with marking the xdp_prog pointer as > __rcu? That'd also let you use rcu_dereference() instead of > READ_ONCE() which seems like the bette

Re: [PATCH net-next RFC] Generic XDP

2017-04-08 Thread Johannes Berg
On Sat, 2017-04-08 at 20:07 -0700, David Miller wrote: > +static int generic_xdp_install(struct net_device *dev, struct > netdev_xdp *xdp) > +{ > +   struct bpf_prog *new = xdp->prog; > +   int ret = 0; > + > +   switch (xdp->command) { > +   case XDP_SETUP_PROG: { > + 

Re: [PATCH net-next RFC] Generic XDP

2017-04-08 Thread Andy Gospodarek
On Sat, Apr 8, 2017 at 11:07 PM, David Miller wrote: > > This provides a generic non-optimized XDP implementation when the > device driver does not provide an optimized one. > > It is arguable that perhaps I should have required something like > this as part of the initial XDP feature merge. > > I

[PATCH net-next RFC] Generic XDP

2017-04-08 Thread David Miller
This provides a generic non-optimized XDP implementation when the device driver does not provide an optimized one. It is arguable that perhaps I should have required something like this as part of the initial XDP feature merge. I believe this is critical for two reasons: 1) Accessibility. More