> On Tue, 26 May 2020 15:48:13 +0200
> Lorenzo Bianconi <lore...@kernel.org> wrote:
> 

[...]

> > diff --git a/include/net/xdp.h b/include/net/xdp.h
> > index 90f11760bd12..5dbdd65866a9 100644
> > --- a/include/net/xdp.h
> > +++ b/include/net/xdp.h
> > @@ -106,6 +106,16 @@ void xdp_warn(const char *msg, const char *func, const 
> > int line);
> >  
> >  struct xdp_frame *xdp_convert_zc_to_xdp_frame(struct xdp_buff *xdp);
> >  
> > +static inline
> > +void convert_to_xdp_buff(struct xdp_frame *frame, struct xdp_buff *xdp)
> > +{
> > +   xdp->data_hard_start = (void *)frame;
> 
> This assumption is problematic.  You are suppose to deduct this from
> frame->data pointer.
> 
> Currently the xdp_frame is designed and access such that is is possible
> to use another memory area for xdp_frame.  That would break after this
> change.
> 
> This should instead be:
> 
>  xdp->data_hard_start = frame->data - (frame->headroom + sizeof(struct 
> xdp_frame));

ack, fine. I will fix it v2.

Regards,
Lorenzo

> 
> > +   xdp->data = frame->data;
> > +   xdp->data_end = frame->data + frame->len;
> > +   xdp->data_meta = frame->data - frame->metasize;
> > +   xdp->frame_sz = frame->frame_sz;
> > +}
> > +
> 
> -- 
> Best regards,
>   Jesper Dangaard Brouer
>   MSc.CS, Principal Kernel Engineer at Red Hat
>   LinkedIn: http://www.linkedin.com/in/brouer
> 

Attachment: signature.asc
Description: PGP signature

Reply via email to