Re: [PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-02 Thread Toshiaki Makita
On 18/08/02 (木) 22:53, Jesper Dangaard Brouer wrote: On Thu, 2 Aug 2018 22:17:53 +0900 Toshiaki Makita wrote: On 18/08/02 (木) 20:45, Jesper Dangaard Brouer wrote: On Thu, 2 Aug 2018 19:55:09 +0900 Toshiaki Makita wrote: + headroom = frame->data - delta - (void *)frame; Your cal

Re: [PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-02 Thread Jesper Dangaard Brouer
On Thu, 2 Aug 2018 22:17:53 +0900 Toshiaki Makita wrote: > On 18/08/02 (木) 20:45, Jesper Dangaard Brouer wrote: > > On Thu, 2 Aug 2018 19:55:09 +0900 > > Toshiaki Makita wrote: > > > >> + headroom = frame->data - delta - (void *)frame; > > > > Your calculation of headroom is still adding

Re: [PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-02 Thread Toshiaki Makita
On 18/08/02 (木) 20:45, Jesper Dangaard Brouer wrote: On Thu, 2 Aug 2018 19:55:09 +0900 Toshiaki Makita wrote: + headroom = frame->data - delta - (void *)frame; Your calculation of headroom is still adding an assumption that xdp_frame is located in the top of data area, that is unneces

Re: [PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-02 Thread Jesper Dangaard Brouer
On Thu, 2 Aug 2018 19:55:09 +0900 Toshiaki Makita wrote: > + headroom = frame->data - delta - (void *)frame; Your calculation of headroom is still adding an assumption that xdp_frame is located in the top of data area, that is unnecessary. The headroom can be calculated as: headroom = si

[PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-02 Thread Toshiaki Makita
This is preparation for XDP TX and ndo_xdp_xmit. This allows napi handler to handle xdp_frames through xdp ring as well as sk_buff. v7: - Use xdp_scrub_frame() instead of memset(). v3: - Revert v2 change around rings and use a flag to differentiate skb and xdp_frame, since bulk skb xmit makes l