Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp408569lqg; Fri, 1 Mar 2024 08:42:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVkvyu7Qu/dJTsHPKxXgfAHtFuiDSaBO6f4SxjIfpfMQELGAsmXsomesMSQQaMlWKVeD3UilKqjkSXAmAtQjZTylaGiBCMhnc0/3xrUvQ== X-Google-Smtp-Source: AGHT+IFaVnv9x2KGI1tyAbiZ8LOJsleyObiN9222tP1zfOJy6jIGwMrbtJ9WPJ22pQAO1eJj5QgW X-Received: by 2002:ad4:40c6:0:b0:690:4d7:f93b with SMTP id x6-20020ad440c6000000b0069004d7f93bmr2166457qvp.31.1709311357712; Fri, 01 Mar 2024 08:42:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709311357; cv=pass; d=google.com; s=arc-20160816; b=J70VZpVQjSKKQCFqBwRGECI+v4SyqXZLNjJUh+9JGV1w31Phckq4FeynMTCseRaWW8 qs2NIIKfGw1SUdZXgXM3LB3EpX5KIiWltxkUt+Ejvf0I3/nifqves5MReXsTHEap7I2a nOS2VwZ5q0B6oq5i1YfHjSS6yqMdTrQg2mjzkB9jVk42pgYrAiScURDSF/svi65ienb9 SZ+JlpYXuGZ5hT6YF4vGjcpdPSCZKaCxdS2sgxCs/ZTWTy93+1RJaQESmwlc0Rg3PZkd v5W7NlEYMkMp6fzi/dXL9aM7dvIZ5DuuwDI6xcrcrfFQiedHI+plZFPqEV7U3HnfdTaU pvPg== 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=0j3g3jFYPBuEOmQrpIsH83jKP4pkLZUnpgeZVLL69Gc=; fh=icnuzcdbhXgwjK0pgvJXK7xplE+Och0jvyZv2PxZJ18=; b=Sf7rY5HBqFlAUoFI+md+MIFdZtJxhvQme19sPzXJGUmnJfAqGo933rb62ckm/9zq4N ZEM2o1H6Co+V0lk8re7MreBgNPLdGqVPXNsPh80noNxr76Sgn7anuenyOA79n0HnrpOk NN9STKkCmvVShIFSGdsbWzwlROliJhLzDXYVGIpWXTeA23tLGPxmpCtUCWjDhPPQhq9s G5KQgCPZjIpc8qKdUVNmaRDkZwNZVyaw5UWNeX4O8S5/1Hnu+m3nmcpkJl45d3CMemrX 6HJjkJ5y+z6TLvf/+d8f9/tiCy7KqztF1CuL5NIIeQfj8q2i1hmA9CuUmUOcrf0hNcPI 1Ruw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UEiVJl6u; 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-88727-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88727-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k2-20020ad45be2000000b0068cb91fb68csi3919526qvc.185.2024.03.01.08.42.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 08:42:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88727-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UEiVJl6u; 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-88727-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88727-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4918E1C21F26 for ; Fri, 1 Mar 2024 16:42:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95E333B790; Fri, 1 Mar 2024 16:38:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UEiVJl6u" 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 D100A3A8E1 for ; Fri, 1 Mar 2024 16:38:40 +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=1709311122; cv=none; b=EnBM3zt7mQSI2RUkH/eRWUSpwHBMjdNBIo9AjUhkWv90uHh4V8x0UOsh9WtzftYuaGGCDFQwQSBioYXbUmZx8uTjh/5imOl9Ez5NukZ0jLpjWXrCwDcmdsWlHU8Yj9JRtIWZTKLkI4rAgwF05omNtGw4oI1ILoXiF2GXkOyOvyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709311122; c=relaxed/simple; bh=HPT1/Otm7HC3lWXqMPZL6qX9ql3qTr8GnyMTVbuei7c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BgpGlkNLPygNr6kjVqAEUcsKjEKYGSa/QT2kwHaKOfmORREs4K4ss4LThmhZ69J0IMDIOrgzBcTLnZ3Dnn4rJNVtEcPrCbEq/9SFICb+inEzKoG/xD43mpI2SYhuRLqI+89Ys6EyxVZ+/oKFV+LwYgVsy3PIbgdWHHXdaaTHbgk= 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=UEiVJl6u; 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=1709311119; 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=0j3g3jFYPBuEOmQrpIsH83jKP4pkLZUnpgeZVLL69Gc=; b=UEiVJl6uuzOFUVs9ybJ6bjpjs9XbAVGRrBs+BXLWguAAQ8cF+5f53doAORvZe3PS1q0ic8 ia9vrZyR8525WTraDqAP8OUIeiAQK9xagA8SxbyB6Bpk0HIBBF1lBgURcQ5PllK31jMRDs mpWP+LCNK6pOTxduH47gGEYeDwWIwl0= 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-264-nZ5-b0IDPcKCKBI-Mevu1A-1; Fri, 01 Mar 2024 11:38:34 -0500 X-MC-Unique: nZ5-b0IDPcKCKBI-Mevu1A-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 594E828B7409; Fri, 1 Mar 2024 16:38:33 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 358D620169D6; Fri, 1 Mar 2024 16:38:32 +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-next 12/21] rxrpc: Move rxrpc_send_ACK() to output.c with rxrpc_send_ack_packet() Date: Fri, 1 Mar 2024 16:37:44 +0000 Message-ID: <20240301163807.385573-13-dhowells@redhat.com> In-Reply-To: <20240301163807.385573-1-dhowells@redhat.com> References: <20240301163807.385573-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 Move rxrpc_send_ACK() to output.c to so that it is with rxrpc_send_ack_packet() prior to merging the two. 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 --- net/rxrpc/ar-internal.h | 4 ++-- net/rxrpc/call_event.c | 37 ------------------------------------- net/rxrpc/output.c | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index 54550ab62adc..a8795ef0d669 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h @@ -873,7 +873,6 @@ int rxrpc_user_charge_accept(struct rxrpc_sock *, unsigned long); */ void rxrpc_propose_ping(struct rxrpc_call *call, u32 serial, enum rxrpc_propose_ack_trace why); -void rxrpc_send_ACK(struct rxrpc_call *, u8, rxrpc_serial_t, enum rxrpc_propose_ack_trace); void rxrpc_propose_delay_ACK(struct rxrpc_call *, rxrpc_serial_t, enum rxrpc_propose_ack_trace); void rxrpc_shrink_call_tx_buffer(struct rxrpc_call *); @@ -1164,7 +1163,8 @@ static inline struct rxrpc_net *rxrpc_net(struct net *net) /* * output.c */ -int rxrpc_send_ack_packet(struct rxrpc_call *call, struct rxrpc_txbuf *txb); +void rxrpc_send_ACK(struct rxrpc_call *call, u8 ack_reason, + rxrpc_serial_t serial, enum rxrpc_propose_ack_trace why); int rxrpc_send_abort_packet(struct rxrpc_call *); void rxrpc_send_conn_abort(struct rxrpc_connection *conn); void rxrpc_reject_packet(struct rxrpc_local *local, struct sk_buff *skb); diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c index 1184518dcdb8..e19ea54dce54 100644 --- a/net/rxrpc/call_event.c +++ b/net/rxrpc/call_event.c @@ -61,43 +61,6 @@ void rxrpc_propose_delay_ACK(struct rxrpc_call *call, rxrpc_serial_t serial, trace_rxrpc_propose_ack(call, why, RXRPC_ACK_DELAY, serial); } -/* - * Queue an ACK for immediate transmission. - */ -void rxrpc_send_ACK(struct rxrpc_call *call, u8 ack_reason, - rxrpc_serial_t serial, enum rxrpc_propose_ack_trace why) -{ - struct rxrpc_txbuf *txb; - - if (test_bit(RXRPC_CALL_DISCONNECTED, &call->flags)) - return; - - rxrpc_inc_stat(call->rxnet, stat_tx_acks[ack_reason]); - - txb = rxrpc_alloc_txbuf(call, RXRPC_PACKET_TYPE_ACK, - rcu_read_lock_held() ? GFP_ATOMIC | __GFP_NOWARN : GFP_NOFS); - if (!txb) { - kleave(" = -ENOMEM"); - return; - } - - txb->ack_why = why; - txb->wire.seq = 0; - txb->wire.type = RXRPC_PACKET_TYPE_ACK; - txb->flags |= RXRPC_SLOW_START_OK; - txb->ack.bufferSpace = 0; - txb->ack.maxSkew = 0; - txb->ack.firstPacket = 0; - txb->ack.previousPacket = 0; - txb->ack.serial = htonl(serial); - txb->ack.reason = ack_reason; - txb->ack.nAcks = 0; - - trace_rxrpc_send_ack(call, why, ack_reason, serial); - rxrpc_send_ack_packet(call, txb); - rxrpc_put_txbuf(txb, rxrpc_txbuf_put_ack_tx); -} - /* * Handle congestion being detected by the retransmit timeout. */ diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index 25b8fc9aef97..ec9ae9c6c492 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -185,7 +185,7 @@ static void rxrpc_cancel_rtt_probe(struct rxrpc_call *call, /* * Transmit an ACK packet. */ -int rxrpc_send_ack_packet(struct rxrpc_call *call, struct rxrpc_txbuf *txb) +static int rxrpc_send_ack_packet(struct rxrpc_call *call, struct rxrpc_txbuf *txb) { struct rxrpc_connection *conn; struct msghdr msg; @@ -248,6 +248,43 @@ int rxrpc_send_ack_packet(struct rxrpc_call *call, struct rxrpc_txbuf *txb) return ret; } +/* + * Queue an ACK for immediate transmission. + */ +void rxrpc_send_ACK(struct rxrpc_call *call, u8 ack_reason, + rxrpc_serial_t serial, enum rxrpc_propose_ack_trace why) +{ + struct rxrpc_txbuf *txb; + + if (test_bit(RXRPC_CALL_DISCONNECTED, &call->flags)) + return; + + rxrpc_inc_stat(call->rxnet, stat_tx_acks[ack_reason]); + + txb = rxrpc_alloc_txbuf(call, RXRPC_PACKET_TYPE_ACK, + rcu_read_lock_held() ? GFP_ATOMIC | __GFP_NOWARN : GFP_NOFS); + if (!txb) { + kleave(" = -ENOMEM"); + return; + } + + txb->ack_why = why; + txb->wire.seq = 0; + txb->wire.type = RXRPC_PACKET_TYPE_ACK; + txb->flags |= RXRPC_SLOW_START_OK; + txb->ack.bufferSpace = 0; + txb->ack.maxSkew = 0; + txb->ack.firstPacket = 0; + txb->ack.previousPacket = 0; + txb->ack.serial = htonl(serial); + txb->ack.reason = ack_reason; + txb->ack.nAcks = 0; + + trace_rxrpc_send_ack(call, why, ack_reason, serial); + rxrpc_send_ack_packet(call, txb); + rxrpc_put_txbuf(txb, rxrpc_txbuf_put_ack_tx); +} + /* * Send an ABORT call packet. */