net/enetc: batch process clean Tx ring calls

Each call to enetc_clean_tx_ring will cost at least 150-200 CPU cycles
even if no clean-up is done, due to the CI register read.
We're only calling it once at the end of the function, on the assumption
that software is slower than hardware and hardware completed sending
older frames out by now.
We're also cleaning up the ring before kicking off Tx for the new batch
to minimize chances of contention on the Tx ring.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Acked-by: Gagandeep Singh <g.singh@nxp.com>
This commit is contained in:
Alex Marginean 2020-03-02 20:02:02 +05:30 committed by Ferruh Yigit
parent 8cb6b561ea
commit 9a6d2fae26

View File

@ -76,7 +76,6 @@ enetc_xmit_pkts(void *tx_queue,
start = 0;
while (nb_pkts--) {
enetc_clean_tx_ring(tx_ring);
tx_ring->q_swbd[i].buffer_addr = tx_pkts[start];
txbd = ENETC_TXBD(*tx_ring, i);
tx_swbd = &tx_ring->q_swbd[i];
@ -92,6 +91,14 @@ enetc_xmit_pkts(void *tx_queue,
i = 0;
}
/* we're only cleaning up the Tx ring here, on the assumption that
* software is slower than hardware and hardware completed sending
* older frames out by now.
* We're also cleaning up the ring before kicking off Tx for the new
* batch to minimize chances of contention on the Tx ring
*/
enetc_clean_tx_ring(tx_ring);
tx_ring->next_to_use = i;
enetc_wr_reg(tx_ring->tcir, i);
return start;