[ofa-general] [PATCH 2/2 v2] opensm: replace switch's fwd_tbl with simple LFT - remove obsolete files

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Wed Oct 29 06:01:58 PDT 2008


Remove all the fwd_tbl files that became obsolete.

[v2 - no changes, just rebased]

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/include/opensm/osm_fwd_tbl.h      |  373 ------------------------------
 opensm/include/opensm/osm_lin_fwd_tbl.h  |  359 ----------------------------
 opensm/include/opensm/osm_rand_fwd_tbl.h |  337 ---------------------------
 opensm/opensm/Makefile.am                |    7 +-
 opensm/opensm/osm_fwd_tbl.c              |  100 --------
 opensm/opensm/osm_lin_fwd_tbl.c          |   88 -------
 6 files changed, 2 insertions(+), 1262 deletions(-)
 delete mode 100644 opensm/include/opensm/osm_fwd_tbl.h
 delete mode 100644 opensm/include/opensm/osm_lin_fwd_tbl.h
 delete mode 100644 opensm/include/opensm/osm_rand_fwd_tbl.h
 delete mode 100644 opensm/opensm/osm_fwd_tbl.c
 delete mode 100644 opensm/opensm/osm_lin_fwd_tbl.c

diff --git a/opensm/include/opensm/osm_fwd_tbl.h b/opensm/include/opensm/osm_fwd_tbl.h
deleted file mode 100644
index 55e853f..0000000
--- a/opensm/include/opensm/osm_fwd_tbl.h
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-/*
- * Abstract:
- * 	Declaration of osm_fwd_tbl_t.
- *	This object represents a unicast forwarding table.
- *	This object is part of the OpenSM family of objects.
- */
-
-#ifndef _OSM_FWD_TBL_H_
-#define _OSM_FWD_TBL_H_
-
-#include <iba/ib_types.h>
-#include <opensm/osm_base.h>
-#include <opensm/osm_rand_fwd_tbl.h>
-#include <opensm/osm_lin_fwd_tbl.h>
-
-#ifdef __cplusplus
-#  define BEGIN_C_DECLS extern "C" {
-#  define END_C_DECLS   }
-#else				/* !__cplusplus */
-#  define BEGIN_C_DECLS
-#  define END_C_DECLS
-#endif				/* __cplusplus */
-
-BEGIN_C_DECLS
-/****h* OpenSM/Forwarding Table
-* NAME
-*	Forwarding Table
-*
-* DESCRIPTION
-*	The Forwarding Table objects encapsulate the information
-*	needed by the OpenSM to manage forwarding tables.  The OpenSM
-*	allocates one Forwarding Table object per switch in the
-*	IBA subnet.
-*
-*	The Forwarding Table objects are not thread safe, thus
-*	callers must provide serialization.
-*
-* AUTHOR
-*	Steve King, Intel
-*
-*********/
-/****s* OpenSM: Forwarding Table/osm_fwd_tbl_t
-* NAME
-*	osm_fwd_tbl_t
-*
-* DESCRIPTION
-*	Forwarding Table structure.  This object hides the type
-*	of fowarding table (linear or random) actually used by
-*	the switch.
-*
-*	This object should be treated as opaque and should
-*	be manipulated only through the provided functions.
-*
-* SYNOPSIS
-*/
-typedef struct osm_fwd_tbl {
-	osm_rand_fwd_tbl_t *p_rnd_tbl;
-	osm_lin_fwd_tbl_t *p_lin_tbl;
-} osm_fwd_tbl_t;
-/*
-* FIELDS
-*	p_rnd_tbl
-*		Pointer to the switch's Random Forwarding Table object.
-*		If the switch does not use a Random Forwarding Table,
-*		then this pointer is NULL.
-*
-*	p_lin_tbl
-*		Pointer to the switch's Linear Forwarding Table object.
-*		If the switch does not use a Linear Forwarding Table,
-*		then this pointer is NULL.
-*
-* SEE ALSO
-*	Forwarding Table object, Random Forwarding Table object.
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_fwd_tbl_init
-* NAME
-*	osm_fwd_tbl_init
-*
-* DESCRIPTION
-*	Initializes a Forwarding Table object.
-*
-* SYNOPSIS
-*/
-ib_api_status_t
-osm_fwd_tbl_init(IN osm_fwd_tbl_t * const p_tbl,
-		 IN const ib_switch_info_t * const p_si);
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-*	p_si
-*		[in] Pointer to the SwitchInfo attribute of the associated
-*		switch.
-*
-* RETURN VALUE
-*	IB_SUCCESS if the operation is successful.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_fwd_tbl_destroy
-* NAME
-*	osm_fwd_tbl_destroy
-*
-* DESCRIPTION
-*	Destroys a Forwarding Table object.
-*
-* SYNOPSIS
-*/
-void osm_fwd_tbl_destroy(IN osm_fwd_tbl_t * const p_tbl);
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	None.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_fwd_tbl_get
-* NAME
-*	osm_fwd_tbl_get
-*
-* DESCRIPTION
-*	Returns the port that routes the specified LID.
-*
-* SYNOPSIS
-*/
-static inline uint8_t
-osm_fwd_tbl_get(IN const osm_fwd_tbl_t * const p_tbl, IN uint16_t const lid_ho)
-{
-	if (p_tbl->p_lin_tbl)
-		return (osm_lin_fwd_tbl_get(p_tbl->p_lin_tbl, lid_ho));
-	else
-		return (osm_rand_fwd_tbl_get(p_tbl->p_rnd_tbl, lid_ho));
-}
-
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-*	lid_ho
-*		[in] LID (host order) for which to find the route.
-*
-* RETURN VALUE
-*	Returns the port that routes the specified LID.
-*	IB_INVALID_PORT_NUM if the table does not have a route for this LID.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_fwd_tbl_set
-* NAME
-*	osm_fwd_tbl_set
-*
-* DESCRIPTION
-*	Sets the port to route the specified LID.
-*
-* SYNOPSIS
-*/
-static inline void
-osm_fwd_tbl_set(IN osm_fwd_tbl_t * const p_tbl,
-		IN const uint16_t lid_ho, IN const uint8_t port)
-{
-	CL_ASSERT(p_tbl);
-	if (p_tbl->p_lin_tbl)
-		osm_lin_fwd_tbl_set(p_tbl->p_lin_tbl, lid_ho, port);
-	else
-		osm_rand_fwd_tbl_set(p_tbl->p_rnd_tbl, lid_ho, port);
-}
-
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-*	lid_ho
-*		[in] LID value (host order) for which to set the route.
-*
-*	port
-*		[in] Port to route the specified LID value.
-*
-* RETURN VALUE
-*	None.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_fwd_tbl_set_block
-* NAME
-*	osm_fwd_tbl_set_block
-*
-* DESCRIPTION
-*	Copies the specified block into the Forwarding Table.
-*
-* SYNOPSIS
-*/
-static inline ib_api_status_t
-osm_fwd_tbl_set_block(IN osm_fwd_tbl_t * const p_tbl,
-		      IN const uint8_t * const p_block,
-		      IN const uint32_t block_num)
-{
-	CL_ASSERT(p_tbl);
-	if (p_tbl->p_lin_tbl)
-		return (osm_lin_fwd_tbl_set_block(p_tbl->p_lin_tbl,
-						  p_block, block_num));
-	else
-		return (osm_rand_fwd_tbl_set_block(p_tbl->p_rnd_tbl,
-						   p_block, block_num));
-}
-
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	None.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_fwd_tbl_get_size
-* NAME
-*	osm_fwd_tbl_get_size
-*
-* DESCRIPTION
-*	Returns the number of entries available in the forwarding table.
-*
-* SYNOPSIS
-*/
-static inline uint16_t
-osm_fwd_tbl_get_size(IN const osm_fwd_tbl_t * const p_tbl)
-{
-	CL_ASSERT(p_tbl);
-	if (p_tbl->p_lin_tbl)
-		return (osm_lin_fwd_tbl_get_size(p_tbl->p_lin_tbl));
-	else
-		return (osm_rand_fwd_tbl_get_size(p_tbl->p_rnd_tbl));
-}
-
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	Returns the number of entries available in the forwarding table.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_fwd_tbl_get_lids_per_block
-* NAME
-*	osm_fwd_tbl_get_lids_per_block
-*
-* DESCRIPTION
-*	Returns the number of LIDs per LID block.
-*
-* SYNOPSIS
-*/
-static inline uint16_t
-osm_fwd_tbl_get_lids_per_block(IN const osm_fwd_tbl_t * const p_tbl)
-{
-	CL_ASSERT(p_tbl);
-	if (p_tbl->p_lin_tbl)
-		return (osm_lin_fwd_tbl_get_lids_per_block(p_tbl->p_lin_tbl));
-	else
-		return (osm_rand_fwd_tbl_get_lids_per_block(p_tbl->p_rnd_tbl));
-}
-
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	Returns the number of LIDs per LID block.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_fwd_tbl_get_max_block_id_in_use
-* NAME
-*	osm_fwd_tbl_get_max_block_id_in_use
-*
-* DESCRIPTION
-*	Returns the number of LIDs per LID block.
-*
-* SYNOPSIS
-*/
-static inline uint16_t
-osm_fwd_tbl_get_max_block_id_in_use(IN const osm_fwd_tbl_t * const p_tbl,
-				    IN const uint16_t lid_top_ho)
-{
-	CL_ASSERT(p_tbl);
-	if (p_tbl->p_lin_tbl)
-		return (osm_lin_fwd_tbl_get_max_block_id_in_use
-			(p_tbl->p_lin_tbl, lid_top_ho));
-	else
-		return (osm_rand_fwd_tbl_get_max_block_id_in_use
-			(p_tbl->p_rnd_tbl, lid_top_ho));
-}
-
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	Returns the number of LIDs per LID block.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-END_C_DECLS
-#endif				/* _OSM_FWD_TBL_H_ */
diff --git a/opensm/include/opensm/osm_lin_fwd_tbl.h b/opensm/include/opensm/osm_lin_fwd_tbl.h
deleted file mode 100644
index be3a3ee..0000000
--- a/opensm/include/opensm/osm_lin_fwd_tbl.h
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright (c) 2004-2007 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-/*
- * Abstract:
- * 	Declaration of osm_lin_fwd_tbl_t.
- *	This object represents a linear forwarding table.
- *	This object is part of the OpenSM family of objects.
- */
-
-#ifndef _OSM_LIN_FWD_TBL_H_
-#define _OSM_LIN_FWD_TBL_H_
-
-#include <string.h>
-#include <iba/ib_types.h>
-#include <opensm/osm_base.h>
-
-#ifdef __cplusplus
-#  define BEGIN_C_DECLS extern "C" {
-#  define END_C_DECLS   }
-#else				/* !__cplusplus */
-#  define BEGIN_C_DECLS
-#  define END_C_DECLS
-#endif				/* __cplusplus */
-
-BEGIN_C_DECLS
-/****h* OpenSM/Linear Forwarding Table
-* NAME
-*	Linear Forwarding Table
-*
-* DESCRIPTION
-*	The Linear Forwarding Table objects encapsulate the information
-*	needed by the OpenSM to manage linear forwarding tables.  The OpenSM
-*	allocates one Linear Forwarding Table object per switch in the
-*	IBA subnet, if that switch uses a linear table.
-*
-*	The Linear Forwarding Table objects are not thread safe, thus
-*	callers must provide serialization.
-*
-* AUTHOR
-*	Steve King, Intel
-*
-*********/
-/****s* OpenSM: Forwarding Table/osm_lin_fwd_tbl_t
-* NAME
-*	osm_lin_fwd_tbl_t
-*
-* DESCRIPTION
-*	Linear Forwarding Table structure.
-*
-*	Callers may directly access this object.
-*
-* SYNOPSIS
-*/
-typedef struct osm_lin_fwd_tbl {
-	uint16_t size;
-	uint8_t port_tbl[1];
-} osm_lin_fwd_tbl_t;
-/*
-* FIELDS
-*	Size
-*		Number of entries in the linear forwarding table.  This value
-*		is taken from the SwitchInfo attribute.
-*
-*	port_tbl
-*		The array that specifies the port number which routes the
-*		corresponding LID.  Index is by LID.
-*
-* SEE ALSO
-*	Forwarding Table object, Random Forwarding Table object.
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_lin_tbl_new
-* NAME
-*	osm_lin_tbl_new
-*
-* DESCRIPTION
-*	This function creates and initializes a Linear Forwarding Table object.
-*
-* SYNOPSIS
-*/
-osm_lin_fwd_tbl_t *osm_lin_tbl_new(IN uint16_t const size);
-/*
-* PARAMETERS
-*	size
-*		[in] Number of entries in the Linear Forwarding Table.
-*
-* RETURN VALUE
-*	On success, returns a pointer to a new Linear Forwarding Table object
-*	of the specified size.
-*	NULL otherwise.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_lin_tbl_delete
-* NAME
-*	osm_lin_tbl_delete
-*
-* DESCRIPTION
-*	This destroys and deallocates a Linear Forwarding Table object.
-*
-* SYNOPSIS
-*/
-void osm_lin_tbl_delete(IN osm_lin_fwd_tbl_t ** const pp_tbl);
-/*
-* PARAMETERS
-*	pp_tbl
-*		[in] Pointer a Pointer to the Linear Forwarding Table object.
-*
-* RETURN VALUE
-*	On success, returns a pointer to a new Linear Forwarding Table object
-*	of the specified size.
-*	NULL otherwise.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_lin_fwd_tbl_set
-* NAME
-*	osm_lin_fwd_tbl_set
-*
-* DESCRIPTION
-*	Sets the port to route the specified LID.
-*
-* SYNOPSIS
-*/
-static inline void
-osm_lin_fwd_tbl_set(IN osm_lin_fwd_tbl_t * const p_tbl,
-		    IN const uint16_t lid_ho, IN const uint8_t port)
-{
-	CL_ASSERT(lid_ho < p_tbl->size);
-	if (lid_ho < p_tbl->size)
-		p_tbl->port_tbl[lid_ho] = port;
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Linear Forwarding Table object.
-*
-*	lid_ho
-*		[in] LID value (host order) for which to set the route.
-*
-*	port
-*		[in] Port to route the specified LID value.
-*
-* RETURN VALUE
-*	None.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_lin_fwd_tbl_get
-* NAME
-*	osm_lin_fwd_tbl_get
-*
-* DESCRIPTION
-*	Returns the port that routes the specified LID.
-*
-* SYNOPSIS
-*/
-static inline uint8_t
-osm_lin_fwd_tbl_get(IN const osm_lin_fwd_tbl_t * const p_tbl,
-		    IN const uint16_t lid_ho)
-{
-	if (lid_ho < p_tbl->size)
-		return (p_tbl->port_tbl[lid_ho]);
-	else
-		return (OSM_NO_PATH);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Linear Forwarding Table object.
-*
-*	lid_ho
-*		[in] LID value (host order) for which to get the route.
-*
-* RETURN VALUE
-*	Returns the port that routes the specified LID.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_lin_fwd_tbl_get_size
-* NAME
-*	osm_lin_fwd_tbl_get_size
-*
-* DESCRIPTION
-*	Returns the number of entries available in the forwarding table.
-*
-* SYNOPSIS
-*/
-static inline uint16_t
-osm_lin_fwd_tbl_get_size(IN const osm_lin_fwd_tbl_t * const p_tbl)
-{
-	return (p_tbl->size);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	Returns the number of entries available in the forwarding table.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_lin_fwd_tbl_get_lids_per_block
-* NAME
-*	osm_lin_fwd_tbl_get_lids_per_block
-*
-* DESCRIPTION
-*	Returns the number of LIDs per LID block.
-*
-* SYNOPSIS
-*/
-static inline uint16_t
-osm_lin_fwd_tbl_get_lids_per_block(IN const osm_lin_fwd_tbl_t * const p_tbl)
-{
-	UNUSED_PARAM(p_tbl);
-	return (64);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	Returns the number of LIDs per LID block.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_lin_fwd_tbl_get_max_block_id_in_use
-* NAME
-*	osm_lin_fwd_tbl_get_max_block_id_in_use
-*
-* DESCRIPTION
-*	Returns the maximum block ID in actual use by the forwarding table.
-*
-* SYNOPSIS
-*/
-static inline uint16_t
-osm_lin_fwd_tbl_get_max_block_id_in_use(IN const osm_lin_fwd_tbl_t *
-					const p_tbl,
-					IN const uint16_t lid_top_ho)
-{
-	return ((uint16_t) (lid_top_ho /
-			    osm_lin_fwd_tbl_get_lids_per_block(p_tbl)));
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	Returns the maximum block ID in actual use by the forwarding table.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_lin_fwd_tbl_set_block
-* NAME
-*	osm_lin_fwd_tbl_set_block
-*
-* DESCRIPTION
-*	Copies the specified block into the Linear Forwarding Table.
-*
-* SYNOPSIS
-*/
-static inline ib_api_status_t
-osm_lin_fwd_tbl_set_block(IN osm_lin_fwd_tbl_t * const p_tbl,
-			  IN const uint8_t * const p_block,
-			  IN const uint32_t block_num)
-{
-	uint16_t lid_start;
-	uint16_t num_lids;
-
-	CL_ASSERT(p_tbl);
-	CL_ASSERT(p_block);
-
-	num_lids = osm_lin_fwd_tbl_get_lids_per_block(p_tbl);
-	lid_start = (uint16_t) (block_num * num_lids);
-
-	if (lid_start + num_lids > p_tbl->size)
-		return (IB_INVALID_PARAMETER);
-
-	memcpy(&p_tbl->port_tbl[lid_start], p_block, num_lids);
-	return (IB_SUCCESS);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Linear Forwarding Table object.
-*
-*	p_block
-*		[in] Pointer to the Forwarding Table block.
-*
-*	block_num
-*		[in] Block number of this block.
-*
-* RETURN VALUE
-*	None.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-END_C_DECLS
-#endif				/* _OSM_LIN_FWD_TBL_H_ */
diff --git a/opensm/include/opensm/osm_rand_fwd_tbl.h b/opensm/include/opensm/osm_rand_fwd_tbl.h
deleted file mode 100644
index 31098b9..0000000
--- a/opensm/include/opensm/osm_rand_fwd_tbl.h
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-/*
- * Abstract:
- * 	Declaration of osm_rand_fwd_tbl_t.
- *	This object represents a random forwarding table.
- *	This object is part of the OpenSM family of objects.
- */
-
-#ifndef _OSM_RAND_FWD_TBL_H_
-#define _OSM_RAND_FWD_TBL_H_
-
-#include <stdlib.h>
-#include <iba/ib_types.h>
-#include <opensm/osm_base.h>
-
-#ifdef __cplusplus
-#  define BEGIN_C_DECLS extern "C" {
-#  define END_C_DECLS   }
-#else				/* !__cplusplus */
-#  define BEGIN_C_DECLS
-#  define END_C_DECLS
-#endif				/* __cplusplus */
-
-BEGIN_C_DECLS
-/****h* OpenSM/Random Forwarding Table
-* NAME
-*	Random Forwarding Table
-*
-* DESCRIPTION
-*	The Random Forwarding Table objects encapsulate the information
-*	needed by the OpenSM to manage random forwarding tables.  The OpenSM
-*	allocates one Random Forwarding Table object per switch in the
-*	IBA subnet, if that switch uses a random forwarding table.
-*
-*	The Random Forwarding Table objects are not thread safe, thus
-*	callers must provide serialization.
-*
-*   ** RANDOM FORWARDING TABLES ARE NOT SUPPORTED IN THE CURRENT VERSION **
-*
-* AUTHOR
-*	Steve King, Intel
-*
-*********/
-/****s* OpenSM: Forwarding Table/osm_rand_fwd_tbl_t
-* NAME
-*	osm_rand_fwd_tbl_t
-*
-* DESCRIPTION
-*	Random Forwarding Table structure.
-*
-*	THIS OBJECT IS PLACE HOLDER.  SUPPORT FOR SWITCHES WITH
-*	RANDOM FORWARDING TABLES HAS NOT BEEN IMPLEMENTED YET.
-*
-* SYNOPSIS
-*/
-typedef struct osm_rand_fwd_tbl {
-	/* PLACE HOLDER STRUCTURE ONLY!! */
-	uint32_t size;
-} osm_rand_fwd_tbl_t;
-/*
-* FIELDS
-*	RANDOM FORWARDING TABLES ARE NOT SUPPORTED YET!!
-*
-* SEE ALSO
-*	Forwarding Table object, Random Forwarding Table object.
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_rand_tbl_delete
-* NAME
-*	osm_rand_tbl_delete
-*
-* DESCRIPTION
-*	This destroys and deallocates a Random Forwarding Table object.
-*
-* SYNOPSIS
-*/
-static inline void osm_rand_tbl_delete(IN osm_rand_fwd_tbl_t ** const pp_tbl)
-{
-	/*
-	   TO DO - This is a place holder function only!
-	 */
-	free(*pp_tbl);
-	*pp_tbl = NULL;
-}
-/*
-* PARAMETERS
-*	pp_tbl
-*		[in] Pointer a Pointer to the Random Forwarding Table object.
-*
-* RETURN VALUE
-*	On success, returns a pointer to a new Random Forwarding Table object
-*	of the specified size.
-*	NULL otherwise.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_rand_fwd_tbl_set
-* NAME
-*	osm_rand_fwd_tbl_set
-*
-* DESCRIPTION
-*	Sets the port to route the specified LID.
-*
-* SYNOPSIS
-*/
-static inline void
-osm_rand_fwd_tbl_set(IN osm_rand_fwd_tbl_t * const p_tbl,
-		     IN const uint16_t lid_ho, IN const uint8_t port)
-{
-	/* Random forwarding tables not supported yet. */
-	UNUSED_PARAM(p_tbl);
-	UNUSED_PARAM(lid_ho);
-	UNUSED_PARAM(port);
-	CL_ASSERT(FALSE);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Random Forwarding Table object.
-*
-*	lid_ho
-*		[in] LID value (host order) for which to set the route.
-*
-*	port
-*		[in] Port to route the specified LID value.
-*
-* RETURN VALUE
-*	None.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_rand_fwd_tbl_set_block
-* NAME
-*	osm_rand_fwd_tbl_set_block
-*
-* DESCRIPTION
-*	Copies the specified block into the Random Forwarding Table.
-*
-* SYNOPSIS
-*/
-static inline ib_api_status_t
-osm_rand_fwd_tbl_set_block(IN osm_rand_fwd_tbl_t * const p_tbl,
-			   IN const uint8_t * const p_block,
-			   IN const uint32_t block_num)
-{
-	/* Random forwarding tables not supported yet. */
-	UNUSED_PARAM(p_tbl);
-	UNUSED_PARAM(p_block);
-	UNUSED_PARAM(block_num);
-	CL_ASSERT(FALSE);
-	return (IB_ERROR);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Random Forwarding Table object.
-*
-*	p_block
-*		[in] Pointer to the Forwarding Table block.
-*
-*	block_num
-*		[in] Block number of this block.
-*
-* RETURN VALUE
-*	None.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_rand_fwd_tbl_get
-* NAME
-*	osm_rand_fwd_tbl_get
-*
-* DESCRIPTION
-*	Returns the port that routes the specified LID.
-*
-* SYNOPSIS
-*/
-static inline uint8_t
-osm_rand_fwd_tbl_get(IN const osm_rand_fwd_tbl_t * const p_tbl,
-		     IN const uint16_t lid_ho)
-{
-	CL_ASSERT(FALSE);
-	UNUSED_PARAM(p_tbl);
-	UNUSED_PARAM(lid_ho);
-
-	return (OSM_NO_PATH);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Random Forwarding Table object.
-*
-*	lid_ho
-*		[in] LID value (host order) for which to get the route.
-*
-* RETURN VALUE
-*	Returns the port that routes the specified LID.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_rand_fwd_tbl_get_lids_per_block
-* NAME
-*	osm_rand_fwd_tbl_get_lids_per_block
-*
-* DESCRIPTION
-*	Returns the number of LIDs per LID block.
-*
-* SYNOPSIS
-*/
-static inline uint16_t
-osm_rand_fwd_tbl_get_lids_per_block(IN const osm_rand_fwd_tbl_t * const p_tbl)
-{
-	UNUSED_PARAM(p_tbl);
-	return (16);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	Returns the number of LIDs per LID block.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_rand_fwd_tbl_get_max_block_id_in_use
-* NAME
-*	osm_rand_fwd_tbl_get_max_block_id_in_use
-*
-* DESCRIPTION
-*	Returns the maximum block ID in actual use by the forwarding table.
-*
-* SYNOPSIS
-*/
-static inline uint16_t
-osm_rand_fwd_tbl_get_max_block_id_in_use(IN const osm_rand_fwd_tbl_t *
-					 const p_tbl,
-					 IN const uint16_t lid_top_ho)
-{
-	UNUSED_PARAM(p_tbl);
-	UNUSED_PARAM(lid_top_ho);
-	CL_ASSERT(FALSE);
-	return (0);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	Returns the maximum block ID in actual use by the forwarding table.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-/****f* OpenSM: Forwarding Table/osm_rand_fwd_tbl_get_size
-* NAME
-*	osm_rand_fwd_tbl_get_size
-*
-* DESCRIPTION
-*	Returns the number of entries available in the forwarding table.
-*
-* SYNOPSIS
-*/
-static inline uint16_t
-osm_rand_fwd_tbl_get_size(IN const osm_rand_fwd_tbl_t * const p_tbl)
-{
-	UNUSED_PARAM(p_tbl);
-	CL_ASSERT(FALSE);
-	return (0);
-}
-/*
-* PARAMETERS
-*	p_tbl
-*		[in] Pointer to the Forwarding Table object.
-*
-* RETURN VALUE
-*	Returns the number of entries available in the forwarding table.
-*
-* NOTES
-*
-* SEE ALSO
-*********/
-
-END_C_DECLS
-#endif				/* _OSM_RAND_FWD_TBL_H_ */
diff --git a/opensm/opensm/Makefile.am b/opensm/opensm/Makefile.am
index 1d345a5..01573d2 100644
--- a/opensm/opensm/Makefile.am
+++ b/opensm/opensm/Makefile.am
@@ -27,9 +27,9 @@ libopensm_la_DEPENDENCIES = $(srcdir)/libopensm.map
 sbin_PROGRAMS = opensm
 opensm_DEPENDENCIES = libopensm.la
 opensm_SOURCES = main.c osm_console_io.c osm_console.c osm_db_files.c \
-		 osm_db_pack.c osm_drop_mgr.c osm_fwd_tbl.c \
+		 osm_db_pack.c osm_drop_mgr.c \
 		 osm_inform.c osm_lid_mgr.c osm_lin_fwd_rcv.c \
-		 osm_lin_fwd_tbl.c osm_link_mgr.c osm_mcast_fwd_rcv.c \
+		 osm_link_mgr.c osm_mcast_fwd_rcv.c \
 		 osm_mcast_mgr.c osm_mcast_tbl.c osm_mcm_info.c \
 		 osm_mcm_port.c osm_mtree.c osm_multicast.c osm_node.c \
 		 osm_node_desc_rcv.c osm_node_info_rcv.c \
@@ -74,11 +74,9 @@ opensminclude_HEADERS = \
 	$(srcdir)/../include/opensm/osm_db_pack.h \
 	$(srcdir)/../include/opensm/osm_event_plugin.h \
 	$(srcdir)/../include/opensm/osm_errors.h \
-	$(srcdir)/../include/opensm/osm_fwd_tbl.h \
 	$(srcdir)/../include/opensm/osm_helper.h \
 	$(srcdir)/../include/opensm/osm_inform.h \
 	$(srcdir)/../include/opensm/osm_lid_mgr.h \
-	$(srcdir)/../include/opensm/osm_lin_fwd_tbl.h \
 	$(srcdir)/../include/opensm/osm_log.h \
 	$(srcdir)/../include/opensm/osm_mad_pool.h \
 	$(srcdir)/../include/opensm/osm_madw.h \
@@ -100,7 +98,6 @@ opensminclude_HEADERS = \
 	$(srcdir)/../include/opensm/osm_port_profile.h \
 	$(srcdir)/../include/opensm/osm_prefix_route.h \
 	$(srcdir)/../include/opensm/osm_qos_policy.h \
-	$(srcdir)/../include/opensm/osm_rand_fwd_tbl.h \
 	$(srcdir)/../include/opensm/osm_remote_sm.h \
 	$(srcdir)/../include/opensm/osm_router.h \
 	$(srcdir)/../include/opensm/osm_sa.h \
diff --git a/opensm/opensm/osm_fwd_tbl.c b/opensm/opensm/osm_fwd_tbl.c
deleted file mode 100644
index 2ea74af..0000000
--- a/opensm/opensm/osm_fwd_tbl.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-/*
- * Abstract:
- *    Implementation of osm_fwd_tbl_t.
- * This object represents a unicast forwarding table.
- * This object is part of the opensm family of objects.
- */
-
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif				/* HAVE_CONFIG_H */
-
-#include <complib/cl_math.h>
-#include <iba/ib_types.h>
-#include <opensm/osm_fwd_tbl.h>
-
-/**********************************************************************
- **********************************************************************/
-ib_api_status_t
-osm_fwd_tbl_init(IN osm_fwd_tbl_t * const p_tbl,
-		 IN const ib_switch_info_t * const p_si)
-{
-	uint16_t tbl_cap;
-	ib_api_status_t status = IB_SUCCESS;
-
-	/*
-	   Determine the type and size of the forwarding table
-	   used by this switch, then initialize accordingly.
-	   The current implementation only supports switches
-	   with linear forwarding tables.
-	 */
-	tbl_cap = cl_ntoh16(p_si->lin_cap);
-
-	if (tbl_cap == 0) {
-		/*
-		   This switch does not support linear forwarding
-		   tables.  Error out for now.
-		 */
-		status = IB_UNSUPPORTED;
-		goto Exit;
-	}
-
-	p_tbl->p_rnd_tbl = NULL;
-
-	p_tbl->p_lin_tbl = osm_lin_tbl_new(tbl_cap);
-
-	if (p_tbl->p_lin_tbl == NULL) {
-		status = IB_INSUFFICIENT_MEMORY;
-		goto Exit;
-	}
-
-Exit:
-	return (status);
-}
-
-/**********************************************************************
- **********************************************************************/
-void osm_fwd_tbl_destroy(IN osm_fwd_tbl_t * const p_tbl)
-{
-	if (p_tbl->p_lin_tbl) {
-		CL_ASSERT(p_tbl->p_rnd_tbl == NULL);
-		osm_lin_tbl_delete(&p_tbl->p_lin_tbl);
-	} else {
-		osm_rand_tbl_delete(&p_tbl->p_rnd_tbl);
-	}
-}
diff --git a/opensm/opensm/osm_lin_fwd_tbl.c b/opensm/opensm/osm_lin_fwd_tbl.c
deleted file mode 100644
index 7d1eeff..0000000
--- a/opensm/opensm/osm_lin_fwd_tbl.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
- * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-/*
- * Abstract:
- *    Implementation of osm_lin_fwd_tbl_t.
- * This object represents an linear forwarding table.
- * This object is part of the opensm family of objects.
- */
-
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif				/* HAVE_CONFIG_H */
-
-#include <stdlib.h>
-#include <string.h>
-#include <complib/cl_math.h>
-#include <iba/ib_types.h>
-#include <opensm/osm_lin_fwd_tbl.h>
-
-static inline size_t __osm_lin_tbl_compute_obj_size(IN const uint16_t num_lids)
-{
-	return (sizeof(osm_lin_fwd_tbl_t) + (num_lids - 1));
-}
-
-/**********************************************************************
- **********************************************************************/
-osm_lin_fwd_tbl_t *osm_lin_tbl_new(IN uint16_t const size)
-{
-	osm_lin_fwd_tbl_t *p_tbl;
-
-	/*
-	   The capacity reported by the switch includes LID 0,
-	   so add 1 to the end of the range here for this assert.
-	 */
-	CL_ASSERT(size <= IB_LID_UCAST_END_HO + 1);
-	p_tbl =
-	    (osm_lin_fwd_tbl_t *) malloc(__osm_lin_tbl_compute_obj_size(size));
-
-	/*
-	   Initialize the table to OSM_NO_PATH, which means "invalid port"
-	 */
-	if (p_tbl != NULL) {
-		memset(p_tbl, OSM_NO_PATH, __osm_lin_tbl_compute_obj_size(size));
-		p_tbl->size = size;
-	}
-	return (p_tbl);
-}
-
-/**********************************************************************
- **********************************************************************/
-void osm_lin_tbl_delete(IN osm_lin_fwd_tbl_t ** const pp_tbl)
-{
-	free(*pp_tbl);
-	*pp_tbl = NULL;
-}
-- 
1.5.1.4





More information about the general mailing list