Re: [net-next PATCH 3/5] bpf: cpumap xdp_buff to skb conversion and allocation

2017-09-29 Thread Jesper Dangaard Brouer
On Fri, 29 Sep 2017 17:49:23 +0800 Jason Wang wrote: > On 2017年09月28日 20:57, Jesper Dangaard Brouer wrote: > > +}; > > + > > +/* Convert xdp_buff to xdp_pkt */ > > +static struct xdp_pkt *convert_to_xdp_pkt(struct xdp_buff *xdp) > > +{ > > + struct xdp_pkt *xdp_pkt; > > + int headroom; > > +

Re: [net-next PATCH 3/5] bpf: cpumap xdp_buff to skb conversion and allocation

2017-09-29 Thread Jason Wang
On 2017年09月28日 20:57, Jesper Dangaard Brouer wrote: +}; + +/* Convert xdp_buff to xdp_pkt */ +static struct xdp_pkt *convert_to_xdp_pkt(struct xdp_buff *xdp) +{ + struct xdp_pkt *xdp_pkt; + int headroom; + + /* Assure headroom is available for storing info */ + headroom

Re: [net-next PATCH 3/5] bpf: cpumap xdp_buff to skb conversion and allocation

2017-09-29 Thread Jesper Dangaard Brouer
On Fri, 29 Sep 2017 01:21:01 +0200 Daniel Borkmann wrote: > On 09/28/2017 02:57 PM, Jesper Dangaard Brouer wrote: > [...] > > +/* Convert xdp_buff to xdp_pkt */ > > +static struct xdp_pkt *convert_to_xdp_pkt(struct xdp_buff *xdp) > > +{ > > + struct xdp_pkt *xdp_pkt; > > + int headroom; > > +

Re: [net-next PATCH 3/5] bpf: cpumap xdp_buff to skb conversion and allocation

2017-09-28 Thread Daniel Borkmann
On 09/28/2017 02:57 PM, Jesper Dangaard Brouer wrote: [...] +/* Convert xdp_buff to xdp_pkt */ +static struct xdp_pkt *convert_to_xdp_pkt(struct xdp_buff *xdp) +{ + struct xdp_pkt *xdp_pkt; + int headroom; + + /* Assure headroom is available for storing info */ + headroom

[net-next PATCH 3/5] bpf: cpumap xdp_buff to skb conversion and allocation

2017-09-28 Thread Jesper Dangaard Brouer
This patch makes cpumap functional, by adding SKB allocation and invoking the network stack on the dequeuing CPU. For constructing the SKB on the remote CPU, the xdp_buff in converted into a struct xdp_pkt, and it mapped into the top headroom of the packet, to avoid allocating separate mem. For n