samples/bpf: Consider frame size in tx_only of xdpsock sample
authorMagnus Karlsson <magnus.karlsson@intel.com>
Thu, 6 May 2021 12:43:49 +0000 (14:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 07:00:51 +0000 (09:00 +0200)
commitbc924bbccc50f28d9b9dc43dd747a43044e0130f
tree0cf63f5d568feab30e69ffe65b2f42510ce49d48
parent02ce4c943e2ed7660786d3618afadf27b61b0758
samples/bpf: Consider frame size in tx_only of xdpsock sample

commit 3b80d106e110d39d3f678954d3b55078669cf07e upstream.

Fix the tx_only micro-benchmark in xdpsock to take frame size into
consideration. It was hardcoded to the default value of frame_size
which is 4K. Changing this on the command line to 2K made half of the
packets illegal as they were outside the umem and were therefore
discarded by the kernel.

Fixes: 46738f73ea4f ("samples/bpf: add use of need_wakeup flag in xdpsock")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/bpf/20210506124349.6666-1-magnus.karlsson@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
samples/bpf/xdpsock_user.c