Skip to content

Commit

Permalink
syncd: adding MLNX SAI support (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
stcheng committed Apr 13, 2016
1 parent 1bd83ea commit a46543a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions syncd/syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
swss::Table *g_vidToRid = NULL;
swss::Table *g_ridToVid = NULL;

std::map<std::string, std::string> gProfileMap;

void sai_diag_shell()
{
sai_status_t status;
Expand Down Expand Up @@ -160,10 +162,13 @@ const char* dummy_profile_get_value(
_In_ sai_switch_profile_id_t profile_id,
_In_ const char* variable)
{
UNREFERENCED_PARAMETER(profile_id);
UNREFERENCED_PARAMETER(variable);
auto it = gProfileMap.find(variable);

if (it == gProfileMap.end())
return NULL;

return it->second.c_str();

return NULL;
}

int dummy_profile_get_next_value(
Expand Down Expand Up @@ -555,6 +560,11 @@ int main(int argc, char **argv)
getRequest = new swss::ConsumerTable(db, "GETREQUEST");
getResponse = new swss::ProducerTable(db, "GETRESPONSE");

#ifdef MLNXSAI
std::string mlnx_config_file = "/etc/ssw/ACS-MSN2700/sai_2700.xml";
gProfileMap[SAI_KEY_INIT_CONFIG_FILE] = mlnx_config_file;
#endif /* MLNX_SAI */

sai_api_initialize(0, (service_method_table_t*)&test_services);

populate_sai_apis();
Expand Down

0 comments on commit a46543a

Please sign in to comment.