From owner-dev-commits-src-branches@freebsd.org Mon Mar 15 02:39:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F07356ACE4; Mon, 15 Mar 2021 02:39:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DzLHK1HFtz3MHv; Mon, 15 Mar 2021 02:39:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 039EB86E; Mon, 15 Mar 2021 02:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12F2dr0l061732; Mon, 15 Mar 2021 02:39:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12F2drwQ061731; Mon, 15 Mar 2021 02:39:53 GMT (envelope-from git) Date: Mon, 15 Mar 2021 02:39:53 GMT Message-Id: <202103150239.12F2drwQ061731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 2f77e2810a9d - stable/13 - Replace STAILQ_SWAP() with simpler STAILQ_CONCAT(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2f77e2810a9df87da7c6947ce2b1007d08da131a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Mar 2021 02:39:58 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=2f77e2810a9df87da7c6947ce2b1007d08da131a commit 2f77e2810a9df87da7c6947ce2b1007d08da131a Author: Alexander Motin AuthorDate: 2021-03-02 23:39:44 +0000 Commit: Alexander Motin CommitDate: 2021-03-15 02:36:04 +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 c64f0cfde71b..d579c034e63f 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -933,7 +933,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_pdu_done(request2, 0); } #if 0 @@ -972,13 +971,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);