Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1847083lqm; Fri, 3 May 2024 08:09:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQQovNLp9LXbzkG83q/GcjsooQLHm1vlYu+5X9+r+5vVYRhICGQ6fgfqdpFfvEVV6ga0mdJVmomFWlrqPK4SQb/+NB6d9mpHcKABhsgw== X-Google-Smtp-Source: AGHT+IE7N5zV/BImB3gN3yabo/kAWZnnTzGs6qBjmlb6gJeXoY8qYvGPWAAhUflm70tA+OMMORnJ X-Received: by 2002:a50:8710:0:b0:568:9cfe:1974 with SMTP id i16-20020a508710000000b005689cfe1974mr1891866edb.18.1714748968277; Fri, 03 May 2024 08:09:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714748968; cv=pass; d=google.com; s=arc-20160816; b=zK/lRUVUWfOITuoMhoTlh6Rw76jW7Jbf8jbGjlHbJTd7O97KWf7GDAh7kGk+inSSZa U4aZ5DN7i2Nskt7iQxgj/sv6tIEC++Ni7gl6427aQblzGpwB9K6MVxOhO8pdCoSStk36 2gH3UBPlawrdpP88+FSvRjqJ/ME7f9dQYcH5s2ikoKFRop588aaMiItasmdFzBkKCbq1 484YmMT1QVSvB8sIvYOouwX2+0yWso6BMu/ZLNHMogLHb2U2mZnof+RO2Mbu1G9BX7yM sudlT3IXhXdsj1a7pXun7LxZxpplwZhGbzkUsZhAXKUElssp0SCJm2l0q5MtN8YF7eA7 iKQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=q81tRT2uTaTBxg18TEDOYg+MWHfHGT+jbt/JaKsoXVk=; fh=icnuzcdbhXgwjK0pgvJXK7xplE+Och0jvyZv2PxZJ18=; b=GRLjU6sV2HOsdtaiQ9IU1XNG1G+g8i59i2iyM3dvGs+g61sy99w59nrv/FR5VEcE8b 9+1i02TaiaKi+vOEIX6ntBBtigM5eMl+ado6TsZoFBoj00PklMn+HfmFMED+Auo/UZX/ GAF7SVKK4/Ew01HVeCnYbvxBTific5hnYnQakD0f7c/OHlo3J5L+T1LumZy5FAVLtjVr 4MDIahXz1tJY0pF4VYmuvO3FmBCTGONa5tc++OxljKp/OFXgRcbXhVCZmqKQkPwgPq84 rCj3eVCsqk7a7KpWrJDkS/Oe8ZKup4D+3PAkMPzjRdd/78Yg4dbaODhCtWETFiEjZ6F/ n2/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Fw6b2kQJ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-167811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167811-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i6-20020a05640242c600b00572d5e1b4a4si614400edc.320.2024.05.03.08.09.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 08:09:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Fw6b2kQJ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-167811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167811-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 070571F23141 for ; Fri, 3 May 2024 15:09:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B159015664C; Fri, 3 May 2024 15:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Fw6b2kQJ" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 616C115535A for ; Fri, 3 May 2024 15:08:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714748890; cv=none; b=NlznyBx8ZIpdxt1UOyDr1GZ62SCuqc2kOlK0Ak4b4N5y98EyRybK4BDnhoOruKhftpKKdm8py/hejMPLHY9cT0H65Edn44f72SfalKp5GG4fdvvPJpHFhL8H5LXpQgZNLil1cU1OAy4M2ZjMLl4AVN6nPKEbWD6HAlY0anMBlZw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714748890; c=relaxed/simple; bh=DuTNKRrHMhyGQpIg62Kb5bTSXicrmNuhWjlQllGZmro=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o0aocTTcPKzkfuGtyBgSbd1hpjjljQb2Ujmljs1DNAL7fCXR5wZOlslAki6vvn981rF2XRNmOldOVD1gO5YQBpQ3MFKzZvFik57Ve8r/F1HbaFiUAAGo8SOyPbe9Q6uTPJSKEYK+JT9JShIWmGyZyglCP731oPbAzxdC/AxlebA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Fw6b2kQJ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714748888; 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=q81tRT2uTaTBxg18TEDOYg+MWHfHGT+jbt/JaKsoXVk=; b=Fw6b2kQJN0CgBijeNi7s16gsDBq5wvlv6CeO243dUTLvRkaFXEeaYWujroTw9QkOUvkD5B NoSxYUdSMP9Sb6GLxvDJRf9ZWD1/yay+qEX+oLHKfeQqnH/stkWFEacqDibclJsrGnc053 VnWWiu7GQ6S2/9QZwRLJia1wVTVcTFw= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122-0qgMMmr8MaW5Z7uHMQr8Gw-1; Fri, 03 May 2024 11:08:05 -0400 X-MC-Unique: 0qgMMmr8MaW5Z7uHMQr8Gw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 B96EC380009F; Fri, 3 May 2024 15:08:04 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4FB0200A3BB; Fri, 3 May 2024 15:08:03 +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 5/5] rxrpc: Request an ACK on impending Tx stall Date: Fri, 3 May 2024 16:07:43 +0100 Message-ID: <20240503150749.1001323-6-dhowells@redhat.com> In-Reply-To: <20240503150749.1001323-1-dhowells@redhat.com> References: <20240503150749.1001323-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Set the REQUEST-ACK flag on the DATA packet we're about to send if we're about to stall transmission because the app layer isn't keeping up supplying us with data to transmit. Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both") 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 | 1 + net/rxrpc/ar-internal.h | 2 +- net/rxrpc/output.c | 2 ++ net/rxrpc/proc.c | 5 +++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h index 7b6c1db53401..dca9f4759dcb 100644 --- a/include/trace/events/rxrpc.h +++ b/include/trace/events/rxrpc.h @@ -449,6 +449,7 @@ #define rxrpc_req_ack_traces \ EM(rxrpc_reqack_ack_lost, "ACK-LOST ") \ + EM(rxrpc_reqack_app_stall, "APP-STALL ") \ EM(rxrpc_reqack_more_rtt, "MORE-RTT ") \ EM(rxrpc_reqack_no_srv_last, "NO-SRVLAST") \ EM(rxrpc_reqack_old_rtt, "OLD-RTT ") \ diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index c11a6043c8f2..08de24658f4f 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h @@ -110,7 +110,7 @@ struct rxrpc_net { atomic_t stat_tx_acks[256]; atomic_t stat_rx_acks[256]; - atomic_t stat_why_req_ack[7]; + atomic_t stat_why_req_ack[8]; atomic_t stat_io_loop; }; diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index 4ebd0bd40a02..32626ff377e1 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -372,6 +372,8 @@ static void rxrpc_prepare_data_subpacket(struct rxrpc_call *call, struct rxrpc_t why = rxrpc_reqack_more_rtt; else if (ktime_before(ktime_add_ms(call->peer->rtt_last_req, 1000), ktime_get_real())) why = rxrpc_reqack_old_rtt; + else if (!more && !last) + why = rxrpc_reqack_app_stall; else goto dont_set_request_ack; diff --git a/net/rxrpc/proc.c b/net/rxrpc/proc.c index 3b7e34dd4385..1bab7f5a7d0f 100644 --- a/net/rxrpc/proc.c +++ b/net/rxrpc/proc.c @@ -519,10 +519,11 @@ int rxrpc_stats_show(struct seq_file *seq, void *v) atomic_read(&rxnet->stat_rx_acks[RXRPC_ACK_DELAY]), atomic_read(&rxnet->stat_rx_acks[RXRPC_ACK_IDLE])); seq_printf(seq, - "Why-Req-A: acklost=%u mrtt=%u ortt=%u\n", + "Why-Req-A: acklost=%u mrtt=%u ortt=%u stall=%u\n", atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_ack_lost]), atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_more_rtt]), - atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_old_rtt])); + atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_old_rtt]), + atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_app_stall])); seq_printf(seq, "Why-Req-A: nolast=%u retx=%u slows=%u smtxw=%u\n", atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_no_srv_last]),