Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4775432rdh; Wed, 29 Nov 2023 10:14:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQVfydhnfthgCyRBkUyARp2XiyChV/fSxmDrD6JGSsYJBkpVQ6A4GahtzVsIYAPrPHGcYr X-Received: by 2002:a17:90a:c68a:b0:285:c04e:d69b with SMTP id n10-20020a17090ac68a00b00285c04ed69bmr11659343pjt.25.1701281673068; Wed, 29 Nov 2023 10:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701281673; cv=none; d=google.com; s=arc-20160816; b=nqvPGuYMCPUjC3eh859ryvMSL4VyE8irw3isrKF+K/9XJlB6Vl7GzS/5PLDsesfmmQ TjfWnD3VtOADwfeF8wC5QJWJUGLdNkX2fG4FCuzSolXyAf9kOX5Ixj67WmNeH0Hgj+NJ u4vnqoQKTp+CrIHnVYbaVAxLDVMvYhAjcJn/gbORNp7qnvotuCWbtut9M2/2QAJeeE7G /dkwPddz8l/n0wZzeyCc2iGGLKuN3y5RAkOrn8x1VYPXKy/+Jbra6eI52knMr1UyxadP GU1gachIVwNiDKX7Y+8cHMGUwrtVKTcFGet/eiZuv+VtleByBx0v4f8LMUfuztH6iHGE fRwg== 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=wY9WeKtXlEdT6ZB9TX0PBdHOlwsuJkt60GHvQlNmDZk=; fh=Qn3RmwYI3aXYf717wpS9yyAY1XUEV59UzlCwvai9e84=; b=oy8ywqCPvqxFh0nmljORYKbiSxW40e4YZ8AuC17OtrBfzlNrw4ty9P1YLQbvXajsyg pxO6eseaouML/v2t09RMrOlv1xVpHa5OSrWhccsQwAldns87pbU8u9GyqfkDYouM9//7 IPmsYeP9Ie5XDVRMsp4/ECSyv6CHlDxWGKv/hD4DQMi/OcI7jVtCY1/JMarxv3yNSHg6 C6qnaTfBQGrxosVH1ywyIlBoT6YreEzcv3yjqzSNTmqv4cip0vpyExi3kdfavqu2ZNLN rLoF6nZIXogtFNgfsvyfn3WN0L9V6WEYL6Dj88Dm98hWydVfCKUkdhUre9t/L/2IhVoJ dVjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=eNe2jYbi; 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 b1-20020a17090ae38100b002859a66662csi1768368pjz.13.2023.11.29.10.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 10:14:33 -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=eNe2jYbi; 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 6A7AF80C9A7E; Wed, 29 Nov 2023 10:14:30 -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 S230317AbjK2SOP (ORCPT + 99 others); Wed, 29 Nov 2023 13:14:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjK2SON (ORCPT ); Wed, 29 Nov 2023 13:14:13 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0A4BB9 for ; Wed, 29 Nov 2023 10:14:19 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3331752d2b9so67455f8f.3 for ; Wed, 29 Nov 2023 10:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; t=1701281658; x=1701886458; 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=wY9WeKtXlEdT6ZB9TX0PBdHOlwsuJkt60GHvQlNmDZk=; b=eNe2jYbiHpkwa/ZNkwOKT14qO98/sNJ5OK0f5gcf2tcDDzf6G05TeflGiDnlPn0b/F 0jxSCryWYJh/61ZODteUoF8r6sudle8sNM1yGrTdsJjOjjXDkql/4VHQIXo3boRe6szq LSMOp+vWjXRrseRTWyFWY8Jaes+wBc2bm/EJc4fK10Kb1VYQQe8Y2yP6BLIcvkouJfcj VC+dT8srvnfX+I6dAg3oLRuvC2vjnEOBnCt5OTGXG74Qy2aj93cKs31RpOYW0ap1OlHL KN7Pmo9ak++sDXbQQwhOI13g+tXtu6+FZZMky8pD3e6W1rJGuI1c6bap6T2v5ce6L/M/ vS1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701281658; x=1701886458; 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=wY9WeKtXlEdT6ZB9TX0PBdHOlwsuJkt60GHvQlNmDZk=; b=ATEBJlOt41kfBAMHsX5aqE4BzEQD1p+nXYSBvU8uUqYypvvsZAoIfeel8/ggZtqMvD pCL9KIgiL0f3gubvWeWxjf05O0Ql6qp5ayCdR8axR5gCg/yGBARal2Y9KXKy5L44IhuJ qE9/r3yZ+HJmip0UNrhB0h+AwnglP42QjsuXNZEffX9AiX39cO5Cw6CQwamf75UFScuU x0Bv2xn9lQlj71KuHnrNT8jgdlAQBvwY2OTHCyMuamjQaR5qMUNi4rL0YUS1Gh2RoCgS 1v5XAvoACft7jXra4OGHTVqcvuDA7VuQNeoaJ24l6C7KPZ7ge28ASAb5vJblUPypr0J1 R1+Q== X-Gm-Message-State: AOJu0YzGIr+mwBDwayq15tlXyfiMe06tnoa0hpS0ctfaJpAFAcn13cdK LV/Fn359XZR7ISvxjW5Oax08DQ== X-Received: by 2002:a05:6000:88:b0:331:6b82:a3ad with SMTP id m8-20020a056000008800b003316b82a3admr13548656wrx.60.1701281658390; Wed, 29 Nov 2023 10:14:18 -0800 (PST) Received: from [10.83.37.178] ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id t2-20020a5d4602000000b0032da4c98ab2sm18812649wrq.35.2023.11.29.10.14.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Nov 2023 10:14:17 -0800 (PST) Message-ID: Date: Wed, 29 Nov 2023 18:14:16 +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: Eric Dumazet Cc: David Ahern , Paolo Abeni , Jakub Kicinski , "David S. Miller" , linux-kernel@vger.kernel.org, Dmitry Safonov <0x7f454c46@gmail.com>, Francesco Ruggeri , Salam Noureddine , Simon Horman , netdev@vger.kernel.org References: <20231129165721.337302-1-dima@arista.com> <20231129165721.337302-7-dima@arista.com> From: Dmitry Safonov In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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]); Wed, 29 Nov 2023 10:14:30 -0800 (PST) On 11/29/23 18:09, Eric Dumazet wrote: > On Wed, Nov 29, 2023 at 5:57 PM 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. >> > > This will not work on 32bit kernels ? Yeah, unsure if there's someone who wants to run BGP on 32bit box, so at this moment it's already limited: config TCP_AO bool "TCP: Authentication Option (RFC5925)" select CRYPTO select TCP_SIGPOOL depends on 64BIT && IPV6 != m # seq-number extension needs WRITE_ONCE(u64) Probably, if there will be a person who is interested in this, it can get a spinlock for !CONFIG_64BIT. > Unless ao->snd_sne and ao->rcv_sneare only read/written under the > socket lock (and in this case no READ_ONCE()/WRITE_ONCE() should be > necessary) Thanks, Dmitry