DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH v1] net: fix TSO packet checksum incorrect
@ 2020-07-28  8:55 Yuying Zhang
  2020-07-28  9:29 ` Olivier Matz
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Yuying Zhang @ 2020-07-28  8:55 UTC (permalink / raw)
  To: dev, olivier.matz, qi.z.zhang, qiming.yang; +Cc: Yuying Zhang

The ol_flags check lacks of PKT_TX_IPV6 which causes checksum
flag configuration error while IPv6/TCP TSO packet is sent.
This patch fixes the issue using PKT_TX_OFFLOAD_MASK.

Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
---
 lib/librte_net/rte_net.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
index 1edc283a4..4b617ab4c 100644
--- a/lib/librte_net/rte_net.h
+++ b/lib/librte_net/rte_net.h
@@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 	 * Mainly it is required to avoid fragmented headers check if
 	 * no offloads are requested.
 	 */
-	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
+	if (!(ol_flags & PKT_TX_OFFLOAD_MASK))
 		return 0;
 
 	if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
-- 
2.25.1


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

* Re: [dpdk-dev] [PATCH v1] net: fix TSO packet checksum incorrect
  2020-07-28  8:55 [dpdk-dev] [PATCH v1] net: fix TSO packet checksum incorrect Yuying Zhang
@ 2020-07-28  9:29 ` Olivier Matz
  2020-07-29 15:58   ` Andrew Rybchenko
  2020-07-28 17:09 ` [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets " Yuying Zhang
  2020-07-30  2:00 ` [dpdk-dev] [PATCH v3 1/1] net: fix bad checksum in offloaded TSOv6 packets Yuying Zhang
  2 siblings, 1 reply; 11+ messages in thread
From: Olivier Matz @ 2020-07-28  9:29 UTC (permalink / raw)
  To: Yuying Zhang; +Cc: dev, qi.z.zhang, qiming.yang, Ferruh Yigit, arybchenko

Hi,

On Tue, Jul 28, 2020 at 08:55:31AM +0000, Yuying Zhang wrote:
> The ol_flags check lacks of PKT_TX_IPV6 which causes checksum
> flag configuration error while IPv6/TCP TSO packet is sent.
> This patch fixes the issue using PKT_TX_OFFLOAD_MASK.
> 
> Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")
> 
> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
> ---
>  lib/librte_net/rte_net.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
> index 1edc283a4..4b617ab4c 100644
> --- a/lib/librte_net/rte_net.h
> +++ b/lib/librte_net/rte_net.h
> @@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>  	 * Mainly it is required to avoid fragmented headers check if
>  	 * no offloads are requested.
>  	 */
> -	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
> +	if (!(ol_flags & PKT_TX_OFFLOAD_MASK))
>  		return 0;
>  
>  	if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
> -- 
> 2.25.1
> 

I think the PKT_TX_TCP_SEG flag is missing in the test above, it
should be like this:

 if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG)))

It would be more precise than having the whole list of offload flags.

The reason is because in case of TSOv4, there is always the flag
PKT_TX_IP_CKSUM, so this test is always wrong and we continue in the
function. In case of TSOv6, there is neither PKT_TX_IP_CKSUM nor
PKT_TX_L4_TCP (which is not mandatory, the doc says that PKT_TX_TCP_SEG
implies PKT_TX_L4_TCP).

Thanks for spotting this. Can you please submit a v2 with
PKT_TX_TCP_SEG?

Olivier

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

* [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets checksum incorrect
  2020-07-28  8:55 [dpdk-dev] [PATCH v1] net: fix TSO packet checksum incorrect Yuying Zhang
  2020-07-28  9:29 ` Olivier Matz
@ 2020-07-28 17:09 ` " Yuying Zhang
  2020-07-29  2:28   ` Xie, WeiX
                     ` (2 more replies)
  2020-07-30  2:00 ` [dpdk-dev] [PATCH v3 1/1] net: fix bad checksum in offloaded TSOv6 packets Yuying Zhang
  2 siblings, 3 replies; 11+ messages in thread
From: Yuying Zhang @ 2020-07-28 17:09 UTC (permalink / raw)
  To: dev, olivier.matz, qi.z.zhang, qiming.yang; +Cc: Yuying Zhang

The ol_flags check lacks of flag for IPv6 which causes checksum
flag configuration error while IPv6/TCP TSO packet is sent.
This patch fixes the issue by adding PKT_TX_TCP_SEG flag.

Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
---
 lib/librte_net/rte_net.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
index 1edc283a4..94b06d9ee 100644
--- a/lib/librte_net/rte_net.h
+++ b/lib/librte_net/rte_net.h
@@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 	 * Mainly it is required to avoid fragmented headers check if
 	 * no offloads are requested.
 	 */
-	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
+	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG)))
 		return 0;
 
 	if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
