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=P1PlxTgx; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 038E75A08B5 for ; Mon, 10 Nov 2025 11:56:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1762772204; bh=DNTItG1kh8AQGk/khkRTGaWdSpsKx95xTyEXdbb2oyg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P1PlxTgxs7fVSvuS0zWWslWcCnspoJmUeXghlJzBsCSUNpfhkCDfidyENW3S4Vb3U b87W9tTF42Va5gOGsjh8skYMsjJqLjOePsYrnBnTtcmOtukFcZ4CAOKn1u4upd3xDO m47iJ5I5UUDLZLCbqWa2foc0L8JPM+9LSZsMfGnc21yRE0ApbMuYrwziXFoTdVM4Dh 0hMtc37jUb7bTnyozzvn0JxCVWLr8K6YsjtXkt9J0tgSRoiv9UutLv0DmgYF/BRo0g 3OVLUf8YggE6aUe+/nwj7JmcWNKExyuUEFaZM4DlxpJPE4c8YEK06id/llSSlfZE93 pSrnGl7qRppkA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4d4mnS024rz4w9q; Mon, 10 Nov 2025 21:56:43 +1100 (AEDT) Date: Mon, 10 Nov 2025 21:35:24 +1100 From: David Gibson To: Yumei Huang Subject: Re: [PATCH v8 3/6] tcp: Add parameter struct ctx *c to tcp_timer_ctl() Message-ID: References: <20251110093137.87705-1-yuhuang@redhat.com> <20251110093137.87705-4-yuhuang@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wAVrOio6VMijgllH" Content-Disposition: inline In-Reply-To: <20251110093137.87705-4-yuhuang@redhat.com> Message-ID-Hash: 3IRLZLWVRQIWIURCBVKZBXNW3RAC5NAV X-Message-ID-Hash: 3IRLZLWVRQIWIURCBVKZBXNW3RAC5NAV 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: --wAVrOio6VMijgllH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 10, 2025 at 05:31:34PM +0800, Yumei Huang wrote: Should have a commit message explaining that it was recently removed, and why you need it back. Stefano might be able to add that on merge, thou= gh. > Signed-off-by: Yumei Huang For the code itself, Reviewed-by: David Gibson > --- > tcp.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) >=20 > diff --git a/tcp.c b/tcp.c > index ca3d742..2f49327 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -543,11 +543,12 @@ static int tcp_epoll_ctl(const struct ctx *c, struc= t tcp_tap_conn *conn) > =20 > /** > * tcp_timer_ctl() - Set timerfd based on flags/events, create timerfd i= f needed > + * @c: Execution context > * @conn: Connection pointer > * > * #syscalls timerfd_create timerfd_settime > */ > -static void tcp_timer_ctl(struct tcp_tap_conn *conn) > +static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) > { > struct itimerspec it =3D { { 0 }, { 0 } }; > =20 > @@ -631,7 +632,7 @@ void conn_flag_do(const struct ctx *c, struct tcp_tap= _conn *conn, > * flags and factor this into the logic below. > */ > if (flag =3D=3D ACK_FROM_TAP_DUE) > - tcp_timer_ctl(conn); > + tcp_timer_ctl(c, conn); > =20 > return; > } > @@ -647,7 +648,7 @@ void conn_flag_do(const struct ctx *c, struct tcp_tap= _conn *conn, > if (flag =3D=3D ACK_FROM_TAP_DUE || flag =3D=3D ACK_TO_TAP_DUE || > (flag =3D=3D ~ACK_FROM_TAP_DUE && (conn->flags & ACK_TO_TAP_DUE)) || > (flag =3D=3D ~ACK_TO_TAP_DUE && (conn->flags & ACK_FROM_TAP_DUE))) > - tcp_timer_ctl(conn); > + tcp_timer_ctl(c, conn); > } > =20 > /** > @@ -702,7 +703,7 @@ void conn_event_do(const struct ctx *c, struct tcp_ta= p_conn *conn, > tcp_epoll_ctl(c, conn); > =20 > if (CONN_HAS(conn, SOCK_FIN_SENT | TAP_FIN_ACKED)) > - tcp_timer_ctl(conn); > + tcp_timer_ctl(c, conn); > } > =20 > /** > @@ -1770,7 +1771,7 @@ static int tcp_data_from_tap(const struct ctx *c, s= truct tcp_tap_conn *conn, > seq, conn->seq_from_tap); > =20 > tcp_send_flag(c, conn, ACK); > - tcp_timer_ctl(conn); > + tcp_timer_ctl(c, conn); > =20 > if (p->count =3D=3D 1) { > tcp_tap_window_update(c, conn, > @@ -2421,7 +2422,7 @@ void tcp_timer_handler(const struct ctx *c, union e= poll_ref ref) > =20 > if (conn->flags & ACK_TO_TAP_DUE) { > tcp_send_flag(c, conn, ACK_IF_NEEDED); > - tcp_timer_ctl(conn); > + tcp_timer_ctl(c, conn); > } else if (conn->flags & ACK_FROM_TAP_DUE) { > if (!(conn->events & ESTABLISHED)) { > flow_dbg(conn, "handshake timeout"); > @@ -2443,7 +2444,7 @@ void tcp_timer_handler(const struct ctx *c, union e= poll_ref ref) > return; > =20 > tcp_data_from_sock(c, conn); > - tcp_timer_ctl(conn); > + tcp_timer_ctl(c, conn); > } > } else { > struct itimerspec new =3D { { 0 }, { ACT_TIMEOUT, 0 } }; > --=20 > 2.51.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 --wAVrOio6VMijgllH Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmkRv+wACgkQzQJF27ox 2GcnpxAAjp19IhOw3V+/7lq5anpqW4g0X1h6HwWtplw0pjNQb5m+1joR9UjnG7VK mWAmKAoTz2Xl/N8NvWtXor27wTbsn0rWQCqM6D7oCVafaWCErmJBV1S4BvfkbRmq bWxWt5xI2wF+/MdjOJ8Zrnzo492mNmGFF/DGv3pgQqx1/zI4QKrk4drv/Pyq3aFv +0erIGLe/jzYPsGUGXYAwbNMupM6UoPn4wywx4POnB9CUdYfsOLJGa8H7aXpAhSF MOn0I8maVAqrI45DTj10kdFGWIq6/MyuqlXoxygNm2AKk9sm4K61SDHmrnUJVZoq 8Pg9/MZjrk5cUrLAyau3K9+nrGWpzUYqplGaxXYC5Pv0dL0qxyCsOBMEmYKxhzTF 8pfPrV3esy4Pio5SM/U7oD4bweQ/Ki7XMi+ppC2QFJ4MesrP9bxblWcwSOc1MwDU OLRvkxXkLPkU2PjxLlp9xJSYXDs9PA83gVQS8j1WS1XIBRuv9HBMgYISFWDCv/Oj KayCwD+TGkC4BN0pmze6ytT9t2jB0OhjgUZFwWl4LgWJP6Z3LaIPpsavWd+grzX7 MTR8wTP8/7BXvzIfK2UP9q/le2wvA2NMqYmHpeClEIPquPLQjxhRoub+iP+7ZhNS 7LORxv48kg5NG7UlMUs2It/g9daembp6B+F9AbozIep2pfIK5GM= =aQcV -----END PGP SIGNATURE----- --wAVrOio6VMijgllH--