diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/tipc/bcast.c | 23 | ||||
-rw-r--r-- | net/tipc/bcast.h | 4 | ||||
-rw-r--r-- | net/tipc/link.c | 5 | ||||
-rw-r--r-- | net/tipc/node.c | 5 | ||||
-rw-r--r-- | net/tipc/node.h | 3 |
5 files changed, 8 insertions, 32 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 79355531c3e2..4289dd62f589 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -62,21 +62,8 @@ static void tipc_bclink_lock(struct net *net) | |||
62 | static void tipc_bclink_unlock(struct net *net) | 62 | static void tipc_bclink_unlock(struct net *net) |
63 | { | 63 | { |
64 | struct tipc_net *tn = net_generic(net, tipc_net_id); | 64 | struct tipc_net *tn = net_generic(net, tipc_net_id); |
65 | struct tipc_node *node = NULL; | ||
66 | 65 | ||
67 | if (likely(!tn->bclink->flags)) { | ||
68 | spin_unlock_bh(&tn->bclink->lock); | ||
69 | return; | ||
70 | } | ||
71 | |||
72 | if (tn->bclink->flags & TIPC_BCLINK_RESET) { | ||
73 | tn->bclink->flags &= ~TIPC_BCLINK_RESET; | ||
74 | node = tipc_bclink_retransmit_to(net); | ||
75 | } | ||
76 | spin_unlock_bh(&tn->bclink->lock); | 66 | spin_unlock_bh(&tn->bclink->lock); |
77 | |||
78 | if (node) | ||
79 | tipc_link_reset_all(node); | ||
80 | } | 67 | } |
81 | 68 | ||
82 | void tipc_bclink_input(struct net *net) | 69 | void tipc_bclink_input(struct net *net) |
@@ -91,13 +78,6 @@ uint tipc_bclink_get_mtu(void) | |||
91 | return MAX_PKT_DEFAULT_MCAST; | 78 | return MAX_PKT_DEFAULT_MCAST; |
92 | } | 79 | } |
93 | 80 | ||
94 | void tipc_bclink_set_flags(struct net *net, unsigned int flags) | ||
95 | { | ||
96 | struct tipc_net *tn = net_generic(net, tipc_net_id); | ||
97 | |||
98 | tn->bclink->flags |= flags; | ||
99 | } | ||
100 | |||
101 | static u32 bcbuf_acks(struct sk_buff *buf) | 81 | static u32 bcbuf_acks(struct sk_buff *buf) |
102 | { | 82 | { |
103 | return (u32)(unsigned long)TIPC_SKB_CB(buf)->handle; | 83 | return (u32)(unsigned long)TIPC_SKB_CB(buf)->handle; |
@@ -156,7 +136,6 @@ static void bclink_update_last_sent(struct tipc_node *node, u32 seqno) | |||
156 | seqno : node->bclink.last_sent; | 136 | seqno : node->bclink.last_sent; |
157 | } | 137 | } |
158 | 138 | ||
159 | |||
160 | /** | 139 | /** |
161 | * tipc_bclink_retransmit_to - get most recent node to request retransmission | 140 | * tipc_bclink_retransmit_to - get most recent node to request retransmission |
162 | * | 141 | * |
@@ -476,13 +455,13 @@ void tipc_bclink_rcv(struct net *net, struct sk_buff *buf) | |||
476 | goto unlock; | 455 | goto unlock; |
477 | if (msg_destnode(msg) == tn->own_addr) { | 456 | if (msg_destnode(msg) == tn->own_addr) { |
478 | tipc_bclink_acknowledge(node, msg_bcast_ack(msg)); | 457 | tipc_bclink_acknowledge(node, msg_bcast_ack(msg)); |
479 | tipc_node_unlock(node); | ||
480 | tipc_bclink_lock(net); | 458 | tipc_bclink_lock(net); |
481 | bcl->stats.recv_nacks++; | 459 | bcl->stats.recv_nacks++; |
482 | tn->bclink->retransmit_to = node; | 460 | tn->bclink->retransmit_to = node; |
483 | bclink_retransmit_pkt(tn, msg_bcgap_after(msg), | 461 | bclink_retransmit_pkt(tn, msg_bcgap_after(msg), |
484 | msg_bcgap_to(msg)); | 462 | msg_bcgap_to(msg)); |
485 | tipc_bclink_unlock(net); | 463 | tipc_bclink_unlock(net); |
464 | tipc_node_unlock(node); | ||
486 | } else { | 465 | } else { |
487 | tipc_node_unlock(node); | 466 | tipc_node_unlock(node); |
488 | bclink_peek_nack(net, msg); | 467 | bclink_peek_nack(net, msg); |
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h index 43f397fbac55..4bdc12277d33 100644 --- a/net/tipc/bcast.h +++ b/net/tipc/bcast.h | |||
@@ -55,7 +55,6 @@ struct tipc_bcbearer_pair { | |||
55 | struct tipc_bearer *secondary; | 55 | struct tipc_bearer *secondary; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | #define TIPC_BCLINK_RESET 1 | ||
59 | #define BCBEARER MAX_BEARERS | 58 | #define BCBEARER MAX_BEARERS |
60 | 59 | ||
61 | /** | 60 | /** |
@@ -86,7 +85,6 @@ struct tipc_bcbearer { | |||
86 | * @lock: spinlock governing access to structure | 85 | * @lock: spinlock governing access to structure |
87 | * @link: (non-standard) broadcast link structure | 86 | * @link: (non-standard) broadcast link structure |
88 | * @node: (non-standard) node structure representing b'cast link's peer node | 87 | * @node: (non-standard) node structure representing b'cast link's peer node |
89 | * @flags: represent bclink states | ||
90 | * @bcast_nodes: map of broadcast-capable nodes | 88 | * @bcast_nodes: map of broadcast-capable nodes |
91 | * @retransmit_to: node that most recently requested a retransmit | 89 | * @retransmit_to: node that most recently requested a retransmit |
92 | * | 90 | * |
@@ -96,7 +94,6 @@ struct tipc_bclink { | |||
96 | spinlock_t lock; | 94 | spinlock_t lock; |
97 | struct tipc_link link; | 95 | struct tipc_link link; |
98 | struct tipc_node node; | 96 | struct tipc_node node; |
99 | unsigned int flags; | ||
100 | struct sk_buff_head arrvq; | 97 | struct sk_buff_head arrvq; |
101 | struct sk_buff_head inputq; | 98 | struct sk_buff_head inputq; |
102 | struct tipc_node_map bcast_nodes; | 99 | struct tipc_node_map bcast_nodes; |
@@ -117,7 +114,6 @@ static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, | |||
117 | 114 | ||
118 | int tipc_bclink_init(struct net *net); | 115 | int tipc_bclink_init(struct net *net); |
119 | void tipc_bclink_stop(struct net *net); | 116 | void tipc_bclink_stop(struct net *net); |
120 | void tipc_bclink_set_flags(struct net *tn, unsigned int flags); | ||
121 | void tipc_bclink_add_node(struct net *net, u32 addr); | 117 | void tipc_bclink_add_node(struct net *net, u32 addr); |
122 | void tipc_bclink_remove_node(struct net *net, u32 addr); | 118 | void tipc_bclink_remove_node(struct net *net, u32 addr); |
123 | struct tipc_node *tipc_bclink_retransmit_to(struct net *tn); | 119 | struct tipc_node *tipc_bclink_retransmit_to(struct net *tn); |
diff --git a/net/tipc/link.c b/net/tipc/link.c index 1287161e9424..f5e086c5f724 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -980,7 +980,6 @@ static void link_retransmit_failure(struct tipc_link *l_ptr, | |||
980 | (unsigned long) TIPC_SKB_CB(buf)->handle); | 980 | (unsigned long) TIPC_SKB_CB(buf)->handle); |
981 | 981 | ||
982 | n_ptr = tipc_bclink_retransmit_to(net); | 982 | n_ptr = tipc_bclink_retransmit_to(net); |
983 | tipc_node_lock(n_ptr); | ||
984 | 983 | ||
985 | tipc_addr_string_fill(addr_string, n_ptr->addr); | 984 | tipc_addr_string_fill(addr_string, n_ptr->addr); |
986 | pr_info("Broadcast link info for %s\n", addr_string); | 985 | pr_info("Broadcast link info for %s\n", addr_string); |
@@ -992,9 +991,7 @@ static void link_retransmit_failure(struct tipc_link *l_ptr, | |||
992 | n_ptr->bclink.oos_state, | 991 | n_ptr->bclink.oos_state, |
993 | n_ptr->bclink.last_sent); | 992 | n_ptr->bclink.last_sent); |
994 | 993 | ||
995 | tipc_node_unlock(n_ptr); | 994 | n_ptr->action_flags |= TIPC_BCAST_RESET; |
996 | |||
997 | tipc_bclink_set_flags(net, TIPC_BCLINK_RESET); | ||
998 | l_ptr->stale_count = 0; | 995 | l_ptr->stale_count = 0; |
999 | } | 996 | } |
1000 | } | 997 | } |
diff --git a/net/tipc/node.c b/net/tipc/node.c index 26d1de1bf34d..5cc43d34ad0a 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -459,7 +459,7 @@ void tipc_node_unlock(struct tipc_node *node) | |||
459 | TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP | | 459 | TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP | |
460 | TIPC_NOTIFY_LINK_DOWN | TIPC_NOTIFY_LINK_UP | | 460 | TIPC_NOTIFY_LINK_DOWN | TIPC_NOTIFY_LINK_UP | |
461 | TIPC_WAKEUP_BCAST_USERS | TIPC_BCAST_MSG_EVT | | 461 | TIPC_WAKEUP_BCAST_USERS | TIPC_BCAST_MSG_EVT | |
462 | TIPC_NAMED_MSG_EVT); | 462 | TIPC_NAMED_MSG_EVT | TIPC_BCAST_RESET); |
463 | 463 | ||
464 | spin_unlock_bh(&node->lock); | 464 | spin_unlock_bh(&node->lock); |
465 | 465 | ||
@@ -488,6 +488,9 @@ void tipc_node_unlock(struct tipc_node *node) | |||
488 | 488 | ||
489 | if (flags & TIPC_BCAST_MSG_EVT) | 489 | if (flags & TIPC_BCAST_MSG_EVT) |
490 | tipc_bclink_input(net); | 490 | tipc_bclink_input(net); |
491 | |||
492 | if (flags & TIPC_BCAST_RESET) | ||
493 | tipc_link_reset_all(node); | ||
491 | } | 494 | } |
492 | 495 | ||
493 | /* Caller should hold node lock for the passed node */ | 496 | /* Caller should hold node lock for the passed node */ |
diff --git a/net/tipc/node.h b/net/tipc/node.h index e89ac04ec2c3..9629ecd2bdd8 100644 --- a/net/tipc/node.h +++ b/net/tipc/node.h | |||
@@ -64,7 +64,8 @@ enum { | |||
64 | TIPC_NOTIFY_LINK_UP = (1 << 6), | 64 | TIPC_NOTIFY_LINK_UP = (1 << 6), |
65 | TIPC_NOTIFY_LINK_DOWN = (1 << 7), | 65 | TIPC_NOTIFY_LINK_DOWN = (1 << 7), |
66 | TIPC_NAMED_MSG_EVT = (1 << 8), | 66 | TIPC_NAMED_MSG_EVT = (1 << 8), |
67 | TIPC_BCAST_MSG_EVT = (1 << 9) | 67 | TIPC_BCAST_MSG_EVT = (1 << 9), |
68 | TIPC_BCAST_RESET = (1 << 10) | ||
68 | }; | 69 | }; |
69 | 70 | ||
70 | /** | 71 | /** |