driver_stat.md

May 6, 2025 ยท View on GitHub

Comprehensive statistics are offered at the driver level via the Linux sysfs.

[Quick start] [Sysfs explanation] [Statistics variable file meaning]

All operations should be done on board in openwifi directory, not in host PC.

Quick start

Enable the driver level statistics (after openwifi up and running)

./stat_enable.sh

Show the statistics

./tx_stat_show.sh
./tx_prio_queue_show.sh
./rx_stat_show.sh
./rx_gain_show.sh

Clear the stattistics

./tx_stat_show.sh clear
./tx_prio_queue_show.sh clear
./rx_stat_show.sh clear

Let rx_stat_show.sh calculate PER (Packet Error Rate) by giving the number of packet sent at the peer (30000 packets for example):

./rx_stat_show.sh 30000

To only show the statistics for the link with a specific peer node

./set_rx_target_sender_mac_addr.sh c83caf93
(If the peer node MAC address is 00:80:c8:3c:af:93)

To show the statistics of all (not filtered by the peer node MAC address)

./set_rx_target_sender_mac_addr.sh 0

To show the peer node MAC address for statistics

./set_rx_target_sender_mac_addr.sh

To see the statistics of ACK packet, run this before above scripts

./set_rx_monitor_all.sh

Disable the statistics of ACK packet, run this before above scripts

./set_rx_monitor_all.sh 0

Disable the driver level statistics (after openwifi up and running)

./stat_enable.sh 0

Sysfs explanation

For user, as you can check in those scripts above, the sysfs is a set of files that can be operated in the command line for communicating with kernel module. You can find these files on zcu102 board at

/sys/devices/platform/fpga-axi@0/fpga-axi@0:sdr

On othe boards at

/sys/devices/soc0/fpga-axi@0/fpga-axi@0:sdr

Statistics variable file meaning

