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

Magnus Karlsson magnus.karlsson at gmail.com
Tue Nov 10 07:12:54 UTC 2020

On Mon, Nov 9, 2020 at 9:47 PM John Fastabend <john.fastabend at gmail.com> wrote:
> 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?

That is correct.

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

More information about the Intel-wired-lan mailing list