net/fm10k: fix Tx prepare to set positive rte_errno
authorAndrew Rybchenko <arybchenko@solarflare.com>
Wed, 5 Jun 2019 08:15:58 +0000 (09:15 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Jun 2019 14:54:30 +0000 (23:54 +0900)
Fixes: 9b134aa39716 ("net/fm10k: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
drivers/net/fm10k/fm10k_rxtx.c

index cc95f95..2f4dad0 100644 (file)
@@ -698,25 +698,25 @@ fm10k_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 
                if ((m->ol_flags & PKT_TX_TCP_SEG) &&
                                (m->tso_segsz < FM10K_TSO_MINMSS)) {
-                       rte_errno = -EINVAL;
+                       rte_errno = EINVAL;
                        return i;
                }
 
                if (m->ol_flags & FM10K_TX_OFFLOAD_NOTSUP_MASK) {
-                       rte_errno = -ENOTSUP;
+                       rte_errno = ENOTSUP;
                        return i;
                }
 
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
                ret = rte_validate_tx_offload(m);
                if (ret != 0) {
-                       rte_errno = ret;
+                       rte_errno = -ret;
                        return i;
                }
 #endif
                ret = rte_net_intel_cksum_prepare(m);
                if (ret != 0) {
-                       rte_errno = ret;
+                       rte_errno = -ret;
                        return i;
                }
        }