<commit_before>Byte Queue Limits monitor
========================

This program uses the Linux Byte Queue Limits support that some Linux Ethernet
drivers do support. Byte Queue Limits is refered to below as BQL. The program
provides a ncurses interface to monitor the current number of bytes in-flight in
the queue.

Motivation for this program was twofold:
- make sure that the Broadcom SYSTEMPORT driver did have correct BQL mechanism
  as I was writing it
- experiment and do something potentially useful with ncurses

BQL in a nutshell
=================

BQL basically keeps track of how many bytes are in-flight, that are pending
transmission in a given Ethernet adapter hardware queue. The more information
about the actual hardware queue state we have, the better for software to
accomodate with transmission of network packets.

Ethernet drivers implementing that feature usually do the following in their
transmit function:

- prepare the buffer for transmission
- tell the network stack how many bytes are being sent (netdev_tx_sent_queue)
- tell the hardware the buffer should be transmitted

In their transmit complete function they do the following:

- free the transmit buffers
- count how many packets and bytes have been transmitted
- report how many packets and bytes have been completed
  (netdev_tx_completed_queue)
- free the buffers

Accurate reporting of how many buffers are in-flight allows for a better sizing
of all software queueing.

Using BQL also allows highlighting potential transmit queueing and flow control
issues. For instance, if the transmitted buffers are reclaimed in an interrupt
context, but that interrupt never fires, we will quickly queue up many buffers
that are not freed.

BQL exposes a few sysfs attributes in
/sys/class/net/<interface>/tx-<queue>/byte_queue_limits which are per-queue
information about:

- in-flight packets
- limit threshold until the queue is declared congested
- hold time
--
<NAME><commit_msg>BQLmon: fix a small README.md rendering issue<commit_after>Byte Queue Limits monitor
========================

This program uses the Linux Byte Queue Limits support that some Linux Ethernet
drivers do support. Byte Queue Limits is refered to below as BQL. The program
provides a ncurses interface to monitor the current number of bytes in-flight in
the queue.

Motivation for this program was twofold:
- make sure that the Broadcom SYSTEMPORT driver did have correct BQL mechanism
  as I was writing it
- experiment and do something potentially useful with ncurses

BQL in a nutshell
=================

BQL basically keeps track of how many bytes are in-flight, that are pending
transmission in a given Ethernet adapter hardware queue. The more information
about the actual hardware queue state we have, the better for software to
accomodate with transmission of network packets.

Ethernet drivers implementing that feature usually do the following in their
transmit function:

- prepare the buffer for transmission
- tell the network stack how many bytes are being sent (netdev_tx_sent_queue)
- tell the hardware the buffer should be transmitted

In their transmit complete function they do the following:

- free the transmit buffers
- count how many packets and bytes have been transmitted
- report how many packets and bytes have been completed
  (netdev_tx_completed_queue)
- free the buffers

Accurate reporting of how many buffers are in-flight allows for a better sizing
of all software queueing.

Using BQL also allows highlighting potential transmit queueing and flow control
issues. For instance, if the transmitted buffers are reclaimed in an interrupt
context, but that interrupt never fires, we will quickly queue up many buffers
that are not freed.

BQL exposes a few sysfs attributes in
/sys/class/net/<interface>/tx-<queue>/byte_queue_limits which are per-queue
information about:

- in-flight packets
- limit threshold until the queue is declared congested
- hold time

--
<NAME>
{'fraction_non_alphanumeric': 0.04948245392577632, 'fraction_numerical': 0.0, 'mean_word_length': 4.700719424460432, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1130266', 'n_tokens_mistral': 975, 'n_tokens_neox': 932, 'n_words': 563}