DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/4] net: calculate correct UDP pseudo header for UFO
@ 2023-04-13  5:34 Zhichao Zeng
  2023-06-06  7:00 ` Zeng, ZhichaoX
  2023-06-06 15:19 ` Olivier Matz
  0 siblings, 2 replies; 4+ messages in thread
From: Zhichao Zeng @ 2023-04-13  5:34 UTC (permalink / raw)
  To: dev; +Cc: qi.z.zhang, ke1.xu, Zhichao Zeng, Olivier Matz

This commit calculates the correct pseudo header for the
UDP fragmentation offload by adding UDP_SEG flag.

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
 lib/net/rte_ip.h  | 4 ++--
 lib/net/rte_net.h | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h
index a310e9d498..8073c8e889 100644
--- a/lib/net/rte_ip.h
+++ b/lib/net/rte_ip.h
@@ -345,7 +345,7 @@ rte_ipv4_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags)
 	psd_hdr.dst_addr = ipv4_hdr->dst_addr;
 	psd_hdr.zero = 0;
 	psd_hdr.proto = ipv4_hdr->next_proto_id;
-	if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
+	if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) {
 		psd_hdr.len = 0;
 	} else {
 		l3_len = rte_be_to_cpu_16(ipv4_hdr->total_length);
@@ -596,7 +596,7 @@ rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags)
 	} psd_hdr;
 
 	psd_hdr.proto = (uint32_t)(ipv6_hdr->proto << 24);
-	if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
+	if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) {
 		psd_hdr.len = 0;
 	} else {
 		psd_hdr.len = ipv6_hdr->payload_len;
diff --git a/lib/net/rte_net.h b/lib/net/rte_net.h
index 56611fc8f9..ef3ff4c6fd 100644
--- a/lib/net/rte_net.h
+++ b/lib/net/rte_net.h
@@ -121,7 +121,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 	 * no offloads are requested.
 	 */
 	if (!(ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_L4_MASK | RTE_MBUF_F_TX_TCP_SEG |
-			  RTE_MBUF_F_TX_OUTER_IP_CKSUM)))
+					RTE_MBUF_F_TX_UDP_SEG | RTE_MBUF_F_TX_OUTER_IP_CKSUM)))
 		return 0;
 
 	if (ol_flags & (RTE_MBUF_F_TX_OUTER_IPV4 | RTE_MBUF_F_TX_OUTER_IPV6)) {
@@ -154,7 +154,8 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 			ipv4_hdr->hdr_checksum = 0;
 	}
 
