From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f100.google.com (mail-ot1-f100.google.com [209.85.210.100]) (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 0E04241C2FD for ; Mon, 2 Mar 2026 17:29:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772472564; cv=none; b=P+YcxcBZQlFkiWDmSzsGo/x2nM9+IyXBzpjmINzUZYrrVDu1ryPjODaXhGkl+5b8Y+mm/Pgb+3wdrIAjzTM5pLU1KreCLtWAUOGs76iquEe6dtCX9uHFJAWpDRPDJ8uppJ4rjTcSAxtGA8xI2l+nduyWWySe9GbILJofSJkw0J8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772472564; c=relaxed/simple; bh=tNf7vH82DXpbm+18bIBSTYtImsiPs9CXTfqOFBdoftQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SObqp7jq4Xt2A8zZCPNasJs/ycm/tEe9Pyf0C2GI1jV/6JE2DHPWelRf1WBXBlF0O9e2/I6IWs3TS6M5+i+e+04NWLUv1bsTvb2dA81c0octI7CuFxgspWaT99Xjd34e553fcjgYmb40K0sifT7Av6jAVOLrk0xdbqaYcqZCLcQ= 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=GBnhs3gE; arc=none smtp.client-ip=209.85.210.100 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="GBnhs3gE" Received: by mail-ot1-f100.google.com with SMTP id 46e09a7af769-7d18d2f87c4so824866a34.1 for ; Mon, 02 Mar 2026 09:29:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1772472562; x=1773077362; 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=tuZ5NgGmMK+fSDZK0DCtbPhVzRqmyqfPDxUv7waUs3k=; b=GBnhs3gEv2XJ9e/TqDIGG6W2GX1y+S8h3LdvpIrP9lkeU8qUl7gHZdVmCyIiVwy7BZ bAnkk+42Rkc1c5xEgi8nhd7uVTfqCRJwQb/Mln+RuUynnO9l1oySpyFyG0vjvpF3Av5b Iyy9Z76C+YgyId5vjEHV1sTPWaW2DXix2jkduMjGh6K08+rdb+0N9B3IvkTKlenDvwjR AlXuX7ft1LOCfKPonXgb1z5FXDwdhcaOfGRf4bKgkQ0bput7qUJMsC0XOXWLz7w5TYzi cb/jZTPTvrY37MAtfxcemvuv1QlmLBIC+9ee0U3iES7Ry43k+VzNalJWsVM6u3f/w5Gg 1g0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772472562; x=1773077362; 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=tuZ5NgGmMK+fSDZK0DCtbPhVzRqmyqfPDxUv7waUs3k=; b=T9FOvOeY+BkGV8KXNMOEjDhJ8t9tnEC/Uj8i1DD1qw5+cNC1ibD5tLaDDnF7qI67H8 mpyg/Bi6WbTesqqId/AJrL7gWvwSBr5bX7wCho9T5t5p4ANM2DxCvIz2xB0RxLOVhEAv vAwgXf/slUZhuwigxqevl4IXd2v5gwNeZdC9l/s1B/3Tbf41XFi389ezyJTiMTAk3zKG LIHgwS/wFaDJ4Fu37GmCJT2hh9MDzc5gRD6n6oONwG9hVEpPV79xfd9u3Mj+rfcVFRxZ IwIwV2k8OdLA5j014lLQJz1mf0ndWrszv10TkhxO/8OwNDCMNW0DayDGRLErCQfVwqYB L0Rw== X-Forwarded-Encrypted: i=1; AJvYcCV/0qUHqkRQEKQhHX74ZPpqIkQaTLxkWYnMh6y1/jYl8oWPtwa3OQMyWnnrn79s/0yiQWHAnXBeh2PYnBM=@vger.kernel.org X-Gm-Message-State: AOJu0Yys5Ge/gb/VxMIjre04ddH38rbi5o1gotwwi9zWTm77Xt7haX1Y Ct+ZO3ofDIfIfvO6kEeOyqgZJyi5Hk3KsvqN4UjRZQPyj4C/5cQ1dvKGpW92QHerJGTI3iG4jHx dXyCcot6i2OADOcL+tLd5igd6y0XG0X6toMNF X-Gm-Gg: ATEYQzyGkeVWYfE9svQ7rD1CvMfrR8at11T+kd7sgTrJmmxR3WfZD4T8MGtH7dNfnnQ DA/898Cux8toJ0cHBV8CLEhr7o42yi1/qPMWNMhnyZb4P9zBM0YmoEwGkgToES3dxb0xoLBagkY wqmU9CNbhrrMGJwZkgRg5chj4IuJ27XkhlRI/Vui9AAjhcMFo3yfc7VpaBgE02BBZWBGdscI9uO t7BPegALgKaAcZCHf2H8THM20xJApMj5+BMx51Vwwe0u1Zsg7hnr7OPGqKEnBcwbFvwjSYAld2i SzVt5XytxIdgg5Po+kuWKVUAUtdL4vpGopTyCRyjkKM8ApcayO/ijNsMrOVJcSuKI6CEBCzfksL R3aq2V4tfdVug6U705kZcJ43wDtUQOSROVEgublEoCdOV8w/XVHoawA== X-Received: by 2002:a05:6830:718b:b0:7d1:474a:191f with SMTP id 46e09a7af769-7d591a02761mr7098900a34.0.1772472561822; Mon, 02 Mar 2026 09:29:21 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 46e09a7af769-7d5865024ffsm1764607a34.4.2026.03.02.09.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2026 09:29:21 -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 09317340199; Mon, 2 Mar 2026 10:29:21 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 00D5AE41FBD; Mon, 2 Mar 2026 10:29:20 -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 v5 0/5] io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL Date: Mon, 2 Mar 2026 10:29:09 -0700 Message-ID: <20260302172914.2488599-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. v5: perform one iteration of iopoll when min_events == 0 (Claude) 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 | 19 ++++++------------- io_uring/opdef.c | 10 ---------- io_uring/opdef.h | 2 -- io_uring/rw.c | 11 ++++++----- io_uring/uring_cmd.c | 9 ++++----- 7 files changed, 19 insertions(+), 39 deletions(-) -- 2.45.2