diff options
author | David Howells <dhowells@redhat.com> | 2020-01-31 00:48:14 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2022-11-08 19:42:28 +0300 |
commit | 530403d9ba1c3f51c721a394f642e56309072295 (patch) | |
tree | de02317503723bcf58f6a730890b7a5b0689f4be /net/rxrpc/output.c | |
parent | 72f0c6fb057971864fe4d42b289b8e6ede836ef1 (diff) | |
download | linux-530403d9ba1c3f51c721a394f642e56309072295.tar.xz |
rxrpc: Clean up ACK handling
Clean up the rxrpc_propose_ACK() function. If deferred PING ACK proposal
is split out, it's only really needed for deferred DELAY ACKs. All other
ACKs, bar terminal IDLE ACK are sent immediately. The deferred IDLE ACK
submission can be handled by conversion of a DELAY ACK into an IDLE ACK if
there's nothing to be SACK'd.
Also, because there's a delay between an ACK being generated and being
transmitted, it's possible that other ACKs of the same type will be
generated during that interval. Apart from the ACK time and the serial
number responded to, most of the ACK body, including window and SACK
parameters, are not filled out till the point of transmission - so we can
avoid generating a new ACK if there's one pending that will cover the SACK
data we need to convey.
Therefore, don't propose a new DELAY or IDLE ACK for a call if there's one
already pending.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Diffstat (limited to 'net/rxrpc/output.c')
-rw-r--r-- | net/rxrpc/output.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index 1edbc678e8be..d35657b659ad 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -115,6 +115,8 @@ static size_t rxrpc_fill_out_ack(struct rxrpc_connection *conn, *ackp++ = RXRPC_ACK_TYPE_NACK; seq++; } while (before_eq(seq, top)); + } else if (txb->ack.reason == RXRPC_ACK_DELAY) { + txb->ack.reason = RXRPC_ACK_IDLE; } mtu = conn->params.peer->if_mtu; @@ -204,6 +206,11 @@ static int rxrpc_send_ack_packet(struct rxrpc_local *local, struct rxrpc_txbuf * if (txb->ack.reason == RXRPC_ACK_PING) txb->wire.flags |= RXRPC_REQUEST_ACK; + if (txb->ack.reason == RXRPC_ACK_DELAY) + clear_bit(RXRPC_CALL_DELAY_ACK_PENDING, &call->flags); + if (txb->ack.reason == RXRPC_ACK_IDLE) + clear_bit(RXRPC_CALL_IDLE_ACK_PENDING, &call->flags); + spin_lock_bh(&call->lock); n = rxrpc_fill_out_ack(conn, call, txb, &hard_ack, &top); spin_unlock_bh(&call->lock); |