Re: [net-next PATCH v2 1/2] e1000: add initial XDP support

2016-09-20 Thread John Fastabend
On 16-09-20 09:26 PM, zhuyj wrote: > +static int e1000_xdp_set(struct net_device *netdev, struct bpf_prog *prog) > +{ > + struct e1000_adapter *adapter = netdev_priv(netdev); > + struct bpf_prog *old_prog; > + > + old_prog = xchg(&adapter->prog, prog); > + if (old_prog) { >

Re: [net-next PATCH v2 1/2] e1000: add initial XDP support

2016-09-20 Thread zhuyj
+static int e1000_xdp_set(struct net_device *netdev, struct bpf_prog *prog) +{ + struct e1000_adapter *adapter = netdev_priv(netdev); + struct bpf_prog *old_prog; + + old_prog = xchg(&adapter->prog, prog); + if (old_prog) { + synchronize_net(); +

Re: [net-next PATCH v2 1/2] e1000: add initial XDP support

2016-09-09 Thread John Fastabend
On 16-09-09 03:04 PM, Eric Dumazet wrote: > On Fri, 2016-09-09 at 14:29 -0700, John Fastabend wrote: >> From: Alexei Starovoitov >> > > > So it looks like e1000_xmit_raw_frame() can return early, > say if there is no available descriptor. > >> +static void e1000_xmit_raw_frame(struct e1000_rx_b

Re: [net-next PATCH v2 1/2] e1000: add initial XDP support

2016-09-09 Thread Eric Dumazet
On Fri, 2016-09-09 at 14:29 -0700, John Fastabend wrote: > From: Alexei Starovoitov > So it looks like e1000_xmit_raw_frame() can return early, say if there is no available descriptor. > +static void e1000_xmit_raw_frame(struct e1000_rx_buffer *rx_buffer_info, > +

[net-next PATCH v2 1/2] e1000: add initial XDP support

2016-09-09 Thread John Fastabend
From: Alexei Starovoitov This patch adds initial support for XDP on e1000 driver. Note e1000 driver does not support page recycling in general which could be added as a further improvement. However XDP_DROP case will recycle. XDP_TX and XDP_PASS do not support recycling yet. I tested this patch