From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=203.254.224.33 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795790874; b=ME1tYnXxrOOCAhstkpaUozC+NhdiFH7Iayyub9/5qIk6GpHBQqltk5m76vmCHiBjyMKS vnTQoS5ivZLPcsTOZfCN8k3F9HRJ42ZbJ0vErD/FQZW2WeGF0NPQqgELmzhR9WoyrG4Bb JRJXsQWcNtY27ZKRvyN3ndoRI5rgVexUPOCvPiwUhsKfop3YJTTq13/FsCEEHS+UFEAXL ++S25nTTn89ZW7Fwcy5NitOAEH9Pyt/J77EQlg1pRsvCzFVmoS/dA0g7fqUsSZnP2BHIy 7gUmg10tWRGkh0y7EnUNDx7wSD0VjUfMVxWQJDZF7k2SvrOKAi7F3NLPVWvi+p2Xu8g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795790874; h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:Received:Received: Received:Received:From:To:Cc:In-Reply-To:Subject:Date:Message-ID: MIME-Version:Content-Transfer-Encoding:X-Mailer:Thread-Index: Content-Language:X-CMS-MailID:X-Msg-Generator:Content-Type:CMS-TYPE: X-CPGSPASS:cpgsPolicy:X-CFilter-Loop:X-CMS-RootMailID:References; bh=LigbDYHgFUyhETTkgekQg93P9iKK9kMEZK/QoESy0XE=; b=AHWIpJTreZFk3r+6sSls/kT4fuA+frRozDQjBC4j+xrc1rNN97iGC4D/Bdk3oo/UZG+o H9z4VrEdnU4nzOMTp9OoYRk8Ha3gWSUstOLhPyjlrFv1wJwa/0Lv1p/wW2zZjAoL66t7E EieT3Kn8fdLsMLT2/4G0Mr0Yf2Vh+qXJ3ezbIci4pRmcIDkOvkbXpMFSmGMeW9YwPuNhM K58Kq5oVnwHZCdL2IqskIYdD4NU3bWxmJxTej4q3DPY4EDOUTNtqcl/miOad21kcylv1Y hTuIXV8h9XgZ29aFAwJen3i6PdwHbGM7tVpM6tlgpv2Glsc26MBwa6RdkjkcbJzLnmw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass header.d=samsung.com header.i=@samsung.com header.a=rsa-sha256 header.s=mail20170921 header.b=sIbjzqZ6; arc=none smtp.remote-ip=203.254.224.33 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98A03606A31E for ; Fri, 27 Nov 2026 14:47:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 98A03606A31E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.a=rsa-sha256 header.s=mail20170921 header.b=sIbjzqZ6 Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20261127144750epoutp0312c31acc939dc49c81949de82e912114~r7khK8ArS2104221042epoutp03Y for ; Fri, 27 Nov 2026 14:47:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20261127144750epoutp0312c31acc939dc49c81949de82e912114~r7khK8ArS2104221042epoutp03Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1795790870; bh=LigbDYHgFUyhETTkgekQg93P9iKK9kMEZK/QoESy0XE=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=sIbjzqZ641dRkba/PO0L2PZ/V2F+oqYTeIritnuJjc/vA9WhmIQjSJp3l60NRP5tQ lv3vpu2MBtWR9tyz+7YyytgzzNwodVWAiZOGwirlprkZoWqyaARQqcFclSbHW5wU/Q OPq/FJ/cvYwDi/yJfwmvMz+Ea3e8MG+YVt4KenJQ= Received: from epsnrtp04.localdomain (unknown [182.195.42.156]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPS id 20261127144749epcas5p49e7591462797aaed3ad3aebe6d3ce918~r7kfprcBC2671426714epcas5p4v; Fri, 27 Nov 2026 14:47:49 +0000 (GMT) Received: from epcas5p2.samsung.com (unknown [182.195.38.91]) by epsnrtp04.localdomain (Postfix) with ESMTP id 4jbbqm2VM4z6B9m5; Fri, 27 Nov 2026 14:47:48 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20261127144747epcas5p3ea5291d4421b9dd1c7b5bd9f689d7639~r7kd9qO0n2159821598epcas5p3p; Fri, 27 Nov 2026 14:47:47 +0000 (GMT) Received: from SRIBCU13LG9P71 (unknown [107.108.208.92]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20261127144743epsmtip11a938de5238cc75244ef9229b378d8a2~r7kaaIVkO2293022930epsmtip1S; Fri, 27 Nov 2026 14:47:43 +0000 (GMT) From: "Irlanki Sandeep" To: "'Kuniyuki Iwashima'" , Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , , In-Reply-To: Subject: RE: [PATCH bpf-next v9] bpf: tcp: add ecn_init callback to bpf_tcp_ops for per-connection ECN Date: Fri, 27 Nov 2026 20:17:42 +0530 Message-ID: <000001dd7e7e$448c3000$cda49000$@samsung.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQLz+NqzmYpujPtDh8x08WfmcH857AK2nUVDAsdHS6ECyy+hMbTSuHvQ Content-Language: en-in X-CMS-MailID: 20261127144747epcas5p3ea5291d4421b9dd1c7b5bd9f689d7639 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P X-CPGSPASS: Y cpgsPolicy: CPGSC10-065,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20261116151200epcas5p4218c26338b3e9580a9e232be400aecc5 References: <20261116151331.500313-1-irlanki.s@samsung.com> Hi Kuniyuki, Thanks for the review. v10 is posted as 0/2, 1/2 and 2/2. > Why can't ip-rule (or VRF) be used with a per-route attribute ? Routes and rules select traffic by destination, interface, mark, uid range, protocol and port, not by cgroup or application. A uid or mark rule can separate apps, but the existing per-route ECN bit (RTAX_FEATURE_ECN) only force-enables classic ECN, so selecting AccECN would need a new route feature. VRF separates traffic by routing table and interface, not by application on the same route. > Also, a route attribute would work with syncookie. Correct. Syncookie connections do not run the callback, so with this series they use the sysctl; the route bit still applies via cookie_ecn_ok(). ip-sysctl.rst documents this. An automated review of v10 pointed out that the commit message is wrong about syncookies. It says no request_sock is created, but a request_sock is allocated; it just has no listener, so sk_to_full_sk() returns NULL and the program is skipped. v11 will fix the commit message and add a comment at the call site. I consider the fallback acceptable, since syncookies only come into play under load. If you think the per-connection policy should also cover the syncookie path, I'm happy to discuss options. > This is simple, but one concern would be that we end up adding more > single-purpose stateless callbacks during 3WHS, which could be more > expensive than stateful solution. > > For stateful use case w/ per-socket field, rwnd_init() + kfunc would > suffice (and we have such a use case). The cost concern is valid. The callback runs at most once per side per handshake, and since v10 on the passive side only for SYNs that request ECN. For the stateful alternative, rwnd_init() + kfunc works on the active side, because rwnd_init() runs in tcp_connect_init() before tcp_ecn_send_syn(). On the passive side it does not, because tcp_ecn_create_request() decides the ECN bits before rwnd_init() runs, so a field set there would not affect that SYN-ACK. If your per-socket use case is active-side only, rwnd_init() + kfunc is viable for it, and we can discuss it as a follow-up. > nit: reverse xmas tree order > Please avoid calling it if not needed, > !tcp_accecn_syn_requested && !th_ecn > > also nit: reverse xmas tree Done in v10. The declarations in tcp_ecn_send_syn() and tcp_ecn_create_request() are reordered. tcp_ecn_create_request() now returns before calling tcp_ecn_init_bpf() unless the SYN requests AccECN or carries ECE+CWR. > Please split selftest into a separate patch. Done in v10. The selftests are in their own patch (2/2). Thanks, Sandeep