DPDK 16.04/16.11.2 默认tx offload是关闭的引起tx vlan offload无效

时间:2021-08-28 04:46:48

打开IXGBE调试日志发发现:tx使用ixgbe_xmit_pkts_vec,默认tx offload无效了
PMD: ixgbe_set_tx_function(): Using simple tx code path
PMD: ixgbe_set_tx_function(): Vector tx enabled.
PMD: ixgbe_set_tx_function(): Using ixgbe_xmit_pkts_vec

解法:
打开ixgbe_ethdev.c 3113行 修订:
dev_info->default_txconf = (struct rte_eth_txconf) {
    ……
    .txq_flags = 0/*ETH_TXQ_FLAGS_NOMULTSEGS |
            ETH_TXQ_FLAGS_NOOFFLOADS*/,
};

另:

/* 修订接口默认配置,如启用TX VLAN OFFLOAD */
struct rte_eth_dev_info dev_info;    
struct rte_eth_txconf *txconf;

rte_eth_dev_info_get (port_id, &dev_info);
txconf = &dev_info.default_txconf;
/* Enable vlan offload */
txconf->txq_flags &= ~ETH_TXQ_FLAGS_NOVLANOFFL;