Thread (15 messages) 15 messages, 3 authors, 2018-08-02

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

From: Jesper Dangaard Brouer <hidden>
Date: 2018-08-02 15:45:02

On Thu, 2 Aug 2018 22:17:53 +0900
Toshiaki Makita [off-list ref] wrote:
On 18/08/02 (木) 20:45, Jesper Dangaard Brouer wrote:
quoted
On Thu,  2 Aug 2018 19:55:09 +0900
Toshiaki Makita [off-list ref] wrote:
  
quoted
+	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 = sizeof(struct xdp_frame) + frame->headroom - delta;  
Thanks. But I'm not sure I get what you are requesting.
I'm simply requesting you do not use the (void *)frame pointer address,
to calculate the headroom, as it can be calculated in another way.
Supposing xdp_frame is not located in the top of data area, what ensures 
that additional sizeof(struct xdp_frame) can be used?
The calculation in convert_to_xdp_frame() assures this.  If we later
add an xdp_frame that is not located in the top of data area, and want
to change the reserved headroom size, then we deal with it, and update
the code.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help