net/qede: fix Tx prepare to set positive rte_errno
authorAndrew Rybchenko <arybchenko@solarflare.com>
Wed, 5 Jun 2019 08:16:03 +0000 (09:16 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Jun 2019 14:54:30 +0000 (23:54 +0900)
Fixes: 29540be7efce ("net/qede: support LRO/TSO offloads")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/qede/qede_rxtx.c

index bae26ce..c38cbb9 100644 (file)
@@ -1798,17 +1798,17 @@ qede_xmit_prep_pkts(__rte_unused void *p_txq, struct rte_mbuf **tx_pkts,
                ol_flags = m->ol_flags;
                if (ol_flags & PKT_TX_TCP_SEG) {
                        if (m->nb_segs >= ETH_TX_MAX_BDS_PER_LSO_PACKET) {
-                               rte_errno = -EINVAL;
+                               rte_errno = EINVAL;
                                break;
                        }
                        /* TBD: confirm its ~9700B for both ? */
                        if (m->tso_segsz > ETH_TX_MAX_NON_LSO_PKT_LEN) {
-                               rte_errno = -EINVAL;
+                               rte_errno = EINVAL;
                                break;
                        }
                } else {
                        if (m->nb_segs >= ETH_TX_MAX_BDS_PER_NON_LSO_PACKET) {
-                               rte_errno = -EINVAL;
+                               rte_errno = EINVAL;
                                break;
                        }
                }
@@ -1825,14 +1825,14 @@ qede_xmit_prep_pkts(__rte_unused void *p_txq, struct rte_mbuf **tx_pkts,
                                        continue;
                        }
 
-                       rte_errno = -ENOTSUP;
+                       rte_errno = ENOTSUP;
                        break;
                }
 
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
                ret = rte_validate_tx_offload(m);
                if (ret != 0) {
-                       rte_errno = ret;
+                       rte_errno = -ret;
                        break;
                }
 #endif