From: Andrew Rybchenko Date: Fri, 26 May 2017 13:50:43 +0000 (+0100) Subject: net/sfc: check added but not completed descs on EF10 Tx reap X-Git-Tag: spdx-start~3089 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3fd7797fcda9531885f6242c0e076e8ea65f296f;p=dpdk.git net/sfc: check added but not completed descs on EF10 Tx reap There is not point to check other Tx descriptors. It is important if Tx datapath does not reset Tx descriptor mbuf pointer to NULL on completion (EF10 simple Tx will do). Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton Reviewed-by: David Riddoch --- diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c index 5482db8f81..fdeea2cb4e 100644 --- a/drivers/net/sfc/sfc_ef10_tx.c +++ b/drivers/net/sfc/sfc_ef10_tx.c @@ -516,12 +516,15 @@ static void sfc_ef10_tx_qreap(struct sfc_dp_txq *dp_txq) { struct sfc_ef10_txq *txq = sfc_ef10_txq_by_dp_txq(dp_txq); - unsigned int txds; + unsigned int completed; - for (txds = 0; txds <= txq->ptr_mask; ++txds) { - if (txq->sw_ring[txds].mbuf != NULL) { - rte_pktmbuf_free(txq->sw_ring[txds].mbuf); - txq->sw_ring[txds].mbuf = NULL; + for (completed = txq->completed; completed != txq->added; ++completed) { + struct sfc_ef10_tx_sw_desc *txd; + + txd = &txq->sw_ring[completed & txq->ptr_mask]; + if (txd->mbuf != NULL) { + rte_pktmbuf_free(txd->mbuf); + txd->mbuf = NULL; } }