Skip to content

Commit 61b8e8e

Browse files
authored
Revert "sonic-sairedis: Add support to sonic-sairedis for gearbox phys (sonic-net#624)" (sonic-net#630)
This reverts commit 2772f15.
1 parent 85e543c commit 61b8e8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+13
-739
lines changed

lib/src/context_config.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
{
2222
"guid" : 1,
2323
"name" : "syncd1",
24-
"dbAsic" : "GB_ASIC_DB",
25-
"dbCounters" : "GB_COUNTERS_DB",
26-
"dbFlex": "GB_FLEX_COUNTER_DB",
27-
"dbState" : "STATE_DB",
24+
"dbAsic" : "ASIC_DB2",
25+
"dbCounters" : "COUNTERS_DB2",
26+
"dbFlex": "FLEX_COUNTER_DB2",
27+
"dbState" : "STATE_DB2",
2828
"switches": [
2929
{
3030
"index" : 0,

lib/src/sai_redis_switch.cpp

-24
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
#include "sai_redis.h"
22

3-
sai_status_t redis_switch_mdio_read(
4-
_In_ sai_object_id_t switch_id,
5-
_In_ uint32_t device_addr,
6-
_In_ uint32_t start_reg_addr,
7-
_In_ uint32_t number_of_registers,
8-
_Out_ uint32_t *reg_val)
9-
{
10-
SWSS_LOG_ENTER();
11-
12-
return SAI_STATUS_NOT_IMPLEMENTED;
13-
}
14-
15-
sai_status_t redis_switch_mdio_write(
16-
_In_ sai_object_id_t switch_id,
17-
_In_ uint32_t device_addr,
18-
_In_ uint32_t start_reg_addr,
19-
_In_ uint32_t number_of_registers,
20-
_In_ const uint32_t *reg_val)
21-
{
22-
SWSS_LOG_ENTER();
23-
24-
return SAI_STATUS_NOT_IMPLEMENTED;
25-
}
26-
273
REDIS_GENERIC_QUAD(SWITCH,switch);
284
REDIS_GENERIC_STATS(SWITCH,switch);
295

syncd/SaiSwitch.cpp

+3-29
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,13 @@ SaiSwitch::SaiSwitch(
5959

6060
helperInternalOids();
6161

62-
if (getSwitchType() == SAI_SWITCH_TYPE_NPU)
63-
{
64-
helperCheckLaneMap();
65-
}
62+
helperCheckLaneMap();
6663

6764
helperLoadColdVids();
6865

6966
helperPopulateWarmBootVids();
7067

71-
if (getSwitchType() == SAI_SWITCH_TYPE_NPU)
72-
{
73-
saiGetMacAddress(m_default_mac_address);
74-
}
68+
saiGetMacAddress(m_default_mac_address);
7569

7670
if (warmBoot)
7771
{
@@ -137,26 +131,6 @@ void SaiSwitch::getDefaultMacAddress(
137131
memcpy(mac, m_default_mac_address, sizeof(sai_mac_t));
138132
}
139133

140-
sai_switch_type_t SaiSwitch::getSwitchType() const
141-
{
142-
SWSS_LOG_ENTER();
143-
144-
sai_attribute_t attr;
145-
146-
attr.id = SAI_SWITCH_ATTR_TYPE;
147-
148-
sai_status_t status = m_vendorSai->get(SAI_OBJECT_TYPE_SWITCH, m_switch_rid, 1, &attr);
149-
150-
if (status != SAI_STATUS_SUCCESS)
151-
{
152-
SWSS_LOG_THROW("failed to get switch type");
153-
}
154-
155-
SWSS_LOG_ERROR("switch type: '%s'", (attr.value.s32 == SAI_SWITCH_TYPE_NPU ? "SAI_SWITCH_TYPE_NPU" : "SAI_SWITCH_TYPE_PHY"));
156-
157-
return (sai_switch_type_t) attr.value.s32;
158-
}
159-
160134
#define MAX_HARDWARE_INFO_LENGTH 0x1000
161135

162136
std::string SaiSwitch::saiGetHardwareInfo() const
@@ -911,7 +885,7 @@ void SaiSwitch::helperPopulateWarmBootVids()
911885
{
912886
sai_object_id_t vid = m_translator->translateRidToVid(rid, m_switch_vid);
913887

914-
m_warmBootDiscoveredVids.insert(vid);
888+
m_warmBootDiscoveredVids.insert(vid);
915889
}
916890
}
917891

syncd/SaiSwitch.h

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ namespace syncd
4141
sai_object_id_t getVid() const;
4242
sai_object_id_t getRid() const;
4343

44-
sai_switch_type_t getSwitchType() const;
4544
std::string getHardwareInfo() const;
4645

4746
std::unordered_map<sai_object_id_t, sai_object_id_t> getVidToRidMap() const;

syncd/scripts/physyncd_start.sh

-7
This file was deleted.

syncd/scripts/physyncd_startup.py

-48
This file was deleted.

tests/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ if SAITHRIFT
1919
vssyncd_LDADD += -lrpcserver -lthrift
2020
endif
2121

22-
TESTS = aspellcheck.pl conflictnames.pl swsslogentercheck.sh BCM56850.pl MLNX2700.pl
22+
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.

vslib/inc/SwitchBCM81724.h

-104
This file was deleted.

vslib/inc/SwitchConfig.h

-12
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
#include <string>
77
#include <memory>
88

9-
extern "C" {
10-
#include "sai.h" // for sai_switch_type_t
11-
}
12-
139
namespace saivs
1410
{
1511
typedef enum _sai_vs_switch_type_t
@@ -18,8 +14,6 @@ namespace saivs
1814

1915
SAI_VS_SWITCH_TYPE_BCM56850,
2016

21-
SAI_VS_SWITCH_TYPE_BCM81724,
22-
2317
SAI_VS_SWITCH_TYPE_MLNX2700,
2418

2519
} sai_vs_switch_type_t;
@@ -44,10 +38,6 @@ namespace saivs
4438

4539
public:
4640

47-
static bool parseSaiSwitchType(
48-
_In_ const char* saiSwitchTypeStr,
49-
_Out_ sai_switch_type_t& saiSwitchType);
50-
5141
static bool parseSwitchType(
5242
_In_ const char* switchTypeStr,
5343
_Out_ sai_vs_switch_type_t& switchType);
@@ -61,8 +51,6 @@ namespace saivs
6151

6252
public:
6353

64-
sai_switch_type_t m_saiSwitchType;
65-
6654
sai_vs_switch_type_t m_switchType;
6755

6856
sai_vs_boot_type_t m_bootType;

vslib/inc/saivs.h

-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ extern "C" {
55
}
66

77
#define SAI_KEY_VS_SWITCH_TYPE "SAI_VS_SWITCH_TYPE"
8-
#define SAI_KEY_VS_SAI_SWITCH_TYPE "SAI_VS_SAI_SWITCH_TYPE"
9-
10-
#define SAI_VALUE_SAI_SWITCH_TYPE_NPU "SAI_SWITCH_TYPE_NPU"
11-
#define SAI_VALUE_SAI_SWITCH_TYPE_PHY "SAI_SWITCH_TYPE_PHY"
128

139
/**
1410
* @def SAI_KEY_VS_INTERFACE_LANE_MAP_FILE
@@ -35,7 +31,6 @@ extern "C" {
3531
#define SAI_KEY_VS_HOSTIF_USE_TAP_DEVICE "SAI_VS_HOSTIF_USE_TAP_DEVICE"
3632

3733
#define SAI_VALUE_VS_SWITCH_TYPE_BCM56850 "SAI_VS_SWITCH_TYPE_BCM56850"
38-
#define SAI_VALUE_VS_SWITCH_TYPE_BCM81724 "SAI_VS_SWITCH_TYPE_BCM81724"
3934
#define SAI_VALUE_VS_SWITCH_TYPE_MLNX2700 "SAI_VS_SWITCH_TYPE_MLNX2700"
4035

4136
/*

vslib/src/Makefile.am

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ libSaiVS_a_SOURCES = \
4545
SelectableFd.cpp \
4646
SwitchState.cpp \
4747
SwitchBCM56850.cpp \
48-
SwitchBCM81724.cpp \
4948
SwitchMLNX2700.cpp
5049

5150
libsaivs_la_SOURCES = \

vslib/src/Sai.cpp

+1-18
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,6 @@ sai_status_t Sai::initialize(
9494
return SAI_STATUS_FAILURE;
9595
}
9696

97-
auto sai_switch_type = service_method_table->profile_get_value(0, SAI_KEY_VS_SAI_SWITCH_TYPE);
98-
sai_switch_type_t saiSwitchType;
99-
100-
if (sai_switch_type == NULL)
101-
{
102-
SWSS_LOG_NOTICE("failed to obtain service method table value: %s", SAI_KEY_VS_SAI_SWITCH_TYPE);
103-
saiSwitchType = SAI_SWITCH_TYPE_NPU;
104-
}
105-
else if (!SwitchConfig::parseSaiSwitchType(sai_switch_type, saiSwitchType))
106-
{
107-
return SAI_STATUS_FAILURE;
108-
}
109-
11097
auto *laneMapFile = service_method_table->profile_get_value(0, SAI_KEY_VS_INTERFACE_LANE_MAP_FILE);
11198

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

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

144-
sc->m_saiSwitchType = saiSwitchType;
145131
sc->m_switchType = switchType;
146132
sc->m_bootType = bootType;
147133
sc->m_switchIndex = 0;
@@ -175,10 +161,7 @@ sai_status_t Sai::initialize(
175161

176162
startUnittestThread();
177163

178-
if (saiSwitchType == SAI_SWITCH_TYPE_NPU)
179-
{
180-
startFdbAgingThread();
181-
}
164+
startFdbAgingThread();
182165

183166
m_apiInitialized = true;
184167

0 commit comments

Comments
 (0)