ZBLOG

struct rte_eth_conf数据结构解析

rte_eth_conf 结构体是 DPDK 中的一个数据结构,用于配置以太网设备(Ethernet device)的属性。该结构体定义如下:

struct rte_eth_conf {
    uint32_t link_speed;     /**< ETH_LINK_SPEED_* */
    uint32_t link_duplex;    /**< ETH_LINK_[HALF/FULL]_DUPLEX */
    struct {
        uint32_t high_water; /**< Set RX buffer high threshold. */
        uint32_t low_water;  /**< Set RX buffer low threshold. */
        uint16_t size;       /**< RX ring size, power of 2 required. */
        uint8_t drop_en;     /**< Drop packets if no descriptors are available. */
    } rxmode;                /**< Configuration of the reception path. */
    struct {
        uint16_t nb_queues;   /**< Number of transmit queues. */
        uint16_t nb_desc;     /**< Number of transmit descriptors in each queue. */
        uint16_t deferred_start; /**< Defered start for TX queues. */
        uint16_t tx_free_thresh; /**< Start freeing TX buffers when there are less free descriptors than this value. */
        enum rte_eth_tx_mq_mode mq_mode;
                              /**< Select Tx multi-queue mode: none(0), RSS (1) or DCB(2). */
        uint8_t offloads;     /**< Device TX offloads configuration. */
    } txmode;                /**< Configuration of the transmission path. */
    struct {
        enum rte_eth_rx_mq_mode mq_mode; /**< Select Rx multi-queue mode: none(0), RSS (1), DCB(2) or VMDQ(3). */
        uint16_t max_rx_pkt_len; /**< Stop receiving after size of this packet is received. */
        uint16_t split_hdr_size; /**< Split header, e.g. for VLAN header. */
        uint16_t nb_queues;   /**< Number of receive queues. */
        uint8_t enable_lro;   /**< Enable LRO (Large Receive Offload). */
        uint8_t enable_scatter; /**< Enable scatter gather. */
        uint8_t rx_free_thresh; /**< Start freeing RX buffers when there are less free descriptors than this value. */
        uint8_t offloads;     /**< Device RX offloads configuration. */
    } rxmode;                /**< Configuration of the reception path. */
    struct {
        uint32_t burst_size;  /**< Maximum size of bursts. */
        uint32_t ring_size;   /**< Size of descriptor rings. */
        uint8_t retry_mode;   /**< Enable retry mode. */
        uint8_t intr_conf.rxq; /**< RX queue intr-conf. */
    } rx_adv_conf;           /**< Advanced configuration for the Rx side. */
    struct {
        uint32_t burst_size;  /**< Maximum size of bursts. */
        uint32_t ring_size;   /**< Size of descriptor rings. */
        uint16_t nb_tcs;      /**< Number of traffic classes in DCB. */
        struct rte_eth_dcb_tx_conf tx_conf[RTE_ETH_DCB_MAX_TRAFFIC_CLASS];
                              /**< Tx configuration for DCB. */
        struct rte_eth_dcb_rx_conf rx_conf[RTE_ETH_DCB_MAX_TRAFFIC_CLASS];
                              /**< Rx configuration for DCB. */
    } dcb;                   /**< DCB configuration. */
    struct rte_eth_vmdq_rx_conf vmdq_rx_conf;
                            /**< VMDQ configuration. */
    struct rte_eth_mac_filter *mac_filter; /**< MAC filtering configuration. */
    uint32_t rx_queue_flags;/**< Flags for configuring the behavior of the Rx queues. */
    uint32_t tx_queue_flags;/**< Flags for configuring the behavior of the Tx queues. */
    struct rte_eth_fdir_conf fdir_conf;
                            /**< Filter Control frame configuration. */
    struct rte_eth_intr_conf intr_conf;
                            /**< Device interrupt configuration. */
};

具体解析如下:

  • link_speed: 设备的链接速度,取值范围为 Ethernet 链接速率,如 ETH_LINK_SPEED_10M。
  • link_duplex: 设备的链接双工模式,取值范围为 ETH_LINK_HALF_DUPLEX 和 ETH_LINK_FULL_DUPLEX。
  • rxmode: 接收端口的配置信息,包括接收队列中缓冲区大小、高低阈值以及是否允许丢弃。
  • txmode: 发送端口的配置信息,包括发送队列数量、每个队列中缓冲区数量、多队列(RSS、DCB)模式选择等。
  • rx_adv_conf: 接收端口高级配置,包括最大传输单位、描述符环大小、重试模式和中断配置等。
  • dcb: 数据中心桥协议(DCB)配置,用于实现带宽分配和服务质量特性(QoS)。
  • vmdq_rx_conf: 虚拟机设备队列(VMDQ)配置,用于支持虚拟化场景。
  • mac_filter: MAC 地址过滤器的配置信息。
  • rx_queue_flags: 接收队列的属性标志,用于指定接收队列是否启用 RSS、LRO 等功能。
  • tx_queue_flags: 发送队列的属性标志,用于指定发送队列是否启用 DCB 等功能。
  • fdir_conf: 控制帧过滤(FDIR)配置,用于实现基于流的流量识别和分类。
  • intr_conf: 设备中断配置。

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://sdn.0voice.com/?id=341

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?