-- 
2.25.1


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

* Re: [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets checksum incorrect
  2020-07-28 17:09 ` [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets " Yuying Zhang
@ 2020-07-29  2:28   ` Xie, WeiX
  2020-07-29  7:49   ` Olivier Matz
  2020-07-29  8:54   ` David Marchand
  2 siblings, 0 replies; 11+ messages in thread
From: Xie, WeiX @ 2020-07-29  2:28 UTC (permalink / raw)
  To: Zhang, Yuying, dev, olivier.matz, Zhang, Qi Z, Yang, Qiming; +Cc: Zhang, Yuying

Tested-by: Zhang, XiX <xix.zhang@intel.com>

Regards,
Xie Wei

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yuying Zhang
Sent: Wednesday, July 29, 2020 1:10 AM
To: dev@dpdk.org; olivier.matz@6wind.com; Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>
Cc: Zhang, Yuying <yuying.zhang@intel.com>
Subject: [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets checksum incorrect

The ol_flags check lacks of flag for IPv6 which causes checksum flag configuration error while IPv6/TCP TSO packet is sent.
This patch fixes the issue by adding PKT_TX_TCP_SEG flag.

Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
---
 lib/librte_net/rte_net.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h index 1edc283a4..94b06d9ee 100644
--- a/lib/librte_net/rte_net.h
+++ b/lib/librte_net/rte_net.h
@@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 	 * Mainly it is required to avoid fragmented headers check if
 	 * no offloads are requested.
 	 */
-	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
+	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG)))
 		return 0;
 
 	if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
--
2.25.1


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

