netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] tipc: use kconfig to limit numeric ranges
@ 2009-12-25  3:26 Amerigo Wang
  2009-12-25  3:50 ` Valdis.Kletnieks
  0 siblings, 1 reply; 3+ messages in thread
From: Amerigo Wang @ 2009-12-25  3:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: David S. Miller, Allan Stephens, netdev, Per Liden,
	tipc-discussion, Amerigo Wang, akpm, Jon Maloy

We can rely on kconfig to limit these numbers,
no need to limit them at compile time/run time.

Users who modify these numbers manually should
be responsible for themself. :)

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Per Liden <per.liden@ericsson.com>
Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Allan Stephens <allan.stephens@windriver.com>
Cc: David S. Miller <davem@davemloft.net>

---
diff --git a/net/tipc/Kconfig b/net/tipc/Kconfig
index 3b30d11..dafbd53 100644
--- a/net/tipc/Kconfig
+++ b/net/tipc/Kconfig
@@ -33,6 +33,7 @@ config TIPC_ADVANCED
 config TIPC_ZONES
 	int "Maximum number of zones in network"
 	depends on TIPC_ADVANCED
+	range 1 255
 	default "3"
 	help
 	 Max number of zones inside TIPC network. Max supported value 
@@ -44,10 +45,10 @@ config TIPC_ZONES
 config TIPC_CLUSTERS
 	int "Maximum number of clusters in a zone"
 	depends on TIPC_ADVANCED
+	range 1 1
 	default "1"
 	help
-          ***Only 1 (one cluster in a zone) is supported by current code.
-          Any value set here will be overridden.***
+          ***Only 1 (one cluster in a zone) is supported by current code.***
 
           (Max number of clusters inside TIPC zone. Max supported 
           value is 4095 clusters, minimum is 1.
@@ -59,6 +60,7 @@ config TIPC_CLUSTERS
 config TIPC_NODES
 	int "Maximum number of nodes in cluster"
 	depends on TIPC_ADVANCED
+	range 8 2047
 	default "255"
 	help
 	  Maximum number of nodes inside a TIPC cluster. Maximum 
@@ -70,6 +72,7 @@ config TIPC_NODES
 config TIPC_SLAVE_NODES
 	int "Maximum number of slave nodes in cluster"
 	depends on TIPC_ADVANCED
+	range 0 2047
 	default "0"
 	help
           ***This capability is not supported by current code.***
@@ -83,6 +86,7 @@ config TIPC_SLAVE_NODES
 config TIPC_PORTS
 	int "Maximum number of ports in a node"
 	depends on TIPC_ADVANCED
+	range 217 65536
 	default "8191"
 	help
 	  Maximum number of ports within a node. Maximum 
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 3256bd7..52c571f 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -189,11 +189,11 @@ static int __init tipc_init(void)
 	tipc_remote_management = 1;
 	tipc_max_publications = 10000;
 	tipc_max_subscriptions = 2000;
-	tipc_max_ports = delimit(CONFIG_TIPC_PORTS, 127, 65536);
-	tipc_max_zones = delimit(CONFIG_TIPC_ZONES, 1, 255);
-	tipc_max_clusters = delimit(CONFIG_TIPC_CLUSTERS, 1, 1);
-	tipc_max_nodes = delimit(CONFIG_TIPC_NODES, 8, 2047);
-	tipc_max_slaves = delimit(CONFIG_TIPC_SLAVE_NODES, 0, 2047);
+	tipc_max_ports = CONFIG_TIPC_PORTS;
+	tipc_max_zones = CONFIG_TIPC_ZONES;
+	tipc_max_clusters = CONFIG_TIPC_CLUSTERS;
+	tipc_max_nodes = CONFIG_TIPC_NODES;
+	tipc_max_slaves = CONFIG_TIPC_SLAVE_NODES;
 	tipc_net_id = 4711;
 
 	if ((res = tipc_core_start()))

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] tipc: use kconfig to limit numeric ranges
  2009-12-25  3:26 [Patch] tipc: use kconfig to limit numeric ranges Amerigo Wang
@ 2009-12-25  3:50 ` Valdis.Kletnieks
  2009-12-25  4:36   ` Cong Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Valdis.Kletnieks @ 2009-12-25  3:50 UTC (permalink / raw)
  To: Amerigo Wang
  Cc: linux-kernel, David S. Miller, Allan Stephens, netdev, Per Liden,
	tipc-discussion, akpm, Jon Maloy

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

On Thu, 24 Dec 2009 22:26:48 EST, Amerigo Wang said:
> We can rely on kconfig to limit these numbers,
> no need to limit them at compile time/run time.

> +          ***Only 1 (one cluster in a zone) is supported by current code.***
>  
>            (Max number of clusters inside TIPC zone. Max supported 
>            value is 4095 clusters, minimum is 1.

Given the limit of 1, maybe the reference to 4095 should be nuked?


[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] tipc: use kconfig to limit numeric ranges
  2009-12-25  3:50 ` Valdis.Kletnieks
@ 2009-12-25  4:36   ` Cong Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Cong Wang @ 2009-12-25  4:36 UTC (permalink / raw)
  To: Valdis.Kletnieks
  Cc: linux-kernel, David S. Miller, Allan Stephens, netdev, Per Liden,
	tipc-discussion, akpm, Jon Maloy

Valdis.Kletnieks@vt.edu wrote:
> On Thu, 24 Dec 2009 22:26:48 EST, Amerigo Wang said:
>> We can rely on kconfig to limit these numbers,
>> no need to limit them at compile time/run time.
> 
>> +          ***Only 1 (one cluster in a zone) is supported by current code.***
>>  
>>            (Max number of clusters inside TIPC zone. Max supported 
>>            value is 4095 clusters, minimum is 1.
> 
> Given the limit of 1, maybe the reference to 4095 should be nuked?
> 

I am not sure, I think the limit of 1 is a temporary choice currently.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-25  4:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-25  3:26 [Patch] tipc: use kconfig to limit numeric ranges Amerigo Wang
2009-12-25  3:50 ` Valdis.Kletnieks
2009-12-25  4:36   ` Cong Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).