These statistics names are the same as the file names (in those scripts) and variable names in the sdr.c. Do search these names in sdr.c to understand exact meaning of these statistics.

  • tx_stat_show.sh

    namemeaning
    tx_data_pkt_need_ack_num_totalnumber of tx data packet reported in openwifi_tx_interrupt() (both fail and succeed)
    tx_data_pkt_need_ack_num_total_failnumber of tx data packet reported in openwifi_tx_interrupt() (fail -- no ACK received)
    tx_data_pkt_need_ack_num_retxnumber of tx data packet reported in openwifi_tx_interrupt() at different number of retransmission (both fail and succeed)
    tx_data_pkt_need_ack_num_retx_failnumber of tx data packet reported in openwifi_tx_interrupt() at different number of retransmission (fail -- no ACK received)
    tx_data_pkt_mcs_realtimeMCS (10*Mbps) of tx data packet reported in openwifi_tx_interrupt() (both fail and succeed)
    tx_data_pkt_fail_mcs_realtimeMCS (10*Mbps) of tx data packet reported in openwifi_tx_interrupt() (fail -- no ACK received)
    tx_mgmt_pkt_need_ack_num_totalnumber of tx management packet reported in openwifi_tx_interrupt() (both fail and succeed)
    tx_mgmt_pkt_need_ack_num_total_failnumber of tx management packet reported in openwifi_tx_interrupt() (fail -- no ACK received)
    tx_mgmt_pkt_need_ack_num_retxnumber of tx management packet reported in openwifi_tx_interrupt() at different number of retransmission (both fail and succeed)
    tx_mgmt_pkt_need_ack_num_retx_failnumber of tx management packet reported in openwifi_tx_interrupt() at different number of retransmission (fail -- no ACK received)
    tx_mgmt_pkt_mcs_realtimeMCS (10*Mbps) of tx management packet reported in openwifi_tx_interrupt() (both fail and succeed)
    tx_mgmt_pkt_fail_mcs_realtimeMCS (10*Mbps) of tx management packet reported in openwifi_tx_interrupt() (fail -- no ACK received)
  • tx_prio_queue_show.sh

    tx_prio_queue_show.sh will show 4 rows. Each row is corresponding one Linux-prio and one FPGA queue. Each row has 12 elements. Elements' name will not be displayed in the command line.

    Element namemeaning
    tx_prio_numnumber of tx packet from Linux prio N to openwifi_tx()
    tx_prio_interrupt_numnumber of tx packet from Linux prio N recorded in openwifi_tx_interrupt()
    tx_prio_stop0_fake_numnumber of Linux prio N stopped attempt in the 1st place of openwfii_tx(), fake alarm
    tx_prio_stop0_real_numnumber of Linux prio N stopped attempt in the 1st place of openwfii_tx(), real stop
    tx_prio_stop1_numnumber of Linux prio N stopped in the 2nd place of openwfii_tx()
    tx_prio_wakeup_numnumber of Linux prio N waked up in openwifi_tx_interrupt()
    tx_queue_numnumber of tx packet for FPGA queue N to openwifi_tx()
    tx_queue_interrupt_numnumber of tx packet for FPGA queue N recorded in openwifi_tx_interrupt()
    tx_queue_stop0_fake_numnumber of FPGA queue N stopped attempt in the 1st place of openwfii_tx(), fake alarm
    tx_queue_stop0_real_numnumber of FPGA queue N stopped attempt in the 1st place of openwfii_tx(), real stop
    tx_queue_stop1_numnumber of FPGA queue N stopped in the 2nd place of openwfii_tx()
    tx_queue_wakeup_numnumber of FPGA queue N waked up in openwifi_tx_interrupt()
  • rx_stat_show.sh

    namemeaning
    rx_data_pkt_num_totalnumber of rx data packet with both FCS ok and failed
    rx_data_pkt_num_failnumber of rx data packet with FCS failed
    rx_mgmt_pkt_num_totalnumber of rx management packet with both FCS ok and failed
    rx_mgmt_pkt_num_failnumber of rx management packet with FCS failed
    rx_ack_pkt_num_totalnumber of rx ACK packet with both FCS ok and failed
    rx_ack_pkt_num_failnumber of rx ACK packet with FCS failed
    rx_data_pkt_mcs_realtimeMCS (10*Mbps) of rx data packet with both FCS ok and failed
    rx_data_pkt_fail_mcs_realtimeMCS (10*Mbps) of rx data packet with FCS failed
    rx_mgmt_pkt_mcs_realtimeMCS (10*Mbps) of rx management packet with both FCS ok and failed
    rx_mgmt_pkt_fail_mcs_realtimeMCS (10*Mbps) of rx management packet with FCS failed
    rx_ack_pkt_mcs_realtimeMCS (10*Mbps) of rx ACK packet with both FCS ok and failed
    rx_data_ok_agc_gain_value_realtimeagc gain value of rx data packet with FCS ok
    rx_data_fail_agc_gain_value_realtimeagc gain value of rx data packet with FCS failed
    rx_mgmt_ok_agc_gain_value_realtimeagc gain value of rx management packet with FCS ok
    rx_mgmt_fail_agc_gain_value_realtimeagc gain value of rx management packet with FCS failed
    rx_ack_ok_agc_gain_value_realtimeagc gain value of rx ACK packet with FCS ok
  • rx_gain_show.sh

    namemeaning
    rx_data_ok_agc_gain_value_realtimeagc gain value of rx data packet with FCS ok
    rx_data_fail_agc_gain_value_realtimeagc gain value of rx data packet with FCS failed
    rx_mgmt_ok_agc_gain_value_realtimeagc gain value of rx management packet with FCS ok
    rx_mgmt_fail_agc_gain_value_realtimeagc gain value of rx management packet with FCS failed
    rx_ack_ok_agc_gain_value_realtimeagc gain value of rx ACK packet with FCS ok

    Note: gain value here is always 14 dB higher than set_rx_gain_auto.sh/set_rx_gain_manual.sh at 5220MHz. 5dB higher at 2.4GHz.