* Re: [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets checksum incorrect
  2020-07-28 17:09 ` [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets " Yuying Zhang
  2020-07-29  2:28   ` Xie, WeiX
@ 2020-07-29  7:49   ` Olivier Matz
  2020-07-29 16:00     ` Andrew Rybchenko
  2020-07-29  8:54   ` David Marchand
  2 siblings, 1 reply; 11+ messages in thread
From: Olivier Matz @ 2020-07-29  7:49 UTC (permalink / raw)
  To: Yuying Zhang; +Cc: dev, qi.z.zhang, qiming.yang, Ferruh Yigit, Andrew Rybchenko

On Tue, Jul 28, 2020 at 05:09:50PM +0000, Yuying Zhang wrote:
> The ol_flags check lacks of flag for IPv6 which causes checksum
> flag configuration error while IPv6/TCP TSO packet is sent.
> This patch fixes the issue by adding PKT_TX_TCP_SEG flag.

Thanks Yuying for the new version. I have another suggestion for the
title/commit log:

net: fix bad checksum in offloaded TSOv6 packets

The rte_net_intel_cksum_flags_prepare() function prepares the
pseudoheader checksum in packet data when doing checksum or TSO
offload.

It does nothing when no checksum offload flag is set in mbuf. But in
case of a IPv6/TCP TSO packet, it is not mandatory to have a checksum
flag. We also need to check the PKT_TX_TCP_SEG flag in addition to
checksum flags to fix offload preparation for such packets.

> Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")
> 
> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>

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

> ---
>  lib/librte_net/rte_net.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
> index 1edc283a4..94b06d9ee 100644
> --- a/lib/librte_net/rte_net.h
> +++ b/lib/librte_net/rte_net.h
> @@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>  	 * Mainly it is required to avoid fragmented headers check if
>  	 * no offloads are requested.
>  	 */
> -	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
> +	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG)))
>  		return 0;
>  
>  	if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
> -- 
> 2.25.1
> 

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

* Re: [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets checksum incorrect
  2020-07-28 17:09 ` [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets " Yuying Zhang
  2020-07-29  2:28   ` Xie, WeiX
  2020-07-29  7:49   ` Olivier Matz
@ 2020-07-29  8:54   ` David Marchand
  2020-07-29 10:03     ` Ferruh Yigit
  2 siblings, 1 reply; 11+ messages in thread
From: David Marchand @ 2020-07-29  8:54 UTC (permalink / raw)
  To: Yuying Zhang; +Cc: dev, Olivier Matz, Qi Zhang, Qiming Yang, Yigit, Ferruh

On Tue, Jul 28, 2020 at 7:11 PM Yuying Zhang <yuying.zhang@intel.com> wrote:
>
> The ol_flags check lacks of flag for IPv6 which causes checksum
> flag configuration error while IPv6/TCP TSO packet is sent.
> This patch fixes the issue by adding PKT_TX_TCP_SEG flag.
>
> Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")
>
> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
> ---
>  lib/librte_net/rte_net.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
> index 1edc283a4..94b06d9ee 100644
> --- a/lib/librte_net/rte_net.h
> +++ b/lib/librte_net/rte_net.h
> @@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>          * Mainly it is required to avoid fragmented headers check if
>          * no offloads are requested.
>          */
> -       if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
> +       if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG)))
>                 return 0;
>
>         if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
> --
> 2.25.1
>

Reviewed-by: David Marchand <david.marchand@redhat.com>

Olivier suggestion on the commitlog/title looks fine to me.


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets checksum incorrect
  2020-07-29  8:54   ` David Marchand
@ 2020-07-29 10:03     ` Ferruh Yigit
  0 siblings, 0 replies; 11+ messages in thread
From: Ferruh Yigit @ 2020-07-29 10:03 UTC (permalink / raw)
  To: David Marchand, Yuying Zhang; +Cc: dev, Olivier Matz, Qi Zhang, Qiming Yang

On 7/29/2020 9:54 AM, David Marchand wrote:
> On Tue, Jul 28, 2020 at 7:11 PM Yuying Zhang <yuying.zhang@intel.com> wrote:
>>
>> The ol_flags check lacks of flag for IPv6 which causes checksum
>> flag configuration error while IPv6/TCP TSO packet is sent.
>> This patch fixes the issue by adding PKT_TX_TCP_SEG flag.
>>
>> Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")
>>
>> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
> 
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 

Applied to dpdk-next-net/master, thanks.

(Used the suggested commit log)

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

* Re: [dpdk-dev] [PATCH v1] net: fix TSO packet checksum incorrect
  2020-07-28  9:29 ` Olivier Matz
@ 2020-07-29 15:58   ` Andrew Rybchenko
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Rybchenko @ 2020-07-29 15:58 UTC (permalink / raw)
  To: Olivier Matz, Yuying Zhang
  Cc: dev, qi.z.zhang, qiming.yang, Ferruh Yigit, arybchenko

