aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorAllan Stephens <Allan.Stephens@windriver.com>2010-12-31 13:59:17 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-01 16:57:48 -0500
commit08c80e9a031df0a8f0269477a32f5eae47d7a146 (patch)
tree87a20adf19603edfafabc0b138a2992a0cbe6481 /net/tipc/node.c
parent51f98a8d70583b18cb08b19353aeed5efb0244af (diff)
tipc: Remove prototype code for supporting slave nodes
Simplifies routines and data structures that were intended to allow TIPC to support slave nodes (i.e. nodes that did not have links to all of the other nodes in its cluster, forcing TIPC to route messages that it could not deliver directly through a non-slave node). Currently, TIPC supports only networks containing non-slave nodes, so this code is unnecessary. Note: The latest edition of the TIPC 2.0 Specification has eliminated the concept of slave nodes entirely. Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c59
1 files changed, 14 insertions, 45 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index c20bd851a44a..8ffbdb33b2cb 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -333,8 +333,6 @@ static void node_established_contact(struct tipc_node *n_ptr)
333 /* Syncronize broadcast acks */ 333 /* Syncronize broadcast acks */
334 n_ptr->bclink.acked = tipc_bclink_get_last_sent(); 334 n_ptr->bclink.acked = tipc_bclink_get_last_sent();
335 335
336 if (is_slave(tipc_own_addr))
337 return;
338 if (!in_own_cluster(n_ptr->addr)) { 336 if (!in_own_cluster(n_ptr->addr)) {
339 /* Usage case 1 (see above) */ 337 /* Usage case 1 (see above) */
340 c_ptr = tipc_cltr_find(tipc_own_addr); 338 c_ptr = tipc_cltr_find(tipc_own_addr);
@@ -347,13 +345,6 @@ static void node_established_contact(struct tipc_node *n_ptr)
347 } 345 }
348 346
349 c_ptr = n_ptr->owner; 347 c_ptr = n_ptr->owner;
350 if (is_slave(n_ptr->addr)) {
351 /* Usage case 2 (see above) */
352 tipc_cltr_bcast_new_route(c_ptr, n_ptr->addr, 1, tipc_max_nodes);
353 tipc_cltr_send_local_routes(c_ptr, n_ptr->addr);
354 return;
355 }
356
357 if (n_ptr->bclink.supported) { 348 if (n_ptr->bclink.supported) {
358 tipc_nmap_add(&tipc_cltr_bcast_nodes, n_ptr->addr); 349 tipc_nmap_add(&tipc_cltr_bcast_nodes, n_ptr->addr);
359 if (n_ptr->addr < tipc_own_addr) 350 if (n_ptr->addr < tipc_own_addr)
@@ -362,9 +353,6 @@ static void node_established_contact(struct tipc_node *n_ptr)
362 353
363 /* Case 3 (see above) */ 354 /* Case 3 (see above) */
364 tipc_net_send_external_routes(n_ptr->addr); 355 tipc_net_send_external_routes(n_ptr->addr);
365 tipc_cltr_send_slave_routes(c_ptr, n_ptr->addr);
366 tipc_cltr_bcast_new_route(c_ptr, n_ptr->addr, LOWEST_SLAVE,
367 tipc_highest_allowed_slave);
368} 356}
369 357
370static void node_cleanup_finished(unsigned long node_addr) 358static void node_cleanup_finished(unsigned long node_addr)
@@ -404,33 +392,20 @@ static void node_lost_contact(struct tipc_node *n_ptr)
404 } 392 }
405 393
406 /* Update routing tables */ 394 /* Update routing tables */
407 if (is_slave(tipc_own_addr)) { 395 if (!in_own_cluster(n_ptr->addr)) {
408 tipc_net_remove_as_router(n_ptr->addr); 396 /* Case 4 (see above) */
397 c_ptr = tipc_cltr_find(tipc_own_addr);
398 tipc_cltr_bcast_lost_route(c_ptr, n_ptr->addr, 1,
399 tipc_max_nodes);
409 } else { 400 } else {
410 if (!in_own_cluster(n_ptr->addr)) { 401 /* Case 5 (see above) */
411 /* Case 4 (see above) */ 402 c_ptr = tipc_cltr_find(n_ptr->addr);
412 c_ptr = tipc_cltr_find(tipc_own_addr); 403 if (n_ptr->bclink.supported) {
413 tipc_cltr_bcast_lost_route(c_ptr, n_ptr->addr, 1, 404 tipc_nmap_remove(&tipc_cltr_bcast_nodes, n_ptr->addr);
414 tipc_max_nodes); 405 if (n_ptr->addr < tipc_own_addr)
415 } else { 406 tipc_own_tag--;
416 /* Case 5 (see above) */
417 c_ptr = tipc_cltr_find(n_ptr->addr);
418 if (is_slave(n_ptr->addr)) {
419 tipc_cltr_bcast_lost_route(c_ptr, n_ptr->addr, 1,
420 tipc_max_nodes);
421 } else {
422 if (n_ptr->bclink.supported) {
423 tipc_nmap_remove(&tipc_cltr_bcast_nodes,
424 n_ptr->addr);
425 if (n_ptr->addr < tipc_own_addr)
426 tipc_own_tag--;
427 }
428 tipc_net_remove_as_router(n_ptr->addr);
429 tipc_cltr_bcast_lost_route(c_ptr, n_ptr->addr,
430 LOWEST_SLAVE,
431 tipc_highest_allowed_slave);
432 }
433 } 407 }
408 tipc_net_remove_as_router(n_ptr->addr);
434 } 409 }
435 if (tipc_node_has_active_routes(n_ptr)) 410 if (tipc_node_has_active_routes(n_ptr))
436 return; 411 return;
@@ -482,7 +457,7 @@ struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector)
482 return n_ptr; 457 return n_ptr;
483 458
484 /* Cluster local system nodes *must* have direct links */ 459 /* Cluster local system nodes *must* have direct links */
485 if (!is_slave(addr) && in_own_cluster(addr)) 460 if (in_own_cluster(addr))
486 return NULL; 461 return NULL;
487 462
488 /* Look for cluster local router with direct link to node */ 463 /* Look for cluster local router with direct link to node */
@@ -490,11 +465,6 @@ struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector)
490 if (router_addr) 465 if (router_addr)
491 return tipc_node_select(router_addr, selector); 466 return tipc_node_select(router_addr, selector);
492 467
493 /* Slave nodes can only be accessed within own cluster via a
494 known router with direct link -- if no router was found,give up */
495 if (is_slave(addr))
496 return NULL;
497
498 /* Inter zone/cluster -- find any direct link to remote cluster */ 468 /* Inter zone/cluster -- find any direct link to remote cluster */
499 addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0); 469 addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
500 n_ptr = tipc_net_select_remote_node(addr, selector); 470 n_ptr = tipc_net_select_remote_node(addr, selector);
@@ -603,8 +573,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
603 return tipc_cfg_reply_none(); 573 return tipc_cfg_reply_none();
604 } 574 }
605 575
606 /* For now, get space for all other nodes 576 /* For now, get space for all other nodes */
607 (will need to modify this when slave nodes are supported */
608 577
609 payload_size = TLV_SPACE(sizeof(node_info)) * (tipc_max_nodes - 1); 578 payload_size = TLV_SPACE(sizeof(node_info)) * (tipc_max_nodes - 1);
610 if (payload_size > 32768u) { 579 if (payload_size > 32768u) {