From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f97.google.com (mail-qv1-f97.google.com [209.85.219.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E5EB355F4E for ; Fri, 27 Feb 2026 22:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.97 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772231709; cv=none; b=ToliDMPc5r4yNME/osX5z1ytChuTYXPEB4x6pA+mNleMUo5VhSMTaSpMzEILMGMmIaoPXshnO7Yguvpq0dVvJHnRSmCNyMj7wBb5XGbqpA08ViDR7rPSqkeaZLC5jBlclwU9mpnu4cpfIXxnrQOSfIpWon4Mb1tArhsGQvvAXus= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772231709; c=relaxed/simple; bh=4mY3cJ9odN+C0yuy3lnfg6eSnPBftceED+7+u938yws=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Io6WG7bj2qlZJxT3ZxJoIiYXOzsG8ZoWEst3GTjdJ5/rIrTxYlDJ1D8qrefuOlkCI2XDqjrKwNxwloenGI4reDO6BqV01bJKwk2QOdJekYxlG4/x/a/hl3d2pA/X1LeuVa4chx4DaDQSxHWRth3nDngmtZUg/hZc2N7JEwOIn5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=SZyPbJFS; arc=none smtp.client-ip=209.85.219.97 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="SZyPbJFS" Received: by mail-qv1-f97.google.com with SMTP id 6a1803df08f44-899ae5bb086so3430916d6.1 for ; Fri, 27 Feb 2026 14:35:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1772231707; x=1772836507; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RUIpiL+ETinhgcxbF3zsLQKsMyyJnBp6MmzUqHPBa/s=; b=SZyPbJFSpvxYp3BFPtnNaaah/Rd7JXzHV9WisoqBVR9yh9Nn7v9rlklPiytfLc4HFU J6hw+7YgMtwDi+Dy062hhNB1T5yn1QnGgCSJcUBzdC8sWYX2LXF7Er0kjEcnAVNwy/6R VyncUT36KZLAe+vaCYdRNceIYV/H1mHXGhqzpD2YmNWfOhRZ+mtKqgfkEqeG6Gb1b2bD brk0CzvqS7VZax0y+BxEOndqsCmQEWFgPi/C1+0zgCFm05s52z9QHNkW4R/1zRkETxGk mDgVw7zUOwekFt0ZzNRRqw2n+iofEVuIhyq0I+BvhtQOlufXPrFl/NyCMJMZl60+yA+g 3zEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772231707; x=1772836507; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RUIpiL+ETinhgcxbF3zsLQKsMyyJnBp6MmzUqHPBa/s=; b=HQUsbKJj1oI27oCN87myERwYGOdJu/nOIAztBXBvYrg6YyDCetUHxYkNlUzB7zTF8P jld9CvRk4KBIA0wDsaWO4sgoybSXNmPFiYpG4JgHGlBg/eiPJaTRYBoyFig5VcjeP86A QAcTM+xHcpbjt194QsO4FT0qrCFVU/2Ur2/bY22NA8J/vWaOOYESPeaIGEiPfmRA8G// VCZmPwEgsNqnIP0QcORyADPK936cqrrUMYS+YnT3WXXnfQXSv5sQj6esKTU+1z/joFW8 4Or/AsCYrJ6xGe68i7hUtkRucAm2v5sCoNExlVzB6RuAm0xxXKzvqSxGgXmDfHn75ZJ4 U28w== X-Forwarded-Encrypted: i=1; AJvYcCXh8JhK4bk+vccr/Gt2s8xRAHrPLEWlljYlbZOlT70zczBACm1jOmFJPsrdhwo0W6llEaAwNiigocFPy1U=@vger.kernel.org X-Gm-Message-State: AOJu0YylyuZRXmwqgmdGvk076GPdViM+zsFl/R6K5d6XmdCF+2qBY9et f0A8GAD7Hxa+Wws64InH7TwRm/yKMZ4aT/7o9cbdnI13AtEGTMItATiWOv+g27oZr9KwH44cA2N FzGW1x3q+UgcZqzrS1B3HiUjF0xImcquhDdv2 X-Gm-Gg: ATEYQzyvXZHAdzKWdsHRGCG/qbBsd0WZdlvcme0Zf1a72Jan2Lnumg0H7zTO3qSoReR beXMq7GInnJXWh5+vl7iLHTZK7H2iQcfC7JG/Eotfntz5EPae7WakKpH1aIVq1a4kP/hdu+Xy5T OVb/Z9hYOpcHA/nzIt8kyldhdskiODFet0/uqYrDKX1+/tqPXjPI4EINVbw5/yxvfpQaPFpxnCm jHATkj4Ir8CSZJHFGVa1n4AHFX4m8iGGQ2JXl8ZTAKZH3aXWS+yB+NHQaIytxFIr+en5nyjJ9s2 pdiMeKgvD+3yYjTNUVMlUmnZZidNBSnzMkVF93tbbyc/r+baMrH+os7ikujHgjiH8zAcidRM80z XDPhvbfTwQ7ZKImSOZWUDtrlHhafjdzT7+tg/StVgB2LwWLbVb4X4Gw== X-Received: by 2002:a05:6214:800a:b0:897:ac:13f0 with SMTP id 6a1803df08f44-899d1d861aemr47334816d6.1.1772231707333; Fri, 27 Feb 2026 14:35:07 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 6a1803df08f44-899c7154514sm5901616d6.7.2026.02.27.14.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 14:35:07 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.112.29.101]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 9592634076F; Fri, 27 Feb 2026 15:35:06 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 8937FE420D8; Fri, 27 Feb 2026 15:35:06 -0700 (MST) From: Caleb Sander Mateos To: Jens Axboe , Christoph Hellwig , Keith Busch , Sagi Grimberg Cc: io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Anuj Gupta , Kanchan Joshi , Ming Lei , Caleb Sander Mateos Subject: [PATCH v4 0/5] io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL Date: Fri, 27 Feb 2026 15:34:58 -0700 Message-ID: <20260227223504.1162421-1-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently, creating an io_uring with IORING_SETUP_IOPOLL requires all requests issued to it to support iopoll. This prevents, for example, using ublk zero-copy together with IORING_SETUP_IOPOLL, as ublk zero-copy buffer registrations are performed using a uring_cmd. There's no technical reason why these non-iopoll uring_cmds can't be supported. They will either complete synchronously or via an external mechanism that calls io_uring_cmd_done(), io_uring_cmd_post_mshot_cqe32(), or io_uring_mshot_cmd_post_cqe(), so they don't need to be polled. Allow uring_cmd requests to be issued to IORING_SETUP_IOPOLL io_urings even if their files don't implement ->uring_cmd_iopoll(). Use a new REQ_F_IOPOLL flag to track whether a request is using iopoll. This makes the iopoll_queue opcode definition flag unnecessary. The last commit removes an unnecessary IO_URING_F_IOPOLL check in nvme_dev_uring_cmd() as NVMe admin passthru commands can be issued to IORING_SETUP_IOPOLL io_urings now. v4: check non-iopoll CQEs against min_events in io_iopoll_check() (Ming) v3: fix REW -> REQ typo (Anuj) v2: - Add REQ_F_IOPOLL request flag, remove redundant iopoll_queue - Split IORING_OP_URING_CMD128 fix to a separate commit Caleb Sander Mateos (5): io_uring: add REQ_F_IOPOLL io_uring: remove iopoll_queue from struct io_issue_def io_uring: count CQEs in io_iopoll_check() io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL nvme: remove nvme_dev_uring_cmd() IO_URING_F_IOPOLL check drivers/nvme/host/ioctl.c | 4 ---- include/linux/io_uring_types.h | 3 +++ io_uring/io_uring.c | 28 +++++++--------------------- io_uring/opdef.c | 10 ---------- io_uring/opdef.h | 2 -- io_uring/rw.c | 11 ++++++----- io_uring/uring_cmd.c | 9 ++++----- 7 files changed, 20 insertions(+), 47 deletions(-) -- 2.45.2