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=IXxIH24e; 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 6EC655A061D for ; Fri, 07 Nov 2025 11:05:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762509947; 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=+wVpxUMJScfrvAmJtUGszz7+YECnfsbajxuOKuUm+TA=; b=IXxIH24eeOglYLVQ3Qf8ZYi3/RhTuClem42LSwlZ55U5yeWjDCdN9cBsBndcqRlcPwoTGU riv753x0HSMbvmObDomHMSc+eI7za183jiRpbuOHl02Y6GgTu+2KpBPcGVXM62NIO0bTgK xQEkkmizaA++y9xvkVaCO5OP7CGCWF4= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-33-iWgE4kc9OAOTZZ6b3vIRwQ-1; Fri, 07 Nov 2025 05:05:46 -0500 X-MC-Unique: iWgE4kc9OAOTZZ6b3vIRwQ-1 X-Mimecast-MFC-AGG-ID: iWgE4kc9OAOTZZ6b3vIRwQ_1762509945 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-477632ef599so2579075e9.1 for ; Fri, 07 Nov 2025 02:05:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762509945; x=1763114745; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YDLyJ4eFJ3KSSnuKAQhzXmQ/PJu9LpW/8je+ipcTeN4=; b=KpwOooCTDTYd5bJul3ncckD9ZqD+Pe/2cgi06jcaYVQ3FHvTJe1FzYxMtNwdhMv97m hStSi/iwdleyFQwrd/l2yBiVfku4zWFBGRrRZNorYuW2kpcmuklPE72rUi8HevTGLI8d nUZUaob/WSK2Gd2rDazOTHQXCX9ab1PEDtZjwHJxw+bhegwQzKUa7A2vE1/Sl1pi5Yjc 45C2YKilOUKEvnByq5OX9YL/LtdOGy9D0hkHtdQ25f/X4uFVRI/ACfoRQ/TQVgJR6i6e OCUF8G+iC6E4GNSwuB1sM0arpmkmVuHHBlwF4o4ClIw1aA3nurFPjGaCoO55VTpsdyUs RviQ== X-Forwarded-Encrypted: i=1; AJvYcCUppPH32Ofy5cQHZUlF42mebjIl63uTNtixnjKXdfluJaQQeUuhUdmxmH+yD7DlASfn6qa08mHK0h0=@passt.top X-Gm-Message-State: AOJu0Yw11mtBJDdB473+7Kn096XZtEvN3YnCttxpokCk7qNoIWo/IdW1 Q95lbKxeErQV2MKNgeLKk+MZo0KCc/JYhGTe14W2AeeWX5madKKJIdLmdzVDSIltDegfjyyIWul 48QG78yD0v6d/TSwHsMXZaMqRVtia9Ll12l9ZGSrNZnN7059JsFBFPA== X-Gm-Gg: ASbGncvTMu4hvYKzo8UaZq3/pMvlnXDw4T7otiTdQY/Cnx6IsT3O5r+GIcvV6OwvQFn sav1PNz8SW+Hun/pZ/21FinDl5FLW/1BcjqTU0bhWTMS7xn2rE8Yjd3bgbxNgUSq9JbBBC7Cp1Z e0IELOhpi0OrWn2cN/7wFJ3kkMr/laT6RXyyNVC62zqxj2w3CbrBMJzPWMxOEhSOnNQFi3d9RTN zi18G5zKaal0zSyJ8g/ltox88pgXv2kRhx+xhfW6uRyGAwVsFxwiqCOQCJYCRGTIIT0ED7tglLJ WJH97UtBRbCRU5VQwKgWMZkrNKClUFiQF4jihv5711uJnWdb+PQ1YD1UXdt4g12yS+b8+0FtSxT gGM9ezE3uCsNc23zw8i9FE8dLVgs= X-Received: by 2002:a05:600c:528b:b0:45d:e775:d8b8 with SMTP id 5b1f17b1804b1-4776dc4e286mr10406775e9.1.1762509944674; Fri, 07 Nov 2025 02:05:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGh4S8mgcu19V/wVQ/StZfm8+uPX+/CXBN8JZ4vYZxfIqnVIOq8c5+eteaTT8L5nfiLOSDUfw== X-Received: by 2002:a05:600c:528b:b0:45d:e775:d8b8 with SMTP id 5b1f17b1804b1-4776dc4e286mr10406495e9.1.1762509944208; Fri, 07 Nov 2025 02:05:44 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42ac675ca86sm4279878f8f.31.2025.11.07.02.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Nov 2025 02:05:43 -0800 (PST) Date: Fri, 7 Nov 2025 11:05:42 +0100 From: Stefano Brivio To: Yumei Huang Subject: Re: [PATCH v7 3/5] tcp: Resend SYN for inbound connections Message-ID: <20251107110542.73016350@elisabeth> In-Reply-To: References: <20251031054242.7334-1-yuhuang@redhat.com> <20251031054242.7334-4-yuhuang@redhat.com> <20251104054233.1dec4eb6@elisabeth> <20251105080057.3c4a61b9@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: kTWQ9RpJG7VzrcxlXLZR5tVawOu6hDviG1ers2y4v4E_1762509945 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CAOZ7VSTDBF5E2RPSMSWSKJIIBWUEK5C X-Message-ID-Hash: CAOZ7VSTDBF5E2RPSMSWSKJIIBWUEK5C X-MailFrom: sbrivio@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, 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: > > =20 > > > On Tue, Nov 04, 2025 at 05:42:33AM +0100, Stefano Brivio wrote: =20 > > > > On Fri, 31 Oct 2025 13:42:40 +0800 > > > > Yumei Huang wrote: =20 > > > [snip] =20 > > > > > +/** > > > > > + * 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_DEFAUL= T); =20 > > > > > > > > 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_TIMEOU= TS, > > > > TCP_SYN_LINEAR_TIMEOUTS= _DEFAULT); > > > > > > > > would be a bit closer to the coding style we're adopting, but I won= der: > > > > > > > > - does read_file_integer() really need to have "integer" in the nam= e? =20 > > > =20 > > > > In a language where integers are called 'int', perhaps > > > > read_file_int() is clear enough? =20 > > > > > > 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 anything > > > bigger or smaller. =20 > > > > Oh, I see. It could be read_file_num() then, even if it's slightly less > > accurate, or it can even remain read_file_integer(). If something like > > 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_TIMEOUT= S_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. =20 >=20 > The longest line just exceeds 80 columns. No, why? It's 80 columns, look: =09v =3D read_file_integer(SYN_LINEAR_TIMEOUTS, SYN_LINEAR_TIMEOUTS_DEFAULT= ); 012345678901234567890123456789012345678901234567890123456789012345678901234= 56789 > I can rename the function to read_file_num() if there is no objection fro= m 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. > (Adding Laurent in the loop.) --=20 Stefano