Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Mar 2021 03:01:31 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: cec95c506540 - stable/12 - Replace STAILQ_SWAP() with simpler STAILQ_CONCAT().
Message-ID:  <202103150301.12F31Vc0098046@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by mav:

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

commit cec95c50654097b8cb8e595abda7cae7a01d5884
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2021-03-02 23:39:44 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2021-03-15 02:54:34 +0000

    Replace STAILQ_SWAP() with simpler STAILQ_CONCAT().
    
    Also remove stray STAILQ_REMOVE_AFTER(), not causing problems only
    because STAILQ_SWAP() fixed corrupted stqh_last.
    
    MFC after:      1 week
    
    (cherry picked from commit df3747c6607be12d48db825653e6adfc3041e97f)
---
 sys/dev/iscsi/icl_soft.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c
index ce0bb3bd4d2d..d4333b64a77c 100644
--- a/sys/dev/iscsi/icl_soft.c
+++ b/sys/dev/iscsi/icl_soft.c
@@ -870,7 +870,6 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue)
 				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);
 			}
 #if 0
@@ -909,13 +908,11 @@ icl_send_thread(void *arg)
 	for (;;) {
 		for (;;) {
 			/*
-			 * If the local queue is empty, populate it from
-			 * the main one.  This way the icl_conn_send_pdus()
-			 * can go through all the queued PDUs without holding
-			 * any locks.
+			 * Populate the local queue from the main one.
+			 * This way the icl_conn_send_pdus() can go through
+			 * all the queued PDUs without holding any locks.
 			 */
-			if (STAILQ_EMPTY(&queue))
-				STAILQ_SWAP(&ic->ic_to_send, &queue, icl_pdu);
+			STAILQ_CONCAT(&queue, &ic->ic_to_send);
 
 			ic->ic_check_send_space = false;
 			ICL_CONN_UNLOCK(ic);



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