Skip to content

Commit 691a620

Browse files
ajstephensPaul Gortmaker
authored andcommitted
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>
1 parent 3a777ff commit 691a620

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎net/tipc/discover.c‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,17 @@ void tipc_disc_update_link_req(struct link_req *req)
240240
}
241241
}
242242

243+
/**
244+
* disc_send_msg - send link setup request message
245+
* @req: ptr to link request structure
246+
*/
247+
248+
static 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+
243254
/**
244255
* disc_timeout - send a periodic link setup request
245256
* @req: ptr to link request structure
@@ -251,7 +262,7 @@ static void disc_timeout(struct link_req *req)
251262
{
252263
spin_lock_bh(&req->bearer->lock);
253264

254-
req->bearer->media->send_msg(req->buf, req->bearer, &req->dest);
265+
disc_send_msg(req);
255266

256267
if ((req->timer_intv == TIPC_LINK_REQ_SLOW) ||
257268
(req->timer_intv == TIPC_LINK_REQ_FAST)) {
@@ -300,6 +311,7 @@ int tipc_disc_create(struct tipc_bearer *b_ptr,
300311
k_init_timer(&req->timer, (Handler)disc_timeout, (unsigned long)req);
301312
k_start_timer(&req->timer, req->timer_intv);
302313
b_ptr->link_req = req;
314+
disc_send_msg(req);
303315
return 0;
304316
}
305317

0 commit comments

Comments
 (0)