@@ -105,7 +105,7 @@ struct tipc_stats {
105
105
* @transmitq: queue for sent, non-acked messages
106
106
* @backlogq: queue for messages waiting to be sent
107
107
* @snt_nxt: next sequence number to use for outbound messages
108
- * @last_retransmitted : sequence number of most recently retransmitted message
108
+ * @prev_from : sequence number of most previous retransmission request
109
109
* @stale_cnt: counter for number of identical retransmit attempts
110
110
* @stale_limit: time when repeated identical retransmits must force link reset
111
111
* @ackers: # of peers that needs to ack each packet before it can be released
@@ -163,7 +163,7 @@ struct tipc_link {
163
163
u16 limit ;
164
164
} backlog [5 ];
165
165
u16 snd_nxt ;
166
- u16 last_retransm ;
166
+ u16 prev_from ;
167
167
u16 window ;
168
168
u16 stale_cnt ;
169
169
unsigned long stale_limit ;
@@ -186,9 +186,6 @@ struct tipc_link {
186
186
u16 acked ;
187
187
struct tipc_link * bc_rcvlink ;
188
188
struct tipc_link * bc_sndlink ;
189
- unsigned long prev_retr ;
190
- u16 prev_from ;
191
- u16 prev_to ;
192
189
u8 nack_state ;
193
190
bool bc_peer_is_up ;
194
191
@@ -210,7 +207,7 @@ enum {
210
207
BC_NACK_SND_SUPPRESS ,
211
208
};
212
209
213
- #define TIPC_BC_RETR_LIMIT 10 /* [ms] */
210
+ #define TIPC_BC_RETR_LIM msecs_to_jiffies(10) /* [ms] */
214
211
215
212
/*
216
213
* Interval between NACKs when packets arrive out of order
@@ -1036,10 +1033,12 @@ static int tipc_link_retrans(struct tipc_link *l, struct tipc_link *r,
1036
1033
1037
1034
if (!skb )
1038
1035
return 0 ;
1036
+ if (less (to , from ))
1037
+ return 0 ;
1039
1038
1040
1039
/* Detect repeated retransmit failures on same packet */
1041
- if (r -> last_retransm != buf_seqno ( skb ) ) {
1042
- r -> last_retransm = buf_seqno ( skb ) ;
1040
+ if (r -> prev_from != from ) {
1041
+ r -> prev_from = from ;
1043
1042
r -> stale_limit = jiffies + msecs_to_jiffies (r -> tolerance );
1044
1043
r -> stale_cnt = 0 ;
1045
1044
} else if (++ r -> stale_cnt > 99 && time_after (jiffies , r -> stale_limit )) {
@@ -1055,6 +1054,11 @@ static int tipc_link_retrans(struct tipc_link *l, struct tipc_link *r,
1055
1054
continue ;
1056
1055
if (more (msg_seqno (hdr ), to ))
1057
1056
break ;
1057
+ if (link_is_bc_sndlink (l )) {
1058
+ if (time_before (jiffies , TIPC_SKB_CB (skb )-> nxt_retr ))
1059
+ continue ;
1060
+ TIPC_SKB_CB (skb )-> nxt_retr = jiffies + TIPC_BC_RETR_LIM ;
1061
+ }
1058
1062
_skb = __pskb_copy (skb , MIN_H_SIZE , GFP_ATOMIC );
1059
1063
if (!_skb )
1060
1064
return 0 ;
@@ -1734,42 +1738,6 @@ void tipc_link_bc_init_rcv(struct tipc_link *l, struct tipc_msg *hdr)
1734
1738
l -> rcv_nxt = peers_snd_nxt ;
1735
1739
}
1736
1740
1737
- /* link_bc_retr eval()- check if the indicated range can be retransmitted now
1738
- * - Adjust permitted range if there is overlap with previous retransmission
1739
- */
1740
- static bool link_bc_retr_eval (struct tipc_link * l , u16 * from , u16 * to )
1741
- {
1742
- unsigned long elapsed = jiffies_to_msecs (jiffies - l -> prev_retr );
1743
-
1744
- if (less (* to , * from ))
1745
- return false;
1746
-
1747
- /* New retransmission request */
1748
- if ((elapsed > TIPC_BC_RETR_LIMIT ) ||
1749
- less (* to , l -> prev_from ) || more (* from , l -> prev_to )) {
1750
- l -> prev_from = * from ;
1751
- l -> prev_to = * to ;
1752
- l -> prev_retr = jiffies ;
1753
- return true;
1754
- }
1755
-
1756
- /* Inside range of previous retransmit */
1757
- if (!less (* from , l -> prev_from ) && !more (* to , l -> prev_to ))
1758
- return false;
1759
-
1760
- /* Fully or partially outside previous range => exclude overlap */
1761
- if (less (* from , l -> prev_from )) {
1762
- * to = l -> prev_from - 1 ;
1763
- l -> prev_from = * from ;
1764
- }
1765
- if (more (* to , l -> prev_to )) {
1766
- * from = l -> prev_to + 1 ;
1767
- l -> prev_to = * to ;
1768
- }
1769
- l -> prev_retr = jiffies ;
1770
- return true;
1771
- }
1772
-
1773
1741
/* tipc_link_bc_sync_rcv - update rcv link according to peer's send state
1774
1742
*/
1775
1743
int tipc_link_bc_sync_rcv (struct tipc_link * l , struct tipc_msg * hdr ,
@@ -1800,8 +1768,7 @@ int tipc_link_bc_sync_rcv(struct tipc_link *l, struct tipc_msg *hdr,
1800
1768
if (more (peers_snd_nxt , l -> rcv_nxt + l -> window ))
1801
1769
return rc ;
1802
1770
1803
- if (link_bc_retr_eval (snd_l , & from , & to ))
1804
- rc = tipc_link_retrans (snd_l , l , from , to , xmitq );
1771
+ rc = tipc_link_retrans (snd_l , l , from , to , xmitq );
1805
1772
1806
1773
l -> snd_nxt = peers_snd_nxt ;
1807
1774
if (link_bc_rcv_gap (l ))
0 commit comments