Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1565141rdb; Thu, 7 Dec 2023 02:52:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmQnIs4sGZrXTTSUL2P3sSRSb9xFpSlLSbg+SRwH5M3mYvVdneZbbyC5VZ4W2SA2FATXL9 X-Received: by 2002:a17:90b:4ac7:b0:286:b4b4:fc1c with SMTP id mh7-20020a17090b4ac700b00286b4b4fc1cmr2467452pjb.65.1701946376020; Thu, 07 Dec 2023 02:52:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701946376; cv=none; d=google.com; s=arc-20160816; b=eJ5ttWpE1PWU8CFR7rGrqlZIoEjefGna7mymLMy2ank7+PsMmZcBy+3zYANYea4kUl ke+9//iG5XPE7NHUYWEq7jax4zOgFEuwK9KOx6zqepKuGVYOZnnfjkUNY+CijaDb3zUM hPtOPIZ5lQnf5/klTre+TeNftmj14NYi5pWJXaR6tolosASjSl2xy8TIdrq0zIQbYKFR IXoZHWJjkoavEUdL4Eku3DnfZjI1BsXZHaVdX5eXg04gWynTd1o9TpRpgXokbHJ4YHFE Qfc0NSckrRgRUA93UAyyw5gUwbzuarpNrw0DpGoW/KtdU2kHUR4bQ+ch0JJhHc7pkB2R YIGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fL4c1qUWwcfPN6aHCIYve0tfY8AcIPIVbZrnKiimr7s=; fh=kxAr5+u0a3N6PbfoZ3MEjlMm86nZnq+rS9JnACyxLi4=; b=RoqiMK+TrbqoSwvNRnACbQykg1pisrqkKlf8smK5AFvGuFkeWpOUVbHkuCie1LtC/C Mk+LBbj/ghPhI92XBUP4XqZ8YzKl/w5qWCrtPfVEDjvIfIeJ0RX+geFhifQqsCQEOQVU ojCnQgJ9DJ2EF9fMB8IaANnWSU9H+o8+p0bv4Vsil5yXnz+LI0ccHiASzCagBXJo1t+b nYxWkbwBeyM8nLJjxUP2rLkZY+7Jv61mzh6Z0u+g/y+rzwFFlAufR+Nvaf/HLEZ3Wq72 nbj0yKUsS8Kf85u65x5AAij4ARZAD6YRKp9uwymZ+WlaAV/TIK6gbTFu3WYdFR5dZYno Sdag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XuUBuaCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id a4-20020a1709027d8400b001cfc4194c96si936122plm.120.2023.12.07.02.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 02:52:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XuUBuaCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 8C9078026185; Thu, 7 Dec 2023 02:52:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231876AbjLGKwh (ORCPT + 99 others); Thu, 7 Dec 2023 05:52:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjLGKwg (ORCPT ); Thu, 7 Dec 2023 05:52:36 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCF04D59 for ; Thu, 7 Dec 2023 02:52:42 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E381DC433C8; Thu, 7 Dec 2023 10:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701946362; bh=5W0HsIUrX9rQ2Z3aNMkLYeMpOcwj3cSmk1NBCIWioOs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XuUBuaCxwj+udyoOssB8D4M3eAX1tEqiCf3i4YqwKggrNye964Je/xTwd/9y4T1iY ieoukzTIZXOa3zdJpiqbBAHmYzreNiInTPQAAvaSSJFF7rgYGsYB4UZZvUl5Q7G5QI 3cmy2iE3k0Y3wTSLhkx36CcRleBh7x9b9h75HVX0VLU15P9z88Jf3YznWTl82+83Pc 8bRBTcN8jz+tXjfyAhCV86wRq/Q7RUEvwj/TJnrz96CY7YqmUF5fjATpECC+EDqiJ4 MXVPiH5NpAI3yEAuTzqunB35aGYNPgrj9P0x1rRV5P/v/D6+JqK4matpuqCe0vLPeJ Zn/nWHU79kj2g== Date: Thu, 7 Dec 2023 10:52:36 +0000 From: Simon Horman To: Dmitry Safonov Cc: David Ahern , Eric Dumazet , Paolo Abeni , Jakub Kicinski , "David S. Miller" , linux-kernel@vger.kernel.org, Dmitry Safonov <0x7f454c46@gmail.com>, Francesco Ruggeri , Salam Noureddine , netdev@vger.kernel.org Subject: Re: [PATCH v4 6/7] net/tcp: Store SNEs + SEQs on ao_info Message-ID: <20231207105236.GE50400@kernel.org> References: <20231129165721.337302-1-dima@arista.com> <20231129165721.337302-7-dima@arista.com> <20231202171612.GC50400@kernel.org> <45d63402-bd0f-4593-8e57-042c0753f3e3@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45d63402-bd0f-4593-8e57-042c0753f3e3@arista.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 02:52:53 -0800 (PST) On Mon, Dec 04, 2023 at 05:08:20PM +0000, Dmitry Safonov wrote: > Hi Simon, > > On 12/2/23 17:16, Simon Horman wrote: > > On Wed, Nov 29, 2023 at 04:57:20PM +0000, Dmitry Safonov wrote: > >> RFC 5925 (6.2): > >>> TCP-AO emulates a 64-bit sequence number space by inferring when to > >>> increment the high-order 32-bit portion (the SNE) based on > >>> transitions in the low-order portion (the TCP sequence number). > >> > >> snd_sne and rcv_sne are the upper 4 bytes of extended SEQ number. > >> Unfortunately, reading two 4-bytes pointers can't be performed > >> atomically (without synchronization). > >> > >> In order to avoid locks on TCP fastpath, let's just double-account for > >> SEQ changes: snd_una/rcv_nxt will be lower 4 bytes of snd_sne/rcv_sne. > >> > >> Fixes: 64382c71a557 ("net/tcp: Add TCP-AO SNE support") > >> Signed-off-by: Dmitry Safonov > > > > ... > > > >> diff --git a/include/net/tcp_ao.h b/include/net/tcp_ao.h > >> index 647781080613..b8ef25d4b632 100644 > >> --- a/include/net/tcp_ao.h > >> +++ b/include/net/tcp_ao.h > >> @@ -121,8 +121,8 @@ struct tcp_ao_info { > >> * - for time-wait sockets the basis is tw_rcv_nxt/tw_snd_nxt. > >> * tw_snd_nxt is not expected to change, while tw_rcv_nxt may. > >> */ > >> - u32 snd_sne; > >> - u32 rcv_sne; > >> + u64 snd_sne; > >> + u64 rcv_sne; > >> refcount_t refcnt; /* Protects twsk destruction */ > >> struct rcu_head rcu; > >> }; > > > > Hi Dmitry, > > > > In tcp_ao.c:tcp_ao_connect_init() there is a local > > variable: > > > > struct tcp_ao_info *ao_info; > > > > And the following assignment occurs: > > > > ao_info->snd_sne = htonl(tp->write_seq); > > > > Is this still correct in light of the change of the type of snd_sne? > > Thanks for the report. > Yes, it's correct as lower 4-bytes are initialized as initial SEQ. > I'll add a cast for it if I'll go with v5 for this patch. Thanks Dmitry, I think that would address my concern.