From patchwork Thu Jan 12 15:57:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13098308 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 1AECAC61DB3 for ; Thu, 12 Jan 2023 16:06:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234146AbjALQGV (ORCPT ); Thu, 12 Jan 2023 11:06:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231540AbjALQF4 (ORCPT ); Thu, 12 Jan 2023 11:05:56 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 757435B140; Thu, 12 Jan 2023 07:57:22 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id 19B917E74F; Thu, 12 Jan 2023 15:57:18 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1673539042; bh=UYpDXwZvwHbe48e65mtN6pHUviQzgszbG46MFmI56ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sNngbj7Vdp6MBFjnWAeXEGwcIs1rDlPB02I2Nmlf6lxcXURCo/d7XOBNMJokkV6iG b70hBUw6pFXQygPxdsYIsSd7rTvaO2+dI/jkg5o9ushlJyngq8y/1QKTiG6ms+fLj/ GYW9a7y75EIecS/Wd7xtYsR/mbCovhcPnMWsoUmQplnQvLXvpl6Fc55AIOcuiPVKJ/ PtVlxlDUIHwWn4Md4B4EZ0FRsVtpm0U/ZhWH8BL8Db6ZvzC+ZATTJrQWWtynjlEXke tEs6FWse9GSIU7ULrgE9rAA8eJeAwD1WZY99gaeCjJZs6ezOZHDGlJvbvtrzZs2mbo SnRw74do9Cy5g== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , Breno Leitao , Christian Mazakas , Gilang Fachrezy , VNLX Kernel Department , io-uring Mailing List , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 1/4] liburing-ffi.map: Add io_uring_prep_msg_ring_cqe_flags() function Date: Thu, 12 Jan 2023 22:57:06 +0700 Message-Id: <20230112155709.303615-2-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112155709.303615-1-ammar.faizi@intel.com> References: <20230112155709.303615-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Commit 27180d7be059 ("Add io_uring_prep_msg_ring_cqe_flags function") adds a new inline function in liburing.h, but it doesn't update the liburing-ffi.map file. Update it. Cc: Breno Leitao Cc: Christian Mazakas Fixes: 27180d7be059 ("Add io_uring_prep_msg_ring_cqe_flags function") Signed-off-by: Ammar Faizi --- src/liburing-ffi.map | 1 + 1 file changed, 1 insertion(+) diff --git a/src/liburing-ffi.map b/src/liburing-ffi.map index 8dd4641..1a6df50 100644 --- a/src/liburing-ffi.map +++ b/src/liburing-ffi.map @@ -164,6 +164,7 @@ LIBURING_2.4 { io_uring_register_restrictions; io_uring_prep_write; io_uring_prep_recv; + io_uring_prep_msg_ring_cqe_flags; local: *; }; From patchwork Thu Jan 12 15:57:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13098309 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 E8F1FC54EBC for ; Thu, 12 Jan 2023 16:06:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233842AbjALQGX (ORCPT ); Thu, 12 Jan 2023 11:06:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232398AbjALQF7 (ORCPT ); Thu, 12 Jan 2023 11:05:59 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E08E5F51; Thu, 12 Jan 2023 07:57:26 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id CA16B7E3C3; Thu, 12 Jan 2023 15:57:22 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1673539045; bh=D7CklgKgJs2Oydmin9qwbjCd+vetbLK0Jx9DpaoIbvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lL6Ofjip9z8ukFTSnfNprKPB1bG5VNc3JH8auXBNUeK5vrVAo7RL3+EaiokXOVMYC puh+vzx4+DQoMl/FWAhsW+eNLUPXt63zAof3s78dXNpPRMvxF0ZsJWDybEWTdmIo1/ dsPnMYt+YC2nQ3ahcWAqjrUGWO6yrvctt8E7+aOxwJ0cFeMsD5k3QnMdN8mIgEOKu7 1leRG5h+KX2wl+PPJCIis38dWh11GjpWWJv08myZ/SqG+vkLrgfDHB2+vfY+/nN5WJ hzn00vEb+qEoTFGVrdDBB+i5i4gkfpQmVhCrjBIdXma2e9ZGMV7DNhZMEjA5sFFGP4 YDANF6ThXn3YQ== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , Breno Leitao , Christian Mazakas , Gilang Fachrezy , VNLX Kernel Department , io-uring Mailing List , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 2/4] CHANGELOG: Note about --nolibc configure option deprecation Date: Thu, 12 Jan 2023 22:57:07 +0700 Message-Id: <20230112155709.303615-3-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112155709.303615-1-ammar.faizi@intel.com> References: <20230112155709.303615-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Since commit bfb432f4cce5 ("configure: Always enable `CONFIG_NOLIBC` if the arch is supported"), the --nolibc configure option is deprecated and has no effect. Plus, building liburing on x86-64, x86, and aarch64 always enables CONFIG_NOLIBC. Note these changes in the CHANGELOG file. Signed-off-by: Ammar Faizi --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 93c500f..0722aae 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,8 @@ liburing-2.4 release - Add IO_URING_{MAJOR,MINOR,CHECK}_VERSION() macros. - FFI support (for non-C/C++ languages integration). - Add io_uring_prep_msg_ring_cqe_flags() function. +- Deprecate --nolibc configure option. +- CONFIG_NOLIBC is always enabled on x86-64, x86, and aarch64. liburing-2.3 release From patchwork Thu Jan 12 15:57:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13098310 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 220F2C61DB3 for ; Thu, 12 Jan 2023 16:06:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232632AbjALQGY (ORCPT ); Thu, 12 Jan 2023 11:06:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232105AbjALQGA (ORCPT ); Thu, 12 Jan 2023 11:06:00 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F308255A0; Thu, 12 Jan 2023 07:57:29 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id 828207E73D; Thu, 12 Jan 2023 15:57:26 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1673539049; bh=yBIS9FwtQ5Dko+wK3qpwtAbxSv3Mr7MwLjxCXmCrwJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VRhTJJtT7xipuhKIcbDWNpa3bZwFbtObAXw6wF+Dl+VcaCdXtCRJDpaQjyXtKcP1L 9MUhrW916qnhV41VTKo5o3gNvwdJpeJjB5nDF709zKVO66FWKM43sw6/diSDuWMNMt kCPR9m2ypRGV41EdZBzkv5dxdl4h71twSrN2QYx6ZKkHsGI9kvTXO95OmCRvn2IuJ+ WkaEVZNrIzH1D8EOgV/FcMMwZTMpV38+FSDnLYFmtOi+NP4Ap4tRRj8pUSYHDqhLKV mkpFfCm20bcqHPVUKmRyP9ipUMp/rwCGCUmK+bCFnEaPRO+kaGYkAikF63mlJ/lOsE BLAEZ/DRiV/iQ== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , Breno Leitao , Christian Mazakas , Gilang Fachrezy , VNLX Kernel Department , io-uring Mailing List , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 3/4] liburing.h: 's/is adjust/is adjusted/' and fix indentation Date: Thu, 12 Jan 2023 22:57:08 +0700 Message-Id: <20230112155709.303615-4-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112155709.303615-1-ammar.faizi@intel.com> References: <20230112155709.303615-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi - Fix a typo: 's/is adjust/is adjusted/'. - Fix indentation. Signed-off-by: Ammar Faizi --- src/include/liburing.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/liburing.h b/src/include/liburing.h index cc3677e..c7139ef 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -388,8 +388,8 @@ IOURINGINLINE void io_uring_prep_rw(int op, struct io_uring_sqe *sqe, int fd, * @param off_in If fd_in refers to a pipe, off_in must be (int64_t) -1; * If fd_in does not refer to a pipe and off_in is (int64_t) -1, * then bytes are read from fd_in starting from the file offset - * and it is adjust appropriately; - * If fd_in does not refer to a pipe and off_in is not + * and it is adjusted appropriately; + * If fd_in does not refer to a pipe and off_in is not * (int64_t) -1, then the starting offset of fd_in will be * off_in. * @param off_out The description of off_in also applied to off_out. From patchwork Thu Jan 12 15:57:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13098311 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 990F1C54EBD for ; Thu, 12 Jan 2023 16:06:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231906AbjALQG0 (ORCPT ); Thu, 12 Jan 2023 11:06:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232596AbjALQGA (ORCPT ); Thu, 12 Jan 2023 11:06:00 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93CC560C0; Thu, 12 Jan 2023 07:57:33 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id 3ABB57E74D; Thu, 12 Jan 2023 15:57:29 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1673539053; bh=rH47GSDKKNn4IUUqXJmB8n2oZPbSj4OOp9WUqqpcbh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nxvkGyjNUSjXd+lzOaZ4g9MRsycP+OfBHdwmVdPKMl1n+VWlEZdzKXk5V5smNWzyM AkeVdWcijkmoasznjtf/79Ke2SAXtVV8O5agAVVP5Q6iMvFvRYxxxIaIGDGKSGDGu2 toBr5Xra526B60HRmVfd3bb+4csF84dSkiLPRJOG6H2OvR5mliIwZBrWPJbQUDXKK1 O/LTV6P1zi1bTINjXGWcw6mFug5K1Xz+pwaKY0in6LW8CDx6f9m/3H2hU11JTTcYot KHtdqmPGtAddaMn0XHzGcJJKtPVcu5hiTZzijsgrbKcskT6y8OxDMMeSl/6dKbtPWw XvE679r7y4xLg== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , Breno Leitao , Christian Mazakas , Gilang Fachrezy , VNLX Kernel Department , io-uring Mailing List , Linux Kernel Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v1 4/4] man/io_uring_prep_splice.3: Explain more about io_uring_prep_splice() Date: Thu, 12 Jan 2023 22:57:09 +0700 Message-Id: <20230112155709.303615-5-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230112155709.303615-1-ammar.faizi@intel.com> References: <20230112155709.303615-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi I have found two people confused about the io_uring_prep_splice() function, especially on the offset part. The current manpage for io_uring_prep_splice() doesn't tell about the rules of the offset arguments. Despite these rules are already noted in "man 2 io_uring_enter", people who want to know about this prep function will prefer to read "man 3 io_uring_prep_splice". Let's explain it there! Signed-off-by: Ammar Faizi --- Stolen from liburing comment (with some modifications): If `fd_in` refers to a pipe, `off_in` must be -1. If `fd_in` does not refer to a pipe and `off_in` is -1, then bytes are read from `fd_in` starting from the file offset and it is adjusted appropriately. If `fd_in` does not refer to a pipe and `off_in` is not -1, then the starting offset of `fd_in` will be `off_in`. The same rules apply to `fd_out` and `off_out`. Note that even if `fd_in` or `fd_out` refers to a pipe, the splice operation can still failed with `EINVAL` if one of the fd doesn't explicitly support splice operation, e.g. reading from terminal is unsupported from kernel 5.7 to 5.11. man/io_uring_prep_splice.3 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/man/io_uring_prep_splice.3 b/man/io_uring_prep_splice.3 index cb82ad0..a177bc6 100644 --- a/man/io_uring_prep_splice.3 +++ b/man/io_uring_prep_splice.3 @@ -52,6 +52,34 @@ and .I fd_in given as a registered file descriptor offset. +If +.I fd_in +refers to a pipe, +.IR off_in +must be -1. + +If +.I fd_in +does not refer to a pipe and +.I off_in +is -1, then bytes are read from +.I fd_in +starting from the file offset and it is adjusted appropriately. + +If +.I fd_in +does not refer to a pipe and +.I off_in +is not -1, then the starting offset of +.I fd_in +will be +.IR off_in . + +The same rules apply to +.I fd_out +and +.IR off_out . + This function prepares an async .BR splice (2) request. See that man page for details. @@ -78,3 +106,13 @@ field. .BR io_uring_submit (3), .BR io_uring_register (2), .BR splice (2) + +.SH NOTES +Note that even if +.I fd_in +or +.I fd_out +refers to a pipe, the splice operation can still failed with +.B EINVAL +if one of the fd doesn't explicitly support splice operation, e.g. reading from +terminal is unsupported from kernel 5.7 to 5.11.