From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Gsg9fqWS; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 7C8845A0619 for ; Wed, 15 Oct 2025 04:17:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760494638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rWHaCshThlxWbqF94dRXTXVIBi8jee90Btpfs717r4M=; b=Gsg9fqWS3uaLhzhT5i8A+6vejkbYRXVlB8uVHWy8I/xkob1140GM9YPtuRGk4vfjeUEsHt cjkpXTkH+fvlXsSJjdSPOiDjpOlg2U4EIg3yb4m/JEljyXAPD/BItZnCtGPvj2NwAUif5v JXRFp0tu/6ztZFuVs6BAHIw36pwn7pk= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-601-DIfJ-Z5gMB6a_MT_HGI2aQ-1; Tue, 14 Oct 2025 22:17:16 -0400 X-MC-Unique: DIfJ-Z5gMB6a_MT_HGI2aQ-1 X-Mimecast-MFC-AGG-ID: DIfJ-Z5gMB6a_MT_HGI2aQ_1760494635 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-63b9bcd8cb4so4207432a12.0 for ; Tue, 14 Oct 2025 19:17:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760494635; x=1761099435; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rWHaCshThlxWbqF94dRXTXVIBi8jee90Btpfs717r4M=; b=Mryez+ULuLX26U9Eyu5yByf34cludQbrhG7/K9+PsEaVaV1qEbakYS6UhAmwZxUcxp oWOD78e8MORC5YXadjrk4U1lPXMYaTRK21vOczR0bjEep6+ApYVEjB/wx0ppuB4zx4J7 j2qUh+veyPn+MhzrOb+BXmmkSPwpWyc2CrWa22mLT+eyEfEB15SR/F0viA/2UnwjJAHW AwysrXc/SRQhlRasqvOQ0sJn1HkfeURwMZXhfrCOXRmxoOrmXITDFzE0cLb10toyetvp 40HyNyFv5Kg/euTW5Kzplhs4HXRUCxZwEVNjoB1q+g0PU5GUo6BqBZORRDV1L62gjML8 2I6w== X-Gm-Message-State: AOJu0YxKrLbIIyoxi9I4FfD6iOecBpRwd5SXZZ4R95W4b+eP4ZPGlOKu 4wUhVovBfeyJevZmDMQO4KnBR+kY+A2P8M7zhLJvBt2mZmkZn2YFdkckz1No/yNayvm5T/o7iZL ZbxYr4VVPBSqM45gwGSzB94lgyfO45aMhXO92ibUvjngfz26J2ckeOfBjIuolE+pFuNE04s1unr g/AUKjLJ761fPuQdw1zJKW/bd3gUj5 X-Gm-Gg: ASbGncsXfgxIgHFTGqVYUqsHBJgeDpQTU2UeOPSIINixi+WRM56ftu+gnTS0sQ2VAkC niZ/TLagkSiqWgY+o6RcgTb3L79IbqngLJw9pecu8EaXACajykCtxOSjN+WsEX+My/I8LlfLFGy YdM3GG6guU5PHEL7L/rvwWiQ== X-Received: by 2002:a05:6402:354c:b0:63b:e31b:a86a with SMTP id 4fb4d7f45d1cf-63be31bab49mr2808145a12.1.1760494635190; Tue, 14 Oct 2025 19:17:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF74pwqlcvk9uqYP8hxu4oBRfdr7stzXRR3SNC3gsfyrCrkZgJU0t7FEvrOB8KIig4zMn4pctG/uh2Qp6ZHBZU= X-Received: by 2002:a05:6402:354c:b0:63b:e31b:a86a with SMTP id 4fb4d7f45d1cf-63be31bab49mr2808128a12.1.1760494634727; Tue, 14 Oct 2025 19:17:14 -0700 (PDT) MIME-Version: 1.0 References: <20251014073836.18150-1-yuhuang@redhat.com> <20251014073836.18150-2-yuhuang@redhat.com> In-Reply-To: From: Yumei Huang Date: Wed, 15 Oct 2025 10:17:03 +0800 X-Gm-Features: AS18NWDLtTXIVeBAlNFh7L4Rgd1psrY9KU-O60nRgSwLfezEoXaxOsuE2FVxSRQ Message-ID: Subject: Re: [PATCH v3 1/4] tcp: Rename "retrans" to "retries" To: David Gibson X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: iCc11pFHz3jegJHbKlQbhm_hNAzS1aE_ia77vlOU9T0_1760494635 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SJSRZOX4LZTCEDATHK5BHBJS2UYNXDAO X-Message-ID-Hash: SJSRZOX4LZTCEDATHK5BHBJS2UYNXDAO X-MailFrom: yuhuang@redhat.com 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: On Wed, Oct 15, 2025 at 7:28=E2=80=AFAM David Gibson wrote: > > 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 > > Reviewed-by: David Gibson > > Btw, if the patch hasn't changed, you can keep the Reviewed-by line > from previous versions of the series. Got it, will add it in the next version. > > > --- > > 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 persi= sts 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_FRO= M_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 stru= ct ctx *c, > > if (SEQ_LT(seq, conn->seq_to_tap)) > > conn_flag(c, conn, ACK_FROM_TAP_DUE); > > > > - 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= 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 =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= epoll_ref ref) > > if (!conn->wnd_from_tap) > > conn->wnd_from_tap =3D 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_t= ap_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); > > > > - 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_TIM= EOUT > > + * @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/g= uest > > * @tap_mss: MSS advertised by tap/guest, rounded to 2 ^ TCP_M= SS_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, netwo= rk 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_TIM= EOUT > > + * @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/g= uest > > * @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 wa= y > | around. > http://www.ozlabs.org/~dgibson --=20 Thanks, Yumei Huang