net/ionic: send as many packets as possible
authorAndrew Boyer <aboyer@pensando.io>
Tue, 16 Feb 2021 20:35:38 +0000 (12:35 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 25 Feb 2021 15:58:56 +0000 (16:58 +0100)
Rather than dropping the whole burst if some don't fit.
This improves performance.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Vishwas Danivas <vishwas@pensando.io>
drivers/net/ionic/ionic_rxtx.c

index bb67c49..b4bdeab 100644 (file)
@@ -536,15 +536,16 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
        struct ionic_tx_stats *stats = &txq->stats;
        uint32_t next_q_head_idx;
        uint32_t bytes_tx = 0;
-       uint16_t nb_tx = 0;
+       uint16_t nb_avail, nb_tx = 0;
        int err;
 
        /* Cleaning old buffers */
        ionic_tx_flush(txq);
 
-       if (unlikely(ionic_q_space_avail(q) < nb_pkts)) {
-               stats->stop += nb_pkts;
-               return 0;
+       nb_avail = ionic_q_space_avail(q);
+       if (unlikely(nb_avail < nb_pkts)) {
+               stats->stop += nb_pkts - nb_avail;
+               nb_pkts = nb_avail;
        }
 
        while (nb_tx < nb_pkts) {