Hi David,
Thanks for the comment.
On Thu, Dec 17, 2020 at 09:07:03AM -0700, David Ahern wrote:
quoted
+ return n - nframes; /* dropped frames count */
just return nframes here, since ...
quoted
+ 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
quoted
+ 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