Skip to content

Commit

Permalink
Merge branch 'psu_presence_1201' of github.com:scottpaulsen/fboss int…
Browse files Browse the repository at this point in the history
…o psu_presence_1201
  • Loading branch information
scottpaulsen committed Dec 3, 2024
2 parents 610940f + e8d02f5 commit 7db34a2
Show file tree
Hide file tree
Showing 15 changed files with 596 additions and 38 deletions.
30 changes: 15 additions & 15 deletions buck2
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,62 @@
"name": "buck2",
"platforms": {
"macos-aarch64": {
"size": 24793637,
"size": 24804372,
"hash": "blake3",
"digest": "bb0035bb305bf3b6bb381b2c98063ab0912f77fcb3603a891cac4c59d17b2795",
"digest": "09468dd3a7114a853b84bd6befa2ab2dc101ca612435a3f6104a3206ad8ae4be",
"format": "zst",
"path": "buck2-aarch64-apple-darwin",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-11-15/buck2-aarch64-apple-darwin.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-12-02/buck2-aarch64-apple-darwin.zst"
}
]
},
"linux-aarch64": {
"size": 27097669,
"size": 27118699,
"hash": "blake3",
"digest": "70c796a8e7470a497d6251963c1d9da1679266f4ba1fdbf44a252aeac1687d8c",
"digest": "de2c4c710767206a3441d54ea5b99c35cd18c49a5e13e280f9f0e14d2130d1f0",
"format": "zst",
"path": "buck2-aarch64-unknown-linux-musl",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-11-15/buck2-aarch64-unknown-linux-musl.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-12-02/buck2-aarch64-unknown-linux-musl.zst"
}
]
},
"macos-x86_64": {
"size": 26566564,
"size": 26609760,
"hash": "blake3",
"digest": "f2d32397d72a0f3d96dd3265a525a9264ecc5aacc01c9f53ef1be7864f792c6c",
"digest": "e0f19c1ad37b9a00e9f5cc4143bec852fdbcdb063dc410fbcb3e99b4b3f383b6",
"format": "zst",
"path": "buck2-x86_64-apple-darwin",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-11-15/buck2-x86_64-apple-darwin.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-12-02/buck2-x86_64-apple-darwin.zst"
}
]
},
"windows-x86_64": {
"size": 21945285,
"size": 22070302,
"hash": "blake3",
"digest": "e0ebb882535cc24439025b39a023ae2148fc9f4733ab3552dbce396f964dd549",
"digest": "be0abcf7746d803da8fd02e011db156dbda100dda281b8445faf6415827c8fe3",
"format": "zst",
"path": "buck2-x86_64-pc-windows-msvc.exe",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-11-15/buck2-x86_64-pc-windows-msvc.exe.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-12-02/buck2-x86_64-pc-windows-msvc.exe.zst"
}
]
},
"linux-x86_64": {
"size": 28049273,
"size": 28064232,
"hash": "blake3",
"digest": "4ce1ccad2e051ac169d165905de2e3de68558a74e90756c71ab04fa78e38d23b",
"digest": "698197b24d042e2c38a253c92fe6b59ed09145200234dffe27cc5011913dd815",
"format": "zst",
"path": "buck2-x86_64-unknown-linux-musl",
"providers": [
{
"url": "https://github.com/facebook/buck2/releases/download/2024-11-15/buck2-x86_64-unknown-linux-musl.zst"
"url": "https://github.com/facebook/buck2/releases/download/2024-12-02/buck2-x86_64-unknown-linux-musl.zst"
}
]
}
Expand Down
7 changes: 6 additions & 1 deletion build/fbcode_builder/getdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@ def run_project_cmd(self, args, loader, manifest):

cache = cache_module.create_cache()
for m in projects:
fetcher = loader.create_fetcher(m)
if isinstance(fetcher, SystemPackageFetcher):
# We are guaranteed that if the fetcher is set to
# SystemPackageFetcher then this item is completely
# satisfied by the appropriate system packages
continue
cached_project = CachedProject(cache, loader, m)
if cached_project.download():
continue
Expand All @@ -348,7 +354,6 @@ def run_project_cmd(self, args, loader, manifest):
continue

# We need to fetch the sources
fetcher = loader.create_fetcher(m)
fetcher.update()


