net/bnxt: fix Tx with multiple mbuf
authorXiaoxin Peng <xiaoxin.peng@broadcom.com>
Thu, 28 Jun 2018 20:15:40 +0000 (13:15 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 2 Jul 2018 23:35:58 +0000 (01:35 +0200)
When using multi-mbuf to xmit large packets, we need to use total
packet lengths (sum of all segments) to set txbd->flags_type.
Packets will not be sent when using tx_pkt->data_len(The first
segment of packets).

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Xiaoxin Peng <xiaoxin.peng@broadcom.com>
Reviewed-by: Herry Chen <herry.chen@broadcom.com>
Reviewed-by: Jason He <jason.he@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_txr.c

index 68645b2..e85511f 100644 (file)
@@ -160,10 +160,10 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
                *cmpl_next = false;
        }
        txbd->len = tx_pkt->data_len;
-       if (txbd->len >= 2014)
+       if (tx_pkt->pkt_len >= 2014)
                txbd->flags_type |= TX_BD_LONG_FLAGS_LHINT_GTE2K;
        else
-               txbd->flags_type |= lhint_arr[txbd->len >> 9];
+               txbd->flags_type |= lhint_arr[tx_pkt->pkt_len >> 9];
        txbd->address = rte_cpu_to_le_32(rte_mbuf_data_iova(tx_buf->mbuf));
 
        if (long_bd) {