From: David Gibson <david@gibson.dropbear.id.au>
To: Yumei Huang <yuhuang@redhat.com>
Cc: passt-dev@passt.top, sbrivio@redhat.com
Subject: Re: [PATCH v3 1/4] tcp: Rename "retrans" to "retries"
Date: Wed, 15 Oct 2025 09:50:25 +1100 [thread overview]
Message-ID: <aO7TsT6AxFRwWK1a@zatzit> (raw)
In-Reply-To: <20251014073836.18150-2-yuhuang@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 4997 bytes --]
On Tue, Oct 14, 2025 at 03:38:33PM +0800, Yumei Huang wrote:
> Rename "retrans" to "retries" so it can be used for SYN retries.
>
> Signed-off-by: Yumei Huang <yuhuang@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Btw, if the patch hasn't changed, you can keep the Reviewed-by line
from previous versions of the series.
> ---
> tcp.c | 12 ++++++------
> tcp_conn.h | 12 ++++++------
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/tcp.c b/tcp.c
> index 0f9e9b3..2ec4b0c 100644
> --- a/tcp.c
> +++ b/tcp.c
> @@ -186,7 +186,7 @@
> * - ACK_TIMEOUT: if no ACK segment was received from tap/guest, after sending
> * data (flag ACK_FROM_TAP_DUE with ESTABLISHED event), re-send data from the
> * socket and reset sequence to what was acknowledged. If this persists for
> - * more than TCP_MAX_RETRANS times in a row, reset the connection
> + * more than TCP_MAX_RETRIES times in a row, reset the connection
> *
> * - FIN_TIMEOUT: if a FIN segment was sent to tap/guest (flag ACK_FROM_TAP_DUE
> * with TAP_FIN_SENT event), and no ACK is received within this time, reset
> @@ -1127,7 +1127,7 @@ static void tcp_update_seqack_from_tap(const struct ctx *c,
> if (SEQ_LT(seq, conn->seq_to_tap))
> conn_flag(c, conn, ACK_FROM_TAP_DUE);
>
> - conn->retrans = 0;
> + conn->retries = 0;
> conn->seq_ack_from_tap = seq;
> }
> }
> @@ -2414,7 +2414,7 @@ void tcp_timer_handler(const struct ctx *c, union epoll_ref ref)
> } else if (CONN_HAS(conn, SOCK_FIN_SENT | TAP_FIN_ACKED)) {
> flow_dbg(conn, "FIN timeout");
> tcp_rst(c, conn);
> - } else if (conn->retrans == TCP_MAX_RETRANS) {
> + } else if (conn->retries == TCP_MAX_RETRIES) {
> flow_dbg(conn, "retransmissions count exceeded");
> tcp_rst(c, conn);
> } else {
> @@ -2423,7 +2423,7 @@ void tcp_timer_handler(const struct ctx *c, union epoll_ref ref)
> if (!conn->wnd_from_tap)
> conn->wnd_from_tap = 1; /* Zero-window probe */
>
> - conn->retrans++;
> + conn->retries++;
> if (tcp_rewind_seq(c, conn))
> return;
>
> @@ -3382,7 +3382,7 @@ static int tcp_flow_repair_opt(const struct tcp_tap_conn *conn,
> int tcp_flow_migrate_source(int fd, struct tcp_tap_conn *conn)
> {
> struct tcp_tap_transfer t = {
> - .retrans = conn->retrans,
> + .retries = conn->retries,
> .ws_from_tap = conn->ws_from_tap,
> .ws_to_tap = conn->ws_to_tap,
> .events = conn->events,
> @@ -3662,7 +3662,7 @@ int tcp_flow_migrate_target(struct ctx *c, int fd)
> memcpy(&flow->f.side, &t.side, sizeof(flow->f.side));
> conn = FLOW_SET_TYPE(flow, FLOW_TCP, tcp);
>
> - conn->retrans = t.retrans;
> + conn->retries = t.retries;
> conn->ws_from_tap = t.ws_from_tap;
> conn->ws_to_tap = t.ws_to_tap;
> conn->events = t.events;
> diff --git a/tcp_conn.h b/tcp_conn.h
> index 38b5c54..e5c8146 100644
> --- a/tcp_conn.h
> +++ b/tcp_conn.h
> @@ -13,7 +13,7 @@
> * struct tcp_tap_conn - Descriptor for a TCP connection (not spliced)
> * @f: Generic flow information
> * @in_epoll: Is the connection in the epoll set?
> - * @retrans: Number of retransmissions occurred due to ACK_TIMEOUT
> + * @retries: Number of retries occurred due to timeouts
> * @ws_from_tap: Window scaling factor advertised from tap/guest
> * @ws_to_tap: Window scaling factor advertised to tap/guest
> * @tap_mss: MSS advertised by tap/guest, rounded to 2 ^ TCP_MSS_BITS
> @@ -38,9 +38,9 @@ struct tcp_tap_conn {
>
> bool in_epoll :1;
>
> -#define TCP_RETRANS_BITS 3
> - unsigned int retrans :TCP_RETRANS_BITS;
> -#define TCP_MAX_RETRANS MAX_FROM_BITS(TCP_RETRANS_BITS)
> +#define TCP_RETRIES_BITS 3
> + unsigned int retries :TCP_RETRIES_BITS;
> +#define TCP_MAX_RETRIES MAX_FROM_BITS(TCP_RETRIES_BITS)
>
> #define TCP_WS_BITS 4 /* RFC 7323 */
> #define TCP_WS_MAX 14
> @@ -102,7 +102,7 @@ struct tcp_tap_conn {
> * struct tcp_tap_transfer - Migrated TCP data, flow table part, network order
> * @pif: Interfaces for each side of the flow
> * @side: Addresses and ports for each side of the flow
> - * @retrans: Number of retransmissions occurred due to ACK_TIMEOUT
> + * @retries: Number of retries occurred due to timeouts
> * @ws_from_tap: Window scaling factor advertised from tap/guest
> * @ws_to_tap: Window scaling factor advertised to tap/guest
> * @events: Connection events, implying connection states
> @@ -122,7 +122,7 @@ struct tcp_tap_transfer {
> uint8_t pif[SIDES];
> struct flowside side[SIDES];
>
> - uint8_t retrans;
> + uint8_t retries;
> uint8_t ws_from_tap;
> uint8_t ws_to_tap;
> uint8_t events;
> --
> 2.47.0
>
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-10-14 23:27 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 7:38 [PATCH v3 0/4] Retry SYNs for inbound connections Yumei Huang
2025-10-14 7:38 ` [PATCH v3 1/4] tcp: Rename "retrans" to "retries" Yumei Huang
2025-10-14 22:50 ` David Gibson [this message]
2025-10-15 2:17 ` Yumei Huang
2025-10-14 7:38 ` [PATCH v3 2/4] util: Introduce read_file() and read_file_long() function Yumei Huang
2025-10-14 23:27 ` David Gibson
2025-10-15 3:50 ` Yumei Huang
2025-10-15 4:46 ` David Gibson
2025-10-15 5:46 ` Yumei Huang
2025-10-28 23:12 ` Stefano Brivio
2025-10-29 0:43 ` David Gibson
2025-10-29 4:43 ` Stefano Brivio
2025-10-29 9:35 ` David Gibson
2025-10-29 16:23 ` Stefano Brivio
2025-10-14 7:38 ` [PATCH v3 3/4] tcp: Resend SYN for inbound connections Yumei Huang
2025-10-14 23:40 ` David Gibson
2025-10-14 7:38 ` [PATCH v3 4/4] tcp: Update data retransmission timeout Yumei Huang
2025-10-15 0:05 ` David Gibson
2025-10-15 6:31 ` Yumei Huang
2025-10-15 22:54 ` David Gibson
2025-10-17 18:28 ` Stefano Brivio
2025-10-20 0:20 ` David Gibson
2025-10-20 5:11 ` Stefano Brivio
2025-10-20 9:17 ` David Gibson
2025-10-28 23:13 ` Stefano Brivio
2025-10-29 0:35 ` David Gibson
2025-10-29 4:52 ` Stefano Brivio
2025-10-29 9:37 ` David Gibson
2025-10-20 10:57 ` Yumei Huang
2025-10-20 23:20 ` Stefano Brivio
2025-10-22 2:23 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aO7TsT6AxFRwWK1a@zatzit \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
--cc=yuhuang@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).