net/idpf: fix TSO
This patch fixes TSO by adding Tx checksum offload.
Fixes: ed5b21acc6
("net/idpf: support Tx offloading")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
This commit is contained in:
parent
b95179d139
commit
ef47d95e90
@ -71,6 +71,10 @@ idpf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
|
||||
RTE_ETH_RX_OFFLOAD_TIMESTAMP;
|
||||
|
||||
dev_info->tx_offload_capa =
|
||||
RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |
|
||||
RTE_ETH_TX_OFFLOAD_UDP_CKSUM |
|
||||
RTE_ETH_TX_OFFLOAD_TCP_CKSUM |
|
||||
RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |
|
||||
RTE_ETH_TX_OFFLOAD_TCP_TSO |
|
||||
RTE_ETH_TX_OFFLOAD_MULTI_SEGS |
|
||||
RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
|
||||
|
@ -1692,6 +1692,8 @@ idpf_splitq_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
|
||||
if (unlikely((tx_id % 32) == 0))
|
||||
txd->qw1.cmd_dtype |= IDPF_TXD_FLEX_FLOW_CMD_RE;
|
||||
if (ol_flags & IDPF_TX_CKSUM_OFFLOAD_MASK)
|
||||
txd->qw1.cmd_dtype |= IDPF_TXD_FLEX_FLOW_CMD_CS_EN;
|
||||
txq->nb_free = (uint16_t)(txq->nb_free - nb_used);
|
||||
txq->nb_used = (uint16_t)(txq->nb_used + nb_used);
|
||||
}
|
||||
@ -2075,6 +2077,9 @@ idpf_singleq_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
|
||||
txq->nb_used = 0;
|
||||
}
|
||||
|
||||
if (ol_flags & IDPF_TX_CKSUM_OFFLOAD_MASK)
|
||||
td_cmd |= IDPF_TX_FLEX_DESC_CMD_CS_EN;
|
||||
|
||||
txd->qw1.cmd_dtype |= rte_cpu_to_le_16(td_cmd << IDPF_FLEX_TXD_QW1_CMD_S);
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,15 @@
|
||||
#define IDPF_MAX_TSO_FRAME_SIZE 262143
|
||||
#define IDPF_TX_MAX_MTU_SEG 10
|
||||
|
||||
#define IDPF_TX_OFFLOAD_MASK RTE_MBUF_F_TX_TCP_SEG
|
||||
#define IDPF_TX_CKSUM_OFFLOAD_MASK ( \
|
||||
RTE_MBUF_F_TX_IP_CKSUM | \
|
||||
RTE_MBUF_F_TX_L4_MASK | \
|
||||
RTE_MBUF_F_TX_TCP_SEG)
|
||||
|
||||
#define IDPF_TX_OFFLOAD_MASK ( \
|
||||
IDPF_TX_CKSUM_OFFLOAD_MASK | \
|
||||
RTE_MBUF_F_TX_IPV4 | \
|
||||
RTE_MBUF_F_TX_IPV6)
|
||||
|
||||
#define IDPF_TX_OFFLOAD_NOTSUP_MASK \
|
||||
(RTE_MBUF_F_TX_OFFLOAD_MASK ^ IDPF_TX_OFFLOAD_MASK)
|
||||
|
Loading…
Reference in New Issue
Block a user