-
Notifications
You must be signed in to change notification settings - Fork 5
Add infra for 2 p4 stack support #32
base: azure-buildimage
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"chip_list": [ | ||
{ | ||
"id": "asic-0", | ||
"chip_family": "Tofino", | ||
"instance": 0, | ||
"pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", | ||
"pcie_domain": 0, | ||
"pcie_bus": 5, | ||
"pcie_fn": 0, | ||
"pcie_dev": 0, | ||
"pcie_int_mode": 1, | ||
"sds_fw_path": "share/tofino_sds_fw/avago/firmware" | ||
} | ||
], | ||
"instance": 0, | ||
"p4_program_list": [ | ||
{ | ||
"id": "pgm-0", | ||
"instance": 0, | ||
"path": "switch", | ||
"program-name": "switch", | ||
"table-config": "share/tofinopd/switch/pipe/context.json", | ||
"tofino-bin": "share/tofinopd/switch/pipe/tofino.bin", | ||
"switchsai": "lib/libswitchsai.so", | ||
"agent0": "lib/platform/x86_64-accton_wedge100bf_32x-r0/libpltfm_mgr.so", | ||
"bfrt-config" : "share/tofinopd/switch/bf-rt.json", | ||
"model_json_path" : "share/switch/aug_model.json" | ||
"switchapi_port_add": false, | ||
"non_default_port_ppgs": 5 | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"chip_list": [ | ||
{ | ||
"id": "asic-0", | ||
"chip_family": "Tofino", | ||
"instance": 0, | ||
"pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", | ||
"pcie_domain": 0, | ||
"pcie_bus": 5, | ||
"pcie_fn": 0, | ||
"pcie_dev": 0, | ||
"pcie_int_mode": 1, | ||
"sds_fw_path": "share/tofino_sds_fw/avago/firmware" | ||
} | ||
], | ||
"instance": 0, | ||
"p4_program_list": [ | ||
{ | ||
"id": "pgm-0", | ||
"instance": 0, | ||
"path": "switch", | ||
"program-name": "switch", | ||
"table-config": "share/tofinopd/switch/pipe/context.json", | ||
"tofino-bin": "share/tofinopd/switch/pipe/tofino.bin", | ||
"switchsai": "lib/libswitchsai.so", | ||
"agent0": "lib/platform/x86_64-accton_wedge100bf_65x-r0/libpltfm_mgr.so", | ||
"bfrt-config" : "share/tofinopd/switch/bf-rt.json", | ||
"model_json_path" : "share/switch/aug_model.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add comma EOL |
||
"switchapi_port_add": false, | ||
"non_default_port_ppgs": 5 | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
BFN_PLATFORM = bfnplatform_1.0.0_amd64.deb | ||
$(BFN_PLATFORM)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/sde-sai1.3.3/bfnplatform_1.0.0_amd64.deb" | ||
|
||
ifeq ($(CONFIGURED_P4_STACK),p4_16) | ||
$(BFN_PLATFORM)_PATH = /sonic # use local path, should be changed as soon as we released p4-16 and make pub available | ||
SONIC_COPY_DEBS +=$(BFN_PLATFORM) | ||
else | ||
$(BFN_PLATFORM)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/sde-sai1.3.3/bfnplatform_1.0.0_amd64.deb" | ||
SONIC_ONLINE_DEBS += $(BFN_PLATFORM) # $(BFN_SAI_DEV) | ||
endif | ||
|
||
$(BFN_SAI_DEV)_DEPENDS += $(BFN_PLATFORM) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
BFN_SAI = bfnsdk_1.0.0_amd64.deb | ||
$(BFN_SAI)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/sde-sai1.3.3/bfnsdk_1.0.0_amd64.deb" | ||
|
||
ifeq ($(CONFIGURED_P4_STACK),p4_16) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we do not plan to merge to the upstream p4_16/p4_14 stack selection infrastructure at this moment, probably we can use the same approach but without mentioning p4_16, just to expose the approach itself. Also, we can use this methodology to either build from public DEB package or from the sources $(BFN_SAI)_PATH. Again, without mentioning p4_16. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it will have to be transparent. For same switch.p4 profile, we dont need to maintain both p4-14 and p4-16 versions. |
||
$(BFN_SAI)_PATH = /sonic # use local path, should be changed to URL as soon as we released p4-16 and make pub available | ||
SONIC_COPY_DEBS +=$(BFN_SAI) | ||
else | ||
$(BFN_SAI)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/sde-sai1.3.3/bfnsdk_1.0.0_amd64.deb" | ||
SONIC_ONLINE_DEBS += $(BFN_SAI) # $(BFN_SAI_DEV) | ||
endif | ||
|
||
$(BFN_SAI_DEV)_DEPENDS += $(BFN_SAI) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ debs/{{ deb }}{{' '}} | |
{%- endfor -%} | ||
debs/ | ||
|
||
RUN apt-get install -y libxml2 libpcap-dev libusb-1.0-0-dev libcurl3 libcurl4-gnutls-dev libunwind8-dev libpython3.4 | ||
RUN apt-get install -y libxml2 libpcap-dev libusb-1.0-0-dev libcurl3 libcurl4-gnutls-dev libunwind8-dev libpython3.4 libc-ares2 libgoogle-perftools4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why we aren't making it a dependency of our .deb package? |
||
|
||
RUN dpkg -i \ | ||
{% for deb in docker_syncd_bfn_debs.split(' ') -%} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[Unit] | ||
|
||
Description=Barefoot P4 stack cofiguration service | ||
Before=syncd.service | ||
After=database.service | ||
[Service] | ||
|
||
Type=oneshot | ||
{% if CONFIGURED_P4_STACK is not defined %} | ||
{% set CONFIGURED_P4_STACK= 'p4_14' %} | ||
{% endif %} | ||
Environment=P4_STACK={{ CONFIGURED_P4_STACK }} | ||
|
||
ExecStart=/bin/bash -c ' \ | ||
PLATFORM=$(/usr/local/bin/sonic-cfggen -H -v 'DEVICE_METADATA.localhost.platform'); \ | ||
HWSKU=$(/usr/local/bin/sonic-cfggen -d -v 'DEVICE_METADATA.localhost.hwsku'); \ | ||
cd /usr/share/sonic/device/$PLATFORM/$HWSKU; \ | ||
[[ "$P4_STACK" == "p4_16" ]] && \ | ||
ln -s switch-sai.p416.conf switch-sai.conf || \ | ||
ln -s switch-sai.p414.conf switch-sai.conf' | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,8 @@ RUN apt-get update && apt-get install -y \ | |
libcurl3-nss-dev \ | ||
libunwind8-dev \ | ||
telnet \ | ||
libc-ares2 \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why we aren't making this the dependencies of our .deb package? (Install them with our .dev) |
||
libgoogle-perftools4 \ | ||
NStetskovych-zz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# For build image | ||
cpio \ | ||
squashfs-tools \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add comma EOL