|
Packit |
857059 |
/* BEGIN_ICS_COPYRIGHT2 ****************************************
|
|
Packit |
857059 |
|
|
Packit |
857059 |
Copyright (c) 2015-2017, Intel Corporation
|
|
Packit |
857059 |
|
|
Packit |
857059 |
Redistribution and use in source and binary forms, with or without
|
|
Packit |
857059 |
modification, are permitted provided that the following conditions are met:
|
|
Packit |
857059 |
|
|
Packit |
857059 |
* Redistributions of source code must retain the above copyright notice,
|
|
Packit |
857059 |
this list of conditions and the following disclaimer.
|
|
Packit |
857059 |
* Redistributions in binary form must reproduce the above copyright
|
|
Packit |
857059 |
notice, this list of conditions and the following disclaimer in the
|
|
Packit |
857059 |
documentation and/or other materials provided with the distribution.
|
|
Packit |
857059 |
* Neither the name of Intel Corporation nor the names of its contributors
|
|
Packit |
857059 |
may be used to endorse or promote products derived from this software
|
|
Packit |
857059 |
without specific prior written permission.
|
|
Packit |
857059 |
|
|
Packit |
857059 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
Packit |
857059 |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
857059 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
Packit |
857059 |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
Packit |
857059 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
857059 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
Packit |
857059 |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
Packit |
857059 |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
Packit |
857059 |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit |
857059 |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
857059 |
|
|
Packit |
857059 |
** END_ICS_COPYRIGHT2 ****************************************/
|
|
Packit |
857059 |
|
|
Packit |
857059 |
/* [ICS VERSION STRING: unknown] */
|
|
Packit |
857059 |
|
|
Packit |
857059 |
//===========================================================================//
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
// FILE NAME
|
|
Packit |
857059 |
// sm_dor.h
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
// DESCRIPTION
|
|
Packit |
857059 |
// This file contains the SM Dor/Torus Routing SM definitions.
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
//===========================================================================//
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#ifndef _SM_DOR_H_
|
|
Packit |
857059 |
#define _SM_DOR_H_
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define SM_DOR_MAX_TOROIDAL_DIMENSIONS 6
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// DorBitMaps are indexed by ij using switch indexes.
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
// When switches disappear from the fabric and sm_compactSwitchSpace() runs
|
|
Packit |
857059 |
// it changes switch indices and the max switch count. This compaction is
|
|
Packit |
857059 |
// done after the closure bit maps were allocated and set based on
|
|
Packit |
857059 |
// the old max switch count. Though the closure bit maps are altered
|
|
Packit |
857059 |
// to take into account the change in switch indices (done in process_swIdx_change),
|
|
Packit |
857059 |
// the bit map space isn't reallocated, so any index calculations should be based
|
|
Packit |
857059 |
// on the old count of switches when the closure was computed
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define DorBitMapsIndex(X,Y) (((X) * (((DorTopology_t *)(sm_topop->routingModule->data))->closure_max_sws)) + (Y))
|
|
Packit |
857059 |
|
|
Packit |
857059 |
static __inline__ void ijSet(uint32* ijBitmap, int ij) {
|
|
Packit |
857059 |
ijBitmap[ij >> 5] |= 1 << (ij & 0x1f);
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
static __inline__ void ijClear(uint32* ijBitmap, int ij) {
|
|
Packit |
857059 |
ijBitmap[ij >> 5] &= ~((uint32_t)(1 << (ij & 0x1f)));
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
static __inline__ int ijTest(uint32* ijBitmap, int ij) {
|
|
Packit |
857059 |
return ((ijBitmap[ij >> 5] & (1 << (ij & 0x1f))) ? 1 : 0);
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
// DOR Topology Information
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
typedef struct _DorNode {
|
|
Packit |
857059 |
int8_t coords[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
Node_t *node;
|
|
Packit |
857059 |
int multipleBrokenDims;
|
|
Packit |
857059 |
struct _DorNode *left[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
struct _DorNode *right[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
} DorNode_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
typedef struct _DorTopology {
|
|
Packit |
857059 |
// mesh sizing
|
|
Packit |
857059 |
uint8_t numDimensions;
|
|
Packit |
857059 |
uint8_t dimensionLength[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
// per-dimension coordinate bounds. coordinates are assumed
|
|
Packit |
857059 |
// contiguous within these bounds
|
|
Packit |
857059 |
int8_t coordMaximums[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
int8_t coordMinimums[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
// keep track of coords measured in mesh dimension
|
|
Packit |
857059 |
int8_t measuredMaximums[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
int8_t measuredMinimums[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
// for each dimension, true if toroidal
|
|
Packit |
857059 |
uint8_t toroidal[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
// the configured number of toroidal dimensions
|
|
Packit |
857059 |
uint8_t numToroidal;
|
|
Packit |
857059 |
// count of toroidal dimensions found till now
|
|
Packit |
857059 |
uint8_t toroidal_count;
|
|
Packit |
857059 |
// minimum number of SCs required to route the fabric correctly
|
|
Packit |
857059 |
uint8_t minReqScs;
|
|
Packit |
857059 |
// maps the index of all dimensions to an index into only the
|
|
Packit |
857059 |
// toroidal dimensions
|
|
Packit |
857059 |
uint8_t toroidalMap[SM_DOR_MAX_DIMENSIONS];
|
|
Packit |
857059 |
// flat 2d bitfield indexed on switch indices marking whether
|
|
Packit |
857059 |
// the cycle-free DOR path is realizable between nodes
|
|
Packit |
857059 |
size_t dorClosureSize;
|
|
Packit |
857059 |
uint32_t *dorLeft;
|
|
Packit |
857059 |
uint32_t *dorRight;
|
|
Packit |
857059 |
uint32_t *dorBroken;
|
|
Packit |
857059 |
uint32_t closure_max_sws; //the switch count when the closures were computed
|
|
Packit |
857059 |
DorNode_t *datelineSwitch;
|
|
Packit |
857059 |
} DorTopology_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
typedef enum {
|
|
Packit |
857059 |
DorAny = 0,
|
|
Packit |
857059 |
DorLeft = 1,
|
|
Packit |
857059 |
DorRight = 2,
|
|
Packit |
857059 |
} DorDirection;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
static __inline__ int dorClosure(DorTopology_t* dorTop, int i, int j) {
|
|
Packit |
857059 |
int ij = DorBitMapsIndex(i, j);
|
|
Packit |
857059 |
if (i == j) return 1;
|
|
Packit |
857059 |
return (ijTest(dorTop->dorLeft, ij) || ijTest(dorTop->dorRight, ij));
|
|
Packit |
857059 |
}
|
|
Packit |
857059 |
|
|
Packit |
857059 |
//===========================================================================//
|
|
Packit |
857059 |
// DOR COORDINATE ASSIGNMENT
|
|
Packit |
857059 |
//
|
|
Packit |
857059 |
typedef struct _detected_dim {
|
|
Packit |
857059 |
uint8_t dim;
|
|
Packit |
857059 |
uint64_t neighbor_nodeGuid;
|
|
Packit |
857059 |
uint8_t port;
|
|
Packit |
857059 |
uint8_t neighbor_port;
|
|
Packit |
857059 |
int pos;
|
|
Packit |
857059 |
Node_t *neighbor_nodep;
|
|
Packit |
857059 |
} detected_dim_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#define PORT_PAIR_WARN_ARR_SIZE 40
|
|
Packit |
857059 |
#define PORT_PAIR_WARN_IDX(X,Y) (((X) * PORT_PAIR_WARN_ARR_SIZE) + (Y))
|
|
Packit |
857059 |
|
|
Packit |
857059 |
typedef enum {
|
|
Packit |
857059 |
DIM_LOOKUP_RVAL_FOUND,
|
|
Packit |
857059 |
DIM_LOOKUP_RVAL_NOTFOUND,
|
|
Packit |
857059 |
DIM_LOOKUP_RVAL_INVALID
|
|
Packit |
857059 |
} DimLookupRval_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
typedef struct _DorDimension {
|
|
Packit |
857059 |
uint8_t ingressPort;
|
|
Packit |
857059 |
uint8_t dimension;
|
|
Packit |
857059 |
int8_t direction;
|
|
Packit |
857059 |
uint8_t hyperlink;
|
|
Packit |
857059 |
cl_map_obj_t portObj;
|
|
Packit |
857059 |
} DorDimension_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
typedef struct _DorDiscoveryState {
|
|
Packit |
857059 |
uint8_t nextDimension;
|
|
Packit |
857059 |
uint8_t toroidalOverflow;
|
|
Packit |
857059 |
uint8_t scsAvailable; // min of SC support of all fabric ISLs
|
|
Packit |
857059 |
DorDimension_t *dimensionMap[256]; // indexed by egress port
|
|
Packit |
857059 |
} DorDiscoveryState_t;
|
|
Packit |
857059 |
|
|
Packit |
857059 |
|
|
Packit |
857059 |
#endif
|