Skip to content

Commit

Permalink
Merge pull request facebook#27 from eerpini/fboss_upstream_04_13_2023
Browse files Browse the repository at this point in the history
Fboss upstream 04 13 2023
  • Loading branch information
eerpini authored Apr 14, 2023
2 parents 88f9d8e + 48917bb commit fbd5bdd
Show file tree
Hide file tree
Showing 230 changed files with 17,971 additions and 3,252 deletions.
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 ea52832e1283042b58262897c97527b8c2f4698f
Subproject commit e145d1f5cd42cd5b2e4b2f82157747a15c5e768e
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 b8b3ed56ecd1aff05abe7c2e5085da40e9ffad5f
Subproject commit 9b7a2dd2c5e755fbaf1a2b60189d77c288636efd
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 a153b33438e47b9fb1a8967d923ff72af24582f9
Subproject commit f2d2a323ee44e4e411049a6cc64999032af2da34
3 changes: 3 additions & 0 deletions build/fbcode_builder/getdeps/dyndeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ def find_dumpbin(self) -> str:
"VC/bin/dumpbin.exe"
),
("c:/Program Files (x86)/Microsoft Visual Studio */VC/bin/dumpbin.exe"),
(
"C:/Program Files/Microsoft Visual Studio/*/Professional/VC/Tools/MSVC/*/bin/HostX64/x64/dumpbin.exe"
),
]
for pattern in globs:
for exe in glob.glob(pattern):
Expand Down
7 changes: 5 additions & 2 deletions build/fbcode_builder/patches/blake3_CMakeLists_txt.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ new file mode 100644
index 0000000..171554b
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,78 @@
@@ -0,0 +1,81 @@
+cmake_minimum_required(VERSION 3.12)
+cmake_policy(VERSION ${CMAKE_VERSION})
+
Expand All @@ -40,13 +40,16 @@ index 0000000..171554b
+ blake3_dispatch.c
+ blake3_portable.c)
+
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
+if((CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64) OR (CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64))
+ enable_language(ASM)
+ if(MSVC)
+ enable_language(ASM_MASM)
+ set(SUFFIX "windows_msvc.asm")
+ elseif(WIN32)
+ enable_language(ASM)
+ set(SUFFIX "windows_gnu.S")
+ else()
+ enable_language(ASM)
+ set(SUFFIX "unix.S")
+ endif()
+ target_sources(blake3 PRIVATE
Expand Down
5 changes: 3 additions & 2 deletions cmake/Agent.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ add_library(fboss_init

target_link_libraries(fboss_init
Folly::folly
fboss_common_cpp2
)

# TODO (rsunkad) re-enable this library for use with linking with libmain
Expand Down Expand Up @@ -169,7 +170,7 @@ target_link_libraries(core
capture
diag_cmd_filter
hardware_stats_cpp2
hw_switch_stats
hw_switch_fb303_stats
switch_asics
ctrl_cpp2
fboss_cpp2
Expand Down Expand Up @@ -266,7 +267,7 @@ target_link_libraries(hw_switch
fboss_cpp2
Folly::folly
platform_base
hw_switch_stats
hw_switch_fb303_stats
)

add_library(async_logger
Expand Down
6 changes: 3 additions & 3 deletions cmake/AgentHw.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ target_link_libraries(diag_cmd_filter
Folly::folly
)

add_library(hw_switch_stats
fboss/agent/hw/HwSwitchStats.cpp
add_library(hw_switch_fb303_stats
fboss/agent/hw/HwSwitchFb303Stats.cpp
)

add_library(hw_fb303_stats
Expand Down Expand Up @@ -64,7 +64,7 @@ target_link_libraries(hw_switch_warmboot_helper
Folly::folly
)

target_link_libraries(hw_switch_stats
target_link_libraries(hw_switch_fb303_stats
stats
fb303::fb303
Folly::folly
Expand Down
3 changes: 2 additions & 1 deletion cmake/AgentHwSaiSwitch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(SAI_SWITCH_SRC
fboss/agent/hw/sai/switch/SaiSwitchManager.cpp
fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp
fboss/agent/hw/sai/switch/SaiTunnelManager.cpp
fboss/agent/hw/sai/switch/SaiUdfManager.cpp
fboss/agent/hw/sai/switch/SaiVlanManager.cpp
fboss/agent/hw/sai/switch/SaiVirtualRouterManager.cpp
fboss/agent/hw/sai/switch/SaiWredManager.cpp
Expand Down Expand Up @@ -78,7 +79,7 @@ target_link_libraries(sai_switch
# allow unresolved-symbols here.
-Wl,--unresolved-symbols=ignore-all
core
hw_switch_stats
hw_switch_fb303_stats
hw_trunk_counters
hw_fb303_stats
hw_cpu_fb303_stats
Expand Down
2 changes: 1 addition & 1 deletion cmake/AgentHwSaiSwitchTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ target_link_libraries(switch_test
sai_store
sai_switch
fake_sai
hw_switch_stats
hw_switch_fb303_stats
manager_test_base
${GTEST}
${LIBGMOCK_LIBRARIES}
Expand Down
1 change: 1 addition & 0 deletions cmake/AgentHwSwitchAsics.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_library(switch_asics
fboss/agent/hw/switch_asics/CredoPhyAsic.cpp
fboss/agent/hw/switch_asics/MarvelPhyAsic.cpp
fboss/agent/hw/switch_asics/Jericho2Asic.cpp
fboss/agent/hw/switch_asics/Jericho3Asic.cpp
fboss/agent/hw/switch_asics/RamonAsic.cpp
fboss/agent/hw/switch_asics/BroadcomXgsAsic.cpp
)
Expand Down
12 changes: 12 additions & 0 deletions cmake/AgentPlatformsCommonMeru800bia.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# CMake to build libraries and binaries in fboss/agent/platforms/common/meru800bia

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

add_library(meru800bia_platform_mapping
fboss/agent/platforms/common/meru800bia/Meru800biaPlatformMapping.cpp
)

target_link_libraries(meru800bia_platform_mapping
platform_mapping
)
4 changes: 4 additions & 0 deletions cmake/AgentPlatformsSai.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ add_library(sai_platform
fboss/agent/platforms/sai/SaiTajoPlatform.cpp
fboss/agent/platforms/sai/SaiTajoPlatformPort.cpp
fboss/agent/platforms/sai/SaiMeru400biuPlatform.cpp
fboss/agent/platforms/sai/SaiMeru800biaPlatform.cpp
fboss/agent/platforms/sai/SaiMeru400biaPlatform.cpp
fboss/agent/platforms/sai/SaiMeru400biaPlatformPort.cpp
fboss/agent/platforms/sai/SaiMeru400bfuPlatform.cpp
Expand All @@ -58,7 +59,9 @@ add_library(sai_platform
fboss/agent/platforms/sai/oss/SaiBcmPlatform.cpp
fboss/agent/platforms/sai/oss/SaiPlatformInit.cpp
fboss/agent/platforms/sai/oss/SaiMeru400biuPlatform.cpp
fboss/agent/platforms/sai/oss/SaiMeru800biaPlatform.cpp
fboss/agent/platforms/sai/oss/SaiMeru400biuPlatformPort.cpp
fboss/agent/platforms/sai/oss/SaiMeru800biaPlatformPort.cpp
fboss/agent/platforms/sai/oss/SaiMeru400biaPlatform.cpp
fboss/agent/platforms/sai/oss/SaiMeru400bfuPlatform.cpp
fboss/agent/platforms/sai/oss/SaiMeru400bfuPlatformPort.cpp
Expand Down Expand Up @@ -95,6 +98,7 @@ target_link_libraries(sai_platform
meru400biu_platform_mapping
meru400bia_platform_mapping
meru400bfu_platform_mapping
meru800bia_platform_mapping
montblanc_platform_mapping
)

Expand Down
1 change: 1 addition & 0 deletions cmake/CliFboss2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ add_executable(fboss2
fboss/cli/fboss2/commands/clear/CmdClearArp.h
fboss/cli/fboss2/commands/clear/CmdClearInterfaceCounters.h
fboss/cli/fboss2/commands/clear/CmdClearNdp.h
fboss/cli/fboss2/commands/clear/CmdClearUtils.h
fboss/cli/fboss2/commands/clear/interface/CmdClearInterface.h
fboss/cli/fboss2/commands/clear/interface/prbs/CmdClearInterfacePrbs.h
fboss/cli/fboss2/commands/clear/interface/prbs/stats/CmdClearInterfacePrbsStats.h
Expand Down
10 changes: 10 additions & 0 deletions cmake/QsfpService.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ target_link_libraries(meru400biu_bsp
FBThrift::thriftcpp2
)

add_library(meru800bia_bsp
fboss/lib/bsp/meru800bia/Meru800biaBspPlatformMapping.cpp
)

target_link_libraries(meru800bia_bsp
bsp_platform_mapping_cpp2
FBThrift::thriftcpp2
)

add_library(montblanc_bsp
fboss/lib/bsp/montblanc/MontblancBspPlatformMapping.cpp
)
Expand Down Expand Up @@ -99,6 +108,7 @@ target_link_libraries(qsfp_bsp_core
Folly::folly
meru400bfu_bsp
meru400biu_bsp
meru800bia_bsp
montblanc_bsp
device_mdio
fpga_device
Expand Down
1 change: 1 addition & 0 deletions cmake/QsfpServicePlatformsWedge.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ target_link_libraries(qsfp_platforms_wedge
wedge40_platform_mapping
meru400bfu_platform_mapping
meru400biu_platform_mapping
meru800bia_platform_mapping
montblanc_platform_mapping
platform_base
qsfp_config
Expand Down
1 change: 1 addition & 0 deletions cmake/Util.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ target_link_libraries(wedge_qsfp_util
phy_management_base
transceiver_manager
qsfp_platforms_wedge
fboss_common_cpp2
)

install(TARGETS wedge_qsfp_util)
3 changes: 2 additions & 1 deletion fboss/agent/ArpCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ ArpCache::ArpCache(
state->getStaleEntryInterval()) {}

void ArpCache::sentArpRequest(folly::IPAddressV4 ip) {
setPendingEntry(ip);
// Pending entry points to CPU port
setPendingEntry(ip, PortDescriptor(PortID(0)));
}

void ArpCache::receivedArpMine(
Expand Down
40 changes: 29 additions & 11 deletions fboss/agent/DsfSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

#include "fboss/agent/DsfSubscriber.h"
#include <fb303/ServiceData.h>
#include "fboss/agent/HwSwitchMatcher.h"
#include "fboss/agent/SwSwitch.h"
#include "fboss/agent/Utils.h"
#include "fboss/agent/state/DsfNode.h"
#include "fboss/agent/state/InterfaceMap.h"
#include "fboss/agent/state/StateDelta.h"
#include "fboss/agent/state/SwitchState.h"
#include "fboss/fsdb/client/FsdbPubSubManager.h"
Expand All @@ -25,7 +27,6 @@ using ThriftMapTypeClass = apache::thrift::type_class::map<
apache::thrift::type_class::integral,
apache::thrift::type_class::structure>;
using SysPortMapThriftType = std::map<int64_t, state::SystemPortFields>;
using InterfaceMapThriftType = std::map<int32_t, state::InterfaceFields>;

DsfSubscriber::DsfSubscriber(SwSwitch* sw) : sw_(sw) {
sw_->registerStateObserver(this, "DSFSubscriber");
Expand All @@ -37,7 +38,7 @@ DsfSubscriber::~DsfSubscriber() {

void DsfSubscriber::scheduleUpdate(
const std::shared_ptr<SystemPortMap>& newSysPorts,
const std::shared_ptr<InterfaceMap>& newRifs,
const std::shared_ptr<MultiInterfaceMap>& newRifs,
const std::string& nodeName,
SwitchID nodeSwitchId) {
XLOG(DBG2) << " For , switchId: " << static_cast<int64_t>(nodeSwitchId)
Expand Down Expand Up @@ -66,7 +67,17 @@ void DsfSubscriber::scheduleUpdate(
// Also, link local only has significance for Servers directly
// connected to Interface Node. Thus, skip programming remote link
// local neighbors.
return nbrEntryIter->second->getIP().isLinkLocal();
if (nbrEntryIter->second->getIP().isLinkLocal()) {
return true;
}

// Only program neighbor entries that are REACHABLE on the DSF node
// that resolved it.
if (nbrEntryIter->second->getState() != NeighborState::REACHABLE) {
return true;
}

return false;
};

auto makeRemoteSysPort = [&](const auto& /*oldNode*/,
Expand Down Expand Up @@ -138,7 +149,15 @@ void DsfSubscriber::scheduleUpdate(
}
if (newRifs) {
auto origRifs = out->getInterfaces(nodeSwitchId);
InterfaceMapDelta delta(origRifs.get(), newRifs.get());
auto getDefaultInterfaces = [](auto interfaceMaps) -> InterfaceMap* {
CHECK(interfaceMaps);
auto interfaceMap = interfaceMaps->getNodeIf(
HwSwitchMatcher::defaultHwSwitchMatcherKey());
CHECK(interfaceMap);
return interfaceMap.get();
};
InterfaceMapDelta delta(
origRifs.get(), getDefaultInterfaces(newRifs));
auto remoteRifs = out->getRemoteInterfaces()->modify(&out);
processDelta(delta, remoteRifs, makeRemoteRif);
}
Expand Down Expand Up @@ -226,7 +245,7 @@ void DsfSubscriber::stateUpdated(const StateDelta& stateDelta) {
},
[this, nodeName, nodeSwitchId](fsdb::OperSubPathUnit&& operStateUnit) {
std::shared_ptr<SystemPortMap> newSysPorts;
std::shared_ptr<InterfaceMap> newRifs;
std::shared_ptr<MultiInterfaceMap> newRifs;
for (const auto& change : *operStateUnit.changes()) {
if (change.path()->path() == getSystemPortsPath()) {
XLOG(DBG2) << " Got sys port update from : " << nodeName;
Expand All @@ -238,12 +257,11 @@ void DsfSubscriber::stateUpdated(const StateDelta& stateDelta) {
*change.state()->contents()));
} else if (change.path()->path() == getInterfacesPath()) {
XLOG(DBG2) << " Got rif update from : " << nodeName;
newRifs = std::make_shared<InterfaceMap>();
newRifs->fromThrift(
thrift_cow::
deserialize<ThriftMapTypeClass, InterfaceMapThriftType>(
fsdb::OperProtocol::BINARY,
*change.state()->contents()));
newRifs = std::make_shared<MultiInterfaceMap>();
newRifs->fromThrift(thrift_cow::deserialize<
MultiInterfaceMapTypeClass,
MultiInterfaceMapThriftType>(
fsdb::OperProtocol::BINARY, *change.state()->contents()));
} else {
throw FbossError(
" Got unexpected state update for : ",
Expand Down
4 changes: 2 additions & 2 deletions fboss/agent/DsfSubscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DECLARE_bool(dsf_subscriber_cache_updated_state);
namespace facebook::fboss {
class SwSwitch;
class SwitchState;
class InterfaceMap;
class MultiInterfaceMap;
class SystemPortMap;
namespace fsdb {
class FsdbPubSubManager;
Expand All @@ -36,7 +36,7 @@ class DsfSubscriber : public StateObserver {
private:
void scheduleUpdate(
const std::shared_ptr<SystemPortMap>& newSysPorts,
const std::shared_ptr<InterfaceMap>& newRifs,
const std::shared_ptr<MultiInterfaceMap>& newRifs,
const std::string& nodeName,
SwitchID nodeSwitchId);
// Paths
Expand Down
Loading

0 comments on commit fbd5bdd

Please sign in to comment.