git: 3034c0dab755 - stable/12 - Optimize TX coalescing by keeping pointer to last mbuf.
Alexander Motin
mav at FreeBSD.org
Mon Mar 15 03:01:32 UTC 2021
The branch stable/12 has been updated by mav:
URL: https://cgit.FreeBSD.org/src/commit/?id=3034c0dab755d29eb24d0187cfc00501b660a9c1
commit 3034c0dab755d29eb24d0187cfc00501b660a9c1
Author: Alexander Motin <mav at FreeBSD.org>
AuthorDate: 2021-03-02 04:31:34 +0000
Commit: Alexander Motin <mav at FreeBSD.org>
CommitDate: 2021-03-15 02:52:57 +0000
Optimize TX coalescing by keeping pointer to last mbuf.
Before m_cat() each time traversed through all the coalesced chain.
MFC after: 1 week
(cherry picked from commit b85a67f54a40053e75658a17c620b89bafaba67f)
---
sys/dev/iscsi/icl_soft.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c
index caeddc9247ba..7c8ca11f4ae3 100644
--- a/sys/dev/iscsi/icl_soft.c
+++ b/sys/dev/iscsi/icl_soft.c
@@ -785,6 +785,7 @@ static void
icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue)
{
struct icl_pdu *request, *request2;
+ struct mbuf *m;
struct socket *so;
long available, size, size2;
int coalesced, error;
@@ -845,8 +846,8 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue)
return;
}
if (coalesce) {
- coalesced = 1;
- for (;;) {
+ m = request->ip_bhs_mbuf;
+ for (coalesced = 1; ; coalesced++) {
request2 = STAILQ_FIRST(queue);
if (request2 == NULL)
break;
@@ -863,13 +864,14 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue)
icl_conn_fail(ic);
return;
}
- m_cat(request->ip_bhs_mbuf, request2->ip_bhs_mbuf);
+ while (m->m_next)
+ m = m->m_next;
+ m_cat(m, request2->ip_bhs_mbuf);
request2->ip_bhs_mbuf = NULL;
request->ip_bhs_mbuf->m_pkthdr.len += size2;
size += size2;
STAILQ_REMOVE_AFTER(queue, request, ip_next);
icl_soft_conn_pdu_free(ic, request2);
- coalesced++;
}
#if 0
if (coalesced > 1) {
More information about the dev-commits-src-all
mailing list