[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 2 Feb 2017 15:57:54 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Jakub Kicinski <kubakici@...pl>
Cc: Michael Chan <michael.chan@...adcom.com>, davem@...emloft.net,
netdev@...r.kernel.org, Martin KaFai Lau <kafai@...com>
Subject: Re: [PATCH net-next v2 11/12] bnxt_en: Add basic XDP support.
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.
Powered by blists - more mailing lists