Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of mdio IPC server class using sai switch api and unix so… #1080

Merged
merged 12 commits into from
Jul 28, 2022
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ AX_CODE_COVERAGE
AX_ADD_AM_MACRO_STATIC([])

AM_CONDITIONAL(SONIC_ASIC_PLATFORM_BAREFOOT, test x$CONFIGURED_PLATFORM = xbarefoot)
AM_CONDITIONAL(SONIC_ASIC_PLATFORM_BROADCOM, test x$CONFIGURED_PLATFORM = xbroadcom)

AC_ARG_ENABLE(debug,
[ --enable-debug turn on debugging],
Expand Down
48 changes: 48 additions & 0 deletions meta/SaiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,51 @@ sai_status_t SaiInterface::get(
return SAI_STATUS_FAILURE;
}
}

sai_status_t SaiInterface::switchMdioRead(
_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_FAILURE;
}

sai_status_t SaiInterface::switchMdioWrite(
_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_FAILURE;
}

sai_status_t SaiInterface::switchMdioCl22Read(
_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_FAILURE;
}

sai_status_t SaiInterface::switchMdioCl22Write(
_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_FAILURE;
}
28 changes: 28 additions & 0 deletions meta/SaiInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,34 @@ namespace sairedis
_In_ uint32_t attrCount,
_In_ const sai_attribute_t *attrList) = 0;

virtual sai_status_t switchMdioRead(
_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);

virtual sai_status_t switchMdioWrite(
_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);

virtual sai_status_t switchMdioCl22Read(
_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);

virtual sai_status_t switchMdioCl22Write(
_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);

public: // SAI API

virtual sai_status_t objectTypeGetAvailability(
Expand Down
5 changes: 5 additions & 0 deletions syncd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ libSyncd_a_SOURCES = \
FlexCounterManager.cpp \
GlobalSwitchId.cpp \
HardReiniter.cpp \
MdioIpcServer.cpp \
MetadataLogger.cpp \
NotificationHandler.cpp \
NotificationProcessor.cpp \
Expand Down Expand Up @@ -71,6 +72,10 @@ syncd_CXXFLAGS += -DSAITHRIFT=yes
syncd_LDADD += -lrpcserver -lthrift
endif

if SONIC_ASIC_PLATFORM_BROADCOM
libSyncd_a_CXXFLAGS += -DMDIO_ACCESS_USE_NPU
endif

libSyncdRequestShutdown_a_SOURCES = \
RequestShutdown.cpp \
RequestShutdownCommandLineOptions.cpp \
Expand Down
Loading