Re: [PATCH net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog

2016-12-03 Thread Daniel Borkmann
On 12/03/2016 08:32 PM, Martin KaFai Lau wrote: On Sat, Dec 03, 2016 at 04:24:13PM +0100, Jesper Dangaard Brouer wrote: On Fri, 2 Dec 2016 15:23:30 -0800 Martin KaFai Lau wrote: -bool bpf_helper_changes_skb_data(void *func) +BPF_CALL_2(bpf_xdp_adjust_head, struct xdp_buff *, xdp, int, offset)

Re: [PATCH net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog

2016-12-03 Thread Martin KaFai Lau
On Sat, Dec 03, 2016 at 04:24:13PM +0100, Jesper Dangaard Brouer wrote: > On Fri, 2 Dec 2016 15:23:30 -0800 > Martin KaFai Lau wrote: > > > -bool bpf_helper_changes_skb_data(void *func) > > +BPF_CALL_2(bpf_xdp_adjust_head, struct xdp_buff *, xdp, int, offset) > > +{ > > + /* Both mlx4 and mlx5 d

Re: [PATCH net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog

2016-12-03 Thread Jesper Dangaard Brouer
On Fri, 2 Dec 2016 15:23:30 -0800 Martin KaFai Lau wrote: > -bool bpf_helper_changes_skb_data(void *func) > +BPF_CALL_2(bpf_xdp_adjust_head, struct xdp_buff *, xdp, int, offset) > +{ > + /* Both mlx4 and mlx5 driver align each packet to PAGE_SIZE when > + * XDP prog is set. > + * If

Re: [PATCH net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog

2016-12-02 Thread Martin KaFai Lau
On Sat, Dec 03, 2016 at 01:22:05AM +0100, Daniel Borkmann wrote: > On 12/03/2016 12:23 AM, Martin KaFai Lau wrote: > >This patch allows XDP prog to extend/remove the packet > >data at the head (like adding or removing header). It is > >done by adding a new XDP helper bpf_xdp_adjust_head(). > > > >

Re: [PATCH net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog

2016-12-02 Thread Daniel Borkmann
On 12/03/2016 12:23 AM, Martin KaFai Lau wrote: This patch allows XDP prog to extend/remove the packet data at the head (like adding or removing header). It is done by adding a new XDP helper bpf_xdp_adjust_head(). It also renames bpf_helper_changes_skb_data() to bpf_helper_changes_pkt_data() t

[PATCH net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog

2016-12-02 Thread Martin KaFai Lau
This patch allows XDP prog to extend/remove the packet data at the head (like adding or removing header). It is done by adding a new XDP helper bpf_xdp_adjust_head(). It also renames bpf_helper_changes_skb_data() to bpf_helper_changes_pkt_data() to better reflect that XDP prog does not work on sk