[Intel-wired-lan] [PATCH bpf-next 2/6] samples/bpf: increment Tx stats at sending

John Fastabend john.fastabend at gmail.com
Mon Nov 9 20:47:32 UTC 2020

Magnus Karlsson wrote:
> From: Magnus Karlsson <magnus.karlsson at intel.com>
> Increment the statistics over how many Tx packets have been sent at
> the time of sending instead of at the time of completion. This as a
> completion event means that the buffer has been sent AND returned to
> user space. The packet always gets sent shortly after sendto() is
> called. The kernel might, for performance reasons, decide to not
> return every single buffer to user space immediately after sending,
> for example, only after a batch of packets have been
> transmitted. Incrementing the number of packets sent at completion,
> will in that case be confusing as if you send a single packet, the
> counter might show zero for a while even though the packet has been
> transmitted.
> Signed-off-by: Magnus Karlsson <magnus.karlsson at intel.com>
> ---

LGTM. Just one question then if we wanted to know the old value, packet
completion counter it looks like (tx_npkts - outstanding_tx) would give
that value?

Acked-by: John Fastabend <john.fastabend at gmail.com>

More information about the Intel-wired-lan mailing list