aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorAllan Stephens <Allan.Stephens@windriver.com>2011-04-21 17:28:02 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-05-10 16:04:00 -0400
commit691a62075922b43b2b03def87ebcfdfbf0cd2ed8 (patch)
tree892bb742c6f6caaedd5ef3e3ac6d8fd96c66483b /net/tipc
parent3a777ff8b14456e15991c9fcc225943453dc3a75 (diff)
tipc: Enhance sending of discovery object link request messages
Augments TIPC's discovery object to send its initial neighbor discovery request message as soon as the associated bearer is created, rather than waiting for its first periodic timeout to occur, thereby speeding up the discovery process. Also adds a check to suppress the initial request or subsequent requests if the bearer is blocked at the time the request is scheduled for transmission. Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/discover.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index 6acf32a9eef8..dba47673124d 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -241,6 +241,17 @@ void tipc_disc_update_link_req(struct link_req *req)
241} 241}
242 242
243/** 243/**
244 * disc_send_msg - send link setup request message
245 * @req: ptr to link request structure
246 */
247
248static void disc_send_msg(struct link_req *req)
249{
250 if (!req->bearer->blocked)
251 tipc_bearer_send(req->bearer, req->buf, &req->dest);
252}
253
254/**
244 * disc_timeout - send a periodic link setup request 255 * disc_timeout - send a periodic link setup request
245 * @req: ptr to link request structure 256 * @req: ptr to link request structure
246 * 257 *
@@ -251,7 +262,7 @@ static void disc_timeout(struct link_req *req)
251{ 262{
252 spin_lock_bh(&req->bearer->lock); 263 spin_lock_bh(&req->bearer->lock);
253 264
254 req->bearer->media->send_msg(req->buf, req->bearer, &req->dest); 265 disc_send_msg(req);
255 266
256 if ((req->timer_intv == TIPC_LINK_REQ_SLOW) || 267 if ((req->timer_intv == TIPC_LINK_REQ_SLOW) ||
257 (req->timer_intv == TIPC_LINK_REQ_FAST)) { 268 (req->timer_intv == TIPC_LINK_REQ_FAST)) {
@@ -300,6 +311,7 @@ int tipc_disc_create(struct tipc_bearer *b_ptr,
300 k_init_timer(&req->timer, (Handler)disc_timeout, (unsigned long)req); 311 k_init_timer(&req->timer, (Handler)disc_timeout, (unsigned long)req);
301 k_start_timer(&req->timer, req->timer_intv); 312 k_start_timer(&req->timer, req->timer_intv);
302 b_ptr->link_req = req; 313 b_ptr->link_req = req;
314 disc_send_msg(req);
303 return 0; 315 return 0;
304} 316}
305 317