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
This commit is contained in:
Alexander Motin 2021-03-02 18:39:44 -05:00
parent 09c3f04ff3
commit df3747c660

View File

@ -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);