ena: Avoid unnecessary mbuf collapses for LLQ condition

In case of Low-latency Queue, one small enough descriptor can be pushed
directly to the ENA hw, thus saving one fragment. Check for this
condition before performing collapse.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
This commit is contained in:
Artur Rojek 2021-08-12 10:34:17 +02:00 committed by Marcin Wojtas
parent 6bc90e8acf
commit c81f8c2611

View File

@ -801,6 +801,11 @@ ena_check_and_collapse_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf)
/* One segment must be reserved for configuration descriptor. */
if (num_frags < adapter->max_tx_sgl_size)
return (0);
if ((num_frags == adapter->max_tx_sgl_size) &&
((*mbuf)->m_pkthdr.len < tx_ring->tx_max_header_size))
return (0);
counter_u64_add(tx_ring->tx_stats.collapse, 1);
collapsed_mbuf = m_collapse(*mbuf, M_NOWAIT,