Skip to content

Commit 27b61ae

Browse files
committed
Merge branch 'tipc-Mar13-2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/net-next-2.6
2 parents 46af318 + 633d2bd commit 27b61ae

23 files changed

Lines changed: 278 additions & 394 deletions

‎MAINTAINERS‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6083,13 +6083,11 @@ F: sound/soc/codecs/twl4030*
60836083
TIPC NETWORK LAYER
60846084
M: Jon Maloy <jon.maloy@ericsson.com>
60856085
M: Allan Stephens <allan.stephens@windriver.com>
6086-
L: tipc-discussion@lists.sourceforge.net
6086+
L: netdev@vger.kernel.org (core kernel code)
6087+
L: tipc-discussion@lists.sourceforge.net (user apps, general discussion)
60876088
W: http://tipc.sourceforge.net/
6088-
W: http://tipc.cslab.ericsson.net/
6089-
T: git git://tipc.cslab.ericsson.net/pub/git/tipc.git
60906089
S: Maintained
60916090
F: include/linux/tipc*.h
6092-
F: include/net/tipc/
60936091
F: net/tipc/
60946092

60956093
TILE ARCHITECTURE

‎include/linux/tipc_config.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
#define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */
9090
#define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */
9191
#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */
92-
#define TIPC_CMD_GET_MAX_NODES 0x4009 /* tx none, rx unsigned */
92+
#define TIPC_CMD_GET_MAX_NODES 0x4009 /* obsoleted */
9393
#define TIPC_CMD_GET_MAX_SLAVES 0x400A /* obsoleted */
9494
#define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */
9595

@@ -115,7 +115,7 @@
115115
#define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */
116116
#define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */
117117
#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */
118-
#define TIPC_CMD_SET_MAX_NODES 0x8009 /* tx unsigned, rx none */
118+
#define TIPC_CMD_SET_MAX_NODES 0x8009 /* obsoleted */
119119
#define TIPC_CMD_SET_MAX_SLAVES 0x800A /* obsoleted */
120120
#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */
121121

