Skip to content

Commit

Permalink
Merge pull request facebook#1 from adamcalabrigo/fb_merge_1_30_2023
Browse files Browse the repository at this point in the history
Facebook: merge upstream FBOSS 1/30
  • Loading branch information
adamcalabrigo authored Feb 1, 2023
2 parents 8c0f5a3 + 7b05d41 commit 7b35f6a
Show file tree
Hide file tree
Showing 165 changed files with 1,971 additions and 1,452 deletions.
43 changes: 1 addition & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -543,19 +543,12 @@ if (NOT SAI_ONLY)
fboss/agent/platforms/wedge/oss/WedgePlatform.cpp
)

add_executable(qsfp_service
fboss/qsfp_service/QsfpServer.cpp
fboss/qsfp_service/oss/QsfpServer.cpp
fboss/qsfp_service/Main.cpp
fboss/qsfp_service/QsfpServiceHandler.cpp
fboss/qsfp_service/QsfpServiceSignalHandler.cpp
)

# TODO (skhare) refactor fboss_agent and remove this library
add_library(switch_asics_old STATIC
fboss/agent/hw/switch_asics/FakeAsic.h
fboss/agent/hw/switch_asics/HwAsic.cpp
fboss/agent/hw/switch_asics/HwAsic.h
fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp
fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp
fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp
fboss/agent/hw/switch_asics/TomahawkAsic.cpp
Expand Down Expand Up @@ -980,46 +973,12 @@ if (NOT SAI_ONLY)

target_link_libraries(switch_asics_old fboss_agent)
target_link_libraries(wedge_agent fboss_agent)
target_link_libraries(qsfp_service
qsfp_module
fboss_agent
qsfp_config
phy_management_base
transceiver_manager
qsfp_platforms_wedge
)

add_executable(cp2112_util
fboss/util/cp2112_util.cpp
)
target_link_libraries(cp2112_util fboss_agent)

add_executable(wedge_qsfp_util
fboss/util/wedge_qsfp_util.cpp
fboss/util/qsfp_util_main.cpp
fboss/util/qsfp/QsfpUtilTx.cpp
fboss/util/qsfp/QsfpServiceDetector.cpp
fboss/util/oss/wedge_qsfp_util.cpp
fboss/lib/firmware_storage/FbossFirmware.cpp
fboss/lib/firmware_storage/FbossFirmware.h
fboss/lib/firmware_storage/FbossFwStorage.cpp
fboss/lib/firmware_storage/FbossFwStorage.h
fboss/lib/i2c/CdbCommandBlock.h
fboss/lib/i2c/CdbCommandBlock.cpp
fboss/lib/i2c/FirmwareUpgrader.cpp
fboss/lib/i2c/FirmwareUpgrader.h
)
target_link_libraries(wedge_qsfp_util
fboss_agent
qsfp_config
qsfp_lib
qsfp_module
${YAML-CPP}
phy_management_base
transceiver_manager
qsfp_platforms_wedge
)

# Don't include fboss/agent/test/ArpBenchmark.cpp
# It depends on the Sim implementation and needs its own target
add_executable(agent_test
Expand Down
2 changes: 1 addition & 1 deletion build/deps/github_hashes/facebook/fbthrift-rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Subproject commit ab1112009f1845f6f9968c89018354317695f619
Subproject commit f90c9696176ff4951b4361614e9287aaff34115a
2 changes: 1 addition & 1 deletion build/deps/github_hashes/facebook/folly-rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Subproject commit f31c77b8aecc0fcd2a94872183dc298a3581ba8f
Subproject commit 22b89282c9d3bb56a625b7def37f42e8cdd93dd0
2 changes: 1 addition & 1 deletion build/deps/github_hashes/facebook/wangle-rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Subproject commit 78f3f7a39b0badc855cbfd14fa5adfff54b7d078
Subproject commit 57f32870d5b451b8d17fe4250c26646955421157
6 changes: 4 additions & 2 deletions build/fbcode_builder/getdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,10 @@ def run_project_cmd(self, args, loader, manifest):
)
builder.build(install_dirs, reconfigure=reconfigure)

with open(built_marker, "w") as f:
f.write(project_hash)
# Update built_marker only if user hasn't built a specific target
if m == manifest and args.cmake_target == "install":
with open(built_marker, "w") as f:
f.write(project_hash)

# Only populate the cache from continuous build runs
if args.schedule_type == "continuous":
Expand Down
3 changes: 3 additions & 0 deletions build/fbcode_builder/manifests/fboss
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ nlohmann-json
fbcode/fboss/github = .
fbcode/fboss/common = common
fbcode/fboss = fboss

[sandcastle]
run_tests = off
29 changes: 29 additions & 0 deletions cmake/AgentBenchmarks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,32 @@ add_library(agent_benchmarks
target_link_libraries(agent_benchmarks
agent_ensemble
)


add_library(bcm_agent_benchmarks_main
fboss/agent/benchmarks/AgentBenchmarksMain.cpp
fboss/agent/benchmarks/bcm/AgentBenchmarksMain.cpp
)

target_link_libraries(bcm_agent_benchmarks_main
agent_benchmarks
Folly::folly
platform
)

add_library(sai_agent_benchmarks_main
fboss/agent/benchmarks/AgentBenchmarksMain.cpp
fboss/agent/benchmarks/sai/AgentBenchmarksMain.cpp
)

target_link_libraries(sai_agent_benchmarks_main
agent_benchmarks
Folly::folly
sai_platform
)

set_target_properties(sai_agent_benchmarks_main PROPERTIES COMPILE_FLAGS
"-DSAI_VER_MAJOR=${SAI_VER_MAJOR} \
-DSAI_VER_MINOR=${SAI_VER_MINOR} \
-DSAI_VER_RELEASE=${SAI_VER_RELEASE}"
)
10 changes: 5 additions & 5 deletions cmake/AgentHwBcmBenchmarks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ add_executable(bcm_init_and_exit_40Gx10G /dev/null)

target_link_libraries(bcm_init_and_exit_40Gx10G
-Wl,--whole-archive
bcm_switch_ensemble
bcm_agent_benchmarks_main
bcm_copp_utils
config_factory
hw_init_and_exit_40Gx10G
Expand All @@ -264,7 +264,7 @@ add_executable(bcm_init_and_exit_100Gx10G /dev/null)

target_link_libraries(bcm_init_and_exit_100Gx10G
-Wl,--whole-archive
bcm_switch_ensemble
bcm_agent_benchmarks_main
bcm_copp_utils
config_factory
hw_init_and_exit_100Gx10G
Expand All @@ -275,7 +275,7 @@ add_executable(bcm_init_and_exit_100Gx25G /dev/null)

target_link_libraries(bcm_init_and_exit_100Gx25G
-Wl,--whole-archive
bcm_switch_ensemble
bcm_agent_benchmarks_main
bcm_copp_utils
config_factory
hw_init_and_exit_100Gx25G
Expand All @@ -286,7 +286,7 @@ add_executable(bcm_init_and_exit_100Gx50G /dev/null)

target_link_libraries(bcm_init_and_exit_100Gx50G
-Wl,--whole-archive
bcm_switch_ensemble
bcm_agent_benchmarks_main
bcm_copp_utils
config_factory
hw_init_and_exit_100Gx50G
Expand All @@ -297,7 +297,7 @@ add_executable(bcm_init_and_exit_100Gx100G /dev/null)

target_link_libraries(bcm_init_and_exit_100Gx100G
-Wl,--whole-archive
bcm_switch_ensemble
bcm_agent_benchmarks_main
bcm_copp_utils
config_factory
hw_init_and_exit_100Gx100G
Expand Down
4 changes: 2 additions & 2 deletions cmake/AgentHwBenchmarks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ add_library(hw_init_and_exit_benchmark_helper

target_link_libraries(hw_init_and_exit_benchmark_helper
config_factory
hw_switch_ensemble
hw_benchmark_main
agent_ensemble
agent_benchmarks
route_scale_gen
prod_config_utils
Folly::folly
Expand Down
3 changes: 3 additions & 0 deletions cmake/AgentHwSaiSwitch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,21 @@ if (SAI_TAJO_IMPL)
fboss/agent/hw/sai/switch/npu/tajo/SaiSwitch.cpp
fboss/agent/hw/sai/switch/npu/tajo/SaiTamManager.cpp
fboss/agent/hw/sai/switch/npu/tajo/SaiPortManager.cpp
fboss/agent/hw/sai/switch/npu/tajo/SaiAclTableManager.cpp
)
elseif (SAI_BRCM_IMPL)
list(APPEND SAI_SWITCH_SRC
fboss/agent/hw/sai/switch/npu/bcm/SaiSwitch.cpp
fboss/agent/hw/sai/switch/npu/bcm/SaiTamManager.cpp
fboss/agent/hw/sai/switch/npu/bcm/SaiPortManager.cpp
fboss/agent/hw/sai/switch/oss/SaiAclTableManager.cpp
)
else()
list(APPEND SAI_SWITCH_SRC
fboss/agent/hw/sai/switch/oss/SaiSwitch.cpp
fboss/agent/hw/sai/switch/oss/SaiTamManager.cpp
fboss/agent/hw/sai/switch/oss/SaiPortManager.cpp
fboss/agent/hw/sai/switch/oss/SaiAclTableManager.cpp
)
endif()

Expand Down
1 change: 1 addition & 0 deletions cmake/AgentHwSwitchAsics.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ add_library(switch_asics
fboss/agent/hw/switch_asics/GaronneAsic.cpp
fboss/agent/hw/switch_asics/HwAsic.cpp
fboss/agent/hw/switch_asics/HwAsic.h
fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp
fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp
fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp
fboss/agent/hw/switch_asics/TomahawkAsic.cpp
Expand Down
1 change: 1 addition & 0 deletions cmake/AgentPlatformsSai.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ add_library(sai_platform
fboss/agent/platforms/sai/SaiKametPlatform.cpp

fboss/agent/platforms/sai/oss/SaiBcmMinipackPlatform.cpp
fboss/agent/platforms/sai/oss/SaiTajoPlatform.cpp
fboss/agent/platforms/sai/oss/SaiBcmGalaxyPlatformPort.cpp
fboss/agent/platforms/sai/oss/SaiBcmMinipackPlatformPort.cpp
fboss/agent/platforms/sai/oss/SaiBcmFujiPlatformPort.cpp
Expand Down
14 changes: 14 additions & 0 deletions cmake/LibFirmwareStorage.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# CMake to build libraries and binaries in fboss/lib/firmware_storage

# In general, libraries and binaries in fboss/foo/bar are built by
# cmake/FooBar.cmake

add_library(firmware_storage
fboss/lib/firmware_storage/FbossFirmware.cpp
fboss/lib/firmware_storage/FbossFwStorage.cpp
)

target_link_libraries(firmware_storage
${YAML-CPP}
Folly::folly
)
12 changes: 12 additions & 0 deletions cmake/LibI2c.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ target_link_libraries(i2c_ctrl
i2c_controller_stats_cpp2
Folly::folly
)

add_library(firmware_upgrader
fboss/lib/i2c/CdbCommandBlock.cpp
fboss/lib/i2c/FirmwareUpgrader.cpp
)

target_link_libraries(firmware_upgrader
Folly::folly
transceiver_cpp2
firmware_storage
fboss_i2c_lib
)
15 changes: 15 additions & 0 deletions cmake/QsfpService.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,18 @@ add_library(qsfp_core
target_link_libraries(qsfp_core
qsfp_handler
)

add_executable(qsfp_service
fboss/qsfp_service/Main.cpp
)

target_link_libraries(qsfp_service
qsfp_module
qsfp_config
phy_management_base
transceiver_manager
qsfp_platforms_wedge
log_thrift_call
qsfp_core
qsfp_handler
)
1 change: 1 addition & 0 deletions cmake/QsfpServicePlatformsWedge.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ target_link_libraries(qsfp_platforms_wedge
wedge40_platform_mapping
kamet_platform_mapping
platform_base
qsfp_config
)
24 changes: 24 additions & 0 deletions cmake/Util.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CMake to build libraries and binaries in fboss/util

# In general, libraries and binaries in fboss/foo/bar are built by
# cmake/FooBar.cmake

add_executable(wedge_qsfp_util
fboss/util/wedge_qsfp_util.cpp
fboss/util/qsfp_util_main.cpp
fboss/util/qsfp/QsfpServiceDetector.cpp
fboss/util/qsfp/QsfpUtilContainer.cpp
fboss/util/qsfp/QsfpUtilTx.cpp
fboss/util/oss/wedge_qsfp_util.cpp
)

target_link_libraries(wedge_qsfp_util
firmware_upgrader
qsfp_config
qsfp_lib
qsfp_module
${YAML-CPP}
phy_management_base
transceiver_manager
qsfp_platforms_wedge
)
26 changes: 15 additions & 11 deletions fboss/agent/ApplyThriftConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ using std::shared_ptr;
namespace {

const uint8_t kV6LinkLocalAddrMask{64};
// Needed until CoPP is removed from code and put into config
const int kAclStartPriority = 100000;

// Only one buffer pool is supported systemwide. Variable to track the name
// and validate during a config change.
Expand Down Expand Up @@ -2489,7 +2487,7 @@ std::shared_ptr<AclMap> ThriftConfigApplier::updateAcls(
AclMap::NodeContainer newAcls;
bool changed = false;
int numExistingProcessed = 0;
int priority = kAclStartPriority;
int priority = AclTable::kDataplaneAclMaxPriority;
int cpuPriority = 1;

// Start with the DROP acls, these should have highest priority
Expand Down Expand Up @@ -3249,13 +3247,17 @@ shared_ptr<SwitchSettings> ThriftConfigApplier::updateSwitchSettings() {
switchSettingsChange = true;
}

std::vector<std::pair<VlanID, folly::IPAddress>> cfgBlockNeighbors;
std::vector<state::BlockedNeighbor> cfgBlockNeighbors;
for (const auto& blockNeighbor : *cfg_->switchSettings()->blockNeighbors()) {
cfgBlockNeighbors.emplace_back(
VlanID(*blockNeighbor.vlanID()),
folly::IPAddress(*blockNeighbor.ipAddress()));
}
if (origSwitchSettings->getBlockNeighbors() != cfgBlockNeighbors) {
state::BlockedNeighbor neighbor{};
neighbor.blockNeighborVlanID_ref() = *blockNeighbor.vlanID();
neighbor.blockNeighborIP_ref() =
network::toBinaryAddress(folly::IPAddress(*blockNeighbor.ipAddress()));
cfgBlockNeighbors.emplace_back(neighbor);
}
// THRIFT_COPY
if (origSwitchSettings->getBlockNeighbors()->toThrift() !=
cfgBlockNeighbors) {
newSwitchSettings->setBlockNeighbors(cfgBlockNeighbors);
switchSettingsChange = true;
}
Expand All @@ -3267,7 +3269,8 @@ shared_ptr<SwitchSettings> ThriftConfigApplier::updateSwitchSettings() {
VlanID(*macAddrToBlock.vlanID()),
folly::MacAddress(*macAddrToBlock.macAddress()));
}
if (origSwitchSettings->getMacAddrsToBlock() != cfgMacAddrsToBlock) {
if (origSwitchSettings->getMacAddrsToBlock_DEPRECATED() !=
cfgMacAddrsToBlock) {
newSwitchSettings->setMacAddrsToBlock(cfgMacAddrsToBlock);
switchSettingsChange = true;
}
Expand All @@ -3288,7 +3291,8 @@ shared_ptr<SwitchSettings> ThriftConfigApplier::updateSwitchSettings() {

auto originalExactMatchTableConfig =
origSwitchSettings->getExactMatchTableConfig();
if (originalExactMatchTableConfig !=
// THRIFT_COPY
if (originalExactMatchTableConfig->toThrift() !=
*cfg_->switchSettings()->exactMatchTableConfigs()) {
if (cfg_->switchSettings()->exactMatchTableConfigs()->size() > 1) {
throw FbossError("Multiple EM tables not supported yet");
Expand Down
Loading

0 comments on commit 7b35f6a

Please sign in to comment.