From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202510 header.b=dkFhv/N6; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 91FE15A061A for ; Mon, 13 Oct 2025 02:20:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1760314851; bh=dIOG68OOMsX9TUbqZwrCTQKNeDqelKWsolwdvvpAhBE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dkFhv/N6juTCcwecS1R6FL83y9oSCyfTT0rj0sgaCWxv6d/BFyFw/ub9rqu/+DQNF zOpBRO1ZnrxiHtbGvaSFgholMBuxbSjoVgsJggrQ56g0Xjri3AOr4Dq/kt3A2u7y3Q YB9/1ivfLUGtzBmX8tl2dnMgRBr6b8O53YmT673obe2Lmof0QaPbcAXhy4euNUR4iI 5KTJLCeg2gCMeX+NOir0khLxU8NCZ79i50SDXuAlSeZW12fJuzvnpUgl7BmeaWPGse MO4evyi9/lVAZ8A4WdpXbpGTGJEhWbUlvvf+WbwtCummCMdd8S/feHAizkpyxViwTw mo5osIQoZaPjw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4clJ0g3mR6z4w9Z; Mon, 13 Oct 2025 11:20:51 +1100 (AEDT) Date: Mon, 13 Oct 2025 10:52:49 +1100 From: David Gibson To: Yumei Huang Subject: Re: [PATCH v2 1/3] tcp: Rename "retrans" to "retries" Message-ID: References: <20251010074700.22177-1-yuhuang@redhat.com> <20251010074700.22177-2-yuhuang@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OEF2/H2JLULGmkIl" Content-Disposition: inline In-Reply-To: <20251010074700.22177-2-yuhuang@redhat.com> Message-ID-Hash: 56QJ4O6BHE43422IPGKVRGH2I4NX5PAE X-Message-ID-Hash: 56QJ4O6BHE43422IPGKVRGH2I4NX5PAE X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, sbrivio@redhat.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --OEF2/H2JLULGmkIl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 10, 2025 at 03:46:58PM +0800, Yumei Huang wrote: > Rename "retrans" to "retries" so it can be used for SYN retries. >=20 > Signed-off-by: Yumei Huang Reviewed-by: David Gibson I think the new name is clearer, although AFAICT the RFCs mostly seem to refer to both data retransmits and SYN retries as "retransmits". > --- > tcp.c | 12 ++++++------ > tcp_conn.h | 12 ++++++------ > 2 files changed, 12 insertions(+), 12 deletions(-) >=20 > 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 s= ending > * data (flag ACK_FROM_TAP_DUE with ESTABLISHED event), re-send data f= rom the > * socket and reset sequence to what was acknowledged. If this persist= s 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); > =20 > - conn->retrans =3D 0; > + conn->retries =3D 0; > conn->seq_ack_from_tap =3D seq; > } > } > @@ -2414,7 +2414,7 @@ void tcp_timer_handler(const struct ctx *c, union e= poll_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 =3D=3D TCP_MAX_RETRANS) { > + } else if (conn->retries =3D=3D 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 e= poll_ref ref) > if (!conn->wnd_from_tap) > conn->wnd_from_tap =3D 1; /* Zero-window probe */ > =20 > - conn->retrans++; > + conn->retries++; > if (tcp_rewind_seq(c, conn)) > return; > =20 > @@ -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 =3D { > - .retrans =3D conn->retrans, > + .retries =3D conn->retries, > .ws_from_tap =3D conn->ws_from_tap, > .ws_to_tap =3D conn->ws_to_tap, > .events =3D 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 =3D FLOW_SET_TYPE(flow, FLOW_TCP, tcp); > =20 > - conn->retrans =3D t.retrans; > + conn->retries =3D t.retries; > conn->ws_from_tap =3D t.ws_from_tap; > conn->ws_to_tap =3D t.ws_to_tap; > conn->events =3D 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 { > =20 > bool in_epoll :1; > =20 > -#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) > =20 > #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]; > =20 > - uint8_t retrans; > + uint8_t retries; > uint8_t ws_from_tap; > uint8_t ws_to_tap; > uint8_t events; > --=20 > 2.47.0 >=20 --=20 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 --OEF2/H2JLULGmkIl Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmjsP1AACgkQzQJF27ox 2GfI+RAAkmRIm8eV0Z1s/DC4vtaGbTes87go7puhx5AyTo/+58Rpn8Q8/f/+uqXE FwH/BDgzI2B8EsJkrXmoox39slQZ3FuhXgkshaTFvlSkv5PrCgfSpE8cievRvXAk ePGoImUBF/4rxs+GtbS0kFiIcEudMWsBLcV+e+JujKEvEWoTVrPMjnxBoAoVl9gs eXFiK2sHdT+ORCCUiI4xgQy8LYJgSkR2iLv+wBscDiGgrfcNETjZhG2006Bcu0lL Wh843fUiKG85LxGINK80Swj98GxNdMlvdGC/3zIIRMkAnlvTNw/cSvPF0oB50nYC LmVo4KNNT+2b1KuD03UDD5ANP20QaLO+N2JLCbuOHVMBOPTSiSCF7RmHakQL2Mcx TIH6q/WS2hZyIF7q0zHJQR4DJ+/60+zd/jSiOcxH75ZZMtUyO1FGYAYwyEKL6m1V 8fV9rXY5pQzThPJmAnvWtG2gwaU01lN+QVQIlYE1VMrJQt0oaxElHxLES+decWlv iVBZrWSH7rQ9LnTQ/TgXrkLVOxrtiWZkRhaKgq+gW6OblPS163aFaZIw0hVFhE1/ sS9NmUj6LZuTHb6ms0Becl5MXBw2eOhu11UmZOZHe/Dv2Vfn8bByGD2xlwA1XSEA en2IErdEghw5P+SyA81/0OJJHxCwiHYgkZagV1kOy4Yt/5v/jiE= =THdi -----END PGP SIGNATURE----- --OEF2/H2JLULGmkIl--