STRUCT EF4_TX_QUEUE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct ef4_tx_queue(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual page for struct ef4_tx_queue β€” aka "An Efx TX queue" ✨ this is the whole glow-up of one TX queue, every field laid out, and honestly it's giving main character energy for the falcon driver πŸ¦‹


πŸŽ€ NAME πŸŽ€

struct ef4_tx_queue β€” An Efx TX queue πŸ‘‘


✨ SYNOPSIS ✨

here's the whole struct, copied exactly, don't touch a single character bestie πŸ’…

struct ef4_tx_queue {
    struct ef4_nic *efx;
    unsigned queue;
    struct ef4_channel *channel;
    struct netdev_queue *core_txq;
    struct ef4_tx_buffer *buffer;
    struct ef4_buffer *cb_page;
    struct ef4_special_buffer txd;
    unsigned int ptr_mask;
    bool initialised;
    unsigned int tx_min_size;
    int (*handle_tso)(struct ef4_tx_queue*, struct sk_buff*, bool *);
    unsigned int read_count;
    unsigned int old_write_count;
    unsigned int merge_events;
    unsigned int bytes_compl;
    unsigned int pkts_compl;
    unsigned int insert_count;
    unsigned int write_count;
    unsigned int old_read_count;
    unsigned int pushes;
    bool xmit_more_available;
    unsigned int cb_packets;
    unsigned long tx_packets;
    unsigned int empty_read_count;
  #define EF4_EMPTY_COUNT_VALID 0x80000000;
    atomic_t flush_outstanding;
};

🌸 Members 🌸

  • efx β€” the Efx NIC this queue is attached to 🫢
  • queue β€” the DMA queue number πŸ”’
  • channel β€” the associated channel πŸ’«
  • core_txq β€” the networking core TX queue structure, like the netdev's own bookkeeping for this queue πŸ““
  • buffer β€” the software buffer ring 🧚
  • cb_page β€” array of pages of copy buffers. it gets carved up according to EF4_TX_CB_ORDER into EF4_TX_CB_SIZE-sized chunks 🍰 (yes, sliced like a cake, no cap)
  • txd β€” the hardware descriptor ring πŸ’€ the real one
  • ptr_mask β€” the size of the ring minus 1. classic mask move, iconic
  • initialised β€” has the hardware queue been initialised? πŸ€” yes/no vibes only
  • tx_min_size β€” minimum transmit size for this queue. it depends on HW, so don't come for her 🫢
  • read_count β€” current read pointer. this is the number of buffers that have been removed from both rings πŸ‘€
  • old_write_count β€” the value of write_count when last checked. this is here for performance reasons. the xmit path will only get the up-to-date value of write_count if this variable indicates that the queue is empty. this is to avoid cache-line ping-pong between the xmit path and the completion path πŸ“ (yes literally ping-pong, that's the actual term, iykyk)
  • merge_events β€” number of TX merged completion events πŸ”₯
  • insert_count β€” current insert pointer. this is the number of buffers that have been added to the software ring 🧺
  • write_count β€” current write pointer. this is the number of buffers that have been added to the hardware ring πŸ’Ύ
  • old_read_count β€” the value of read_count when last checked. this is here for performance reasons. the xmit path will only get the up-to-date value of read_count if this variable indicates that the queue is full. this is to avoid cache-line ping-pong between the xmit path and the completion path πŸ“ again. same energy, opposite condition, obsessed
  • pushes β€” number of times the TX push feature has been used πŸ‘Ÿ
  • xmit_more_available β€” are any packets waiting to be pushed to the NIC? πŸ“¬
  • cb_packets β€” number of times the TX copybreak feature has been used πŸ“¦
  • empty_read_count β€” if the completion path has seen the queue as empty and the transmission path has not yet checked this, then it's the value of read_count bitwise-added to EF4_EMPTY_COUNT_VALID; otherwise 0 🫠
ngl, the struct also carries handle_tso, bytes_compl, pkts_compl and flush_outstanding β€” they're up there in the synopsis fr fr, this Members list just doesn't say anything about them. no cap, that's literally all the page gives you πŸ’€

πŸ’œ Description πŸ’œ

so what actually is this thing? it's a ring buffer of TX fragments πŸŒ€ periodt.

since the TX completion path always executes on the same CPU, but the xmit path can operate on different CPUs, performance gets increased by ensuring that the completion path and the xmit path operate on different cache lines 🧠✨ this is particularly important if the xmit path is always executing on one CPU which is different from the completion path. like, highkey crucial πŸ™

there's also a cache line for members which are read but not written on the fast path πŸ‘‘ everyone gets their own space, no crowding, we love boundaries.


πŸ¦‹ SEE ALSO πŸ¦‹

  • kernel file ./drivers/net/ethernet/sfc/falcon/net_driver.h
  • struct ef4_buffer(9)
  • struct ef4_special_buffer(9)
  • struct ef4_tx_buffer(9)
  • struct ef4_rx_buffer(9)
  • struct ef4_rx_page_state(9)
  • struct ef4_rx_queue(9)
  • struct ef4_channel(9)
  • struct ef4_msi_context(9)
  • struct ef4_channel_type(9)
  • struct ef4_link_state(9)
  • struct ef4_phy_operations(9)
  • enum ef4_phy_mode(9)
  • struct ef4_hw_stat_desc(9)
  • struct ef4_nic(9)
  • struct ef4_nic_type(9)

and that's the whole page bestie, go forth and read those TX fragments πŸ’–

this icon was brought to you by ./drivers/net/ethernet/sfc/falcon, dated October 2026, and it says struct ef4_tx_queue(9) at the bottom like a little signature πŸŽ€ mwah πŸ’‹

πŸ“¦ where this page comes from