diff options
author | Ying Xue <ying.xue@windriver.com> | 2014-05-04 20:56:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-05 17:26:45 -0400 |
commit | 3f5a12bd9f9a61d8a12f9adf778b14e4bb8ca050 (patch) | |
tree | 4fe673edf946c5dbcbd472c04d5d20360d897c2e /net/tipc/bcast.c | |
parent | eb8b00f5f248c50603bca383792ac3a618297be0 (diff) |
tipc: avoid to asynchronously reset all links
Postpone the actions of resetting all links until after bclink
lock is released, avoiding to asynchronously reset all links.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r-- | net/tipc/bcast.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index ef8cff4ad743..a0978d0890cb 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -87,6 +87,7 @@ struct tipc_bcbearer { | |||
87 | * @lock: spinlock governing access to structure | 87 | * @lock: spinlock governing access to structure |
88 | * @link: (non-standard) broadcast link structure | 88 | * @link: (non-standard) broadcast link structure |
89 | * @node: (non-standard) node structure representing b'cast link's peer node | 89 | * @node: (non-standard) node structure representing b'cast link's peer node |
90 | * @flags: represent bclink states | ||
90 | * @bcast_nodes: map of broadcast-capable nodes | 91 | * @bcast_nodes: map of broadcast-capable nodes |
91 | * @retransmit_to: node that most recently requested a retransmit | 92 | * @retransmit_to: node that most recently requested a retransmit |
92 | * | 93 | * |
@@ -96,6 +97,7 @@ struct tipc_bclink { | |||
96 | spinlock_t lock; | 97 | spinlock_t lock; |
97 | struct tipc_link link; | 98 | struct tipc_link link; |
98 | struct tipc_node node; | 99 | struct tipc_node node; |
100 | unsigned int flags; | ||
99 | struct tipc_node_map bcast_nodes; | 101 | struct tipc_node_map bcast_nodes; |
100 | struct tipc_node *retransmit_to; | 102 | struct tipc_node *retransmit_to; |
101 | }; | 103 | }; |
@@ -119,7 +121,26 @@ static void tipc_bclink_lock(void) | |||
119 | 121 | ||
120 | static void tipc_bclink_unlock(void) | 122 | static void tipc_bclink_unlock(void) |
121 | { | 123 | { |
124 | struct tipc_node *node = NULL; | ||
125 | |||
126 | if (likely(!bclink->flags)) { | ||
127 | spin_unlock_bh(&bclink->lock); | ||
128 | return; | ||
129 | } | ||
130 | |||
131 | if (bclink->flags & TIPC_BCLINK_RESET) { | ||
132 | bclink->flags &= ~TIPC_BCLINK_RESET; | ||
133 | node = tipc_bclink_retransmit_to(); | ||
134 | } | ||
122 | spin_unlock_bh(&bclink->lock); | 135 | spin_unlock_bh(&bclink->lock); |
136 | |||
137 | if (node) | ||
138 | tipc_link_reset_all(node); | ||
139 | } | ||
140 | |||
141 | void tipc_bclink_set_flags(unsigned int flags) | ||
142 | { | ||
143 | bclink->flags |= flags; | ||
123 | } | 144 | } |
124 | 145 | ||
125 | static u32 bcbuf_acks(struct sk_buff *buf) | 146 | static u32 bcbuf_acks(struct sk_buff *buf) |