Ensure packets are available before accessing the mbuf list in Tx
burst function. Otherwise, just reclaim completed Tx descriptors and
exit.
Fixes:
b1df19e43e1d ("net/cxgbe: fix prefetch for non-coalesced Tx packets")
Cc: stable@dpdk.org
Reported-by: Brian Poole <brian90013@gmail.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
t4_os_lock(&txq->txq_lock);
/* free up desc from already completed tx */
reclaim_completed_tx(&txq->q);
+ if (unlikely(!nb_pkts))
+ goto out_unlock;
+
rte_prefetch0(rte_pktmbuf_mtod(tx_pkts[0], volatile void *));
while (total_sent < nb_pkts) {
pkts_remain = nb_pkts - total_sent;
reclaim_completed_tx(&txq->q);
}
+out_unlock:
t4_os_unlock(&txq->txq_lock);
return total_sent;
}