[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150607.020153.2078872410885973154.davem@davemloft.net>
Date: Sun, 07 Jun 2015 02:01:53 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: ast@...mgrid.com
Cc: edumazet@...gle.com, jhs@...atatu.com, daniel@...earbox.net,
netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next 1/2] bpf: make programs see skb->data == L2
for ingress and egress
From: Alexei Starovoitov <ast@...mgrid.com>
Date: Thu, 4 Jun 2015 10:11:53 -0700
> eBPF programs attached to ingress and egress qdiscs see inconsistent skb->data.
> For ingress L2 header is already pulled, whereas for egress it's present.
> This is known to program writers which are currently forced to use
> BPF_LL_OFF workaround.
> Since programs don't change skb internal pointers it is safe to do
> pull/push right around invocation of the program and earlier taps and
> later pt->func() will not be affected.
> Multiple taps via packet_rcv(), tpacket_rcv() are doing the same trick
> around run_filter/BPF_PROG_RUN even if skb_shared.
>
> This fix finally allows programs to use optimized LD_ABS/IND instructions
> without BPF_LL_OFF for higher performance.
> tc ingress + cls_bpf + samples/bpf/tcbpf1_kern.o
> w/o JIT w/JIT
> before 20.5 23.6 Mpps
> after 21.8 26.6 Mpps
>
> Old programs with BPF_LL_OFF will still work as-is.
>
> We can now undo most of the earlier workaround commit:
> a166151cbe33 ("bpf: fix bpf helpers to use skb->mac_header relative offsets")
>
> Signed-off-by: Alexei Starovoitov <ast@...mgrid.com>
Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists