Skip to content

Commit

Permalink
Revert "sonic-sairedis: Add support to sonic-sairedis for gearbox phys (
Browse files Browse the repository at this point in the history
#624)" (#630)

This reverts commit 2772f15.
  • Loading branch information
daall authored Jun 27, 2020
1 parent 85e543c commit 61b8e8e
Show file tree
Hide file tree
Showing 76 changed files with 13 additions and 739 deletions.
8 changes: 4 additions & 4 deletions lib/src/context_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
{
"guid" : 1,
"name" : "syncd1",
"dbAsic" : "GB_ASIC_DB",
"dbCounters" : "GB_COUNTERS_DB",
"dbFlex": "GB_FLEX_COUNTER_DB",
"dbState" : "STATE_DB",
"dbAsic" : "ASIC_DB2",
"dbCounters" : "COUNTERS_DB2",
"dbFlex": "FLEX_COUNTER_DB2",
"dbState" : "STATE_DB2",
"switches": [
{
"index" : 0,
Expand Down
24 changes: 0 additions & 24 deletions lib/src/sai_redis_switch.cpp
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
#include "sai_redis.h"

sai_status_t redis_switch_mdio_read(
_In_ sai_object_id_t switch_id,
_In_ uint32_t device_addr,
_In_ uint32_t start_reg_addr,
_In_ uint32_t number_of_registers,
_Out_ uint32_t *reg_val)
{
SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t redis_switch_mdio_write(
_In_ sai_object_id_t switch_id,
_In_ uint32_t device_addr,
_In_ uint32_t start_reg_addr,
_In_ uint32_t number_of_registers,
_In_ const uint32_t *reg_val)
{
SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

REDIS_GENERIC_QUAD(SWITCH,switch);
REDIS_GENERIC_STATS(SWITCH,switch);

Expand Down
32 changes: 3 additions & 29 deletions syncd/SaiSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,13 @@ SaiSwitch::SaiSwitch(

helperInternalOids();

if (getSwitchType() == SAI_SWITCH_TYPE_NPU)
{
helperCheckLaneMap();
}
helperCheckLaneMap();

helperLoadColdVids();

helperPopulateWarmBootVids();

if (getSwitchType() == SAI_SWITCH_TYPE_NPU)
{
saiGetMacAddress(m_default_mac_address);
}
saiGetMacAddress(m_default_mac_address);

if (warmBoot)
{
Expand Down Expand Up @@ -137,26 +131,6 @@ void SaiSwitch::getDefaultMacAddress(
memcpy(mac, m_default_mac_address, sizeof(sai_mac_t));
}

sai_switch_type_t SaiSwitch::getSwitchType() const
{
SWSS_LOG_ENTER();

sai_attribute_t attr;

attr.id = SAI_SWITCH_ATTR_TYPE;

sai_status_t status = m_vendorSai->get(SAI_OBJECT_TYPE_SWITCH, m_switch_rid, 1, &attr);

if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_THROW("failed to get switch type");
}

SWSS_LOG_ERROR("switch type: '%s'", (attr.value.s32 == SAI_SWITCH_TYPE_NPU ? "SAI_SWITCH_TYPE_NPU" : "SAI_SWITCH_TYPE_PHY"));

return (sai_switch_type_t) attr.value.s32;
}

#define MAX_HARDWARE_INFO_LENGTH 0x1000

std::string SaiSwitch::saiGetHardwareInfo() const
Expand Down Expand Up @@ -911,7 +885,7 @@ void SaiSwitch::helperPopulateWarmBootVids()
{
sai_object_id_t vid = m_translator->translateRidToVid(rid, m_switch_vid);

m_warmBootDiscoveredVids.insert(vid);
m_warmBootDiscoveredVids.insert(vid);
}
}

Expand Down
1 change: 0 additions & 1 deletion syncd/SaiSwitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ namespace syncd
sai_object_id_t getVid() const;
sai_object_id_t getRid() const;

sai_switch_type_t getSwitchType() const;
std::string getHardwareInfo() const;

std::unordered_map<sai_object_id_t, sai_object_id_t> getVidToRidMap() const;
Expand Down
7 changes: 0 additions & 7 deletions syncd/scripts/physyncd_start.sh

This file was deleted.

48 changes: 0 additions & 48 deletions syncd/scripts/physyncd_startup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ if SAITHRIFT
vssyncd_LDADD += -lrpcserver -lthrift
endif

TESTS = aspellcheck.pl conflictnames.pl swsslogentercheck.sh BCM56850.pl MLNX2700.pl
TESTS = aspellcheck.pl conflictnames.pl swsslogentercheck.sh brcm.pl mlnx.pl
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
104 changes: 0 additions & 104 deletions vslib/inc/SwitchBCM81724.h

This file was deleted.

12 changes: 0 additions & 12 deletions vslib/inc/SwitchConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#include <string>
#include <memory>

extern "C" {
#include "sai.h" // for sai_switch_type_t
}

namespace saivs
{
typedef enum _sai_vs_switch_type_t
Expand All @@ -18,8 +14,6 @@ namespace saivs

SAI_VS_SWITCH_TYPE_BCM56850,

SAI_VS_SWITCH_TYPE_BCM81724,

SAI_VS_SWITCH_TYPE_MLNX2700,

} sai_vs_switch_type_t;
Expand All @@ -44,10 +38,6 @@ namespace saivs

public:

static bool parseSaiSwitchType(
_In_ const char* saiSwitchTypeStr,
_Out_ sai_switch_type_t& saiSwitchType);

static bool parseSwitchType(
_In_ const char* switchTypeStr,
_Out_ sai_vs_switch_type_t& switchType);
Expand All @@ -61,8 +51,6 @@ namespace saivs

public:

sai_switch_type_t m_saiSwitchType;

sai_vs_switch_type_t m_switchType;

sai_vs_boot_type_t m_bootType;
Expand Down
5 changes: 0 additions & 5 deletions vslib/inc/saivs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ extern "C" {
}

#define SAI_KEY_VS_SWITCH_TYPE "SAI_VS_SWITCH_TYPE"
#define SAI_KEY_VS_SAI_SWITCH_TYPE "SAI_VS_SAI_SWITCH_TYPE"

#define SAI_VALUE_SAI_SWITCH_TYPE_NPU "SAI_SWITCH_TYPE_NPU"
#define SAI_VALUE_SAI_SWITCH_TYPE_PHY "SAI_SWITCH_TYPE_PHY"

/**
* @def SAI_KEY_VS_INTERFACE_LANE_MAP_FILE
Expand All @@ -35,7 +31,6 @@ extern "C" {
#define SAI_KEY_VS_HOSTIF_USE_TAP_DEVICE "SAI_VS_HOSTIF_USE_TAP_DEVICE"

#define SAI_VALUE_VS_SWITCH_TYPE_BCM56850 "SAI_VS_SWITCH_TYPE_BCM56850"
#define SAI_VALUE_VS_SWITCH_TYPE_BCM81724 "SAI_VS_SWITCH_TYPE_BCM81724"
#define SAI_VALUE_VS_SWITCH_TYPE_MLNX2700 "SAI_VS_SWITCH_TYPE_MLNX2700"

/*
Expand Down
1 change: 0 additions & 1 deletion vslib/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ libSaiVS_a_SOURCES = \
SelectableFd.cpp \
SwitchState.cpp \
SwitchBCM56850.cpp \
SwitchBCM81724.cpp \
SwitchMLNX2700.cpp

libsaivs_la_SOURCES = \
Expand Down
19 changes: 1 addition & 18 deletions vslib/src/Sai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,6 @@ sai_status_t Sai::initialize(
return SAI_STATUS_FAILURE;
}

auto sai_switch_type = service_method_table->profile_get_value(0, SAI_KEY_VS_SAI_SWITCH_TYPE);
sai_switch_type_t saiSwitchType;

if (sai_switch_type == NULL)
{
SWSS_LOG_NOTICE("failed to obtain service method table value: %s", SAI_KEY_VS_SAI_SWITCH_TYPE);
saiSwitchType = SAI_SWITCH_TYPE_NPU;
}
else if (!SwitchConfig::parseSaiSwitchType(sai_switch_type, saiSwitchType))
{
return SAI_STATUS_FAILURE;
}

auto *laneMapFile = service_method_table->profile_get_value(0, SAI_KEY_VS_INTERFACE_LANE_MAP_FILE);

m_laneMapContainer = LaneMapFileParser::parseLaneMapFile(laneMapFile);
Expand Down Expand Up @@ -141,7 +128,6 @@ sai_status_t Sai::initialize(

auto sc = std::make_shared<SwitchConfig>();

sc->m_saiSwitchType = saiSwitchType;
sc->m_switchType = switchType;
sc->m_bootType = bootType;
sc->m_switchIndex = 0;
Expand Down Expand Up @@ -175,10 +161,7 @@ sai_status_t Sai::initialize(

startUnittestThread();

if (saiSwitchType == SAI_SWITCH_TYPE_NPU)
{
startFdbAgingThread();
}
startFdbAgingThread();

m_apiInitialized = true;

Expand Down
Loading

0 comments on commit 61b8e8e

Please sign in to comment.