我想启用每个端口卸载功能,以使用DEV_TX_OFFLOAD_MULTI_SEGS为多个段设置TX卸载功能。 UDP数据包因错误UDP长度> IP有效负载长度错误而被丢弃,如wireshark捕获所示。 我升级到DPDK 18.08后,会看到此问题。 因此,我想设置每个端口的卸载DEV_TX_OFFLOAD_MULTI_SEGS以允许分割大数据包。
尝试设置上述卸载时,出现以下错误。
Ethdev port_id = 0 tx_queue_id = 0,新添加的卸载0x9f3e55必须在rte_eth_tx_queue_setup()中的队列前卸载功能0x0之内
请让我知道我要去哪里哪里以及如何正确设置卸载DEV_TX_OFFLOAD_MULTI_SEGS。
static const struct rte_eth_txconf tx_conf = {
.tx_thresh = {
.pthresh = TX_PTHRESH,
.hthresh = TX_HTHRESH,
.wthresh = TX_WTHRESH,
},
.tx_free_thresh = 0,
.tx_rs_thresh = 0,
};
static struct rte_eth_conf port_conf = {
.rxmode = {
.mq_mode = ETH_MQ_RX_RSS,
.max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
.split_hdr_size = 0,
.offloads = (DEV_RX_OFFLOAD_CHECKSUM |
DEV_RX_OFFLOAD_CRC_STRIP),
},
.rx_adv_conf = {
.rss_conf = {
.rss_key = NULL,
.rss_hf = ETH_RSS_TCP| ETH_RSS_UDP |
ETH_RSS_TCP | ETH_RSS_SCTP,
},
},
.txmode = {
.mq_mode = ETH_MQ_TX_NONE,
},
};
struct rte_eth_txconf *tx_conf;
struct rte_eth_conf local_port_conf = port_conf;
if(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MULTI_SEGS)
{
local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_MULTI_SEGS;
}
ret = rte_eth_dev_configure(port, nbqueue, nbqueue, &local_port_conf);
rte_eth_dev_info_get(port, &dev_info);
tx_conf = &dev_info.default_txconf;
tx_conf->offloads = local_port_conf.txmode.offloads;
ret = rte_eth_tx_queue_setup(port, queue, RTE_TEST_TX_DESC_DEFAULT, master_socket_id, &tx_conf);