aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
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
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')
-rw-r--r--net/tipc/addr.c2
-rw-r--r--net/tipc/addr.h10
-rw-r--r--net/tipc/cluster.c166
-rw-r--r--net/tipc/cluster.h7
-rw-r--r--net/tipc/config.c21
-rw-r--r--net/tipc/core.c6
-rw-r--r--net/tipc/core.h1
-rw-r--r--net/tipc/discover.c4
-rw-r--r--net/tipc/msg.h2
-rw-r--r--net/tipc/node.c59
-rw-r--r--net/tipc/port.c5
11 files changed, 38 insertions, 245 deletions
diff --git a/net/tipc/addr.c b/net/tipc/addr.c
index 3d0f97da5b5f..8823e03e52e0 100644
--- a/net/tipc/addr.c
+++ b/net/tipc/addr.c
@@ -53,8 +53,6 @@ int tipc_addr_domain_valid(u32 addr)
53 u32 z = tipc_zone(addr); 53 u32 z = tipc_zone(addr);
54 u32 max_nodes = tipc_max_nodes; 54 u32 max_nodes = tipc_max_nodes;
55 55
56 if (is_slave(addr))
57 max_nodes = LOWEST_SLAVE + tipc_max_slaves;
58 if (n > max_nodes) 56 if (n > max_nodes)
59 return 0; 57 return 0;
60 if (c > tipc_max_clusters) 58 if (c > tipc_max_clusters)
diff --git a/net/tipc/addr.h b/net/tipc/addr.h
index c1cc5724d8cc..a16c6c87208e 100644
--- a/net/tipc/addr.h
+++ b/net/tipc/addr.h
@@ -57,16 +57,6 @@ static inline int in_own_cluster(u32 addr)
57 return !((addr ^ tipc_own_addr) >> 12); 57 return !((addr ^ tipc_own_addr) >> 12);
58} 58}
59 59
60static inline int is_slave(u32 addr)
61{
62 return addr & 0x800;
63}
64
65static inline int may_route(u32 addr)
66{
67 return(addr ^ tipc_own_addr) >> 11;
68}
69
70/** 60/**
71 * addr_domain - convert 2-bit scope value to equivalent message lookup domain 61 * addr_domain - convert 2-bit scope value to equivalent message lookup domain
72 * 62 *
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c
index 996b2b67687e..6bc9f07be945 100644
--- a/net/tipc/cluster.c
+++ b/net/tipc/cluster.c
@@ -43,7 +43,6 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
43 43
44struct tipc_node **tipc_local_nodes = NULL; 44struct tipc_node **tipc_local_nodes = NULL;
45struct tipc_node_map tipc_cltr_bcast_nodes = {0,{0,}}; 45struct tipc_node_map tipc_cltr_bcast_nodes = {0,{0,}};
46u32 tipc_highest_allowed_slave = 0;
47 46
48struct cluster *tipc_cltr_create(u32 addr) 47struct cluster *tipc_cltr_create(u32 addr)
49{ 48{
@@ -57,10 +56,7 @@ struct cluster *tipc_cltr_create(u32 addr)
57 } 56 }
58 57
59 c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0); 58 c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
60 if (in_own_cluster(addr)) 59 max_nodes = tipc_max_nodes + 1;
61 max_nodes = LOWEST_SLAVE + tipc_max_slaves;
62 else
63 max_nodes = tipc_max_nodes + 1;
64 60
65 c_ptr->nodes = kcalloc(max_nodes + 1, sizeof(void*), GFP_ATOMIC); 61 c_ptr->nodes = kcalloc(max_nodes + 1, sizeof(void*), GFP_ATOMIC);
66 if (c_ptr->nodes == NULL) { 62 if (c_ptr->nodes == NULL) {
@@ -71,7 +67,6 @@ struct cluster *tipc_cltr_create(u32 addr)
71 67
72 if (in_own_cluster(addr)) 68 if (in_own_cluster(addr))
73 tipc_local_nodes = c_ptr->nodes; 69 tipc_local_nodes = c_ptr->nodes;
74 c_ptr->highest_slave = LOWEST_SLAVE - 1;
75 c_ptr->highest_node = 0; 70 c_ptr->highest_node = 0;
76 71
77 tipc_net.clusters[1] = c_ptr; 72 tipc_net.clusters[1] = c_ptr;
@@ -87,9 +82,6 @@ void tipc_cltr_delete(struct cluster *c_ptr)
87 for (n_num = 1; n_num <= c_ptr->highest_node; n_num++) { 82 for (n_num = 1; n_num <= c_ptr->highest_node; n_num++) {
88 tipc_node_delete(c_ptr->nodes[n_num]); 83 tipc_node_delete(c_ptr->nodes[n_num]);
89 } 84 }
90 for (n_num = LOWEST_SLAVE; n_num <= c_ptr->highest_slave; n_num++) {
91 tipc_node_delete(c_ptr->nodes[n_num]);
92 }
93 kfree(c_ptr->nodes); 85 kfree(c_ptr->nodes);
94 kfree(c_ptr); 86 kfree(c_ptr);
95} 87}
@@ -100,8 +92,6 @@ void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr)
100 u32 n_num = tipc_node(n_ptr->addr); 92 u32 n_num = tipc_node(n_ptr->addr);
101 u32 max_n_num = tipc_max_nodes; 93 u32 max_n_num = tipc_max_nodes;
102 94
103 if (in_own_cluster(n_ptr->addr))
104 max_n_num = tipc_highest_allowed_slave;
105 assert(n_num > 0); 95 assert(n_num > 0);
106 assert(n_num <= max_n_num); 96 assert(n_num <= max_n_num);
107 assert(c_ptr->nodes[n_num] == NULL); 97 assert(c_ptr->nodes[n_num] == NULL);
@@ -237,41 +227,6 @@ void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest,
237 } 227 }
238} 228}
239 229
240void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest)
241{
242 struct sk_buff *buf;
243 struct tipc_msg *msg;
244 u32 highest = c_ptr->highest_slave;
245 u32 n_num;
246 int send = 0;
247
248 assert(!is_slave(dest));
249 assert(in_own_cluster(dest));
250 assert(in_own_cluster(c_ptr->addr));
251 if (highest <= LOWEST_SLAVE)
252 return;
253 buf = tipc_cltr_prepare_routing_msg(highest - LOWEST_SLAVE + 1,
254 c_ptr->addr);
255 if (buf) {
256 msg = buf_msg(buf);
257 msg_set_remote_node(msg, c_ptr->addr);
258 msg_set_type(msg, SLAVE_ROUTING_TABLE);
259 for (n_num = LOWEST_SLAVE; n_num <= highest; n_num++) {
260 if (c_ptr->nodes[n_num] &&
261 tipc_node_has_active_links(c_ptr->nodes[n_num])) {
262 send = 1;
263 msg_set_dataoctet(msg, n_num);
264 }
265 }
266 if (send)
267 tipc_link_send(buf, dest, dest);
268 else
269 buf_discard(buf);
270 } else {
271 warn("Memory squeeze: broadcast of lost route failed\n");
272 }
273}
274
275void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest) 230void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest)
276{ 231{
277 struct sk_buff *buf; 232 struct sk_buff *buf;
@@ -282,7 +237,6 @@ void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest)
282 237
283 if (in_own_cluster(c_ptr->addr)) 238 if (in_own_cluster(c_ptr->addr))
284 return; 239 return;
285 assert(!is_slave(dest));
286 assert(in_own_cluster(dest)); 240 assert(in_own_cluster(dest));
287 highest = c_ptr->highest_node; 241 highest = c_ptr->highest_node;
288 buf = tipc_cltr_prepare_routing_msg(highest + 1, c_ptr->addr); 242 buf = tipc_cltr_prepare_routing_msg(highest + 1, c_ptr->addr);
@@ -306,37 +260,6 @@ void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest)
306 } 260 }
307} 261}
308 262
309void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest)
310{
311 struct sk_buff *buf;
312 struct tipc_msg *msg;
313 u32 highest = c_ptr->highest_node;
314 u32 n_num;
315 int send = 0;
316
317 assert(is_slave(dest));
318 assert(in_own_cluster(c_ptr->addr));
319 buf = tipc_cltr_prepare_routing_msg(highest, c_ptr->addr);
320 if (buf) {
321 msg = buf_msg(buf);
322 msg_set_remote_node(msg, c_ptr->addr);
323 msg_set_type(msg, LOCAL_ROUTING_TABLE);
324 for (n_num = 1; n_num <= highest; n_num++) {
325 if (c_ptr->nodes[n_num] &&
326 tipc_node_has_active_links(c_ptr->nodes[n_num])) {
327 send = 1;
328 msg_set_dataoctet(msg, n_num);
329 }
330 }
331 if (send)
332 tipc_link_send(buf, dest, dest);
333 else
334 buf_discard(buf);
335 } else {
336 warn("Memory squeeze: broadcast of local route failed\n");
337 }
338}
339
340void tipc_cltr_recv_routing_table(struct sk_buff *buf) 263void tipc_cltr_recv_routing_table(struct sk_buff *buf)
341{ 264{
342 struct tipc_msg *msg = buf_msg(buf); 265 struct tipc_msg *msg = buf_msg(buf);
@@ -366,8 +289,6 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf)
366 c_num = tipc_cluster(rem_node); 289 c_num = tipc_cluster(rem_node);
367 290
368 switch (msg_type(msg)) { 291 switch (msg_type(msg)) {
369 case LOCAL_ROUTING_TABLE:
370 assert(is_slave(tipc_own_addr));
371 case EXT_ROUTING_TABLE: 292 case EXT_ROUTING_TABLE:
372 for (n_num = 1; n_num < table_size; n_num++) { 293 for (n_num = 1; n_num < table_size; n_num++) {
373 if (node_table[n_num]) { 294 if (node_table[n_num]) {
@@ -382,29 +303,10 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf)
382 } 303 }
383 break; 304 break;
384 case SLAVE_ROUTING_TABLE: 305 case SLAVE_ROUTING_TABLE:
385 assert(!is_slave(tipc_own_addr));
386 assert(in_own_cluster(c_ptr->addr)); 306 assert(in_own_cluster(c_ptr->addr));
387 for (n_num = 1; n_num < table_size; n_num++) {
388 if (node_table[n_num]) {
389 u32 slave_num = n_num + LOWEST_SLAVE;
390 u32 addr = tipc_addr(z_num, c_num, slave_num);
391 n_ptr = c_ptr->nodes[slave_num];
392 if (!n_ptr) {
393 n_ptr = tipc_node_create(addr);
394 }
395 if (n_ptr)
396 tipc_node_add_router(n_ptr, router);
397 }
398 }
399 break; 307 break;
400 case ROUTE_ADDITION: 308 case ROUTE_ADDITION:
401 if (!is_slave(tipc_own_addr)) { 309 assert(!in_own_cluster(c_ptr->addr));
402 assert(!in_own_cluster(c_ptr->addr) ||
403 is_slave(rem_node));
404 } else {
405 assert(in_own_cluster(c_ptr->addr) &&
406 !is_slave(rem_node));
407 }
408 n_ptr = c_ptr->nodes[tipc_node(rem_node)]; 310 n_ptr = c_ptr->nodes[tipc_node(rem_node)];
409 if (!n_ptr) 311 if (!n_ptr)
410 n_ptr = tipc_node_create(rem_node); 312 n_ptr = tipc_node_create(rem_node);
@@ -412,13 +314,7 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf)
412 tipc_node_add_router(n_ptr, router); 314 tipc_node_add_router(n_ptr, router);
413 break; 315 break;
414 case ROUTE_REMOVAL: 316 case ROUTE_REMOVAL:
415 if (!is_slave(tipc_own_addr)) { 317 assert(!in_own_cluster(c_ptr->addr));
416 assert(!in_own_cluster(c_ptr->addr) ||
417 is_slave(rem_node));
418 } else {
419 assert(in_own_cluster(c_ptr->addr) &&
420 !is_slave(rem_node));
421 }
422 n_ptr = c_ptr->nodes[tipc_node(rem_node)]; 318 n_ptr = c_ptr->nodes[tipc_node(rem_node)];
423 if (n_ptr) 319 if (n_ptr)
424 tipc_node_remove_router(n_ptr, router); 320 tipc_node_remove_router(n_ptr, router);
@@ -431,22 +327,12 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf)
431 327
432void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router) 328void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router)
433{ 329{
434 u32 start_entry;
435 u32 tstop;
436 u32 n_num; 330 u32 n_num;
437 331
438 if (is_slave(router)) 332 if (in_own_cluster(c_ptr->addr))
439 return; /* Slave nodes can not be routers */ 333 return;
440
441 if (in_own_cluster(c_ptr->addr)) {
442 start_entry = LOWEST_SLAVE;
443 tstop = c_ptr->highest_slave;
444 } else {
445 start_entry = 1;
446 tstop = c_ptr->highest_node;
447 }
448 334
449 for (n_num = start_entry; n_num <= tstop; n_num++) { 335 for (n_num = 1; n_num <= c_ptr->highest_node; n_num++) {
450 if (c_ptr->nodes[n_num]) { 336 if (c_ptr->nodes[n_num]) {
451 tipc_node_remove_router(c_ptr->nodes[n_num], router); 337 tipc_node_remove_router(c_ptr->nodes[n_num], router);
452 } 338 }
@@ -466,13 +352,11 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
466 u32 tstop; 352 u32 tstop;
467 353
468 assert(lower <= upper); 354 assert(lower <= upper);
469 assert(((lower >= 1) && (lower <= tipc_max_nodes)) || 355 assert((lower >= 1) && (lower <= tipc_max_nodes));
470 ((lower >= LOWEST_SLAVE) && (lower <= tipc_highest_allowed_slave))); 356 assert((upper >= 1) && (upper <= tipc_max_nodes));
471 assert(((upper >= 1) && (upper <= tipc_max_nodes)) ||
472 ((upper >= LOWEST_SLAVE) && (upper <= tipc_highest_allowed_slave)));
473 assert(in_own_cluster(c_ptr->addr)); 357 assert(in_own_cluster(c_ptr->addr));
474 358
475 tstop = is_slave(upper) ? c_ptr->highest_slave : c_ptr->highest_node; 359 tstop = c_ptr->highest_node;
476 if (tstop > upper) 360 if (tstop > upper)
477 tstop = upper; 361 tstop = upper;
478 for (n_num = lower; n_num <= tstop; n_num++) { 362 for (n_num = lower; n_num <= tstop; n_num++) {
@@ -498,32 +382,23 @@ void tipc_cltr_broadcast(struct sk_buff *buf)
498 struct cluster *c_ptr; 382 struct cluster *c_ptr;
499 struct tipc_node *n_ptr; 383 struct tipc_node *n_ptr;
500 u32 n_num; 384 u32 n_num;
501 u32 tstart;
502 u32 tstop;
503 u32 node_type;
504 385
505 if (tipc_mode == TIPC_NET_MODE) { 386 if (tipc_mode == TIPC_NET_MODE) {
506 c_ptr = tipc_cltr_find(tipc_own_addr); 387 c_ptr = tipc_cltr_find(tipc_own_addr);
507 assert(in_own_cluster(c_ptr->addr)); /* For now */ 388 assert(in_own_cluster(c_ptr->addr)); /* For now */
508 389
509 /* Send to standard nodes, then repeat loop sending to slaves */ 390 /* Send to nodes */
510 tstart = 1; 391 for (n_num = 1; n_num <= c_ptr->highest_node; n_num++) {
511 tstop = c_ptr->highest_node; 392 n_ptr = c_ptr->nodes[n_num];
512 for (node_type = 1; node_type <= 2; node_type++) { 393 if (n_ptr && tipc_node_has_active_links(n_ptr)) {
513 for (n_num = tstart; n_num <= tstop; n_num++) { 394 buf_copy = skb_copy(buf, GFP_ATOMIC);
514 n_ptr = c_ptr->nodes[n_num]; 395 if (buf_copy == NULL)
515 if (n_ptr && tipc_node_has_active_links(n_ptr)) { 396 goto exit;
516 buf_copy = skb_copy(buf, GFP_ATOMIC); 397 msg_set_destnode(buf_msg(buf_copy),
517 if (buf_copy == NULL) 398 n_ptr->addr);
518 goto exit; 399 tipc_link_send(buf_copy, n_ptr->addr,
519 msg_set_destnode(buf_msg(buf_copy), 400 n_ptr->addr);
520 n_ptr->addr);
521 tipc_link_send(buf_copy, n_ptr->addr,
522 n_ptr->addr);
523 }
524 } 401 }
525 tstart = LOWEST_SLAVE;
526 tstop = c_ptr->highest_slave;
527 } 402 }
528 } 403 }
529exit: 404exit:
@@ -532,7 +407,6 @@ exit:
532 407
533int tipc_cltr_init(void) 408int tipc_cltr_init(void)
534{ 409{
535 tipc_highest_allowed_slave = LOWEST_SLAVE + tipc_max_slaves;
536 return tipc_cltr_create(tipc_own_addr) ? 0 : -ENOMEM; 410 return tipc_cltr_create(tipc_own_addr) ? 0 : -ENOMEM;
537} 411}
538 412
diff --git a/net/tipc/cluster.h b/net/tipc/cluster.h
index 21493f7beb95..aa1fd6ab4d11 100644
--- a/net/tipc/cluster.h
+++ b/net/tipc/cluster.h
@@ -40,26 +40,21 @@
40#include "addr.h" 40#include "addr.h"
41#include "net.h" 41#include "net.h"
42 42
43#define LOWEST_SLAVE 2048u
44
45/** 43/**
46 * struct cluster - TIPC cluster structure 44 * struct cluster - TIPC cluster structure
47 * @addr: network address of cluster 45 * @addr: network address of cluster
48 * @nodes: array of pointers to all nodes within cluster 46 * @nodes: array of pointers to all nodes within cluster
49 * @highest_node: id of highest numbered node within cluster 47 * @highest_node: id of highest numbered node within cluster
50 * @highest_slave: (used for secondary node support)
51 */ 48 */
52 49
53struct cluster { 50struct cluster {
54 u32 addr; 51 u32 addr;
55 struct tipc_node **nodes; 52 struct tipc_node **nodes;
56 u32 highest_node; 53 u32 highest_node;
57 u32 highest_slave;
58}; 54};
59 55
60 56
61extern struct tipc_node **tipc_local_nodes; 57extern struct tipc_node **tipc_local_nodes;
62extern u32 tipc_highest_allowed_slave;
63extern struct tipc_node_map tipc_cltr_bcast_nodes; 58extern struct tipc_node_map tipc_cltr_bcast_nodes;
64 59
65void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router); 60void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router);
@@ -70,12 +65,10 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf);
70struct cluster *tipc_cltr_create(u32 addr); 65struct cluster *tipc_cltr_create(u32 addr);
71void tipc_cltr_delete(struct cluster *c_ptr); 66void tipc_cltr_delete(struct cluster *c_ptr);
72void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr); 67void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr);
73void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest);
74void tipc_cltr_broadcast(struct sk_buff *buf); 68void tipc_cltr_broadcast(struct sk_buff *buf);
75int tipc_cltr_init(void); 69int tipc_cltr_init(void);
76 70
77void tipc_cltr_bcast_new_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi); 71void tipc_cltr_bcast_new_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi);
78void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest);
79void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi); 72void tipc_cltr_bcast_lost_route(struct cluster *c_ptr, u32 dest, u32 lo, u32 hi);
80 73
81static inline struct cluster *tipc_cltr_find(u32 addr) 74static inline struct cluster *tipc_cltr_find(u32 addr)
diff --git a/net/tipc/config.c b/net/tipc/config.c
index 8de97ddb0427..05dc102300ae 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -301,19 +301,6 @@ static struct sk_buff *cfg_set_max_nodes(void)
301 return tipc_cfg_reply_none(); 301 return tipc_cfg_reply_none();
302} 302}
303 303
304static struct sk_buff *cfg_set_max_slaves(void)
305{
306 u32 value;
307
308 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
309 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
310 value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
311 if (value != 0)
312 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
313 " (max secondary nodes fixed at 0)");
314 return tipc_cfg_reply_none();
315}
316
317static struct sk_buff *cfg_set_netid(void) 304static struct sk_buff *cfg_set_netid(void)
318{ 305{
319 u32 value; 306 u32 value;
@@ -439,9 +426,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
439 case TIPC_CMD_SET_MAX_NODES: 426 case TIPC_CMD_SET_MAX_NODES:
440 rep_tlv_buf = cfg_set_max_nodes(); 427 rep_tlv_buf = cfg_set_max_nodes();
441 break; 428 break;
442 case TIPC_CMD_SET_MAX_SLAVES:
443 rep_tlv_buf = cfg_set_max_slaves();
444 break;
445 case TIPC_CMD_SET_NETID: 429 case TIPC_CMD_SET_NETID:
446 rep_tlv_buf = cfg_set_netid(); 430 rep_tlv_buf = cfg_set_netid();
447 break; 431 break;
@@ -463,9 +447,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
463 case TIPC_CMD_GET_MAX_NODES: 447 case TIPC_CMD_GET_MAX_NODES:
464 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_nodes); 448 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_nodes);
465 break; 449 break;
466 case TIPC_CMD_GET_MAX_SLAVES:
467 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_slaves);
468 break;
469 case TIPC_CMD_GET_NETID: 450 case TIPC_CMD_GET_NETID:
470 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id); 451 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id);
471 break; 452 break;
@@ -475,6 +456,8 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
475 break; 456 break;
476 case TIPC_CMD_SET_MAX_ZONES: 457 case TIPC_CMD_SET_MAX_ZONES:
477 case TIPC_CMD_GET_MAX_ZONES: 458 case TIPC_CMD_GET_MAX_ZONES:
459 case TIPC_CMD_SET_MAX_SLAVES:
460 case TIPC_CMD_GET_MAX_SLAVES:
478 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 461 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
479 " (obsolete command)"); 462 " (obsolete command)");
480 break; 463 break;
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 13946331bd4d..8b7af893971e 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -56,10 +56,6 @@
56#define CONFIG_TIPC_NODES 255 56#define CONFIG_TIPC_NODES 255
57#endif 57#endif
58 58
59#ifndef CONFIG_TIPC_SLAVE_NODES
60#define CONFIG_TIPC_SLAVE_NODES 0
61#endif
62
63#ifndef CONFIG_TIPC_PORTS 59#ifndef CONFIG_TIPC_PORTS
64#define CONFIG_TIPC_PORTS 8191 60#define CONFIG_TIPC_PORTS 8191
65#endif 61#endif
@@ -82,7 +78,6 @@ const char tipc_alphabet[] =
82u32 tipc_own_addr; 78u32 tipc_own_addr;
83int tipc_max_clusters; 79int tipc_max_clusters;
84int tipc_max_nodes; 80int tipc_max_nodes;
85int tipc_max_slaves;
86int tipc_max_ports; 81int tipc_max_ports;
87int tipc_max_subscriptions; 82int tipc_max_subscriptions;
88int tipc_max_publications; 83int tipc_max_publications;
@@ -206,7 +201,6 @@ static int __init tipc_init(void)
206 tipc_max_ports = CONFIG_TIPC_PORTS; 201 tipc_max_ports = CONFIG_TIPC_PORTS;
207 tipc_max_clusters = CONFIG_TIPC_CLUSTERS; 202 tipc_max_clusters = CONFIG_TIPC_CLUSTERS;
208 tipc_max_nodes = CONFIG_TIPC_NODES; 203 tipc_max_nodes = CONFIG_TIPC_NODES;
209 tipc_max_slaves = CONFIG_TIPC_SLAVE_NODES;
210 tipc_net_id = 4711; 204 tipc_net_id = 4711;
211 205
212 if ((res = tipc_core_start())) 206 if ((res = tipc_core_start()))
diff --git a/net/tipc/core.h b/net/tipc/core.h
index 9403a226a570..8313a1689565 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -186,7 +186,6 @@ void tipc_dump_dbg(struct print_buf *, const char *fmt, ...);
186extern u32 tipc_own_addr; 186extern u32 tipc_own_addr;
187extern int tipc_max_clusters; 187extern int tipc_max_clusters;
188extern int tipc_max_nodes; 188extern int tipc_max_nodes;
189extern int tipc_max_slaves;
190extern int tipc_max_ports; 189extern int tipc_max_ports;
191extern int tipc_max_subscriptions; 190extern int tipc_max_subscriptions;
192extern int tipc_max_publications; 191extern int tipc_max_publications;
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index f2ce36baf42e..80799f6ba892 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -149,10 +149,6 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
149 } 149 }
150 if (!tipc_in_scope(dest, tipc_own_addr)) 150 if (!tipc_in_scope(dest, tipc_own_addr))
151 return; 151 return;
152 if (is_slave(tipc_own_addr) && is_slave(orig))
153 return;
154 if (is_slave(orig) && !in_own_cluster(orig))
155 return;
156 if (in_own_cluster(orig)) { 152 if (in_own_cluster(orig)) {
157 /* Always accept link here */ 153 /* Always accept link here */
158 struct sk_buff *rbuf; 154 struct sk_buff *rbuf;
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index aee53864d7a0..c1b6217838e6 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -850,7 +850,7 @@ static inline void msg_set_dataoctet(struct tipc_msg *m, u32 pos)
850 * Routing table message types 850 * Routing table message types
851 */ 851 */
852#define EXT_ROUTING_TABLE 0 852#define EXT_ROUTING_TABLE 0
853#define LOCAL_ROUTING_TABLE 1 853#define LOCAL_ROUTING_TABLE 1 /* obsoleted */
854#define SLAVE_ROUTING_TABLE 2 854#define SLAVE_ROUTING_TABLE 2
855#define ROUTE_ADDITION 3 855#define ROUTE_ADDITION 3
856#define ROUTE_REMOVAL 4 856#define ROUTE_REMOVAL 4
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) {
diff --git a/net/tipc/port.c b/net/tipc/port.c
index 7873283f4965..c033cb87b964 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -1110,10 +1110,7 @@ int tipc_connect2port(u32 ref, struct tipc_portid const *peer)
1110 msg_set_origport(msg, p_ptr->publ.ref); 1110 msg_set_origport(msg, p_ptr->publ.ref);
1111 msg_set_transp_seqno(msg, 42); 1111 msg_set_transp_seqno(msg, 42);
1112 msg_set_type(msg, TIPC_CONN_MSG); 1112 msg_set_type(msg, TIPC_CONN_MSG);
1113 if (!may_route(peer->node)) 1113 msg_set_hdr_sz(msg, SHORT_H_SIZE);
1114 msg_set_hdr_sz(msg, SHORT_H_SIZE);
1115 else
1116 msg_set_hdr_sz(msg, LONG_H_SIZE);
1117 1114
1118 p_ptr->probing_interval = PROBING_INTERVAL; 1115 p_ptr->probing_interval = PROBING_INTERVAL;
1119 p_ptr->probing_state = CONFIRMED; 1116 p_ptr->probing_state = CONFIRMED;