]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: Fix one packet sending in xdpsock
authorMagnus Karlsson <magnus.karlsson@intel.com>
Thu, 10 Sep 2020 08:31:04 +0000 (10:31 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 15 Sep 2020 01:38:11 +0000 (18:38 -0700)
commitd6f83abd803d56feb088bdbe26ed14a6e9619e80
treeae29ca1e0953972061cd7548512b23489ae0d4a1
parent81f9f1eb6829e0f0c9aeaf9ce093efccbf8cbdb1
samples/bpf: Fix one packet sending in xdpsock

Fix the sending of a single packet (or small burst) in xdpsock when
executing in copy mode. Currently, the l2fwd application in xdpsock
only transmits the packets after a batch of them has been received,
which might be confusing if you only send one packet and expect that
it is returned pronto. Fix this by calling sendto() more often and add
a comment in the code that states that this can be optimized if
needed.

Reported-by: Tirthendu Sarkar <tirthendu.sarkar@intel.com>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/1599726666-8431-2-git-send-email-magnus.karlsson@gmail.com
samples/bpf/xdpsock_user.c