From nobody Wed Nov 18 16:15:16 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jV6Br2zqmz6w3X2 for ; Wed, 18 Nov 2026 16:15:16 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jV6Br2VRlz4Nsp for ; Wed, 18 Nov 2026 16:15:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795018516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6s4KVIpT9mWOaCZ6UfcflLk32oUr7NBkk+wUm2UJYqo=; b=NlQXqaN//MMNNCk1JxR4JtUcQQynW0vsVbZVehnty18rREt3Sg4b0JepZRj2rcNNZF/LCo UZVKObCdxWou/QbZehiC0brAafYciejoG3nKmj/Fy8Png1JhiGvogAhjnFG5o5zezmKFdJ RftQrkPPsYQrMSdiv276fAI0aKh056eYB0d0lZkY6xI+bK7qUhUruhfBn2RbkXawPwlIYJ 3Yk1pse5sDk9olRxknEr258rM9Hmo/dLseii1bFuQwClyOA6JY+Z47Ez9UtoByhWZBSyz7 /BBOBkSlQwP8jtsFoW/C0CUOLlFMn9IHucT5R0r4BKDtVyIzbrPox67MlmeOFQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795018516; b=xQ7YryQQ6SuxQr5DobGahuLZ1TMTOrl4yRaR56lyuXI8CpRbfIa3LXgwjXfcOuFq0mCEda K4NrbdI7MIA1SXmFZ9MGsu06P4cCaEj5XD5cfZpHRWHn5XxwScQyuF1WMo4Ls1BFdBz6S7 NZZi8T6tWm0KohS87d0S5PiK+ZpIJLgScNs9PHeswlafb0yfbLxkR1bLA/uzhxLuOwPS6o lJQ1ACIY2M6D2iyCBqdASiIPg4X54TOql7diD86oLmPjWTyPM4Z3Ta3SuJB+bSmZAU3gGG HCsrA7s7vQ8I9BkWITEb4ZgFmcOxltxzA774lYnHBj0wEZTGlDR9EULwq43naQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795018516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6s4KVIpT9mWOaCZ6UfcflLk32oUr7NBkk+wUm2UJYqo=; b=odGoK/QtRA7x9loyYa9j6QqDeIo41ouu5EjTNHgtaZoZoGUeZwrgl/cxKSQXD95Twc/QR8 K+O3qP2eggQqIjA696H6aS3giFcY1CaPM13cTukIEXsZGb3C1MSqwxjgOdpprE6qFSUyVm BoFu04dtrXeX8g8cfulGcWJ7eJwNahORIwdh7tTe26sl4SYd9G51lsSBzWftRd7qkNYTSn OMCXdc7UrscxEV41dWWZlX3WtbSFBPwWxyucCzkeazXhpcVxVLXOsy5/XxIojf7v9xO0UA oJkalmXzWBs4T3/kmF7r3ufRBLX3zbdwACwLLWItKylusW44tKLDn89BzM2geg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jV6Br29m4zL3c for ; Wed, 18 Nov 2026 16:15:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3382 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Nov 2026 16:15:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: R. Christian McDonald Subject: git: cb9e8ccf4ff0 - main - opencrypto: Do not requeue a re-dispatched request as ordered List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rcm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb9e8ccf4ff0919a7b1e1801e3c0a5a0f4bc11a8 Auto-Submitted: auto-generated Date: Wed, 18 Nov 2026 16:15:16 +0000 Message-Id: <6afdcf14.3382.119b7448@gitrepo.freebsd.org> The branch main has been updated by rcm: URL: https://cgit.FreeBSD.org/src/commit/?id=cb9e8ccf4ff0919a7b1e1801e3c0a5a0f4bc11a8 commit cb9e8ccf4ff0919a7b1e1801e3c0a5a0f4bc11a8 Author: R. Christian McDonald AuthorDate: 2026-11-18 16:10:24 +0000 Commit: R. Christian McDonald CommitDate: 2026-11-18 16:14:05 +0000 opencrypto: Do not requeue a re-dispatched request as ordered crypto_dispatch_async() marks an ordered request with CRYPTO_F_ASYNC_ORDERED and gives it a sequence number. The return thread runs the callbacks in sequence and only takes the head of its ordered queue when the head carries the next number. When a driver unregisters, the request completes with EAGAIN and the ESP and AH callbacks dispatch it again with crypto_dispatch(). The flag is still set, so crypto_done() puts the request back on the ordered queue under the number the return thread has already passed. The head of the queue never matches again, and no ordered request of any session on that return worker completes after that. Before crypto_dispatch_async() existed, crypto_dispatch() gave such a request a new sequence number. Clear the flag when the return thread takes a request off the ordered queue, so a request that is dispatched again completes like any other. Reviewed by: markj Fixes: 68f6800ce05c ("opencrypto: Introduce...") MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D61516 --- sys/opencrypto/crypto.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index 9fa017902a19..b268d23ac223 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -1883,6 +1883,15 @@ crypto_ret_thread(void *arg) if (crpt->crp_seq == ret_worker->reorder_cur_seq) { TAILQ_REMOVE(&ret_worker->crp_ordered_ret_q, crpt, crp_next); ret_worker->reorder_cur_seq++; + + /* + * The sequence number is spent. A callback + * that dispatches the request again, as + * consumers do after EAGAIN, must not bring it + * back to this queue under a number the + * thread will never wait for again. + */ + crpt->crp_flags &= ~CRYPTO_F_ASYNC_ORDERED; } else { crpt = NULL; }