net/iavf: fix building data desc
Checks
Commit Message
Build correct data desc for UFO pkt by adding UDP_SEG flag, and disable
L4 checksum offload when TSO/UFO is enabled to prevent the MDD.
Fixes: 1e728b01120c ("net/iavf: rework Tx path")
Cc: stable@dpdk.org
Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
drivers/net/iavf/iavf_rxtx.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
Comments
> -----Original Message-----
> From: Zhichao Zeng <zhichaox.zeng@intel.com>
> Sent: Thursday, January 12, 2023 5:32 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhou, YidingX <yidingx.zhou@intel.com>; Zeng,
> ZhichaoX <zhichaox.zeng@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>; Sinha, Abhijit <abhijit.sinha@intel.com>;
> Nicolau, Radu <radu.nicolau@intel.com>
> Subject: [PATCH] net/iavf: fix building data desc
>
> Build correct data desc for UFO pkt by adding UDP_SEG flag, and disable
> L4 checksum offload when TSO/UFO is enabled to prevent the MDD.
>
> Fixes: 1e728b01120c ("net/iavf: rework Tx path")
> Cc: stable@dpdk.org
>
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
@@ -2619,10 +2619,21 @@ iavf_build_data_desc_cmd_offset_fields(volatile uint64_t *qw1,
offset |= (m->l3_len >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT;
}
- if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
- command |= IAVF_TX_DESC_CMD_L4T_EOFT_TCP;
+ if (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) {
+ if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG)
+ command |= IAVF_TX_DESC_CMD_L4T_EOFT_TCP;
+ else
+ command |= IAVF_TX_DESC_CMD_L4T_EOFT_UDP;
offset |= (m->l4_len >> 2) <<
IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
+
+ *qw1 = rte_cpu_to_le_64((((uint64_t)command <<
+ IAVF_TXD_DATA_QW1_CMD_SHIFT) & IAVF_TXD_DATA_QW1_CMD_MASK) |
+ (((uint64_t)offset << IAVF_TXD_DATA_QW1_OFFSET_SHIFT) &
+ IAVF_TXD_DATA_QW1_OFFSET_MASK) |
+ ((uint64_t)l2tag1 << IAVF_TXD_DATA_QW1_L2TAG1_SHIFT));
+
+ return;
}
/* Enable L4 checksum offloads */