Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4772218rdh; Wed, 29 Nov 2023 10:09:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfQdBEIKcQJeOCuvl/jGTa9zKwLM/U9o0W56DjdA45Y0Rt5hJNMFUyyzeFjmkeTv4E38tZ X-Received: by 2002:a05:6808:1790:b0:3a4:8251:5f43 with SMTP id bg16-20020a056808179000b003a482515f43mr26690136oib.40.1701281378755; Wed, 29 Nov 2023 10:09:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701281378; cv=none; d=google.com; s=arc-20160816; b=bogcnPE8Ev92m04LHsFu6TIXA12gXclY+TxoUVo+YN/LZRmjmtGcUpPyDeMJV2ikB1 /ZVkhr86Ja4hMoqvhFvK97Goy5nCDbeVzipuPdNCkHgIhECcTOHjLnhEdcodDdUiR3AD gz/HwEBqv8ntoGu+1UfXlQSPfvhCLdxYK1e0xM9EKEabRdUII6dRkD9mHmPrM2z2Z/f0 El8W7sUg2mtPMpn+wZBNQEdaqLQhHy2GRiMeVIsy4smU7wniuaHLxCzRs9X5AKHgfacW fEBBgVYXPevRk/mf7KaXj1xhbj8gROr0QeJwOPNVk3X6FDs6mE7Qdkksz92af4Uyqp9w lt7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9YPZxso0QzNj3gqcGGnNvHk0pzKPfOYD5SPW1T+A/ws=; fh=X1lxrGLA7V3PBg9NtHG1M9vtBdBLI2mDk4lzNRfgcS0=; b=entaFBdc3LdO+nRiUM9IsyFyyUl4qbym7ptWqe8Aol96gKYSjXUL4xmtI2qRbjgq0F 7d2UJZecPNO7hC9sBCfFOUeLBUBQRJP2rbDoOCRqbZrobn60suv0Y3pZnOvjb65OwPxa d87NMOdLozJR46IS7Q/ke4vPcXf+I0XmBDqecZMk7fFQ3grCuLfQeqvu7Q42hNyz1x8g 2TWlzti3pIZZuY9UQLaKol4/Dw3DyX7lVnDu3BJ3gKCbIP2J41uQ4qNuLH5d77vQ/IBa EJPhUI0smJGXvfqw/sumWQCrls8wIOFxPFxrE+c7HsByoZoeIl6py5hPS+S+blzB5Niq /INg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=04b8Q81K; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id t36-20020a05680815a400b003b844821cf8si5896234oiw.55.2023.11.29.10.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 10:09:38 -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=@google.com header.s=20230601 header.b=04b8Q81K; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4C9C180569B7; Wed, 29 Nov 2023 10:09:35 -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 S231187AbjK2SJX (ORCPT + 99 others); Wed, 29 Nov 2023 13:09:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjK2SJV (ORCPT ); Wed, 29 Nov 2023 13:09:21 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B2C6AF for ; Wed, 29 Nov 2023 10:09:28 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-548c6efc020so733a12.0 for ; Wed, 29 Nov 2023 10:09:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701281366; x=1701886166; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9YPZxso0QzNj3gqcGGnNvHk0pzKPfOYD5SPW1T+A/ws=; b=04b8Q81KSvsKQJIr2Te+mfZoEcAHDHyHsjycrRAolZzPGhXM25XYFF1Uqs9MjADf/t dyZ4Xdv4ryaQE6/ar2C5pnG96McgeQwyODgjbzxOTmpkHf+V4EZNM4OhQL9HBnqVmJ69 hGeAjtpmrCHm24SZU1qmm4euTEsMkYN3qEs0rGVJ81wrkS0Nlso5vFmFNa0SBoiUKs8Y IQxib3K+ZZ6e5BSzkL7C3jFOfL57KyB/oODB/pkcGoPXejC1h2mzuwtFGlH5fEKJd7Px 0R6xmQcNWqTyIjK8gsbZumazpyZwpG9NV2Yckrq3mHN253isf7XN1yPZpM5xWRb0Vlv2 NYbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701281366; x=1701886166; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9YPZxso0QzNj3gqcGGnNvHk0pzKPfOYD5SPW1T+A/ws=; b=kuwBXJ9hBEy5qdwtXOoTs472L4t16QdjlZIFX2LB83ihrgmY3ge8Sg3cqgRW3w7eqU 9CALYZz2oDlbGOWidMwXj66wcAoC6X5MHXSgiTOj7+Cpn9k6lJkvn4XOD3h8NPyr7PXb xCbOXmecgR20+WTkR0GdPpGtre8vLxU5ndzDn6bgIGFV6WV8aSIQpmuY0Cxbln0Jj3Ed vrdoka30SCv56lgBM6HVdCgn26QTmR0cpK4aGuErrPFK+oRjTorH9C09g2OKBv3k3TyY KgTd9ygDr1UoyhEhnqRTOE1prxuqWUpY9MCLiqMfEwJ9PkgqybIBEQGi6ycIUnntSSVo 3Zsw== X-Gm-Message-State: AOJu0YwzSnMr1sR0JcWCfj2nOVsd86rWOzyPxOfUUKaTEtTR3jAoTZov ftIdYNkgg8f4IDTtDLJ98gYev4IJqYP5KO+NGshrEw== X-Received: by 2002:a05:6402:430e:b0:54b:67da:b2f with SMTP id m14-20020a056402430e00b0054b67da0b2fmr635103edc.7.1701281366310; Wed, 29 Nov 2023 10:09:26 -0800 (PST) MIME-Version: 1.0 References: <20231129165721.337302-1-dima@arista.com> <20231129165721.337302-7-dima@arista.com> In-Reply-To: <20231129165721.337302-7-dima@arista.com> From: Eric Dumazet Date: Wed, 29 Nov 2023 19:09:15 +0100 Message-ID: Subject: Re: [PATCH v4 6/7] net/tcp: Store SNEs + SEQs on ao_info To: Dmitry Safonov 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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]); Wed, 29 Nov 2023 10:09:35 -0800 (PST) On Wed, Nov 29, 2023 at 5:57=E2=80=AFPM Dmitry Safonov wr= ote: > > 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 ? 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)