Expand Down
21 changes: 13 additions & 8 deletions build/fbcode_builder/getdeps/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,23 +430,27 @@ def _create_fetcher(self, build_options, ctx):
# We can use the code from fbsource
return ShipitTransformerFetcher(build_options, self.shipit_project)

# If both of these are None, the package can only be coming from
# preinstalled toolchain or system packages
repo_url = self.get_repo_url(ctx)
url = self.get("download", "url", ctx=ctx)

# Can we satisfy this dep with system packages?
if build_options.allow_system_packages:
if (repo_url is None and url is None) or build_options.allow_system_packages:
if self._is_satisfied_by_preinstalled_environment(ctx):
return PreinstalledNopFetcher()

packages = self.get_required_system_packages(ctx)
package_fetcher = SystemPackageFetcher(build_options, packages)
if package_fetcher.packages_are_installed():
return package_fetcher
if build_options.host_type.get_package_manager():
packages = self.get_required_system_packages(ctx)
package_fetcher = SystemPackageFetcher(build_options, packages)
if package_fetcher.packages_are_installed():
return package_fetcher

repo_url = self.get_repo_url(ctx)
if repo_url:
rev = self.get("git", "rev")
depth = self.get("git", "depth")
return GitFetcher(build_options, self, repo_url, rev, depth)

url = self.get("download", "url", ctx=ctx)
if url:
# We need to defer this import until now to avoid triggering
# a cycle when the facebook/__init__.py is loaded.
Expand All @@ -464,7 +468,8 @@ def _create_fetcher(self, build_options, ctx):
)

raise KeyError(
"project %s has no fetcher configuration matching %s" % (self.name, ctx)
"project %s has no fetcher configuration or system packages matching %s"
% (self.name, ctx)
)

def create_fetcher(self, build_options, loader, ctx):
Expand Down
12 changes: 7 additions & 5 deletions build/fbcode_builder/manifests/openssl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = openssl
libssl-dev

[homebrew]
openssl@1.1
openssl
# on homebrew need the matching curl and ca-

[rpms]
Expand All @@ -16,17 +16,19 @@ openssl-libs
[pps]
openssl

[download]
url = https://www.openssl.org/source/openssl-1.1.1l.tar.gz
sha256 = 0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
# no need to download on the systems where we always use the system libs
[download.not(any(os=linux, os=freebsd))]
# match the openssl version packages in ubuntu LTS folly current supports
url = https://www.openssl.org/source/openssl-3.0.15.tar.gz
sha256 = 23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533

# We use the system openssl on these platforms even without --allow-system-packages
[build.any(os=linux, os=freebsd)]
builder = nop

[build.not(any(os=linux, os=freebsd))]
builder = openssl
subdir = openssl-1.1.1l
subdir = openssl-3.0.15

