Skip to content

Commit 37f841f

Browse files
author
Gleb Pomykalov
committed
Add comments to GRO and GSO control messages
1 parent c0226fb commit 37f841f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/sys/socket/mod.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,14 @@ pub enum ControlMessageOwned {
464464
))]
465465
Ipv4RecvDstAddr(libc::in_addr),
466466

467+
/// UDP Generic Receive Offload (GRO) allows receiving multiple UDP
468+
/// packets from a single sender.
469+
/// Fixed-size payloads are following one by one in a receive buffer.
470+
/// This Control Message indicates the size of all smaller packets,
471+
/// except, maybe, the last one.
472+
///
473+
/// `UdpGroSegment` socket option should be enabled on a socket
474+
/// to allow receiving GRO packets.
467475
#[cfg(target_os = "linux")]
468476
UdpGroSegments(u16),
469477

@@ -626,7 +634,14 @@ pub enum ControlMessage<'a> {
626634
))]
627635
AlgSetAeadAssoclen(&'a u32),
628636

629-
///Gso UDP
637+
/// UDP GSO makes it possible for applications to generate network packets
638+
/// for a virtual MTU much greater than the real one.
639+
/// The length of the send data no longer matches the expected length on
640+
/// the wire.
641+
/// The size of the datagram payload as it should appear on the wire may be
642+
/// passed through this control message.
643+
/// Send buffer should consist of multiple fixed-size wire payloads
644+
/// following one by one, and the last, possibly smaller one.
630645
#[cfg(target_os = "linux")]
631646
UdpGsoSegments(&'a u16),
632647
}

0 commit comments

Comments
 (0)