From 682e9cb7313cfc4a4a0eee64109ae600e59d8053 Mon Sep 17 00:00:00 2001 From: Ron He Date: Sun, 15 Sep 2024 22:28:12 -0700 Subject: [PATCH] Retired unused VOQ utils Summary: As titled. This is no longer used. Reviewed By: nivinl Differential Revision: D62657225 fbshipit-source-id: 7d9697e12af330e8c996d7a81633fe6b1d7ed50c --- fboss/agent/test/utils/VoqTestUtils.cpp | 62 ------------------------- fboss/agent/test/utils/VoqTestUtils.h | 6 --- 2 files changed, 68 deletions(-) diff --git a/fboss/agent/test/utils/VoqTestUtils.cpp b/fboss/agent/test/utils/VoqTestUtils.cpp index 48cdbe658b6ec..9f0b1b29833c6 100644 --- a/fboss/agent/test/utils/VoqTestUtils.cpp +++ b/fboss/agent/test/utils/VoqTestUtils.cpp @@ -230,68 +230,6 @@ std::shared_ptr addRemoveRemoteNeighbor( return outState; } -std::shared_ptr setupRemoteIntfAndSysPorts( - std::shared_ptr currState, - const SwitchIdScopeResolver& scopeResolver, - const cfg::SwitchConfig& config, - bool useEncapIndex) { - auto newState = currState->clone(); - for (const auto& [remoteSwitchId, dsfNode] : *config.dsfNodes()) { - if ((*config.switchSettings()) - .switchIdToSwitchInfo() - ->contains(remoteSwitchId)) { - continue; - } - CHECK(dsfNode.systemPortRange().has_value()); - const auto minPortID = *dsfNode.systemPortRange()->minimum(); - const auto maxPortID = *dsfNode.systemPortRange()->maximum(); - // 0th port for CPU and 1st port for recycle port - for (int i = minPortID + kRemoteSysPortOffset; i <= maxPortID; i++) { - const SystemPortID remoteSysPortId(i); - const InterfaceID remoteIntfId(i); - const PortDescriptor portDesc(remoteSysPortId); - const std::optional encapEndx = - useEncapIndex ? std::optional(0x200001 + i) : std::nullopt; - - // Use subnet 100+(dsfNodeId/256):(dsfNodeId%256):(localIntfId)::1/64 - // and 100+(dsfNodeId/256).(dsfNodeId%256).(localIntfId).1/24 - auto firstOctet = 100 + remoteSwitchId / 256; - auto secondOctet = remoteSwitchId % 256; - auto thirdOctet = i - minPortID; - folly::IPAddressV6 neighborIp(folly::to( - firstOctet, ":", secondOctet, ":", thirdOctet, "::2")); - newState = addRemoteSysPort( - newState, - scopeResolver, - remoteSysPortId, - SwitchID(remoteSwitchId), - (i - minPortID - kRemoteSysPortOffset) / kNumPortPerCore, - (i - minPortID) % kNumPortPerCore); - newState = addRemoteInterface( - newState, - scopeResolver, - remoteIntfId, - { - {folly::IPAddress(folly::to( - firstOctet, ":", secondOctet, ":", thirdOctet, "::1")), - 64}, - {folly::IPAddress(folly::to( - firstOctet, ".", secondOctet, ".", thirdOctet, ".1")), - 24}, - }); - newState = addRemoveRemoteNeighbor( - newState, - scopeResolver, - neighborIp, - remoteIntfId, - portDesc, - true /* add */, - encapEndx); - } - } - return newState; -} - void populateRemoteIntfAndSysPorts( std::map>& switchId2SystemPorts, std::map>& switchId2Rifs, diff --git a/fboss/agent/test/utils/VoqTestUtils.h b/fboss/agent/test/utils/VoqTestUtils.h index 0ad49983e393a..7c31baf6e5fd2 100644 --- a/fboss/agent/test/utils/VoqTestUtils.h +++ b/fboss/agent/test/utils/VoqTestUtils.h @@ -54,12 +54,6 @@ std::shared_ptr addRemoveRemoteNeighbor( bool add, std::optional encapIndex = std::nullopt); -std::shared_ptr setupRemoteIntfAndSysPorts( - std::shared_ptr currState, - const SwitchIdScopeResolver& scopeResolver, - const cfg::SwitchConfig& config, - bool useEncapIndex); - QueueConfig getDefaultVoqConfig(); std::optional getDummyEncapIndex(TestEnsembleIf* ensemble);