From nobody Fri Oct 25 18:19:59 2024 X-Original-To: dev-commits-src-main@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 4XZrfm4Pn7z5b1Z8; Fri, 25 Oct 2024 18:20:00 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XZrfl5QHTz4Xs3; Fri, 25 Oct 2024 18:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729880399; 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=Fm0PVrzRjDjsxUgS2Pk/PDua+nCeB7/0Sqk5vJHfhpk=; b=da9ahfMCLlHvRFF+nztC39Gcstyrk91huMFb/k2DCrItZpPQ/DFYtcx/4lSIBwolrnSI1N c2e/49dj0ISWhgmD9NxW+LcsAvg5tI4ZgiHD4WZlauhBtBsWA1MQlB3gNwLsbXKP7hzzLd jLdwr4eHBTzFLPkK7JF6J/KdfnQ7we9vnjVoIIH92YxBKX02IYDAylnzSHnV9baJ0RrpC4 OP/87FQwzrANGGVRMkaIs+OB4P4jbH7IqDVF1OfTLzjJZ5wZFqkp1G4eZjBTcQHhLkEtnx 8dMJN2eMWjj49n2LPZjxd5wC2YCfof9mHEwXzgfgDnyD23tWZPIFQCOOzQThwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729880399; 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=Fm0PVrzRjDjsxUgS2Pk/PDua+nCeB7/0Sqk5vJHfhpk=; b=wjMfLXoG9xtONiQxQBKx3aP6dN5vyaWR3sFI7683i31a+IyXZpcl5lGAFoPkApCXOzES1b xZm/ZCF9sgQ+pO2DpzHux/cg4B4FdPH+2XFL6H4JDsGpdFs8whIYztSZ9vkIWiwDlfYcKD 2UZc533GHjqPBCrmtfqBOpotnW3QBV/XVDnpE6MBNy/UFBPYH9raC8gs6AwOYwZymf9Guv +/4NG9yjysKxMrg0OsRkT9bVg66DVgt067zUZ0qeQMAsy8AbxpV0Ev7SsDSqKw/18fC0CR 6QbrKWn0owKu5MQ+jBHrGlkP7t1pVaiOafszSQZWB+6633KY4YczzCWzYyUadg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729880399; a=rsa-sha256; cv=none; b=UCWXsqI/brOmu/9/2wjupNbNBdcIPqcQ5gjIx/+MxVhq6d+4KfIeDJKWQGLQ6D/Fc/pCw2 PJ3mH79XwJ9pWba6nklDOh6HzYI6408+aTW4+cyYhiA7NJodk30vDr2FJrfDgUGMoSs/Vp ibnKS7iw/COqD1WmO/nRMHyaVH+hs8C7auECw1Zg64WylxuONOZPTnfHurnnkcfHCT5p2N fd3s6HzwXfmbdzMGB1OUDkEtrrYs/it8vdlM0ikgRW4/B5KSZTybYelD7PO7FeuRU/hNDJ eiVXE+zkZmi0DUs5y+M/1qXJLqunU1DbWg84zxZ71kRI6avXhE9Gzo3jBUdPPQ== 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 4XZrfl4wXVzc8Z; Fri, 25 Oct 2024 18:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49PIJxcl087339; Fri, 25 Oct 2024 18:19:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49PIJxdS087336; Fri, 25 Oct 2024 18:19:59 GMT (envelope-from git) Date: Fri, 25 Oct 2024 18:19:59 GMT Message-Id: <202410251819.49PIJxdS087336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1f6f247b3526 - main - virtio_p9fs: Check for completions after enabling interrupts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f6f247b3526abd4d5927684735012220aefe373 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1f6f247b3526abd4d5927684735012220aefe373 commit 1f6f247b3526abd4d5927684735012220aefe373 Author: Mark Johnston AuthorDate: 2024-10-25 17:52:22 +0000 Commit: Mark Johnston CommitDate: 2024-10-25 17:53:11 +0000 virtio_p9fs: Check for completions after enabling interrupts Otherwise we can end up with a lost interrupt, causing lost request completion wakeups and hangs in the filesystem layer. Continue processing until we enable interrupts and then observe an empty queue, like other virtio drivers do. Sponsored by: Klara, Inc. --- sys/dev/virtio/p9fs/virtio_p9fs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index 42f47a4f63cb..dae38a507428 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -222,11 +222,15 @@ vt9p_intr_complete(void *xsc) P9_DEBUG(TRANS, "%s: completing\n", __func__); VT9P_LOCK(chan); +again: while ((curreq = virtqueue_dequeue(vq, NULL)) != NULL) { curreq->rc->tag = curreq->tc->tag; wakeup_one(curreq); } - virtqueue_enable_intr(vq); + if (virtqueue_enable_intr(vq) != 0) { + virtqueue_disable_intr(vq); + goto again; + } cv_signal(&chan->submit_cv); VT9P_UNLOCK(chan); }