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=ASxFpYfd; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id F41AB5A0965 for ; Mon, 10 Nov 2025 03:52:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762743140; 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=Yg8BaDsKDHDbAEsAq5Bz7uEV9ewISN45v0KyPAhtkbc=; b=ASxFpYfdWR4+io8OowTnDWWVavNLts1HXLiOK3lOVvcSLiV7IJqW24bpVDdmDFWYgpV4kA Y2EQ8XCmvJy9vLus0ACzqbQBtGnven2CoJm3LHrkfEwHKLJroJ8+HwoOFcbdlrgUK8xQJU q/VNKGz+wdbayrDOJI5a06Dm+NwisQ0= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-zkKsBpOgODGnvPY9oFdtrA-1; Sun, 09 Nov 2025 21:52:19 -0500 X-MC-Unique: zkKsBpOgODGnvPY9oFdtrA-1 X-Mimecast-MFC-AGG-ID: zkKsBpOgODGnvPY9oFdtrA_1762743138 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-6417a4b67f9so631297a12.3 for ; Sun, 09 Nov 2025 18:52:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762743138; x=1763347938; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Yg8BaDsKDHDbAEsAq5Bz7uEV9ewISN45v0KyPAhtkbc=; b=b2Uy89pVe3R/pqVXt0ZX4e0/95w9vM4NyT3CpeF03LFE/8o0Gzj1Kxz+nvpsIh5zPl Aoro3RXJhlR/i8namv7/moz2akLc4Jmu6j+bXAsLokPl6MMwAn9AWhvTFQICYwIsRUuh CIQ30/+3AyvT9dXJg3yrH7dpwCrZretgGfp7JTzSv6ngZtuh1GmhiaFStstDJLw2hRA/ e/MLg1ecmHTq1jz35eaYLjXV6vIaSXoahNBXEWfipzPYB2kwmBYJ79lKRJ0C1I5U2YHh Jpz5cy7m5G4t2HHIqOzJqBKcFXeehjtbAL3Ndp1tP02VbDgmRNgN813TIt3E3dddFF3+ RM4g== X-Forwarded-Encrypted: i=1; AJvYcCVv1x6wj0DqMAR5jOlFkqEui0FGbxnNjgUPf2c72j5aldJT2RHne9MeHW9ASgItm5aKvwS5vgtpCKs=@passt.top X-Gm-Message-State: AOJu0YwPhJCkAAsFIeNGs6dMmY7oSPXnPe1z5ocbaTb9hlHffzAgedun 9LbP2rAhQ2h8qDkIkPCzy+Yysb16bGgyFBwuA2xWZclrK43Vpg4x6xGFVz7c6xYAYfPVGHLfT08 APG/v0QyG8TfNe43+zsxiwGoKFQ1xNdOQ1q5APlhxFwOF4NHfp4C7DvQifiMIto9KfxuXa1243y vRGUOhNOdIrlOSBGK1L4hypqGNQI2+ X-Gm-Gg: ASbGncsJdMEax+KgP5zz5AQ1Sd07AqtibbAAl2nw4rt+EaAhYSv+H7nBfF1/f3VMnlS XZZ5ssKtxR8nCfh0jXkE1vR7IR5tTXlDFPbtw1VmZxVlf/AITquEaQC1ooNwObZNN51K07kqS3R yzW1Q7sMYZxtYsTonUpcgRXUXJ8w6qF86jsq2NXe1FFTCkNIgGpmiN7gBA X-Received: by 2002:a05:6402:1ecf:b0:640:9eb3:3686 with SMTP id 4fb4d7f45d1cf-6415e6f21b4mr5456293a12.19.1762743137698; Sun, 09 Nov 2025 18:52:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHNTxOW7Lhq5qcKdSq1DxjIuoLKAfmPKmx8rqemH51exOTluZvnkrp+i/wj+f/XL868lbJjfpQTYa3s6LZOuKU= X-Received: by 2002:a05:6402:1ecf:b0:640:9eb3:3686 with SMTP id 4fb4d7f45d1cf-6415e6f21b4mr5456208a12.19.1762743137054; Sun, 09 Nov 2025 18:52:17 -0800 (PST) MIME-Version: 1.0 References: <20251031054242.7334-1-yuhuang@redhat.com> <20251031054242.7334-4-yuhuang@redhat.com> <20251104054233.1dec4eb6@elisabeth> <20251105080057.3c4a61b9@elisabeth> <20251107110542.73016350@elisabeth> In-Reply-To: <20251107110542.73016350@elisabeth> From: Yumei Huang Date: Mon, 10 Nov 2025 10:52:05 +0800 X-Gm-Features: AWmQ_bnEA_CJOSeI8ODyiKV3TRnk_jnBH7MA0Xczfb17EgxaFysCDN76FQLBP5o Message-ID: Subject: Re: [PATCH v7 3/5] tcp: Resend SYN for inbound connections To: Stefano Brivio X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: o-FUAtNehV-LYi1MhXXEXgsoyTS1HgkT_Zwl6qOWsJk_1762743138 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZRUKW2JU6CBJJM5SKEXVYKVUDZFAL4J7 X-Message-ID-Hash: ZRUKW2JU6CBJJM5SKEXVYKVUDZFAL4J7 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: David Gibson , passt-dev@passt.top, Laurent Vivier 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 Fri, Nov 7, 2025 at 6:05=E2=80=AFPM Stefano Brivio = wrote: > > On Fri, 7 Nov 2025 17:56:54 +0800 > Yumei Huang wrote: > > > On Wed, Nov 5, 2025 at 3:01=E2=80=AFPM Stefano Brivio wrote: > > > > > > On Wed, 5 Nov 2025 15:24:44 +1100 > > > David Gibson wrote: > > > > > > > On Tue, Nov 04, 2025 at 05:42:33AM +0100, Stefano Brivio wrote: > > > > > On Fri, 31 Oct 2025 13:42:40 +0800 > > > > > Yumei Huang wrote: > > > > [snip] > > > > > > +/** > > > > > > + * tcp_get_rto_params() - Get host kernel RTO parameters > > > > > > + * @c: Execution context > > > > > > +*/ > > > > > > +void tcp_get_rto_params(struct ctx *c) > > > > > > +{ > > > > > > + intmax_t tcp_syn_retries, syn_linear_timeouts; > > > > > > + > > > > > > + tcp_syn_retries =3D read_file_integer( > > > > > > + TCP_SYN_RETRIES, TCP_SYN_RETRIES_DEFAULT); > > > > > > + syn_linear_timeouts =3D read_file_integer( > > > > > > + TCP_SYN_LINEAR_TIMEOUTS, TCP_SYN_LINEAR_TIMEOUTS_DEFA= ULT); > > > > > > > > > > I think this is a bit hard to read. Now: > > > > > > > > > > tcp_syn_retries =3D read_file_integer(TCP_SYN_RETRIES, > > > > > TCP_SYN_RETRIES_DEFAULT); > > > > > syn_linear_timeouts =3D read_file_integer(TCP_SYN_LINEAR_TIME= OUTS, > > > > > TCP_SYN_LINEAR_TIMEOU= TS_DEFAULT); > > > > > > > > > > would be a bit closer to the coding style we're adopting, but I w= onder: > > > > > > > > > > - does read_file_integer() really need to have "integer" in the n= ame? > > > > > > > > > In a language where integers are called 'int', perhaps > > > > > read_file_int() is clear enough? > > > > > > > > I think the idea is that read_file_integer() can be used for any > > > > (signed) integer type (with range checking performed after the call= ). > > > > read_file_int() might suggest it reads exactly an 'int', not anythi= ng > > > > bigger or smaller. > > > > > > Oh, I see. It could be read_file_num() then, even if it's slightly le= ss > > > accurate, or it can even remain read_file_integer(). If something lik= e > > > this: > > > > > > v =3D read_file_integer(SYN_RETRIES, SYN_RETRIES_DEFAULT); > > > c->tcp.tcp_syn_retries =3D MIN(v, UINT8_MAX); > > > > > > v =3D read_file_integer(SYN_LINEAR_TIMEOUTS, SYN_LINEAR_TIMEO= UTS_DEFAULT); > > > c->tcp.syn_linear_timeouts =3D MIN(v, UINT8_MAX); > > > > > > fits 80 columns, I'm taking it as a sign that the function name isn't > > > exceedingly long. No particular preference from me. > > > > The longest line just exceeds 80 columns. > > No, why? It's 80 columns, look: > > v =3D read_file_integer(SYN_LINEAR_TIMEOUTS, SYN_LINEAR_TIMEOUTS_= DEFAULT); > 0123456789012345678901234567890123456789012345678901234567890123456789012= 3456789 You are right. Somehow I counted 81 columns. Then I will keep the name as it is. (To me, read_file_num() sounds like it can read any kind of number.) > > > I can rename the function to read_file_num() if there is no objection f= rom David. > > Sure, up to you and David. > > > Another thing, while I was revising the patches, I noticed the > > parameter "const struct ctx *c" was removed from tcp_timer_ctl() by > > commit dd5302dd7bf51 ("tcp, flow: Replace per-connection in_epoll flag > > with an epollid in flow_common") from Laurent, but we need it to > > access c->tcp.syn_retries and c->tcp.syn_linear_timeouts. Should we > > add it back? > > Yes, I don't see any other way around it, and I think I'll need it back > anyway for some fixes I'm working on. > > It's one type of trivial conflict I would typically fix up on merge, by > the way, but given that you will send another version, you could/should > rebase on latest HEAD anyway. Sure. > > > (Adding Laurent in the loop.) > > -- > Stefano > --=20 Thanks, Yumei Huang