]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sctp: reuse sent_count to avoid retransmitted chunks for RTT measurements
authorXin Long <lucien.xin@gmail.com>
Sat, 8 Oct 2016 03:36:05 +0000 (11:36 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Oct 2016 13:44:13 +0000 (09:44 -0400)
Now sctp uses chunk->resent to record if a chunk is retransmitted, for
RTT measurements with retransmitted DATA chunks. chunk->sent_count was
introduced to record how many times one chunk has been sent for prsctp
RTX policy before. We actually can know if one chunk is retransmitted
by checking chunk->sent_count is greater than 1.

This patch is to remove resent from sctp_chunk and reuse sent_count
to avoid retransmitted chunks for RTT measurements.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/structs.h
net/sctp/output.c
net/sctp/outqueue.c

index 11c3bf262a850315dcb938d6e95a7a4a638b7afe..27a933e4c90e25effdaf968f138671aa4fa45f83 100644 (file)
@@ -641,7 +641,6 @@ struct sctp_chunk {
 #define SCTP_NEED_FRTX 0x1
 #define SCTP_DONT_FRTX 0x2
        __u16   rtt_in_progress:1,      /* This chunk used for RTT calc? */
-               resent:1,               /* Has this chunk ever been resent. */
                has_tsn:1,              /* Does this chunk have a TSN yet? */
                has_ssn:1,              /* Does this chunk have a SSN yet? */
                singleton:1,            /* Only chunk in the packet? */
@@ -656,6 +655,7 @@ struct sctp_chunk {
                fast_retransmit:2;      /* Is this chunk fast retransmitted? */
 };
 
+#define sctp_chunk_retransmitted(chunk)        (chunk->sent_count > 1)
 void sctp_chunk_hold(struct sctp_chunk *);
 void sctp_chunk_put(struct sctp_chunk *);
 int sctp_user_addto_chunk(struct sctp_chunk *chunk, int len,
index 2a5c1896d18fa674f0e0e84ff6787d04914b2b73..84f66d560b0273d6d1632e3b750de87f315782eb 100644 (file)
@@ -552,7 +552,8 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp)
                                 * for a given destination transport address.
                                 */
 
-                               if (!chunk->resent && !tp->rto_pending) {
+                               if (!sctp_chunk_retransmitted(chunk) &&
+                                   !tp->rto_pending) {
                                        chunk->rtt_in_progress = 1;
                                        tp->rto_pending = 1;
                                }
index 582585393d35ea43d69a85f836d5d6d864ccad4e..e54082699520ae40d8ab4c282c230f3b3787db92 100644 (file)
@@ -507,8 +507,6 @@ void sctp_retransmit_mark(struct sctp_outq *q,
                                transport->rto_pending = 0;
                        }
 
-                       chunk->resent = 1;
-
                        /* Move the chunk to the retransmit queue. The chunks
                         * on the retransmit queue are always kept in order.
                         */
@@ -1439,7 +1437,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
                                 * instance).
                                 */
                                if (!tchunk->tsn_gap_acked &&
-                                   !tchunk->resent &&
+                                   !sctp_chunk_retransmitted(tchunk) &&
                                    tchunk->rtt_in_progress) {
                                        tchunk->rtt_in_progress = 0;
                                        rtt = jiffies - tchunk->sent_at;