On Tue, 18 Apr 2017 15:05:35 -0400 Andy Gospodarek <[email protected]> wrote:
> On Fri, Apr 14, 2017 at 05:59:51PM -0700, Alexei Starovoitov wrote:
> > On Thu, Apr 13, 2017 at 04:23:15PM -0400, David Miller wrote:
> > > +
> > > + switch (act) {
> > > + case XDP_TX:
> > > + __skb_push(skb, skb->mac_len);
> >
> > s/skb->mac_len/mac_len/
> >
>
[...]
>
> When using this change above suggested by Alexei, XDP_DROP and XDP_TX
> actions appear to work well with xdp1 and xdp2.
Also adjusted patch accordingly.
Ran a few quick tests today, but just against an really old e1000 NIC
attached to a PCI-bus (32bit). There were not difference between DROP
and PASS, but this is likely due to a NIC HW limit.
Sender were sending 951,146 pps (<= tx_queue_0_packets /sec)
$ sudo ./xdp_bench01_mem_access_cost --readmem --action XDP_DROP --dev e1000
XDP_action pps pps-human-readable mem
XDP_DROP 671975 671,975 read
XDP_DROP 671997 671,997 read
XDP_DROP 672061 672,061 read
XDP_DROP 671861 671,861 read
^CInterrupted: Removing XDP program on ifindex:2 device:e1000
$ sudo ./xdp_bench01_mem_access_cost --readmem --action XDP_PASS --dev e1000
XDP_action pps pps-human-readable mem
XDP_PASS 672032 672,032 read
XDP_PASS 671910 671,910 read
XDP_PASS 671926 671,926 read
XDP_PASS 671947 671,947 read
^CInterrupted: Removing XDP program on ifindex:2 device:e1000
Program xdp_bench01_mem_access_cost avail here:
https://github.com/netoptimizer/prototype-kernel/tree/master/kernel/samples/bpf
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer