Data Structures

This section documents the data structures provided by the dma-utils

struct mdb5_dma_channel_stats {
    uint64_t req_rcvd;
    uint64_t req_success;
    uint64_t req_failed;
    uint64_t intr_rcvd;
    uint64_t read_data_processed;
    uint64_t write_data_processed;
    uint64_t total_data_processed;
};

mdb5_dma_channel_stats - Channel performance statistics

This structure contains various statistics related to a MDB5-DMA read/write channels. It includes information about the number of packets received, successfully processed, failed, the number of interrupts received, and the total data length transferred.

  • req_rcvd - Number of requests received

  • req_success - Number of successful requests

  • req_failed - Number of failed requests

  • intr_rcvd - Number of interrupts received

  • read_data_processed - Total read data processed

  • write_data_processed - Total write data processed

  • total_data_processed - Total data processed

struct mdb5_dma_channel {
    struct mdb5_dma_channel_stats stats;
    uint64_t address;
    uint32_t aperture_sz;
    uint8_t ch_id;
    char name[MDB5_NAME_SZ];
    enum mdb5_dma_chan_dir dir;
    enum mdb5_dma_transfer_mode mode;
};

mdb5_dma_channel - Complete channel information

This structure contains information about MDB5-DMA read/write channels. It includes the device memory address, I/O type, Channel’s name, index, mode, direction and statistics. Additionally, it contains specific parameters like aperture size for Scatter-Gather (Linked-list) DMA mode.

  • stats - Channel statistics

  • address - Device memory address

  • aperture_sz - Aperture size for SG mode

  • ch_id - Channel index

  • name - Channel node name

  • dir - Channel direction

  • mode - Transfer mode

struct mdb5_dma_reg {
    uint32_t offset;
    uint32_t data;
    char pci_bdf[8];
};

mdb5_dma_reg - Register access structure

This structure contains the offset, data, and PCI Bus, Device, Function in BB:DD.F format.

  • offset - Register offset

  • data - Register data

  • pci_bdf - PCI Bus:Device.Function

struct ctrl_mode {
    char name[MDB5_NAME_SZ];
    enum mdb5_dma_transfer_mode mode;
};

ctrl_mode - Transfer mode configuration

This structure contains control mode information such as configuring channel to transfer mode Scatter-Gather (Linked-list) Mode or Simple (Non Linked-list) Mode.

  • name - Control node name

  • mode - Transfer mode

struct ctrl_aperture {
    char name[MDB5_NAME_SZ];
    uint32_t aperture;
};

ctrl_aperture - Aperture size configuration

This structure contains aperture information. It includes control device node name and aperture size.

  • name - Control node name

  • aperture - Aperture size

struct ctrl_stats {
    char name[MDB5_NAME_SZ];
    uint64_t stat_addr;
};

ctrl_stats - Statistics retrieval structure

This structure contains channel statistics information. It includes physical address to be provided to kernel for filling statistics mdb5_dma_channel_stats.

  • name - Control node name

  • stat_addr - Statistics address

struct mdb5_dma_ioctl {
    struct ctrl_mode cmode;
    struct ctrl_aperture caperture;
    struct ctrl_stats cstats;
    struct mdb5_dma_common *h;
};

mdb5_dma_ioctl - IOCTL operation container

  • cmode - Mode configuration

  • caperture - Aperture configuration

  • cstats - Statistics configuration

  • h - Common structure pointer

struct mdb5_dma_common {
    struct mdb5_dma_ioctl hioc;
    struct mdb5_dma_reg reg;
    struct mdb5_dma_channel *chan;
    uint64_t address;
    size_t pkt_sz;
    uint32_t num_rd_chan;
    uint32_t num_wr_chan;
    uint32_t num_pkts;
    uint32_t op_arg;
    char ctrl_name[MDB5_NAME_SZ];
    char cfg_name[64];
    enum operation op;
    enum mdb5_dma_chan_mode chan_mode;
    enum mdb5_dma_io_type io_type;
    bool set_mode;
    bool set_aperture;
    bool dump_en;
};

mdb5_dma_common - Main configuration structure

This structure contains various configuration parameters and settings for MDB5-DMA operations. It includes information about the operation type, channel mode, I/O type, channel direction, and other relevant details required for MDB5-DMA operations. It is commonly used by all MDB5-DMA user space utilities.

  • hioc - IOCTL structure

  • reg - Register structure

  • chan - Channel pointer

  • address - Device address

  • pkt_sz - Packet size

  • num_rd_chan - Number of read channels

  • num_wr_chan - Number of write channels

  • num_pkts - Number of packets

  • op_arg - Operation argument (enum operation_arg)

  • ctrl_name - Control node name (Name of the PF/VF control node)

  • cfg_name - Configuration name (for dma-xfer)

  • op - Operation type

  • chan_mode - Channel mode

  • io_type - I/O type

  • set_mode - Set mode flag

  • set_aperture - Set aperture flag

  • dump_en - Dump enable flag