DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix TSO segment size
@ 2017-06-20  5:24 Shahaf Shuler
  2017-06-20  7:13 ` Nélio Laranjeiro
  0 siblings, 1 reply; 3+ messages in thread
From: Shahaf Shuler @ 2017-06-20  5:24 UTC (permalink / raw)
  To: nelio.laranjeiro, adrien.mazarguil; +Cc: dev, stable

In case on multi segment packet, the TSO segment size
was taken from the last segment. This may lead to incorrect
values in case not all segments are initialized with the field.

Fixing it by taking the value from the first segment.

Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index cade625f9..70314b393 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -527,6 +527,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 		uint16_t ehdr;
 		uint8_t cs_flags = 0;
 		uint64_t tso = 0;
+		uint16_t tso_segsz = 0;
 #ifdef MLX5_PMD_SOFT_COUNTERS
 		uint32_t total_length = 0;
 #endif
@@ -622,6 +623,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 
 				tso_header_sz = buf->l2_len + vlan_sz +
 						buf->l3_len + buf->l4_len;
+				tso_segsz = buf->tso_segsz;
 
 				if (is_tunneled	&& txq->tunnel_en) {
 					tso_header_sz += buf->outer_l2_len +
@@ -821,7 +823,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			};
 			wqe->eseg = (rte_v128u32_t){
 				0,
-				cs_flags | (htons(buf->tso_segsz) << 16),
+				cs_flags | (htons(tso_segsz) << 16),
 				0,
 				(ehdr << 16) | htons(tso_header_sz),
 			};
-- 
2.12.0

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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix TSO segment size
  2017-06-20  5:24 [dpdk-dev] [PATCH] net/mlx5: fix TSO segment size Shahaf Shuler
@ 2017-06-20  7:13 ` Nélio Laranjeiro
  2017-06-21  9:57   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Nélio Laranjeiro @ 2017-06-20  7:13 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: adrien.mazarguil, dev, stable

On Tue, Jun 20, 2017 at 08:24:47AM +0300, Shahaf Shuler wrote:
> In case on multi segment packet, the TSO segment size
> was taken from the last segment. This may lead to incorrect
> values in case not all segments are initialized with the field.
> 
> Fixing it by taking the value from the first segment.
> 
> Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> Acked-by: Yongseok Koh <yskoh@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_rxtx.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
> index cade625f9..70314b393 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.c
> +++ b/drivers/net/mlx5/mlx5_rxtx.c
> @@ -527,6 +527,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
>  		uint16_t ehdr;
>  		uint8_t cs_flags = 0;
>  		uint64_t tso = 0;
> +		uint16_t tso_segsz = 0;
>  #ifdef MLX5_PMD_SOFT_COUNTERS
>  		uint32_t total_length = 0;
>  #endif
> @@ -622,6 +623,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
>  
>  				tso_header_sz = buf->l2_len + vlan_sz +
>  						buf->l3_len + buf->l4_len;
> +				tso_segsz = buf->tso_segsz;
>  
>  				if (is_tunneled	&& txq->tunnel_en) {
>  					tso_header_sz += buf->outer_l2_len +
> @@ -821,7 +823,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n)
>  			};
>  			wqe->eseg = (rte_v128u32_t){
>  				0,
> -				cs_flags | (htons(buf->tso_segsz) << 16),
> +				cs_flags | (htons(tso_segsz) << 16),
>  				0,
>  				(ehdr << 16) | htons(tso_header_sz),
>  			};
> -- 
> 2.12.0

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

-- 
Nélio Laranjeiro
6WIND

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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix TSO segment size
  2017-06-20  7:13 ` Nélio Laranjeiro
@ 2017-06-21  9:57   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-06-21  9:57 UTC (permalink / raw)
  To: Nélio Laranjeiro, Shahaf Shuler; +Cc: adrien.mazarguil, dev, stable

On 6/20/2017 8:13 AM, Nélio Laranjeiro wrote:
> On Tue, Jun 20, 2017 at 08:24:47AM +0300, Shahaf Shuler wrote:
>> In case on multi segment packet, the TSO segment size
>> was taken from the last segment. This may lead to incorrect
>> values in case not all segments are initialized with the field.
>>
>> Fixing it by taking the value from the first segment.
>>
>> Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
>> Acked-by: Yongseok Koh <yskoh@mellanox.com>

> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2017-06-21  9:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-20  5:24 [dpdk-dev] [PATCH] net/mlx5: fix TSO segment size Shahaf Shuler
2017-06-20  7:13 ` Nélio Laranjeiro
2017-06-21  9:57   ` 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).