On Thu, Apr 08, 2021 at 02:51:01PM +0200, Lorenzo Bianconi wrote: > From: Eelco Chaudron <echaudro@xxxxxxxxxx> > > This patch adds support for multi-buffer for the following helpers: > - bpf_xdp_output() > - bpf_perf_event_output() > > Signed-off-by: Eelco Chaudron <echaudro@xxxxxxxxxx> > Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx> > --- > diff --git a/tools/testing/selftests/bpf/progs/test_xdp_bpf2bpf.c b/tools/testing/selftests/bpf/progs/test_xdp_bpf2bpf.c > index a038e827f850..d5a5f603d252 100644 > --- a/tools/testing/selftests/bpf/progs/test_xdp_bpf2bpf.c > +++ b/tools/testing/selftests/bpf/progs/test_xdp_bpf2bpf.c > @@ -27,6 +27,7 @@ struct xdp_buff { > void *data_hard_start; > unsigned long handle; > struct xdp_rxq_info *rxq; > + __u32 frame_length; This patch will not work without patch 10, so could you change the order? > } __attribute__((preserve_access_index)); > > struct meta { > @@ -49,7 +50,7 @@ int BPF_PROG(trace_on_entry, struct xdp_buff *xdp) > void *data = (void *)(long)xdp->data; > > meta.ifindex = xdp->rxq->dev->ifindex; > - meta.pkt_len = data_end - data; > + meta.pkt_len = xdp->frame_length; > bpf_xdp_output(xdp, &perf_buf_map, > ((__u64) meta.pkt_len << 32) | > BPF_F_CURRENT_CPU, > -- > 2.30.2 >