]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: xdpsock: Add time-out for cleaning Tx
authorOng Boon Leong <boon.leong.ong@intel.com>
Thu, 30 Dec 2021 03:54:46 +0000 (11:54 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 6 Jan 2022 01:53:24 +0000 (17:53 -0800)
commitde0ea6f88b883378a723820f7bcd402b247486e9
tree2a574f00c7c099238006f01b3ba286893484b750
parentc43bd64caf344633c5ab0ddf4477922b6e6a9bc5
samples/bpf: xdpsock: Add time-out for cleaning Tx

When user sets tx-pkt-count and in case where there are invalid Tx frame,
the complete_tx_only_all() process polls indefinitely. So, this patch
adds a time-out mechanism into the process so that the application
can terminate automatically after it retries 3*polling interval duration.

v1->v2:
 Thanks to Jesper's and Song Liu's suggestion.
 - clean-up git message to remove polling log
 - make the Tx time-out retries configurable with 1s granularity

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211230035447.523177-7-boon.leong.ong@intel.com
samples/bpf/xdpsock_user.c