Skip to content

Commit

Permalink
Merge pull request #460 from opencomputeproject/master
Browse files Browse the repository at this point in the history
merge master into v1.0
  • Loading branch information
lguohan authored Mar 16, 2017
2 parents b501f8f + a2b6bb1 commit b816443
Show file tree
Hide file tree
Showing 74 changed files with 9,893 additions and 2,156 deletions.
Binary file added doc/OCP/SAI Demo 2017 topology.pdf
Binary file not shown.
File renamed without changes.
Binary file added doc/TAM/SAI-Proposal-TAM-v0.10.docx
Binary file not shown.
Binary file added doc/TAM/SAI-Proposal-TAM-v0.9.docx
Binary file not shown.
File renamed without changes.
Binary file added doc/object-model/pipeline_object_model.pdf
Binary file not shown.
62 changes: 40 additions & 22 deletions inc/sai.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "saibuffer.h"
#include "saifdb.h"
#include "saihash.h"
#include "saihostintf.h"
#include "saihostif.h"
#include "sailag.h"
#include "saimirror.h"
#include "saineighbor.h"
Expand All @@ -40,11 +40,11 @@
#include "saiobject.h"
#include "saipolicer.h"
#include "saiport.h"
#include "saiqosmaps.h"
#include "saiqosmap.h"
#include "saiqueue.h"
#include "sairoute.h"
#include "sairouter.h"
#include "sairouterintf.h"
#include "saivirtualrouter.h"
#include "sairouterinterface.h"
#include "saisamplepacket.h"
#include "saischedulergroup.h"
#include "saischeduler.h"
Expand All @@ -60,7 +60,7 @@
#include "sairpfgroup.h"
#include "sail2mcgroup.h"
#include "saiipmcgroup.h"
#include "saimcfdb.h"
#include "saimcastfdb.h"

/**
* @defgroup SAI SAI - Entry point specific API definitions.
Expand Down Expand Up @@ -89,18 +89,18 @@ typedef enum _sai_api_t
SAI_API_ROUTER_INTERFACE = 9, /**< sai_router_interface_api_t */
SAI_API_NEIGHBOR = 10, /**< sai_neighbor_api_t */
SAI_API_ACL = 11, /**< sai_acl_api_t */
SAI_API_HOST_INTERFACE = 12, /**< sai_host_interface_api_t */
SAI_API_HOSTIF = 12, /**< sai_hostif_api_t */
SAI_API_MIRROR = 13, /**< sai_mirror_api_t */
SAI_API_SAMPLEPACKET = 14, /**< sai_samplepacket_api_t */
SAI_API_STP = 15, /**< sai_stp_api_t */
SAI_API_LAG = 16, /**< sai_lag_api_t */
SAI_API_POLICER = 17, /**< sai_policer_api_t */
SAI_API_WRED = 18, /**< sai_wred_api_t */
SAI_API_QOS_MAPS = 19, /**< sai_qos_map_api_t */
SAI_API_QOS_MAP = 19, /**< sai_qos_map_api_t */
SAI_API_QUEUE = 20, /**< sai_queue_api_t */
SAI_API_SCHEDULER = 21, /**< sai_scheduler_api_t */
SAI_API_SCHEDULER_GROUP = 22, /**< sai_scheduler_group_api_t */
SAI_API_BUFFERS = 23, /**< sai_buffer_api_t */
SAI_API_BUFFER = 23, /**< sai_buffer_api_t */
SAI_API_HASH = 24, /**< sai_hash_api_t */
SAI_API_UDF = 25, /**< sai_udf_api_t */
SAI_API_TUNNEL = 26, /**< sai_tunnel_api_t */
Expand All @@ -111,6 +111,7 @@ typedef enum _sai_api_t
SAI_API_IPMC_GROUP = 31, /**< sai_ipmc_group_api_t */
SAI_API_MCAST_FDB = 32, /**< sai_mcast_fdb_api_t */
SAI_API_BRIDGE = 33, /**< sai_bridge_api_t */
SAI_API_MAX = 34, /**< total number of apis */
} sai_api_t;

/**
Expand Down Expand Up @@ -138,6 +139,15 @@ typedef enum _sai_log_level_t

} sai_log_level_t;

typedef const char* (*sai_profile_get_value_fn)(
_In_ sai_switch_profile_id_t profile_id,
_In_ const char *variable);

typedef int (*sai_profile_get_next_value_fn)(
_In_ sai_switch_profile_id_t profile_id,
_Out_ const char** variable,
_Out_ const char** value);

/**
* @brief Method table that contains function pointers for services exposed by
* adapter host for adapter.
Expand All @@ -147,20 +157,15 @@ typedef struct _service_method_table_t
/**
* @brief Get variable value given its name
*/
const char* (*profile_get_value)(
_In_ sai_switch_profile_id_t profile_id,
_In_ const char *variable);
sai_profile_get_value_fn profile_get_value;

/**
* @brief Enumerate all the K/V pairs in a profile.
*
* Pointer to NULL passed as variable restarts enumeration. Function
* returns 0 if next value exists, -1 at the end of the list.
*/
int (*profile_get_next_value)(
_In_ sai_switch_profile_id_t profile_id,
_Out_ const char** variable,
_Out_ const char** value);
sai_profile_get_next_value_fn profile_get_next_value;

} service_method_table_t;

Expand Down Expand Up @@ -222,14 +227,27 @@ sai_object_type_t sai_object_type_query(
_In_ sai_object_id_t sai_object_id);

/**
* @brief Generate dump file. The dump file may include SAI state information and vendor SDK information.
*
* @param[in] dump_file_name Full path for dump file
*
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
*/
* @brief Query sai switch id.
*
* @param[in] sai_object_id Object id
*
* @return Return #SAI_NULL_OBJECT_ID when sai_object_id is not valid.
* Otherwise, return a valid SAI_OBJECT_TYPE_SWITCH object on which
* provided object id belongs. If valid switch id object is provided
* as input parameter it should returin itself.
*/
sai_object_id_t sai_switch_id_query(
_In_ sai_object_id_t sai_object_id);

/**
* @brief Generate dump file. The dump file may include SAI state information and vendor SDK information.
*
* @param[in] dump_file_name Full path for dump file
*
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
*/
sai_status_t sai_dbg_generate_dump(
_In_ const char *dump_file_name);
_In_ const char *dump_file_name);

/**
* @}
Expand Down
Loading

0 comments on commit b816443

Please sign in to comment.