wrsm_config.h revision 159cf8a6ecac7ecbb601c9653abfd0fa878075d8
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _WRSM_CONFIG_H
#define _WRSM_CONFIG_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
#include <sys/wrsm_types.h>
#endif /* _ASM */
/*
* Macro to guarantee proper pointer alignment in 32 or 64 bit mode
*/
#if defined(_LP64)
#define WRSM_ALIGN_64(t, n) t n
#define WRSM_ALIGN_PTR(n) n
#else
#endif
/*
* If any of the data structures in this file are changed,
* WRSM_CF_IOCTL_VERSION must be incremented.
*/
#define WRSM_CF_IOCTL_VERSION 0x0e
#define CONFIG_PROTOCOL_VERSION 0x2
#define WRSM_MAX_SWITCHES 38
#define WRSM_HOSTNAMELEN 255
#ifndef _ASM
/*
* network routing methods used by preferred_route
*/
typedef enum {
/*
* network topology types used to give hints to the multihop routing
* algorithm.
*/
typedef enum {
typedef enum {
ncslice_invalid = 0x0,
ncslice_passthrough = 0x1,
ncslice_small_page = 0x2,
ncslice_large_page = 0x3
/*
* information about each link attached to a wci
*/
typedef struct wrsm_link_data {
/*
* routing related information about each wci
*/
struct wrsm_wci_data {
/*
* bus port number - unique within a chassis
*/
/* cnodes potentially accessible through this WCI, indexed by wnodeid */
/* gnid to wnode mapping for this WCI, indexed by gnid */
/*
* if wnode_reachable[n] == B_TRUE then reachable[n]
* contains a valid reachable cnodeid and gnid_to_wnode[n]
* contains a valid wnode.
*/
/* Data about links directly connected to this WCI. */
};
/*
* identify wcis which may be used together for striping
*/
typedef struct wrsm_stripe_group {
int nwcis;
/*
* The order of the wcis in this list determines which address
* stripe each wci is assigned. For Starcat, it is required that
* the wcis are in adjacent expanders, that the lower wci is
* specified first, and that the first expander has an expander id
* that's divisible by 2 (0,2,4..). Also, for Starcat a maximum of
* 2 wcis can be striped.
*/
/*
* Description of one possible method to route data to a remote node.
*/
typedef struct wrsm_preferred_route {
int striping_level; /* level of striping desired */
/*
* ordered list of preferred passthrough cnodeids
*/
int nswitches;
/*
* A preferred route may indicate either a WCI
* to use or a stripe group, but not both.
*/
enum {
route_stripe_group = 1,
} route_type;
union {
} route;
/*
* Information about how to route data to remote network members.
*/
typedef struct wrsm_routing_policy {
/*
* must the number of links per WCI be equal?
*/
/*
* Is the number of stripes more important than the order of
* the preferred routes?
*/
/*
* is passthrough forwarding to this node allowed?
*/
/*
* If forwarding is allowed, this bitmask contains import ncslice ids
* each remote network member uses to access ncslices exported by this
* node.
*/
int nroutes; /* number of preferred routes */
/*
* Information on how to communicate with all the remote rsm nodes.
*/
typedef struct wrsm_routing_data {
int nwcis;
int ngroups;
int npolicy;
/*
* WCIs owned by this controller, sorted in ascending
* order by the safari port id of the wci.
*/
/*
* List of stripe groups sorted in ascending
* order by stripe group id.
*/
/*
* list of routing policies for each remote cnode,
* sorted in ascending order by cnodeid.
*/
/*
* Are routes not explicitly listed permitted given the
* available connectivity in the network?
*/
/*
* Information the local node needs to know about every other rsm node
* in the network.
*/
struct wrsm_net_member {
char hostname[WRSM_HOSTNAMELEN];
/*
* Exported_ncslices is the ncslices the remote node (the node this
* wrsm_net_member is describing) exports memory through; these are
* the ncslices the local node (the node that is using the config
* containing this wrsm_net_member) uses to import the remote
* node's memory.
*/
/*
* Imported ncslices is the set of ncslices the remote node uses to
* access the local node's exported memory. Each node may use
* different ncslices to import memory from the local node. The
* local node sets up the WCI hardware to allow access using these
* ncslices.
*/
/*
* ncslice and offset to use to send interrupt based communication to
* wrsm_net_member's driver
*/
/*
* offset that should be set up to allow interrupts to be received
* from wrsm_net_member's driver (the ncslice is the small page
* ncslice specified in the exported_ncslices structure of the
* wrsm_net_member structure for the local controller).
*/
};
/*
* Configuration data about a particular rsm controller.
*
* An RSM network is a set of communicating RSM nodes. A "controller" is
* the node-local view of an RSM network. The wrsm_controller_t structure
* contains the configuration information the node needs to participate in
* the network. There is one controller for each node in a network, and
* the controller_id of each communicating controller matches the network
* id of the network it is part of.
*/
typedef struct wrsm_controller {
/*
* version number to track changes in the definition of
* the data structures in this file.
*/
/*
* version number to identify the version of the RSM network
* this wrsm_controller_t is participating in.
*/
int nmembers; /* number of elements in the members list */
/*
* routing data
*/
/*
* List of network members sorted by cnodeid
*/
/*
* Used as argument to INITIALCFG, REPLACECFG and GETCFG ioctls
*/
typedef struct wrsm_admin_arg_config {
/*
* Used as argument to INSTALLCFG, CHECKCFG, and ENABLECFG ioctls
*/
typedef struct wrsm_admin_arg_wci {
/*
* Used as argument to CTLR_PING ioctl
*/
typedef struct wrsm_ping_arg {
/*
* Used as argument to CTLR_MBOX ioctl
*/
typedef struct wrsm_link_arg {
int cmd;
/*
* Used as argument to CTLR_SEG ioctl
*/
typedef struct wrsm_seg_arg {
int cmd;
char *datap;
/*
* Used as argument to CTLR_SESS ioctls
*/
typedef struct wrsm_sess_arg {
int cmd;
#endif /* _ASM */
#ifdef __cplusplus
}
#endif
#endif /* _WRSM_CONFIG_H */