wrsm_nc_impl.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _WRSM_NC_IMPL_H
#define _WRSM_NC_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* this file is included by modules that are part of the NC
*/
#include <sys/wrsm_common.h>
#include <sys/wrsm_config.h>
#include <sys/wrsm_plat.h>
#ifdef __cplusplus
extern "C" {
#endif
#define WRSM_INID2DNID_ENTRIES 16
#define WRSM_MAX_STRIPEWCIS 4
#define WNODE_UNREACHABLE (-1)
typedef unsigned char wrsm_linknum_t;
typedef unsigned char inid_t;
typedef struct wrsm_mh_reroute_state wrsm_mh_reroute_state_t;
typedef struct wrsm_nc_strgrp wrsm_nc_strgrp_t;
/*
* arg to wci_routechange()
*
* controls how the gain or loss of a wnode route affects which
* nodes have their ncslice routes re-evaluated.
*/
typedef enum {
wci_reroute_all, /* route eval on all interested nodes */
wci_reroute_direct, /* route eval only on direct connect nodes */
wci_reroute_pending, /* only route eval nodes using lost routes */
wci_reroute_disabled, /* teardown routes on nodes using lost routes */
wci_reroute_force /* reroute_all, changed and unchanged wnodes */
#ifdef DEBUG
#define WCI_RTSTRING(e) \
((e == wci_reroute_all) ? "reroute_all" : \
(e == wci_reroute_direct) ? "reroute_direct" : \
(e == wci_reroute_pending) ? "reroute_pending" : \
(e == wci_reroute_disabled) ? "reroute_disabled" : \
#endif
typedef enum {
wci_rerouted, /* no multi-hop reroute needed */
wci_in_reroute, /* MH currently recalculating routes */
wci_need_reroute, /* wci needs an MH reroute */
wci_force_reroute /* force an MH reroute */
typedef struct wrsm_inid2dnid_entry {
int stripes; /* 0 - unique wnodes: 1, 2, 3, or 4 */
typedef struct wrsm_wnodeinfo {
/*
* wci related information private to the NR
*/
typedef struct nrwci {
/* inid2dnid table settings */
} nr_wci_t;
typedef struct wrsm_ncwci {
} wrsm_ncwci_t;
struct wrsm_nc_strgrp {
int attached_wcis; /* attached wcis in stripe group */
/* ncslices forced onto single wci */
};
typedef struct inidwnode_route {
enum {
} route_type;
typedef struct ncslice_route {
/*
* total # links used in ncslice route; combined striping provided
* by route map striping, inid2dnid striping, and wci striping
*/
int stripes;
int nwcis; /* number of wcis used */
/*
*/
/*
* This state is used by ncslice_apply_routes to update ncslice routes for
* each node.
*/
typedef enum {
ncslice_use_current, /* current route is still ok */
ncslice_use_new_route, /* use a new route */
ncslice_remove_route, /* remove route (to remove node) */
ncslice_use_errloopback, /* use errloopack route */
ncslice_no_route /* route has been removed */
#ifdef DEBUG
#define ROUTEINFO_MSGSTRING(e) \
((e == ncslice_use_current) ? "use_current" : \
(e == ncslice_use_new_route) ? "use_new_route" : \
(e == ncslice_remove_route) ? "remove_route" : \
(e == ncslice_use_errloopback) ? "use_errloopback" :\
#endif
struct wrsm_node_routeinfo {
int pt_route_counter; /* incr when pt_provided changes */
int pt_rerouting; /* remote node is rerouting */
int orig_nroutes; /* count of policy supplied routes */
};
typedef enum {
} pt_msgtype_t;
typedef struct wrsm_ptlist_msg {
int pt_route_counter; /* incr when pt_provided changes */
#ifdef DEBUG
#define PT_MSGSTRING(e) \
((e == pt_route_counter) ? "route_counter" : \
(e == pt_reroute_start) ? "reroute_start" : \
#endif
/*
* wcis and stripe groups are linked lists. wci list is ordered by
* (safari) port, and stripe group list is ordered by stripe group id
*/
struct wrsm_nr {
int pt_route_counter; /* incr when pt_provided changes */
int waiting_linksup; /* # wcis whose links aren't all up */
int suspended; /* controller is suspended */
/*
* to this ncslice
*/
};
/*
* counting wcis for kstats
*/
uint_t *avail_wcis);
/*
* register control interfaces
*/
void wrsm_nc_config_linksup(void *arg);
/*
* NR interfaces
*/
/*
* MH interfaces
*/
#ifdef __cplusplus
}
#endif
#endif /* _WRSM_NC_IMPL_H */