]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: Increment Tx stats at sending
authorMagnus Karlsson <magnus.karlsson@intel.com>
Mon, 16 Nov 2020 11:12:43 +0000 (12:12 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 17 Nov 2020 21:07:40 +0000 (22:07 +0100)
commit3ffa75206f4ccf857e28aa6d676b767e56435293
tree26b7122be1f5a4f8e196a184581404e95a0ee844
parent0e43714fedc77bff3b09a339c6f61a56ca5f1f43
samples/bpf: Increment Tx stats at sending

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@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/1605525167-14450-2-git-send-email-magnus.karlsson@gmail.com
samples/bpf/xdpsock_user.c