STRUCT VFDI_REQ(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct vfdi_req(9) πŸ’…

okay bestie, welcome to the Kernel API Manual ✨ β€” yes that's the whole manual name, we're fancy here. This page is all about struct vfdi_req, and no cap, it's a whole vibe.


🌸 NAME 🌸

struct vfdi_req β€” literally the request that goes from the VF driver to the PF driver 🫢


✨ SYNOPSIS ✨

struct vfdi_req {
    u32 op;
    u32 reserved1;
    s32 rc;
    u32 reserved2;
    union {
      struct {
        u32 index;
        u32 buf_count;
        u64 addr[];
      } init_evq;
      struct {
        u32 index;
        u32 buf_count;
        u32 evq;
        u32 label;
        u32 flags;
  #define VFDI_RXQ_FLAG_SCATTER_EN 1;
        u32 reserved;
        u64 addr[];
      } init_rxq;
      struct {
        u32 index;
        u32 buf_count;
        u32 evq;
        u32 label;
        u32 flags;
  #define VFDI_TXQ_FLAG_IP_CSUM_DIS 1;
  #define VFDI_TXQ_FLAG_TCPUDP_CSUM_DIS 2;
        u32 reserved;
        u64 addr[];
      } init_txq;
      struct {
        u32 rxq;
        u32 flags;
  #define VFDI_MAC_FILTER_FLAG_RSS 1;
  #define VFDI_MAC_FILTER_FLAG_SCATTER 2;
      } mac_filter;
      struct {
        u64 dma_addr;
        u64 peer_page_count;
        u64 peer_page_addr[];
      } set_status_page;
    } u;
 };

it's giving "one struct to rule them all" πŸ‘‘ β€” everything lives inside that big union u, so it's a pick-one-situation, iykyk πŸ’…


πŸŽ€ Members πŸŽ€

  • op β€” the operation code or response indicator, taken straight from enum vfdi_op ✨
  • rc β€” the response code. set it to 0 when it slayed (success), or a negative error code when it did not πŸ’€

πŸ¦‹ the init_evq branch πŸ¦‹

  • u.init_evq.index β€” which event queue to create, by index
  • u.init_evq.buf_count β€” how many 4k buffers are backing that event queue
  • u.init_evq.addr β€” array of length u.init_evq.buf_count, holding the DMA address of every page backing the event queue 🫢

πŸ’– the init_rxq branch πŸ’–

  • u.init_rxq.index β€” which receive queue to create, by index
  • u.init_rxq.buf_count β€” how many 4k buffers are backing the receive queue
  • u.init_rxq.evq β€” the instance of the event queue you want receive events aimed at 🎯
  • u.init_rxq.label β€” the label that shows up in receive events
  • u.init_rxq.flags β€” unused (yes, really, it's just sitting there being decorative πŸ™ˆ)
  • u.init_rxq.addr β€” array of length u.init_rxq.buf_count with the DMA address of each page backing the receive queue

πŸ”₯ the init_txq branch πŸ”₯

  • u.init_txq.index β€” which transmit queue to create, by index
  • u.init_txq.buf_count β€” how many 4k buffers are backing the transmit queue
  • u.init_txq.evq β€” the instance of the event queue to target transmit completion events at 🎯
  • u.init_txq.label β€” the label used in transmit completion events
  • u.init_txq.flags β€” checksum offload flags, and the relevant macros are VFDI_TXQ_FLAG_IP_CSUM_DIS and VFDI_TXQ_FLAG_TCPUDP_CSUM_DIS ✨
  • u.init_txq.addr β€” array of length u.init_txq.buf_count with the DMA address of each page backing the transmit queue

πŸ’œ the mac_filter branch πŸ’œ

  • u.mac_filter.rxq β€” inserts a MAC filter at the VF local address / VLAN, targeting all traffic at this receive queue
  • u.mac_filter.flags β€” the MAC filter flags themselves (VFDI_MAC_FILTER_FLAG_RSS and VFDI_MAC_FILTER_FLAG_SCATTER are the macros in play here) 🌈

⭐ the set_status_page branch ⭐

  • u.set_status_page.dma_addr β€” base address for the struct vfdi_status. this one must be page-aligned, and heads up: the PF may write up to a whole page (that's them allowing for the structure getting extended, bestie) πŸ‘€
  • u.set_status_page.peer_page_count β€” how many additional pages the VF has handed over, which peer addresses may be DMAd into
  • u.set_status_page.peer_page_addr β€” array of DMA addresses of those pages. and listen: if the number of peers exceeds 256, then the VF must provide additional pages in this array. the PF will then DMA up to 512 vfdi_endpoint structures into each page. these addresses must be page-aligned too 🫢
fr fr on the page-alignment thing β€” both dma_addr and every peer_page_addr entry. not the place to be sloppy πŸ’€

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/net/ethernet/sfc/siena/vfdi.h Virtual Function Driver Interface(9)
  • enum vfdi_op(9)
  • struct vfdi_status(9)

and that's the whole page, bestie πŸŽ€ source lives in ./drivers/net/ethernet/sfc/siena, dated October 2026, and it's struct vfdi_req(9) til the end. periodt πŸ’…βœ¨

πŸ“¦ where this page comes from