Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3266097rdb; Thu, 16 Nov 2023 05:14:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1Dfw0Tp3NO/vevOK/j05qrYS7WIHYtTvXLIeEbOFUYNX1pGlFzo8206FxImJ43jzK4RGH X-Received: by 2002:a17:90b:4a49:b0:27d:6404:bffc with SMTP id lb9-20020a17090b4a4900b0027d6404bffcmr17011454pjb.1.1700140453210; Thu, 16 Nov 2023 05:14:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700140453; cv=none; d=google.com; s=arc-20160816; b=cCMbuQcCJOJevzicQihh295kYb6LihGa8NfXkAdRYEc4btF5K7m6GKosWEMsHZdhTj 0yQ0wU9QuQj6vvscxwL3gd4Kp1VE4Q1UOhbWMuVDYxL/vwoKVv+UFXnDOCh3s9OvU+qc R+zIpuntlXNJOV5mA5guCVFAxBE2DjK6ek7LjIo81gPE1G57ZyYWVb8Wer3bJK7vlhxo OaXtS4G85CiliYG/LgrldqxEDNj6aBz+yUVdgeVUkXU8uP+AAO11jUsjz26td5fAe28M wVdd6ccNy9MSjdWSiFnDLOkRLpgxAUfRy5rBPJsGLKH578dNVJ0syljXvgvNp499gIy2 Mphw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=amx7SkdxhyQZBIZGSORR2hEtLgqQ9WgEbAgze3egzOA=; fh=icnuzcdbhXgwjK0pgvJXK7xplE+Och0jvyZv2PxZJ18=; b=hEBY6lc0xCJWUx8ZudwG2EAq/GUWHeH1alajhwMeYP03C7XZJl/jPUUFuH274bOKXL QBbXjSTDZ1Aq7Y0eqtirhAnoeVDiqxpQM4DbIdVq0R5B1bXtwl0x47cGIt2GSChhITRH a5eyFTRlvi+Iuu8pRMd3N56eSQqisA2Zu3ehBlkYV060RrgoZApcp4Kx3c1fbwXd6EQm lj2oDmuwXEpV20kXWUu47FqDHPqN9MhTHWXJLFlzctazgKu+MRH8ArgvdYdu2hBb3EIz PhpYKKfNc9pAh6EnT+N3NzGMgUCqZpcUFz8UZmuVBi2XxbyuxtvydkGAtoE2Cqgf3oxd 3I6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="aN4//HQ2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id e3-20020a17090301c300b001b9c3498526si13051893plh.433.2023.11.16.05.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 05:14:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="aN4//HQ2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id F3E6A81C0995; Thu, 16 Nov 2023 05:14:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345149AbjKPNNO (ORCPT + 99 others); Thu, 16 Nov 2023 08:13:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345003AbjKPNNM (ORCPT ); Thu, 16 Nov 2023 08:13:12 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 927C71AD for ; Thu, 16 Nov 2023 05:13:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700140387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=amx7SkdxhyQZBIZGSORR2hEtLgqQ9WgEbAgze3egzOA=; b=aN4//HQ20gc1T0/0nGjCxvk0gGgNnnhPTzvh/PoLrYgcapj4rFJDuqZxoV6sr/zPsuJBSM 0S2g+lyqw0TZgLQq3STANA8VAEc3ASq3Z53ZtJgFh7EsOWWTDbSxR8mOyWckjDtQBJ1EkJ LcSVmzRAaiR88vRhxGNJv1N/VP4Ns94= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-ujvchDHtOmae_nRX8S1YUw-1; Thu, 16 Nov 2023 08:13:05 -0500 X-MC-Unique: ujvchDHtOmae_nRX8S1YUw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6704D811E7D; Thu, 16 Nov 2023 13:13:05 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C5431121306; Thu, 16 Nov 2023 13:13:04 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org Cc: David Howells , Marc Dionne , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net 1/2] rxrpc: Fix RTT determination to use any ACK as a source Date: Thu, 16 Nov 2023 13:12:58 +0000 Message-ID: <20231116131259.103513-2-dhowells@redhat.com> In-Reply-To: <20231116131259.103513-1-dhowells@redhat.com> References: <20231116131259.103513-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-1.0 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 fry.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 (fry.vger.email [0.0.0.0]); Thu, 16 Nov 2023 05:14:10 -0800 (PST) Fix RTT determination to be able to use any type of ACK as the response from which RTT can be calculated provided its ack.serial is non-zero and matches the serial number of an outgoing DATA or ACK packet. This shouldn't be limited to REQUESTED-type ACKs as these can have other types substituted for them for things like duplicate or out-of-order packets. Fixes: 4700c4d80b7b ("rxrpc: Fix loss of RTT samples due to interposed ACK") Signed-off-by: David Howells cc: Marc Dionne cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org --- include/trace/events/rxrpc.h | 2 +- net/rxrpc/input.c | 35 ++++++++++++++++------------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h index 4c53a5ef6257..f7e537f64db4 100644 --- a/include/trace/events/rxrpc.h +++ b/include/trace/events/rxrpc.h @@ -328,7 +328,7 @@ E_(rxrpc_rtt_tx_ping, "PING") #define rxrpc_rtt_rx_traces \ - EM(rxrpc_rtt_rx_cancel, "CNCL") \ + EM(rxrpc_rtt_rx_other_ack, "OACK") \ EM(rxrpc_rtt_rx_obsolete, "OBSL") \ EM(rxrpc_rtt_rx_lost, "LOST") \ EM(rxrpc_rtt_rx_ping_response, "PONG") \ diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c index 030d64f282f3..3f9594d12519 100644 --- a/net/rxrpc/input.c +++ b/net/rxrpc/input.c @@ -643,12 +643,8 @@ static void rxrpc_complete_rtt_probe(struct rxrpc_call *call, clear_bit(i + RXRPC_CALL_RTT_PEND_SHIFT, &call->rtt_avail); smp_mb(); /* Read data before setting avail bit */ set_bit(i, &call->rtt_avail); - if (type != rxrpc_rtt_rx_cancel) - rxrpc_peer_add_rtt(call, type, i, acked_serial, ack_serial, - sent_at, resp_time); - else - trace_rxrpc_rtt_rx(call, rxrpc_rtt_rx_cancel, i, - orig_serial, acked_serial, 0, 0); + rxrpc_peer_add_rtt(call, type, i, acked_serial, ack_serial, + sent_at, resp_time); matched = true; } @@ -801,20 +797,21 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb) summary.ack_reason, nr_acks); rxrpc_inc_stat(call->rxnet, stat_rx_acks[ack.reason]); - switch (ack.reason) { - case RXRPC_ACK_PING_RESPONSE: - rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, - rxrpc_rtt_rx_ping_response); - break; - case RXRPC_ACK_REQUESTED: - rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, - rxrpc_rtt_rx_requested_ack); - break; - default: - if (acked_serial != 0) + if (acked_serial != 0) { + switch (ack.reason) { + case RXRPC_ACK_PING_RESPONSE: rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, - rxrpc_rtt_rx_cancel); - break; + rxrpc_rtt_rx_ping_response); + break; + case RXRPC_ACK_REQUESTED: + rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, + rxrpc_rtt_rx_requested_ack); + break; + default: + rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial, + rxrpc_rtt_rx_other_ack); + break; + } } if (ack.reason == RXRPC_ACK_PING) {