David Ahern <dsah...@gmail.com> writes: > On 5/27/20 4:01 AM, Toke Høiland-Jørgensen wrote: >> Did you give any special consideration to where the hook should be? I'm >> asking because my immediate thought was that it should be on flush >> (i.e., in bq_xmit_all()), but now that I see this I'm so sure anymore. >> What were your thoughts around this? > > I chose this spot for many reasons: > > 1. dev_map_enqueue has the bpf_dtab_netdev structure which holds the program > > 2. programs take xdp_buff, and dev_map_enqueue still has the xdp_buff > with the rx information; no need to convert from buff to frame losing rx > data, enqueue, back to buff to run program, back to frame to hand off to > the driver. > > 3. no sense enqueuing if the device program drops the frame.
Right, makes sense; thank you for explaining :) -Toke