rxrpc: Track highest acked serial
authorDavid Howells <dhowells@redhat.com>
Thu, 28 Apr 2022 07:30:47 +0000 (08:30 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 8 Nov 2022 16:42:15 +0000 (16:42 +0000)
Keep track of the highest DATA serial number that has been acked by the
peer for future purposes.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org

net/rxrpc/ar-internal.h
net/rxrpc/input.c

index 1ad0ec5afb50ce5817b3e79757240762b7034573..6c93a2fa96283fcd16fcefa2da7239263eb80e46 100644 (file)
@@ -690,6 +690,7 @@ struct rxrpc_call {
        rxrpc_seq_t             acks_lowest_nak; /* Lowest NACK in the buffer (or ==tx_hard_ack) */
        rxrpc_seq_t             acks_lost_top;  /* tx_top at the time lost-ack ping sent */
        rxrpc_serial_t          acks_lost_ping; /* Serial number of probe ACK */
+       rxrpc_serial_t          acks_highest_serial; /* Highest serial number ACK'd */
 };
 
 /*
index 721d847ba92bb26ad9d5380e3b739457a4234d67..4ba678f0c384d147d7b5f378bb776dd9bc3cb0d8 100644 (file)
@@ -967,6 +967,10 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
        call->acks_first_seq = first_soft_ack;
        call->acks_prev_seq = prev_pkt;
 
+       if (buf.ack.reason != RXRPC_ACK_PING &&
+           after(acked_serial, call->acks_highest_serial))
+               call->acks_highest_serial = acked_serial;
+
        /* Parse rwind and mtu sizes if provided. */
        if (buf.info.rxMTU)
                rxrpc_input_ackinfo(call, skb, &buf.info);