net/idpf: fix TSO issue
PATCH 1/1 net/idpf: fix TSO issue
From: Beilei Xing <[email protected]>
This patch fixes TSO by adding Tx checksum offload.
--- drivers/net/idpf/idpf_ethdev.c | 4 ++++ drivers/net/idpf/idpf_rxtx.c | 5 +++++ drivers/net/idpf/idpf_rxtx.h | 10 +++++++++- 3 files changed, 18 insertions(+), 1 deletion(-)
drivers/net/idpf/idpf_ethdev.c +4 -0
@@ -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 ;
drivers/net/idpf/idpf_rxtx.c +5 -0
@@ -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 ); }
drivers/net/idpf/idpf_rxtx.h +9 -1
@@ -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)
Signature · 1 line
2.26.2
Quoted 15 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, November 9, 2022 9:18 AM
To: Wu, Jingjing <[email protected]>
Cc: [email protected]; Peng, Yuan <[email protected]>; Xing, Beilei <[email protected]>
Subject: [PATCH] net/idpf: fix TSO issueFrom: Beilei Xing <[email protected]>
This patch fixes TSO by adding Tx checksum offload.
Fixes ed5b21acc67e ("net/idpf: support Tx offloading")Signed-off-by Beilei Xing <[email protected]>
Zhang, Qi Z
AppliedQuoted 26 lines
-----Original Message-----
From: Peng, Yuan <[email protected]>
Sent: Wednesday, November 9, 2022 3:19 PM
To: Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>
Cc: [email protected]
Subject: RE: [PATCH] net/idpf: fix TSO issueTested-by Peng, Yuan <[email protected]>Quoted 15 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Wednesday, November 9, 2022 9:18 AM
To: Wu, Jingjing <[email protected]>
Cc: [email protected]; Peng, Yuan <[email protected]>; Xing, Beilei <[email protected]>
Subject: [PATCH] net/idpf: fix TSO issueFrom: Beilei Xing <[email protected]>
This patch fixes TSO by adding Tx checksum offload.
Fixes ed5b21acc67e ("net/idpf: support Tx offloading")Signed-off-by Beilei Xing <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi