Example #1
0
/*
	This function fills chassislist structure with all nodes
	in that chassis
	chassislist structure = structure of one standalone chassis
*/
static void build_chassis(Node *node, ChassisList *chassislist)
{
	Node *remnode = 0;
	Port *port = 0;

	/* we get here with node = chassis_spine */
	chassislist->chassistype = node->chrecord->chassistype;
	insert_spine(node, chassislist);

	/* loop: pass on all ports of node */
	for (port = node->ports; port; port = port->next) {
		if (!port->remoteport)
			continue;
		remnode = port->remoteport->node;

		if (!remnode->chrecord)
			continue; /* some error - line or router not initialized ? FIXME */

		insert_line_router(remnode, chassislist);
	}

	pass_on_lines_catch_spines(chassislist);
	/* this pass needed for to catch routers, since routers connected only */
	/* to spines in slot 1 or 4 and we could miss them first time */
	pass_on_spines_catch_lines(chassislist);

	/* additional 2 passes needed for to overcome a problem of pure "in-chassis" */
	/* connectivity - extra pass to ensure that all related chips/modules */
	/* inserted into the chassislist */
	pass_on_lines_catch_spines(chassislist);
	pass_on_spines_catch_lines(chassislist);
	pass_on_spines_interpolate_chguid(chassislist);
}
Example #2
0
static void pass_on_lines_catch_spines(ChassisList *chassislist)
{
	Node *node, *remnode;
	Port *port;
	int i;

	for (i = 1; i <= LINES_MAX_NUM; i++) {
		node = chassislist->linenode[i];

		if (!(node && is_line(node)))
			continue;	/* empty slot or router */

		for (port = node->ports; port; port = port->next) {
			if (port->portnum > 12)
				continue;

			if (!port->remoteport)
				continue;
			remnode = port->remoteport->node;

			if (!remnode->chrecord)
				continue;	/* some error - spine not initialized ? FIXME */
			insert_spine(remnode, chassislist);
		}
	}
}
Example #3
0
/*
	This function fills chassis structure with all nodes
	in that chassis
	chassis structure = structure of one standalone chassis
*/
static int build_chassis(ibnd_node_t * node, ibnd_chassis_t * chassis)
{
	int p = 0;
	ibnd_node_t *remnode = 0;
	ibnd_port_t *port = 0;

	/* we get here with node = chassis_spine */
	if (insert_spine(node, chassis))
		return -1;

	/* loop: pass on all ports of node */
	for (p = 1; p <= node->numports; p++) {

		port = node->ports[p];
		if (!port || !port->remoteport)
			continue;

		/*
		 * ISR4700 double density fabric board ports 19-36 are
		 * chassis external ports, so skip them
		 */
		if (is_spine_4700x2(node) && (port->portnum > 18))
			continue;

		remnode = port->remoteport->node;

		if (!remnode->ch_found)
			continue;	/* some error - line or router not initialized ? FIXME */

		insert_line_router(remnode, chassis);
	}

	if (pass_on_lines_catch_spines(chassis))
		return -1;
	/* this pass needed for to catch routers, since routers connected only */
	/* to spines in slot 1 or 4 and we could miss them first time */
	if (pass_on_spines_catch_lines(chassis))
		return -1;

	/* additional 2 passes needed for to overcome a problem of pure "in-chassis" */
	/* connectivity - extra pass to ensure that all related chips/modules */
	/* inserted into the chassis */
	if (pass_on_lines_catch_spines(chassis))
		return -1;
	if (pass_on_spines_catch_lines(chassis))
		return -1;
	pass_on_spines_interpolate_chguid(chassis);

	return 0;
}
Example #4
0
static int pass_on_lines_catch_spines(ibnd_chassis_t * chassis)
{
	ibnd_node_t *node, *remnode;
	ibnd_port_t *port;
	int i, p;

	for (i = 1; i <= LINES_MAX_NUM; i++) {
		int is_4700_line;

		node = chassis->linenode[i];

		if (!(node && is_line(node)))
			continue;	/* empty slot or router */

		is_4700_line = is_line_4700(node);

		for (p = 1; p <= node->numports; p++) {

			port = node->ports[p];
			if (!port || !port->remoteport)
				continue;

			if ((is_4700_line && (port->portnum > 18)) ||
			    (!is_4700_line && (port->portnum > 12)))
				continue;

			remnode = port->remoteport->node;

			if (!remnode->ch_found)
				continue;	/* some error - spine not initialized ? FIXME */
			if (insert_spine(remnode, chassis))
				return -1;
		}
	}
	return 0;
}