From patchwork Fri Oct 21 13:10:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13014787 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 9D6D2C433FE for ; Fri, 21 Oct 2022 13:14:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230207AbiJUNOp (ORCPT ); Fri, 21 Oct 2022 09:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230360AbiJUNN1 (ORCPT ); Fri, 21 Oct 2022 09:13:27 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE47426D92B for ; Fri, 21 Oct 2022 06:13:10 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id bp11so4462944wrb.9 for ; Fri, 21 Oct 2022 06:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jUAXv1LdZ9pWxJhUJt3wJBd5ntX+l5BKmhILqEYKZpU=; b=XFzw4RgLbQp2MBCBGarorlJ4ZwOZvBkxt0enuMGflHeazGksi+OUWUay7AWFGNGO0y /fLA82eNNdvwp7VjH6I312Eao0yaZYM5Zs2+tMoX9OiTOaNLo8mrK4jMqA+/qoqd4vuK MbaXNZ67+iiI0h1Vn1YV0qeBAHHhEvxESvHcrzlweu61nyqZZUq9Af8rdvONYhkV8JLB Bq9vTd3t3BGNFeFJeARhNdStV/kVuyN3EKUEiBCchWUG3AZuZJguntPgpI6FW9bDmfT7 jMSUHuJCN241KCWOGKaUqT49AvkzByWcFVV/AOjYfL+cVrk7LLKamwUw06hLTsQ7fh2x ezFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jUAXv1LdZ9pWxJhUJt3wJBd5ntX+l5BKmhILqEYKZpU=; b=20MR21EU7IX9dT7TVTs0lOBOKCJa5mvZGlhQ48EHtQiOMKe0sczdmVIkSO3XyPYt1u rBo1DIHqtkDVupU4DAZjFcHxa2DmYX7GgfcRaJdU+d39lH7YlN/Yx+tYpKIv6oAWgrah xOP7/ryPggwzagWt0EmFZs8KUXcEo6ehslDnGmML3n1+74rT+hkNaGbrykKpM1yWFr8M yea5o/mmFoLkIQqkPsEcWV95XhMQqcgsCfFNp02M1gKWs9TUZJ7nphxIBXl5yow6+b8g Eu8zQNFlHw2kzHMbDUQ3y6hoIqHG6WPow5MY7lPpgPkSx/CB8WR0AFWgXqxPgQq3XExu olMQ== X-Gm-Message-State: ACrzQf0tizahmkDwjNd+F+IKm62Pwhfuf8B5+yZcvfqat0XAFBW5NAlg kYTGRXrYatadw6z9KZJkW/fbdDxq7jk= X-Google-Smtp-Source: AMsMyM4hBci2wJvwzBesN2epQXnFWqX5E9paOKIUoebCaP/GU1ZW/oxP1S5tE2LSjUu30DHEN7xVWw== X-Received: by 2002:adf:dd88:0:b0:236:57e3:fc86 with SMTP id x8-20020adfdd88000000b0023657e3fc86mr1052385wrl.493.1666357987794; Fri, 21 Oct 2022 06:13:07 -0700 (PDT) Received: from 127.0.0.1localhost.com ([2620:10d:c092:600::2:f27e]) by smtp.gmail.com with ESMTPSA id n4-20020adf8b04000000b00231893bfdc7sm20739442wra.2.2022.10.21.06.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 06:13:07 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH liburing 1/3] io_uring_enter.2: add sendzc -EOPNOTSUPP note Date: Fri, 21 Oct 2022 14:10:58 +0100 Message-Id: X-Mailer: git-send-email 2.38.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Signed-off-by: Pavel Begunkov --- man/io_uring_enter.2 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/man/io_uring_enter.2 b/man/io_uring_enter.2 index 2ebc6e3..25fdc1e 100644 --- a/man/io_uring_enter.2 +++ b/man/io_uring_enter.2 @@ -1098,8 +1098,11 @@ Available since 5.19. Issue the zerocopy equivalent of a .BR send(2) system call. Similar to IORING_OP_SEND, but tries to avoid making intermediate -copies of data. Zerocopy execution is not guaranteed and it may fall back to -copying. +copies of data. Zerocopy execution is not guaranteed and may fall back to +copying. The request may also fail with +.B -EOPNOTSUPP, +for instance when a protocol doesn't support zerocopy in the first place, in +which case users are recommended to use copying sends instead. The .I flags From patchwork Fri Oct 21 13:10:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13014788 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 7218FC4332F for ; Fri, 21 Oct 2022 13:14:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230246AbiJUNOq (ORCPT ); Fri, 21 Oct 2022 09:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230424AbiJUNNe (ORCPT ); Fri, 21 Oct 2022 09:13:34 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B77826D93E for ; Fri, 21 Oct 2022 06:13:14 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id n12so4717820wrp.10 for ; Fri, 21 Oct 2022 06:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qD/HUVeBVaV7ueHpbiwfPiA2/CzRwAefzoKoFoTpIMU=; b=Iz1jFHzRNSZThyn/ZNMrsDVqu0NE0CNSpt2Ohk4HkLXcwOYgfGT8zxnXU0Uum8ffaO u4k4MAGSA0oXBtECDHKVs+hnPXv2JvmLwSLb0yByFXQTLjsi4SCNmnCJHGHw9lVPIcnP 9ehufmdh3/HshlxWEq5yDfHTUO6wW8AHB08rpdgiotgFKZmonqjbZdEm2meIc8Fnd+r2 MJUk7SJXuyjt26fg57KzbwnpiprQ86Uk115TfC1ypzx7Ac8DFXp+NoB6m96zqcwsYrWt z5Sas2CHwexC5YR6KlqiUhgPx3zt/4X65EFd6/ll3KuZTTi2+fBQlsQWtAGrurDnjswX BNUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qD/HUVeBVaV7ueHpbiwfPiA2/CzRwAefzoKoFoTpIMU=; b=Ey40SZ/M+MzQMxJpIQpEvo/dVRZ2sXd+KccaLEWpRnyDK9ApxWXOLVrb2m++Kzs/iP bau8hJhGK37TOMjTo/YqayWhIC5ddvu6zcI70/ugMqBu6VCJ+iLsmYRvChWTi97WT9Ys ox1pCKyrPg761n4UXHq1TTJQLMU0PL7I2bLmtLIrJ3YoO1SAL3XBBF7uzPqmPcs+4mBB lp4os4xFQwruHE+X4dVvFWU0NCMf9x351xcnsm0MHHtd77Q42atYByd26AxSptgpwKYr YOrqChFdtPXlUwDMqQc1O+kDCHdGCm4oBWbBZp2vnrKz62ATfCifiTkzyv+HUOvmZbQF li/g== X-Gm-Message-State: ACrzQf1n0COrupp5BwuHK2Wvx0QXM9TZki+ipywAWZX60HVa8aUNlP18 ZlaPCVmStdpoVqW6R2Oi/1GhgOoHYgk= X-Google-Smtp-Source: AMsMyM7OUClqeu72gtdkoSYttvmYmzfDZvWIZNyzmJLrYzGMbMPV0a9bntGBj5fjRj0YxXEhKNe1qg== X-Received: by 2002:adf:fc8b:0:b0:234:d624:cb7 with SMTP id g11-20020adffc8b000000b00234d6240cb7mr7425160wrr.412.1666357988562; Fri, 21 Oct 2022 06:13:08 -0700 (PDT) Received: from 127.0.0.1localhost.com ([2620:10d:c092:600::2:f27e]) by smtp.gmail.com with ESMTPSA id n4-20020adf8b04000000b00231893bfdc7sm20739442wra.2.2022.10.21.06.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 06:13:08 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH liburing 2/3] io_uring_enter.2: document IORING_RECVSEND_POLL_FIRST Date: Fri, 21 Oct 2022 14:10:59 +0100 Message-Id: <46c7ba19248dd732241651da54bdcdee5f988d20.1666357688.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Signed-off-by: Pavel Begunkov --- man/io_uring_enter.2 | 85 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/man/io_uring_enter.2 b/man/io_uring_enter.2 index 25fdc1e..d98ae59 100644 --- a/man/io_uring_enter.2 +++ b/man/io_uring_enter.2 @@ -394,12 +394,46 @@ holds the flags associated with the system call. See also .BR sendmsg (2) for the general description of the related system call. Available since 5.3. +This command also supports the following modifiers in +.I ioprio: + +.PP +.in +12 +.B IORING_RECVSEND_POLL_FIRST +If set, io_uring will assume the socket is currently full and attempting to +send data will be unsuccessful. For this case, io_uring will arm internal +poll and trigger a send of the data when there is enough space available. +This initial send attempt can be wasteful for the case where the socket +is expected to be full, setting this flag will bypass the initial send +attempt and go straight to arming poll. If poll does indicate that data can +be sent, the operation will proceed. +.EE +.in +.PP + .TP .B IORING_OP_RECVMSG Works just like IORING_OP_SENDMSG, except for .BR recvmsg(2) instead. See the description of IORING_OP_SENDMSG. Available since 5.3. +This command also supports the following modifiers in +.I ioprio: + +.PP +.in +12 +.B IORING_RECVSEND_POLL_FIRST +If set, io_uring will assume the socket is currently empty and attempting to +receive data will be unsuccessful. For this case, io_uring will arm internal +poll and trigger a receive of the data when the socket has data to be read. +This initial receive attempt can be wasteful for the case where the socket +is expected to be empty, setting this flag will bypass the initial receive +attempt and go straight to arming poll. If poll does indicate that data is +ready to be received, the operation will proceed. +.EE +.in +.PP + .TP .B IORING_OP_SEND Issue the equivalent of a @@ -416,12 +450,46 @@ holds the flags associated with the system call. See also .BR send(2) for the general description of the related system call. Available since 5.6. +This command also supports the following modifiers in +.I ioprio: + +.PP +.in +12 +.B IORING_RECVSEND_POLL_FIRST +If set, io_uring will assume the socket is currently full and attempting to +send data will be unsuccessful. For this case, io_uring will arm internal +poll and trigger a send of the data when there is enough space available. +This initial send attempt can be wasteful for the case where the socket +is expected to be full, setting this flag will bypass the initial send +attempt and go straight to arming poll. If poll does indicate that data can +be sent, the operation will proceed. +.EE +.in +.PP + .TP .B IORING_OP_RECV Works just like IORING_OP_SEND, except for .BR recv(2) instead. See the description of IORING_OP_SEND. Available since 5.6. +This command also supports the following modifiers in +.I ioprio: + +.PP +.in +12 +.B IORING_RECVSEND_POLL_FIRST +If set, io_uring will assume the socket is currently empty and attempting to +receive data will be unsuccessful. For this case, io_uring will arm internal +poll and trigger a receive of the data when the socket has data to be read. +This initial receive attempt can be wasteful for the case where the socket +is expected to be empty, setting this flag will bypass the initial receive +attempt and go straight to arming poll. If poll does indicate that data is +ready to be received, the operation will proceed. +.EE +.in +.PP + .TP .B IORING_OP_TIMEOUT This command will register a timeout operation. The @@ -1150,6 +1218,23 @@ system call equivalent. Available since 6.0. +This command also supports the following modifiers in +.I ioprio: + +.PP +.in +12 +.B IORING_RECVSEND_POLL_FIRST +If set, io_uring will assume the socket is currently full and attempting to +send data will be unsuccessful. For this case, io_uring will arm internal +poll and trigger a send of the data when there is enough space available. +This initial send attempt can be wasteful for the case where the socket +is expected to be full, setting this flag will bypass the initial send +attempt and go straight to arming poll. If poll does indicate that data can +be sent, the operation will proceed. +.EE +.in +.PP + .PP The .I flags From patchwork Fri Oct 21 13:11:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13014789 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 69B57C43217 for ; Fri, 21 Oct 2022 13:14:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230347AbiJUNOr (ORCPT ); Fri, 21 Oct 2022 09:14:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230432AbiJUNNe (ORCPT ); Fri, 21 Oct 2022 09:13:34 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8077526DB19 for ; Fri, 21 Oct 2022 06:13:16 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id v1so4731605wrt.11 for ; Fri, 21 Oct 2022 06:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eZYQSbfkaJtk5nzX2qim59oopTpElc7omAbRQbEtBO4=; b=mDvJW82+EfqRjFo19WeBi9jQIqud0rXE1ph3AgIhGqBRO5VIrDMAl/bDA2YLHd04yf nEwxdLAR8g5txQtagQDJPxakJeS2lTjrMaessvvdpbSQbReTdfVbZo78uVLeL3T9DO+D AmmwnHJtk4MmmR4zb0nykC69gLGXBIjIU+zC94OMlzgkQXMIg5YCqdYzWB+WqNy+jRDi tN50RogzKh9F4kJGSsyy+pQzu8ElEFrIs1JyD0zDSmLOm8k9Wvr9z27ewowrUTLLtF1U XXcDGkjMrCpMCHpnZd34R8ZWTAcvaMZOy+4ezBLkLCWh2PS0QRfYDliWLhN1C5HpuqlV Of0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eZYQSbfkaJtk5nzX2qim59oopTpElc7omAbRQbEtBO4=; b=ZeFUOfE72qpTZbBMRKe2boZ9ASuO7Ehwt2y+WzKbEmlXiUXK8uizqV4VK4RhvQzrsn lvt5nV5PvT13Oh91joaegFY9Vkm6+X1GhICHHq4m51OGOSiD0ajogGeFDiFU3CgDKZOq hbrC1qv7ybk/G8XppltT5VAqca7+IguKYWvxEtkKneOJUDPDJny08KG+tGEB+Pj8Kzdx +lsrSamchJ4F7rLqbqiXO1t9w6+2Mwy1WbhvdttIHhA9/FtakWzY/TI7Qs2DtrBcFO4v eWpMVzutaAKggbMPfGcxcY+j7BD/Fu3UA+3CIt2oKs2iuvThsC2o1f85rJBaSnsTb2Nj blEA== X-Gm-Message-State: ACrzQf3vVbC/xG2uSJkDikGQGaQXlg991cyIAQ65H7X+jLMXWcuKQttr IzA3iOWbJRM6V3IYx3zUD8vQ1Xaah1k= X-Google-Smtp-Source: AMsMyM67xn70WCG45GsfRqBYCBQ8k3qIekMWSlyIqYHif3tpnRAmCCv9yZb68CR036/4kPsGDze5iw== X-Received: by 2002:a5d:64e8:0:b0:231:a71:1eec with SMTP id g8-20020a5d64e8000000b002310a711eecmr12341618wri.59.1666357989429; Fri, 21 Oct 2022 06:13:09 -0700 (PDT) Received: from 127.0.0.1localhost.com ([2620:10d:c092:600::2:f27e]) by smtp.gmail.com with ESMTPSA id n4-20020adf8b04000000b00231893bfdc7sm20739442wra.2.2022.10.21.06.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 06:13:08 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH liburing 3/3] io_uring_enter.2: document IORING_RECVSEND_FIXED_BUF Date: Fri, 21 Oct 2022 14:11:00 +0100 Message-Id: <2075ca0ba4b2e8bf11cc16131e09ab5136953155.1666357688.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Signed-off-by: Pavel Begunkov --- man/io_uring_enter.2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man/io_uring_enter.2 b/man/io_uring_enter.2 index d98ae59..2a8705f 100644 --- a/man/io_uring_enter.2 +++ b/man/io_uring_enter.2 @@ -1231,6 +1231,12 @@ This initial send attempt can be wasteful for the case where the socket is expected to be full, setting this flag will bypass the initial send attempt and go straight to arming poll. If poll does indicate that data can be sent, the operation will proceed. + +.B IORING_RECVSEND_FIXED_BUF +instructs to use a pre-mapped buffer. If set, the +.I buf_index +field should contain an index into an array of fixed buffers. See +io_uring_register(2) for details on how to setup a context for fixed buffer I/O. .EE .in .PP