Skip to content

Commit

Permalink
[SAI] [SYNCD] Integrated SAI Package into syncd (#28)
Browse files Browse the repository at this point in the history
* SAI Integration into syncd

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Co-authored-by: Vivek Reddy Karri <vkarri@nvidia.com>
  • Loading branch information
vivekrnv and vivekrnv authored Mar 16, 2022
1 parent dd39b22 commit bd6896e
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,7 @@
url = ssh://git@github.com/nvidia-sonic/sonic-bluefield-packages
[submodule "src/sonic-p4rt/sonic-pins"]
path = src/sonic-p4rt/sonic-pins
url = https://github.com/Azure/sonic-pins.git
url = https://github.com/Azure/sonic-pins.git
[submodule "platform/nvidia-bluefield/dpu-sai/sai-dpu"]
path = platform/nvidia-bluefield/dpu-sai/sai-dpu
url = ssh://git@github.com/nvidia-sonic/sai-dpu
36 changes: 36 additions & 0 deletions platform/nvidia-bluefield/dpu-sai/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES.
# Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -ex

DPU_SAI_TAR = mlnx-sai.1.mlnx.${DPU_SAI_VERSION}-master.orig.tar.gz

$(addprefix $(DEST)/, $(DPU_SAI)): $(DEST)/% :

pushd sai-dpu
pushd mlnx_sai

chmod +x autogen.sh
# Build the package
debuild -e 'make_extra_flags="DEFS=-DACS_OS"' -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR)

popd

mv $* $(DEST)/
popd
1 change: 1 addition & 0 deletions platform/nvidia-bluefield/dpu-sai/sai-dpu
Submodule sai-dpu added at 186e9b
4 changes: 2 additions & 2 deletions platform/nvidia-bluefield/recipes/docker-syncd-bluefield.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ $(DOCKER_SYNCD_BASE)_RUN_OPT += --privileged -t
$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

$(DOCKER_SYNCD_BASE)_DEPENDS += $(MFT) $(SDN_APPL)
$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(LIBSWSSCOMMON_DBG)
$(DOCKER_SYNCD_BASE)_DEPENDS += $(MFT) $(SDN_APPL) $(DPU_SAI)
$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(LIBSWSSCOMMON_DBG) $(DPU_SAI_DBGSYM)

$(DOCKER_SYNCD_BASE)_VERSION = 1.0.0
$(DOCKER_SYNCD_BASE)_PACKAGE_NAME = syncd
Expand Down
21 changes: 21 additions & 0 deletions platform/nvidia-bluefield/recipes/dpu-sai.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# DPKG FRK

SPATH := $($(DPU_SAI)_SRC_PATH)
SLINKS := $(shell find $(SPATH) -type l -exec echo {} \; | grep -Ev ' ')
SMDEP_PATHS := $(shell git submodule status --recursive -- $(SPATH) | awk '{print $$2}' | grep -Ev ' ')
SMDEP_FILES := $(foreach path,$(SMDEP_PATHS),$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/,$(shell cd $(path) && git ls-files | grep -Ev ' '))))
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/$(RECIPE_DIR)/dpu-sai.mk $(PLATFORM_PATH)/$(RECIPE_DIR)/dpu-sai.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(filter-out $(SMDEP_PATHS),$(shell git ls-files -- $(SPATH) | grep -Ev ' '))

$(DPU_SAI)_CACHE_MODE := GIT_CONTENT_SHA
$(DPU_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DPU_SAI)_DEP_FILES := $(filter-out $(SLINKS),$(DEP_FILES))
$(DPU_SAI)_SMDEP_FILES := $(filter-out $(SLINKS),$(SMDEP_FILES))
$(DPU_SAI)_SMDEP_PATHS := $(SMDEP_PATHS)

$(DPU_SAI_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA
$(DPU_SAI_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DPU_SAI_DBGSYM)_DEP_FILES := $(filter-out $(SLINKS),$(DEP_FILES))
$(DPU_SAI_DBGSYM)_SMDEP_FILES := $(filter-out $(SLINKS),$(SMDEP_FILES))
$(DPU_SAI_DBGSYM)_SMDEP_PATHS := $(SMDEP_PATHS)
29 changes: 29 additions & 0 deletions platform/nvidia-bluefield/recipes/dpu-sai.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES.
# Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

DPU_SAI_VERSION = SAIRel0.0.0.3

export DPU_SAI_VERSION

DPU_SAI = mlnx-sai_1.mlnx.$(DPU_SAI_VERSION)_arm64.deb
$(DPU_SAI)_SRC_PATH = $(PLATFORM_PATH)/dpu-sai

DPU_SAI_DBGSYM = mlnx-sai-dbgsym_1.mlnx.$(DPU_SAI_VERSION)_arm64.deb
$(eval $(call add_derived_package,$(DPU_SAI),$(DPU_SAI_DBGSYM)))
SONIC_MAKE_DEBS += $(DPU_SAI)

export DPU_SAI
1 change: 1 addition & 0 deletions platform/nvidia-bluefield/rules.dep
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ include $(PLATFORM_PATH)/$(RECIPE_DIR)/bootimages.dep
include $(PLATFORM_PATH)/$(RECIPE_DIR)/bfscripts.dep
include $(PLATFORM_PATH)/$(RECIPE_DIR)/platform-modules-bf2.dep
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mft.dep
include $(PLATFORM_PATH)/$(RECIPE_DIR)/dpu-sai.dep
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlx-openipmi.dep
# include $(PLATFORM_PATH)/$(RECIPE_DIR)/libpka.dep
include $(PLATFORM_PATH)/$(RECIPE_DIR)/installer-image.dep
1 change: 1 addition & 0 deletions platform/nvidia-bluefield/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ include $(PLATFORM_PATH)/$(RECIPE_DIR)/bootimages.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/bfscripts.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/platform-modules-bf2.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mft.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/dpu-sai.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/mlx-openipmi.mk
include $(PLATFORM_PATH)/$(RECIPE_DIR)/sdk.mk
# include $(PLATFORM_PATH)/$(RECIPE_DIR)/libpka.mk
Expand Down

0 comments on commit bd6896e

Please sign in to comment.