rxrpc: Add re-sent Tx annotation

Add a Tx-phase annotation for packet buffers to indicate that a buffer has
already been retransmitted.  This will be used by future congestion
management.  Re-retransmissions of a packet don't affect the congestion
window managment in the same way as initial retransmissions.

Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
David Howells
2016-09-22 00:29:32 +01:00
parent 5a924b8951
commit f07373ead4
3 changed files with 32 additions and 12 deletions

View File

@@ -388,17 +388,25 @@ static void rxrpc_input_soft_acks(struct rxrpc_call *call, u8 *acks,
{
bool resend = false;
int ix;
u8 annotation, anno_type;
for (; nr_acks > 0; nr_acks--, seq++) {
ix = seq & RXRPC_RXTX_BUFF_MASK;
annotation = call->rxtx_annotations[ix];
anno_type = annotation & RXRPC_TX_ANNO_MASK;
annotation &= ~RXRPC_TX_ANNO_MASK;
switch (*acks++) {
case RXRPC_ACK_TYPE_ACK:
call->rxtx_annotations[ix] = RXRPC_TX_ANNO_ACK;
if (anno_type == RXRPC_TX_ANNO_ACK)
continue;
call->rxtx_annotations[ix] =
RXRPC_TX_ANNO_ACK | annotation;
break;
case RXRPC_ACK_TYPE_NACK:
if (call->rxtx_annotations[ix] == RXRPC_TX_ANNO_NAK)
if (anno_type == RXRPC_TX_ANNO_NAK)
continue;
call->rxtx_annotations[ix] = RXRPC_TX_ANNO_NAK;
call->rxtx_annotations[ix] =
RXRPC_TX_ANNO_NAK | annotation;
resend = true;
break;
default: