From patchwork Thu Mar 2 15:48:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willem de Bruijn X-Patchwork-Id: 13157475 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 16402C7EE2F for ; Thu, 2 Mar 2023 15:48:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229739AbjCBPsP (ORCPT ); Thu, 2 Mar 2023 10:48:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbjCBPsN (ORCPT ); Thu, 2 Mar 2023 10:48:13 -0500 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FEED193C2; Thu, 2 Mar 2023 07:48:12 -0800 (PST) Received: by mail-qt1-x82d.google.com with SMTP id d7so18399522qtr.12; Thu, 02 Mar 2023 07:48:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OQkiJND02BK/IXx43D/6SWtx0ejjMuFojMoaAG3gPWQ=; b=Kmv5Z9EesMZzu6NKbOpKGZKLADvdtBnDEbDoxdsbw6Lib1WTNhqahAziVKjahTDTun Pv972CHmYjqZG2TUOS09QD2fCzvNiuuR5G2E/aV27SbzVzgJMk5wKbLAZcNKsBsyy/K+ rIfqZQSGHZ2ob+j5MP2atFMYZxlAjSHYVzM2SooQx8WtmYP7NHqV6D3vECmfsh7/OIRd jzl68Ua+YrU2EtYG+AExN1CPxe1G9eNoACegPEcW/jRg5c44tfi0VZsV0iFrRc+If9FW CVrr+RuvLfdhR+bWJphB67kMCMWGd3dRG7AusQtqWQAzBvCJ75tJnTAey9R7vXwVjIX9 pbdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OQkiJND02BK/IXx43D/6SWtx0ejjMuFojMoaAG3gPWQ=; b=6gR8DbGYj2HA4Psaa74llcSXNXqnfyUS/Yt2nxECZrCsV9zUNKweP1afgoCBy1ahxc PeLE25ywhz3+ygkyvtH7u83RT3qsktShCg54u/f6SVzZz8up7xFL6589WYd01mG0p7sO SCjSgEON4x3L7phm4AKAolhuywyJTPo50vreBVPoUGxfP8iog4EwZ80NEFiFd3TMk64V DwFU4cc60xSQ5SiNKc5mi9A4cuk2V6GbXC/HiSGYQHc/xu+lIl8a7A3JIlYM7x0O7PSA rqU5BrlvEu8566Zb8m9JnjzRbzXOYb4T9OYkIaHEDZAGuVaIY/ue1cDRV5EvKjy5rVQj 2uMw== X-Gm-Message-State: AO0yUKXYODLUE/affmdgvVMqCDnfdhoij832/HpJTzeP92JLQWf7yyKC I3ZKmkkluhe7iEU2lWEareIRLiP+jY4= X-Google-Smtp-Source: AK7set93WhOxbqAThjFxYgvJAJzjliza/f79qldeP6f1q5EDaxzX6P6kKyYwUrDi1HhgfY8Wx44PVg== X-Received: by 2002:a05:622a:11c3:b0:3b9:bd8d:bb22 with SMTP id n3-20020a05622a11c300b003b9bd8dbb22mr4279873qtk.14.1677772091443; Thu, 02 Mar 2023 07:48:11 -0800 (PST) Received: from willemb.c.googlers.com.com (240.157.150.34.bc.googleusercontent.com. [34.150.157.240]) by smtp.gmail.com with ESMTPSA id s72-20020a37454b000000b007417e60f621sm11097113qka.126.2023.03.02.07.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 07:48:11 -0800 (PST) From: Willem de Bruijn To: linux-man@vger.kernel.org Cc: mtk.manpages@gmail.com, alx.manpages@gmail.com, pabeni@redhat.com, netdev@vger.kernel.org, Willem de Bruijn Subject: [PATCH manpages v2 1/2] udp.7: add UDP_SEGMENT Date: Thu, 2 Mar 2023 10:48:07 -0500 Message-Id: <20230302154808.2139031-1-willemdebruijn.kernel@gmail.com> X-Mailer: git-send-email 2.39.2.722.g9855ee24e9-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Willem de Bruijn UDP_SEGMENT was added in commit bec1f6f69736 ("udp: generate gso with UDP_SEGMENT") $ git describe --contains bec1f6f69736 linux/v4.18-rc1~114^2~377^2~8 Kernel source has example code in tools/testing/selftests/net/udpgso* Per https://www.kernel.org/doc/man-pages/patches.html, "Describe how you obtained the information in your patch": I am the author of the above commit and follow-ons. Signed-off-by: Willem de Bruijn Reviewed-by: Simon Horman --- Changes v1->v2 - semantic newlines: also break on comma and colon - remove bold: section number following function name - add bold: special macro USHRT_MAX --- man7/udp.7 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/man7/udp.7 b/man7/udp.7 index 5822bc551fdf..6646c1e96bb0 100644 --- a/man7/udp.7 +++ b/man7/udp.7 @@ -204,6 +204,34 @@ portable. .\" UDP_ENCAP_ESPINUDP draft-ietf-ipsec-udp-encaps-06 .\" UDP_ENCAP_L2TPINUDP rfc2661 .\" FIXME Document UDP_NO_CHECK6_TX and UDP_NO_CHECK6_RX, added in Linux 3.16 +.TP +.BR UDP_SEGMENT " (since Linux 4.18)" +Enables UDP segmentation offload. +Segmentation offload reduces +.BR send (2) +cost by transferring multiple datagrams worth of data as a single large +packet through the kernel transmit path, +even when that exceeds MTU. +As late as possible, +the large packet is split by segment size into a series of datagrams. +This segmentation offload step is deferred to hardware if supported, +else performed in software. +This option takes a value between 0 and +.BR USHRT_MAX +that sets the segment size: +the size of datagram payload, +excluding the UDP header. +The segment size must be chosen such that at most 64 datagrams are sent in +a single call and that the datagrams after segmentation meet the same MTU +rules that apply to datagrams sent without this option. +Segmentation offload depends on checksum offload, +as datagram checksums are computed after segmentation. +The option may also be set for individual +.BR sendmsg (2) +calls by passing it as a +.BR cmsg (7). +A value of zero disables the feature. +This option should not be used in code intended to be portable. .SS Ioctls These ioctls can be accessed using .BR ioctl (2). From patchwork Thu Mar 2 15:48:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Willem de Bruijn X-Patchwork-Id: 13157474 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 A0181C7EE32 for ; Thu, 2 Mar 2023 15:48:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbjCBPsQ (ORCPT ); Thu, 2 Mar 2023 10:48:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjCBPsN (ORCPT ); Thu, 2 Mar 2023 10:48:13 -0500 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D03DD6EBC; Thu, 2 Mar 2023 07:48:12 -0800 (PST) Received: by mail-qv1-xf29.google.com with SMTP id ks17so11920269qvb.6; Thu, 02 Mar 2023 07:48:12 -0800 (PST) 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=4KNdpY7mZZeDMkNs/8ZHD716EPWzyrnrEKXe+qhTR3c=; b=FNM6gfaaMuXxpfs5roJYZVjl8ioiJANcydrINN6kG4maAyuA+d1qkZvVrYwKrWWZFP wH5c3OqVNYgS+Jdiw9OyfH43c8eq9bGnAsfEOMJvK9z9hk7ydYpJSf618Bi2tCpOcNpx P1BOJmGH3OPAZVZI7RBiLmBTyZ14k/ERcXvj4lH6UcCTUQ+8ydQ0zjzoFHSkX/rNU+7E Y3teVJvg4/IwEHr/6GpggJJi6NtE+yYwyoc88hYk54cQYTLTuKZkcpiDLCz44EMNGt1q TdWZYlGIKY3WUi9vd9eKTyZUsV16738cwhhTE/U3odFMeCcg9SAWy7qNw3c+Z7vrdO9J p3iw== 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=4KNdpY7mZZeDMkNs/8ZHD716EPWzyrnrEKXe+qhTR3c=; b=BvKavR5BWkio1sY1kRt4A/4fpTtl2pauT1ByN1Ye9QCE6LF7tbYu/wsmubPAMX1xxO AWDUYMoNo5CdqYaE/mWjH4qlfx7xDYYc3EvNxRf8gwx/4cdpiUq6u7Z4F3TOVaYWS2nz RkgnkCTOTqjaoFrvathrUcLmYzQwztZjeO2ir48+6wihoAt7k2zmOZFdQOe7IkQ5n64+ qyRR3NjLrUSRgE/TS6b3UVWwM/oo9E3vwsNdRGJlAcITVsym8vn6U1nDcTbvihfIXmIF kY63K4zd8ZJ8qIa4lyhstIbZvNVNRS/+01sCmLBlaoDyuuZts4mK3Mjke474ia3AouCv tNbw== X-Gm-Message-State: AO0yUKXLF6OGZht2styqnl7Uw9sQQ1sGtxDOkIul2F0hhdwroY3BZoVS ZSOjQQ8mcca7bdxa/yxnyDKyMkOQxSk= X-Google-Smtp-Source: AK7set8vHj0UySoAa9aQkTdwfIxwW6/G3k6RYJV6mH6EJucH9wEsq9N5AUoHpBcRzw2iExz0GjyPHw== X-Received: by 2002:a05:6214:2589:b0:56b:7cb:bdcd with SMTP id fq9-20020a056214258900b0056b07cbbdcdmr22386104qvb.39.1677772091950; Thu, 02 Mar 2023 07:48:11 -0800 (PST) Received: from willemb.c.googlers.com.com (240.157.150.34.bc.googleusercontent.com. [34.150.157.240]) by smtp.gmail.com with ESMTPSA id s72-20020a37454b000000b007417e60f621sm11097113qka.126.2023.03.02.07.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 07:48:11 -0800 (PST) From: Willem de Bruijn To: linux-man@vger.kernel.org Cc: mtk.manpages@gmail.com, alx.manpages@gmail.com, pabeni@redhat.com, netdev@vger.kernel.org, Willem de Bruijn Subject: [PATCH manpages v2 2/2] udp.7: add UDP_GRO Date: Thu, 2 Mar 2023 10:48:08 -0500 Message-Id: <20230302154808.2139031-2-willemdebruijn.kernel@gmail.com> X-Mailer: git-send-email 2.39.2.722.g9855ee24e9-goog In-Reply-To: <20230302154808.2139031-1-willemdebruijn.kernel@gmail.com> References: <20230302154808.2139031-1-willemdebruijn.kernel@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Willem de Bruijn UDP_GRO was added in commit e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.") $ git describe --contains e20cf8d3f1f7 linux/v5.0-rc1~129^2~379^2~8 Kernel source has example code in tools/testing/selftests/net/udpgro* Per https://www.kernel.org/doc/man-pages/patches.html, "Describe how you obtained the information in your patch": I reviewed the relevant UDP_GRO patches. Signed-off-by: Willem de Bruijn Reviewed-by: Simon Horman --- Changes v1->v2 - semantic newlines: also break on comma - remove bold: section number following function name --- man7/udp.7 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/man7/udp.7 b/man7/udp.7 index 6646c1e96bb0..a350a40da340 100644 --- a/man7/udp.7 +++ b/man7/udp.7 @@ -232,6 +232,20 @@ calls by passing it as a .BR cmsg (7). A value of zero disables the feature. This option should not be used in code intended to be portable. +.TP +.BR UDP_GRO " (since Linux 5.0)" +Enables UDP receive offload. +If enabled, +the socket may receive multiple datagrams worth of data as a single large +buffer, +together with a +.BR cmsg (7) +that holds the segment size. +This option is the inverse of segmentation offload. +It reduces receive cost by handling multiple datagrams worth of data +as a single large packet in the kernel receive path, +even when that exceeds MTU. +This option should not be used in code intended to be portable. .SS Ioctls These ioctls can be accessed using .BR ioctl (2).