[dpdk-dev] net/mlx5: fix TSO segment size verification

Message ID 20170917081249.65181-1-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 Sept. 17, 2017, 8:12 a.m. UTC
  TSO segment size must be larger then 0.

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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Nélio Laranjeiro Sept. 18, 2017, 11:41 a.m. UTC | #1
On Sun, Sep 17, 2017 at 11:12:49AM +0300, Shahaf Shuler wrote:
> TSO segment size must be larger then 0.
> 
> 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>
  
Ferruh Yigit Sept. 18, 2017, 9:02 p.m. UTC | #2
On 9/18/2017 12:41 PM, Nélio Laranjeiro wrote:
> On Sun, Sep 17, 2017 at 11:12:49AM +0300, Shahaf Shuler wrote:
>> TSO segment size must be larger then 0.
>>
>> 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.
  

Patch

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index bc1f85c93..8a1829aa7 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -475,7 +475,10 @@  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 (unlikely(tso_segsz == 0)) {
+					txq->stats.oerrors++;
+					break;
+				}
 				if (is_tunneled	&& txq->tunnel_en) {
 					tso_header_sz += buf->outer_l2_len +
 							 buf->outer_l3_len;