Re: [PATCHv12 bpf-next 1/6] bpf: run devmap xdp_prog on flush instead of bulk enqueue

Hangbin Liu
2020-12-18T09:44:46Z

Hi David,

Thanks for the comment.

On Thu, Dec 17, 2020 at 09:07:03AM -0700, David Ahern wrote:
> > + return n - nframes; /* dropped frames count */
>
> just return nframes here, since ...
>
> > + xdp_drop = dev_map_bpf_prog_run(bq->xdp_prog, bq->q, cnt, dev);
> > + cnt -= xdp_drop;
>
> ... that is apparently what you really want.

I will fix this

> > + if (dst && dst->xdp_prog && !bq->xdp_prog)
> > + bq->xdp_prog = dst->xdp_prog;
>
>
> if you pass in xdp_prog through __xdp_enqueue you can reduce that to just:
>
> if (!bq->xdp_prog)
> bq->xdp_prog = xdp_prog;

And this in the next PATCH version.

Thanks
Hangbin