summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShahaf Shuler <shahafs@mellanox.com>2017-09-17 11:12:49 +0300
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-06 02:49:48 +0200
commit96fc8d6561b1b1348af97c2ed275922315d228c4 (patch)
tree9eaccb88a3cfa64036c9f22d967c5283c180a39a
parentf46900d03823aff1cb636a2f889caeee99c721b2 (diff)
downloaddpdk-96fc8d6561b1b1348af97c2ed275922315d228c4.zip
dpdk-96fc8d6561b1b1348af97c2ed275922315d228c4.tar.gz
dpdk-96fc8d6561b1b1348af97c2ed275922315d228c4.tar.xz
net/mlx5: fix TSO segment size verification
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>
-rw-r--r--drivers/net/mlx5/mlx5_rxtx.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index bc1f85c..8a1829a 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;