-	if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM) {
+	if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM ||
+			(ol_flags & RTE_MBUF_F_TX_UDP_SEG)) {
 		if (ol_flags & RTE_MBUF_F_TX_IPV4) {
 			udp_hdr = (struct rte_udp_hdr *)((char *)ipv4_hdr +
 					m->l3_len);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/4] net: calculate correct UDP pseudo header for UFO
  2023-04-13  5:34 [PATCH 1/4] net: calculate correct UDP pseudo header for UFO Zhichao Zeng
@ 2023-06-06  7:00 ` Zeng, ZhichaoX
  2023-06-06 15:19 ` Olivier Matz
  1 sibling, 0 replies; 4+ messages in thread
From: Zeng, ZhichaoX @ 2023-06-06  7:00 UTC (permalink / raw)
  To: Matz, Olivier; +Cc: dev, Zhang, Qi Z, Xu,  HailinX, Jiang, YuX, Cui,  KaixinX

Hi Olivier,

Could you please help to review this patch? Many thanks.

Best Regards
Zhichao
> -----Original Message-----
> From: Zeng, ZhichaoX <zhichaox.zeng@intel.com>
> Sent: Thursday, April 13, 2023 1:34 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>; Matz, Olivier
> <olivier.matz@6wind.com>
> Subject: [PATCH 1/4] net: calculate correct UDP pseudo header for UFO
> 
> This commit calculates the correct pseudo header for the UDP fragmentation
> offload by adding UDP_SEG flag.
> 
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
> ---
>  lib/net/rte_ip.h  | 4 ++--
>  lib/net/rte_net.h | 5 +++--
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/4] net: calculate correct UDP pseudo header for UFO
  2023-04-13  5:34 [PATCH 1/4] net: calculate correct UDP pseudo header for UFO Zhichao Zeng
  2023-06-06  7:00 ` Zeng, ZhichaoX
@ 2023-06-06 15:19 ` Olivier Matz
  2023-06-06 18:01   ` Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Olivier Matz @ 2023-06-06 15:19 UTC (permalink / raw)
  To: Zhichao Zeng; +Cc: dev, qi.z.zhang, ke1.xu

Hi Zeng,

On Thu, Apr 13, 2023 at 01:34:00PM +0800, Zhichao Zeng wrote:
> This commit calculates the correct pseudo header for the
> UDP fragmentation offload by adding UDP_SEG flag.
> 
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>

Sorry for the late feedback.
The patch looks good to me, thanks!

I don't think we need to Cc stable or add a "Fixes:" tag, as this
feature was not supported by any driver before your series.

Acked-by: Olivier Matz <olivier.matz@6wind.com>


> ---
>  lib/net/rte_ip.h  | 4 ++--
>  lib/net/rte_net.h | 5 +++--
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h
> index a310e9d498..8073c8e889 100644
> --- a/lib/net/rte_ip.h
> +++ b/lib/net/rte_ip.h
> @@ -345,7 +345,7 @@ rte_ipv4_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags)
>  	psd_hdr.dst_addr = ipv4_hdr->dst_addr;
>  	psd_hdr.zero = 0;
>  	psd_hdr.proto = ipv4_hdr->next_proto_id;
> -	if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
> +	if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) {
>  		psd_hdr.len = 0;
>  	} else {
>  		l3_len = rte_be_to_cpu_16(ipv4_hdr->total_length);
> @@ -596,7 +596,7 @@ rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags)
>  	} psd_hdr;
>  
>  	psd_hdr.proto = (uint32_t)(ipv6_hdr->proto << 24);
> -	if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) {
> +	if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) {
>  		psd_hdr.len = 0;
>  	} else {
>  		psd_hdr.len = ipv6_hdr->payload_len;
> diff --git a/lib/net/rte_net.h b/lib/net/rte_net.h
> index 56611fc8f9..ef3ff4c6fd 100644
> --- a/lib/net/rte_net.h
> +++ b/lib/net/rte_net.h
> @@ -121,7 +121,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>  	 * no offloads are requested.
>  	 */
>  	if (!(ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_L4_MASK | RTE_MBUF_F_TX_TCP_SEG |
> -			  RTE_MBUF_F_TX_OUTER_IP_CKSUM)))
> +					RTE_MBUF_F_TX_UDP_SEG | RTE_MBUF_F_TX_OUTER_IP_CKSUM)))
>  		return 0;
>  
>  	if (ol_flags & (RTE_MBUF_F_TX_OUTER_IPV4 | RTE_MBUF_F_TX_OUTER_IPV6)) {
> @@ -154,7 +154,8 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>  			ipv4_hdr->hdr_checksum = 0;
>  	}
>  
> -	if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM) {
> +	if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM ||
> +			(ol_flags & RTE_MBUF_F_TX_UDP_SEG)) {
>  		if (ol_flags & RTE_MBUF_F_TX_IPV4) {
>  			udp_hdr = (struct rte_udp_hdr *)((char *)ipv4_hdr +
>  					m->l3_len);
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/4] net: calculate correct UDP pseudo header for UFO
  2023-06-06 15:19 ` Olivier Matz
@ 2023-06-06 18:01   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2023-06-06 18:01 UTC (permalink / raw)
  To: Olivier Matz, Zhichao Zeng; +Cc: dev, qi.z.zhang, ke1.xu

On 6/6/2023 4:19 PM, Olivier Matz wrote:
> Hi Zeng,
> 
> On Thu, Apr 13, 2023 at 01:34:00PM +0800, Zhichao Zeng wrote:
>> This commit calculates the correct pseudo header for the
>> UDP fragmentation offload by adding UDP_SEG flag.
>>
>> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
> 
> Sorry for the late feedback.
> The patch looks good to me, thanks!
> 
> I don't think we need to Cc stable or add a "Fixes:" tag, as this
> feature was not supported by any driver before your series.
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
> 
> 

Except 3/4 & 4/4,
Series applied to dpdk-next-net/main, thanks.


Driver patches (3/4 & 4/4) are not merged because they are not ack'ed by
their maintainers.

Assigning them to Qi (next-net-intel) but because of dependency if you
prefer to get those directly to next-net, please review them and let me
know.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-06 18:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13  5:34 [PATCH 1/4] net: calculate correct UDP pseudo header for UFO Zhichao Zeng
2023-06-06  7:00 ` Zeng, ZhichaoX
2023-06-06 15:19 ` Olivier Matz
2023-06-06 18:01   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).