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

Support for XDP stats #20

Open
dsahern opened this issue May 14, 2020 · 5 comments
Open

Support for XDP stats #20

dsahern opened this issue May 14, 2020 · 5 comments

Comments

@dsahern
Copy link

dsahern commented May 14, 2020

XDP is the name for running ebpf programs in a driver on packets before the stack sees them. Packets can be redirected to another device, transmitted back out the device they arrived on or allowed to proceed up the stack. XDP stats are typically separate. Given ethq's purpose (showing per queue driver stats) It would be a great extension to support XDP stats. I'll post data for drivers as individual messages

@dsahern
Copy link
Author

dsahern commented May 14, 2020

XDP stats for mlx5 driver, 4.7 kernel.
$ ethtool -i eth0
driver: mlx5_core
version: 5.0-0
firmware-version: 14.27.1016 (MT_2420110034)
expansion-rom-version:
bus-info: 0000:d8:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes

Example of per-queue XDP stats (from ethtool -S eth0 | grep xdp):
rx_xdp_drop: 0
rx_xdp_redirect: 59031087
rx_xdp_tx_xmit: 0
rx_xdp_tx_mpwqe: 0
rx_xdp_tx_inlnw: 0
rx_xdp_tx_nops: 0
rx_xdp_tx_full: 0
rx_xdp_tx_err: 0
rx_xdp_tx_cqe: 0
tx_xdp_xmit: 0
tx_xdp_mpwqe: 0
tx_xdp_inlnw: 0
tx_xdp_nops: 0
tx_xdp_full: 0
tx_xdp_err: 0
tx_xdp_cqes: 0
rx_xsk_xdp_drop: 0
rx_xsk_xdp_redirect: 0
rx0_xdp_drop: 0
rx0_xdp_redirect: 0
rx0_xdp_tx_xmit: 0
rx0_xdp_tx_mpwqe: 0
rx0_xdp_tx_inlnw: 0
rx0_xdp_tx_nops: 0
rx0_xdp_tx_full: 0
rx0_xdp_tx_err: 0
rx0_xdp_tx_cqes: 0
.... repeat for all queues ...
tx0_xdp_xmit: 0
tx0_xdp_mpwqe: 0
tx0_xdp_inlnw: 0
tx0_xdp_nops: 0
tx0_xdp_full: 0
tx0_xdp_err: 0
tx0_xdp_cqes: 0
.... repeat for all queues ...

Relevant counters of interest to this tool are:
rx0_xdp_redirect - packets received on this queue and redirected to another device
rx0_xdp_tx_xmit - packets received on this queue and transmitted out the device
tx0_xdp_xmit - packets forwarded to this device and queue from XDP context for xmit

{r,t}x0_xdp_tx_full, {r,t}x0_xdp_tx_err are useful too for seeing error conditions

@dsahern
Copy link
Author

dsahern commented May 14, 2020

XDP stats, solarflare sfc driver:
$ ethtool -i eth0
driver: sfc
version: 4.1
firmware-version: 6.2.7.1000 rx0 tx0
expansion-rom-version:
bus-info: 0000:82:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

 rx_xdp_drops: 0
 rx_xdp_bad_drops: 0
 rx_xdp_tx: 0
 rx_xdp_redirect: 0
 tx-xdp-cpu-0.tx_packets: 0
 ... repeats for each cpu ...

Unfortunately, not per queue for Rx. I will reach out to them about it

@dsahern
Copy link
Author

dsahern commented May 14, 2020

XDP stats for virtio net driver:

ethtool -i eth0

driver: virtio_net
version: 1.0.0
firmware-version:
expansion-rom-version:
bus-info: 0000:00:03.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

ethtool -S eth0

NIC statistics:
rx_queue_0_packets: 1158589154
rx_queue_0_bytes: 3578142677756
rx_queue_0_drops: 0
rx_queue_0_xdp_packets: 0
rx_queue_0_xdp_tx: 0
rx_queue_0_xdp_redirects: 0
rx_queue_0_xdp_drops: 0
rx_queue_0_kicks: 4103726
tx_queue_0_packets: 42637406
tx_queue_0_bytes: 2871089779
tx_queue_0_xdp_tx: 0
tx_queue_0_xdp_tx_drops: 0
tx_queue_0_kicks: 16255054

My VM only has 1 queue hence only queue_0 shown above.

@netoptimizer
Copy link

Loop in @LorenzoBianconi

On the kernel side we are planning to make these XDP counters more consistent across driver.

@raybellis
Copy link
Collaborator

I'm not sure how to handle this, and I don't have a system with XDP that I can test it with.

If every driver really does make its XDP counter names consistent that would help, otherwise I'm going to need a special XDP mode that shows those counters instead of the normal interface counters, along with additional RegExes to match the patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants