From 44198adce69e08308d5898620dd13c32a0be945f Mon Sep 17 00:00:00 2001 From: vthriller Date: Sat, 16 Aug 2025 05:54:45 +0300 Subject: [PATCH 1/4] markup fix --- src/inet/nlas.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/inet/nlas.rs b/src/inet/nlas.rs index 66f518b..73d812f 100644 --- a/src/inet/nlas.rs +++ b/src/inet/nlas.rs @@ -90,8 +90,7 @@ buffer!(MemInfoBuffer(MEM_INFO_LEN) { /// documentation with a huge grain of salt. Please report any error /// you may notice. Here are the references I used: /// -/// - [https://wiki.linuxfoundation.org/networking/sk_buff](a short introduction -/// to `sk_buff`, the struct used in the kernel to store packets) +/// - [a short introduction to `sk_buff`, the struct used in the kernel to store packets](https://wiki.linuxfoundation.org/networking/sk_buff) /// - [vger.kernel.org has a lot of documentation about the low level network stack APIs](http://vger.kernel.org/~davem/skb_data.html) /// - [thorough high level explanation of buffering in the network stack](https://www.coverfire.com/articles/queueing-in-the-linux-network-stack/) /// - [understanding the backlog queue](http://veithen.io/2014/01/01/how-tcp-backlog-works-in-linux.html) From 8cf4ed633fec467408d43c93240eeca745f66393 Mon Sep 17 00:00:00 2001 From: vthriller Date: Sat, 16 Aug 2025 06:02:06 +0300 Subject: [PATCH 2/4] not only this has confusing wording, it also seems redundant given the lists below, so just trim that --- src/unix/nlas.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/unix/nlas.rs b/src/unix/nlas.rs index bfbb33a..2274be1 100644 --- a/src/unix/nlas.rs +++ b/src/unix/nlas.rs @@ -30,12 +30,8 @@ pub enum Nla { /// attribute is reported for listening sockets only. This /// attribute is known as `UNIX_DIAG_ICONS` in the kernel. PendingConnections(Vec), - /// This attribute corresponds to the `UNIX_DIAG_RQLEN`. It - /// reports the length of the socket receive queue, and the queue - /// size limit. Note that for **listening** sockets the receive - /// queue is used to store actual data sent by other sockets. It - /// is used to store pending connections. So the meaning of this - /// attribute differs for listening sockets. + /// This attribute corresponds to the `UNIX_DIAG_RQLEN`. Actual meaning of + /// this attribute differs depending on the type of socket. /// /// For **listening** sockets: /// From a384774bb0d5c0a741d65a2004c4ec2093bacd68 Mon Sep 17 00:00:00 2001 From: vthriller Date: Sat, 16 Aug 2025 06:06:24 +0300 Subject: [PATCH 3/4] fix rustdoc::broken_intra_doc_links --- src/inet/nlas.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inet/nlas.rs b/src/inet/nlas.rs index 73d812f..87cf8bc 100644 --- a/src/inet/nlas.rs +++ b/src/inet/nlas.rs @@ -154,7 +154,7 @@ pub struct MemInfo { /// Memory used for packets that have been passed down the network /// stack, i.e. that are either in the QDisc or device driver /// queues. This attribute is known as `sk_wmem_alloc` in the - /// kernel. See also [`send_queue`]. + /// kernel. See also [`send_queue`](#structfield.send_queue). pub bottom_send_queues: u32, /// The amount of memory already allocated for this socket but /// currently unused. When more memory is needed either for From 6b1d73918b7934c27711e0a13940e73111036b5b Mon Sep 17 00:00:00 2001 From: vthriller Date: Sat, 16 Aug 2025 06:15:27 +0300 Subject: [PATCH 4/4] clarify retransmit-related fields of TcpInfo Based on https://lore.kernel.org/netdev/CADVnQyn=6wYbVP0m3mepGU23LcEn_BK_TKoSNxVf=TUz9Q+f8g@mail.gmail.com/ Additionally, tcpi_retransmits was reworded for broader audience; I believe new description is correct based on where icsk_retransmits (source of tcpi_retransmits) get reset to 0 in the kernel: - tcp_connect_init() - tcp_ack() - tcp_try_undo_loss() - tcp_rcv_synrecv_state_fastopen() --- src/inet/nlas.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/inet/nlas.rs b/src/inet/nlas.rs index 87cf8bc..36141ad 100644 --- a/src/inet/nlas.rs +++ b/src/inet/nlas.rs @@ -476,7 +476,7 @@ pub struct TcpInfo { /// `TCP_CA_DISORDER`, `TCP_CA_CWR`, `TCP_CA_RECOVERY`, /// `TCP_CA_LOSS` pub ca_state: u8, - /// + /// Number of retransmits since the last ACK pub retransmits: u8, pub probes: u8, pub backoff: u8, @@ -506,7 +506,7 @@ pub struct TcpInfo { pub sacked: u32, /// Number of segments that have been lost pub lost: u32, - /// Number of segments that have been retransmitted + /// Number of segments that are currently being retransmitted pub retrans: u32, /// Number of segments that have been FACKed pub fackets: u32, @@ -538,6 +538,7 @@ pub struct TcpInfo { pub rcv_rtt: u32, pub rcv_space: u32, + /// Number of segments that have been retransmitted during lifetime of the socket pub total_retrans: u32, pub pacing_rate: u64,