On Thu, Feb 02, 2017 at 03:08:27PM -0800, Jakub Kicinski wrote: > > + rcu_read_lock(); > > + act = bpf_prog_run_xdp(xdp_prog, &xdp); > > + rcu_read_unlock(); > > + > > + if (orig_data != xdp.data) { > > + offset = xdp.data - xdp.data_hard_start; > > + len = xdp.data_end - xdp.data; > > If BPF changed the start of the packet and returned XDP_PASS you should > make sure stack will see the modified packet. I.e. with adjusted > offset and len.
that is correct. skb passed to the stack should see new packet start and len. Though today it's only useful with tc+cls_bpf on top that can take advantage of it. Certainly more work is needed in this area for xdp overall. I don't think we should mix that discussion with this patch set.