Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2851987rdb; Mon, 4 Dec 2023 09:08:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnLnu9+Khqu+pm1KfF1TQS/U19VyffPCwRASB/Nx2EA73RGSl0KI1j4Nkwu+0KBN2fAgPM X-Received: by 2002:a05:6a20:938e:b0:18f:97c:8a37 with SMTP id x14-20020a056a20938e00b0018f097c8a37mr6063503pzh.98.1701709717026; Mon, 04 Dec 2023 09:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701709717; cv=none; d=google.com; s=arc-20160816; b=WPQ5AIdYuJpjcsRUvCOdZd2B/FsFxKfbQ/trhYLFBKsdObyzbzDUJpLLkCEvp7pKe5 RUdQNJKALoUqImDh1umF8FGMDoGfyyYWjCJ/LMH78KSwXe64ZFYWVa8DmBaooQmguNQC jzxRkJlFSVk9A/Ty5k7vvnW4oIrmHxCgemlQD0RIXHKaNa6MVqQyg6AZDy+vaKCWMGIL LYumzYOqi4Xph5VZUghIObK0npzAh6eI83ic7bGWzoCu7jfVO0ryFnAhknuVD8fULKbh ShdVbPDVIP2/c8uCN0jtX1eJuFSjdy4brrLRIYqKR2NmZJgboK3GsRcS+FY/z+YXg0e2 lTBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=eM2Bf2WoC1yvqXGfr4khi6TDVXFpyxPzOUHleHrubpg=; fh=xLz1neRnmYlgMJfetvoLg2+7Nklbjjl1yJequJ3GsTc=; b=aTrKSOcX6rlrB8UJkYgxBBxCyqi+2PGuLv3pj+vr4z9KJUWxM8BmhQNesbYnxqEUUB N68oou3BZx8ILERiZz7F0GrE6GmtZYD7/W/bfPNKwTRzWjtlYlJjy+x2YQuv9rSyacee qPUSK1z5/5s8lfbOYCZUbCwYgBBoINuc565w3GLOdOQ+6PsqwGJUsBJ78aV8katK/t+j S/oq+IEN7/lI9QEzpoS6OrHeE6biiF0A+9UoNyP6/tPZrgQu3p/q7QMUb5rBGMeVqUcL nhDF2w1P1gYN0ROww2mVUzAcOz5LODkfssHVkjKtaWTeyt+4c0WmFWTTXo8TjGkELEW/ hG7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=W1Hp4fyV; 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=REJECT sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id z27-20020a630a5b000000b005c1b2c911f0si8122084pgk.328.2023.12.04.09.08.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 09:08:36 -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=@arista.com header.s=google header.b=W1Hp4fyV; 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=REJECT sp=REJECT dis=NONE) header.from=arista.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 16D9480A99A8; Mon, 4 Dec 2023 09:08:34 -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 S229588AbjLDRIS (ORCPT + 99 others); Mon, 4 Dec 2023 12:08:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbjLDRIR (ORCPT ); Mon, 4 Dec 2023 12:08:17 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98F1DCD for ; Mon, 4 Dec 2023 09:08:23 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40b595bf5d2so49443305e9.2 for ; Mon, 04 Dec 2023 09:08:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; t=1701709702; x=1702314502; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eM2Bf2WoC1yvqXGfr4khi6TDVXFpyxPzOUHleHrubpg=; b=W1Hp4fyVhOpqZS8p3cF5mIFuDz6mEbLDXeLzHaub3VV6UMDKtTVKyro0BgOH0+NuRe uadbFzvxY5hDvwX13GifbmGiqGSSk9D/vQ6DWpzoNdY3MqUXdkwjYoAQUt8Mh/V1G5TX 3x2aj10HT1RUfMoPYnBrtgh6gfbPG4rV0M+29molgPq5GwezjOm710S8WWvLgfj/eC/8 gxLUenkjAlSn3q1I3thxZ7YoFuS7XVgBXkszOAG4j3dGizbd+fXTHR5cMpaMFDIlWf5X t8FzN0DgtERGHyjrmvmkU1aZSmptLB5pYRT8UZxAFky8hR7Ythf8U/5/BrrQQ7dpIccK BiNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701709702; x=1702314502; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eM2Bf2WoC1yvqXGfr4khi6TDVXFpyxPzOUHleHrubpg=; b=ZENW3NbOsUh7LuGLoi+Fu4U7OTt/OtYrM2ZvW5pgO5pIURsftjsnC5TMC6Xq9lLjuK Kfp9EU1lWzH3IzmFY25VnHMRYUj/2QPVqiQnDAHUjfqIzvpdY3H29eNOTDFUOTQMhrA0 BwScvpQ6LktLnd4bY1deb323cHNXuChlm/22xvsxJ9O5+BLHxitUZ9AQ5hr3oHPL0orj 3g/xsgjxbbMkFlInSHKTLA54O0jd+x/NExrZ4gHc3aacmykjxj3PNjZiyub8ZHRebMqe G+lX3962bz1dXjRHt+6aTwIgJaJ82HQ5Uf/J4wNoqt9zZwuwU/Tiq4s8QP1KHOv6OFbr WlCw== X-Gm-Message-State: AOJu0Yw7JZ1PAUODGK61YXGobG241LQLQUG6c4/X16yuQk6uyNZayeag AEYQx+BpCalfs8v9sH+95BPynA== X-Received: by 2002:a05:600c:5247:b0:40b:5e59:99a8 with SMTP id fc7-20020a05600c524700b0040b5e5999a8mr1862808wmb.200.1701709701454; Mon, 04 Dec 2023 09:08:21 -0800 (PST) Received: from [10.83.37.178] ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id p6-20020a05600c468600b0040c0902dc22sm6127004wmo.31.2023.12.04.09.08.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Dec 2023 09:08:20 -0800 (PST) Message-ID: <45d63402-bd0f-4593-8e57-042c0753f3e3@arista.com> Date: Mon, 4 Dec 2023 17:08:20 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 6/7] net/tcp: Store SNEs + SEQs on ao_info Content-Language: en-US To: Simon Horman 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 References: <20231129165721.337302-1-dima@arista.com> <20231129165721.337302-7-dima@arista.com> <20231202171612.GC50400@kernel.org> From: Dmitry Safonov In-Reply-To: <20231202171612.GC50400@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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]); Mon, 04 Dec 2023 09:08:34 -0800 (PST) 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. > > Flagged by Sparse. > Thanks, Dmitry