[dpdk-dev] net/mlx5: fix TSO TCP checksum flag

Message ID 1488887271-34342-1-git-send-email-shahafs@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Shahaf Shuler March 7, 2017, 11:47 a.m. UTC
  Since PKT_TX_TCP_SEG implies PKT_TX_TCP_CKSUM, the PMD must force this
flag.
The fix applied for both tunneled and non-tunneled packets.

Fixes: 19c5dc66b851 ("net/mlx5: add hardware TSO support")
Fixes: 751f56489e31 ("net/mlx5: add hardware TSO support for VXLAN and GRE")
Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Nélio Laranjeiro March 9, 2017, 7:17 a.m. UTC | #1
On Tue, Mar 07, 2017 at 01:47:51PM +0200, Shahaf Shuler wrote:
> Since PKT_TX_TCP_SEG implies PKT_TX_TCP_CKSUM, the PMD must force this
> flag.
> The fix applied for both tunneled and non-tunneled packets.
> 
> Fixes: 19c5dc66b851 ("net/mlx5: add hardware TSO support")
> Fixes: 751f56489e31 ("net/mlx5: add hardware TSO support for VXLAN and GRE")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_rxtx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
> index 405836c..2d33f2d 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.c
> +++ b/drivers/net/mlx5/mlx5_rxtx.c
> @@ -499,6 +499,9 @@
>  				if (is_tunneled	&& txq->tunnel_en) {
>  					tso_header_sz += buf->outer_l2_len +
>  							 buf->outer_l3_len;
> +					cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM;
> +				} else {
> +					cs_flags |= MLX5_ETH_WQE_L4_CSUM;
>  				}
>  				if (unlikely(tso_header_sz >
>  					     MLX5_MAX_TSO_HEADER))
> -- 
> 1.8.3.1
> 

Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
  
Ferruh Yigit March 9, 2017, 4:07 p.m. UTC | #2
On 3/9/2017 7:17 AM, Nélio Laranjeiro wrote:
> On Tue, Mar 07, 2017 at 01:47:51PM +0200, Shahaf Shuler wrote:
>> Since PKT_TX_TCP_SEG implies PKT_TX_TCP_CKSUM, the PMD must force this
>> flag.
>> The fix applied for both tunneled and non-tunneled packets.
>>
>> Fixes: 19c5dc66b851 ("net/mlx5: add hardware TSO support")
>> Fixes: 751f56489e31 ("net/mlx5: add hardware TSO support for VXLAN and GRE")

>>
>> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

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

Patch

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 405836c..2d33f2d 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -499,6 +499,9 @@ 
 				if (is_tunneled	&& txq->tunnel_en) {
 					tso_header_sz += buf->outer_l2_len +
 							 buf->outer_l3_len;
+					cs_flags |= MLX5_ETH_WQE_L4_INNER_CSUM;
+				} else {
+					cs_flags |= MLX5_ETH_WQE_L4_CSUM;
 				}
 				if (unlikely(tso_header_sz >
 					     MLX5_MAX_TSO_HEADER))