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

syncd: Remove platform dependency code #138

Merged
merged 1 commit into from
Dec 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ Install prerequisite packages:

sudo apt-get install libswsscommon libswsscommon-dev

Before compiling, you will need to set an environmental variable to indicate which 'SAI flavor' you are using.

export DEB_SAI_FLAVOR=[FLAVOR]

You can compile and install from source using:

./autogen.sh
./configure --with-sai=$(DEB_SAI_FLAVOR)
./configure
make && sudo make install

You can also build a debian package using:
Expand Down
6 changes: 0 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
AC_ARG_WITH(sai,
[ --with-sai Compiling against specific SAI],
[case "${withval}" in
bcm) sai=bcm ;;
mlnx) sai=mlnx ;;
cavm) sai=cavm ;;
vs) sai=vs ;;
*) AC_MSG_ERROR(bad value ${withval} for --with-sai) ;;
esac])
AM_CONDITIONAL(SAIBCM, test x$sai = xbcm)
AM_CONDITIONAL(SAIMLNX, test x$sai = xmlnx)
AM_CONDITIONAL(SAICAVM, test x$sai = xcavm)
AM_CONDITIONAL(SAIVS, test x$sai = xvs)

AC_ARG_ENABLE(rpcserver,
Expand Down
4 changes: 1 addition & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ include /usr/share/dpkg/default.mk
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

DEB_SAI_FLAVOR ?= "bcm"

# main packaging script based on dh7 syntax
%:
dh $@ --with autotools-dev
Expand All @@ -35,7 +33,7 @@ else
endif

override_dh_auto_configure:
dh_auto_configure -- --with-sai=$(DEB_SAI_FLAVOR) ${CONFIGURE_ARGS}
dh_auto_configure -- ${CONFIGURE_ARGS}

override_dh_installinit:
ifeq ($(saithrift), yes)
Expand Down
12 changes: 0 additions & 12 deletions syncd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ else
DBGFLAGS = -g
endif

if SAIBCM
SAIFLAGS = -DBRCMSAI
endif

if SAIMLNX
SAIFLAGS = -DMLNXSAI
endif

if SAICAVM
SAIFLAGS = -DCAVMSAI
endif

if SAIVS
SAILIB=-L$(top_srcdir)/vslib/src/.libs -lsaivs
else
Expand Down
12 changes: 3 additions & 9 deletions syncd/syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ void exit_and_notify(int status)
exit(status);
}

#ifdef BRCMSAI
void sai_diag_shell()
{
SWSS_LOG_ENTER();
Expand All @@ -88,7 +87,6 @@ void sai_diag_shell()
sleep(1);
}
}
#endif /* BRCMSAI */

sai_object_id_t redis_create_virtual_object_id(
_In_ sai_object_type_t object_type)
Expand Down Expand Up @@ -1730,18 +1728,14 @@ int main(int argc, char **argv)
exit_and_notify(EXIT_FAILURE);
}

#ifdef BRCMSAI

if (options.diagShell)
{
SWSS_LOG_NOTICE("starting bcm diag shell thread");
SWSS_LOG_NOTICE("starting diag shell thread");

std::thread bcm_diag_shell_thread = std::thread(sai_diag_shell);
bcm_diag_shell_thread.detach();
std::thread diag_shell_thread = std::thread(sai_diag_shell);
diag_shell_thread.detach();
}

#endif /* BRCMSAI */

#ifdef SAITHRIFT
if (options.run_rpc_server)
{
Expand Down