All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH manpages 1/2] udp.7: add UDP_SEGMENT
@ 2023-03-01 21:11 Willem de Bruijn
  2023-03-01 21:11 ` [PATCH manpages 2/2] udp.7: add UDP_GRO Willem de Bruijn
  2023-03-01 21:35 ` [PATCH manpages 1/2] udp.7: add UDP_SEGMENT Alejandro Colomar
  0 siblings, 2 replies; 4+ messages in thread
From: Willem de Bruijn @ 2023-03-01 21:11 UTC (permalink / raw)
  To: linux-man; +Cc: mtk.manpages, alx.manpages, pabeni, netdev, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

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 <willemb@google.com>
---
 man7/udp.7 | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/man7/udp.7 b/man7/udp.7
index 5822bc551fdf..ec16306df605 100644
--- a/man7/udp.7
+++ b/man7/udp.7
@@ -204,6 +204,31 @@ 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 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).
-- 
2.39.2.722.g9855ee24e9-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH manpages 2/2] udp.7: add UDP_GRO
  2023-03-01 21:11 [PATCH manpages 1/2] udp.7: add UDP_SEGMENT Willem de Bruijn
@ 2023-03-01 21:11 ` Willem de Bruijn
  2023-03-01 21:35 ` [PATCH manpages 1/2] udp.7: add UDP_SEGMENT Alejandro Colomar
  1 sibling, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2023-03-01 21:11 UTC (permalink / raw)
  To: linux-man; +Cc: mtk.manpages, alx.manpages, pabeni, netdev, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

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 <willemb@google.com>
---
 man7/udp.7 | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/man7/udp.7 b/man7/udp.7
index ec16306df605..b4cc06791e47 100644
--- a/man7/udp.7
+++ b/man7/udp.7
@@ -229,6 +229,18 @@ 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).
-- 
2.39.2.722.g9855ee24e9-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH manpages 1/2] udp.7: add UDP_SEGMENT
  2023-03-01 21:11 [PATCH manpages 1/2] udp.7: add UDP_SEGMENT Willem de Bruijn
  2023-03-01 21:11 ` [PATCH manpages 2/2] udp.7: add UDP_GRO Willem de Bruijn
@ 2023-03-01 21:35 ` Alejandro Colomar
  2023-03-01 22:22   ` Willem de Bruijn
  1 sibling, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2023-03-01 21:35 UTC (permalink / raw)
  To: Willem de Bruijn, linux-man; +Cc: pabeni, netdev, Willem de Bruijn


[-- Attachment #1.1: Type: text/plain, Size: 3116 bytes --]

Hi Willem,

On 3/1/23 22:11, Willem de Bruijn wrote:
> From: Willem de Bruijn <willemb@google.com>
> 
> 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 <willemb@google.com>
> ---
>  man7/udp.7 | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/man7/udp.7 b/man7/udp.7
> index 5822bc551fdf..ec16306df605 100644
> --- a/man7/udp.7
> +++ b/man7/udp.7
> @@ -204,6 +204,31 @@ 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

Please use semantic newlines.  See man-pages(7):

   Use semantic newlines
       In the source of a manual page, new sentences should be started
       on  new  lines,  long  sentences  should be split into lines at
       clause breaks (commas, semicolons, colons, and so on), and long
       clauses should be split at phrase boundaries.  This convention,
       sometimes known as "semantic newlines", makes it easier to  see
       the  effect of patches, which often operate at the level of in‐
       dividual sentences, clauses, or phrases.


> +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 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)

There should be a space between the bold part and the roman part:

.BR foo (2)

Otherwise, it all gets printed in bold.

Cheers,

Alex

> +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).

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH manpages 1/2] udp.7: add UDP_SEGMENT
  2023-03-01 21:35 ` [PATCH manpages 1/2] udp.7: add UDP_SEGMENT Alejandro Colomar
@ 2023-03-01 22:22   ` Willem de Bruijn
  0 siblings, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2023-03-01 22:22 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: Willem de Bruijn, linux-man, netdev, Paolo Abeni

On Wed, Mar 1, 2023 at 4:35 PM Alejandro Colomar <alx.manpages@gmail.com> wrote:
>
> Hi Willem,
>
> On 3/1/23 22:11, Willem de Bruijn wrote:
> > From: Willem de Bruijn <willemb@google.com>
> >
> > 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 <willemb@google.com>
> > ---
> >  man7/udp.7 | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >
> > diff --git a/man7/udp.7 b/man7/udp.7
> > index 5822bc551fdf..ec16306df605 100644
> > --- a/man7/udp.7
> > +++ b/man7/udp.7
> > @@ -204,6 +204,31 @@ 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
>
> Please use semantic newlines.  See man-pages(7):
>
>    Use semantic newlines
>        In the source of a manual page, new sentences should be started
>        on  new  lines,  long  sentences  should be split into lines at
>        clause breaks (commas, semicolons, colons, and so on), and long
>        clauses should be split at phrase boundaries.  This convention,
>        sometimes known as "semantic newlines", makes it easier to  see
>        the  effect of patches, which often operate at the level of in‐
>        dividual sentences, clauses, or phrases.
>
>
> > +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 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)
>
> There should be a space between the bold part and the roman part:
>
> .BR foo (2)
>
> Otherwise, it all gets printed in bold.

Thanks Alex. I'll leave this open for other comments for a bit, but
will address both points in both patches in v2.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-01 22:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 21:11 [PATCH manpages 1/2] udp.7: add UDP_SEGMENT Willem de Bruijn
2023-03-01 21:11 ` [PATCH manpages 2/2] udp.7: add UDP_GRO Willem de Bruijn
2023-03-01 21:35 ` [PATCH manpages 1/2] udp.7: add UDP_SEGMENT Alejandro Colomar
2023-03-01 22:22   ` Willem de Bruijn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.