Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1790185rdb; Sat, 2 Dec 2023 09:17:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6RDRlFYS0DePzkxETXYrJp7at0dMVpAO0OiZnw31q3BexH3JM0MbavgrNxK3qmFZGNiKQ X-Received: by 2002:a17:903:2a8f:b0:1d0:6ffd:f205 with SMTP id lv15-20020a1709032a8f00b001d06ffdf205mr592080plb.91.1701537420954; Sat, 02 Dec 2023 09:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701537420; cv=none; d=google.com; s=arc-20160816; b=DzYOkksdgXm7htT5fFARRCZ9w7D930ousYx2sNktazyPMraH+d+GAMZZumIy4RSSuQ JY91/WC71u6Po1xUdjiD9XjnDHZRcHcY7WsgD/Vu9Ipd310+LR2iesW6HmFBsw6UZc7f OeZfW1C9NWthWk/LEaEaGSN3v1Qhs1RkcVx0TuCctoRGyL2AzkgPOZ5A69S2rBDR/8Dt WYHgOITXNkb0/3VQ59r/dwF3iCjn3PHwJJVFfVMPwkZOlIP/iZMjFcu6Ggu4sL0EYoTO kpwQXvfSy9aTCRpTlooHKbrN0ISS8dgWWM5sTBCRVM/IvwapHRMo/MRKNuZ4vfj2LLq5 sVOw== 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=kgx0fymLTN9OcsqAtjs4OIghYeLxTJWrS8pUBAS4op4=; fh=kxAr5+u0a3N6PbfoZ3MEjlMm86nZnq+rS9JnACyxLi4=; b=KxqwuS8gP4hG7AkWppa7qEBrCGJCfBONBML+fxUXcTArC2j7hDcbKJpF8qhVJ0eItC BK1bgJhCkLbjtFF3Jnbkz9En3GjaaIK993x5ICSk0sCFT70bNdw1yTqYq62d5SGU34lz gnMwkH+NYFJcBbcVnD+WEqhlKODPhl0dlgLaFZnrSbWJw0lsrUpleepFlE2kz8uJCsNn XF/SRRtcxRjf5OV0HK4xnDk1cMJsqDc4ZDvmiTOEB5FrWDs/ehqAavD6TXaS4H5Ln9Ow Eupy/mDr+u97bjXYqIZG/MsVLALsEVmhkj0lB4TY+nDCAbOKl7bSP1vylp9du0Rl7xf3 CHNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jN6ES8a4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bc3-20020a170902930300b001cfb6a814a0si4981945plb.288.2023.12.02.09.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 09:17:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jN6ES8a4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 62130805DC40; Sat, 2 Dec 2023 09:16:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232432AbjLBRQL (ORCPT + 99 others); Sat, 2 Dec 2023 12:16:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjLBRQK (ORCPT ); Sat, 2 Dec 2023 12:16:10 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AB68124 for ; Sat, 2 Dec 2023 09:16:17 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF781C433C9; Sat, 2 Dec 2023 17:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701537377; bh=53gQ5QPBeQ1+h1gAjauNWXZ/KuI17gL+1YoqsW1KWKo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jN6ES8a4zqtEydvdGod1EVRG1C3ScEKJp/IsOzbHWP0SBqotp79X9MMxrYd7gC6fg Fd9Vc6vdRLKd7mSwB7BCIJISaTlD9i3ExUF4QUCLuVDh39jnFN2aZmarB9MybBydWK 2FLLUZskyd+DSceIs2VdcX1cUIs6Io4ts4GVOpXMR6VmvIypBCl4pwMdrP6Jznp6pJ k2lW2Mqt+o9CtAwG/JZUQtoVYQ53CCjtUDKMoclNfaanASzuWYgJdq1eWcspdm7pdT BFAJl2KldMZfzxekSW6JEIaGZzdzbEZi6RFdQmn+IMyzI4xoAOYubgdHvI7kF8jART 1NXT0Q4YFHjsA== Date: Sat, 2 Dec 2023 17:16:12 +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: <20231202171612.GC50400@kernel.org> References: <20231129165721.337302-1-dima@arista.com> <20231129165721.337302-7-dima@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231129165721.337302-7-dima@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 morse.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 (morse.vger.email [0.0.0.0]); Sat, 02 Dec 2023 09:16:58 -0800 (PST) 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? Flagged by Sparse. ...