Skip to content

Commit 1fc07f3

Browse files
Jon Paul Maloydavem330
authored andcommitted
tipc: reset all unicast links when broadcast send link fails
In test situations with many nodes and a heavily stressed system we have observed that the transmission broadcast link may fail due to an excessive number of retransmissions of the same packet. In such situations we need to reset all unicast links to all peers, in order to reset and re-synchronize the broadcast link. In this commit, we add a new function tipc_bearer_reset_all() to be used in such situations. The function scans across all bearers and resets all their pertaining links. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a71eb72 commit 1fc07f3

3 files changed

Lines changed: 27 additions & 4 deletions

File tree

‎net/tipc/bearer.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,21 @@ static int tipc_reset_bearer(struct net *net, struct tipc_bearer *b)
330330
return 0;
331331
}
332332

333+
/* tipc_bearer_reset_all - reset all links on all bearers
334+
*/
335+
void tipc_bearer_reset_all(struct net *net)
336+
{
337+
struct tipc_net *tn = tipc_net(net);
338+
struct tipc_bearer *b;
339+
int i;
340+
341+
for (i = 0; i < MAX_BEARERS; i++) {
342+
b = rcu_dereference_rtnl(tn->bearer_list[i]);
343+
if (b)
344+
tipc_reset_bearer(net, b);
345+
}
346+
}
347+
333348
/**
334349
* bearer_disable
335350
*

‎net/tipc/bearer.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ void tipc_bearer_add_dest(struct net *net, u32 bearer_id, u32 dest);
198198
void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest);
199199
struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name);
200200
struct tipc_media *tipc_media_find(const char *name);
201+
void tipc_bearer_reset_all(struct net *net);
201202
int tipc_bearer_setup(void);
202203
void tipc_bearer_cleanup(void);
203204
void tipc_bearer_stop(struct net *net);

‎net/tipc/node.c‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,10 +1297,6 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id
12971297

12981298
rc = tipc_bcast_rcv(net, be->link, skb);
12991299

1300-
/* Broadcast link reset may happen at reassembly failure */
1301-
if (rc & TIPC_LINK_DOWN_EVT)
1302-
tipc_node_reset_links(n);
1303-
13041300
/* Broadcast ACKs are sent on a unicast link */
13051301
if (rc & TIPC_LINK_SND_BC_ACK) {
13061302
tipc_node_read_lock(n);
@@ -1320,6 +1316,17 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id
13201316
spin_unlock_bh(&be->inputq2.lock);
13211317
tipc_sk_mcast_rcv(net, &be->arrvq, &be->inputq2);
13221318
}
1319+
1320+
if (rc & TIPC_LINK_DOWN_EVT) {
1321+
/* Reception reassembly failure => reset all links to peer */
1322+
if (!tipc_link_is_up(be->link))
1323+
tipc_node_reset_links(n);
1324+
1325+
/* Retransmission failure => reset all links to all peers */
1326+
if (!tipc_link_is_up(tipc_bc_sndlink(net)))
1327+
tipc_bearer_reset_all(net);
1328+
}
1329+
13231330
tipc_node_put(n);
13241331
}
13251332

0 commit comments

Comments
 (0)