samples/bpf: xdpsock: Add sched policy and priority support
authorOng Boon Leong <boon.leong.ong@intel.com>
Thu, 30 Dec 2021 03:54:45 +0000 (11:54 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 6 Jan 2022 01:53:24 +0000 (17:53 -0800)
commitfa24d0b1d57825d1a5b802339728d4d8ac20b6d6
tree5db80a9d5c2bb65645e469d2b665bc23fcedc265
parentfa0d27a1d5a8c1f07b0229348b0d178233694fbc
samples/bpf: xdpsock: Add sched policy and priority support

By default, TX schedule policy is SCHED_OTHER (round-robin time-sharing).
To improve TX cyclic scheduling, we add SCHED_FIFO policy and its priority
by using -W FIFO or --policy=FIFO and -U <PRIO> or --schpri=<PRIO>.

A) From xdpsock --app-stats, for SCHED_OTHER policy:
   $ xdpsock -i eth0 -t -N -z -T 1000 -b 16 -C 100000 -a

                      period     min        ave        max        cycle
   Cyclic TX          1000000    53507      75334      712642     6250

B) For SCHED_FIFO policy and schpri=50:
   $ xdpsock -i eth0 -t -N -z -T 1000 -b 16 -C 100000 -a -W FIFO -U 50

                      period     min        ave        max        cycle
   Cyclic TX          1000000    3699       24859      54397      6250

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-6-boon.leong.ong@intel.com
samples/bpf/xdpsock_user.c