On 7/28/20 12:29 PM, Olivier Matz wrote:
> Hi,
> 
> On Tue, Jul 28, 2020 at 08:55:31AM +0000, Yuying Zhang wrote:
>> The ol_flags check lacks of PKT_TX_IPV6 which causes checksum
>> flag configuration error while IPv6/TCP TSO packet is sent.
>> This patch fixes the issue using PKT_TX_OFFLOAD_MASK.
>>
>> Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")
>>
>> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
>> ---
>>  lib/librte_net/rte_net.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
>> index 1edc283a4..4b617ab4c 100644
>> --- a/lib/librte_net/rte_net.h
>> +++ b/lib/librte_net/rte_net.h
>> @@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>>  	 * Mainly it is required to avoid fragmented headers check if
>>  	 * no offloads are requested.
>>  	 */
>> -	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
>> +	if (!(ol_flags & PKT_TX_OFFLOAD_MASK))
>>  		return 0;
>>  
>>  	if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
>> -- 
>> 2.25.1
>>
> 
> I think the PKT_TX_TCP_SEG flag is missing in the test above, it
> should be like this:
> 
>  if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG)))
> 
> It would be more precise than having the whole list of offload flags.
> 
> The reason is because in case of TSOv4, there is always the flag
> PKT_TX_IP_CKSUM, so this test is always wrong and we continue in the
> function. In case of TSOv6, there is neither PKT_TX_IP_CKSUM nor
> PKT_TX_L4_TCP (which is not mandatory, the doc says that PKT_TX_TCP_SEG
> implies PKT_TX_L4_TCP).

I thought that PKT_TX_L4_TCP is required anyway and missed the
fact that PKT_TX_TCP_SEG implies PKT_TX_L4_TCP. Thanks.

> 
> Thanks for spotting this. Can you please submit a v2 with
> PKT_TX_TCP_SEG?
> 
> Olivier
> 


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

* Re: [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets checksum incorrect
  2020-07-29  7:49   ` Olivier Matz
@ 2020-07-29 16:00     ` Andrew Rybchenko
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Rybchenko @ 2020-07-29 16:00 UTC (permalink / raw)
  To: Olivier Matz, Yuying Zhang
  Cc: dev, qi.z.zhang, qiming.yang, Ferruh Yigit, Andrew Rybchenko

On 7/29/20 10:49 AM, Olivier Matz wrote:
> On Tue, Jul 28, 2020 at 05:09:50PM +0000, Yuying Zhang wrote:
>> The ol_flags check lacks of flag for IPv6 which causes checksum
>> flag configuration error while IPv6/TCP TSO packet is sent.
>> This patch fixes the issue by adding PKT_TX_TCP_SEG flag.
> 
> Thanks Yuying for the new version. I have another suggestion for the
> title/commit log:
> 
> net: fix bad checksum in offloaded TSOv6 packets
> 
> The rte_net_intel_cksum_flags_prepare() function prepares the
> pseudoheader checksum in packet data when doing checksum or TSO
> offload.
> 
> It does nothing when no checksum offload flag is set in mbuf. But in
> case of a IPv6/TCP TSO packet, it is not mandatory to have a checksum
> flag. We also need to check the PKT_TX_TCP_SEG flag in addition to
> checksum flags to fix offload preparation for such packets.
> 
>> Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")
>>
>> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>

> 
>> ---
>>  lib/librte_net/rte_net.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
>> index 1edc283a4..94b06d9ee 100644
>> --- a/lib/librte_net/rte_net.h
>> +++ b/lib/librte_net/rte_net.h
>> @@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>>  	 * Mainly it is required to avoid fragmented headers check if
>>  	 * no offloads are requested.
>>  	 */
>> -	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
>> +	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG)))
>>  		return 0;
>>  
>>  	if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
>> -- 
>> 2.25.1
>>


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

