Re: [bpf-next V4 PATCH 3/8] xdp: add tracepoint for devmap like cpumap have

Jesper Dangaard Brouer
2018-05-23T15:04:58Z

On Wed, 23 May 2018 07:24:03 -0700
John Fastabend <john.fastabend@gmail.com> wrote:

> > @@ -219,8 +221,8 @@ void __dev_map_insert_ctx(struct bpf_map *map, u32 bit)
> > static int bq_xmit_all(struct bpf_dtab_netdev *obj,
> > struct xdp_bulk_queue *bq)
> > {
> > - unsigned int processed = 0, drops = 0;
> > struct net_device *dev = obj->dev;
> > + int sent = 0, drops = 0;
> > int i;
> >
> > if (unlikely(!bq->count))
> > @@ -241,10 +243,13 @@ static int bq_xmit_all(struct bpf_dtab_netdev *obj,
> > drops++;
> > xdp_return_frame(xdpf);
> > }
> > - processed++;
> > + sent++;
>
> Do 'dropped' frames also get counted as 'sent' frames? This seems a bit
> counter-intuitive to me. Should it be 'drops+sent = total frames'
> instead?

Again, sorry for mixing this up when spliting up the patch. The
patchset does end up with: 'drops+sent = total frames'. (The
"processed" counter is a copy-paste of code from cpumap, which have
another semantics). I'll clean it up in V5, to help reviewers.

--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer