From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 949D6C32772 for ; Fri, 19 Aug 2022 15:28:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349328AbiHSP2T (ORCPT ); Fri, 19 Aug 2022 11:28:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349649AbiHSP2S (ORCPT ); Fri, 19 Aug 2022 11:28:18 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A47215737 for ; Fri, 19 Aug 2022 08:28:17 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1660922895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KahsA1qAdE1eUEiiRPuPwsPCrW+nKU4ePjzOFyhkWsU=; b=a7bgh/Zt3bmm4SjKncYc75nGnAqMowgGrcEAIBhcTi5aNGovrOmFnkNSSTIAXQdsP4RYcr Djdg9C0FmBeAJQqda/aIqkWu+7rYPSU+O01mNyNmYcHwPuvF4b3J/hNvjTTOEDnCui4EpA MF/fnYJXVlCxGrCQ4UA48xG/hFoMYG8= From: Hao Xu To: io-uring@vger.kernel.org Cc: Jens Axboe , Pavel Begunkov , Ingo Molnar , Wanpeng Li Subject: [PATCH 02/19] io_uring: add IORING_SETUP_URINGLET Date: Fri, 19 Aug 2022 23:27:21 +0800 Message-Id: <20220819152738.1111255-3-hao.xu@linux.dev> In-Reply-To: <20220819152738.1111255-1-hao.xu@linux.dev> References: <20220819152738.1111255-1-hao.xu@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Hao Xu Add a new setup flag to turn on/off uringlet mode. Signed-off-by: Hao Xu --- include/uapi/linux/io_uring.h | 4 ++++ io_uring/io_uring.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index 1463cfecb56b..68507c23b079 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -152,6 +152,10 @@ enum { * Only one task is allowed to submit requests */ #define IORING_SETUP_SINGLE_ISSUER (1U << 12) +/* + * uringlet mode + */ +#define IORING_SETUP_URINGLET (1U << 13) enum io_uring_op { IORING_OP_NOP, diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index ebfdb2212ec2..5e4f5b1684dd 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3226,6 +3226,8 @@ static __cold int io_uring_create(unsigned entries, struct io_uring_params *p, struct file *file; int ret; + if (p->flags & IORING_SETUP_URINGLET) + return -EINVAL; if (!entries) return -EINVAL; if (entries > IORING_MAX_ENTRIES) { @@ -3400,7 +3402,7 @@ static long io_uring_setup(u32 entries, struct io_uring_params __user *params) IORING_SETUP_R_DISABLED | IORING_SETUP_SUBMIT_ALL | IORING_SETUP_COOP_TASKRUN | IORING_SETUP_TASKRUN_FLAG | IORING_SETUP_SQE128 | IORING_SETUP_CQE32 | - IORING_SETUP_SINGLE_ISSUER)) + IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_URINGLET)) return -EINVAL; return io_uring_create(entries, &p, params); -- 2.25.1