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=F/hoxF1t; 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 594B35A061D for ; Fri, 07 Nov 2025 10:57:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762509430; 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=lvDmS5r7yyi4PbyMlLAbdt2KeRRDZxOoxOh2d0dUIsI=; b=F/hoxF1tsZhV3e3F56LesRWcaab6R6STgEWJSWQ8uHs/buqAjPtj7QasMfqS6ae+YoR4hS b25LX9hjKMvHmTMcC0vK+0MCe6agbkRt6e0ExZSdl/fMTMpytcbolMMICUrbToYIDFQEkT GELXcPH+Nerw7lsfH+IAyOFihm/H9MU= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-pekVACmJMJyLKHTvTshcOQ-1; Fri, 07 Nov 2025 04:57:08 -0500 X-MC-Unique: pekVACmJMJyLKHTvTshcOQ-1 X-Mimecast-MFC-AGG-ID: pekVACmJMJyLKHTvTshcOQ_1762509428 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-64095d94c2cso755277a12.1 for ; Fri, 07 Nov 2025 01:57:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762509428; x=1763114228; 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=lvDmS5r7yyi4PbyMlLAbdt2KeRRDZxOoxOh2d0dUIsI=; b=ZPhph8aZzrJbarHnXlcSI1crZEZCxevzSXAb2uXhb4xmmbXe4t1SPLLALN1Aks5h76 RuRKjiAJ410TTqRjrdmBS0tT/0Gpltb0hIMfYwiWueOhgUjgOwqeA7VTrcEnPSlyNjJE ogQ7krC7R4Xs283WwAZFyRab/TZEBr7Y9dCYD7RZj97edrqPDyzZFhdu3IAqnno+r7Os tWn96WJyk7qnf/ogI3vvxn9W/IlzbZH9wvxnZj5J8nM4SBO9nv7/S6alT3lFuzUpkdvB tX+dYJZegQNVpihDSIGbgXrM18WCPGDg3TC1y3lv95dS3Sm9NifHKGzZmU9fI6Ky8/tP YCnQ== X-Forwarded-Encrypted: i=1; AJvYcCUkODd8JPRui4bVqqWAD3J5cuSplkh7PW0cU1VSF4Q0ML3I4+tMN+7MEzB+ibL7SdHUa6mvMisc0h4=@passt.top X-Gm-Message-State: AOJu0YzcMjjzXWUPGjPxla/JjN8CNCJ49WEc5vXBBj09NI4riuD1jmWo WKqN8WXMTlVz2gxzM5/F6ArURL/Vs+xnQ7Se5tBfg5OImFMg2lEmu+nHkZdLV2CfNTlrC0Xw2Lq dQH2YQKE6iCmRpLQ8ynQd6vcBg8O+1gGvhE8e1GT+XnxCJ/32P6VmsnMbHkkbOA5MVt13X3+RWB nT4qKhF0LmDWfud+Ul59DYInepeMY0 X-Gm-Gg: ASbGncv11vdXkd+jx/IRISXI3O6zPyMszJaT0C6Us2LdR6qEUCnwD3kj7HtPCEFz1N3 ZOk/f1p641AI3jwXEinjYmVuBVUWGBodtaWFCbR8/FASMO4ZBIg+7/dvFgA5KtzIru16HAW7uaJ 8QnKdFn8c4u4pXl4Q2B0rstYYyCrtpv8qMU1eN7f0o0dD1j4C7wKFJcQ6/ X-Received: by 2002:a05:6402:34c1:b0:640:b321:9eb3 with SMTP id 4fb4d7f45d1cf-6413f0972a4mr2240818a12.14.1762509427682; Fri, 07 Nov 2025 01:57:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKVDDyxw50+d1L6GJ8+1WzT0s5m1gJZTd/dBhk+avLx3/o4szXtZb/vvu2wzCjk8TFUCX5OhVjc7GaRFLZQOU= X-Received: by 2002:a05:6402:34c1:b0:640:b321:9eb3 with SMTP id 4fb4d7f45d1cf-6413f0972a4mr2240731a12.14.1762509425666; Fri, 07 Nov 2025 01:57:05 -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> In-Reply-To: <20251105080057.3c4a61b9@elisabeth> From: Yumei Huang Date: Fri, 7 Nov 2025 17:56:54 +0800 X-Gm-Features: AWmQ_bnVQAZQ4YEW2MBmkwKWjuSzJ2rym-qYXL9lSkYgvglVG-pw-9iWq8YrW48 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: I5cMVLpmH_zyauEK8P52MBHEwYltwzAOxVSF3tSphFE_1762509428 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ARAPPWETVVYVFWFMR2RASQWAQOQN4A75 X-Message-ID-Hash: ARAPPWETVVYVFWFMR2RASQWAQOQN4A75 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 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_DEFAULT)= ; > > > > > > 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_TIMEOUTS= , > > > TCP_SYN_LINEAR_TIMEOUTS_D= EFAULT); > > > > > > would be a bit closer to the coding style we're adopting, but I wonde= r: > > > > > > - does read_file_integer() really need to have "integer" in the name? > > > > > 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 anything > > bigger or smaller. > > 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_TIMEOUTS_= 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. I can rename the function to read_file_num() if there is no objection from 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? (Adding Laurent in the loop.) --=20 Thanks, Yumei Huang