aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2012-08-16 08:09:13 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-20 05:26:31 -0400
commit34f256cc7962a44537a0d33877cd93c89873098e (patch)
treeceb48aa806a99439d345b37ecbc3159b1ddcf385 /net/tipc
parent61cdd4d80b29cfdee45920238eea2d1fbb51f922 (diff)
tipc: eliminate configuration for maximum number of name subscriptions
Gets rid of the need for users to specify the maximum number of name subscriptions supported by TIPC. TIPC now automatically provides support for the maximum number of name subscriptions to 65535. Signed-off-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.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/config.c25
-rw-r--r--net/tipc/core.c2
-rw-r--r--net/tipc/core.h4
-rw-r--r--net/tipc/subscr.c4
4 files changed, 7 insertions, 28 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c
index a056a3852f71..7a1275863c8a 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -2,7 +2,7 @@
2 * net/tipc/config.c: TIPC configuration management code 2 * net/tipc/config.c: TIPC configuration management code
3 * 3 *
4 * Copyright (c) 2002-2006, Ericsson AB 4 * Copyright (c) 2002-2006, Ericsson AB
5 * Copyright (c) 2004-2007, 2010-2011, Wind River Systems 5 * Copyright (c) 2004-2007, 2010-2012, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -223,21 +223,6 @@ static struct sk_buff *cfg_set_max_publications(void)
223 return tipc_cfg_reply_none(); 223 return tipc_cfg_reply_none();
224} 224}
225 225
226static struct sk_buff *cfg_set_max_subscriptions(void)
227{
228 u32 value;
229
230 if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
231 return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
232
233 value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
234 if (value < 1 || value > 65535)
235 return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
236 " (max subscriptions must be 1-65535");
237 tipc_max_subscriptions = value;
238 return tipc_cfg_reply_none();
239}
240
241static struct sk_buff *cfg_set_max_ports(void) 226static struct sk_buff *cfg_set_max_ports(void)
242{ 227{
243 u32 value; 228 u32 value;
@@ -360,9 +345,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
360 case TIPC_CMD_SET_MAX_PUBL: 345 case TIPC_CMD_SET_MAX_PUBL:
361 rep_tlv_buf = cfg_set_max_publications(); 346 rep_tlv_buf = cfg_set_max_publications();
362 break; 347 break;
363 case TIPC_CMD_SET_MAX_SUBSCR:
364 rep_tlv_buf = cfg_set_max_subscriptions();
365 break;
366 case TIPC_CMD_SET_NETID: 348 case TIPC_CMD_SET_NETID:
367 rep_tlv_buf = cfg_set_netid(); 349 rep_tlv_buf = cfg_set_netid();
368 break; 350 break;
@@ -375,9 +357,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
375 case TIPC_CMD_GET_MAX_PUBL: 357 case TIPC_CMD_GET_MAX_PUBL:
376 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_publications); 358 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_publications);
377 break; 359 break;
378 case TIPC_CMD_GET_MAX_SUBSCR:
379 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions);
380 break;
381 case TIPC_CMD_GET_NETID: 360 case TIPC_CMD_GET_NETID:
382 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id); 361 rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id);
383 break; 362 break;
@@ -393,6 +372,8 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
393 case TIPC_CMD_GET_MAX_CLUSTERS: 372 case TIPC_CMD_GET_MAX_CLUSTERS:
394 case TIPC_CMD_SET_MAX_NODES: 373 case TIPC_CMD_SET_MAX_NODES:
395 case TIPC_CMD_GET_MAX_NODES: 374 case TIPC_CMD_GET_MAX_NODES:
375 case TIPC_CMD_SET_MAX_SUBSCR:
376 case TIPC_CMD_GET_MAX_SUBSCR:
396 case TIPC_CMD_SET_LOG_SIZE: 377 case TIPC_CMD_SET_LOG_SIZE:
397 case TIPC_CMD_DUMP_LOG: 378 case TIPC_CMD_DUMP_LOG:
398 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 379 rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
diff --git a/net/tipc/core.c b/net/tipc/core.c
index b858f2003523..73e5eac20735 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -53,7 +53,6 @@ int tipc_random __read_mostly;
53/* configurable TIPC parameters */ 53/* configurable TIPC parameters */
54u32 tipc_own_addr __read_mostly; 54u32 tipc_own_addr __read_mostly;
55int tipc_max_ports __read_mostly; 55int tipc_max_ports __read_mostly;
56int tipc_max_subscriptions;
57int tipc_max_publications; 56int tipc_max_publications;
58int tipc_net_id __read_mostly; 57int tipc_net_id __read_mostly;
59int tipc_remote_management __read_mostly; 58int tipc_remote_management __read_mostly;
@@ -157,7 +156,6 @@ static int __init tipc_init(void)
157 tipc_own_addr = 0; 156 tipc_own_addr = 0;
158 tipc_remote_management = 1; 157 tipc_remote_management = 1;
159 tipc_max_publications = 10000; 158 tipc_max_publications = 10000;
160 tipc_max_subscriptions = 2000;
161 tipc_max_ports = CONFIG_TIPC_PORTS; 159 tipc_max_ports = CONFIG_TIPC_PORTS;
162 tipc_net_id = 4711; 160 tipc_net_id = 4711;
163 161
diff --git a/net/tipc/core.h b/net/tipc/core.h
index 4c5705ac8a5a..ef01412b0989 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -60,7 +60,8 @@
60 60
61#define TIPC_MOD_VER "2.0.0" 61#define TIPC_MOD_VER "2.0.0"
62 62
63#define ULTRA_STRING_MAX_LEN 32768 63#define ULTRA_STRING_MAX_LEN 32768
64#define TIPC_MAX_SUBSCRIPTIONS 65535
64 65
65struct tipc_msg; /* msg.h */ 66struct tipc_msg; /* msg.h */
66 67
@@ -76,7 +77,6 @@ int tipc_snprintf(char *buf, int len, const char *fmt, ...);
76 */ 77 */
77extern u32 tipc_own_addr __read_mostly; 78extern u32 tipc_own_addr __read_mostly;
78extern int tipc_max_ports __read_mostly; 79extern int tipc_max_ports __read_mostly;
79extern int tipc_max_subscriptions;
80extern int tipc_max_publications; 80extern int tipc_max_publications;
81extern int tipc_net_id __read_mostly; 81extern int tipc_net_id __read_mostly;
82extern int tipc_remote_management __read_mostly; 82extern int tipc_remote_management __read_mostly;
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 5ed5965eb0be..0f7d0d007e22 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -304,9 +304,9 @@ static struct tipc_subscription *subscr_subscribe(struct tipc_subscr *s,
304 } 304 }
305 305
306 /* Refuse subscription if global limit exceeded */ 306 /* Refuse subscription if global limit exceeded */
307 if (atomic_read(&topsrv.subscription_count) >= tipc_max_subscriptions) { 307 if (atomic_read(&topsrv.subscription_count) >= TIPC_MAX_SUBSCRIPTIONS) {
308 pr_warn("Subscription rejected, limit reached (%u)\n", 308 pr_warn("Subscription rejected, limit reached (%u)\n",
309 tipc_max_subscriptions); 309 TIPC_MAX_SUBSCRIPTIONS);
310 subscr_terminate(subscriber); 310 subscr_terminate(subscriber);
311 return NULL; 311 return NULL;
312 } 312 }