[4/4] net/iavf: enable UDP fragmentation offload

Message ID 20230413053506.4191340-1-zhichaox.zeng@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series support UDP fragmentation offload |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Zhichao Zeng April 13, 2023, 5:35 a.m. UTC
  This commit enables transmit segmentation offload for UDP, including both
non-tunneled and tunneled packets.

The command "tso set <tso_segsz> <port_id>" or
"tunnel_tso set <tso_segsz> <port_id>" is used to enable UFO.

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 2 +-
 drivers/net/iavf/iavf_rxtx.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
  

Comments

Ke Xu May 24, 2023, 5:20 a.m. UTC | #1
> From: Zeng, ZhichaoX <zhichaox.zeng@intel.com>
> Sent: Thursday, April 13, 2023 1:35 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Xu, Ke1 <ke1.xu@intel.com>; Zeng,
> ZhichaoX <zhichaox.zeng@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH 4/4] net/iavf: enable UDP fragmentation offload
> 
> This commit enables transmit segmentation offload for UDP, including both
> non-tunneled and tunneled packets.
> 
> The command "tso set <tso_segsz> <port_id>" or "tunnel_tso set <tso_segsz>
> <port_id>" is used to enable UFO.
> 
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>

Verified and Passed.

Two extra issues exists found blocking very limited part of validation.
1. On QEMU DCF not able to enable rx_vxlan.
2. IPv6 Tunneled UDP packets triggers MDD event.

Tested-by: Ke Xu <ke1.xu@intel.com>

> ---
>  drivers/net/iavf/iavf_rxtx.c | 2 +-
>  drivers/net/iavf/iavf_rxtx.h | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
  
Qi Zhang June 7, 2023, 1 a.m. UTC | #2
> -----Original Message-----
> From: Xu, Ke1 <ke1.xu@intel.com>
> Sent: Wednesday, May 24, 2023 1:21 PM
> To: Zeng, ZhichaoX <zhichaox.zeng@intel.com>; dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Xu, Ke1
> <ke1.xu@intel.com>
> Subject: RE: [PATCH 4/4] net/iavf: enable UDP fragmentation offload
> 
> > From: Zeng, ZhichaoX <zhichaox.zeng@intel.com>
> > Sent: Thursday, April 13, 2023 1:35 PM
> > To: dev@dpdk.org
> > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Xu, Ke1 <ke1.xu@intel.com>;
> > Zeng, ZhichaoX <zhichaox.zeng@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> > Subject: [PATCH 4/4] net/iavf: enable UDP fragmentation offload
> >
> > This commit enables transmit segmentation offload for UDP, including
> > both non-tunneled and tunneled packets.
> >
> > The command "tso set <tso_segsz> <port_id>" or "tunnel_tso set
> > <tso_segsz> <port_id>" is used to enable UFO.
> >
> > Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
> 
> Verified and Passed.
> 
> Two extra issues exists found blocking very limited part of validation.
> 1. On QEMU DCF not able to enable rx_vxlan.
> 2. IPv6 Tunneled UDP packets triggers MDD event.
> 
> Tested-by: Ke Xu <ke1.xu@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index b1d0fbceb6..8eca8aba3e 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -3622,7 +3622,7 @@  iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 		ol_flags = m->ol_flags;
 
 		/* Check condition for nb_segs > IAVF_TX_MAX_MTU_SEG. */
-		if (!(ol_flags & RTE_MBUF_F_TX_TCP_SEG)) {
+		if (!(ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG))) {
 			if (m->nb_segs > IAVF_TX_MAX_MTU_SEG) {
 				rte_errno = EINVAL;
 				return i;
diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h
index 09e2127db0..5096868d87 100644
--- a/drivers/net/iavf/iavf_rxtx.h
+++ b/drivers/net/iavf/iavf_rxtx.h
@@ -73,6 +73,7 @@ 
 		RTE_MBUF_F_TX_IP_CKSUM |		 \
 		RTE_MBUF_F_TX_L4_MASK |		 \
 		RTE_MBUF_F_TX_TCP_SEG |          \
+		RTE_MBUF_F_TX_UDP_SEG |          \
 		RTE_MBUF_F_TX_OUTER_IP_CKSUM |   \
 		RTE_MBUF_F_TX_OUTER_UDP_CKSUM)
 
@@ -85,6 +86,7 @@ 
 		RTE_MBUF_F_TX_IP_CKSUM |		 \
 		RTE_MBUF_F_TX_L4_MASK |		 \
 		RTE_MBUF_F_TX_TCP_SEG |		 \
+		RTE_MBUF_F_TX_UDP_SEG |      \
 		RTE_MBUF_F_TX_TUNNEL_MASK |	\
 		RTE_MBUF_F_TX_OUTER_IP_CKSUM |  \
 		RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \