Skip to content

Commit

Permalink
rxrpc: Need to start the resend timer on initial transmission
Browse files Browse the repository at this point in the history
When a DATA packet has its initial transmission, we may need to start or
adjust the resend timer.  Without this we end up relying on being sent a
NACK to initiate the resend.

Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
David Howells committed Sep 23, 2016
1 parent 98dafac commit dfc3da4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions net/rxrpc/ar-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ int rxrpc_reject_call(struct rxrpc_sock *);
/*
* call_event.c
*/
void rxrpc_set_timer(struct rxrpc_call *);
void rxrpc_propose_ACK(struct rxrpc_call *, u8, u16, u32, bool, bool);
void rxrpc_process_call(struct work_struct *);

Expand Down
2 changes: 1 addition & 1 deletion net/rxrpc/call_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/*
* Set the timer
*/
static void rxrpc_set_timer(struct rxrpc_call *call)
void rxrpc_set_timer(struct rxrpc_call *call)
{
unsigned long t, now = jiffies;

Expand Down
9 changes: 9 additions & 0 deletions net/rxrpc/sendmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ static void rxrpc_queue_packet(struct rxrpc_call *call, struct sk_buff *skb,
if (ret < 0) {
_debug("need instant resend %d", ret);
rxrpc_instant_resend(call, ix);
} else {
unsigned long resend_at;

resend_at = jiffies + msecs_to_jiffies(rxrpc_resend_timeout);

if (time_before(resend_at, call->resend_at)) {
call->resend_at = resend_at;
rxrpc_set_timer(call);
}
}

rxrpc_free_skb(skb, rxrpc_skb_tx_freed);
Expand Down

0 comments on commit dfc3da4

Please sign in to comment.