rxrpc: Need to start the resend timer on initial transmission
authorDavid Howells <dhowells@redhat.com>
Fri, 23 Sep 2016 11:39:23 +0000 (12:39 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 23 Sep 2016 13:05:12 +0000 (14:05 +0100)
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>
net/rxrpc/ar-internal.h
net/rxrpc/call_event.c
net/rxrpc/sendmsg.c

index 808ab750dc6b3d913eca629ef59dfa0dbf5194b0..9e3ba4dc9578284963c7e333e6a1e2f696f2cb10 100644 (file)
@@ -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 *);
 
index a2909da5d581fbf9967be5142a41cb86c0a76fbf..3a7f90a2659c89fcf0d98b33ee97da0e02e1b409 100644 (file)
@@ -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;
 
index ca3811bfbd177bc1dd6bedadfcf8610fe249b4a7..7cb34b2dfba9df6c5d2809d1fcc72fdc704a1884 100644 (file)
@@ -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);