Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples/bpf: xdpsock app enhancements #2348

Closed
wants to merge 8 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: samples/bpf: xdpsock app enhancements
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963

@kernel-patches-bot
Copy link
Author

Master branch: 1705c62
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 35580f9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 35580f9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 63d000c
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 11f9983
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 9e6b19a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: e63a023
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 5e22dd1
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 218d747
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: ca796fe
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: ca796fe
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 58d8a3f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: a5bebc4
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 2847993
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 2847993
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 7218c28
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

@kernel-patches-bot
Copy link
Author

Master branch: 51a33c6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

Nobody and others added 5 commits January 5, 2022 16:14
In multi-queue environment testing, the support for VLAN-tag based
steering is useful. So, this patch adds the capability to add
VLAN tag (VLAN ID and Priority) to the generated Tx frame.

To set the VLAN ID=10 and Priority=2 for Tx only through TxQ=3:
 $ xdpsock -i eth0 -t -N -z -q 3 -V -J 10 -K 2

If VLAN ID (-J) and Priority (-K) is set, it default to
  VLAN ID = 1
  VLAN Priority = 0.

For example, VLAN-tagged Tx only, xdp copy mode through TxQ=1:
 $ xdpsock -i eth0 -t -N -c -q 1 -V

Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
To set Dest MAC address (-G|--tx-dmac) only:
 $ xdpsock -i eth0 -t -N -z -G aa:bb:cc:dd:ee:ff

To set Source MAC address (-H|--tx-smac) only:
 $ xdpsock -i eth0 -t -N -z -H 11:22:33:44:55:66

To set both Dest and Source MAC address:
 $ xdpsock -i eth0 -t -N -z -G aa:bb:cc:dd:ee:ff \
   -H 11:22:33:44:55:66

The default Dest and Source MAC address remain the same as before.

Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
User specifies the clock selection by using -w CLOCK or --clock=CLOCK
where CLOCK=[REALTIME, TAI, BOOTTIME, MONOTONIC].

The default CLOCK selection is MONOTONIC.

The implementation of clock selection parsing is borrowed from
iproute2/tc/q_taprio.c

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Tx cycle time is in micro-seconds unit. By combining the batch size (-b M)
and Tx cycle time (-T|--tx-cycle N), xdpsock now can transmit batch-size of
packets every N-us periodically. Cyclic TX operation is not applicable if
--poll mode is used.

To transmit 16 packets every 1ms cycle time for total of 100000 packets
silently:
 $ xdpsock -i eth0 -T -N -z -T 1000 -b 16 -C 100000

To print cyclic TX schedule variance stats, use --app-stats|-a:
 $ xdpsock -i eth0 -T -N -z -T 1000 -b 16 -C 100000 -a

 sock0@eth0:0 txonly xdp-drv
                   pps            pkts           0.00
rx                 0              0
tx                 0              100000

                   calls/s        count
rx empty polls     0              0
fill fail polls    0              0
copy tx sendtos    0              0
tx wakeup sendtos  0              6254
opt polls          0              0

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

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
@kernel-patches-bot
Copy link
Author

Master branch: 5f60826
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=601963
version: 2

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>
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>
It may be useful to add timestamp for Tx packets for continuous or cyclic
transmit operation. The timestamp and sequence ID of a Tx packet are
stored according to pktgen header format. To enable per-packet timestamp,
use -y|--tstamp option. If timestamp is off, pktgen header is not
included in the UDP payload. This means receiving side can use the magic
number for pktgen for differentiation.

The implementation supports both VLAN tagged and untagged option. By
default, the minimum packet size is set at 64B. However, if VLAN tagged
is on (-V), the minimum packet size is increased to 66B just so to fit
the pktgen_hdr size.

Added hex_dump() into the code path just for future cross-checking.
As before, simply change to "#define DEBUG_HEXDUMP 1" to inspect the
accuracy of TX packet.

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=601963 irrelevant now. Closing PR.

@kernel-patches-bot kernel-patches-bot deleted the series/585069=>bpf-next branch January 6, 2022 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants