Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Sep 2021 23:07:32 GMT
From:      Marcin Wojtas <mw@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: c81f8c26115a - main - ena: Avoid unnecessary mbuf collapses for LLQ condition
Message-ID:  <202109012307.181N7WfM020772@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mw:

URL: https://cgit.FreeBSD.org/src/commit/?id=c81f8c26115a64b9a97ecdb2a64e824dd839ee73

commit c81f8c26115a64b9a97ecdb2a64e824dd839ee73
Author:     Artur Rojek <ar@semihalf.com>
AuthorDate: 2021-08-12 08:34:17 +0000
Commit:     Marcin Wojtas <mw@FreeBSD.org>
CommitDate: 2021-09-01 23:05:38 +0000

    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.
---
 sys/dev/ena/ena_datapath.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c
index 15bd09c489cf..c0066b1209cc 100644
--- a/sys/dev/ena/ena_datapath.c
+++ b/sys/dev/ena/ena_datapath.c
@@ -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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109012307.181N7WfM020772>