* [dpdk-dev] [PATCH v3 1/1] net: fix bad checksum in offloaded TSOv6 packets
  2020-07-28  8:55 [dpdk-dev] [PATCH v1] net: fix TSO packet checksum incorrect Yuying Zhang
  2020-07-28  9:29 ` Olivier Matz
  2020-07-28 17:09 ` [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets " Yuying Zhang
@ 2020-07-30  2:00 ` Yuying Zhang
  2020-07-30  2:25   ` Zhang, Yuying
  2 siblings, 1 reply; 11+ messages in thread
From: Yuying Zhang @ 2020-07-30  2:00 UTC (permalink / raw)
  To: dev, olivier.matz, qi.z.zhang, qiming.yang; +Cc: Yuying Zhang, David Marchand

The rte_net_intel_cksum_flags_prepare() function prepares the
pseudoheader checksum in packet data when doing checksum or TSO
offload.

It does nothing when no checksum offload flag is set in mbuf. But
in case of a IPv6/TCP TSO packet, it is not mandatory to have a
checksum flag. We also need to check the PKT_TX_TCP_SEG flag in addition
to checksum flags to fix offload preparation for such packets.

Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_net/rte_net.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
index 1edc283a4..94b06d9ee 100644
--- a/lib/librte_net/rte_net.h
+++ b/lib/librte_net/rte_net.h
@@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 	 * Mainly it is required to avoid fragmented headers check if
 	 * no offloads are requested.
 	 */
-	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
+	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG)))
 		return 0;
 
 	if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
-- 
2.25.1


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

* Re: [dpdk-dev] [PATCH v3 1/1] net: fix bad checksum in offloaded TSOv6 packets
  2020-07-30  2:00 ` [dpdk-dev] [PATCH v3 1/1] net: fix bad checksum in offloaded TSOv6 packets Yuying Zhang
@ 2020-07-30  2:25   ` Zhang, Yuying
  0 siblings, 0 replies; 11+ messages in thread
From: Zhang, Yuying @ 2020-07-30  2:25 UTC (permalink / raw)
  To: dev, olivier.matz, Zhang, Qi Z, Yang, Qiming; +Cc: David Marchand

> -----Original Message-----
> From: Zhang, Yuying <yuying.zhang@intel.com>
> Sent: 2020^[$BG/^[(B7^[$B7n^[(B30^[$BF|^[(B 10:01
> To: dev@dpdk.org; olivier.matz@6wind.com; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>
> Cc: Zhang, Yuying <yuying.zhang@intel.com>; David Marchand
> <david.marchand@redhat.com>
> Subject: [PATCH v3 1/1] net: fix bad checksum in offloaded TSOv6 packets
> 
> The rte_net_intel_cksum_flags_prepare() function prepares the pseudoheader
> checksum in packet data when doing checksum or TSO offload.
> 
> It does nothing when no checksum offload flag is set in mbuf. But in case of a
> IPv6/TCP TSO packet, it is not mandatory to have a checksum flag. We also need
> to check the PKT_TX_TCP_SEG flag in addition to checksum flags to fix offload
> preparation for such packets.
> 
> Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")
> 
> Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/librte_net/rte_net.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h index
> 1edc283a4..94b06d9ee 100644
> --- a/lib/librte_net/rte_net.h
> +++ b/lib/librte_net/rte_net.h
> @@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m,
> uint64_t ol_flags)
>  	 * Mainly it is required to avoid fragmented headers check if
>  	 * no offloads are requested.
>  	 */
> -	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
> +	if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK |
> PKT_TX_TCP_SEG)))
>  		return 0;
> 
>  	if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))
> --
> 2.25.1

Please drop this patch since it has been merged into dpdk-next-net/master.
I am so sorry.

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

end of thread, back to index

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28  8:55 [dpdk-dev] [PATCH v1] net: fix TSO packet checksum incorrect Yuying Zhang
2020-07-28  9:29 ` Olivier Matz
2020-07-29 15:58   ` Andrew Rybchenko
2020-07-28 17:09 ` [dpdk-dev] [PATCH v2 1/1] net: fix TSO packets " Yuying Zhang
2020-07-29  2:28   ` Xie, WeiX
2020-07-29  7:49   ` Olivier Matz
2020-07-29 16:00     ` Andrew Rybchenko
2020-07-29  8:54   ` David Marchand
2020-07-29 10:03     ` Ferruh Yigit
2020-07-30  2:00 ` [dpdk-dev] [PATCH v3 1/1] net: fix bad checksum in offloaded TSOv6 packets Yuying Zhang
2020-07-30  2:25   ` Zhang, Yuying

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox