Skip to content

Commit

Permalink
tipc: Remove prototype code for supporting multiple clusters
Browse files Browse the repository at this point in the history
Eliminates routines, data structures, and files that were intended
to allow TIPC to support a network containing multiple clusters.
Currently, TIPC supports only networks consisting of a single cluster
within a single zone, so this code is unnecessary.

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>
  • Loading branch information
Allan Stephens authored and David S. Miller committed Jan 1, 2011
1 parent 51a8e4d commit 8f92df6
Show file tree
Hide file tree
Showing 16 changed files with 83 additions and 289 deletions.
4 changes: 2 additions & 2 deletions include/linux/tipc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
#define TIPC_CMD_GET_MAX_PUBL 0x4005 /* tx none, rx unsigned */
#define TIPC_CMD_GET_MAX_SUBSCR 0x4006 /* tx none, rx unsigned */
#define TIPC_CMD_GET_MAX_ZONES 0x4007 /* obsoleted */
#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* tx none, rx unsigned */
#define TIPC_CMD_GET_MAX_CLUSTERS 0x4008 /* obsoleted */
#define TIPC_CMD_GET_MAX_NODES 0x4009 /* tx none, rx unsigned */
#define TIPC_CMD_GET_MAX_SLAVES 0x400A /* obsoleted */
#define TIPC_CMD_GET_NETID 0x400B /* tx none, rx unsigned */
Expand Down Expand Up @@ -131,7 +131,7 @@
#define TIPC_CMD_SET_MAX_PUBL 0x8005 /* tx unsigned, rx none */
#define TIPC_CMD_SET_MAX_SUBSCR 0x8006 /* tx unsigned, rx none */
#define TIPC_CMD_SET_MAX_ZONES 0x8007 /* obsoleted */
#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* tx unsigned, rx none */
#define TIPC_CMD_SET_MAX_CLUSTERS 0x8008 /* obsoleted */
#define TIPC_CMD_SET_MAX_NODES 0x8009 /* tx unsigned, rx none */
#define TIPC_CMD_SET_MAX_SLAVES 0x800A /* obsoleted */
#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */
Expand Down
10 changes: 0 additions & 10 deletions net/tipc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ config TIPC_ADVANCED
Saying Y here will open some advanced configuration for TIPC.
Most users do not need to bother; if unsure, just say N.

config TIPC_CLUSTERS
int "Maximum number of clusters in a zone"
depends on TIPC_ADVANCED
range 1 1
default "1"
help
Specifies how many clusters can be supported in a TIPC zone.

*** Currently TIPC only supports a single cluster per zone. ***

config TIPC_NODES
int "Maximum number of nodes in a cluster"
depends on TIPC_ADVANCED
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

obj-$(CONFIG_TIPC) := tipc.o

tipc-y += addr.o bcast.o bearer.o config.o cluster.o \
tipc-y += addr.o bcast.o bearer.o config.o \
core.o handler.o link.o discover.o msg.o \
name_distr.o subscr.o name_table.o net.o \
netlink.o node.o node_subscr.o port.o ref.o \
Expand Down
5 changes: 2 additions & 3 deletions net/tipc/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
*/

#include "core.h"
#include "cluster.h"
#include "node.h"
#include "addr.h"

/**
* tipc_addr_domain_valid - validates a network domain address
Expand All @@ -55,8 +56,6 @@ int tipc_addr_domain_valid(u32 addr)

if (n > max_nodes)
return 0;
if (c > tipc_max_clusters)
return 0;

if (n && (!z || !c))
return 0;
Expand Down
9 changes: 6 additions & 3 deletions net/tipc/bcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ static struct bclink *bclink = NULL;
static struct link *bcl = NULL;
static DEFINE_SPINLOCK(bc_lock);

/* broadcast-capable node map */
struct tipc_node_map tipc_bcast_nmap;

const char tipc_bclink_name[] = "broadcast-link";