[dependencies.os=windows]
perl
1 change: 1 addition & 0 deletions cmake/AgentPacket.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ target_link_libraries(packet_factory
ctrl_cpp2
switch_config_cpp2
Folly::folly
sflow_structs
)
1 change: 1 addition & 0 deletions cmake/AgentTestAgentHwTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ add_library(agent_hw_test_src
fboss/agent/test/agent_hw_tests/AgentMmuTuningTests.cpp
fboss/agent/test/agent_hw_tests/AgentSflowMirrorTest.cpp
fboss/agent/test/agent_hw_tests/AgentAclPriorityTests.cpp
fboss/agent/test/agent_hw_tests/AgentTrafficPauseTests.cpp
fboss/agent/test/agent_hw_tests/AgentTrunkLoadBalancerTests.cpp
fboss/agent/test/agent_hw_tests/AgentTrunkTests.cpp
fboss/agent/test/agent_hw_tests/AgentRxReasonTests.cpp
Expand Down
27 changes: 26 additions & 1 deletion fboss/agent/ApplyThriftConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2505,7 +2505,9 @@ shared_ptr<Port> ThriftConfigApplier::updatePort(
portFlowletConfigUnchanged &&
newFlowletConfigName == orig->getFlowletConfigName() &&
*portConf->conditionalEntropyRehash() ==
orig->getConditionalEntropyRehash()) {
orig->getConditionalEntropyRehash() &&
portConf->selfHealingECMPLagEnable().value_or(false) ==
orig->getSelfHealingECMPLagEnable()) {
return nullptr;
}

Expand Down Expand Up @@ -2549,6 +2551,16 @@ shared_ptr<Port> ThriftConfigApplier::updatePort(
newPort->setPortFlowletConfig(portFlowletCfg);
newPort->setScope(*portConf->scope());
newPort->setConditionalEntropyRehash(*portConf->conditionalEntropyRehash());
if (auto selfHealingECMPLagEnable = portConf->selfHealingECMPLagEnable()) {
if (*selfHealingECMPLagEnable &&
!cfg_->switchSettings()->selfHealingEcmpLagConfig().has_value()) {
throw FbossError(
"Switch selfHealingEcmpLagConfig needs to be enabled for port ",
newPort->getName(),
" to have selfHealingEcmpLag enable");
}
newPort->setSelfHealingECMPLagEnable(*selfHealingECMPLagEnable);
}
return newPort;
}

Expand Down Expand Up @@ -4838,6 +4850,19 @@ shared_ptr<SwitchSettings> ThriftConfigApplier::updateSwitchSettings(
switchSettingsChange = true;
}

{
// SelfHealingEcmpLag switch configurations
std::optional<cfg::SelfHealingEcmpLagConfig> newSwitchShelConfig;
if (cfg_->switchSettings()->selfHealingEcmpLagConfig()) {
newSwitchShelConfig = *cfg_->switchSettings()->selfHealingEcmpLagConfig();
}
if (newSwitchShelConfig !=
origSwitchSettings->getSelfHealingEcmpLagConfig()) {
newSwitchSettings->setSelfHealingEcmpLagConfig(newSwitchShelConfig);
switchSettingsChange = true;
}
}

if (switchSettingsChange) {
return newSwitchSettings;
}
Expand Down
8 changes: 4 additions & 4 deletions fboss/agent/hw/sai/switch/SaiPortManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1526,11 +1526,11 @@ std::shared_ptr<Port> SaiPortManager::swPortFromAttributes(
#endif
port->setScope(platform_->getPlatformMapping()->getPortScope(port->getID()));

// TODO(zecheng): Update flag when new 12.0 release has the attribute
#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) && !defined(BRCM_SAI_SDK_DNX_GTE_12_0)
port->setReachabilityGroupId(
GET_OPT_ATTR(Port, CondEntropyRehashEnable, attributes));
#if defined(SAI_VERSION_11_7_0_0_DNX_ODP)
auto shelEnable = GET_OPT_ATTR(Port, ShelEnable, attributes);
port->setSelfHealingECMPLagEnable(shelEnable);
#endif

return port;
}

Expand Down
9 changes: 7 additions & 2 deletions fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,11 @@ SaiPortTraits::CreateAttributes SaiPortManager::attributesFromSwPort(
#if defined(BRCM_SAI_SDK_DNX_GTE_11_0) && !defined(BRCM_SAI_SDK_DNX_GTE_12_0)
condEntropyRehashEnable = swPort->getConditionalEntropyRehash();
#endif
std::optional<SaiPortTraits::Attributes::ShelEnable> shelEnable{};
#if defined(SAI_VERSION_11_7_0_0_DNX_ODP)
shelEnable = SaiPortTraits::Attributes::ShelEnable{
swPort->getSelfHealingECMPLagEnable()};
#endif

if (basicAttributeOnly) {
return SaiPortTraits::CreateAttributes{
Expand Down Expand Up @@ -799,10 +804,10 @@ SaiPortTraits::CreateAttributes SaiPortManager::attributesFromSwPort(
arsPortLoadFutureWeight, // ARS port load future weight
#endif
reachabilityGroup,
condEntropyRehashEnable, // CondEntropyRehashEnable
condEntropyRehashEnable,
std::nullopt, // CondEntropyRehashPeriodUS
std::nullopt, // CondEntropyRehashSeed
std::nullopt, // ShelEnable
shelEnable,
};
}

Expand Down
1 change: 1 addition & 0 deletions fboss/agent/packet/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ cpp_library(
"//fboss/agent:fboss-types",
"//fboss/agent:hw_switch",
"//fboss/agent:packet",
"//fboss/agent/packet:sflow_structs",
"//folly:network_address",
"//folly/io:iobuf",
],
Expand Down
Loading

0 comments on commit 7db34a2

Please sign in to comment.