@@ -202,7 +202,7 @@ struct tipc_link_info {
202202

203203
struct tipc_bearer_config {
204204
__be32 priority; /* Range [1,31]. Override per link */
205-
__be32 detect_scope;
205+
__be32 disc_domain; /* <Z.C.N> describing desired nodes */
206206
char name[TIPC_MAX_BEARER_NAME];
207207
};
208208

‎net/tipc/Kconfig‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@ config TIPC_ADVANCED
2929
Saying Y here will open some advanced configuration for TIPC.
3030
Most users do not need to bother; if unsure, just say N.
3131

32-
config TIPC_NODES
33-
int "Maximum number of nodes in a cluster"
34-
depends on TIPC_ADVANCED
35-
range 8 2047
36-
default "255"
37-
help
38-
Specifies how many nodes can be supported in a TIPC cluster.
39-
Can range from 8 to 2047 nodes; default is 255.
40-
41-
Setting this to a smaller value saves some memory;
42-
setting it to higher allows for more nodes.
43-
4432
config TIPC_PORTS
4533
int "Maximum number of ports in a node"
4634
depends on TIPC_ADVANCED

‎net/tipc/addr.c‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* net/tipc/addr.c: TIPC address utility routines
33
*
44
* Copyright (c) 2000-2006, Ericsson AB
5-
* Copyright (c) 2004-2005, Wind River Systems
5+
* Copyright (c) 2004-2005, 2010-2011, Wind River Systems
66
* All rights reserved.
77
*
88
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
4141
* tipc_addr_domain_valid - validates a network domain address
4242
*
4343
* Accepts <Z.C.N>, <Z.C.0>, <Z.0.0>, and <0.0.0>,
44-
* where Z, C, and N are non-zero and do not exceed the configured limits.
44+
* where Z, C, and N are non-zero.
4545
*
4646
* Returns 1 if domain address is valid, otherwise 0
4747
*/
@@ -51,10 +51,6 @@ int tipc_addr_domain_valid(u32 addr)
5151
u32 n = tipc_node(addr);
5252
u32 c = tipc_cluster(addr);
5353
u32 z = tipc_zone(addr);
54-
u32 max_nodes = tipc_max_nodes;
55-
56-
if (n > max_nodes)
57-
return 0;
5854

5955
if (n && (!z || !c))
6056
return 0;
@@ -66,8 +62,7 @@ int tipc_addr_domain_valid(u32 addr)
6662
/**
6763
* tipc_addr_node_valid - validates a proposed network address for this node
6864
*
69-
* Accepts <Z.C.N>, where Z, C, and N are non-zero and do not exceed
70-
* the configured limits.
65+
* Accepts <Z.C.N>, where Z, C, and N are non-zero.
7166
*
7267
* Returns 1 if address can be used, otherwise 0
7368
*/
@@ -81,9 +76,9 @@ int tipc_in_scope(u32 domain, u32 addr)
8176
{
8277
if (!domain || (domain == addr))
8378
return 1;
84-
if (domain == (addr & 0xfffff000u)) /* domain <Z.C.0> */
79+
if (domain == tipc_cluster_mask(addr)) /* domain <Z.C.0> */
8580
return 1;
86-
if (domain == (addr & 0xff000000u)) /* domain <Z.0.0> */
81+
if (domain == tipc_zone_mask(addr)) /* domain <Z.0.0> */
8782
return 1;
8883
return 0;
8984
}

‎net/tipc/addr.h‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737
#ifndef _TIPC_ADDR_H
3838
#define _TIPC_ADDR_H
3939

40+
static inline u32 tipc_zone_mask(u32 addr)
41+
{
42+
return addr & 0xff000000u;
43+
}
44+
45+
static inline u32 tipc_cluster_mask(u32 addr)
46+
{
47+
return addr & 0xfffff000u;
48+
}
49+
4050
static inline int in_own_cluster(u32 addr)
4151
{
4252
return !((addr ^ tipc_own_addr) >> 12);
@@ -49,14 +59,13 @@ static inline int in_own_cluster(u32 addr)
4959
* after a network hop.
5060
*/
5161

52-
static inline int addr_domain(int sc)
62+
static inline u32 addr_domain(u32 sc)
5363
{
5464
if (likely(sc == TIPC_NODE_SCOPE))
5565
return tipc_own_addr;
5666
if (sc == TIPC_CLUSTER_SCOPE)
57-
return tipc_addr(tipc_zone(tipc_own_addr),
58-
tipc_cluster(tipc_own_addr), 0);
59-
return tipc_addr(tipc_zone(tipc_own_addr), 0, 0);
67+
return tipc_cluster_mask(tipc_own_addr);
68+
return tipc_zone_mask(tipc_own_addr);
6069
}
6170

6271
int tipc_addr_domain_valid(u32);

‎net/tipc/bearer.c‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ int tipc_register_media(u32 media_type,
158158
m_ptr->disable_bearer = disable;
159159
m_ptr->addr2str = addr2str;
160160
memcpy(&m_ptr->bcast_addr, bcast_addr, sizeof(*bcast_addr));
161-
m_ptr->bcast = 1;
162161
strcpy(m_ptr->name, name);
163162
m_ptr->priority = bearer_priority;
164163
m_ptr->tolerance = link_tolerance;
@@ -474,7 +473,7 @@ int tipc_bearer_congested(struct tipc_bearer *b_ptr, struct link *l_ptr)
474473
* tipc_enable_bearer - enable bearer with the given name
475474
*/
476475

477-
int tipc_enable_bearer(const char *name, u32 bcast_scope, u32 priority)
476+
int tipc_enable_bearer(const char *name, u32 disc_domain, u32 priority)
478477
{
479478
struct tipc_bearer *b_ptr;
480479
struct media *m_ptr;
@@ -494,9 +493,9 @@ int tipc_enable_bearer(const char *name, u32 bcast_scope, u32 priority)
494493
warn("Bearer <%s> rejected, illegal name\n", name);
495494
return -EINVAL;
496495
}
497-
if (!tipc_addr_domain_valid(bcast_scope) ||
498-
!tipc_in_scope(bcast_scope, tipc_own_addr)) {
499-
warn("Bearer <%s> rejected, illegal broadcast scope\n", name);
496+
if (!tipc_addr_domain_valid(disc_domain) ||
497+
!tipc_in_scope(disc_domain, tipc_own_addr)) {
498+
warn("Bearer <%s> rejected, illegal discovery domain\n", name);
500499
return -EINVAL;
501500
}
502501
if ((priority < TIPC_MIN_LINK_PRI ||
@@ -560,18 +559,15 @@ int tipc_enable_bearer(const char *name, u32 bcast_scope, u32 priority)
560559
b_ptr->media = m_ptr;
561560
b_ptr->net_plane = bearer_id + 'A';
562561
b_ptr->active = 1;
563-
b_ptr->detect_scope = bcast_scope;
564562
b_ptr->priority = priority;
565563
INIT_LIST_HEAD(&b_ptr->cong_links);
566564
INIT_LIST_HEAD(&b_ptr->links);
567-
if (m_ptr->bcast) {
568-
b_ptr->link_req = tipc_disc_init_link_req(b_ptr, &m_ptr->bcast_addr,
569-
bcast_scope);
570-
}
565+
b_ptr->link_req = tipc_disc_init_link_req(b_ptr, &m_ptr->bcast_addr,
566+
disc_domain);
571567
spin_lock_init(&b_ptr->lock);
572568
write_unlock_bh(&tipc_net_lock);
573569
info("Enabled bearer <%s>, discovery domain %s, priority %u\n",
574-
name, tipc_addr_string_fill(addr_string, bcast_scope), priority);
570+
name, tipc_addr_string_fill(addr_string, disc_domain), priority);
575571
return 0;
576572
failed:
577573
write_unlock_bh(&tipc_net_lock);

‎net/tipc/bearer.h‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ struct tipc_bearer;
7070
* @disable_bearer: routine which disables a bearer
7171
* @addr2str: routine which converts bearer's address to string form
7272
* @bcast_addr: media address used in broadcasting
73-
* @bcast: non-zero if media supports broadcasting [currently mandatory]
7473
* @priority: default link (and bearer) priority
7574
* @tolerance: default time (in ms) before declaring link failure
7675
* @window: default window (in packets) before declaring link congestion
@@ -87,7 +86,6 @@ struct media {
8786
char *(*addr2str)(struct tipc_media_addr *a,
8887
char *str_buf, int str_size);
8988
struct tipc_media_addr bcast_addr;
90-
int bcast;
9189
u32 priority;
9290
u32 tolerance;
9391
u32 window;
@@ -105,7 +103,6 @@ struct media {
105103
* @name: bearer name (format = media:interface)
106104
* @media: ptr to media structure associated with bearer
107105
* @priority: default link priority for bearer
108-
* @detect_scope: network address mask used during automatic link creation
109106
* @identity: array index of this bearer within TIPC bearer array
110107
* @link_req: ptr to (optional) structure making periodic link setup requests
111108
* @links: list of non-congested links associated with bearer
@@ -128,7 +125,6 @@ struct tipc_bearer {
128125
spinlock_t lock;
129126
struct media *media;
130127
u32 priority;
131-
u32 detect_scope;
132128
u32 identity;
133129
struct link_req *link_req;
134130
struct list_head links;
@@ -167,7 +163,7 @@ void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr);
167163
int tipc_block_bearer(const char *name);
168164
void tipc_continue(struct tipc_bearer *tb_ptr);
169165

170-
int tipc_enable_bearer(const char *bearer_name, u32 bcast_scope, u32 priority);
166+
int tipc_enable_bearer(const char *bearer_name, u32 disc_domain, u32 priority);
171167
int tipc_disable_bearer(const char *name);
172168

173169
/*

‎net/tipc/config.c‎

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* net/tipc/config.c: TIPC configuration management code
33
*
44
* Copyright (c) 2002-2006, Ericsson AB
5-
* Copyright (c) 2004-2007, Wind River Systems
5+
* Copyright (c) 2004-2007, 2010-2011, Wind River Systems
66
* All rights reserved.
77
*
88
* Redistribution and use in source and binary forms, with or without
@@ -148,7 +148,7 @@ static struct sk_buff *cfg_enable_bearer(void)
148148

149149
args = (struct tipc_bearer_config *)TLV_DATA(req_tlv_area);
150150
if (tipc_enable_bearer(args->name,
151-
ntohl(args->detect_scope),
151+
ntohl(args->disc_domain),
152152
ntohl(args->priority)))
153153
return tipc_cfg_reply_error_string("unable to enable bearer");
154154

@@ -260,25 +260,6 @@ static struct sk_buff *cfg_set_max_ports(void)
260260
return tipc_cfg_reply_none();
261261
}
262262

263-
static struct sk_buff *cfg_set_max_nodes(void)
264-
{
265-
u32 value;
266-
267-
if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
268-
return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
269-
value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
270-
if (value == tipc_max_nodes)
271-
return tipc_cfg_reply_none();
272-
if (value != delimit(value, 8, 2047))
273-
return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
274-
" (max nodes must be 8-2047)");
275-
if (tipc_mode == TIPC_NET_MODE)
276-
return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
277-
" (cannot change max nodes once TIPC has joined a network)");
278-
tipc_max_nodes = value;
279-
return tipc_cfg_reply_none();
280-
}
281-
282263
static struct sk_buff *cfg_set_netid(void)
283264
{
284265
u32 value;
@@ -397,9 +378,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
397378
case TIPC_CMD_SET_MAX_SUBSCR:
398379
rep_tlv_buf = cfg_set_max_subscriptions();
399380
break;
400-
case TIPC_CMD_SET_MAX_NODES:
401-
rep_tlv_buf = cfg_set_max_nodes();
402-
break;
403381
case TIPC_CMD_SET_NETID:
404382
rep_tlv_buf = cfg_set_netid();
405383
break;
@@ -415,9 +393,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
415393
case TIPC_CMD_GET_MAX_SUBSCR:
416394
rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions);
417395
break;
418-
case TIPC_CMD_GET_MAX_NODES:
419-
rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_nodes);
420-
break;
421396
case TIPC_CMD_GET_NETID:
422397
rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id);
423398
break;
@@ -431,6 +406,8 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
431406
case TIPC_CMD_GET_MAX_SLAVES:
432407
case TIPC_CMD_SET_MAX_CLUSTERS:
433408
case TIPC_CMD_GET_MAX_CLUSTERS:
409+
case TIPC_CMD_SET_MAX_NODES:
410+
case TIPC_CMD_GET_MAX_NODES:
434411
rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
435412
" (obsolete command)");
436413
break;

‎net/tipc/core.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@
4141
#include "config.h"
4242

4343

44-
#ifndef CONFIG_TIPC_NODES
45-
#define CONFIG_TIPC_NODES 255
46-
#endif
47-
4844
#ifndef CONFIG_TIPC_PORTS
4945
#define CONFIG_TIPC_PORTS 8191
5046
#endif
@@ -64,7 +60,6 @@ const char tipc_alphabet[] =
6460
/* configurable TIPC parameters */
6561

6662
u32 tipc_own_addr;
67-
int tipc_max_nodes;
6863
int tipc_max_ports;
6964
int tipc_max_subscriptions;
7065
int tipc_max_publications;
@@ -192,7 +187,6 @@ static int __init tipc_init(void)
192187
tipc_max_publications = 10000;
193188
tipc_max_subscriptions = 2000;
194189
tipc_max_ports = CONFIG_TIPC_PORTS;
195-
tipc_max_nodes = CONFIG_TIPC_NODES;
196190
tipc_net_id = 4711;
197191

198192
res = tipc_core_start();

‎net/tipc/core.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ void tipc_msg_dbg(struct print_buf *, struct tipc_msg *, const char *);
147147
*/
148148

149149
extern u32 tipc_own_addr;
150-
extern int tipc_max_nodes;
151150
extern int tipc_max_ports;
152151
extern int tipc_max_subscriptions;
153152
extern int tipc_max_publications;

0 commit comments

Comments
 (0)