static void tipc_nmap_diff(struct tipc_node_map *nm_a,
Expand Down Expand Up @@ -566,8 +569,8 @@ static int tipc_bcbearer_send(struct sk_buff *buf,
if (likely(!msg_non_seq(buf_msg(buf)))) {
struct tipc_msg *msg;

assert(tipc_cltr_bcast_nodes.count != 0);
bcbuf_set_acks(buf, tipc_cltr_bcast_nodes.count);
assert(tipc_bcast_nmap.count != 0);
bcbuf_set_acks(buf, tipc_bcast_nmap.count);
msg = buf_msg(buf);
msg_set_non_seq(msg, 1);
msg_set_mc_netid(msg, tipc_net_id);
Expand All @@ -576,7 +579,7 @@ static int tipc_bcbearer_send(struct sk_buff *buf,

/* Send buffer over bearers until all targets reached */

bcbearer->remains = tipc_cltr_bcast_nodes;
bcbearer->remains = tipc_bcast_nmap;

for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) {
struct bearer *p = bcbearer->bpairs[bp_index].primary;
Expand Down
1 change: 1 addition & 0 deletions net/tipc/bcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct tipc_node_map {
u32 map[MAX_NODES / WSIZE];
};

extern struct tipc_node_map tipc_bcast_nmap;

#define PLSIZE 32

Expand Down
135 changes: 0 additions & 135 deletions net/tipc/cluster.c

This file was deleted.

73 changes: 0 additions & 73 deletions net/tipc/cluster.h

This file was deleted.

21 changes: 2 additions & 19 deletions net/tipc/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,6 @@ static struct sk_buff *cfg_set_max_ports(void)
return tipc_cfg_reply_none();
}

static struct sk_buff *cfg_set_max_clusters(void)
{
u32 value;

if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
if (value != delimit(value, 1, 1))
return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
" (max clusters fixed at 1)");
return tipc_cfg_reply_none();
}

static struct sk_buff *cfg_set_max_nodes(void)
{
u32 value;
Expand Down Expand Up @@ -420,9 +407,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
case TIPC_CMD_SET_MAX_SUBSCR:
rep_tlv_buf = cfg_set_max_subscriptions();
break;
case TIPC_CMD_SET_MAX_CLUSTERS:
rep_tlv_buf = cfg_set_max_clusters();
break;
case TIPC_CMD_SET_MAX_NODES:
rep_tlv_buf = cfg_set_max_nodes();
break;
Expand All @@ -441,9 +425,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
case TIPC_CMD_GET_MAX_SUBSCR:
rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions);
break;
case TIPC_CMD_GET_MAX_CLUSTERS:
rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_clusters);
break;
case TIPC_CMD_GET_MAX_NODES:
rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_nodes);
break;
Expand All @@ -458,6 +439,8 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
case TIPC_CMD_GET_MAX_ZONES:
case TIPC_CMD_SET_MAX_SLAVES:
case TIPC_CMD_GET_MAX_SLAVES:
case TIPC_CMD_SET_MAX_CLUSTERS:
case TIPC_CMD_GET_MAX_CLUSTERS:
rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
" (obsolete command)");
break;
Expand Down
6 changes: 0 additions & 6 deletions net/tipc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
#include "config.h"


#ifndef CONFIG_TIPC_CLUSTERS
#define CONFIG_TIPC_CLUSTERS 1
#endif

#ifndef CONFIG_TIPC_NODES
#define CONFIG_TIPC_NODES 255
#endif
Expand All @@ -76,7 +72,6 @@ const char tipc_alphabet[] =
/* configurable TIPC parameters */

u32 tipc_own_addr;
int tipc_max_clusters;
int tipc_max_nodes;
int tipc_max_ports;
int tipc_max_subscriptions;
Expand Down Expand Up @@ -199,7 +194,6 @@ static int __init tipc_init(void)
tipc_max_publications = 10000;
tipc_max_subscriptions = 2000;
tipc_max_ports = CONFIG_TIPC_PORTS;
tipc_max_clusters = CONFIG_TIPC_CLUSTERS;
tipc_max_nodes = CONFIG_TIPC_NODES;
tipc_net_id = 4711;

Expand Down
1 change: 0 additions & 1 deletion net/tipc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ void tipc_dump_dbg(struct print_buf *, const char *fmt, ...);
*/

extern u32 tipc_own_addr;
extern int tipc_max_clusters;
extern int tipc_max_nodes;
extern int tipc_max_ports;
extern int tipc_max_subscriptions;
Expand Down
Loading

0 comments on commit 8f92df6

Please sign in to comment.