From ce3311c9b70c237d92a351f8d34fab8ca47fcca6 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 30 Jan 2023 20:32:46 -0800 Subject: [PATCH 001/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/7be3bac2a0148c9edfc9b51b987899e4afa3ec6a https://github.com/facebook/proxygen/commit/393bd9d8f1e5f8e563c2913c4d7cca6c2636cb55 https://github.com/facebook/rocksdb/commit/36174d89a6000723f3ad6bdb3d25f64866cab0f2 Reviewed By: jailby fbshipit-source-id: 911ed17a4557041050468bbb68df90a4a7bd1844 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index c85964b397785..2f8d4edb1104d 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit f90c9696176ff4951b4361614e9287aaff34115a +Subproject commit 7be3bac2a0148c9edfc9b51b987899e4afa3ec6a From 58b0091a352f294f38b892f2bce27a4634dfc170 Mon Sep 17 00:00:00 2001 From: Ron He Date: Mon, 30 Jan 2023 22:12:27 -0800 Subject: [PATCH 002/280] Sai replayer log elapsed time on create function Summary: Support logging elapsed time on create functions - this would help us to determine the efficiency of each SDK call and find out expensive/inefficient calls. The flag `enable_elapsed_time_log` should guard the new functionality. Also fix variable mapping after moving to log-then-call model. Reviewed By: jasmeetbagga Differential Revision: D42759012 Privacy Context Container: L1125642 fbshipit-source-id: 18d098b8284e10c1de004b558624564fdafd3560 --- fboss/agent/hw/sai/tracer/SaiTracer.cpp | 39 ++++++++++++++++++++----- fboss/agent/hw/sai/tracer/SaiTracer.h | 21 +++++++++---- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.cpp b/fboss/agent/hw/sai/tracer/SaiTracer.cpp index 034358f267b87..42e1acd234f32 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.cpp +++ b/fboss/agent/hw/sai/tracer/SaiTracer.cpp @@ -68,6 +68,11 @@ DEFINE_bool( "At runtime, it should be disabled to reduce logging overhead." "However, it's needed for testing e.g. HwL4PortBlackHolingTest"); +DEFINE_bool( + enable_elapsed_time_log, + false, + "Flag to indicate whether to log the elapsed time of SDK API calls."); + DEFINE_bool( enable_get_attr_log, false, @@ -724,7 +729,7 @@ void SaiTracer::logInsegEntryCreateFn( writeToFile(lines); } -void SaiTracer::logCreateFn( +std::string SaiTracer::logCreateFn( const string& fn_name, sai_object_id_t* create_object_id, sai_object_id_t switch_id, @@ -732,7 +737,7 @@ void SaiTracer::logCreateFn( const sai_attribute_t* attr_list, sai_object_type_t object_type) { if (!FLAGS_enable_replayer) { - return; + return ""; } // First fill in attribute list @@ -749,6 +754,7 @@ void SaiTracer::logCreateFn( fn_name, varName, getVariable(switch_id), attr_count, object_type)); writeToFile(lines, false); + return varName; } void SaiTracer::logRouteEntryRemoveFn( @@ -1287,8 +1293,6 @@ std::tuple SaiTracer::declareVariable( varCounts_, object_type, "Unsupported Sai Object type in Sai Tracer")++; string varName = to(varPrefix, num); - // Add this variable to the variable map - variables_.emplace(*object_id, varName); return std::make_tuple(to(varType, varName), varName); } @@ -1614,7 +1618,10 @@ string SaiTracer::rvCheck(sai_status_t rv) { return to("rvCheck(rv,", rv, ",", numCalls_++, ")"); } -string SaiTracer::logTimeAndRv(sai_status_t rv, sai_object_id_t object_id) { +string SaiTracer::logTimeAndRv( + sai_status_t rv, + sai_object_id_t object_id, + std::chrono::system_clock::time_point begin) { auto now = std::chrono::system_clock::now(); auto now_ms = std::chrono::duration_cast( now.time_since_epoch()) % @@ -1636,6 +1643,14 @@ string SaiTracer::logTimeAndRv(sai_status_t rv, sai_object_id_t object_id) { outStringStream << " rv: " << rv; + if (begin != std::chrono::system_clock::time_point::min()) { + outStringStream << " elapsed time " << std::dec + << std::chrono::duration_cast( + now - begin) + .count() + << " μs"; + } + return outStringStream.str(); } @@ -1679,10 +1694,20 @@ uint32_t SaiTracer::checkListCount( return FLAGS_default_list_size * sizeof(int) / elem_size; } -void SaiTracer::logPostInvocation(sai_status_t rv, sai_object_id_t object_id) { +void SaiTracer::logPostInvocation( + sai_status_t rv, + sai_object_id_t object_id, + std::chrono::system_clock::time_point begin, + std::optional varName) { + // In the case of create fn, objectID is known after invocation. + // Therefore, add it to the variable mapping here. + if (varName) { + variables_.emplace(object_id, *varName); + } + vector lines; // Log current timestamp, object id and return value - lines.push_back(logTimeAndRv(rv, object_id)); + lines.push_back(logTimeAndRv(rv, object_id, begin)); // Check return value to be the same as the original run lines.push_back(rvCheck(rv)); diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.h b/fboss/agent/hw/sai/tracer/SaiTracer.h index 210c81bae828c..5c0d8fab3fe27 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.h +++ b/fboss/agent/hw/sai/tracer/SaiTracer.h @@ -31,6 +31,7 @@ extern "C" { DECLARE_bool(enable_replayer); DECLARE_bool(enable_packet_log); +DECLARE_bool(enable_elapsed_time_log); using PrimitiveFunction = std::string (*)(const sai_attribute_t*, int); using AttributeFunction = @@ -90,7 +91,7 @@ class SaiTracer { const sai_attribute_t* attr_list, sai_status_t rv); - void logCreateFn( + std::string logCreateFn( const std::string& fn_name, sai_object_id_t* create_object_id, sai_object_id_t switch_id, @@ -198,7 +199,11 @@ class SaiTracer { const std::vector& strVec, bool linefeed = true); - void logPostInvocation(sai_status_t rv, sai_object_id_t object_id); + void logPostInvocation( + sai_status_t rv, + sai_object_id_t object_id, + std::chrono::system_clock::time_point begin, + std::optional varName = std::nullopt); sai_acl_api_t* aclApi_; sai_bridge_api_t* bridgeApi_; @@ -310,7 +315,9 @@ class SaiTracer { std::string logTimeAndRv( sai_status_t rv, - sai_object_id_t object_id = SAI_NULL_OBJECT_ID); + sai_object_id_t object_id = SAI_NULL_OBJECT_ID, + std::chrono::system_clock::time_point begin = + std::chrono::system_clock::time_point::min()); void checkAttrCount(uint32_t attr_count); @@ -524,16 +531,20 @@ class SaiTracer { sai_object_id_t switch_id, \ uint32_t attr_count, \ const sai_attribute_t* attr_list) { \ - SaiTracer::getInstance()->logCreateFn( \ + auto varName = SaiTracer::getInstance()->logCreateFn( \ "create_" #obj_type, \ obj_type##_id, \ switch_id, \ attr_count, \ attr_list, \ sai_obj_type); \ + auto begin = FLAGS_enable_elapsed_time_log \ + ? std::chrono::system_clock::now() \ + : std::chrono::system_clock::time_point::min(); \ auto rv = SaiTracer::getInstance()->api_type##Api_->create_##obj_type( \ obj_type##_id, switch_id, attr_count, attr_list); \ - SaiTracer::getInstance()->logPostInvocation(rv, *obj_type##_id); \ + SaiTracer::getInstance()->logPostInvocation( \ + rv, *obj_type##_id, begin, varName); \ return rv; \ } From edeb459acd5996ba1d73bcae6ebcd42dc8dda3e0 Mon Sep 17 00:00:00 2001 From: Ron He Date: Mon, 30 Jan 2023 22:12:27 -0800 Subject: [PATCH 003/280] Sai replayer log elapsed time on remove fn Summary: As titled. Also move remove function to log-and-call model. Reviewed By: nivinl Differential Revision: D42761303 Privacy Context Container: L1125642 fbshipit-source-id: 4d2c391f79dc4bfbfef12c5ba09f6c73becc4001 --- fboss/agent/hw/sai/tracer/SaiTracer.cpp | 11 ++--------- fboss/agent/hw/sai/tracer/SaiTracer.h | 11 +++++++---- fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp | 8 ++++++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.cpp b/fboss/agent/hw/sai/tracer/SaiTracer.cpp index 42e1acd234f32..32f929155c1f7 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.cpp +++ b/fboss/agent/hw/sai/tracer/SaiTracer.cpp @@ -868,17 +868,13 @@ void SaiTracer::logInsegEntryRemoveFn( void SaiTracer::logRemoveFn( const string& fn_name, sai_object_id_t remove_object_id, - sai_object_type_t object_type, - sai_status_t rv) { + sai_object_type_t object_type) { if (!FLAGS_enable_replayer) { return; } vector lines{}; - // Log current timestamp, object id and return value - lines.push_back(logTimeAndRv(rv, remove_object_id)); - // Make the remove call lines.push_back(to( "rv=", @@ -889,10 +885,7 @@ void SaiTracer::logRemoveFn( getVariable(remove_object_id), ")")); - // Check return value to be the same as the original run - lines.push_back(rvCheck(rv)); - - writeToFile(lines); + writeToFile(lines, false); // Remove object from variables_ variables_.erase(remove_object_id); diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.h b/fboss/agent/hw/sai/tracer/SaiTracer.h index 5c0d8fab3fe27..0e760ba80bf15 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.h +++ b/fboss/agent/hw/sai/tracer/SaiTracer.h @@ -116,8 +116,7 @@ class SaiTracer { void logRemoveFn( const std::string& fn_name, sai_object_id_t remove_object_id, - sai_object_type_t object_type, - sai_status_t rv); + sai_object_type_t object_type); void logRouteEntrySetAttrFn( const sai_route_entry_t* route_entry, @@ -550,11 +549,15 @@ class SaiTracer { #define WRAP_REMOVE_FUNC(obj_type, sai_obj_type, api_type) \ sai_status_t wrap_remove_##obj_type(sai_object_id_t obj_type##_id) { \ + SaiTracer::getInstance()->logRemoveFn( \ + "remove_" #obj_type, obj_type##_id, sai_obj_type); \ + auto begin = FLAGS_enable_elapsed_time_log \ + ? std::chrono::system_clock::now() \ + : std::chrono::system_clock::time_point::min(); \ auto rv = SaiTracer::getInstance()->api_type##Api_->remove_##obj_type( \ obj_type##_id); \ + SaiTracer::getInstance()->logPostInvocation(rv, obj_type##_id, begin); \ \ - SaiTracer::getInstance()->logRemoveFn( \ - "remove_" #obj_type, obj_type##_id, sai_obj_type, rv); \ return rv; \ } diff --git a/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp b/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp index ab7009a836300..441a1c6547ded 100644 --- a/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp +++ b/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp @@ -101,10 +101,14 @@ sai_status_t wrap_create_switch( } sai_status_t wrap_remove_switch(sai_object_id_t switch_id) { + SaiTracer::getInstance()->logRemoveFn( + "remove_switch", switch_id, SAI_OBJECT_TYPE_SWITCH); + auto begin = FLAGS_enable_elapsed_time_log + ? std::chrono::system_clock::now() + : std::chrono::system_clock::time_point::min(); auto rv = SaiTracer::getInstance()->switchApi_->remove_switch(switch_id); - SaiTracer::getInstance()->logRemoveFn( - "remove_switch", switch_id, SAI_OBJECT_TYPE_SWITCH, rv); + SaiTracer::getInstance()->logPostInvocation(rv, switch_id, begin); return rv; } From 69770191639d118b4918df17cf8998dcfeb6d36e Mon Sep 17 00:00:00 2001 From: Ron He Date: Mon, 30 Jan 2023 22:12:27 -0800 Subject: [PATCH 004/280] Sai replayer log elapsed time on set fn Summary: As titled. Reviewed By: jasmeetbagga Differential Revision: D42763438 Privacy Context Container: L1125642 fbshipit-source-id: cd92742c21246dc5845f46224b608df7759f3833 --- fboss/agent/hw/sai/tracer/SaiTracer.cpp | 11 ++------ fboss/agent/hw/sai/tracer/SaiTracer.h | 27 ++++++++++--------- fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp | 8 ++++-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.cpp b/fboss/agent/hw/sai/tracer/SaiTracer.cpp index 32f929155c1f7..42e22eece89a4 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.cpp +++ b/fboss/agent/hw/sai/tracer/SaiTracer.cpp @@ -1055,8 +1055,7 @@ void SaiTracer::logSetAttrFn( const string& fn_name, sai_object_id_t set_object_id, const sai_attribute_t* attr, - sai_object_type_t object_type, - sai_status_t rv) { + sai_object_type_t object_type) { if (!FLAGS_enable_replayer) { return; } @@ -1064,9 +1063,6 @@ void SaiTracer::logSetAttrFn( // Setup one attribute vector lines = setAttrList(attr, 1, object_type); - // Log current timestamp, object id and return value - lines.push_back(logTimeAndRv(rv, set_object_id)); - // Make setAttribute call lines.push_back(to( "rv=", @@ -1077,10 +1073,7 @@ void SaiTracer::logSetAttrFn( getVariable(set_object_id), ",s_a)")); - // Check return value to be the same as the original run - lines.push_back(rvCheck(rv)); - - writeToFile(lines); + writeToFile(lines, false); } void SaiTracer::logBulkSetAttrFn( diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.h b/fboss/agent/hw/sai/tracer/SaiTracer.h index 0e760ba80bf15..12a501a224e33 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.h +++ b/fboss/agent/hw/sai/tracer/SaiTracer.h @@ -150,8 +150,7 @@ class SaiTracer { const std::string& fn_name, sai_object_id_t set_object_id, const sai_attribute_t* attr, - sai_object_type_t object_type, - sai_status_t rv); + sai_object_type_t object_type); void logBulkSetAttrFn( const std::string& fn_name, @@ -561,16 +560,20 @@ class SaiTracer { return rv; \ } -#define WRAP_SET_ATTR_FUNC(obj_type, sai_obj_type, api_type) \ - sai_status_t wrap_set_##obj_type##_attribute( \ - sai_object_id_t obj_type##_id, const sai_attribute_t* attr) { \ - auto rv = \ - SaiTracer::getInstance()->api_type##Api_->set_##obj_type##_attribute( \ - obj_type##_id, attr); \ - \ - SaiTracer::getInstance()->logSetAttrFn( \ - "set_" #obj_type "_attribute", obj_type##_id, attr, sai_obj_type, rv); \ - return rv; \ +#define WRAP_SET_ATTR_FUNC(obj_type, sai_obj_type, api_type) \ + sai_status_t wrap_set_##obj_type##_attribute( \ + sai_object_id_t obj_type##_id, const sai_attribute_t* attr) { \ + SaiTracer::getInstance()->logSetAttrFn( \ + "set_" #obj_type "_attribute", obj_type##_id, attr, sai_obj_type); \ + auto begin = FLAGS_enable_elapsed_time_log \ + ? std::chrono::system_clock::now() \ + : std::chrono::system_clock::time_point::min(); \ + auto rv = \ + SaiTracer::getInstance()->api_type##Api_->set_##obj_type##_attribute( \ + obj_type##_id, attr); \ + SaiTracer::getInstance()->logPostInvocation(rv, obj_type##_id, begin); \ + \ + return rv; \ } #define WRAP_GET_ATTR_FUNC(obj_type, sai_obj_type, api_type) \ diff --git a/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp b/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp index 441a1c6547ded..b9ed3026cb9ab 100644 --- a/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp +++ b/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp @@ -122,10 +122,14 @@ sai_status_t wrap_set_switch_attribute( auto* tracer = SaiTracer::getInstance().get(); rv = tracer->switchApi_->set_switch_attribute(switch_id, attr); } else { + SaiTracer::getInstance()->logSetAttrFn( + "set_switch_attribute", switch_id, attr, SAI_OBJECT_TYPE_SWITCH); + auto begin = FLAGS_enable_elapsed_time_log + ? std::chrono::system_clock::now() + : std::chrono::system_clock::time_point::min(); rv = SaiTracer::getInstance()->switchApi_->set_switch_attribute( switch_id, attr); - SaiTracer::getInstance()->logSetAttrFn( - "set_switch_attribute", switch_id, attr, SAI_OBJECT_TYPE_SWITCH, rv); + SaiTracer::getInstance()->logPostInvocation(rv, switch_id, begin); } return rv; } From e6902967b6666dbd1e8aede95829eb87ccacf4a2 Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Mon, 30 Jan 2023 23:04:28 -0800 Subject: [PATCH 005/280] stubs to set/reset qos map on system ports Summary: As titled, empty stubs to set/reset qos map on system ports Reviewed By: nivinl Differential Revision: D42865122 fbshipit-source-id: b1c8cfd95e43a976ed0948b4b1bf32f84c8ee6af --- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 5 +++++ fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp | 4 ++++ fboss/agent/hw/sai/switch/SaiSystemPortManager.h | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index 85d8bc2af39aa..6e68cfaad177e 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -330,23 +330,28 @@ void SaiSwitch::processDefaultDataPlanePolicyDelta( auto& qosMapManager = managerTable_->qosMapManager(); auto& portManager = managerTable_->portManager(); auto& switchManager = managerTable_->switchManager(); + auto& systemPortManager = managerTable_->systemPortManager(); if ((qosDelta.getOld() != qosDelta.getNew())) { [[maybe_unused]] const auto& lock = lockPolicy.lock(); if (qosDelta.getOld() && qosDelta.getNew()) { if (*qosDelta.getOld() != *qosDelta.getNew()) { portManager.clearQosPolicy(); + systemPortManager.clearQosPolicy(); switchManager.clearQosPolicy(); qosMapManager.removeQosMap(); qosMapManager.addQosMap(qosDelta.getNew()); portManager.setQosPolicy(); + systemPortManager.setQosPolicy(); switchManager.setQosPolicy(); } } else if (qosDelta.getNew()) { qosMapManager.addQosMap(qosDelta.getNew()); portManager.setQosPolicy(); + systemPortManager.setQosPolicy(); switchManager.setQosPolicy(); } else if (qosDelta.getOld()) { portManager.clearQosPolicy(); + systemPortManager.clearQosPolicy(); switchManager.clearQosPolicy(); qosMapManager.removeQosMap(); } diff --git a/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp b/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp index 9546a6b833460..e2fbbd4c39117 100644 --- a/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp @@ -266,4 +266,8 @@ std::shared_ptr SaiSystemPortManager::constructSystemPorts( return sysPortMap; } +void SaiSystemPortManager::setQosPolicy() {} + +void SaiSystemPortManager::clearQosPolicy() {} + } // namespace facebook::fboss diff --git a/fboss/agent/hw/sai/switch/SaiSystemPortManager.h b/fboss/agent/hw/sai/switch/SaiSystemPortManager.h index f4cff6704829f..842ddc3b14145 100644 --- a/fboss/agent/hw/sai/switch/SaiSystemPortManager.h +++ b/fboss/agent/hw/sai/switch/SaiSystemPortManager.h @@ -78,6 +78,10 @@ class SaiSystemPortManager { } void updateStats(SystemPortID portId, bool updateWatermarks); + void setQosPolicy(); + + void clearQosPolicy(); + private: void loadQueues( SaiSystemPortHandle& sysPortHandle, From d533783b3a669bcd1b467c2a5db67a3de0ffb0ec Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Mon, 30 Jan 2023 23:04:28 -0800 Subject: [PATCH 006/280] implement setQosMap/clearQosMap for system ports Summary: As titled, implement qos map application on system ports. Reviewed By: nivinl Differential Revision: D42865121 fbshipit-source-id: ec9d710d644fed328cd0d49d751caf4e7365cb5e --- .../hw/sai/switch/SaiSystemPortManager.cpp | 32 +++++++++++++++++-- .../hw/sai/switch/SaiSystemPortManager.h | 3 ++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp b/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp index e2fbbd4c39117..863f4e7dc5739 100644 --- a/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiSystemPortManager.cpp @@ -9,6 +9,7 @@ */ #include "fboss/agent/hw/sai/switch/SaiSystemPortManager.h" +#include "fboss/agent/hw/sai/switch/SaiSwitchManager.h" #include "fboss/agent/FbossError.h" #include "fboss/agent/hw/HwSysPortFb303Stats.h" @@ -266,8 +267,35 @@ std::shared_ptr SaiSystemPortManager::constructSystemPorts( return sysPortMap; } -void SaiSystemPortManager::setQosPolicy() {} +void SaiSystemPortManager::setQosMapOnAllSystemPorts(QosMapSaiId qosMapId) { + for (const auto& systemPortIdAndHandle : handles_) { + systemPortIdAndHandle.second->systemPort->setOptionalAttribute( + SaiSystemPortTraits::Attributes::QosTcToQueueMap{qosMapId}); + } +} -void SaiSystemPortManager::clearQosPolicy() {} +void SaiSystemPortManager::setQosPolicy() { + if (platform_->getAsic()->getSwitchType() != cfg::SwitchType::VOQ) { + return; + } + if (managerTable_->switchManager().isGlobalQoSMapSupported()) { + return; + } + auto& qosMapManager = managerTable_->qosMapManager(); + auto qosMapHandle = qosMapManager.getQosMap(); + globalTcToQueueQosMap_ = qosMapHandle->tcToQueueMap; + setQosMapOnAllSystemPorts(globalTcToQueueQosMap_->adapterKey()); +} + +void SaiSystemPortManager::clearQosPolicy() { + if (platform_->getAsic()->getSwitchType() != cfg::SwitchType::VOQ) { + return; + } + if (managerTable_->switchManager().isGlobalQoSMapSupported()) { + return; + } + setQosMapOnAllSystemPorts(QosMapSaiId(SAI_NULL_OBJECT_ID)); + globalTcToQueueQosMap_.reset(); +} } // namespace facebook::fboss diff --git a/fboss/agent/hw/sai/switch/SaiSystemPortManager.h b/fboss/agent/hw/sai/switch/SaiSystemPortManager.h index 842ddc3b14145..36f1eb03355a5 100644 --- a/fboss/agent/hw/sai/switch/SaiSystemPortManager.h +++ b/fboss/agent/hw/sai/switch/SaiSystemPortManager.h @@ -12,6 +12,7 @@ #include "fboss/agent/hw/sai/api/SystemPortApi.h" #include "fboss/agent/hw/sai/store/SaiObject.h" +#include "fboss/agent/hw/sai/switch/SaiQosMapManager.h" #include "fboss/agent/hw/sai/switch/SaiQueueManager.h" #include "fboss/agent/state/StateDelta.h" #include "fboss/agent/state/SystemPort.h" @@ -91,12 +92,14 @@ class SaiSystemPortManager { const std::shared_ptr& swSystemPort) const; SaiSystemPortHandle* getSystemPortHandleImpl(SystemPortID swId) const; + void setQosMapOnAllSystemPorts(QosMapSaiId qosMapId); SaiStore* saiStore_; SaiManagerTable* managerTable_; SaiPlatform* platform_; Handles handles_; ConcurrentIndices* concurrentIndices_; Stats portStats_; + std::shared_ptr globalTcToQueueQosMap_; }; } // namespace facebook::fboss From 998cadbf4a4cc9323f77afed5fadd0cf04e27856 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Tue, 31 Jan 2023 01:25:43 -0800 Subject: [PATCH 007/280] Get HwInDiscardCounterTests runnable on voq switches and greenlight on ebro Summary: As titled Reviewed By: nivinl Differential Revision: D42875660 fbshipit-source-id: 6de59cdfa93820156b968274600fa053e8c7f8b3 --- .../test/dataplane_tests/HwInDiscardCounterTests.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwInDiscardCounterTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwInDiscardCounterTests.cpp index 9f2696aa8a8b2..d257f94ab1fac 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwInDiscardCounterTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwInDiscardCounterTests.cpp @@ -41,21 +41,21 @@ class HwInDiscardsCounterTest : public HwLinkStateDependentTest { protected: void pumpTraffic(bool isV6) { - auto vlanId = VlanID(*initialConfig().vlanPorts()[0].vlanID()); - auto intfMac = utility::getInterfaceMac(getProgrammedState(), vlanId); + auto vlanId = utility::firstVlanID(getProgrammedState()); + auto intfMac = utility::getFirstInterfaceMac(getProgrammedState()); auto srcIp = IPAddress(isV6 ? "1001::1" : "10.0.0.1"); auto dstIp = IPAddress(isV6 ? "100:100:100::1" : "100.100.100.1"); auto pkt = utility::makeUDPTxPacket( - getHwSwitch(), VlanID(1), intfMac, intfMac, srcIp, dstIp, 10000, 10001); + getHwSwitch(), vlanId, intfMac, intfMac, srcIp, dstIp, 10000, 10001); getHwSwitchEnsemble()->ensureSendPacketOutOfPort( - std::move(pkt), PortID(masterLogicalPortIds()[0])); + std::move(pkt), PortID(masterLogicalInterfacePortIds()[0])); } }; TEST_F(HwInDiscardsCounterTest, nullRouteHit) { auto setup = [=]() {}; auto verify = [=]() { - PortID portId = masterLogicalPortIds()[0]; + PortID portId = masterLogicalInterfacePortIds()[0]; auto portStatsBefore = getLatestPortStats(portId); pumpTraffic(true); pumpTraffic(false); From 1fb5153c370cec30da846d23b389bcf91a4986a5 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Tue, 31 Jan 2023 01:25:43 -0800 Subject: [PATCH 008/280] Make vlan optional in eth tx pkt helper function Summary: On VOQ switches, eth packets are not tagged with vlan Reviewed By: nivinl Differential Revision: D42876465 Privacy Context Container: L1125642 fbshipit-source-id: 94466338e334fb374652528f2d717e08f24d7c91 --- fboss/agent/hw/test/HwTestPacketUtils.cpp | 2 +- fboss/agent/hw/test/HwTestPacketUtils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fboss/agent/hw/test/HwTestPacketUtils.cpp b/fboss/agent/hw/test/HwTestPacketUtils.cpp index 66cf887462d12..328c81bbae024 100644 --- a/fboss/agent/hw/test/HwTestPacketUtils.cpp +++ b/fboss/agent/hw/test/HwTestPacketUtils.cpp @@ -120,7 +120,7 @@ std::optional firstVlanID(const std::shared_ptr& state) { std::unique_ptr makeEthTxPacket( const HwSwitch* hw, - VlanID vlan, + std::optional vlan, folly::MacAddress srcMac, folly::MacAddress dstMac, facebook::fboss::ETHERTYPE etherType, diff --git a/fboss/agent/hw/test/HwTestPacketUtils.h b/fboss/agent/hw/test/HwTestPacketUtils.h index 56a5662285ca5..c9b02447d5bba 100644 --- a/fboss/agent/hw/test/HwTestPacketUtils.h +++ b/fboss/agent/hw/test/HwTestPacketUtils.h @@ -54,7 +54,7 @@ std::optional firstVlanID(const std::shared_ptr& state); std::unique_ptr makeEthTxPacket( const HwSwitch* hw, - VlanID vlan, + std::optional vlan, folly::MacAddress srcMac, folly::MacAddress dstMac, facebook::fboss::ETHERTYPE etherType, From 9dcbdceeb724ab8bcdbe778798022ccb8c537cba Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 31 Jan 2023 06:57:11 -0800 Subject: [PATCH 009/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/4e89197926c0f35c9b2fe6b6bb28268f030c15d8 Reviewed By: jailby fbshipit-source-id: 037e0b3a8e082de46de973da4bba2d98b7bd2b11 --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index 8bf4243933502..92801b5153d36 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 22b89282c9d3bb56a625b7def37f42e8cdd93dd0 +Subproject commit 4e89197926c0f35c9b2fe6b6bb28268f030c15d8 From 00fee33e9d947771076eb8f39ff4ac5303cba504 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 31 Jan 2023 08:55:39 -0800 Subject: [PATCH 010/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/3f49c9c7d19439124e7365608c3baf3ca364292b https://github.com/facebook/fbthrift/commit/67512d5003eb3f7afd6145fea9db82b65d818ad1 https://github.com/facebook/folly/commit/4e89197926c0f35c9b2fe6b6bb28268f030c15d8 https://github.com/facebook/ocamlrep/commit/4bdc768cd905349705ece5b0efedf358bbf7551d https://github.com/facebookincubator/mvfst/commit/68ca466f646959b43940775a12eb6fbd4618f6f7 https://github.com/facebookincubator/velox/commit/cdd6bb76107d17672af3b1604ef520f2b66a7f15 Reviewed By: jailby fbshipit-source-id: 8950c9b7a5b5b2bd67f4ff0f7ee31f1f7a0b3f37 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 2f8d4edb1104d..feeff20d1c62d 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 7be3bac2a0148c9edfc9b51b987899e4afa3ec6a +Subproject commit 67512d5003eb3f7afd6145fea9db82b65d818ad1 From 8ee31f14d3470cf397143f58a0eb0d8501b8a4e9 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Tue, 31 Jan 2023 10:24:47 -0800 Subject: [PATCH 011/280] migrate switch state to thrift cow Summary: Second attempt to get D42715623 (https://github.com/facebook/fboss/commit/c3052d88ccbbf4cc30806d169eaeb989d3e7d3d0) landed Original commit changeset: 90c9ece0a811 Original Phabricator Diff: D42807695 (https://github.com/facebook/fboss/commit/c53ce8f3137ae3332ae43b5b3b1da33e3fa1eb65) Differential Revision: D42851183 fbshipit-source-id: e6c76984f266934dd27b197f7e0d19c470b56fac --- fboss/agent/ApplyThriftConfig.cpp | 6 +- fboss/agent/state/SwitchState.cpp | 229 +++++++++++----- fboss/agent/state/SwitchState.h | 250 +++++++++++------- .../state/tests/BufferPoolConfigTests.cpp | 3 +- fboss/thrift_cow/nodes/ThriftMapNode-inl.h | 12 + 5 files changed, 339 insertions(+), 161 deletions(-) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index 9bacddcfd5c96..efcea95c4db16 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -3133,17 +3133,17 @@ shared_ptr ThriftConfigApplier::updateBufferPoolConfigs( BufferPoolCfgMap::NodeContainer newBufferPoolConfigMap; auto newCfgedBufferPools = cfg_->bufferPoolConfigs(); - if (!newCfgedBufferPools && !origBufferPoolConfigs) { + if (!newCfgedBufferPools && origBufferPoolConfigs->empty()) { return nullptr; } - if (!newCfgedBufferPools && origBufferPoolConfigs) { + if (!newCfgedBufferPools && !origBufferPoolConfigs->empty()) { // old cfg eixists but new one doesn't *changed = true; return nullptr; } - if (newCfgedBufferPools && !origBufferPoolConfigs) { + if (newCfgedBufferPools && origBufferPoolConfigs->empty()) { *changed = true; } diff --git a/fboss/agent/state/SwitchState.cpp b/fboss/agent/state/SwitchState.cpp index 23583c6ad08f6..f97cc2bed1beb 100644 --- a/fboss/agent/state/SwitchState.cpp +++ b/fboss/agent/state/SwitchState.cpp @@ -405,7 +405,19 @@ SwitchStateFields SwitchStateFields::fromFollyDynamic( return switchState; } -SwitchState::SwitchState() {} +SwitchState::SwitchState() { + set( + network::toBinaryAddress(folly::IPAddress("0.0.0.0"))); + set( + network::toBinaryAddress(folly::IPAddress("0.0.0.0"))); + set( + network::toBinaryAddress(folly::IPAddress("::"))); + set( + network::toBinaryAddress(folly::IPAddress("::"))); + + set( + std::map{}); +} SwitchState::~SwitchState() {} @@ -417,223 +429,224 @@ void SwitchState::modify(std::shared_ptr* state) { } std::shared_ptr SwitchState::getPort(PortID id) const { - return getFields()->ports->getPort(id); + return getPorts()->getPort(id); } void SwitchState::registerPort(PortID id, const std::string& name) { - writableFields()->ports->registerPort(id, name); + ref()->registerPort(id, name); } void SwitchState::addPort(const std::shared_ptr& port) { - writableFields()->ports->addPort(port); + ref()->addPort(port); } void SwitchState::resetPorts(std::shared_ptr ports) { - writableFields()->ports.swap(ports); + ref() = ports; } void SwitchState::resetVlans(std::shared_ptr vlans) { - writableFields()->vlans.swap(vlans); + ref() = vlans; } void SwitchState::addVlan(const std::shared_ptr& vlan) { - auto* fields = writableFields(); - // For ease-of-use, automatically clone the VlanMap if we are still - // pointing to a published map. - if (fields->vlans->isPublished()) { - fields->vlans = fields->vlans->clone(); + if (cref()->isPublished()) { + // For ease-of-use, automatically clone the VlanMap if we are still + // pointing to a published map. + auto vlans = cref()->clone(); + + ref() = vlans; } - fields->vlans->addVlan(vlan); + ref()->addVlan(vlan); } -void SwitchState::setDefaultVlan(VlanID id) { - writableFields()->defaultVlan = id; +void SwitchState::setDefaultVlan(const VlanID& id) { + set(id); } void SwitchState::setArpTimeout(seconds timeout) { - writableFields()->arpTimeout = timeout; + set(timeout.count()); } void SwitchState::setNdpTimeout(seconds timeout) { - writableFields()->ndpTimeout = timeout; + set(timeout.count()); } void SwitchState::setArpAgerInterval(seconds interval) { - writableFields()->arpAgerInterval = interval; + set(interval.count()); } void SwitchState::setMaxNeighborProbes(uint32_t maxNeighborProbes) { - writableFields()->maxNeighborProbes = maxNeighborProbes; + set(maxNeighborProbes); } void SwitchState::setStaleEntryInterval(seconds interval) { - writableFields()->staleEntryInterval = interval; + set(interval.count()); } void SwitchState::addIntf(const std::shared_ptr& intf) { - auto* fields = writableFields(); - // For ease-of-use, automatically clone the InterfaceMap if we are still - // pointing to a published map. - if (fields->interfaces->isPublished()) { - fields->interfaces = fields->interfaces->clone(); + if (cref()->isPublished()) { + // For ease-of-use, automatically clone the InterfaceMap if we are still + // pointing to a published map. + auto intfs = cref()->clone(); + ref() = intfs; } - fields->interfaces->addInterface(intf); + ref()->addInterface(intf); } void SwitchState::resetIntfs(std::shared_ptr intfs) { - writableFields()->interfaces.swap(intfs); + ref() = intfs; } void SwitchState::resetRemoteIntfs(std::shared_ptr intfs) { - writableFields()->remoteInterfaces.swap(intfs); + ref() = intfs; } void SwitchState::resetRemoteSystemPorts( std::shared_ptr sysPorts) { - writableFields()->remoteSystemPorts.swap(sysPorts); + ref() = sysPorts; } void SwitchState::addAcl(const std::shared_ptr& acl) { - auto* fields = writableFields(); // For ease-of-use, automatically clone the AclMap if we are still // pointing to a published map. - if (fields->acls->isPublished()) { - fields->acls = fields->acls->clone(); + if (cref()->isPublished()) { + auto acls = cref()->clone(); + ref() = acls; } - fields->acls->addEntry(acl); + ref()->addEntry(acl); } std::shared_ptr SwitchState::getAcl(const std::string& name) const { - return getFields()->acls->getEntryIf(name); + return getAcls()->getEntryIf(name); } void SwitchState::resetAcls(std::shared_ptr acls) { - writableFields()->acls.swap(acls); + ref() = acls; } void SwitchState::resetAclTableGroups( std::shared_ptr aclTableGroups) { - writableFields()->aclTableGroups.swap(aclTableGroups); + ref() = aclTableGroups; } void SwitchState::resetAggregatePorts( std::shared_ptr aggPorts) { - writableFields()->aggPorts.swap(aggPorts); + ref() = aggPorts; } void SwitchState::resetSflowCollectors( const std::shared_ptr& collectors) { - writableFields()->sFlowCollectors = collectors; + ref() = collectors; } void SwitchState::resetQosPolicies(std::shared_ptr qosPolicies) { - writableFields()->qosPolicies = qosPolicies; + ref() = qosPolicies; } void SwitchState::resetControlPlane( std::shared_ptr controlPlane) { - writableFields()->controlPlane = controlPlane; + ref() = controlPlane; } void SwitchState::resetLoadBalancers( std::shared_ptr loadBalancers) { - writableFields()->loadBalancers.swap(loadBalancers); + ref() = loadBalancers; } void SwitchState::resetSwitchSettings( std::shared_ptr switchSettings) { - writableFields()->switchSettings = switchSettings; + ref() = switchSettings; } void SwitchState::resetQcmCfg(std::shared_ptr qcmCfg) { - writableFields()->qcmCfg = qcmCfg; + ref() = qcmCfg; } void SwitchState::resetBufferPoolCfgs(std::shared_ptr cfgs) { - writableFields()->bufferPoolCfgs = cfgs; + ref() = cfgs; } const std::shared_ptr& SwitchState::getLoadBalancers() const { - return getFields()->loadBalancers; + return cref(); } void SwitchState::resetMirrors(std::shared_ptr mirrors) { - writableFields()->mirrors.swap(mirrors); + ref() = mirrors; } const std::shared_ptr& SwitchState::getMirrors() const { - return getFields()->mirrors; + return cref(); } const std::shared_ptr& SwitchState::getFibs() const { - return getFields()->fibs; + return cref(); } void SwitchState::resetLabelForwardingInformationBase( std::shared_ptr labelFib) { - writableFields()->labelFib.swap(labelFib); + ref() = labelFib; } void SwitchState::resetForwardingInformationBases( std::shared_ptr fibs) { - writableFields()->fibs.swap(fibs); + ref() = fibs; } void SwitchState::addTransceiver( const std::shared_ptr& transceiver) { - auto* fields = writableFields(); // For ease-of-use, automatically clone the TransceiverMap if we are still // pointing to a published map. - if (fields->transceivers->isPublished()) { - fields->transceivers = fields->transceivers->clone(); + if (cref()->isPublished()) { + auto xcvrs = cref()->clone(); + ref() = xcvrs; } - fields->transceivers->addTransceiver(transceiver); + ref()->addTransceiver(transceiver); } void SwitchState::resetTransceivers( std::shared_ptr transceivers) { - writableFields()->transceivers.swap(transceivers); + ref() = transceivers; } void SwitchState::addSystemPort(const std::shared_ptr& systemPort) { - auto* fields = writableFields(); // For ease-of-use, automatically clone the SystemPortMap if we are still // pointing to a published map. - if (fields->systemPorts->isPublished()) { - fields->systemPorts = fields->systemPorts->clone(); + if (cref()->isPublished()) { + auto sysPortMap = cref()->clone(); + ref() = sysPortMap; } - fields->systemPorts->addSystemPort(systemPort); + ref()->addSystemPort(systemPort); } void SwitchState::resetSystemPorts(std::shared_ptr systemPorts) { - writableFields()->systemPorts.swap(systemPorts); + ref() = systemPorts; } void SwitchState::addTunnel(const std::shared_ptr& tunnel) { - auto* fields = writableFields(); // For ease-of-use, automatically clone the TunnelMap if we are still // pointing to a published map. - if (fields->ipTunnels->isPublished()) { - fields->ipTunnels = fields->ipTunnels->clone(); + if (cref()->isPublished()) { + auto ipTunnelMap = cref()->clone(); + ref() = ipTunnelMap; } - fields->ipTunnels->addTunnel(tunnel); + ref()->addTunnel(tunnel); } void SwitchState::resetTunnels(std::shared_ptr tunnels) { - writableFields()->ipTunnels.swap(tunnels); + ref() = tunnels; } void SwitchState::resetTeFlowTable(std::shared_ptr flowTable) { - writableFields()->teFlowTable.swap(flowTable); + ref() = flowTable; } void SwitchState::resetDsfNodes(std::shared_ptr dsfNodes) { - writableFields()->dsfNodes.swap(dsfNodes); + ref() = dsfNodes; } void SwitchState::resetUdfConfig(std::shared_ptr udfConfig) { - writableFields()->udfConfig.swap(udfConfig); + ref() = udfConfig; } std::shared_ptr SwitchState::getAclTablesForStage( @@ -748,6 +761,86 @@ void SwitchState::revertNewTeFlowEntry( } } -template class NodeBaseT; +std::shared_ptr SwitchState::fromFollyDynamic( + const folly::dynamic& json) { + const auto& fields = SwitchStateFields::fromFollyDynamic(json); + return SwitchState::fromThrift(fields.toThrift()); +} + +std::unique_ptr SwitchState::uniquePtrFromThrift( + const state::SwitchState& switchState) { + auto state = std::make_unique(); + state->BaseT::fromThrift(switchState); + if (FLAGS_enable_acl_table_group) { + if (!switchState.aclMap()->empty()) { + state->ref() = + AclTableGroupMap::createDefaultAclTableGroupMapFromThrift( + switchState.get_aclMap()); + state->ref()->clear(); + } + } + if (!FLAGS_enable_acl_table_group) { + auto aclTableGroupMap = switchState.aclTableGroupMap(); + if (aclTableGroupMap && aclTableGroupMap->size() > 0) { + state->ref() = + AclTableGroupMap::getDefaultAclTableGroupMap(*aclTableGroupMap); + state->ref()->clear(); + } + } + return state; +} + +std::unique_ptr SwitchState::uniquePtrFromFollyDynamic( + const folly::dynamic& json) { + const auto& fields = SwitchStateFields::fromFollyDynamic(json); + return uniquePtrFromThrift(fields.toThrift()); +} + +folly::dynamic SwitchState::toFollyDynamic() const { + SwitchStateFields fields(toThrift()); + return fields.toFollyDynamic(); +} + +VlanID SwitchState::getDefaultVlan() const { + return VlanID(cref()->toThrift()); +} + +std::shared_ptr SwitchState::fromThrift( + const state::SwitchState& data) { + auto uniqState = uniquePtrFromThrift(data); + std::shared_ptr state = std::move(uniqState); + return state; +} + +state::SwitchState SwitchState::toThrift() const { + auto data = BaseT::toThrift(); + auto aclMap = data.aclMap(); + auto aclTableGroupMap = data.aclTableGroupMap(); + if (FLAGS_enable_acl_table_group) { + if (!aclMap->empty() && (!aclTableGroupMap || aclTableGroupMap->empty())) { + data.aclTableGroupMap() = + AclTableGroupMap::createDefaultAclTableGroupMapFromThrift( + data.get_aclMap()) + ->toThrift(); + } + aclMap->clear(); + } else { + if (aclTableGroupMap && !aclTableGroupMap->empty() && aclMap->empty()) { + if (auto aclMapPtr = + AclTableGroupMap::getDefaultAclTableGroupMap(*aclTableGroupMap)) { + aclMap = aclMapPtr->toThrift(); + } + aclTableGroupMap->clear(); + } + } + return data; +} + +// THRIFT_COPY +bool SwitchState::operator==(const SwitchState& other) const { + return (toThrift() == other.toThrift()); +} + +template class ThriftStructNode; } // namespace facebook::fboss diff --git a/fboss/agent/state/SwitchState.h b/fboss/agent/state/SwitchState.h index 9d0e39d989c71..f9522c8c2a261 100644 --- a/fboss/agent/state/SwitchState.h +++ b/fboss/agent/state/SwitchState.h @@ -27,6 +27,7 @@ #include "fboss/agent/state/ControlPlane.h" #include "fboss/agent/state/DsfNodeMap.h" #include "fboss/agent/state/ForwardingInformationBaseMap.h" +#include "fboss/agent/state/Interface.h" #include "fboss/agent/state/InterfaceMap.h" #include "fboss/agent/state/IpTunnelMap.h" #include "fboss/agent/state/LabelForwardingInformationBase.h" @@ -42,6 +43,7 @@ #include "fboss/agent/state/TeFlowTable.h" #include "fboss/agent/state/TransceiverMap.h" #include "fboss/agent/state/UdfConfig.h" +#include "fboss/agent/state/Vlan.h" #include "fboss/agent/state/VlanMap.h" #include "fboss/agent/types.h" @@ -64,6 +66,9 @@ struct SwitchStateFields : public ThriftyFields { SwitchStateFields(); + explicit SwitchStateFields(const state::SwitchState& data) { + writableData() = data; + } template void forEachChild(Fn fn) { fn(ports.get()); @@ -154,6 +159,81 @@ struct SwitchStateFields std::optional pfcWatchdogRecoveryAction{}; }; +USE_THRIFT_COW(SwitchState); +RESOLVE_STRUCT_MEMBER(SwitchState, switch_state_tags::portMap, PortMap); +RESOLVE_STRUCT_MEMBER(SwitchState, switch_state_tags::vlanMap, VlanMap); +RESOLVE_STRUCT_MEMBER(SwitchState, switch_state_tags::aclMap, AclMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::transceiverMap, + TransceiverMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::bufferPoolCfgMap, + BufferPoolCfgMap); +RESOLVE_STRUCT_MEMBER(SwitchState, switch_state_tags::mirrorMap, MirrorMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::controlPlane, + ControlPlane); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::switchSettings, + SwitchSettings); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::systemPortMap, + SystemPortMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::fibs, + ForwardingInformationBaseMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::labelFib, + LabelForwardingInformationBase); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::qosPolicyMap, + QosPolicyMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::sflowCollectorMap, + SflowCollectorMap); +RESOLVE_STRUCT_MEMBER(SwitchState, switch_state_tags::ipTunnelMap, IpTunnelMap); +RESOLVE_STRUCT_MEMBER(SwitchState, switch_state_tags::teFlowTable, TeFlowTable); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::aggregatePortMap, + AggregatePortMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::loadBalancerMap, + LoadBalancerMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::aclTableGroupMap, + AclTableGroupMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::interfaceMap, + InterfaceMap); +RESOLVE_STRUCT_MEMBER(SwitchState, switch_state_tags::dsfNodes, DsfNodeMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::remoteSystemPortMap, + SystemPortMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::remoteInterfaceMap, + InterfaceMap); +RESOLVE_STRUCT_MEMBER( + SwitchState, + switch_state_tags::defaultDataPlaneQosPolicy, + QosPolicy); +RESOLVE_STRUCT_MEMBER(SwitchState, switch_state_tags::qcmCfg, QcmCfg); +RESOLVE_STRUCT_MEMBER(SwitchState, switch_state_tags::udfConfig, UdfConfig); + /* * SwitchState stores the current switch configuration. * @@ -186,54 +266,34 @@ struct SwitchStateFields * without making a new copy-on-write version of the SwitchState. Therefore * locks are used to protect access to dynamic data. */ -class SwitchState : public NodeBaseT { +class SwitchState : public ThriftStructNode { public: + using BaseT = ThriftStructNode; /* * Create a new, empty state. */ SwitchState(); ~SwitchState() override; - state::SwitchState toThrift() const { - return this->getFields()->toThrift(); - } - - static std::shared_ptr fromThrift( - const state::SwitchState& obj) { - auto fields = SwitchStateFields::fromThrift(obj); - return std::make_shared(fields); - } - static std::shared_ptr fromFollyDynamic( - const folly::dynamic& json) { - const auto& fields = SwitchStateFields::fromFollyDynamic(json); - return std::make_shared(fields); - } + const folly::dynamic& json); static std::shared_ptr fromJson(const folly::fbstring& jsonStr) { return fromFollyDynamic(folly::parseJson(jsonStr)); } static std::unique_ptr uniquePtrFromThrift( - const state::SwitchState& switchState) { - const auto& fields = SwitchStateFields::fromThrift(switchState); - return std::make_unique(fields); - } + const state::SwitchState& switchState); static std::unique_ptr uniquePtrFromFollyDynamic( - const folly::dynamic& json) { - const auto& fields = SwitchStateFields::fromFollyDynamic(json); - return std::make_unique(fields); - } + const folly::dynamic& json); static std::unique_ptr uniquePtrFromJson( const folly::fbstring& jsonStr) { return uniquePtrFromFollyDynamic(folly::parseJson(jsonStr)); } - folly::dynamic toFollyDynamic() const override { - return getFields()->toFollyDynamic(); - } + folly::dynamic toFollyDynamic() const override; static void modify(std::shared_ptr* state); @@ -261,52 +321,47 @@ class SwitchState : public NodeBaseT { const std::shared_ptr& oldFlowEntry, std::shared_ptr* appliedState); - bool operator==(const SwitchState& other) const { - return *getFields() == *other.getFields(); - } - const std::shared_ptr& getPorts() const { - return getFields()->ports; + return cref(); } std::shared_ptr getPort(PortID id) const; const std::shared_ptr getAggregatePorts() const { - return getFields()->aggPorts; + return cref(); } const std::shared_ptr& getVlans() const { - return getFields()->vlans; + return cref(); } - VlanID getDefaultVlan() const { - return getFields()->defaultVlan; - } - void setDefaultVlan(VlanID id); + VlanID getDefaultVlan() const; + void setDefaultVlan(const VlanID& id); const std::shared_ptr getDefaultDataPlaneQosPolicy() const { - return getFields()->defaultDataPlaneQosPolicy; + return cref(); } void setDefaultDataPlaneQosPolicy(std::shared_ptr qosPolicy) { - writableFields()->defaultDataPlaneQosPolicy = std::move(qosPolicy); + ref() = qosPolicy; } const std::shared_ptr& getInterfaces() const { - return getFields()->interfaces; + return cref(); } std::shared_ptr getAcl(const std::string& name) const; const std::shared_ptr& getAcls() const { - return getFields()->acls; + return cref(); } const std::shared_ptr& getAclTableGroups() const { - return getFields()->aclTableGroups; + return cref(); } std::chrono::seconds getArpTimeout() const { - return getFields()->arpTimeout; + auto arpTimeout = cref()->toThrift(); + return std::chrono::seconds(arpTimeout); } std::shared_ptr getAclsForTable( @@ -317,54 +372,57 @@ class SwitchState : public NodeBaseT { cfg::AclStage aclStage) const; const std::shared_ptr& getSflowCollectors() const { - return getFields()->sFlowCollectors; + return cref(); } std::shared_ptr getQosPolicy(const std::string& name) const { - return getFields()->qosPolicies->getQosPolicyIf(name); + return getQosPolicies()->getQosPolicyIf(name); } const std::shared_ptr& getQosPolicies() const { - return getFields()->qosPolicies; + return cref(); } const std::shared_ptr& getControlPlane() const { - return getFields()->controlPlane; + return cref(); } const std::shared_ptr& getSwitchSettings() const { - return getFields()->switchSettings; + return cref(); } const std::shared_ptr getQcmCfg() const { - return getFields()->qcmCfg; + return cref(); } const std::shared_ptr getBufferPoolCfgs() const { - return getFields()->bufferPoolCfgs; + return cref(); } void setArpTimeout(std::chrono::seconds timeout); std::chrono::seconds getNdpTimeout() const { - return getFields()->ndpTimeout; + return std::chrono::seconds( + cref()->toThrift()); } void setNdpTimeout(std::chrono::seconds timeout); std::chrono::seconds getArpAgerInterval() const { - return getFields()->arpAgerInterval; + return std::chrono::seconds( + cref()->toThrift()); } void setArpAgerInterval(std::chrono::seconds interval); uint32_t getMaxNeighborProbes() const { - return getFields()->maxNeighborProbes; + return cref()->toThrift(); } void setMaxNeighborProbes(uint32_t maxNeighborProbes); std::chrono::seconds getStaleEntryInterval() const { - return getFields()->staleEntryInterval; + return std::chrono::seconds( + cref()->toThrift()); } void setStaleEntryInterval(std::chrono::seconds interval); @@ -372,41 +430,62 @@ class SwitchState : public NodeBaseT { // dhcp relay packet IP overrides folly::IPAddressV4 getDhcpV4RelaySrc() const { - return getFields()->dhcpV4RelaySrc; + return network::toIPAddress( + cref()->toThrift()) + .asV4(); } void setDhcpV4RelaySrc(folly::IPAddressV4 v4RelaySrc) { - writableFields()->dhcpV4RelaySrc = v4RelaySrc; + set( + network::toBinaryAddress(v4RelaySrc)); } folly::IPAddressV6 getDhcpV6RelaySrc() const { - return getFields()->dhcpV6RelaySrc; + return network::toIPAddress( + cref()->toThrift()) + .asV6(); } void setDhcpV6RelaySrc(folly::IPAddressV6 v6RelaySrc) { - writableFields()->dhcpV6RelaySrc = v6RelaySrc; + set( + network::toBinaryAddress(v6RelaySrc)); } folly::IPAddressV4 getDhcpV4ReplySrc() const { - return getFields()->dhcpV4ReplySrc; + return network::toIPAddress( + cref()->toThrift()) + .asV4(); } void setDhcpV4ReplySrc(folly::IPAddressV4 v4ReplySrc) { - writableFields()->dhcpV4ReplySrc = v4ReplySrc; + set( + network::toBinaryAddress(v4ReplySrc)); } folly::IPAddressV6 getDhcpV6ReplySrc() const { - return getFields()->dhcpV6ReplySrc; + return network::toIPAddress( + cref()->toThrift()) + .asV6(); } void setDhcpV6ReplySrc(folly::IPAddressV6 v6ReplySrc) { - writableFields()->dhcpV6ReplySrc = v6ReplySrc; + set( + network::toBinaryAddress(v6ReplySrc)); } + // THRIFT_COPY std::optional getPfcWatchdogRecoveryAction() const { - return getFields()->pfcWatchdogRecoveryAction; + auto action = safe_cref(); + if (!action) { + return std::nullopt; + } + return action->toThrift(); } void setPfcWatchdogRecoveryAction( std::optional recoveryAction) { - writableFields()->pfcWatchdogRecoveryAction = recoveryAction; + if (!recoveryAction) { + ref().reset(); + } else { + set(*recoveryAction); + } } const std::shared_ptr& getLoadBalancers() const; @@ -414,38 +493,38 @@ class SwitchState : public NodeBaseT { const std::shared_ptr& getFibs() const; const std::shared_ptr& getLabelForwardingInformationBase() const { - return getFields()->labelFib; + return cref(); } const std::shared_ptr& getTransceivers() const { - return getFields()->transceivers; + return cref(); } const std::shared_ptr& getSystemPorts() const { - return getFields()->systemPorts; + return cref(); } const std::shared_ptr& getTunnels() const { - return getFields()->ipTunnels; + return cref(); } const std::shared_ptr& getTeFlowTable() const { - return getFields()->teFlowTable; + return cref(); } const std::shared_ptr& getDsfNodes() const { - return getFields()->dsfNodes; + return cref(); } const std::shared_ptr& getUdfConfig() const { - return getFields()->udfConfig; + return cref(); } /* * Remote objects */ const std::shared_ptr& getRemoteSystemPorts() const { - return getFields()->remoteSystemPorts; + return cref(); } const std::shared_ptr& getRemoteInterfaces() const { - return getFields()->remoteInterfaces; + return cref(); } /* * Get system ports for a given switch id @@ -501,27 +580,20 @@ class SwitchState : public NodeBaseT { void resetRemoteSystemPorts(std::shared_ptr systemPorts); void resetRemoteIntfs(std::shared_ptr intfs); - void publish() override { - using BaseT = NodeBaseT; - if (auto defaultDataPlaneQosPolicy = getDefaultDataPlaneQosPolicy()) { - defaultDataPlaneQosPolicy->publish(); - } - if (auto qcmCfg = getQcmCfg()) { - qcmCfg->publish(); - } - if (auto bufferPoolCfg = getBufferPoolCfgs()) { - bufferPoolCfg->publish(); - } - if (auto udfCfg = getUdfConfig()) { - udfCfg->publish(); - } - BaseT::publish(); + + static std::shared_ptr fromThrift( + const state::SwitchState& data); + state::SwitchState toThrift() const; + + bool operator==(const SwitchState& other) const; + bool operator!=(const SwitchState& other) const { + return !(*this == other); } private: bool isLocalSwitchId(SwitchID switchId) const; // Inherit the constructor required for clone() - using NodeBaseT::NodeBaseT; + using BaseT::BaseT; friend class CloneAllocator; }; diff --git a/fboss/agent/state/tests/BufferPoolConfigTests.cpp b/fboss/agent/state/tests/BufferPoolConfigTests.cpp index e33fc861ac6e6..89cc50f152396 100644 --- a/fboss/agent/state/tests/BufferPoolConfigTests.cpp +++ b/fboss/agent/state/tests/BufferPoolConfigTests.cpp @@ -113,7 +113,8 @@ TEST(BufferPoolConfigTest, applyConfig) { const int kSharedBytes = 1500; cfg::SwitchConfig config; - EXPECT_EQ(nullptr, stateV0->getBufferPoolCfgs()); + EXPECT_NE(nullptr, stateV0->getBufferPoolCfgs()); + EXPECT_EQ(0, stateV0->getBufferPoolCfgs()->size()); std::map bufferPoolCfgMap; auto updateBufferPoolCfg = [&](const std::string& key, diff --git a/fboss/thrift_cow/nodes/ThriftMapNode-inl.h b/fboss/thrift_cow/nodes/ThriftMapNode-inl.h index f61c401509436..c008982d40bf1 100644 --- a/fboss/thrift_cow/nodes/ThriftMapNode-inl.h +++ b/fboss/thrift_cow/nodes/ThriftMapNode-inl.h @@ -250,6 +250,10 @@ struct ThriftMapFields { return !(*this == that); } + void clear() { + storage_.clear(); + } + private: template value_type childFactory(Args&&... args) { @@ -421,6 +425,10 @@ class ThriftMapNode return this->getFields()->size(); } + bool empty() const { + return size() == 0; + } + void modify(const std::string& token) { if constexpr (std::is_same_v< typename Fields::KeyTypeClass, @@ -497,6 +505,10 @@ class ThriftMapNode return !(*this == that); } + void clear() { + this->writableFields()->clear(); + } + private: friend class CloneAllocator; }; From b7d5aaa50115e8abf5f591e6a00a7c8533a25cc4 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 31 Jan 2023 10:43:47 -0800 Subject: [PATCH 012/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/a00fc48a102776ab3fc432d1c424a0ff88162fca https://github.com/facebook/rocksdb/commit/a82021c3d03a51abff582cf5a009c0a289df7059 https://github.com/facebook/wangle/commit/9db446294f9153c4cb8d667b4faaef9dc1e57caf https://github.com/facebookexperimental/edencommon/commit/cfa7e8516cc394fa26f725f518eed06e8c937c9c https://github.com/facebookincubator/fizz/commit/c82fcdfee776034e37ffebc7f49dce494f39301f https://github.com/facebookincubator/katran/commit/49709a1f9ccfaee57ad95d966fa1002dcd7da023 https://github.com/facebookincubator/velox/commit/360c5cca7ffd2795feb8c112775b8399b23fb932 Reviewed By: jailby fbshipit-source-id: 8c7a459e7c6ac1277f2da7420325b3f65e588f71 --- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 6b6bcf8903e14..d70ba4569c3cc 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 57f32870d5b451b8d17fe4250c26646955421157 +Subproject commit 9db446294f9153c4cb8d667b4faaef9dc1e57caf From 551f271a3a098cb83aec11f2b277ff971a9f34ae Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Tue, 31 Jan 2023 11:11:22 -0800 Subject: [PATCH 013/280] Get HwInPauseDiscardsTests runnable on both voq and non voq switch Summary: As titled + unblock HwVoqSwitchWithFabricTest on Ebro Differential Revision: D42879169 fbshipit-source-id: 0fba292878e4505fc8a47ad211f3b23516da9bde --- .../dataplane_tests/HwInPauseDiscardsTests.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwInPauseDiscardsTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwInPauseDiscardsTests.cpp index 26cbac1271c06..0758140eb8383 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwInPauseDiscardsTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwInPauseDiscardsTests.cpp @@ -40,13 +40,13 @@ class HwInPauseDiscardsCounterTest : public HwLinkStateDependentTest { payload.insert(payload.end(), padding.begin(), padding.end()); auto pkt = utility::makeEthTxPacket( getHwSwitch(), - VlanID(1), + utility::firstVlanID(getProgrammedState()), getPlatform()->getLocalMac(), folly::MacAddress("01:80:C2:00:00:01"), ETHERTYPE::ETHERTYPE_EPON, payload); getHwSwitchEnsemble()->ensureSendPacketOutOfPort( - std::move(pkt), PortID(masterLogicalPortIds()[0])); + std::move(pkt), PortID(masterLogicalInterfacePortIds()[0])); } protected: @@ -55,8 +55,8 @@ class HwInPauseDiscardsCounterTest : public HwLinkStateDependentTest { if (enableRxPause) { auto newState = getProgrammedState()->clone(); auto portMap = newState->getPorts()->modify(&newState); - auto port = - portMap->getPort(PortID(masterLogicalPortIds()[0]))->clone(); + auto port = portMap->getPort(PortID(masterLogicalInterfacePortIds()[0])) + ->clone(); cfg::PortPause pauseCfg; *pauseCfg.rx() = true; port->setPause(pauseCfg); @@ -65,9 +65,11 @@ class HwInPauseDiscardsCounterTest : public HwLinkStateDependentTest { } }; auto verify = [=]() { - auto portStatsBefore = getLatestPortStats(masterLogicalPortIds()[0]); + auto portStatsBefore = + getLatestPortStats(masterLogicalInterfacePortIds()[0]); pumpTraffic(); - auto portStatsAfter = getLatestPortStats(masterLogicalPortIds()[0]); + auto portStatsAfter = + getLatestPortStats(masterLogicalInterfacePortIds()[0]); /* * Certain asics count the pause packets when pause is disabled while From bbb6845a05554dbaae4fbd0427f1d953288b0d2e Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 31 Jan 2023 11:32:51 -0800 Subject: [PATCH 014/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/d3028413d6155b72a0a72a64a6b4bdb5d672d99c https://github.com/facebook/fbthrift/commit/6f25f084bceaf2cd1e8b9fb0d2ad648f50c426b5 https://github.com/facebook/mcrouter/commit/e77901ee38dcc77681931e03d9bd9dc470d2c90a https://github.com/facebook/proxygen/commit/ab610d2f000319dd7bb8175dd658aa566b6d14f8 https://github.com/facebook/rocksdb/commit/753d4d507892e8059a17258ea03505dee396b033 https://github.com/facebook/watchman/commit/49e2842b532f2bc4f321c80f8732b3ce273a3f0b https://github.com/facebookincubator/velox/commit/4fbff1fcd646a19a0de803dedbd7839d769cf9ce Reviewed By: jailby fbshipit-source-id: becb2445467da110250d1711e0b9851119a596a4 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index feeff20d1c62d..415b163c3739e 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 67512d5003eb3f7afd6145fea9db82b65d818ad1 +Subproject commit 6f25f084bceaf2cd1e8b9fb0d2ad648f50c426b5 From 06a0804c645b95e098b49a12509062f61f386ae5 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Tue, 31 Jan 2023 13:07:30 -0800 Subject: [PATCH 015/280] Get jubmo frames test working and greenlight tests on voq chips Summary: As titled Reviewed By: nivinl Differential Revision: D42887962 fbshipit-source-id: 18497f2be00a9466e626d1f25604951d37c8b05d --- .../test/dataplane_tests/HwJumboFramesTests.cpp | 16 +++++++++------- .../centos-7-x86_64/run_scripts/run_test.py | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwJumboFramesTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwJumboFramesTests.cpp index d04d2e7b69917..1b2e25d268f56 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwJumboFramesTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwJumboFramesTests.cpp @@ -32,20 +32,19 @@ namespace facebook::fboss { class HwJumboFramesTest : public HwLinkStateDependentTest { private: cfg::SwitchConfig initialConfig() const override { - auto cfg = utility::oneL3IntfConfig( + auto cfg = utility::onePortPerInterfaceConfig( getHwSwitch(), - masterLogicalPortIds()[0], + masterLogicalPortIds(), getAsic()->desiredLoopbackMode()); cfg.interfaces()[0].mtu() = 9000; return cfg; } void sendPkt(int payloadSize) { - auto vlanId = VlanID(*initialConfig().vlanPorts()[0].vlanID()); - auto mac = utility::getInterfaceMac(getProgrammedState(), vlanId); + auto mac = utility::getFirstInterfaceMac(getProgrammedState()); auto txPacket = utility::makeUDPTxPacket( getHwSwitch(), - vlanId, + utility::firstVlanID(getProgrammedState()), mac, mac, folly::IPAddressV6("2620:0:1cfe:face:b00c::3"), @@ -67,11 +66,14 @@ class HwJumboFramesTest : public HwLinkStateDependentTest { }; auto verify = [=]() { - auto portStatsBefore = getLatestPortStats(masterLogicalPortIds()[0]); + utility::EcmpSetupAnyNPorts6 ecmpHelper( + getProgrammedState(), RouterID(0)); + auto port = ecmpHelper.ecmpPortDescriptorAt(0).phyPortID(); + auto portStatsBefore = getLatestPortStats(port); auto pktsBefore = getPortOutPkts(portStatsBefore); auto bytesBefore = *portStatsBefore.outBytes_(); sendPkt(payloadSize); - auto portStatsAfter = getLatestPortStats(masterLogicalPortIds()[0]); + auto portStatsAfter = getLatestPortStats(port); auto pktsAfter = getPortOutPkts(portStatsAfter); auto bytesAfter = *portStatsAfter.outBytes_(); if (expectPacketDrop) { diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 764a4a885b45a..1de76312efa01 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -38,6 +38,9 @@ # Basic VOQ switch tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwVoqSwitchTest* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwVoqSwitchWithFabriPortsTest.* +# Basic forwarding tests +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwJumboFramesTest.* +# # LB Tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV4.*:-*Ucmp*:-*Shrink* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV6.*:-*Ucmp*:-*Shrink* From 3013d2f5022c3845c1c2607f7f68b050c14ffed6 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 31 Jan 2023 14:07:09 -0800 Subject: [PATCH 016/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fb303/commit/50af07af9a1b6374b44faeb50ed948f56cd33455 https://github.com/facebook/fbthrift/commit/206bba8e29b52c4f5cacc4638e403b34ce07472d https://github.com/facebook/watchman/commit/170ea0e5d165f60fbc28fb23411959d910416f8c https://github.com/facebookincubator/katran/commit/2ee002a8087ce0a79f0e07f5359ff01b6fe83fed https://github.com/facebookincubator/velox/commit/dffb9b9ce42d4bc18b98d6032fed4ee83b7e0bb2 Reviewed By: jailby fbshipit-source-id: 7a5f70a68ffbb53e4e567d0f305d58aed2a6867a --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 415b163c3739e..74fed02f97219 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 6f25f084bceaf2cd1e8b9fb0d2ad648f50c426b5 +Subproject commit 206bba8e29b52c4f5cacc4638e403b34ce07472d From 7a579c4350296550eb6786c8bafb202a2ad80ba7 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 31 Jan 2023 16:38:47 -0800 Subject: [PATCH 017/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/2ba650e17fae81eb7d72d503914ce039f32a9873 https://github.com/facebook/proxygen/commit/75a214c46e8f4229047adc21c7efb7d1b64a856a https://github.com/facebook/watchman/commit/2bd8be703af27aeba8ac93a311ea1396aaa05084 https://github.com/facebookincubator/katran/commit/c1d6ecf726df1db0dc2098e79567f38d186adfde https://github.com/facebookincubator/mvfst/commit/d32728fb0a2ed1add922621a1f68d412d6c22fb4 https://github.com/facebookincubator/superconsole/commit/b8913d070b3d54776ddf1b26082bf3aada23dba6 https://github.com/facebookincubator/velox/commit/07cba598266a5fcc122ba7f7e340e91c12a89370 Reviewed By: jailby fbshipit-source-id: f5ddee9d1bca5d9587e64654e77ef7fa51b92950 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 74fed02f97219..db1c130b68145 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 206bba8e29b52c4f5cacc4638e403b34ce07472d +Subproject commit 2ba650e17fae81eb7d72d503914ce039f32a9873 diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index 92801b5153d36..aa87e466c1c95 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 4e89197926c0f35c9b2fe6b6bb28268f030c15d8 +Subproject commit e8c0e1300cb86b23b0c9b129ea3b5904a36a8b75 From 2e4d8781ca65c3d71cd1a54bc0113578ceebff97 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Tue, 31 Jan 2023 19:27:58 -0800 Subject: [PATCH 018/280] provide a way to save test config in different file Summary: provide a way to save config in different file instead of overwriting FLAGS_config. this is being done in a fashion similar to AgentTest. Reviewed By: jasmeetbagga Differential Revision: D42806001 Privacy Context Container: L1125642 fbshipit-source-id: 4321c954796380b0816a37cfc933d24aae4e1f44 --- fboss/agent/test/AgentEnsemble.cpp | 15 ++++++++++++--- fboss/agent/test/AgentEnsemble.h | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fboss/agent/test/AgentEnsemble.cpp b/fboss/agent/test/AgentEnsemble.cpp index 80bd46e9ba636..fc70220671fdf 100644 --- a/fboss/agent/test/AgentEnsemble.cpp +++ b/fboss/agent/test/AgentEnsemble.cpp @@ -22,6 +22,9 @@ void initFlagDefaults(const std::map& defaults) { } } // namespace namespace facebook::fboss { +AgentEnsemble::AgentEnsemble(const std::string& configFileName) { + configFile_ = configFileName; +} void AgentEnsemble::setupEnsemble( int argc, @@ -61,14 +64,20 @@ void AgentEnsemble::startAgent() { } void AgentEnsemble::writeConfig(const cfg::SwitchConfig& config) { - auto agentConfig = AgentConfig::fromFile(FLAGS_config)->thrift; + auto* initializer = agentInitializer(); + auto agentConfig = initializer->sw()->getPlatform()->config()->thrift; agentConfig.sw() = config; auto newAgentConfig = AgentConfig( agentConfig, apache::thrift::SimpleJSONSerializer::serialize( agentConfig)); - newAgentConfig.dumpConfig(FLAGS_config); - + auto testConfigDir = + initializer->sw()->getPlatform()->getPersistentStateDir() + + "/agent_ensemble/"; + utilCreateDir(testConfigDir); + auto fileName = testConfigDir + configFile_; + newAgentConfig.dumpConfig(fileName); + FLAGS_config = fileName; initFlagDefaults(*newAgentConfig.thrift.defaultCommandLineArgs()); } diff --git a/fboss/agent/test/AgentEnsemble.h b/fboss/agent/test/AgentEnsemble.h index 02c6e03145df5..3d5e4573dc108 100644 --- a/fboss/agent/test/AgentEnsemble.h +++ b/fboss/agent/test/AgentEnsemble.h @@ -19,6 +19,7 @@ using AgentEnsembleConfigFn = std::function< class AgentEnsemble { public: AgentEnsemble() {} + explicit AgentEnsemble(const std::string& configFileName); ~AgentEnsemble(); void setupEnsemble( @@ -75,6 +76,7 @@ class AgentEnsemble { cfg::SwitchConfig initialConfig_; std::unique_ptr asyncInitThread_{nullptr}; std::vector masterLogicalPortIds_; + std::string configFile_{"agent.conf"}; }; } // namespace facebook::fboss From 5e2877968ed4ac14aedbd7f9af8a9c5ae08e9934 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 31 Jan 2023 19:51:55 -0800 Subject: [PATCH 019/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/41ae5343f88a64d6283ac2c205828f35deaad46e https://github.com/facebookincubator/velox/commit/81c70f287fe85a60858ea680714f167a710f1fe7 Reviewed By: jailby fbshipit-source-id: 7e72e5f328f6665bf8f3cd6783310f31a6c781a5 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index db1c130b68145..a42ad231e0349 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 2ba650e17fae81eb7d72d503914ce039f32a9873 +Subproject commit 41ae5343f88a64d6283ac2c205828f35deaad46e From 1cae6a2fe174350f23ea8846608625d340682cf2 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 31 Jan 2023 20:40:52 -0800 Subject: [PATCH 020/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/e3815f69539dd18820966b5ac9f8e9b91c898c82 https://github.com/facebook/watchman/commit/28dc82a00a98697a930c9254b97facfea38f766e https://github.com/facebookincubator/velox/commit/288251865641b7414b50999d9a8d655dc5d2d055 https://github.com/facebookresearch/multimodal/commit/777569188e2c3c9d4341a003a8f1727174d0857a https://github.com/pytorch/fbgemm/commit/45f5fb3dad57831176d6ccb2f5465366a8bae525 Reviewed By: jailby fbshipit-source-id: 2f3c74ee5e80f1f4c2619ed9f44a7b386cb941a6 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index a42ad231e0349..363b4ad834260 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 41ae5343f88a64d6283ac2c205828f35deaad46e +Subproject commit e3815f69539dd18820966b5ac9f8e9b91c898c82 From 288c426911067d1d758092c65a879100f42c79a9 Mon Sep 17 00:00:00 2001 From: Jitendra Verma Date: Tue, 31 Jan 2023 22:25:25 -0800 Subject: [PATCH 021/280] BCM config check test for UdfPacketMatcher Summary: Added test to verify BCM UDF PacketMatcher configuration Differential Revision: D42877349 Privacy Context Container: L1125642 fbshipit-source-id: e902e953bd7cd14cee4cd7fcc2119d423f112c2f --- fboss/agent/hw/bcm/BcmUdfManager.cpp | 12 ++++++++++++ fboss/agent/hw/bcm/BcmUdfManager.h | 2 ++ fboss/agent/hw/bcm/tests/BcmUdfTests.cpp | 23 +++++++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/fboss/agent/hw/bcm/BcmUdfManager.cpp b/fboss/agent/hw/bcm/BcmUdfManager.cpp index 8d24c4e71eef9..54a70ea10683d 100644 --- a/fboss/agent/hw/bcm/BcmUdfManager.cpp +++ b/fboss/agent/hw/bcm/BcmUdfManager.cpp @@ -204,6 +204,18 @@ int BcmUdfManager::getBcmUdfGroupFieldSize( return iter->second->getUdfMatchFieldWidth(); } +int BcmUdfManager::getBcmUdfPacketMatcherId( + const std::string& udfPacketMatcherName) const { + auto iter = udfPacketMatcherMap_.find(udfPacketMatcherName); + if (iter == udfPacketMatcherMap_.end()) { + throw FbossError("Unable to find : ", udfPacketMatcherName, " in the map."); + } + XLOG(DBG3) << " For UDF packet matcher " << udfPacketMatcherName + << " get BCM udf packet matcher id: " + << iter->second->getUdfPacketMatcherId(); + return iter->second->getUdfPacketMatcherId(); +} + BcmUdfManager::~BcmUdfManager() { XLOG(DBG2) << "Destroying BcmUdfManager"; udfGroupsMap_.clear(); diff --git a/fboss/agent/hw/bcm/BcmUdfManager.h b/fboss/agent/hw/bcm/BcmUdfManager.h index 892d0401ffe08..eb448a2d4147c 100644 --- a/fboss/agent/hw/bcm/BcmUdfManager.h +++ b/fboss/agent/hw/bcm/BcmUdfManager.h @@ -54,6 +54,8 @@ class BcmUdfManager { int getBcmUdfGroupId(const std::string& udfGroupName) const; int getBcmUdfGroupFieldSize(const std::string& udfGroupName) const; + int getBcmUdfPacketMatcherId(const std::string& udfPacketMatcherName) const; + const std::map> getUdfGroupsMap() const { return udfGroupsMap_; diff --git a/fboss/agent/hw/bcm/tests/BcmUdfTests.cpp b/fboss/agent/hw/bcm/tests/BcmUdfTests.cpp index 3caf9f14d7112..d05116504f28d 100644 --- a/fboss/agent/hw/bcm/tests/BcmUdfTests.cpp +++ b/fboss/agent/hw/bcm/tests/BcmUdfTests.cpp @@ -14,6 +14,7 @@ #include "fboss/agent/hw/bcm/tests/BcmTest.h" #include "fboss/agent/hw/bcm/tests/BcmTestUtils.h" #include "fboss/agent/hw/test/LoadBalancerUtils.h" +#include "fboss/agent/packet/IPProto.h" #include @@ -55,4 +56,26 @@ TEST_F(BcmUdfTest, checkUdfGroupConfiguration) { verifyAcrossWarmBoots(setupUdfConfig, verifyUdfConfig); }; + +TEST_F(BcmUdfTest, checkUdfPktMatcherConfiguration) { + auto setupUdfConfig = [=]() { applyNewState(setupUdfConfiguration(true)); }; + auto verifyUdfConfig = [=]() { + const int udfPacketMatcherId = + getHwSwitch()->getUdfMgr()->getBcmUdfPacketMatcherId( + utility::kUdfPktMatcherName); + /* get udf pkt info */ + bcm_udf_pkt_format_info_t pktFormat; + bcm_udf_pkt_format_info_t_init(&pktFormat); + auto rv = bcm_udf_pkt_format_info_get( + getHwSwitch()->getUnit(), udfPacketMatcherId, &pktFormat); + bcmCheckError( + rv, + "Unable to get pkt_format for udfPacketMatcherId: ", + udfPacketMatcherId); + ASSERT_EQ(pktFormat.ip_protocol, static_cast(IP_PROTO::IP_PROTO_UDP)); + ASSERT_EQ(pktFormat.l4_dst_port, utility::kUdfL4DstPort); + }; + + verifyAcrossWarmBoots(setupUdfConfig, verifyUdfConfig); +}; } // namespace facebook::fboss From fb40e878c24a5314a6df2ef69f8305aabaf061d8 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 1 Feb 2023 00:06:01 -0800 Subject: [PATCH 022/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/562d4b958dc83c26c51808e867ce7cdcb6d05d36 Reviewed By: jailby fbshipit-source-id: 6b76a8301506a76a3a23a207253312656104b2f5 --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index aa87e466c1c95..89eb5994a48e0 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit e8c0e1300cb86b23b0c9b129ea3b5904a36a8b75 +Subproject commit 562d4b958dc83c26c51808e867ce7cdcb6d05d36 From 383080ed310deb16c77cbfc25c442b06616ce955 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 1 Feb 2023 00:51:38 -0800 Subject: [PATCH 023/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/12e9667089fcfe43f188021ff3cd81674bf3ade6 https://github.com/facebook/proxygen/commit/ba3217ad22f39dd7fe1758e01dfb47e967068d1d https://github.com/facebookincubator/velox/commit/8fd31edc70bc6eb465c755e6dfd8b97b16dd98af Reviewed By: jailby fbshipit-source-id: 39b8889207775dd03652ea9502b19e4085c833c5 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 363b4ad834260..4ae5e57fc88d5 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit e3815f69539dd18820966b5ac9f8e9b91c898c82 +Subproject commit 12e9667089fcfe43f188021ff3cd81674bf3ade6 From 6abc1c9f3e6970dcc90c2bcce37a4a43806e84fa Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Wed, 1 Feb 2023 02:05:14 -0800 Subject: [PATCH 024/280] Fix typo in test name s/Reacability/Reachability Summary: As titled. Annoying to factor in the typo when running test by hand Differential Revision: D42894150 Privacy Context Container: L1125642 fbshipit-source-id: c891f08357fb445716f238da6c727894e675a97e --- fboss/agent/hw/test/HwFabricSwitchTests.cpp | 2 +- fboss/agent/hw/test/HwVoqSwitchTests.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fboss/agent/hw/test/HwFabricSwitchTests.cpp b/fboss/agent/hw/test/HwFabricSwitchTests.cpp index 06b63cf33734d..aa711b28e798b 100644 --- a/fboss/agent/hw/test/HwFabricSwitchTests.cpp +++ b/fboss/agent/hw/test/HwFabricSwitchTests.cpp @@ -50,7 +50,7 @@ TEST_F(HwFabricSwitchTest, collectStats) { verifyAcrossWarmBoots([] {}, verify); } -TEST_F(HwFabricSwitchTest, checkFabricReacability) { +TEST_F(HwFabricSwitchTest, checkFabricReachability) { verifyAcrossWarmBoots( [] {}, [this]() { checkFabricReachability(getHwSwitch()); }); } diff --git a/fboss/agent/hw/test/HwVoqSwitchTests.cpp b/fboss/agent/hw/test/HwVoqSwitchTests.cpp index cfcc0c5c7b485..f8e9450b51a42 100644 --- a/fboss/agent/hw/test/HwVoqSwitchTests.cpp +++ b/fboss/agent/hw/test/HwVoqSwitchTests.cpp @@ -593,7 +593,7 @@ TEST_F(HwVoqSwitchTest, AclCounter) { verifyAcrossWarmBoots(setup, verify); } -TEST_F(HwVoqSwitchTest, checkFabricReacability) { +TEST_F(HwVoqSwitchTest, checkFabricReachability) { verifyAcrossWarmBoots( [] {}, [this]() { checkFabricReachability(getHwSwitch()); }); } From 72b572d50c6549b6f14d838376ad385a7cce2216 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Wed, 1 Feb 2023 02:05:14 -0800 Subject: [PATCH 025/280] Get loopback tests working on voq switches and greenlight test runs Summary: As titled Reviewed By: nivinl Differential Revision: D42902002 fbshipit-source-id: d7b8688289c44617c55596a18f4aab96b9ce8017 --- .../hw/test/dataplane_tests/HwLoopBackTests.cpp | 12 +++++++----- installer/centos-7-x86_64/run_scripts/run_test.py | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwLoopBackTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwLoopBackTests.cpp index 2235b077886e8..5cad89b209dfe 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwLoopBackTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwLoopBackTests.cpp @@ -26,9 +26,9 @@ namespace facebook::fboss { class HwLoopBackTest : public HwLinkStateDependentTest { private: cfg::SwitchConfig initialConfig() const override { - return utility::oneL3IntfConfig( + return utility::onePortPerInterfaceConfig( getHwSwitch(), - masterLogicalPortIds()[0], + masterLogicalPortIds(), getAsic()->desiredLoopbackMode()); } @@ -53,7 +53,7 @@ class HwLoopBackTest : public HwLinkStateDependentTest { if (frontPanel) { getHwSwitchEnsemble()->ensureSendPacketOutOfPort( - std::move(txPacket), masterLogicalPortIds()[0]); + std::move(txPacket), masterLogicalInterfacePortIds()[0]); } else { getHwSwitchEnsemble()->ensureSendPacketSwitched(std::move(txPacket)); } @@ -70,9 +70,11 @@ class HwLoopBackTest : public HwLinkStateDependentTest { resolveNeigborAndProgramRoutes(ecmpHelper6, kEcmpWidthForTest); }; auto verify = [=]() { - auto beforePortStats = getLatestPortStats(masterLogicalPortIds()[0]); + auto beforePortStats = + getLatestPortStats(masterLogicalInterfacePortIds()[0]); sendPkt(frontPanel, pktTtl); - auto afterPortStats = getLatestPortStats(masterLogicalPortIds()[0]); + auto afterPortStats = + getLatestPortStats(masterLogicalInterfacePortIds()[0]); // For packets going out to front panel, they would not go through the // routing logic the very first time (but directly looped back). // Therefore, the counter would plus one compared to the cpu port. diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 1de76312efa01..d172eae324d31 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -40,8 +40,10 @@ # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwVoqSwitchWithFabriPortsTest.* # Basic forwarding tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwJumboFramesTest.* +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoopBackTest.* # -# LB Tests +# Load Balancer Tests +# UCMP support lacking DNX # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV4.*:-*Ucmp*:-*Shrink* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV6.*:-*Ucmp*:-*Shrink* # Route programming tests From a7db282c3f37c502a708d37031dd60cec08cb86e Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Wed, 1 Feb 2023 02:05:14 -0800 Subject: [PATCH 026/280] Get HwL4PortBlackHolingTest working on voq + greenlight these tests Summary: As titled Reviewed By: nivinl Differential Revision: D42913596 fbshipit-source-id: 373858e8c111184aaeabce6104eb90395506991a --- .../HwL4PortBlackholingTests.cpp | 20 ++++++++++--------- .../centos-7-x86_64/run_scripts/run_test.py | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwL4PortBlackholingTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwL4PortBlackholingTests.cpp index ec5bb377e26c3..13c70da51953e 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwL4PortBlackholingTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwL4PortBlackholingTests.cpp @@ -32,17 +32,17 @@ class HwL4PortBlackHolingTest : public HwLinkStateDependentTest { return pow(2, 16) - 1; } cfg::SwitchConfig initialConfig() const override { - auto cfg = utility::oneL3IntfConfig( + auto cfg = utility::onePortPerInterfaceConfig( getHwSwitch(), - masterLogicalPortIds()[0], + masterLogicalPortIds(), getAsic()->desiredLoopbackMode()); return cfg; } void pumpTraffic(bool isV6) { - auto srcIp = IPAddress(isV6 ? "1001::1" : "100.0.0.1"); - auto dstIp = IPAddress(isV6 ? "2001::1" : "200.0.0.1"); - auto vlanId = VlanID(*initialConfig().vlanPorts()[0].vlanID()); - auto mac = utility::getInterfaceMac(getProgrammedState(), vlanId); + auto srcIp = IPAddress(isV6 ? "1001::1" : "101.0.0.1"); + auto dstIp = IPAddress(isV6 ? "2001::1" : "201.0.0.1"); + auto vlanId = utility::firstVlanID(getProgrammedState()); + auto mac = utility::getFirstInterfaceMac(getProgrammedState()); enum class Dir { SRC_PORT, DST_PORT }; for (auto l4Port = 1; l4Port <= kNumL4Ports(); ++l4Port) { for (auto dir : {Dir::SRC_PORT, Dir::DST_PORT}) { @@ -71,9 +71,10 @@ class HwL4PortBlackHolingTest : public HwLinkStateDependentTest { utility::EcmpSetupAnyNPorts4(getProgrammedState(), kRid), 1); }; auto verify = [=]() { - auto originalPortStats = getLatestPortStats(masterLogicalPortIds()); + auto originalPortStats = + getLatestPortStats(masterLogicalInterfacePortIds()); int numL4Ports = kNumL4Ports(); - PortID portId = masterLogicalPortIds()[0]; + PortID portId = masterLogicalInterfacePortIds()[0]; auto expectPackets = [&originalPortStats, numL4Ports, portId]( const auto& newPortStats) -> bool { auto original = getPortOutPkts(originalPortStats.at(portId)); @@ -89,7 +90,8 @@ class HwL4PortBlackHolingTest : public HwLinkStateDependentTest { return current - original == 2 * numL4Ports; }; pumpTraffic(isV6); - EXPECT_TRUE(getHwSwitchEnsemble()->waitPortStatsCondition(expectPackets)); + EXPECT_TRUE(getHwSwitchEnsemble()->waitPortStatsCondition( + expectPackets, 10 /*retries*/, std::chrono::milliseconds(1000))); }; verifyAcrossWarmBoots(setup, verify); } diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index d172eae324d31..7c71c5e01f853 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -41,6 +41,7 @@ # Basic forwarding tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwJumboFramesTest.* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoopBackTest.* +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwL4PortBlackHolingTest.* # # Load Balancer Tests # UCMP support lacking DNX From 98b8d10ef7daf04906ca9d43c1eb1518d873c3dc Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Wed, 1 Feb 2023 08:26:33 -0800 Subject: [PATCH 027/280] Bump up run_test time out to account for slower runs on Makalu Summary: As titled + also fix log in HwL4PortBlackholingTests where we are counting pkts not bytes Reviewed By: nivinl Differential Revision: D42914074 fbshipit-source-id: c997ea62c23b04ebab3375d1141169f180690aae --- .../hw/test/dataplane_tests/HwL4PortBlackholingTests.cpp | 4 ++-- installer/centos-7-x86_64/run_scripts/run_test.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwL4PortBlackholingTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwL4PortBlackholingTests.cpp index 13c70da51953e..d4add6e5f901d 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwL4PortBlackholingTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwL4PortBlackholingTests.cpp @@ -81,8 +81,8 @@ class HwL4PortBlackHolingTest : public HwLinkStateDependentTest { auto current = getPortOutPkts(newPortStats.at(portId)); XLOGF( INFO, - "Checking current port outBytes ({}) - " - "original port outBytes: ({}) == " + "Checking current port outPkts ({}) - " + "original port outPkts: ({}) == " "2 * number of l4 ports ({})", current, original, diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 7c71c5e01f853..79cbc97a9c4f4 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -84,7 +84,7 @@ class TestRunner(abc.ABC): WARMBOOT_SETUP_OPTION = "--setup-for-warmboot" COLDBOOT_PREFIX = "cold_boot." WARMBOOT_PREFIX = "warm_boot." - TESTRUN_TIMEOUT = 600 + TESTRUN_TIMEOUT = 1200 _GTEST_RESULT_PATTERN = re.compile( r"""\[\s+(?P(OK)|(FAILED)|(SKIPPED)|(TIMEOUT))\s+\]\s+ From 7c8eaabe3c7cb520c3f45b7b50b8de489149acf6 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Wed, 1 Feb 2023 09:06:42 -0800 Subject: [PATCH 028/280] Pass right switchID while creating system ports during init Summary: In the current code, we end up passing OID from switch create. However, we need to set 'switchID' during system port creation. Fix it. Reviewed By: jasmeetbagga, nivinl Differential Revision: D42765928 Privacy Context Container: L1125642 fbshipit-source-id: 0188d9520981c136936dbebc8c8b2c94254c5921 --- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index 6e68cfaad177e..8b92d1f0c0230 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -1687,10 +1687,11 @@ std::shared_ptr SaiSwitch::getColdBootSwitchState() { // For VOQ switch, create system ports for existing egress ports if (switchType_ == cfg::SwitchType::VOQ) { + CHECK(getSwitchId().has_value()); state->resetSystemPorts( managerTable_->systemPortManager().constructSystemPorts( state->getPorts(), - switchId_, + getSwitchId().value(), platform_->getAsic()->getSystemPortRange())); } From fd3f7f7e50efd8660ad65c34c6d2739842c4bff4 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 1 Feb 2023 10:03:02 -0800 Subject: [PATCH 029/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/wangle/commit/400138bc9f3e30a69fe84923ec21b0f656ccb44e https://github.com/facebookexperimental/edencommon/commit/f33957eb485ded95021936af5ad4826fcef186a4 https://github.com/facebookincubator/fizz/commit/a7329f160f284ef3c132eddd4309d004a266eb6b https://github.com/facebookincubator/velox/commit/c8d618c18519e11d98cad3d6ce9ce1c4ceeec401 Reviewed By: jailby fbshipit-source-id: d6ec3b46017ee719c758901a96c792a4c177824e --- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index d70ba4569c3cc..3f8aa8d0d89d9 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 9db446294f9153c4cb8d667b4faaef9dc1e57caf +Subproject commit 400138bc9f3e30a69fe84923ec21b0f656ccb44e From 27407019c5af0a57c4579b0cdb418de60e1cff26 Mon Sep 17 00:00:00 2001 From: Bin Huang Date: Wed, 1 Feb 2023 13:01:43 -0800 Subject: [PATCH 030/280] Update thrift definition Summary: Update thrift definition, to be more specific for fbdevd platform configuration Reviewed By: somasun, tao-ren Differential Revision: D42786188 Privacy Context Container: L1125642 fbshipit-source-id: 41af056be187cabb0fe2ecc8d7f9cd51012e8e88 --- fboss/platform/fbdevd/FbdevdImpl.cpp | 2 +- fboss/platform/fbdevd/FbdevdImpl.h | 2 +- fboss/platform/fbdevd/if/fbdevd.thrift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fboss/platform/fbdevd/FbdevdImpl.cpp b/fboss/platform/fbdevd/FbdevdImpl.cpp index 5a550bf02b564..c637c92149fad 100644 --- a/fboss/platform/fbdevd/FbdevdImpl.cpp +++ b/fboss/platform/fbdevd/FbdevdImpl.cpp @@ -23,7 +23,7 @@ void FbdevdImpl::initPlatformConfig() { // Clear everything before filling the structure fbdevdConfig_ = {}; - apache::thrift::SimpleJSONSerializer::deserialize( + apache::thrift::SimpleJSONSerializer::deserialize( fbdevdConfJson, fbdevdConfig_); XLOG(DBG2) << apache::thrift::SimpleJSONSerializer::serialize( diff --git a/fboss/platform/fbdevd/FbdevdImpl.h b/fboss/platform/fbdevd/FbdevdImpl.h index fad5d9eeefb51..5ec1ccc2e5f52 100644 --- a/fboss/platform/fbdevd/FbdevdImpl.h +++ b/fboss/platform/fbdevd/FbdevdImpl.h @@ -21,7 +21,7 @@ class FbdevdImpl { // Fbdevd config file full path std::string confFileName_{}; - fbossPlatformDesc fbdevdConfig_; + FbdevdConfig fbdevdConfig_; void initPlatformConfig(); }; diff --git a/fboss/platform/fbdevd/if/fbdevd.thrift b/fboss/platform/fbdevd/if/fbdevd.thrift index deaefe48217be..29c66aac979c1 100644 --- a/fboss/platform/fbdevd/if/fbdevd.thrift +++ b/fboss/platform/fbdevd/if/fbdevd.thrift @@ -95,7 +95,7 @@ struct FruModule { } // Structure to describe a specific FBOSS switch. -struct fbossPlatformDesc { +struct FbdevdConfig { 1: string platformName; // List of kernel modules that need to be loaded. It's no-op if the From ef875fe127a9aa3f02ed1d7a3c1701498ed159b8 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Wed, 1 Feb 2023 13:42:59 -0800 Subject: [PATCH 031/280] pulling up route scale add and delete benchmarks at agent layer Summary: as titled. initiate the whole agent instead of just hw switch in these benchmarks Reviewed By: msomasundaran Differential Revision: D42814340 fbshipit-source-id: ca5427a203209ac8d66a77ea3ac0411af28101f0 --- cmake/AgentHwBcmBenchmarks.cmake | 20 +++++------ cmake/AgentHwBenchmarks.cmake | 24 ++++++++----- cmake/AgentHwSaiBenchmarks.cmake | 9 +++++ .../benchmarks/HwRouteScaleBenchmarkHelpers.h | 34 +++++++++++-------- fboss/agent/test/AgentEnsemble.cpp | 11 ++++++ fboss/agent/test/AgentEnsemble.h | 3 ++ 6 files changed, 69 insertions(+), 32 deletions(-) diff --git a/cmake/AgentHwBcmBenchmarks.cmake b/cmake/AgentHwBcmBenchmarks.cmake index 84e8df529c51b..69a15d9b8e6b9 100644 --- a/cmake/AgentHwBcmBenchmarks.cmake +++ b/cmake/AgentHwBcmBenchmarks.cmake @@ -50,7 +50,7 @@ target_link_libraries(bcm_fsw_scale_route_add_speed hw_fsw_scale_route_add_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -67,7 +67,7 @@ target_link_libraries(bcm_fsw_scale_route_del_speed hw_fsw_scale_route_del_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -84,7 +84,7 @@ target_link_libraries(bcm_th_alpm_scale_route_add_speed hw_th_alpm_scale_route_add_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -101,7 +101,7 @@ target_link_libraries(bcm_th_alpm_scale_route_del_speed hw_th_alpm_scale_route_del_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -118,7 +118,7 @@ target_link_libraries(bcm_hgrid_du_scale_route_add_speed hw_hgrid_du_scale_route_add_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -135,7 +135,7 @@ target_link_libraries(bcm_hgrid_du_scale_route_del_speed hw_hgrid_du_scale_route_del_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -152,7 +152,7 @@ target_link_libraries(bcm_hgrid_uu_scale_route_add_speed hw_hgrid_uu_scale_route_add_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -169,7 +169,7 @@ target_link_libraries(bcm_hgrid_uu_scale_route_del_speed hw_hgrid_uu_scale_route_del_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -186,7 +186,7 @@ target_link_libraries(bcm_anticipated_scale_route_add_speed hw_anticipated_scale_route_add_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -203,7 +203,7 @@ target_link_libraries(bcm_anticipated_scale_route_del_speed hw_anticipated_scale_route_del_speed route_scale_gen -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark diff --git a/cmake/AgentHwBenchmarks.cmake b/cmake/AgentHwBenchmarks.cmake index 394774031c181..c3caff27ff8f7 100644 --- a/cmake/AgentHwBenchmarks.cmake +++ b/cmake/AgentHwBenchmarks.cmake @@ -43,10 +43,11 @@ add_library(hw_fsw_scale_route_add_speed ) target_link_libraries(hw_fsw_scale_route_add_speed + agent_ensemble + agent_benchmarks config_factory hw_packet_utils ecmp_helper - hw_benchmark_main function_call_time_reporter Folly::folly ) @@ -56,10 +57,11 @@ add_library(hw_fsw_scale_route_del_speed ) target_link_libraries(hw_fsw_scale_route_del_speed + agent_ensemble + agent_benchmarks config_factory hw_packet_utils ecmp_helper - hw_benchmark_main function_call_time_reporter Folly::folly ) @@ -69,10 +71,11 @@ add_library(hw_th_alpm_scale_route_add_speed ) target_link_libraries(hw_th_alpm_scale_route_add_speed + agent_ensemble + agent_benchmarks config_factory hw_packet_utils ecmp_helper - hw_benchmark_main function_call_time_reporter Folly::folly ) @@ -82,10 +85,11 @@ add_library(hw_th_alpm_scale_route_del_speed ) target_link_libraries(hw_th_alpm_scale_route_del_speed + agent_ensemble + agent_benchmarks config_factory hw_packet_utils ecmp_helper - hw_benchmark_main function_call_time_reporter Folly::folly ) @@ -95,10 +99,11 @@ add_library(hw_hgrid_du_scale_route_add_speed ) target_link_libraries(hw_hgrid_du_scale_route_add_speed + agent_ensemble + agent_benchmarks config_factory hw_packet_utils ecmp_helper - hw_benchmark_main function_call_time_reporter Folly::folly ) @@ -108,10 +113,11 @@ add_library(hw_hgrid_du_scale_route_del_speed ) target_link_libraries(hw_hgrid_du_scale_route_del_speed + agent_ensemble + agent_benchmarks config_factory hw_packet_utils ecmp_helper - hw_benchmark_main function_call_time_reporter Folly::folly ) @@ -121,10 +127,11 @@ add_library(hw_hgrid_uu_scale_route_add_speed ) target_link_libraries(hw_hgrid_uu_scale_route_add_speed + agent_ensemble + agent_benchmarks config_factory hw_packet_utils ecmp_helper - hw_benchmark_main function_call_time_reporter Folly::folly ) @@ -134,10 +141,11 @@ add_library(hw_hgrid_uu_scale_route_del_speed ) target_link_libraries(hw_hgrid_uu_scale_route_del_speed + agent_ensemble + agent_benchmarks config_factory hw_packet_utils ecmp_helper - hw_benchmark_main function_call_time_reporter Folly::folly ) diff --git a/cmake/AgentHwSaiBenchmarks.cmake b/cmake/AgentHwSaiBenchmarks.cmake index a56b6ce8444c3..247f9cee1201c 100644 --- a/cmake/AgentHwSaiBenchmarks.cmake +++ b/cmake/AgentHwSaiBenchmarks.cmake @@ -15,6 +15,7 @@ function(BUILD_SAI_BENCHMARKS SAI_IMPL_NAME SAI_IMPL_ARG) target_link_libraries(sai_fsw_scale_route_add_speed-${SAI_IMPL_NAME}-${SAI_VER_SUFFIX} -Wl,--whole-archive sai_switch_ensemble + sai_agent_benchmarks_main hw_fsw_scale_route_add_speed route_scale_gen ${SAI_IMPL_ARG} @@ -33,6 +34,7 @@ function(BUILD_SAI_BENCHMARKS SAI_IMPL_NAME SAI_IMPL_ARG) target_link_libraries(sai_fsw_scale_route_del_speed-${SAI_IMPL_NAME}-${SAI_VER_SUFFIX} -Wl,--whole-archive sai_switch_ensemble + sai_agent_benchmarks_main hw_fsw_scale_route_del_speed route_scale_gen ${SAI_IMPL_ARG} @@ -51,6 +53,7 @@ function(BUILD_SAI_BENCHMARKS SAI_IMPL_NAME SAI_IMPL_ARG) target_link_libraries(sai_th_alpm_scale_route_add_speed-${SAI_IMPL_NAME}-${SAI_VER_SUFFIX} -Wl,--whole-archive sai_switch_ensemble + sai_agent_benchmarks_main hw_th_alpm_scale_route_add_speed route_scale_gen ${SAI_IMPL_ARG} @@ -69,6 +72,7 @@ function(BUILD_SAI_BENCHMARKS SAI_IMPL_NAME SAI_IMPL_ARG) target_link_libraries(sai_th_alpm_scale_route_del_speed-${SAI_IMPL_NAME}-${SAI_VER_SUFFIX} -Wl,--whole-archive sai_switch_ensemble + sai_agent_benchmarks_main hw_th_alpm_scale_route_del_speed route_scale_gen ${SAI_IMPL_ARG} @@ -105,6 +109,7 @@ function(BUILD_SAI_BENCHMARKS SAI_IMPL_NAME SAI_IMPL_ARG) target_link_libraries(sai_hgrid_du_scale_route_del_speed-${SAI_IMPL_NAME}-${SAI_VER_SUFFIX} -Wl,--whole-archive sai_switch_ensemble + sai_agent_benchmarks_main hw_hgrid_du_scale_route_del_speed route_scale_gen ${SAI_IMPL_ARG} @@ -123,6 +128,7 @@ function(BUILD_SAI_BENCHMARKS SAI_IMPL_NAME SAI_IMPL_ARG) target_link_libraries(sai_hgrid_uu_scale_route_add_speed-${SAI_IMPL_NAME}-${SAI_VER_SUFFIX} -Wl,--whole-archive sai_switch_ensemble + sai_agent_benchmarks_main hw_hgrid_uu_scale_route_add_speed route_scale_gen ${SAI_IMPL_ARG} @@ -141,6 +147,7 @@ function(BUILD_SAI_BENCHMARKS SAI_IMPL_NAME SAI_IMPL_ARG) target_link_libraries(sai_hgrid_uu_scale_route_del_speed-${SAI_IMPL_NAME}-${SAI_VER_SUFFIX} -Wl,--whole-archive sai_switch_ensemble + sai_agent_benchmarks_main hw_hgrid_uu_scale_route_del_speed route_scale_gen ${SAI_IMPL_ARG} @@ -159,6 +166,7 @@ function(BUILD_SAI_BENCHMARKS SAI_IMPL_NAME SAI_IMPL_ARG) target_link_libraries(sai_anticipated_scale_route_add_speed-${SAI_IMPL_NAME}-${SAI_VER_SUFFIX} -Wl,--whole-archive sai_switch_ensemble + sai_agent_benchmarks_main hw_anticipated_scale_route_add_speed route_scale_gen ${SAI_IMPL_ARG} @@ -177,6 +185,7 @@ function(BUILD_SAI_BENCHMARKS SAI_IMPL_NAME SAI_IMPL_ARG) target_link_libraries(sai_anticipated_scale_route_del_speed-${SAI_IMPL_NAME}-${SAI_VER_SUFFIX} -Wl,--whole-archive sai_switch_ensemble + sai_agent_benchmarks_main hw_anticipated_scale_route_del_speed route_scale_gen ${SAI_IMPL_ARG} diff --git a/fboss/agent/hw/benchmarks/HwRouteScaleBenchmarkHelpers.h b/fboss/agent/hw/benchmarks/HwRouteScaleBenchmarkHelpers.h index 740fbb7f72441..746335736f0eb 100644 --- a/fboss/agent/hw/benchmarks/HwRouteScaleBenchmarkHelpers.h +++ b/fboss/agent/hw/benchmarks/HwRouteScaleBenchmarkHelpers.h @@ -22,6 +22,9 @@ #include "fboss/agent/test/ResourceLibUtil.h" #include "fboss/lib/FunctionCallTimeReporter.h" +#include "fboss/agent/benchmarks/AgentBenchmarks.h" +#include "fboss/agent/test/AgentEnsemble.h" + DECLARE_bool(json); namespace facebook::fboss { @@ -35,24 +38,27 @@ namespace facebook::fboss { template void routeAddDelBenchmarker(bool measureAdd) { folly::BenchmarkSuspender suspender; - auto ensemble = createHwEnsemble(HwSwitchEnsemble::getAllFeatures()); - auto config = utility::onePortPerInterfaceConfig( - ensemble->getHwSwitch(), ensemble->masterLogicalPortIds()); - ensemble->applyInitialConfig(config); - auto routeGenerator = RouteScaleGeneratorT(ensemble->getProgrammedState()); + AgentEnsembleConfigFn initialConfigFn = [](HwSwitch* hwSwitch, + const std::vector& ports) { + return utility::onePortPerInterfaceConfig(hwSwitch, ports); + }; + auto ensemble = createAgentEnsemble(initialConfigFn); + ensemble->startAgent(); + auto* sw = ensemble->getSw(); + + auto routeGenerator = RouteScaleGeneratorT(sw->getState()); if (!routeGenerator.isSupported(ensemble->getPlatform()->getMode())) { // skip if this is not supported for a platform return; } - ensemble->applyNewState( - routeGenerator.resolveNextHops(ensemble->getProgrammedState())); + ensemble->applyNewState(routeGenerator.resolveNextHops(sw->getState())); const RouterID kRid(0); auto routeChunks = routeGenerator.getThriftRoutes(); auto allThriftRoutes = routeGenerator.allThriftRoutes(); // Get routes with one smaller ecmp width to capture a peering // flap and following route updates auto allThriftRoutesNarrowerEcmp = RouteScaleGeneratorT( - ensemble->getProgrammedState(), + sw->getState(), allThriftRoutes.size(), routeGenerator.ecmpWidth() - 1) .allThriftRoutes(); @@ -60,7 +66,7 @@ void routeAddDelBenchmarker(bool measureAdd) { std::atomic done{false}; auto doLookups = [&ensemble, kRid, &done]() { - auto programmedState = ensemble->getProgrammedState(); + auto programmedState = ensemble->getSw()->getState(); std::vector addrsToLookup; utility::IPAddressGenerator ipAddrGen; for (auto i = 0; i < 1000; ++i) { @@ -87,7 +93,7 @@ void routeAddDelBenchmarker(bool measureAdd) { &recordMaxLookupTime](const auto& addr) { StopWatch lookupTimer(std::nullopt, FLAGS_json); findLongestMatchRoute( - ensemble->getRib(), kRid, addr, programmedState); + ensemble->getSw()->getRib(), kRid, addr, programmedState); recordMaxLookupTime(lookupTimer, worstCaseLookupMsecs); }); recordMaxLookupTime(bulkLookupTimer, worstCaseBulkLookupMsecs); @@ -109,7 +115,7 @@ void routeAddDelBenchmarker(bool measureAdd) { }; // Start parallel lookup thread std::thread lookupThread([&doLookups]() { doLookups(); }); - auto updater = ensemble->getRouteUpdater(); + auto updater = ensemble->getSw()->getRouteUpdater(); if (measureAdd) { { // Route add benchmark @@ -119,7 +125,7 @@ void routeAddDelBenchmarker(bool measureAdd) { suspender.dismiss(); // Program 1 chunk to seed ~4k routes // program remaining chunks - updater.programRoutes(RouterID(0), ClientID::BGPD, routeChunks); + ensemble->programRoutes(RouterID(0), ClientID::BGPD, routeChunks); // We are about to blow away all routes, before that // deactivate benchmark measurement. suspender.rehire(); @@ -148,12 +154,12 @@ void routeAddDelBenchmarker(bool measureAdd) { // Sync fib with all routes syncFib(allThriftRoutes); } else { - updater.programRoutes(kRid, ClientID::BGPD, routeChunks); + ensemble->programRoutes(kRid, ClientID::BGPD, routeChunks); ScopedCallTimer timeIt; // We are about to blow away all routes, before that // activate benchmark measurement. suspender.dismiss(); - updater.unprogramRoutes(kRid, ClientID::BGPD, routeChunks); + ensemble->unprogramRoutes(kRid, ClientID::BGPD, routeChunks); suspender.rehire(); } done = true; diff --git a/fboss/agent/test/AgentEnsemble.cpp b/fboss/agent/test/AgentEnsemble.cpp index fc70220671fdf..cb66a5a6d4802 100644 --- a/fboss/agent/test/AgentEnsemble.cpp +++ b/fboss/agent/test/AgentEnsemble.cpp @@ -138,4 +138,15 @@ void AgentEnsemble::gracefulExit() { initializer->stopAgent(true); } +std::shared_ptr AgentEnsemble::applyNewState( + const std::shared_ptr& state) { + if (!state) { + return getSw()->getState(); + } + getSw()->updateStateBlocking( + "apply new state", + [state](const std::shared_ptr&) { return state; }); + return getSw()->getState(); +} + } // namespace facebook::fboss diff --git a/fboss/agent/test/AgentEnsemble.h b/fboss/agent/test/AgentEnsemble.h index 3d5e4573dc108..5be14f9097d3b 100644 --- a/fboss/agent/test/AgentEnsemble.h +++ b/fboss/agent/test/AgentEnsemble.h @@ -53,6 +53,9 @@ class AgentEnsemble { return getSw()->getHw(); } + std::shared_ptr applyNewState( + const std::shared_ptr& state); + const std::vector& masterLogicalPortIds() const; void programRoutes( From 74bff83fbc8d7e25300354f86d59f4250a196e64 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 1 Feb 2023 14:26:20 -0800 Subject: [PATCH 032/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/159a26c2a24184c18b47c7f7854fa958ad6202bb https://github.com/facebook/litho/commit/3a474dc486890d5cd4fd12eb69e36f849eb35787 https://github.com/facebookincubator/velox/commit/884aa73b2e9943ab94acf20605557fb82c4182c8 Reviewed By: jailby fbshipit-source-id: c5463e200328324c34b0267958cbc603957de380 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 4ae5e57fc88d5..2b97816b7e0ea 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 12e9667089fcfe43f188021ff3cd81674bf3ade6 +Subproject commit 159a26c2a24184c18b47c7f7854fa958ad6202bb From 73f21e4341052760362d1662b1593e563b0ec78d Mon Sep 17 00:00:00 2001 From: Wei Dai Date: Wed, 1 Feb 2023 14:48:40 -0800 Subject: [PATCH 033/280] add 800G port profile for tomahawk5 Summary: Similar to D42908303, add 800G port profile for tomahawk5 Reviewed By: zechengh09 Differential Revision: D42929677 fbshipit-source-id: 51409b7ecf639d5eafa896c62fc09a6ca3153d6c --- fboss/agent/Platform.cpp | 2 ++ fboss/agent/hw/bcm/BcmPlatform.cpp | 1 + fboss/agent/hw/sai/switch/SaiPortUtils.cpp | 2 ++ fboss/agent/hw/sai/switch/tests/ManagerTestBase.cpp | 4 ++++ fboss/agent/hw/switch_asics/Tomahawk5Asic.h | 2 +- fboss/agent/hw/test/HwPortUtils.cpp | 6 ++++++ fboss/agent/switch_config.thrift | 3 +++ fboss/agent/test/ThriftTest.cpp | 3 +++ 8 files changed, 22 insertions(+), 1 deletion(-) diff --git a/fboss/agent/Platform.cpp b/fboss/agent/Platform.cpp index 0247608680ce4..8d5998eefd4cb 100644 --- a/fboss/agent/Platform.cpp +++ b/fboss/agent/Platform.cpp @@ -249,11 +249,13 @@ int Platform::getLaneCount(cfg::PortProfileID profile) const { case cfg::PortProfileID::PROFILE_100G_4_NRZ_CL91_OPTICAL: case cfg::PortProfileID::PROFILE_100G_4_NRZ_NOFEC_COPPER: case cfg::PortProfileID::PROFILE_100G_4_NRZ_CL91_COPPER_RACK_YV3_T1: + case cfg::PortProfileID::PROFILE_400G_4_PAM4_RS544X2N_OPTICAL: return 4; case cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N: case cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N_OPTICAL: case cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N_COPPER: + case cfg::PortProfileID::PROFILE_800G_8_PAM4_RS544X2N_OPTICAL: return 8; case cfg::PortProfileID::PROFILE_DEFAULT: diff --git a/fboss/agent/hw/bcm/BcmPlatform.cpp b/fboss/agent/hw/bcm/BcmPlatform.cpp index 60c8b88436c8f..53792e795ee2d 100644 --- a/fboss/agent/hw/bcm/BcmPlatform.cpp +++ b/fboss/agent/hw/bcm/BcmPlatform.cpp @@ -112,6 +112,7 @@ phy::VCOFrequency BcmPlatform::getVCOFrequency( return phy::VCOFrequency::VCO_20_625GHZ; case cfg::PortSpeed::GIGE: FOLLY_FALLTHROUGH; + case cfg::PortSpeed::EIGHTHUNDREDG: case cfg::PortSpeed::DEFAULT: return phy::VCOFrequency::UNKNOWN; } diff --git a/fboss/agent/hw/sai/switch/SaiPortUtils.cpp b/fboss/agent/hw/sai/switch/SaiPortUtils.cpp index e93e1167089ba..5a214fb1aac07 100644 --- a/fboss/agent/hw/sai/switch/SaiPortUtils.cpp +++ b/fboss/agent/hw/sai/switch/SaiPortUtils.cpp @@ -163,6 +163,8 @@ phy::FecMode getFecModeFromSaiFecMode( case cfg::PortProfileID::PROFILE_200G_4_PAM4_RS544X2N_OPTICAL: case cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N_OPTICAL: case cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N_COPPER: + case cfg::PortProfileID::PROFILE_400G_4_PAM4_RS544X2N_OPTICAL: + case cfg::PortProfileID::PROFILE_800G_8_PAM4_RS544X2N_OPTICAL: mode = phy::FecMode::RS544_2N; break; case cfg::PortProfileID::PROFILE_53POINT125G_1_PAM4_RS545_COPPER: diff --git a/fboss/agent/hw/sai/switch/tests/ManagerTestBase.cpp b/fboss/agent/hw/sai/switch/tests/ManagerTestBase.cpp index 5c36fa2464637..7538852f73eb5 100644 --- a/fboss/agent/hw/sai/switch/tests/ManagerTestBase.cpp +++ b/fboss/agent/hw/sai/switch/tests/ManagerTestBase.cpp @@ -222,6 +222,10 @@ std::shared_ptr ManagerTestBase::makePort( swPort->setProfileId( cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N_OPTICAL); break; + case cfg::PortSpeed::EIGHTHUNDREDG: + swPort->setProfileId( + cfg::PortProfileID::PROFILE_800G_8_PAM4_RS544X2N_OPTICAL); + break; } auto platformPort = saiPlatform->getPort(swPort->getID()); PlatformPortProfileConfigMatcher matcher{ diff --git a/fboss/agent/hw/switch_asics/Tomahawk5Asic.h b/fboss/agent/hw/switch_asics/Tomahawk5Asic.h index 2a341d9752235..cdb3dd587cf09 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk5Asic.h +++ b/fboss/agent/hw/switch_asics/Tomahawk5Asic.h @@ -24,7 +24,7 @@ class Tomahawk5Asic : public BroadcomXgsAsic { return asicMode; } cfg::PortSpeed getMaxPortSpeed() const override { - return cfg::PortSpeed::FOURHUNDREDG; + return cfg::PortSpeed::EIGHTHUNDREDG; } int getDefaultNumPortQueues(cfg::StreamType streamType, bool cpu) const override; diff --git a/fboss/agent/hw/test/HwPortUtils.cpp b/fboss/agent/hw/test/HwPortUtils.cpp index 03f9f51c2f624..e0c88d3a8dc65 100644 --- a/fboss/agent/hw/test/HwPortUtils.cpp +++ b/fboss/agent/hw/test/HwPortUtils.cpp @@ -137,8 +137,12 @@ cfg::PortSpeed getSpeed(cfg::PortProfileID profile) { case cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N: case cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N_OPTICAL: case cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N_COPPER: + case cfg::PortProfileID::PROFILE_400G_4_PAM4_RS544X2N_OPTICAL: return cfg::PortSpeed::FOURHUNDREDG; + case cfg::PortProfileID::PROFILE_800G_8_PAM4_RS544X2N_OPTICAL: + return cfg::PortSpeed::EIGHTHUNDREDG; + case cfg::PortProfileID::PROFILE_DEFAULT: break; } @@ -175,6 +179,8 @@ TransmitterTechnology getMediaType(cfg::PortProfileID profile) { case cfg::PortProfileID::PROFILE_100G_4_NRZ_CL91_OPTICAL: case cfg::PortProfileID::PROFILE_200G_4_PAM4_RS544X2N_OPTICAL: case cfg::PortProfileID::PROFILE_400G_8_PAM4_RS544X2N_OPTICAL: + case cfg::PortProfileID::PROFILE_400G_4_PAM4_RS544X2N_OPTICAL: + case cfg::PortProfileID::PROFILE_800G_8_PAM4_RS544X2N_OPTICAL: return TransmitterTechnology::OPTICAL; case cfg::PortProfileID::PROFILE_10G_1_NRZ_NOFEC: diff --git a/fboss/agent/switch_config.thrift b/fboss/agent/switch_config.thrift index 0a594339c16ad..0c772be8d79c8 100644 --- a/fboss/agent/switch_config.thrift +++ b/fboss/agent/switch_config.thrift @@ -101,6 +101,7 @@ enum PortSpeed { HUNDREDG = 100000, // 100G TWOHUNDREDG = 200000, // 200G FOURHUNDREDG = 400000, // 400G + EIGHTHUNDREDG = 800000, // 800G } // ___ @@ -146,6 +147,8 @@ enum PortProfileID { PROFILE_400G_8_PAM4_RS544X2N_COPPER = 35, PROFILE_53POINT125G_1_PAM4_RS545_COPPER = 36, PROFILE_53POINT125G_1_PAM4_RS545_OPTICAL = 37, + PROFILE_400G_4_PAM4_RS544X2N_OPTICAL = 38, + PROFILE_800G_8_PAM4_RS544X2N_OPTICAL = 39, } /** diff --git a/fboss/agent/test/ThriftTest.cpp b/fboss/agent/test/ThriftTest.cpp index 154be3b905550..3affcf5995d51 100644 --- a/fboss/agent/test/ThriftTest.cpp +++ b/fboss/agent/test/ThriftTest.cpp @@ -192,6 +192,9 @@ TEST(ThriftEnum, assertPortSpeeds) { case PortSpeed::FOURHUNDREDG: EXPECT_EQ(static_cast(key), 400000); break; + case PortSpeed::EIGHTHUNDREDG: + EXPECT_EQ(static_cast(key), 800000); + break; } } } From e1788662539d331c74515c5b7d0f823412ecaad8 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Wed, 1 Feb 2023 15:33:18 -0800 Subject: [PATCH 034/280] Break the cyclic dependency between agent:utils from agent/state:state Reviewed By: peygar Differential Revision: D42912362 Privacy Context Container: L1125642 fbshipit-source-id: ebfb400326932abf4d6714fea06ed71c37f37693 --- fboss/agent/EnumUtils.h | 34 +++++++++++++++++++ fboss/agent/Utils.h | 20 ----------- fboss/agent/platforms/sai/SaiPlatformInit.cpp | 1 + .../platforms/wedge/WedgePlatformInit.cpp | 1 + fboss/agent/state/AclEntry.h | 1 - fboss/agent/state/AclTable.h | 1 - fboss/agent/state/AclTableGroup.h | 1 - fboss/agent/state/AggregatePort.h | 1 - fboss/agent/state/AggregatePortMap.h | 1 - fboss/agent/state/BufferPoolConfig.h | 1 - fboss/agent/state/ControlPlane.h | 1 - fboss/agent/state/DsfNode.cpp | 3 ++ .../ForwardingInformationBaseContainer.h | 1 - fboss/agent/state/Interface.h | 1 - fboss/agent/state/IpTunnel.h | 1 - fboss/agent/state/LabelForwardingEntry.h | 1 - fboss/agent/state/LoadBalancer.h | 1 - fboss/agent/state/MacEntry.h | 1 - fboss/agent/state/Mirror.h | 1 - fboss/agent/state/NeighborEntry.h | 2 +- fboss/agent/state/NeighborResponseEntry.h | 2 +- fboss/agent/state/Port.h | 1 + fboss/agent/state/PortPgConfig.h | 1 - fboss/agent/state/QcmConfig.h | 1 - fboss/agent/state/Route.h | 1 - fboss/agent/state/RouteNextHopsMulti.cpp | 1 - fboss/agent/state/SflowCollector.h | 1 - fboss/agent/state/SwitchSettings.h | 3 +- fboss/agent/state/SystemPort.h | 1 - fboss/agent/state/TeFlowEntry.h | 1 - fboss/agent/state/Thrifty.h | 3 +- fboss/agent/state/Transceiver.h | 1 - fboss/agent/state/Vlan.h | 1 - fboss/agent/state/tests/PortPgConfigTests.cpp | 1 + fboss/agent/test/EcmpSetupHelper.h | 1 + 35 files changed, 48 insertions(+), 47 deletions(-) create mode 100644 fboss/agent/EnumUtils.h diff --git a/fboss/agent/EnumUtils.h b/fboss/agent/EnumUtils.h new file mode 100644 index 0000000000000..22a8d707ea909 --- /dev/null +++ b/fboss/agent/EnumUtils.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2004-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ +#pragma once + +#include +#include + +namespace facebook::fboss { +template +std::string enumToName(Enum enumInput) { + auto name = apache::thrift::util::enumName(enumInput); + if (name == nullptr) { + XLOG(FATAL) << "Unexpected enum: " << static_cast(enumInput); + } + return name; +} + +template +Enum nameToEnum(const std::string& valueAsString) { + Enum enumOutput; + if (!apache::thrift::TEnumTraits::findValue( + valueAsString, &enumOutput)) { + XLOG(FATAL) << "Invalid enum value as string: " << valueAsString; + } + return enumOutput; +} +} // namespace facebook::fboss diff --git a/fboss/agent/Utils.h b/fboss/agent/Utils.h index 29355198725f0..0944ce54313fd 100644 --- a/fboss/agent/Utils.h +++ b/fboss/agent/Utils.h @@ -14,7 +14,6 @@ #include #include -#include #include #include @@ -204,23 +203,4 @@ inline constexpr uint8_t kGetNetworkControlTrafficClass() { return 48 << 2; } -template -std::string enumToName(Enum enumInput) { - auto name = apache::thrift::util::enumName(enumInput); - if (name == nullptr) { - XLOG(FATAL) << "Unexpected enum: " << static_cast(enumInput); - } - return name; -} - -template -Enum nameToEnum(const std::string& valueAsString) { - Enum enumOutput; - if (!apache::thrift::TEnumTraits::findValue( - valueAsString, &enumOutput)) { - XLOG(FATAL) << "Invalid enum value as string: " << valueAsString; - } - return enumOutput; -} - } // namespace facebook::fboss diff --git a/fboss/agent/platforms/sai/SaiPlatformInit.cpp b/fboss/agent/platforms/sai/SaiPlatformInit.cpp index 640dd9077f9b7..4d8a66695ae4b 100644 --- a/fboss/agent/platforms/sai/SaiPlatformInit.cpp +++ b/fboss/agent/platforms/sai/SaiPlatformInit.cpp @@ -14,6 +14,7 @@ #include "fboss/agent/AgentConfig.h" #include "fboss/agent/Platform.h" +#include "fboss/agent/Utils.h" #include "fboss/agent/platforms/sai/SaiBcmDarwinPlatform.h" #include "fboss/agent/platforms/sai/SaiBcmElbertPlatform.h" #include "fboss/agent/platforms/sai/SaiBcmFujiPlatform.h" diff --git a/fboss/agent/platforms/wedge/WedgePlatformInit.cpp b/fboss/agent/platforms/wedge/WedgePlatformInit.cpp index 88d15643ce842..89cb7a4935559 100644 --- a/fboss/agent/platforms/wedge/WedgePlatformInit.cpp +++ b/fboss/agent/platforms/wedge/WedgePlatformInit.cpp @@ -13,6 +13,7 @@ #include "fboss/agent/AgentConfig.h" #include "fboss/agent/Platform.h" +#include "fboss/agent/Utils.h" #include "fboss/agent/platforms/wedge/WedgePlatform.h" #include "fboss/agent/platforms/wedge/galaxy/GalaxyFCPlatform.h" #include "fboss/agent/platforms/wedge/galaxy/GalaxyLCPlatform.h" diff --git a/fboss/agent/state/AclEntry.h b/fboss/agent/state/AclEntry.h index 7b419d6906532..a929ec44cf279 100644 --- a/fboss/agent/state/AclEntry.h +++ b/fboss/agent/state/AclEntry.h @@ -10,7 +10,6 @@ #pragma once #include "fboss/agent/FbossError.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/state/MatchAction.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/AclTable.h b/fboss/agent/state/AclTable.h index 86160a8ed4df1..77fb2d363b3cd 100644 --- a/fboss/agent/state/AclTable.h +++ b/fboss/agent/state/AclTable.h @@ -10,7 +10,6 @@ #pragma once #include "fboss/agent/FbossError.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/state/AclMap.h" #include "fboss/agent/state/NodeBase.h" #include "fboss/agent/types.h" diff --git a/fboss/agent/state/AclTableGroup.h b/fboss/agent/state/AclTableGroup.h index fb2ab15ada398..f5b68d587c708 100644 --- a/fboss/agent/state/AclTableGroup.h +++ b/fboss/agent/state/AclTableGroup.h @@ -10,7 +10,6 @@ #pragma once #include "fboss/agent/FbossError.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/state/AclMap.h" #include "fboss/agent/state/AclTableMap.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/AggregatePort.h b/fboss/agent/state/AggregatePort.h index 88a40365e5ed4..4a687175d42f4 100644 --- a/fboss/agent/state/AggregatePort.h +++ b/fboss/agent/state/AggregatePort.h @@ -11,7 +11,6 @@ #include "fboss/agent/FbossError.h" #include "fboss/agent/LacpTypes.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_constants.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" diff --git a/fboss/agent/state/AggregatePortMap.h b/fboss/agent/state/AggregatePortMap.h index c4dc744b6d8d2..b8756b5317b16 100644 --- a/fboss/agent/state/AggregatePortMap.h +++ b/fboss/agent/state/AggregatePortMap.h @@ -9,7 +9,6 @@ */ #pragma once -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeMap.h" #include "fboss/agent/state/Thrifty.h" diff --git a/fboss/agent/state/BufferPoolConfig.h b/fboss/agent/state/BufferPoolConfig.h index 3280fe345601a..3f3f23bbfde27 100644 --- a/fboss/agent/state/BufferPoolConfig.h +++ b/fboss/agent/state/BufferPoolConfig.h @@ -12,7 +12,6 @@ #include #include -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" #include "fboss/agent/state/Thrifty.h" diff --git a/fboss/agent/state/ControlPlane.h b/fboss/agent/state/ControlPlane.h index d54fa7921c290..5f55a67b573dc 100644 --- a/fboss/agent/state/ControlPlane.h +++ b/fboss/agent/state/ControlPlane.h @@ -9,7 +9,6 @@ */ #pragma once -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/DsfNode.cpp b/fboss/agent/state/DsfNode.cpp index c18d936d8b436..940c56ff6ace6 100644 --- a/fboss/agent/state/DsfNode.cpp +++ b/fboss/agent/state/DsfNode.cpp @@ -8,6 +8,9 @@ * */ #include "fboss/agent/state/DsfNode.h" + +#include + #include "fboss/agent/gen-cpp2/switch_config_fatal.h" #include "fboss/agent/gen-cpp2/switch_config_fatal_types.h" diff --git a/fboss/agent/state/ForwardingInformationBaseContainer.h b/fboss/agent/state/ForwardingInformationBaseContainer.h index 624f53b04c51c..7bbbd479efac2 100644 --- a/fboss/agent/state/ForwardingInformationBaseContainer.h +++ b/fboss/agent/state/ForwardingInformationBaseContainer.h @@ -9,7 +9,6 @@ */ #pragma once -#include "fboss/agent/Utils.h" #include "fboss/agent/state/ForwardingInformationBase.h" #include "fboss/agent/state/NodeBase.h" #include "fboss/agent/state/Thrifty.h" diff --git a/fboss/agent/state/Interface.h b/fboss/agent/state/Interface.h index 1af419f5a7b58..c622c4df7b0b4 100644 --- a/fboss/agent/state/Interface.h +++ b/fboss/agent/state/Interface.h @@ -15,7 +15,6 @@ #include #include "fboss/agent/AddressUtil.h" #include "fboss/agent/FbossError.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/IpTunnel.h b/fboss/agent/state/IpTunnel.h index 7f7d85f80cdc4..ec3758a460875 100644 --- a/fboss/agent/state/IpTunnel.h +++ b/fboss/agent/state/IpTunnel.h @@ -2,7 +2,6 @@ #pragma once -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" #include "fboss/agent/state/Thrifty.h" diff --git a/fboss/agent/state/LabelForwardingEntry.h b/fboss/agent/state/LabelForwardingEntry.h index 6dce5a868b77e..bd685af8bd7e0 100644 --- a/fboss/agent/state/LabelForwardingEntry.h +++ b/fboss/agent/state/LabelForwardingEntry.h @@ -2,7 +2,6 @@ #pragma once -#include "fboss/agent/Utils.h" #include "fboss/agent/if/gen-cpp2/ctrl_types.h" #include "fboss/agent/if/gen-cpp2/mpls_constants.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/LoadBalancer.h b/fboss/agent/state/LoadBalancer.h index 15c1994e2968f..22c35406b87a7 100644 --- a/fboss/agent/state/LoadBalancer.h +++ b/fboss/agent/state/LoadBalancer.h @@ -9,7 +9,6 @@ */ #pragma once -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/MacEntry.h b/fboss/agent/state/MacEntry.h index 7ddfda815f761..7fec5b6cfcb3d 100644 --- a/fboss/agent/state/MacEntry.h +++ b/fboss/agent/state/MacEntry.h @@ -10,7 +10,6 @@ #pragma once #include "fboss/agent/FbossError.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/Mirror.h b/fboss/agent/state/Mirror.h index 5ebe789832b96..00070fe2942fb 100644 --- a/fboss/agent/state/Mirror.h +++ b/fboss/agent/state/Mirror.h @@ -9,7 +9,6 @@ #include #include #include "fboss/agent/AddressUtil.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_constants.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/AclEntry.h" diff --git a/fboss/agent/state/NeighborEntry.h b/fboss/agent/state/NeighborEntry.h index e4536bd73c56d..6592c6a4c1499 100644 --- a/fboss/agent/state/NeighborEntry.h +++ b/fboss/agent/state/NeighborEntry.h @@ -11,7 +11,7 @@ #include #include -#include "fboss/agent/Utils.h" + #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/NeighborResponseEntry.h b/fboss/agent/state/NeighborResponseEntry.h index 3150de741049d..72b2e56468b32 100644 --- a/fboss/agent/state/NeighborResponseEntry.h +++ b/fboss/agent/state/NeighborResponseEntry.h @@ -11,7 +11,7 @@ #include #include -#include "fboss/agent/Utils.h" + #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" #include "fboss/agent/state/Thrifty.h" diff --git a/fboss/agent/state/Port.h b/fboss/agent/state/Port.h index adecae62b023f..7053dfa498dc7 100644 --- a/fboss/agent/state/Port.h +++ b/fboss/agent/state/Port.h @@ -9,6 +9,7 @@ */ #pragma once +#include "fboss/agent/EnumUtils.h" #include "fboss/agent/gen-cpp2/switch_config_constants.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" diff --git a/fboss/agent/state/PortPgConfig.h b/fboss/agent/state/PortPgConfig.h index 7573a1f54ab16..e20fc924b527d 100644 --- a/fboss/agent/state/PortPgConfig.h +++ b/fboss/agent/state/PortPgConfig.h @@ -10,7 +10,6 @@ #pragma once #include "fboss/agent/FbossError.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/BufferPoolConfig.h" diff --git a/fboss/agent/state/QcmConfig.h b/fboss/agent/state/QcmConfig.h index d79469bd83b10..7e54315de1e4b 100644 --- a/fboss/agent/state/QcmConfig.h +++ b/fboss/agent/state/QcmConfig.h @@ -11,7 +11,6 @@ #include #include -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_constants.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" diff --git a/fboss/agent/state/Route.h b/fboss/agent/state/Route.h index 742834fdbbcae..d1b6aaad80b48 100644 --- a/fboss/agent/state/Route.h +++ b/fboss/agent/state/Route.h @@ -12,7 +12,6 @@ #include -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/if/gen-cpp2/ctrl_types.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/RouteNextHopsMulti.cpp b/fboss/agent/state/RouteNextHopsMulti.cpp index 3819c923e3091..a72940fe10af1 100644 --- a/fboss/agent/state/RouteNextHopsMulti.cpp +++ b/fboss/agent/state/RouteNextHopsMulti.cpp @@ -10,7 +10,6 @@ #include "fboss/agent/state/RouteNextHopsMulti.h" #include "fboss/agent/AddressUtil.h" #include "fboss/agent/FbossError.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/RouteNextHopEntry.h" #include "fboss/agent/state/StateUtils.h" diff --git a/fboss/agent/state/SflowCollector.h b/fboss/agent/state/SflowCollector.h index 0931d5aa4b9f9..301b664c0d4f6 100644 --- a/fboss/agent/state/SflowCollector.h +++ b/fboss/agent/state/SflowCollector.h @@ -15,7 +15,6 @@ #include -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" #include "fboss/agent/state/Thrifty.h" diff --git a/fboss/agent/state/SwitchSettings.h b/fboss/agent/state/SwitchSettings.h index 70df42a1e7bcd..97adb47b8675d 100644 --- a/fboss/agent/state/SwitchSettings.h +++ b/fboss/agent/state/SwitchSettings.h @@ -9,7 +9,8 @@ */ #pragma once -#include "fboss/agent/Utils.h" +#include + #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/SystemPort.h b/fboss/agent/state/SystemPort.h index d5229c4ba48fe..35c76e7705f80 100644 --- a/fboss/agent/state/SystemPort.h +++ b/fboss/agent/state/SystemPort.h @@ -9,7 +9,6 @@ */ #pragma once -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" #include "fboss/agent/state/Thrifty.h" diff --git a/fboss/agent/state/TeFlowEntry.h b/fboss/agent/state/TeFlowEntry.h index 548e62bdd7f85..126b7513a91b2 100644 --- a/fboss/agent/state/TeFlowEntry.h +++ b/fboss/agent/state/TeFlowEntry.h @@ -2,7 +2,6 @@ #pragma once -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/if/gen-cpp2/ctrl_types.h" #include "fboss/agent/state/NodeBase.h" diff --git a/fboss/agent/state/Thrifty.h b/fboss/agent/state/Thrifty.h index cd4c3ddc6c618..0ca981fcef054 100644 --- a/fboss/agent/state/Thrifty.h +++ b/fboss/agent/state/Thrifty.h @@ -13,7 +13,6 @@ #include "fboss/agent/AddressUtil.h" #include "fboss/agent/Constants.h" #include "fboss/agent/FbossError.h" -#include "fboss/agent/Utils.h" #include "fboss/agent/state/NodeBase.h" #include "fboss/agent/state/NodeMap.h" @@ -26,6 +25,8 @@ namespace facebook::fboss { +class SwitchState; + using switch_state_tags = state::switch_state_tags::strings; using switch_config_tags = cfg::switch_config_tags::strings; using ctrl_if_tags = ctrl_tags::strings; diff --git a/fboss/agent/state/Transceiver.h b/fboss/agent/state/Transceiver.h index 12319ef1762c4..e2712ff13bbc7 100644 --- a/fboss/agent/state/Transceiver.h +++ b/fboss/agent/state/Transceiver.h @@ -9,7 +9,6 @@ */ #pragma once -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/NodeBase.h" #include "fboss/agent/state/Thrifty.h" diff --git a/fboss/agent/state/Vlan.h b/fboss/agent/state/Vlan.h index 8d27ff4b49a68..101e39bcf4d1e 100644 --- a/fboss/agent/state/Vlan.h +++ b/fboss/agent/state/Vlan.h @@ -12,7 +12,6 @@ #include #include #include -#include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" #include "fboss/agent/state/ArpResponseTable.h" #include "fboss/agent/state/ArpTable.h" diff --git a/fboss/agent/state/tests/PortPgConfigTests.cpp b/fboss/agent/state/tests/PortPgConfigTests.cpp index 0ea02eed0e526..35738f1b9a215 100644 --- a/fboss/agent/state/tests/PortPgConfigTests.cpp +++ b/fboss/agent/state/tests/PortPgConfigTests.cpp @@ -8,6 +8,7 @@ * */ #include "fboss/agent/ApplyThriftConfig.h" +#include "fboss/agent/EnumUtils.h" #include "fboss/agent/FbossError.h" #include "fboss/agent/hw/mock/MockPlatform.h" #include "fboss/agent/state/BufferPoolConfig.h" diff --git a/fboss/agent/test/EcmpSetupHelper.h b/fboss/agent/test/EcmpSetupHelper.h index a86f49b55cf65..ce74b78e070a6 100644 --- a/fboss/agent/test/EcmpSetupHelper.h +++ b/fboss/agent/test/EcmpSetupHelper.h @@ -25,6 +25,7 @@ #include "fboss/agent/types.h" namespace facebook::fboss { +class Interface; class SwitchState; class RouteUpdateWrapper; } // namespace facebook::fboss From 026e58fe535cae4a10589c0cbbbc437597c2c2a1 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Wed, 1 Feb 2023 15:33:18 -0800 Subject: [PATCH 035/280] Enable autodeps for fboss/agent/state:state Summary: This was an involved fix. A bunch of dependent files are updated to make the build work Reviewed By: peygar Differential Revision: D42912441 Privacy Context Container: L1125642 fbshipit-source-id: d9143e2f45323ed6d470b534e9f1592424cde254 --- fboss/agent/state/LabelForwardingInformationBase.cpp | 1 - fboss/agent/state/LoadBalancer.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/fboss/agent/state/LabelForwardingInformationBase.cpp b/fboss/agent/state/LabelForwardingInformationBase.cpp index 70292f08aae79..10595d5f8dd85 100644 --- a/fboss/agent/state/LabelForwardingInformationBase.cpp +++ b/fboss/agent/state/LabelForwardingInformationBase.cpp @@ -2,7 +2,6 @@ #include "fboss/agent/state/LabelForwardingInformationBase.h" #include -#include "fboss/agent/rib/RoutingInformationBase.h" #include "fboss/agent/state/NodeMap-defs.h" #include "fboss/agent/state/RouteNextHopEntry.h" #include "fboss/agent/state/SwitchState.h" diff --git a/fboss/agent/state/LoadBalancer.cpp b/fboss/agent/state/LoadBalancer.cpp index 3f58c62e8318e..23ac115282d01 100644 --- a/fboss/agent/state/LoadBalancer.cpp +++ b/fboss/agent/state/LoadBalancer.cpp @@ -9,7 +9,6 @@ */ #include "fboss/agent/state/LoadBalancer.h" #include "fboss/agent/FbossError.h" -#include "fboss/agent/Platform.h" #include "fboss/agent/state/NodeBase-defs.h" #include From 0e311d0edcb6d6190e67563511f73cb898650df6 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 1 Feb 2023 16:11:28 -0800 Subject: [PATCH 036/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/d75dff237dc45a4f19923754badd9b5b32281c73 Reviewed By: jailby fbshipit-source-id: 2491f2a02c4cd436597b654b3e81e7599d15a541 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 2b97816b7e0ea..5f8d99bc50cf2 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 159a26c2a24184c18b47c7f7854fa958ad6202bb +Subproject commit d75dff237dc45a4f19923754badd9b5b32281c73 From ff38dede8e852b28c1563835fd6eafbfe0c8e34f Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Wed, 1 Feb 2023 16:32:30 -0800 Subject: [PATCH 037/280] Break the cyclic dependency between DHCPv4Packet and DHCPv4Handler Reviewed By: jasmeetbagga Differential Revision: D42925940 fbshipit-source-id: c58d49ce382192ad694b37c34583c358b48bd9f7 --- fboss/agent/DHCPv4Handler.cpp | 2 ++ fboss/agent/DHCPv4Handler.h | 7 ------- fboss/agent/DHCPv4OptionsOfInterest.h | 22 ++++++++++++++++++++ fboss/agent/packet/DHCPv4Packet.cpp | 7 ++++--- fboss/agent/packet/test/DHCPv4PacketTest.cpp | 10 ++++----- 5 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 fboss/agent/DHCPv4OptionsOfInterest.h diff --git a/fboss/agent/DHCPv4Handler.cpp b/fboss/agent/DHCPv4Handler.cpp index 5b61bad5087bd..7cdc50cfc4cf6 100644 --- a/fboss/agent/DHCPv4Handler.cpp +++ b/fboss/agent/DHCPv4Handler.cpp @@ -14,6 +14,8 @@ #include #include #include + +#include "fboss/agent/DHCPv4OptionsOfInterest.h" #include "fboss/agent/FbossError.h" #include "fboss/agent/Platform.h" #include "fboss/agent/RxPacket.h" diff --git a/fboss/agent/DHCPv4Handler.h b/fboss/agent/DHCPv4Handler.h index 9de36d7a7d1c1..1ec3cd721c3f2 100644 --- a/fboss/agent/DHCPv4Handler.h +++ b/fboss/agent/DHCPv4Handler.h @@ -27,13 +27,6 @@ class IPv4Hdr; class DHCPv4Handler { public: enum BootpMsgType { BOOTREQUEST = 1, BOOTREPLY = 2 }; - enum OptionsOfInterest { - PAD = 0, - DHCP_MESSAGE_TYPE = 53, - DHCP_MAX_MESSAGE_SIZE = 57, - DHCP_AGENT_OPTIONS = 82, - END = 255 - }; enum SubOptionsOfInterest { AGENT_CIRCUIT_ID = 1 }; static constexpr uint16_t kBootPSPort = 67; static constexpr uint16_t kBootPCPort = 68; diff --git a/fboss/agent/DHCPv4OptionsOfInterest.h b/fboss/agent/DHCPv4OptionsOfInterest.h new file mode 100644 index 0000000000000..a9ad49e0ed60b --- /dev/null +++ b/fboss/agent/DHCPv4OptionsOfInterest.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2004-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ +#pragma once + +namespace facebook::fboss { + +enum DHCPv4OptionsOfInterest { + PAD = 0, + DHCP_MESSAGE_TYPE = 53, + DHCP_MAX_MESSAGE_SIZE = 57, + DHCP_AGENT_OPTIONS = 82, + END = 255 +}; + +} // namespace facebook::fboss diff --git a/fboss/agent/packet/DHCPv4Packet.cpp b/fboss/agent/packet/DHCPv4Packet.cpp index e957807d5d415..3aae1cee6d695 100644 --- a/fboss/agent/packet/DHCPv4Packet.cpp +++ b/fboss/agent/packet/DHCPv4Packet.cpp @@ -14,7 +14,7 @@ #include #include #include -#include "fboss/agent/DHCPv4Handler.h" +#include "fboss/agent/DHCPv4OptionsOfInterest.h" #include "fboss/agent/FbossError.h" using folly::IPAddressV4; @@ -29,7 +29,8 @@ class SwSwitch; const uint8_t DHCPv4Packet::kOptionsCookie[] = {99, 130, 83, 99}; bool DHCPv4Packet::isOptionWithoutLength(uint8_t op) { - return op == DHCPv4Handler::PAD || op == DHCPv4Handler::END; + return op == DHCPv4OptionsOfInterest::PAD || + op == DHCPv4OptionsOfInterest::END; } void DHCPv4Packet::parse(Cursor* cursor) { @@ -100,7 +101,7 @@ DHCPv4Packet::appendOption(uint8_t op, uint8_t len, const uint8_t* bytes) { } void DHCPv4Packet::appendPadding(size_t length) { - options.insert(options.end(), length, DHCPv4Handler::PAD); + options.insert(options.end(), length, DHCPv4OptionsOfInterest::PAD); } void DHCPv4Packet::padToMinLength() { diff --git a/fboss/agent/packet/test/DHCPv4PacketTest.cpp b/fboss/agent/packet/test/DHCPv4PacketTest.cpp index 7569c134ffc1b..6829d789e04ce 100644 --- a/fboss/agent/packet/test/DHCPv4PacketTest.cpp +++ b/fboss/agent/packet/test/DHCPv4PacketTest.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "fboss/agent/DHCPv4Handler.h" +#include "fboss/agent/DHCPv4OptionsOfInterest.h" #include "fboss/agent/FbossError.h" #include "fboss/agent/SwSwitch.h" #include "fboss/agent/hw/mock/MockHwSwitch.h" @@ -172,23 +172,23 @@ TEST(DHCPv4Packet, getOption) { auto dhcpPkt = makeDHCPPacket(); vector optData; EXPECT_TRUE(DHCPv4Packet::getOptionSlow( - DHCPv4Handler::DHCP_MESSAGE_TYPE, dhcpPkt.options, optData)); + DHCPv4OptionsOfInterest::DHCP_MESSAGE_TYPE, dhcpPkt.options, optData)); EXPECT_EQ(1, optData.size()); EXPECT_EQ(1, optData[0]); optData.clear(); EXPECT_TRUE(DHCPv4Packet::getOptionSlow( - DHCPv4Handler::PAD, dhcpPkt.options, optData)); + DHCPv4OptionsOfInterest::PAD, dhcpPkt.options, optData)); EXPECT_EQ(0, optData.size()); optData.clear(); EXPECT_TRUE(DHCPv4Packet::getOptionSlow( - DHCPv4Handler::END, dhcpPkt.options, optData)); + DHCPv4OptionsOfInterest::END, dhcpPkt.options, optData)); EXPECT_EQ(0, optData.size()); optData.clear(); EXPECT_FALSE(DHCPv4Packet::getOptionSlow( - DHCPv4Handler::DHCP_AGENT_OPTIONS, dhcpPkt.options, optData)); + DHCPv4OptionsOfInterest::DHCP_AGENT_OPTIONS, dhcpPkt.options, optData)); EXPECT_EQ(0, optData.size()); } From ca893e99c465bb7e94f09abfa62452964412ff48 Mon Sep 17 00:00:00 2001 From: Ron He Date: Wed, 1 Feb 2023 16:49:38 -0800 Subject: [PATCH 038/280] Sai Replayer log elapsed time on get fn Summary: As titled. Log elapsed time and also log the call before making the call to SDK. Reviewed By: shri-khare Differential Revision: D42763603 Privacy Context Container: L1125642 fbshipit-source-id: cffb8d8694466db4d5abf1d5e3ec03e496494780 --- fboss/agent/hw/sai/tracer/SaiTracer.cpp | 11 +---- fboss/agent/hw/sai/tracer/SaiTracer.h | 45 +++++++++++-------- fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp | 13 +++++- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.cpp b/fboss/agent/hw/sai/tracer/SaiTracer.cpp index 42e22eece89a4..cc06c1c7bc743 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.cpp +++ b/fboss/agent/hw/sai/tracer/SaiTracer.cpp @@ -1020,8 +1020,7 @@ void SaiTracer::logGetAttrFn( sai_object_id_t get_object_id, uint32_t attr_count, const sai_attribute_t* attr, - sai_object_type_t object_type, - sai_status_t rv) { + sai_object_type_t object_type) { if (!FLAGS_enable_replayer || !FLAGS_enable_get_attr_log) { return; } @@ -1030,9 +1029,6 @@ void SaiTracer::logGetAttrFn( lines.push_back( to("memset(get_attribute,0,ATTR_SIZE*", maxAttrCount_, ")")); - // Log current timestamp, object id and return value - lines.push_back(logTimeAndRv(rv, get_object_id)); - // Make getAttribute call lines.push_back(to( "rv=", @@ -1045,10 +1041,7 @@ void SaiTracer::logGetAttrFn( attr_count, ",get_attribute)")); - // Check return value to be the same as the original run - lines.push_back(rvCheck(rv)); - - writeToFile(lines); + writeToFile(lines, false); } void SaiTracer::logSetAttrFn( diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.h b/fboss/agent/hw/sai/tracer/SaiTracer.h index 12a501a224e33..05cf17ed20701 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.h +++ b/fboss/agent/hw/sai/tracer/SaiTracer.h @@ -32,6 +32,7 @@ extern "C" { DECLARE_bool(enable_replayer); DECLARE_bool(enable_packet_log); DECLARE_bool(enable_elapsed_time_log); +DECLARE_bool(enable_get_attr_log); using PrimitiveFunction = std::string (*)(const sai_attribute_t*, int); using AttributeFunction = @@ -143,8 +144,7 @@ class SaiTracer { sai_object_id_t get_object_id, uint32_t attr_count, const sai_attribute_t* attr, - sai_object_type_t object_type, - sai_status_t rv); + sai_object_type_t object_type); void logSetAttrFn( const std::string& fn_name, @@ -576,23 +576,30 @@ class SaiTracer { return rv; \ } -#define WRAP_GET_ATTR_FUNC(obj_type, sai_obj_type, api_type) \ - sai_status_t wrap_get_##obj_type##_attribute( \ - sai_object_id_t obj_type##_id, \ - uint32_t attr_count, \ - sai_attribute_t* attr_list) { \ - auto rv = \ - SaiTracer::getInstance()->api_type##Api_->get_##obj_type##_attribute( \ - obj_type##_id, attr_count, attr_list); \ - \ - SaiTracer::getInstance()->logGetAttrFn( \ - "get_" #obj_type "_attribute", \ - obj_type##_id, \ - attr_count, \ - attr_list, \ - sai_obj_type, \ - rv); \ - return rv; \ +#define WRAP_GET_ATTR_FUNC(obj_type, sai_obj_type, api_type) \ + sai_status_t wrap_get_##obj_type##_attribute( \ + sai_object_id_t obj_type##_id, \ + uint32_t attr_count, \ + sai_attribute_t* attr_list) { \ + if (FLAGS_enable_get_attr_log) { \ + SaiTracer::getInstance()->logGetAttrFn( \ + "get_" #obj_type "_attribute", \ + obj_type##_id, \ + attr_count, \ + attr_list, \ + sai_obj_type); \ + auto begin = FLAGS_enable_elapsed_time_log \ + ? std::chrono::system_clock::now() \ + : std::chrono::system_clock::time_point::min(); \ + auto rv = SaiTracer::getInstance() \ + ->api_type##Api_->get_##obj_type##_attribute( \ + obj_type##_id, attr_count, attr_list); \ + SaiTracer::getInstance()->logPostInvocation(rv, obj_type##_id, begin); \ + return rv; \ + } \ + return SaiTracer::getInstance() \ + ->api_type##Api_->get_##obj_type##_attribute( \ + obj_type##_id, attr_count, attr_list); \ } #define WRAP_BULK_SET_ATTR_FUNC(obj_type, sai_obj_type, api_type) \ diff --git a/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp b/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp index b9ed3026cb9ab..ae40ff508fdba 100644 --- a/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp +++ b/fboss/agent/hw/sai/tracer/SwitchApiTracer.cpp @@ -138,8 +138,19 @@ sai_status_t wrap_get_switch_attribute( sai_object_id_t switch_id, uint32_t attr_count, sai_attribute_t* attr_list) { - return SaiTracer::getInstance()->switchApi_->get_switch_attribute( + SaiTracer::getInstance()->logGetAttrFn( + "get_switch_attribute", + switch_id, + attr_count, + attr_list, + SAI_OBJECT_TYPE_SWITCH); + auto begin = FLAGS_enable_elapsed_time_log + ? std::chrono::system_clock::now() + : std::chrono::system_clock::time_point::min(); + auto rv = SaiTracer::getInstance()->switchApi_->get_switch_attribute( switch_id, attr_count, attr_list); + SaiTracer::getInstance()->logPostInvocation(rv, switch_id, begin); + return rv; } sai_status_t wrap_get_switch_stats( From 70304876c83b092e2983fb6c9f3fb0553fbc2924 Mon Sep 17 00:00:00 2001 From: Ron He Date: Wed, 1 Feb 2023 16:49:38 -0800 Subject: [PATCH 039/280] Log elapsed time for route entry Summary: As titled. Log before call + elapsed time. Reviewed By: shri-khare Differential Revision: D42937187 Privacy Context Container: L1125642 fbshipit-source-id: 99d6143cb214348cc4ea1075c6279eea32e6782a --- fboss/agent/hw/sai/tracer/RouteApiTracer.cpp | 17 ++++++---- fboss/agent/hw/sai/tracer/SaiTracer.cpp | 34 ++++---------------- fboss/agent/hw/sai/tracer/SaiTracer.h | 10 ++---- 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/fboss/agent/hw/sai/tracer/RouteApiTracer.cpp b/fboss/agent/hw/sai/tracer/RouteApiTracer.cpp index 4a8a225d828a0..533d2372e1da8 100644 --- a/fboss/agent/hw/sai/tracer/RouteApiTracer.cpp +++ b/fboss/agent/hw/sai/tracer/RouteApiTracer.cpp @@ -32,29 +32,32 @@ sai_status_t wrap_create_route_entry( const sai_route_entry_t* route_entry, uint32_t attr_count, const sai_attribute_t* attr_list) { + SaiTracer::getInstance()->logRouteEntryCreateFn( + route_entry, attr_count, attr_list); + auto begin = std::chrono::system_clock::now(); auto rv = SaiTracer::getInstance()->routeApi_->create_route_entry( route_entry, attr_count, attr_list); - - SaiTracer::getInstance()->logRouteEntryCreateFn( - route_entry, attr_count, attr_list, rv); + SaiTracer::getInstance()->logPostInvocation(rv, SAI_NULL_OBJECT_ID, begin); return rv; } sai_status_t wrap_remove_route_entry(const sai_route_entry_t* route_entry) { + SaiTracer::getInstance()->logRouteEntryRemoveFn(route_entry); + auto begin = std::chrono::system_clock::now(); auto rv = SaiTracer::getInstance()->routeApi_->remove_route_entry(route_entry); - - SaiTracer::getInstance()->logRouteEntryRemoveFn(route_entry, rv); + SaiTracer::getInstance()->logPostInvocation(rv, SAI_NULL_OBJECT_ID, begin); return rv; } sai_status_t wrap_set_route_entry_attribute( const sai_route_entry_t* route_entry, const sai_attribute_t* attr) { + SaiTracer::getInstance()->logRouteEntrySetAttrFn(route_entry, attr); + auto begin = std::chrono::system_clock::now(); auto rv = SaiTracer::getInstance()->routeApi_->set_route_entry_attribute( route_entry, attr); - - SaiTracer::getInstance()->logRouteEntrySetAttrFn(route_entry, attr, rv); + SaiTracer::getInstance()->logPostInvocation(rv, SAI_NULL_OBJECT_ID, begin); return rv; } diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.cpp b/fboss/agent/hw/sai/tracer/SaiTracer.cpp index cc06c1c7bc743..68c8fb309d97d 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.cpp +++ b/fboss/agent/hw/sai/tracer/SaiTracer.cpp @@ -588,8 +588,7 @@ void SaiTracer::logSwitchCreateFn( void SaiTracer::logRouteEntryCreateFn( const sai_route_entry_t* route_entry, uint32_t attr_count, - const sai_attribute_t* attr_list, - sai_status_t rv) { + const sai_attribute_t* attr_list) { if (!FLAGS_enable_replayer) { return; } @@ -601,9 +600,6 @@ void SaiTracer::logRouteEntryCreateFn( // Then setup route entry (switch, virtual router and destination) setRouteEntry(route_entry, lines); - // Log timestamp and return value - lines.push_back(logTimeAndRv(rv)); - // Make the function call lines.push_back(to( "rv=", @@ -615,10 +611,7 @@ void SaiTracer::logRouteEntryCreateFn( attr_count, ",s_a)")); - // Check return value to be the same as the original run - lines.push_back(rvCheck(rv)); - - writeToFile(lines); + writeToFile(lines, false); } void SaiTracer::logNeighborEntryCreateFn( @@ -757,9 +750,7 @@ std::string SaiTracer::logCreateFn( return varName; } -void SaiTracer::logRouteEntryRemoveFn( - const sai_route_entry_t* route_entry, - sai_status_t rv) { +void SaiTracer::logRouteEntryRemoveFn(const sai_route_entry_t* route_entry) { if (!FLAGS_enable_replayer) { return; } @@ -767,9 +758,6 @@ void SaiTracer::logRouteEntryRemoveFn( vector lines{}; setRouteEntry(route_entry, lines); - // Log timestamp and return value - lines.push_back(logTimeAndRv(rv)); - lines.push_back(to( "rv=", folly::get_or_throw( @@ -778,10 +766,7 @@ void SaiTracer::logRouteEntryRemoveFn( "Unsupported Sai Object type in Sai Tracer"), "remove_route_entry(&r_e)")); - // Check return value to be the same as the original run - lines.push_back(rvCheck(rv)); - - writeToFile(lines); + writeToFile(lines, false); } void SaiTracer::logNeighborEntryRemoveFn( @@ -893,8 +878,7 @@ void SaiTracer::logRemoveFn( void SaiTracer::logRouteEntrySetAttrFn( const sai_route_entry_t* route_entry, - const sai_attribute_t* attr, - sai_status_t rv) { + const sai_attribute_t* attr) { if (!FLAGS_enable_replayer) { return; } @@ -904,9 +888,6 @@ void SaiTracer::logRouteEntrySetAttrFn( setRouteEntry(route_entry, lines); - // Log timestamp and return value - lines.push_back(logTimeAndRv(rv)); - // Make setAttribute call lines.push_back(to( "rv=", @@ -916,10 +897,7 @@ void SaiTracer::logRouteEntrySetAttrFn( "Unsupported Sai Object type in Sai Tracer"), "set_route_entry_attribute(&r_e, s_a)")); - // Check return value to be the same as the original run - lines.push_back(rvCheck(rv)); - - writeToFile(lines); + writeToFile(lines, false); } void SaiTracer::logNeighborEntrySetAttrFn( diff --git a/fboss/agent/hw/sai/tracer/SaiTracer.h b/fboss/agent/hw/sai/tracer/SaiTracer.h index 05cf17ed20701..4d6790d52aeb3 100644 --- a/fboss/agent/hw/sai/tracer/SaiTracer.h +++ b/fboss/agent/hw/sai/tracer/SaiTracer.h @@ -71,8 +71,7 @@ class SaiTracer { void logRouteEntryCreateFn( const sai_route_entry_t* route_entry, uint32_t attr_count, - const sai_attribute_t* attr_list, - sai_status_t rv); + const sai_attribute_t* attr_list); void logNeighborEntryCreateFn( const sai_neighbor_entry_t* neighbor_entry, @@ -100,9 +99,7 @@ class SaiTracer { const sai_attribute_t* attr_list, sai_object_type_t object_type); - void logRouteEntryRemoveFn( - const sai_route_entry_t* route_entry, - sai_status_t rv); + void logRouteEntryRemoveFn(const sai_route_entry_t* route_entry); void logNeighborEntryRemoveFn( const sai_neighbor_entry_t* neighbor_entry, @@ -121,8 +118,7 @@ class SaiTracer { void logRouteEntrySetAttrFn( const sai_route_entry_t* route_entry, - const sai_attribute_t* attr, - sai_status_t rv); + const sai_attribute_t* attr); void logNeighborEntrySetAttrFn( const sai_neighbor_entry_t* neighbor_entry, From 4347952a0780eadc681a706a4e29ef136144170f Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 1 Feb 2023 17:05:24 -0800 Subject: [PATCH 040/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/1f7143624af2c3b3231147c02d947e3753c29206 https://github.com/facebookincubator/katran/commit/4123b7b45a2ac60bad0f767b50307faf84e83d65 https://github.com/facebookincubator/mvfst/commit/3ecd2ef2fa5c780ce35c166218d81b084f37d0db Reviewed By: jailby fbshipit-source-id: cb5a60a309cb27520d7de6cbf571fa3435f15338 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 5f8d99bc50cf2..56136fb08e8c8 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit d75dff237dc45a4f19923754badd9b5b32281c73 +Subproject commit 1f7143624af2c3b3231147c02d947e3753c29206 From 5b60767528d1109ae3fc5305eafe92ad73461324 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 1 Feb 2023 20:23:07 -0800 Subject: [PATCH 041/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/1bd531c7c3e15b5b4be64df36dc955150f8f9ef0 https://github.com/facebook/folly/commit/6a206aa77c9700cc293631826a8db91d0d4e1d4a https://github.com/facebook/proxygen/commit/78890daa4c682f2b65656211587cfeebf86d049b https://github.com/facebookincubator/velox/commit/878d25cf37861029e49cee7a6353f4d5189ad7af Reviewed By: jailby fbshipit-source-id: 384208de7810ffb8d294b9c29b94c675517cb07a --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 56136fb08e8c8..c5ba1df612149 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 1f7143624af2c3b3231147c02d947e3753c29206 +Subproject commit 1bd531c7c3e15b5b4be64df36dc955150f8f9ef0 diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index 89eb5994a48e0..aaa7f9b86d2f6 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 562d4b958dc83c26c51808e867ce7cdcb6d05d36 +Subproject commit 6a206aa77c9700cc293631826a8db91d0d4e1d4a From 95b5617f7ac2a63e2b9d5f8e47f1c1b87f748177 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Wed, 1 Feb 2023 23:40:08 -0800 Subject: [PATCH 042/280] modify switch state while resetting teflow table Summary: as titled. this is useful when resetTeFlowTable is invoked on published switch state, it is no-op when invoked on cloned switch state. Reviewed By: zechengh09 Differential Revision: D42951868 Privacy Context Container: L1125642 fbshipit-source-id: 9bb455a2c2b1c9fe943b16f9059af08fdad2962b --- fboss/agent/state/TeFlowTable.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/fboss/agent/state/TeFlowTable.cpp b/fboss/agent/state/TeFlowTable.cpp index 0fa1b831a272a..c21d87099625d 100644 --- a/fboss/agent/state/TeFlowTable.cpp +++ b/fboss/agent/state/TeFlowTable.cpp @@ -79,6 +79,7 @@ TeFlowTable* TeFlowTable::modify(std::shared_ptr* state) { CHECK(!(*state)->isPublished()); return this; } + SwitchState::modify(state); auto newTable = clone(); auto* ptr = newTable.get(); From 5139dd7493d3c0f78901ca28a1d4cd4f04d05cbc Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 1 Feb 2023 23:42:55 -0800 Subject: [PATCH 043/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/07162c5c160379e0ca6a5e2656f977b58d4bcd1d Reviewed By: jailby fbshipit-source-id: 81b2f585a20a2a0595564eb27b578de5577c2bf2 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index c5ba1df612149..ea5102769e089 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 1bd531c7c3e15b5b4be64df36dc955150f8f9ef0 +Subproject commit 07162c5c160379e0ca6a5e2656f977b58d4bcd1d From 6e57a87ba0bf4d8118e73d5e229e67dd97ee42c2 Mon Sep 17 00:00:00 2001 From: Siva Muthusamy Date: Thu, 2 Feb 2023 01:07:19 -0800 Subject: [PATCH 044/280] Update the stable commit hashes to latest Summary: Update the stable commit hashes to latest Differential Revision: D42952628 fbshipit-source-id: c5ce0dd7ce55f6be6db6ecd2de1c780b1377cffe --- .../github_hashes_02012023_170524.tar.gz | Bin 0 -> 616 bytes fboss/stable_commits/latest_stable_hashes.tar.gz | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 fboss/stable_commits/github_hashes_02012023_170524.tar.gz diff --git a/fboss/stable_commits/github_hashes_02012023_170524.tar.gz b/fboss/stable_commits/github_hashes_02012023_170524.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..06628a463933458fb9535d749d1590ae71957b97 GIT binary patch literal 616 zcmV-u0+;2H<{n4<@((^;FfVQ`PHm0j914$_x`|yi8)^ zVqB=*qYoww89*o#{J#eR9TJNC{hz+Y?P8hVb{9n>XKnX=eE;g@k8jgw#r(Maw@$Hk z*4XK_BSprUZe}mLtY5a9A*^S!1HM<*o69e!wfLBSF87l7jX7M{<) zh9N9pugj-5!5>Ip^ve$6%88!ak;61>chvYw5+mUOJq?0sW7w&8B((MWO#K?Dn4x zyWZ+R&Ql3FiC4jq1TMNSRgK9oD@PUmzXpf&-;inDe-e%Ux3JrP6{WW|*s4?V!G@lT z@zIjkE_?2UMM#N8|F6O!{U7G*MIBBb0mt`W(RjIt{x|SM|ErtA&>Y4IV4~4RDRzl; z?%5UNtVz1pBKSh z_FSq-%IK1FW Date: Thu, 2 Feb 2023 01:15:45 -0800 Subject: [PATCH 045/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fb303/commit/992d8a7f935af41ceb24c6b680aa37b4a4a414b3 https://github.com/facebook/fbthrift/commit/35853c6e4ea3babd3c81995d4d744e3f69066be2 https://github.com/facebook/wangle/commit/71a2998dec1d439a55789af810dcd274c76c3abc https://github.com/facebook/watchman/commit/e293e854d29651651158715b0df048e8c43c3374 https://github.com/facebookexperimental/edencommon/commit/b0d5fd5edb6108fce44538e57dde394f91839fac https://github.com/facebookexperimental/rust-shed/commit/935b7f23cbc1b83fc2ed3b02db9de40ff8096276 https://github.com/facebookincubator/fizz/commit/280ab3debfc301638341c78b8cdbbb6f2879dcbf https://github.com/facebookresearch/beanmachine/commit/b6c5d19aa0dc03b487320a04da00f8b31ceafc29 https://github.com/facebookresearch/recipes/commit/599d879790b3dc6171a5e2ac24a06b76edb0d0d6 Reviewed By: jailby fbshipit-source-id: 11cb1d9bbaba911ed55b7b59827c084bac7f442e --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index ea5102769e089..488243b659d56 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 07162c5c160379e0ca6a5e2656f977b58d4bcd1d +Subproject commit 35853c6e4ea3babd3c81995d4d744e3f69066be2 diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 3f8aa8d0d89d9..8bf806c5012d7 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 400138bc9f3e30a69fe84923ec21b0f656ccb44e +Subproject commit 71a2998dec1d439a55789af810dcd274c76c3abc From eadb0acd2670eec58b29b620aa56a16e4f103bd6 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 2 Feb 2023 02:00:21 -0800 Subject: [PATCH 046/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/e972119e108cf5b4ad7af9fa12a1bd38ca781222 https://github.com/facebook/proxygen/commit/f66fe46dca0e39127140b6972241c2c9da2624bd https://github.com/facebookincubator/katran/commit/7d947198fbeb8cd2d6fe236a86e9e5fc80f79fcf https://github.com/facebookincubator/mvfst/commit/ca275684b24194eb4dff48afc0b92f6cdf9aa4a9 Reviewed By: jailby fbshipit-source-id: f3f870960316fed3065c1e8d38f84f76074ea9a8 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 488243b659d56..d80eedbdd7665 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 35853c6e4ea3babd3c81995d4d744e3f69066be2 +Subproject commit e972119e108cf5b4ad7af9fa12a1bd38ca781222 From 6b9c98661bcfba8ce03aed06e9e4b49b0836a8c7 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 2 Feb 2023 03:40:19 -0800 Subject: [PATCH 047/280] Add IN_PAUSE_INCREMENT_DISCARDS feature knob. Summary: All but IndusAsic have this behavior Reviewed By: nivinl Differential Revision: D42953070 Privacy Context Container: L1125642 fbshipit-source-id: 7de134545b0517bf35a08e0f7048350580990ece --- fboss/agent/hw/switch_asics/EbroAsic.cpp | 1 + fboss/agent/hw/switch_asics/GaronneAsic.cpp | 1 + fboss/agent/hw/switch_asics/HwAsic.h | 1 + fboss/agent/hw/switch_asics/IndusAsic.cpp | 1 + fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp | 1 + fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp | 1 + fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp | 1 + fboss/agent/hw/switch_asics/TomahawkAsic.cpp | 1 + fboss/agent/hw/switch_asics/Trident2Asic.cpp | 1 + 9 files changed, 9 insertions(+) diff --git a/fboss/agent/hw/switch_asics/EbroAsic.cpp b/fboss/agent/hw/switch_asics/EbroAsic.cpp index 98faff2d51751..394437e0844b7 100644 --- a/fboss/agent/hw/switch_asics/EbroAsic.cpp +++ b/fboss/agent/hw/switch_asics/EbroAsic.cpp @@ -62,6 +62,7 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::SAI_PORT_SPEED_CHANGE: case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::P4_WARMBOOT: + case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: return true; // VOQ vs NPU mode dependent features case HwAsic::Feature::BRIDGE_PORT_8021Q: diff --git a/fboss/agent/hw/switch_asics/GaronneAsic.cpp b/fboss/agent/hw/switch_asics/GaronneAsic.cpp index 6ef3f41df70fc..91465530ea0ba 100644 --- a/fboss/agent/hw/switch_asics/GaronneAsic.cpp +++ b/fboss/agent/hw/switch_asics/GaronneAsic.cpp @@ -56,6 +56,7 @@ bool GaronneAsic::isSupported(Feature feature) const { case HwAsic::Feature::ECMP_MEMBER_WIDTH_INTROSPECTION: case HwAsic::Feature::SAI_MPLS_INSEGMENT: case HwAsic::Feature::ROUTE_METADATA: + case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: return true; case HwAsic::Feature::HOSTTABLE: case HwAsic::Feature::HASH_FIELDS_CUSTOMIZATION: diff --git a/fboss/agent/hw/switch_asics/HwAsic.h b/fboss/agent/hw/switch_asics/HwAsic.h index 6f3af43683b58..e0a59db700597 100644 --- a/fboss/agent/hw/switch_asics/HwAsic.h +++ b/fboss/agent/hw/switch_asics/HwAsic.h @@ -125,6 +125,7 @@ class HwAsic { ROUTE_METADATA, DLB, P4_WARMBOOT, + IN_PAUSE_INCREMENTS_DISCARDS, }; enum class AsicMode { diff --git a/fboss/agent/hw/switch_asics/IndusAsic.cpp b/fboss/agent/hw/switch_asics/IndusAsic.cpp index bd50cbb9959f9..0d41a634fe733 100644 --- a/fboss/agent/hw/switch_asics/IndusAsic.cpp +++ b/fboss/agent/hw/switch_asics/IndusAsic.cpp @@ -72,6 +72,7 @@ bool IndusAsic::isSupported(Feature feature) const { case HwAsic::Feature::BUFFER_POOL: return true; + case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: case HwAsic::Feature::SAI_LAG_HASH: case HwAsic::Feature::HOSTTABLE_FOR_HOSTROUTES: case HwAsic::Feature::QOS_MAP_GLOBAL: diff --git a/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp b/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp index 080bcabe73cd4..1b47ed7b389a6 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp +++ b/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp @@ -73,6 +73,7 @@ bool Tomahawk3Asic::isSupported(Feature feature) const { case HwAsic::Feature::QOS_MAP_GLOBAL: case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::DLB: + case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: return true; case HwAsic::Feature::HOSTTABLE_FOR_HOSTROUTES: diff --git a/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp b/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp index 41bdbfb33afa6..e633a169158e6 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp +++ b/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp @@ -92,6 +92,7 @@ bool Tomahawk4Asic::isSupported(Feature feature) const { case HwAsic::Feature::SAI_PORT_VCO_CHANGE: case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::DLB: + case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: return true; // features only supported by B0 version, or any physical device // where used chip is always B0. diff --git a/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp b/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp index e42447d7c9931..a932dd0067b35 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp +++ b/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp @@ -77,6 +77,7 @@ bool Tomahawk5Asic::isSupported(Feature feature) const { case HwAsic::Feature::NON_UNICAST_HASH: case HwAsic::Feature::WEIGHTED_NEXTHOPGROUP_MEMBER: case HwAsic::Feature::DLB: + case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: return true; // features not working well with bcmsim case HwAsic::Feature::MIRROR_PACKET_TRUNCATION: diff --git a/fboss/agent/hw/switch_asics/TomahawkAsic.cpp b/fboss/agent/hw/switch_asics/TomahawkAsic.cpp index 9fd2244433684..0eb707a68132a 100644 --- a/fboss/agent/hw/switch_asics/TomahawkAsic.cpp +++ b/fboss/agent/hw/switch_asics/TomahawkAsic.cpp @@ -62,6 +62,7 @@ bool TomahawkAsic::isSupported(Feature feature) const { case HwAsic::Feature::SAI_MPLS_QOS: case HwAsic::Feature::QOS_MAP_GLOBAL: case HwAsic::Feature::ROUTE_METADATA: + case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: return true; case HwAsic::Feature::HOSTTABLE_FOR_HOSTROUTES: diff --git a/fboss/agent/hw/switch_asics/Trident2Asic.cpp b/fboss/agent/hw/switch_asics/Trident2Asic.cpp index 005fc4b9ef497..1d43773fdc839 100644 --- a/fboss/agent/hw/switch_asics/Trident2Asic.cpp +++ b/fboss/agent/hw/switch_asics/Trident2Asic.cpp @@ -45,6 +45,7 @@ bool Trident2Asic::isSupported(Feature feature) const { case HwAsic::Feature::FEC: case HwAsic::Feature::ECMP_MEMBER_WIDTH_INTROSPECTION: case HwAsic::Feature::ROUTE_METADATA: + case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: return true; case HwAsic::Feature::ERSPANv6: From d29fab44f2ead6c950a1b75bfa0e9623613dbb3a Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 2 Feb 2023 03:40:19 -0800 Subject: [PATCH 048/280] SaiPort - subtract pause from discards only if pause frames count as discards Summary: As titled Differential Revision: D42952572 Privacy Context Container: L1125642 fbshipit-source-id: f0ca1db61352da692b7e5476c30584d44b1ef0f0 --- fboss/agent/hw/sai/switch/SaiPortManager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fboss/agent/hw/sai/switch/SaiPortManager.cpp b/fboss/agent/hw/sai/switch/SaiPortManager.cpp index e774e0b05183d..5eb74862c50ac 100644 --- a/fboss/agent/hw/sai/switch/SaiPortManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiPortManager.cpp @@ -1177,8 +1177,13 @@ void SaiPortManager::updateStats(PortID portId, bool updateWatermarks) { const auto& counters = handle->port->getStats(); fillHwPortStats(counters, managerTable_->debugCounterManager(), curPortStats); std::vector toSubtractFromInDiscardsRaw = { - {*prevPortStats.inDstNullDiscards_(), *curPortStats.inDstNullDiscards_()}, - {*prevPortStats.inPause_(), *curPortStats.inPause_()}}; + {*prevPortStats.inDstNullDiscards_(), + *curPortStats.inDstNullDiscards_()}}; + if (platform_->getAsic()->isSupported( + HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS)) { + toSubtractFromInDiscardsRaw.push_back( + {*prevPortStats.inPause_(), *curPortStats.inPause_()}); + } *curPortStats.inDiscards_() += utility::subtractIncrements( {*prevPortStats.inDiscardsRaw_(), *curPortStats.inDiscardsRaw_()}, toSubtractFromInDiscardsRaw); From 505a6d62c9bdf986d0a98b5a9e7cadbc24e3ce69 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 2 Feb 2023 03:40:19 -0800 Subject: [PATCH 049/280] BcmPort: subtract in pause from discards on asics with IN_PAUSE_INCREMENT_DISCARDS Summary: as titled Reviewed By: nivinl Differential Revision: D42952992 Privacy Context Container: L1125642 fbshipit-source-id: f2b47a1141a7ae08c10a084544ff6932b46ab0ae --- fboss/agent/hw/bcm/BcmPort.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fboss/agent/hw/bcm/BcmPort.cpp b/fboss/agent/hw/bcm/BcmPort.cpp index 7d64c270fa445..7b5bfb0a89750 100644 --- a/fboss/agent/hw/bcm/BcmPort.cpp +++ b/fboss/agent/hw/bcm/BcmPort.cpp @@ -1440,7 +1440,9 @@ void BcmPort::updateStats() { std::vector toSubtractFromInDiscardsRaw = { {*lastPortStats.inDstNullDiscards_(), *curPortStats.inDstNullDiscards_()}}; - if (isMmuLossy()) { + if (isMmuLossy() && + hw_->getPlatform()->getAsic()->isSupported( + HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS)) { // If MMU setup as lossy, all incoming pause frames will be // discarded and will count towards in discards. This makes in discards // counter somewhat useless. So instead calculate "in_non_pause_discards", From a4ea6cbd913695edc937c3f63e3e164c5507b244 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 2 Feb 2023 07:06:22 -0800 Subject: [PATCH 050/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/5141ebce006eb6a569927fceb760614cc1267b2b Reviewed By: jailby fbshipit-source-id: 085114ebb63785a1d38f828ffff1fc060351f370 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index d80eedbdd7665..6ecdd2f287ae5 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit e972119e108cf5b4ad7af9fa12a1bd38ca781222 +Subproject commit 5141ebce006eb6a569927fceb760614cc1267b2b From 6a91f25997812e7d74d8413364471130e0865e29 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Thu, 2 Feb 2023 09:22:55 -0800 Subject: [PATCH 051/280] TunManager: refactor getTableID for vlan vs. port based RIFs Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. Table ID computation differs for port based RIFs (added by stacked diff) Reviewed By: jasmeetbagga Differential Revision: D42421785 Privacy Context Container: L1125642 fbshipit-source-id: 1a2c205f1f6a30f29ad5d33ee05485fadb4ba50f --- fboss/agent/TunManager.cpp | 30 ++++++++++++++++++++++++++---- fboss/agent/TunManager.h | 3 +++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/fboss/agent/TunManager.cpp b/fboss/agent/TunManager.cpp index 243e251c9db2d..c7e1b98a63b26 100644 --- a/fboss/agent/TunManager.cpp +++ b/fboss/agent/TunManager.cpp @@ -232,6 +232,27 @@ void TunManager::setIntfStatus( } int TunManager::getTableId(InterfaceID ifID) const { + int tableId; + auto interface = sw_->getState()->getInterfaces()->getInterfaceIf(ifID); + CHECK(interface); // corresponding interface must already be created + + switch (interface->getType()) { + case cfg::InterfaceType::VLAN: + tableId = getTableIdForVlanInterface(ifID); + break; + case cfg::InterfaceType::SYSTEM_PORT: + tableId = getTableIdForSystemPortInterface(ifID); + break; + } + + // Sanity checks. Generated ID must be in range [1-253] + CHECK_GE(tableId, 1); + CHECK_LE(tableId, 253); + + return tableId; +} + +int TunManager::getTableIdForVlanInterface(InterfaceID ifID) const { // Kernel only supports up to 256 tables. The last few are used by kernel // as main, default, and local. IDs 0, 254 and 255 are not available. So we // use range 1-253 for our usecase. @@ -252,13 +273,14 @@ int TunManager::getTableId(InterfaceID ifID) const { tableId = 250 - (ifID - 10); // 250, 249, 248, ... } - // Sanity checks. Generated ID must be in range [1-253] - CHECK_GE(tableId, 1); - CHECK_LE(tableId, 253); - return tableId; } +int TunManager::getTableIdForSystemPortInterface(InterfaceID ifID) const { + // TODO(skhare) + return 0; +} + int TunManager::getInterfaceMtu(InterfaceID ifID) const { auto interface = sw_->getState()->getInterfaces()->getInterfaceIf(ifID); return interface ? interface->getMtu() : kDefaultMtu; diff --git a/fboss/agent/TunManager.h b/fboss/agent/TunManager.h index 98b44647bed35..c833283a659fb 100644 --- a/fboss/agent/TunManager.h +++ b/fboss/agent/TunManager.h @@ -133,6 +133,9 @@ class TunManager : public StateObserver { */ int getTableId(InterfaceID ifID) const; + int getTableIdForVlanInterface(InterfaceID ifID) const; + int getTableIdForSystemPortInterface(InterfaceID ifID) const; + /** * Add/remove an IP rule for source routing based on a given address * From e8c4d35b36a7eab7bc7562d4748b840d35c06acc Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Thu, 2 Feb 2023 09:22:55 -0800 Subject: [PATCH 052/280] TunManager: support getTableID for port based RIFs Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff as titled. See comments in the code. Reviewed By: jasmeetbagga Differential Revision: D42422629 Privacy Context Container: L1125642 fbshipit-source-id: dd524813419d70182f5ae3b6b199cc0d2580866e --- fboss/agent/TunManager.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/fboss/agent/TunManager.cpp b/fboss/agent/TunManager.cpp index c7e1b98a63b26..4129f12caf4a1 100644 --- a/fboss/agent/TunManager.cpp +++ b/fboss/agent/TunManager.cpp @@ -277,8 +277,22 @@ int TunManager::getTableIdForVlanInterface(InterfaceID ifID) const { } int TunManager::getTableIdForSystemPortInterface(InterfaceID ifID) const { - // TODO(skhare) - return 0; + // Kernel only supports up to 256 tables. The last few are used by kernel + // as main, default, and local. IDs 0, 254 and 255 are not available. So we + // use range 1-253 for our usecase. + // + // VOQ systems use port based RIFs. + // Port based RIF IDs are assigned starting minimum system port range. + // Thus, map ifID to 1-253 with ifID - sysPortMin + 1 + // In practice, [sysPortMin, sysPortMax] range is << 253, so no risk of + // overflow. Moreover, getTableID asserts that the computed ID is <= 253 + if (!sw_->getState()->getSwitchSettings()->getSystemPortRange()) { + throw FbossError("No system port range in SwitchSettings for VOQ switch"); + } + auto sysPortMin = + *sw_->getState()->getSwitchSettings()->getSystemPortRange()->minimum(); + + return ifID - sysPortMin; } int TunManager::getInterfaceMtu(InterfaceID ifID) const { From 27b0903fab7995c1f9d1c049965ed9c003550269 Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Thu, 2 Feb 2023 09:39:27 -0800 Subject: [PATCH 053/280] move bcm-sai impl to right sdk/sai version Summary: As titled, move bcm-sai impl to right sdk and sai version. Reviewed By: shri-khare Differential Revision: D42951895 fbshipit-source-id: be00e227dfe5a62eeca3baf9a700539f88a7cbdc --- CMakeLists.txt | 8 +++++--- installer/centos-8-x64_64/build-helper.py | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11b8a4714afe7..ce2a6408789f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,10 +70,12 @@ if (SAI_BRCM_IMPL) # TODO (skhare) IS_OSS_BRCM_SAI is only a short-term change to unblock. # Refactor/fix the code and then remove this flag. add_definitions (-DIS_OSS_BRCM_SAI=true) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSAI_VERSION_7_2_0_0_ODP") + # TODO: Replace SAI_VERSION_9_0_EA_DNX_ODP with SAI_VERSION_9_0_EA_ODP + # to build bcm xgs + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSAI_VERSION_9_0_EA_DNX_ODP") set(SAI_VER_MAJOR "1") - set(SAI_VER_MINOR "10") - set(SAI_VER_RELEASE "2") + set(SAI_VER_MINOR "11") + set(SAI_VER_RELEASE "0") else() set(SAI_VER_MAJOR "1") set(SAI_VER_MINOR "7") diff --git a/installer/centos-8-x64_64/build-helper.py b/installer/centos-8-x64_64/build-helper.py index 9011c167ba207..da6c192356c52 100755 --- a/installer/centos-8-x64_64/build-helper.py +++ b/installer/centos-8-x64_64/build-helper.py @@ -164,12 +164,12 @@ def _edit_sai_manifest(self): "name = libsai\n" "\n" "[download]\n" - "url = https://github.com/opencomputeproject/SAI/archive/v1.10.2.tar.gz\n" - "sha256 = ec6ff2e44a136f72fc7f8081cec74ede9e22a1ca6097c69f0238b72bafea316c\n" + "url = https://github.com/opencomputeproject/SAI/archive/v1.11.0.tar.gz\n" + "sha256 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n" "\n" "[build]\n" "builder = nop\n" - "subdir = SAI-1.10.2\n" + "subdir = SAI-1.11.0\n" "\n" "[install.files]\n" "inc = include\n" From b52255e2f5f4d0f02b9c7eafb73b3c6b6ec78c99 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 2 Feb 2023 11:56:47 -0800 Subject: [PATCH 054/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/45eac83936b7fa8946be205fd093030870c7e810 https://github.com/facebook/rocksdb/commit/6781009ee89fb0bd703d752b221865d066a76846 https://github.com/facebookincubator/velox/commit/c094dfde4de7ac94c83b52511970c749b3d28233 Reviewed By: jailby fbshipit-source-id: 77eed32bada98e3988206736a6539634fd9b17e0 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 6ecdd2f287ae5..d0a02307fcbbf 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 5141ebce006eb6a569927fceb760614cc1267b2b +Subproject commit 45eac83936b7fa8946be205fd093030870c7e810 From d9f5b7ec79516144add9f54a11a472dbf797c4c9 Mon Sep 17 00:00:00 2001 From: Jitendra Verma Date: Thu, 2 Feb 2023 14:11:12 -0800 Subject: [PATCH 055/280] BCM config delete test Summary: Added test to make sure that BCM UdfGroup and PacketMatcher configs are deleted in HW on Udf configuration deletion. Differential Revision: D42914324 Privacy Context Container: L1125642 fbshipit-source-id: 6a2f377159e252c00e8607f049538df955fdfd9c --- fboss/agent/hw/bcm/tests/BcmUdfTests.cpp | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/fboss/agent/hw/bcm/tests/BcmUdfTests.cpp b/fboss/agent/hw/bcm/tests/BcmUdfTests.cpp index d05116504f28d..bd060fefaea83 100644 --- a/fboss/agent/hw/bcm/tests/BcmUdfTests.cpp +++ b/fboss/agent/hw/bcm/tests/BcmUdfTests.cpp @@ -78,4 +78,55 @@ TEST_F(BcmUdfTest, checkUdfPktMatcherConfiguration) { verifyAcrossWarmBoots(setupUdfConfig, verifyUdfConfig); }; + +TEST_F(BcmUdfTest, deleteUdfConfiguration) { + // Udf Config + applyNewState(setupUdfConfiguration(true)); + + const int udfGroupId = + getHwSwitch()->getUdfMgr()->getBcmUdfGroupId(utility::kUdfGroupName); + const int udfPacketMatcherId = + getHwSwitch()->getUdfMgr()->getBcmUdfPacketMatcherId( + utility::kUdfPktMatcherName); + + // Undo Udf Config + applyNewState(setupUdfConfiguration(false)); + + auto verifyUdfConfig = [=]() { + EXPECT_THROW( + getHwSwitch()->getUdfMgr()->getBcmUdfGroupId(utility::kUdfGroupName), + FbossError); + EXPECT_THROW( + getHwSwitch()->getUdfMgr()->getBcmUdfPacketMatcherId( + utility::kUdfPktMatcherName), + FbossError); + + /* get udf info */ + bcm_udf_t udfInfo; + bcm_udf_t_init(&udfInfo); + auto rv = bcm_udf_get(getHwSwitch()->getUnit(), udfGroupId, &udfInfo); + if (getAsic()->getAsicType() != cfg::AsicType::ASIC_TYPE_FAKE) { + EXPECT_THROW( + bcmCheckError( + rv, "Unable to get udfInfo for udfGroupId: ", udfGroupId), + FbossError); + } + + /* get udf pkt info */ + bcm_udf_pkt_format_info_t pktFormat; + bcm_udf_pkt_format_info_t_init(&pktFormat); + rv = bcm_udf_pkt_format_info_get( + getHwSwitch()->getUnit(), udfPacketMatcherId, &pktFormat); + if (getAsic()->getAsicType() != cfg::AsicType::ASIC_TYPE_FAKE) { + EXPECT_THROW( + bcmCheckError( + rv, + "Unable to get pkt_format for udfPacketMatcherId: ", + udfPacketMatcherId), + FbossError); + } + }; + + verifyAcrossWarmBoots([] {}, verifyUdfConfig); +}; } // namespace facebook::fboss From 7ca214e95c75a490028b4944a6955645ed316f1d Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Thu, 2 Feb 2023 15:35:10 -0800 Subject: [PATCH 056/280] disable pfc tx/rx priorities for tajo in OSS Summary: As titled, disable pfc tx/rx priorities for tajo in OSS. Trying to minimize the number of patches carried by Tajo in OSS. Reviewed By: nivinl Differential Revision: D42970308 fbshipit-source-id: ff71e8f09b4ff4d280694d0794aaa0ed43ab9dd2 --- fboss/agent/hw/sai/store/tests/PortStoreTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fboss/agent/hw/sai/store/tests/PortStoreTest.cpp b/fboss/agent/hw/sai/store/tests/PortStoreTest.cpp index 564e49a46569c..80ea195f8083c 100644 --- a/fboss/agent/hw/sai/store/tests/PortStoreTest.cpp +++ b/fboss/agent/hw/sai/store/tests/PortStoreTest.cpp @@ -44,8 +44,10 @@ class PortStoreTest : public SaiStoreTest { std::nullopt, // PTP Mode std::nullopt, // PFC Mode std::nullopt, // PFC Priorities +#if !defined(TAJO_SDK) std::nullopt, // PFC Rx Priorities std::nullopt, // PFC Tx Priorities +#endif std::nullopt, // TC to Priority Group map std::nullopt, // PFC Priority to Queue map #if SAI_API_VERSION >= SAI_VERSION(1, 9, 0) From f2a9148f1c8df5a6f502c18b0f3b2e088394cd45 Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Thu, 2 Feb 2023 15:35:10 -0800 Subject: [PATCH 057/280] use the tajo specific debug counter for oss Summary: As titled, use the tajo specific file in OSS for debug counter NOTE: Trying to minimize the OSS patches to build tajo in OSS Reviewed By: nivinl Differential Revision: D42970632 fbshipit-source-id: 8ef2242046c7ef1096b5f706ff36ceddc97f29b0 --- cmake/AgentHwSaiSwitch.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/AgentHwSaiSwitch.cmake b/cmake/AgentHwSaiSwitch.cmake index 4969c6735098d..34ec177e4270f 100644 --- a/cmake/AgentHwSaiSwitch.cmake +++ b/cmake/AgentHwSaiSwitch.cmake @@ -39,7 +39,6 @@ set(SAI_SWITCH_SRC fboss/agent/hw/sai/switch/SaiVirtualRouterManager.cpp fboss/agent/hw/sai/switch/SaiWredManager.cpp fboss/agent/hw/sai/switch/oss/SaiBufferManager.cpp - fboss/agent/hw/sai/switch/oss/SaiDebugCounterManager.cpp fboss/agent/hw/sai/switch/oss/SaiHostifManager.cpp fboss/agent/hw/sai/switch/npu/SaiAclTableManager.cpp fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp @@ -53,6 +52,7 @@ if (SAI_TAJO_IMPL) 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 + fboss/agent/hw/sai/switch/npu/tajo/SaiDebugCounterManager.cpp ) elseif (SAI_BRCM_IMPL) list(APPEND SAI_SWITCH_SRC @@ -60,6 +60,7 @@ elseif (SAI_BRCM_IMPL) 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 + fboss/agent/hw/sai/switch/oss/SaiDebugCounterManager.cpp ) else() list(APPEND SAI_SWITCH_SRC @@ -67,6 +68,7 @@ else() fboss/agent/hw/sai/switch/oss/SaiTamManager.cpp fboss/agent/hw/sai/switch/oss/SaiPortManager.cpp fboss/agent/hw/sai/switch/oss/SaiAclTableManager.cpp + fboss/agent/hw/sai/switch/oss/SaiDebugCounterManager.cpp ) endif() From 3256ed1dfa4743f851348812c26009d12577f017 Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Thu, 2 Feb 2023 15:35:10 -0800 Subject: [PATCH 058/280] fix warning for tam switch type event in OSS Summary: As titled, fix warning for tam switch type event in OSS Reviewed By: jasmeetbagga Differential Revision: D42971039 fbshipit-source-id: 71a1813780b9afe042d5019c76c88128105875e1 --- fboss/agent/hw/sai/switch/npu/tajo/SaiSwitch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fboss/agent/hw/sai/switch/npu/tajo/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/npu/tajo/SaiSwitch.cpp index 18548a2b68cbd..094e45372445d 100644 --- a/fboss/agent/hw/sai/switch/npu/tajo/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/npu/tajo/SaiSwitch.cpp @@ -65,7 +65,7 @@ void SaiSwitch::tamEventCallback( uint32_t /*attr_count*/, const sai_attribute_t* /*attr_list*/) { auto eventDesc = static_cast(buffer); - if (eventDesc->type != SAI_TAM_EVENT_TYPE_SWITCH) { + if (eventDesc->type != (sai_tam_event_type_t)SAI_TAM_EVENT_TYPE_SWITCH) { // not a switch type event return; } From 04afbacf485432ffe33fc3d8dd44c10c76925474 Mon Sep 17 00:00:00 2001 From: Ron He Date: Thu, 2 Feb 2023 16:20:07 -0800 Subject: [PATCH 059/280] Update getCurrentStateJSON to work with thrift path Summary: As thrift state is converted to thrift cow, update getCurrentStateJSON to work with thrift path. We'll use path visitors to walk down switch state (which is similar to how we did it in json). Will follow up with changes in fboss2 CLI which relies on this thrift call. Reviewed By: jasmeetbagga Differential Revision: D42669464 Privacy Context Container: L1125642 fbshipit-source-id: 0de1e07487c3fa5aac34d4f9ad5c1d48fb0a8326 --- fboss/agent/ThriftHandler.cpp | 34 +++++++++++++++++++++++++++++---- fboss/agent/ThriftHandler.h | 4 ++-- fboss/agent/if/ctrl.thrift | 4 ++-- fboss/agent/test/ThriftTest.cpp | 27 ++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 8 deletions(-) diff --git a/fboss/agent/ThriftHandler.cpp b/fboss/agent/ThriftHandler.cpp index f5e5be44e3a69..5cd2c240e01fd 100644 --- a/fboss/agent/ThriftHandler.cpp +++ b/fboss/agent/ThriftHandler.cpp @@ -1127,10 +1127,36 @@ void ThriftHandler::getRunningConfig(std::string& configStr) { void ThriftHandler::getCurrentStateJSON( std::string& ret, - std::unique_ptr jsonPointerStr) { - auto log = LOG_THRIFT_CALL(DBG1, *jsonPointerStr); - throw FbossError( - "getCurrentStateJSON no longer supported by agent due to thrift migration"); + std::unique_ptr path) { + auto log = LOG_THRIFT_CALL(DBG1); + ensureConfigured(__func__); + + // Split path into vector of string + std::vector thriftPath; + auto start = 0; + for (auto end = 0; (end = path->find("/", end)) != std::string::npos; ++end) { + thriftPath.push_back(path->substr(start, end - start)); + start = end + 1; + } + thriftPath.push_back(path->substr(start)); + + auto traverseResult = thrift_cow::RootPathVisitor::visit( + *std::const_pointer_cast(sw_->getState()), + thriftPath.begin(), + thriftPath.end(), + thrift_cow::PathVisitMode::LEAF, + [&](auto& node, auto /* begin */, auto /* end */) { + ret = node.encode(fsdb::OperProtocol::SIMPLE_JSON); + }); + switch (traverseResult) { + case thrift_cow::ThriftTraverseResult::OK: + break; + case thrift_cow::ThriftTraverseResult::VISITOR_EXCEPTION: + throw FbossError("Visitor exception when traversing thrift path."); + break; + default: + throw FbossError("Invalid thrift path provided."); + } } void ThriftHandler::patchCurrentStateJSON( diff --git a/fboss/agent/ThriftHandler.h b/fboss/agent/ThriftHandler.h index fb1d94c8238c0..f1f618a7260b2 100644 --- a/fboss/agent/ThriftHandler.h +++ b/fboss/agent/ThriftHandler.h @@ -348,9 +348,9 @@ class ThriftHandler : virtual public FbossCtrlSvIf, void getConfigAppliedInfo(ConfigAppliedInfo& configAppliedInfo) override; /** - * Serialize live running switch state at the path pointer by JSON Pointer + * Serialize live running switch state at the path pointer by thrift path */ - void getCurrentStateJSON(std::string& ret, std::unique_ptr) + void getCurrentStateJSON(std::string& ret, std::unique_ptr path) override; /** diff --git a/fboss/agent/if/ctrl.thrift b/fboss/agent/if/ctrl.thrift index ac52bd9fe44b8..82a8124bd7072 100644 --- a/fboss/agent/if/ctrl.thrift +++ b/fboss/agent/if/ctrl.thrift @@ -1042,9 +1042,9 @@ service FbossCtrl extends phy.FbossCommonPhyCtrl { ); /* - * Serialize switch state at path pointed by JSON pointer + * Serialize switch state at thrift path */ - string getCurrentStateJSON(1: string jsonPointer); + string getCurrentStateJSON(1: string path); /* * Apply patch at given path within the state tree. jsonPatch must be diff --git a/fboss/agent/test/ThriftTest.cpp b/fboss/agent/test/ThriftTest.cpp index 3affcf5995d51..f3d82b66a8185 100644 --- a/fboss/agent/test/ThriftTest.cpp +++ b/fboss/agent/test/ThriftTest.cpp @@ -1987,6 +1987,33 @@ TEST_F(ThriftTest, applySpeedAndProfileMismatchConfig) { FbossError); } +TEST_F(ThriftTest, getCurrentStateJSON) { + ThriftHandler handler(sw_); + std::string out; + std::string in = "portMap/1"; + handler.getCurrentStateJSON(out, std::make_unique(in)); + auto dyn = folly::parseJson(out); + EXPECT_EQ(dyn["portId"], 1); + EXPECT_EQ(dyn["portName"], "port1"); + EXPECT_EQ(dyn["portState"], "ENABLED"); + + in = "portMap/1/portOperState"; + handler.getCurrentStateJSON(out, std::make_unique(in)); + EXPECT_EQ(out, "false"); + + // Empty thrift path + in = ""; + EXPECT_THROW( + handler.getCurrentStateJSON(out, std::make_unique(in)), + FbossError); + + // Invalid thrift path + in = "invalid/path"; + EXPECT_THROW( + handler.getCurrentStateJSON(out, std::make_unique(in)), + FbossError); +} + class ThriftTeFlowTest : public ::testing::Test { public: void SetUp() override { From 5240ce3e029f17ad04b8666d201b54b60841ab00 Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Thu, 2 Feb 2023 16:38:43 -0800 Subject: [PATCH 060/280] kill tajo/oss SaiDebugCounterManager Summary: As titled, kill tajo/oss SaiDebugCounterManager since they look alike except the SAI versioning which exists in OSS. Kill both the files and move the source to main file since they are all open sourced anyways Reviewed By: jasmeetbagga Differential Revision: D42973135 fbshipit-source-id: f34b319fbc16d1beda69dad725d406277e070039 --- .../hw/sai/switch/SaiDebugCounterManager.cpp | 24 ++++++++++++++ .../npu/tajo/SaiDebugCounterManager.cpp | 32 ------------------- .../sai/switch/oss/SaiDebugCounterManager.cpp | 32 ------------------- 3 files changed, 24 insertions(+), 64 deletions(-) delete mode 100644 fboss/agent/hw/sai/switch/npu/tajo/SaiDebugCounterManager.cpp delete mode 100644 fboss/agent/hw/sai/switch/oss/SaiDebugCounterManager.cpp diff --git a/fboss/agent/hw/sai/switch/SaiDebugCounterManager.cpp b/fboss/agent/hw/sai/switch/SaiDebugCounterManager.cpp index 74d642a377478..ee3ab290c4425 100644 --- a/fboss/agent/hw/sai/switch/SaiDebugCounterManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiDebugCounterManager.cpp @@ -18,6 +18,10 @@ #include "fboss/agent/hw/switch_asics/HwAsic.h" #include "fboss/agent/platforms/sai/SaiPlatform.h" +extern "C" { +#include +} + namespace facebook::fboss { void SaiDebugCounterManager::setupDebugCounters() { @@ -39,4 +43,24 @@ void SaiDebugCounterManager::setupPortL3BlackHoleCounter() { portL3BlackHoleCounter_->adapterKey(), SaiDebugCounterTraits::Attributes::Index{}); } + +void SaiDebugCounterManager::setupMPLSLookupFailedCounter() { + if (!platform_->getAsic()->isSupported( + HwAsic::Feature::SAI_MPLS_LABEL_LOOKUP_FAIL_COUNTER)) { + return; + } +#if SAI_API_VERSION >= SAI_VERSION(1, 9, 0) + SaiDebugCounterTraits::CreateAttributes attrs{ + SAI_DEBUG_COUNTER_TYPE_PORT_IN_DROP_REASONS, + SAI_DEBUG_COUNTER_BIND_METHOD_AUTOMATIC, + SaiDebugCounterTraits::Attributes::InDropReasons{ + {SAI_IN_DROP_REASON_MPLS_MISS}}}; + auto& debugCounterStore = saiStore_->get(); + mplsLookupFailCounter_ = debugCounterStore.setObject(attrs, attrs); + mplsLookupFailCounterStatId_ = SAI_SWITCH_STAT_IN_DROP_REASON_RANGE_BASE + + SaiApiTable::getInstance()->debugCounterApi().getAttribute( + mplsLookupFailCounter_->adapterKey(), + SaiDebugCounterTraits::Attributes::Index{}); +#endif +} } // namespace facebook::fboss diff --git a/fboss/agent/hw/sai/switch/npu/tajo/SaiDebugCounterManager.cpp b/fboss/agent/hw/sai/switch/npu/tajo/SaiDebugCounterManager.cpp deleted file mode 100644 index eb27a0f4ca929..0000000000000 --- a/fboss/agent/hw/sai/switch/npu/tajo/SaiDebugCounterManager.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. - -#include "fboss/agent/hw/sai/switch/SaiDebugCounterManager.h" - -#include "fboss/agent/hw/sai/store/SaiStore.h" -#include "fboss/agent/hw/switch_asics/HwAsic.h" -#include "fboss/agent/platforms/sai/SaiPlatform.h" - -extern "C" { -#include -} - -namespace facebook::fboss { -void SaiDebugCounterManager::setupMPLSLookupFailedCounter() { - if (!platform_->getAsic()->isSupported( - HwAsic::Feature::SAI_MPLS_LABEL_LOOKUP_FAIL_COUNTER)) { - return; - } - SaiDebugCounterTraits::CreateAttributes attrs{ - SAI_DEBUG_COUNTER_TYPE_PORT_IN_DROP_REASONS, - SAI_DEBUG_COUNTER_BIND_METHOD_AUTOMATIC, - SaiDebugCounterTraits::Attributes::InDropReasons{ - {SAI_IN_DROP_REASON_MPLS_MISS}}}; - auto& debugCounterStore = saiStore_->get(); - mplsLookupFailCounter_ = debugCounterStore.setObject(attrs, attrs); - mplsLookupFailCounterStatId_ = SAI_SWITCH_STAT_IN_DROP_REASON_RANGE_BASE + - SaiApiTable::getInstance()->debugCounterApi().getAttribute( - mplsLookupFailCounter_->adapterKey(), - SaiDebugCounterTraits::Attributes::Index{}); -} - -} // namespace facebook::fboss diff --git a/fboss/agent/hw/sai/switch/oss/SaiDebugCounterManager.cpp b/fboss/agent/hw/sai/switch/oss/SaiDebugCounterManager.cpp deleted file mode 100644 index 226f008cea5a4..0000000000000 --- a/fboss/agent/hw/sai/switch/oss/SaiDebugCounterManager.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "fboss/agent/hw/sai/switch/SaiDebugCounterManager.h" - -#include "fboss/agent/hw/sai/api/SaiVersion.h" -#include "fboss/agent/hw/sai/store/SaiStore.h" -#include "fboss/agent/hw/switch_asics/HwAsic.h" -#include "fboss/agent/platforms/sai/SaiPlatform.h" - -extern "C" { -#include -} - -namespace facebook::fboss { -void SaiDebugCounterManager::setupMPLSLookupFailedCounter() { - if (!platform_->getAsic()->isSupported( - HwAsic::Feature::SAI_MPLS_LABEL_LOOKUP_FAIL_COUNTER)) { - return; - } -#if SAI_API_VERSION >= SAI_VERSION(1, 9, 0) - SaiDebugCounterTraits::CreateAttributes attrs{ - SAI_DEBUG_COUNTER_TYPE_PORT_IN_DROP_REASONS, - SAI_DEBUG_COUNTER_BIND_METHOD_AUTOMATIC, - SaiDebugCounterTraits::Attributes::InDropReasons{ - {SAI_IN_DROP_REASON_MPLS_MISS}}}; - auto& debugCounterStore = saiStore_->get(); - mplsLookupFailCounter_ = debugCounterStore.setObject(attrs, attrs); - mplsLookupFailCounterStatId_ = SAI_SWITCH_STAT_IN_DROP_REASON_RANGE_BASE + - SaiApiTable::getInstance()->debugCounterApi().getAttribute( - mplsLookupFailCounter_->adapterKey(), - SaiDebugCounterTraits::Attributes::Index{}); -#endif -} -} // namespace facebook::fboss From b894e005af684324acb1a0f2ba80d5dcf8ed2026 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 2 Feb 2023 17:20:15 -0800 Subject: [PATCH 061/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/eb3d9f4fe9bb24ced287d141cf9b3c77ceea8fc3 https://github.com/facebook/rocksdb/commit/63da9cfa2694fcb17c9f3f115debfd895a8213fe https://github.com/facebookincubator/velox/commit/758ee7038cc39dd5031f76231b27265c7d53a06b Reviewed By: jailby fbshipit-source-id: 679f462221a94185d3412b116fe3c1a2b5d97e15 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index d0a02307fcbbf..142607d6bade3 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 45eac83936b7fa8946be205fd093030870c7e810 +Subproject commit eb3d9f4fe9bb24ced287d141cf9b3c77ceea8fc3 From 4acaf6f1aab1fb87c84cc827cc68d9410ec35060 Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Thu, 2 Feb 2023 21:01:19 -0800 Subject: [PATCH 062/280] update sai v.11 with the correct hash Summary: As titled.update sai v.11 with the correct hash Reviewed By: simuthus-fb Differential Revision: D42981512 fbshipit-source-id: 1fb9e6d937ee72798ca8e2dee1685f79fcb872f9 --- installer/centos-8-x64_64/build-helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/centos-8-x64_64/build-helper.py b/installer/centos-8-x64_64/build-helper.py index da6c192356c52..e78f0377f5f1a 100755 --- a/installer/centos-8-x64_64/build-helper.py +++ b/installer/centos-8-x64_64/build-helper.py @@ -165,7 +165,7 @@ def _edit_sai_manifest(self): "\n" "[download]\n" "url = https://github.com/opencomputeproject/SAI/archive/v1.11.0.tar.gz\n" - "sha256 = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n" + "sha256 = 240d0211bbea2758faabfdbfa5e5488d837a47d42839bfe99b4bfbff52ab6c11\n" "\n" "[build]\n" "builder = nop\n" From aeaa3bc6a44b6b5bf62269bea2ae38d3e5a9c48c Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 2 Feb 2023 21:36:00 -0800 Subject: [PATCH 063/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/ba013d4da0854b57e9646b75c694f6061b4613ae https://github.com/facebook/wangle/commit/d0522127730ff60723d896cbfeed42dfde2e394e Reviewed By: jailby fbshipit-source-id: 59e95a951467afba5dfb3df63f089582b91e690b --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index aaa7f9b86d2f6..e9e708c2b3970 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 6a206aa77c9700cc293631826a8db91d0d4e1d4a +Subproject commit ba013d4da0854b57e9646b75c694f6061b4613ae diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 8bf806c5012d7..338e3fb31c86c 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 71a2998dec1d439a55789af810dcd274c76c3abc +Subproject commit d0522127730ff60723d896cbfeed42dfde2e394e From e4f06ef7c98331632123eed54acf311c389e325d Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 2 Feb 2023 22:26:34 -0800 Subject: [PATCH 064/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/fffd43c02f7760c7708e5e32ec32b49b4583cf54 https://github.com/facebook/fbthrift/commit/7e07abbe0ff21797e1ebf901b891ebc243e7c369 https://github.com/facebook/folly/commit/ba013d4da0854b57e9646b75c694f6061b4613ae https://github.com/facebook/proxygen/commit/4907a956f10e1a353669205d3cc520a3e34caaf1 https://github.com/facebook/wangle/commit/d0522127730ff60723d896cbfeed42dfde2e394e https://github.com/facebookexperimental/edencommon/commit/f36685d994fc79c54d2a694499e54a6bd476aea1 https://github.com/facebookincubator/fizz/commit/c24e576d1697219082a74fdfac9af3230ed6571a https://github.com/facebookincubator/mvfst/commit/d25b41d7fc79f55e1a1f49ab7834b0f3d61dd601 https://github.com/facebookincubator/velox/commit/5e2c31671aca0354ae15317a4a71a40fdbeee9b7 https://github.com/pytorch/fbgemm/commit/64c6a5bfa79291ec0b5cbccaee65c600d55f0644 Reviewed By: jailby fbshipit-source-id: 5fdac8ae3c8ee57c36056b6c5d7634a6ebfb5ea3 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 142607d6bade3..8de3e3330a7a9 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit eb3d9f4fe9bb24ced287d141cf9b3c77ceea8fc3 +Subproject commit 7e07abbe0ff21797e1ebf901b891ebc243e7c369 From 06ce32437991e394e8574f41ea24e5ebd8c3119f Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 2 Feb 2023 23:57:03 -0800 Subject: [PATCH 065/280] Towards getting fsdb integration test runnable on voq switch Summary: Interfaces on voq switches have no vlan Reviewed By: shri-khare Differential Revision: D42982235 fbshipit-source-id: a9cf1a315f23d7ddf8f032f4dd051f346d4d8925 --- fboss/agent/IPv6Handler.cpp | 4 ++-- fboss/agent/IPv6Handler.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fboss/agent/IPv6Handler.cpp b/fboss/agent/IPv6Handler.cpp index 482d40134c99e..73f7d7c8dee72 100644 --- a/fboss/agent/IPv6Handler.cpp +++ b/fboss/agent/IPv6Handler.cpp @@ -886,7 +886,7 @@ void IPv6Handler::floodNeighborAdvertisements() { continue; } sendNeighborAdvertisement( - intf->getVlanID(), + intf->getVlanIDIf(), intf->getMac(), addrEntry.asV6(), MacAddress::BROADCAST, @@ -896,7 +896,7 @@ void IPv6Handler::floodNeighborAdvertisements() { } void IPv6Handler::sendNeighborAdvertisement( - VlanID vlan, + std::optional vlan, MacAddress srcMac, IPAddressV6 srcIP, MacAddress dstMac, diff --git a/fboss/agent/IPv6Handler.h b/fboss/agent/IPv6Handler.h index 72b8b42c79abd..473d635d9f5da 100644 --- a/fboss/agent/IPv6Handler.h +++ b/fboss/agent/IPv6Handler.h @@ -69,7 +69,7 @@ class IPv6Handler : public StateObserver { * internally in response to incoming packets */ void sendNeighborAdvertisement( - VlanID vlan, + std::optional vlan, folly::MacAddress srcMac, folly::IPAddressV6 srcIP, folly::MacAddress dstMac, From 46d3b9452fb3af71a9eb8d95a457a95c8139ab48 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 2 Feb 2023 23:57:03 -0800 Subject: [PATCH 066/280] TestUtils: set interface type correctly for VOQ Switches Summary: As titled. Reviewed By: shri-khare, nivinl Differential Revision: D42983952 fbshipit-source-id: 82081ba6c9d5d3bad4aad65bd41b9d4976d79589 --- fboss/agent/test/TestUtils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fboss/agent/test/TestUtils.cpp b/fboss/agent/test/TestUtils.cpp index 33a15770d9a1c..5d34fe67726cf 100644 --- a/fboss/agent/test/TestUtils.cpp +++ b/fboss/agent/test/TestUtils.cpp @@ -228,6 +228,11 @@ cfg::SwitchConfig testConfigAImpl(bool isMhnic, cfg::SwitchType switchType) { cfg.ports()->push_back(recyclePort); addRecyclePortRif(myNode, cfg); } + if (switchType == cfg::SwitchType::VOQ) { + for (auto& intf : *cfg.interfaces()) { + intf.type() = cfg::InterfaceType::SYSTEM_PORT; + } + } return cfg; } From 2c951d86b44333473aac369e72a0332c524e9da3 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 2 Feb 2023 23:57:03 -0800 Subject: [PATCH 067/280] API to get sys port id for a given interface + UT Summary: As titled Reviewed By: shri-khare, nivinl Differential Revision: D42983963 fbshipit-source-id: 3381a3cc676e5236fd4906c19f11b50c57e49f5f --- fboss/agent/state/Interface.cpp | 8 ++++++++ fboss/agent/state/Interface.h | 1 + fboss/agent/state/tests/InterfaceTests.cpp | 23 ++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/fboss/agent/state/Interface.cpp b/fboss/agent/state/Interface.cpp index 1ba064ec9884e..4e83cd5d757c9 100644 --- a/fboss/agent/state/Interface.cpp +++ b/fboss/agent/state/Interface.cpp @@ -172,6 +172,14 @@ bool Interface::canReachAddress(const folly::IPAddress& dest) const { return getAddressToReach(dest).has_value(); } +std::optional Interface::getSystemPortID() const { + std::optional sysPort; + if (getType() == cfg::InterfaceType::SYSTEM_PORT) { + sysPort = SystemPortID(static_cast(getID())); + } + return sysPort; +} + bool Interface::isIpAttached( folly::IPAddress ip, InterfaceID intfID, diff --git a/fboss/agent/state/Interface.h b/fboss/agent/state/Interface.h index c622c4df7b0b4..e35d3de20d84d 100644 --- a/fboss/agent/state/Interface.h +++ b/fboss/agent/state/Interface.h @@ -124,6 +124,7 @@ class Interface : public ThriftStructNode { InterfaceID getID() const { return InterfaceID(get()->cref()); } + std::optional getSystemPortID() const; RouterID getRouterID() const { return RouterID(get()->cref()); diff --git a/fboss/agent/state/tests/InterfaceTests.cpp b/fboss/agent/state/tests/InterfaceTests.cpp index 8d5dbb09bed22..ac72d92eef3d9 100644 --- a/fboss/agent/state/tests/InterfaceTests.cpp +++ b/fboss/agent/state/tests/InterfaceTests.cpp @@ -635,3 +635,26 @@ TEST(Interface, getRemoteInterfacesBySwitchId) { EXPECT_EQ(stateV2->getInterfaces(SwitchID(remoteSwitchId))->size(), 1); } + +TEST(Interface, getInterfaceSysPortIDVoqSwitch) { + auto platform = createMockPlatform(); + auto stateV0 = std::make_shared(); + auto config = testConfigA(cfg::SwitchType::VOQ); + auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); + ASSERT_NE(nullptr, stateV1); + auto intf = stateV1->getInterfaces()->begin()->second; + EXPECT_TRUE(intf->getSystemPortID().has_value()); + EXPECT_EQ( + static_cast(intf->getID()), + static_cast(intf->getSystemPortID().value())); +} + +TEST(Interface, getInterfaceSysPortID) { + auto platform = createMockPlatform(); + auto stateV0 = std::make_shared(); + auto config = testConfigA(); + auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); + ASSERT_NE(nullptr, stateV1); + auto intf = stateV1->getInterfaces()->begin()->second; + EXPECT_FALSE(intf->getSystemPortID().has_value()); +} From 12ec2388dd174fbfcac1d0ff4eb4e36ef7cd7f0a Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 3 Feb 2023 02:06:08 -0800 Subject: [PATCH 068/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/wangle/commit/b9c48881ea253f1037a5b28161fb74784393d4ba https://github.com/facebookincubator/katran/commit/ccd03d0ebddb3af68eef47c1866f957d30ed87df Reviewed By: jailby fbshipit-source-id: 31a6285105011533dd66d38fb6e3558ab289743a --- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 338e3fb31c86c..bad7390dfd795 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit d0522127730ff60723d896cbfeed42dfde2e394e +Subproject commit b9c48881ea253f1037a5b28161fb74784393d4ba From 4144ccb736d0f0dfe10a874fa428042a9be16ae1 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Fri, 3 Feb 2023 08:21:42 -0800 Subject: [PATCH 069/280] Helper apis to get portid for sys port id and ports for a interface + UTs Summary: As titled Reviewed By: nivinl Differential Revision: D42984459 fbshipit-source-id: 12ca30128e5a8097831b22a7b617ae858bc9e71d --- fboss/agent/Utils.cpp | 37 +++++++++++++++++++++- fboss/agent/Utils.h | 7 ++++ fboss/agent/state/tests/InterfaceTests.cpp | 20 ++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/fboss/agent/Utils.cpp b/fboss/agent/Utils.cpp index 035c0387f42b3..ee4b2a032ec51 100644 --- a/fboss/agent/Utils.cpp +++ b/fboss/agent/Utils.cpp @@ -296,7 +296,6 @@ UnicastRoute makeUnicastRoute( route.nextHops() = thriftNextHopsFromAddresses(addrs); return route; } - bool isAnyInterfacePortInLoopbackMode( std::shared_ptr swState, const std::shared_ptr interface) { @@ -322,6 +321,42 @@ bool isAnyInterfacePortInLoopbackMode( return false; } +PortID getPortID( + SystemPortID sysPortId, + const std::shared_ptr& state) { + auto mySwitchId = state->getSwitchSettings()->getSwitchId(); + CHECK(mySwitchId); + auto sysPortRange = state->getDsfNodes() + ->getDsfNodeIf(SwitchID(*mySwitchId)) + ->getSystemPortRange(); + return PortID(static_cast(sysPortId) - *sysPortRange.minimum()); +} + +std::vector getPortsForInterface( + InterfaceID intfId, + const std::shared_ptr& state) { + auto intf = state->getInterfaces()->getInterfaceIf(intfId); + if (!intf) { + return {}; + } + std::vector ports; + switch (intf->getType()) { + case cfg::InterfaceType::VLAN: { + auto vlanId = intf->getVlanID(); + auto vlan = state->getVlans()->getVlanIf(vlanId); + if (vlan) { + for (const auto& memberPort : vlan->getPorts()) { + ports.push_back(PortID(memberPort.first)); + } + } + } break; + case cfg::InterfaceType::SYSTEM_PORT: + ports.push_back(getPortID(intf->getSystemPortID().value(), state)); + break; + } + return ports; +} + StopWatch::StopWatch(std::optional name, bool json) : name_(name), json_(json), startTime_(std::chrono::steady_clock::now()) {} diff --git a/fboss/agent/Utils.h b/fboss/agent/Utils.h index 0944ce54313fd..94d21179e0563 100644 --- a/fboss/agent/Utils.h +++ b/fboss/agent/Utils.h @@ -183,6 +183,13 @@ bool isAnyInterfacePortInLoopbackMode( std::shared_ptr swState, const std::shared_ptr interface); +PortID getPortID( + SystemPortID sysPortId, + const std::shared_ptr& state); +std::vector getPortsForInterface( + InterfaceID intf, + const std::shared_ptr& state); + class StopWatch { public: StopWatch(std::optional name, bool json); diff --git a/fboss/agent/state/tests/InterfaceTests.cpp b/fboss/agent/state/tests/InterfaceTests.cpp index ac72d92eef3d9..eecef954baa7b 100644 --- a/fboss/agent/state/tests/InterfaceTests.cpp +++ b/fboss/agent/state/tests/InterfaceTests.cpp @@ -658,3 +658,23 @@ TEST(Interface, getInterfaceSysPortID) { auto intf = stateV1->getInterfaces()->begin()->second; EXPECT_FALSE(intf->getSystemPortID().has_value()); } + +TEST(Interface, getInterfacePortsVoqSwitch) { + auto platform = createMockPlatform(); + auto stateV0 = std::make_shared(); + auto config = testConfigA(cfg::SwitchType::VOQ); + auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); + ASSERT_NE(nullptr, stateV1); + auto intf = stateV1->getInterfaces()->begin()->second; + EXPECT_EQ(getPortsForInterface(intf->getID(), stateV1).size(), 1); +} + +TEST(Interface, getInterfacePorts) { + auto platform = createMockPlatform(); + auto stateV0 = std::make_shared(); + auto config = testConfigA(); + auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); + ASSERT_NE(nullptr, stateV1); + auto intf = stateV1->getInterfaces()->begin()->second; + EXPECT_EQ(getPortsForInterface(intf->getID(), stateV1).size(), 11); +} From aedb584faac8d41474acca68f7c6739bcf9446a2 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Fri, 3 Feb 2023 08:21:42 -0800 Subject: [PATCH 070/280] Migrate isAnyInterfacePortInLoopbackMode test to use newer apis Summary: As titled. Prev diffs added apis to get ports for a interface use that. Newer APIs handle both vlan and sys port interfaces Differential Revision: D42984550 fbshipit-source-id: 9161af6637f5260966840de35a1fb3e76b00750e --- fboss/agent/Utils.cpp | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/fboss/agent/Utils.cpp b/fboss/agent/Utils.cpp index ee4b2a032ec51..92ee2ae8458d6 100644 --- a/fboss/agent/Utils.cpp +++ b/fboss/agent/Utils.cpp @@ -296,30 +296,6 @@ UnicastRoute makeUnicastRoute( route.nextHops() = thriftNextHopsFromAddresses(addrs); return route; } -bool isAnyInterfacePortInLoopbackMode( - std::shared_ptr swState, - const std::shared_ptr interface) { - auto vlanId = interface->getVlanID(); - auto vlan = swState->getVlans()->getVlanIf(vlanId); - if (vlan) { - // walk all ports for the given interface and ensure that there are no - // loopbacks configured This is mostly for the agent tests for which we dont - // want to flood grat arp when we are in loopback resulting in these pkts - // getting looped back forever - for (const auto& memberPort : vlan->getPorts()) { - auto* port = - swState->getPorts()->getPortIf(PortID(memberPort.first)).get(); - if (port) { - if (port->getLoopbackMode() != cfg::PortLoopbackMode::NONE) { - XLOG(DBG2) << "Port: " << port->getName() - << " is in loopback mode for vlanId: " << (int)vlanId; - return true; - } - } - } - } - return false; -} PortID getPortID( SystemPortID sysPortId, @@ -357,6 +333,25 @@ std::vector getPortsForInterface( return ports; } +bool isAnyInterfacePortInLoopbackMode( + std::shared_ptr swState, + const std::shared_ptr interface) { + // walk all ports for the given interface and ensure that there are no + // loopbacks configured This is mostly for the agent tests for which we dont + // want to flood grat arp when we are in loopback resulting in these pkts + // getting looped back forever + for (auto portId : getPortsForInterface(interface->getID(), swState)) { + auto port = swState->getPorts()->getPortIf(portId); + if (port && port->getLoopbackMode() != cfg::PortLoopbackMode::NONE) { + XLOG(DBG2) << "Port: " << port->getName() + << " in interface: " << interface->getID() + << " is in loopback mode"; + return true; + } + } + return false; +} + StopWatch::StopWatch(std::optional name, bool json) : name_(name), json_(json), startTime_(std::chrono::steady_clock::now()) {} From f9dd949488771a372009312f996c7a63eb2cf65d Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Fri, 3 Feb 2023 08:42:03 -0800 Subject: [PATCH 071/280] Back out "TunManager: support getTableID for port based RIFs" Summary: This diff broke linktests: https://fburl.com/sandcastle/vl9xsayw it wasn't caught by on-diff as link tests don't run for SwSwitch diffs. Will fix and then land, reverting in the meantime to unblock others. Original commit changeset: dd524813419d Original Phabricator Diff: D42422629 *** Back out "[fboss][agent] TunManager: refactor getTableID for vlan vs. port based RIFs" Original commit changeset: 1a2c205f1f6a Original Phabricator Diff: D42421785 Differential Revision: D42979924 Privacy Context Container: L1125642 fbshipit-source-id: 19cfdbf152907dee9e38e5eb89ed8d8c6d20cf44 --- fboss/agent/TunManager.cpp | 44 ++++---------------------------------- fboss/agent/TunManager.h | 3 --- 2 files changed, 4 insertions(+), 43 deletions(-) diff --git a/fboss/agent/TunManager.cpp b/fboss/agent/TunManager.cpp index 4129f12caf4a1..243e251c9db2d 100644 --- a/fboss/agent/TunManager.cpp +++ b/fboss/agent/TunManager.cpp @@ -232,27 +232,6 @@ void TunManager::setIntfStatus( } int TunManager::getTableId(InterfaceID ifID) const { - int tableId; - auto interface = sw_->getState()->getInterfaces()->getInterfaceIf(ifID); - CHECK(interface); // corresponding interface must already be created - - switch (interface->getType()) { - case cfg::InterfaceType::VLAN: - tableId = getTableIdForVlanInterface(ifID); - break; - case cfg::InterfaceType::SYSTEM_PORT: - tableId = getTableIdForSystemPortInterface(ifID); - break; - } - - // Sanity checks. Generated ID must be in range [1-253] - CHECK_GE(tableId, 1); - CHECK_LE(tableId, 253); - - return tableId; -} - -int TunManager::getTableIdForVlanInterface(InterfaceID ifID) const { // Kernel only supports up to 256 tables. The last few are used by kernel // as main, default, and local. IDs 0, 254 and 255 are not available. So we // use range 1-253 for our usecase. @@ -273,26 +252,11 @@ int TunManager::getTableIdForVlanInterface(InterfaceID ifID) const { tableId = 250 - (ifID - 10); // 250, 249, 248, ... } - return tableId; -} + // Sanity checks. Generated ID must be in range [1-253] + CHECK_GE(tableId, 1); + CHECK_LE(tableId, 253); -int TunManager::getTableIdForSystemPortInterface(InterfaceID ifID) const { - // Kernel only supports up to 256 tables. The last few are used by kernel - // as main, default, and local. IDs 0, 254 and 255 are not available. So we - // use range 1-253 for our usecase. - // - // VOQ systems use port based RIFs. - // Port based RIF IDs are assigned starting minimum system port range. - // Thus, map ifID to 1-253 with ifID - sysPortMin + 1 - // In practice, [sysPortMin, sysPortMax] range is << 253, so no risk of - // overflow. Moreover, getTableID asserts that the computed ID is <= 253 - if (!sw_->getState()->getSwitchSettings()->getSystemPortRange()) { - throw FbossError("No system port range in SwitchSettings for VOQ switch"); - } - auto sysPortMin = - *sw_->getState()->getSwitchSettings()->getSystemPortRange()->minimum(); - - return ifID - sysPortMin; + return tableId; } int TunManager::getInterfaceMtu(InterfaceID ifID) const { diff --git a/fboss/agent/TunManager.h b/fboss/agent/TunManager.h index c833283a659fb..98b44647bed35 100644 --- a/fboss/agent/TunManager.h +++ b/fboss/agent/TunManager.h @@ -133,9 +133,6 @@ class TunManager : public StateObserver { */ int getTableId(InterfaceID ifID) const; - int getTableIdForVlanInterface(InterfaceID ifID) const; - int getTableIdForSystemPortInterface(InterfaceID ifID) const; - /** * Add/remove an IP rule for source routing based on a given address * From f655fae939d2af18cf475a50e349101622b6087f Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Fri, 3 Feb 2023 10:13:16 -0800 Subject: [PATCH 072/280] Unbreak oss build (remove SaiDebugCounterManager) Reviewed By: shri-khare Differential Revision: D42996395 fbshipit-source-id: 91ce2dabfea5857efa40bd6fda9163916bc98044 --- cmake/AgentHwSaiSwitch.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/AgentHwSaiSwitch.cmake b/cmake/AgentHwSaiSwitch.cmake index 34ec177e4270f..551712ea6c825 100644 --- a/cmake/AgentHwSaiSwitch.cmake +++ b/cmake/AgentHwSaiSwitch.cmake @@ -52,7 +52,6 @@ if (SAI_TAJO_IMPL) 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 - fboss/agent/hw/sai/switch/npu/tajo/SaiDebugCounterManager.cpp ) elseif (SAI_BRCM_IMPL) list(APPEND SAI_SWITCH_SRC @@ -60,7 +59,6 @@ elseif (SAI_BRCM_IMPL) 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 - fboss/agent/hw/sai/switch/oss/SaiDebugCounterManager.cpp ) else() list(APPEND SAI_SWITCH_SRC @@ -68,7 +66,6 @@ else() fboss/agent/hw/sai/switch/oss/SaiTamManager.cpp fboss/agent/hw/sai/switch/oss/SaiPortManager.cpp fboss/agent/hw/sai/switch/oss/SaiAclTableManager.cpp - fboss/agent/hw/sai/switch/oss/SaiDebugCounterManager.cpp ) endif() From 612facf116503646a447f304f9f6ca9e4a3475ef Mon Sep 17 00:00:00 2001 From: Peyman Gardideh Date: Fri, 3 Feb 2023 10:39:22 -0800 Subject: [PATCH 073/280] Publish device watermark stats to fsdb Summary: Network analyics needs this counter (buffer_watermark_device) from NSDB Reviewed By: jasmeetbagga Differential Revision: D42970150 fbshipit-source-id: 30c3f20dea609d4e6310f84474ef1cbca92956dd --- fboss/agent/SwSwitch.cpp | 7 +++++++ fboss/agent/SwSwitch.h | 2 ++ fboss/agent/agent_stats.thrift | 1 + fboss/agent/hw/hardware_stats.thrift | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/fboss/agent/SwSwitch.cpp b/fboss/agent/SwSwitch.cpp index a28610512bd00..fd8e08af371f7 100644 --- a/fboss/agent/SwSwitch.cpp +++ b/fboss/agent/SwSwitch.cpp @@ -469,6 +469,7 @@ void SwSwitch::updateStats() { getHw()->getSwitchStats()->getHwAsicErrors(); agentStats.teFlowStats() = getTeFlowStats(); stats()->fillAgentStats(agentStats); + agentStats.bufferPoolStats() = getBufferPoolStats(); fsdbSyncer_->statsUpdated(std::move(agentStats)); publishedStatsToFsdbAt_ = now; } @@ -523,6 +524,12 @@ TeFlowStats SwSwitch::getTeFlowStats() { return teFlowStats; } +HwBufferPoolStats SwSwitch::getBufferPoolStats() const { + HwBufferPoolStats stats; + stats.deviceWatermarkBytes() = getHw()->getDeviceWatermarkBytes(); + return stats; +} + void SwSwitch::registerNeighborListener( std::function& added, diff --git a/fboss/agent/SwSwitch.h b/fboss/agent/SwSwitch.h index d5bb754217f40..bcd0c641e578c 100644 --- a/fboss/agent/SwSwitch.h +++ b/fboss/agent/SwSwitch.h @@ -769,6 +769,8 @@ class SwSwitch : public HwSwitch::Callback { TeFlowStats getTeFlowStats(); + HwBufferPoolStats getBufferPoolStats() const; + VlanID getVlanIDHelper(std::optional vlanID) const; private: diff --git a/fboss/agent/agent_stats.thrift b/fboss/agent/agent_stats.thrift index f3be3638f473c..8157470c4ba88 100644 --- a/fboss/agent/agent_stats.thrift +++ b/fboss/agent/agent_stats.thrift @@ -19,4 +19,5 @@ struct AgentStats { 5: i64 linkFlaps; 7: map sysPortStats; 8: hardware_stats.TeFlowStats teFlowStats; + 9: hardware_stats.HwBufferPoolStats bufferPoolStats; } diff --git a/fboss/agent/hw/hardware_stats.thrift b/fboss/agent/hw/hardware_stats.thrift index ce2410d584c07..219bf9689ee85 100644 --- a/fboss/agent/hw/hardware_stats.thrift +++ b/fboss/agent/hw/hardware_stats.thrift @@ -211,3 +211,7 @@ struct TeFlowStats { struct HwRxReasonStats { 1: map rxReasonStats; } + +struct HwBufferPoolStats { + 1: i64 deviceWatermarkBytes; +} From b380ce74111a6a698c55516e003cc4865009c24e Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Fri, 3 Feb 2023 10:43:23 -0800 Subject: [PATCH 074/280] Update the built_marker hashing logic only for current project (#3934) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/3934 Reviewed By: shri-khare Differential Revision: D42996394 fbshipit-source-id: e4fe54ba6e7f51b4fc640bf80bbb18b257903b1c --- build/fbcode_builder/getdeps.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index 86993e00ec70e..146fdb35722cd 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -627,8 +627,12 @@ def run_project_cmd(self, args, loader, manifest): ) builder.build(install_dirs, reconfigure=reconfigure) - # Update built_marker only if user hasn't built a specific target - if m == manifest and args.cmake_target == "install": + # If we are building the project (not depdendency) and a specific + # cmake_target (not 'install') has been requested, then we don't + # set the built_marker. This allows subsequent runs of getdeps.py + # for the project to run with different cmake_targets to trigger + # cmake + if not (m == manifest and args.cmake_target != "install"): with open(built_marker, "w") as f: f.write(project_hash) From d1633bf981e63755aeec7e43c5e8477ced16ca00 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Fri, 3 Feb 2023 10:59:26 -0800 Subject: [PATCH 075/280] move method to enable exact match config in utils Summary: as titled. this breaks the dependency on BcmSwitchEnsemble and can be used in agent ensembles. Besides this function is pure string manipulation and doesn't have to reside in BcmSwitchEnsemble. Reviewed By: msomasundaran Differential Revision: D42941743 Privacy Context Container: L1125642 fbshipit-source-id: b0c98561ccf27bedf0a7ff8baf210e8c4582ba81 --- fboss/agent/Utils.cpp | 36 +++++++++++++++++++ fboss/agent/Utils.h | 2 ++ .../agent/hw/bcm/tests/BcmSwitchEnsemble.cpp | 35 ++---------------- fboss/agent/test/AgentEnsemble.cpp | 11 ++++++ fboss/agent/test/AgentEnsemble.h | 3 ++ 5 files changed, 54 insertions(+), 33 deletions(-) diff --git a/fboss/agent/Utils.cpp b/fboss/agent/Utils.cpp index 92ee2ae8458d6..fc4858be3cd06 100644 --- a/fboss/agent/Utils.cpp +++ b/fboss/agent/Utils.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -368,4 +369,39 @@ StopWatch::~StopWatch() { XLOG(DBG2) << *name_ << " : " << durationMillseconds; } } + +void enableExactMatch(std::string& yamlCfg) { + std::string globalSt("global:\n"); + std::string emSt("fpem_mem_entries:"); + std::string emWidthSt("fpem_mem_entries_width:"); + std::size_t glPos = yamlCfg.find(globalSt); + std::size_t emPos = yamlCfg.find(emSt); + std::size_t emWidthPos = yamlCfg.find(emWidthSt); + static const re2::RE2 emPattern( + "(fpem_mem_entries: )(0x[0-9a-fA-F]+|[0-9]+)(\n)"); + static const re2::RE2 emWidthPattern( + "(fpem_mem_entries_width: )(0x[0-9a-fA-F]+|[0-9]+)(\n)"); + if (glPos != std::string::npos) { + if (emPos == std::string::npos && emWidthPos == std::string::npos) { + yamlCfg.replace( + glPos, + globalSt.length(), + "global:\n fpem_mem_entries_width: 1\n fpem_mem_entries: 65536\n"); + } else if (emPos != std::string::npos && emWidthPos == std::string::npos) { + yamlCfg.replace( + glPos, + globalSt.length(), + "global:\n fpem_mem_entries_width: 1\n"); + re2::RE2::Replace(&yamlCfg, emPattern, "fpem_mem_entries: 65536\n"); + } else { + if (emPos != std::string::npos) { + re2::RE2::Replace(&yamlCfg, emPattern, "fpem_mem_entries: 65536\n"); + } + if (emWidthPos != std::string::npos) { + re2::RE2::Replace( + &yamlCfg, emWidthPattern, "fpem_mem_entries_width: 1\n"); + } + } + } +} } // namespace facebook::fboss diff --git a/fboss/agent/Utils.h b/fboss/agent/Utils.h index 94d21179e0563..57d6c196b0605 100644 --- a/fboss/agent/Utils.h +++ b/fboss/agent/Utils.h @@ -210,4 +210,6 @@ inline constexpr uint8_t kGetNetworkControlTrafficClass() { return 48 << 2; } +void enableExactMatch(std::string& yamlCfg); + } // namespace facebook::fboss diff --git a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp index 56e89898033a7..7ec4d5de9d4f6 100644 --- a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp +++ b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp @@ -10,10 +10,10 @@ #include "fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.h" #include -#include #include #include "fboss/agent/AgentConfig.h" #include "fboss/agent/FbossError.h" +#include "fboss/agent/Utils.h" #include "fboss/agent/hw/bcm/BcmAPI.h" #include "fboss/agent/hw/bcm/BcmConfig.h" #include "fboss/agent/hw/bcm/BcmError.h" @@ -130,38 +130,7 @@ void modifyCfgForQcmTests(facebook::fboss::BcmConfig::ConfigMap& cfg) { } void modifyCfgForEMTests(std::string& yamlCfg) { - std::string globalSt("global:\n"); - std::string emSt("fpem_mem_entries:"); - std::string emWidthSt("fpem_mem_entries_width:"); - std::size_t glPos = yamlCfg.find(globalSt); - std::size_t emPos = yamlCfg.find(emSt); - std::size_t emWidthPos = yamlCfg.find(emWidthSt); - static const re2::RE2 emPattern( - "(fpem_mem_entries: )(0x[0-9a-fA-F]+|[0-9]+)(\n)"); - static const re2::RE2 emWidthPattern( - "(fpem_mem_entries_width: )(0x[0-9a-fA-F]+|[0-9]+)(\n)"); - if (glPos != std::string::npos) { - if (emPos == std::string::npos && emWidthPos == std::string::npos) { - yamlCfg.replace( - glPos, - globalSt.length(), - "global:\n fpem_mem_entries_width: 1\n fpem_mem_entries: 65536\n"); - } else if (emPos != std::string::npos && emWidthPos == std::string::npos) { - yamlCfg.replace( - glPos, - globalSt.length(), - "global:\n fpem_mem_entries_width: 1\n"); - re2::RE2::Replace(&yamlCfg, emPattern, "fpem_mem_entries: 65536\n"); - } else { - if (emPos != std::string::npos) { - re2::RE2::Replace(&yamlCfg, emPattern, "fpem_mem_entries: 65536\n"); - } - if (emWidthPos != std::string::npos) { - re2::RE2::Replace( - &yamlCfg, emWidthPattern, "fpem_mem_entries_width: 1\n"); - } - } - } + facebook::fboss::enableExactMatch(yamlCfg); } } // namespace diff --git a/fboss/agent/test/AgentEnsemble.cpp b/fboss/agent/test/AgentEnsemble.cpp index cb66a5a6d4802..790e6ce37fe94 100644 --- a/fboss/agent/test/AgentEnsemble.cpp +++ b/fboss/agent/test/AgentEnsemble.cpp @@ -3,6 +3,7 @@ #include "fboss/agent/test/AgentEnsemble.h" #include "fboss/agent/AgentConfig.h" +#include "fboss/agent/Utils.h" #include "fboss/agent/hw/test/ConfigFactory.h" #include "fboss/lib/config/PlatformConfigUtils.h" @@ -149,4 +150,14 @@ std::shared_ptr AgentEnsemble::applyNewState( return getSw()->getState(); } +void AgentEnsemble::enableExactMatch(bcm::BcmConfig& config) { + if (auto yamlCfg = config.yamlConfig()) { + // use common func + facebook::fboss::enableExactMatch(*yamlCfg); + } else { + auto& cfg = *(config.config()); + cfg["fpem_mem_entries"] = "0x10000"; + } +} + } // namespace facebook::fboss diff --git a/fboss/agent/test/AgentEnsemble.h b/fboss/agent/test/AgentEnsemble.h index 5be14f9097d3b..c1f9ad8c28a26 100644 --- a/fboss/agent/test/AgentEnsemble.h +++ b/fboss/agent/test/AgentEnsemble.h @@ -3,6 +3,7 @@ #pragma once #include +#include #include #include "fboss/agent/Main.h" @@ -72,6 +73,8 @@ class AgentEnsemble { void gracefulExit(); + static void enableExactMatch(bcm::BcmConfig& config); + private: void writeConfig(const cfg::SwitchConfig& config); From 4661402e11c82ef62d0794a282f670a92d0826a4 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Fri, 3 Feb 2023 10:59:26 -0800 Subject: [PATCH 076/280] set up input cli arguments and platform init function in ensemble Summary: as titled. this is simple movement of code from benchmark file to ensemble since this will be needed beyond benchmarks as well Reviewed By: msomasundaran Differential Revision: D42952064 Privacy Context Container: L1125642 fbshipit-source-id: d4597acd8f974469d03f783ceb7e0b3a2622ebdb --- fboss/agent/benchmarks/AgentBenchmarks.cpp | 19 +------------------ fboss/agent/benchmarks/AgentBenchmarks.h | 6 ------ fboss/agent/test/AgentEnsemble.cpp | 20 ++++++++++++++++++++ fboss/agent/test/AgentEnsemble.h | 8 ++++++++ 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/fboss/agent/benchmarks/AgentBenchmarks.cpp b/fboss/agent/benchmarks/AgentBenchmarks.cpp index 3be21eafb364a..321ecce419b51 100644 --- a/fboss/agent/benchmarks/AgentBenchmarks.cpp +++ b/fboss/agent/benchmarks/AgentBenchmarks.cpp @@ -4,27 +4,10 @@ #include "fboss/agent/test/AgentEnsemble.h" -namespace { -int kArgc; -char** kArgv; -facebook::fboss::PlatformInitFn kPlatformInitFn; -} // namespace - namespace facebook::fboss { void benchmarksMain(int argc, char* argv[], PlatformInitFn initPlatform) { - kArgc = argc; - kArgv = argv; - kPlatformInitFn = std::move(initPlatform); -} - -std::unique_ptr createAgentEnsemble( - AgentEnsembleConfigFn initialConfigFn, - uint32_t featuresDesired) { - auto ensemble = std::make_unique(); - ensemble->setupEnsemble( - kArgc, kArgv, featuresDesired, kPlatformInitFn, initialConfigFn); - return ensemble; + ensembleMain(argc, argv, initPlatform); } } // namespace facebook::fboss diff --git a/fboss/agent/benchmarks/AgentBenchmarks.h b/fboss/agent/benchmarks/AgentBenchmarks.h index 92d88473ffe18..67e7dfd721e0e 100644 --- a/fboss/agent/benchmarks/AgentBenchmarks.h +++ b/fboss/agent/benchmarks/AgentBenchmarks.h @@ -8,10 +8,4 @@ namespace facebook::fboss { void benchmarksMain(int argc, char* args[], PlatformInitFn initPlatform); -std::unique_ptr createAgentEnsemble( - AgentEnsembleConfigFn initialConfigFn, - uint32_t featuresDesired = - (HwSwitch::FeaturesDesired::PACKET_RX_DESIRED | - HwSwitch::FeaturesDesired::LINKSCAN_DESIRED)); - } // namespace facebook::fboss diff --git a/fboss/agent/test/AgentEnsemble.cpp b/fboss/agent/test/AgentEnsemble.cpp index 790e6ce37fe94..1dc38cf968982 100644 --- a/fboss/agent/test/AgentEnsemble.cpp +++ b/fboss/agent/test/AgentEnsemble.cpp @@ -21,6 +21,11 @@ void initFlagDefaults(const std::map& defaults) { item.first.c_str(), item.second.c_str(), gflags::SET_FLAGS_DEFAULT); } } + +int kArgc; +char** kArgv; +facebook::fboss::PlatformInitFn kPlatformInitFn; + } // namespace namespace facebook::fboss { AgentEnsemble::AgentEnsemble(const std::string& configFileName) { @@ -160,4 +165,19 @@ void AgentEnsemble::enableExactMatch(bcm::BcmConfig& config) { } } +void ensembleMain(int argc, char* argv[], PlatformInitFn initPlatform) { + kArgc = argc; + kArgv = argv; + kPlatformInitFn = std::move(initPlatform); +} + +std::unique_ptr createAgentEnsemble( + AgentEnsembleConfigFn initialConfigFn, + uint32_t featuresDesired) { + auto ensemble = std::make_unique(); + ensemble->setupEnsemble( + kArgc, kArgv, featuresDesired, kPlatformInitFn, initialConfigFn); + return ensemble; +} + } // namespace facebook::fboss diff --git a/fboss/agent/test/AgentEnsemble.h b/fboss/agent/test/AgentEnsemble.h index c1f9ad8c28a26..310b3da70feaa 100644 --- a/fboss/agent/test/AgentEnsemble.h +++ b/fboss/agent/test/AgentEnsemble.h @@ -85,4 +85,12 @@ class AgentEnsemble { std::string configFile_{"agent.conf"}; }; +void ensembleMain(int argc, char* argv[], PlatformInitFn initPlatform); + +std::unique_ptr createAgentEnsemble( + AgentEnsembleConfigFn initialConfigFn, + uint32_t featuresDesired = + (HwSwitch::FeaturesDesired::PACKET_RX_DESIRED | + HwSwitch::FeaturesDesired::LINKSCAN_DESIRED)); + } // namespace facebook::fboss From 652881e10a98e2f9edafa0338f58580bbca48346 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Fri, 3 Feb 2023 10:59:26 -0800 Subject: [PATCH 077/280] record original config file argument Summary: as titled. the ensemble replaces FLAGS_config, save input FLAGS_config in static variable just before it gets overwritten. Reviewed By: jasmeetbagga Differential Revision: D42952360 Privacy Context Container: L1125642 fbshipit-source-id: 1fb72fc102e9d26f3723fa2ca103f34efa2c22e0 --- fboss/agent/test/AgentEnsemble.cpp | 13 +++++++++++++ fboss/agent/test/AgentEnsemble.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/fboss/agent/test/AgentEnsemble.cpp b/fboss/agent/test/AgentEnsemble.cpp index 1dc38cf968982..09b1be59eba61 100644 --- a/fboss/agent/test/AgentEnsemble.cpp +++ b/fboss/agent/test/AgentEnsemble.cpp @@ -25,8 +25,10 @@ void initFlagDefaults(const std::map& defaults) { int kArgc; char** kArgv; facebook::fboss::PlatformInitFn kPlatformInitFn; +static std::string kInputConfigFile; } // namespace + namespace facebook::fboss { AgentEnsemble::AgentEnsemble(const std::string& configFileName) { configFile_ = configFileName; @@ -83,6 +85,10 @@ void AgentEnsemble::writeConfig(const cfg::SwitchConfig& config) { utilCreateDir(testConfigDir); auto fileName = testConfigDir + configFile_; newAgentConfig.dumpConfig(fileName); + if (kInputConfigFile.empty()) { + // saving the original config file. + kInputConfigFile = FLAGS_config; + } FLAGS_config = fileName; initFlagDefaults(*newAgentConfig.thrift.defaultCommandLineArgs()); } @@ -165,6 +171,13 @@ void AgentEnsemble::enableExactMatch(bcm::BcmConfig& config) { } } +std::string AgentEnsemble::getInputConfigFile() { + if (kInputConfigFile.empty()) { + return FLAGS_config; + } + return kInputConfigFile; +} + void ensembleMain(int argc, char* argv[], PlatformInitFn initPlatform) { kArgc = argc; kArgv = argv; diff --git a/fboss/agent/test/AgentEnsemble.h b/fboss/agent/test/AgentEnsemble.h index 310b3da70feaa..77ebe9052119a 100644 --- a/fboss/agent/test/AgentEnsemble.h +++ b/fboss/agent/test/AgentEnsemble.h @@ -75,6 +75,8 @@ class AgentEnsemble { static void enableExactMatch(bcm::BcmConfig& config); + static std::string getInputConfigFile(); + private: void writeConfig(const cfg::SwitchConfig& config); From 4f4a708697d1ea2754a79d718215c5586104b0ba Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Fri, 3 Feb 2023 10:59:26 -0800 Subject: [PATCH 078/280] rename AgentEnsembleConfigFn to AgentEnsembleSwitchConfigFn Summary: as titled this is because agent ensemble will now allow platform config function as well Reviewed By: msomasundaran Differential Revision: D42953106 Privacy Context Container: L1125642 fbshipit-source-id: 024d3e1fbd6c41c2e7128155220f03a3eb277cef --- .../HwInitAndExitBenchmarkHelper.cpp | 44 +++++++++---------- .../benchmarks/HwRouteScaleBenchmarkHelpers.h | 8 ++-- fboss/agent/test/AgentEnsemble.cpp | 4 +- fboss/agent/test/AgentEnsemble.h | 6 +-- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/fboss/agent/hw/benchmarks/HwInitAndExitBenchmarkHelper.cpp b/fboss/agent/hw/benchmarks/HwInitAndExitBenchmarkHelper.cpp index 3b48d09740727..5eec29677a9c8 100644 --- a/fboss/agent/hw/benchmarks/HwInitAndExitBenchmarkHelper.cpp +++ b/fboss/agent/hw/benchmarks/HwInitAndExitBenchmarkHelper.cpp @@ -149,29 +149,29 @@ void initandExitBenchmarkHelper( folly::BenchmarkSuspender suspender; std::unique_ptr ensemble{}; - AgentEnsembleConfigFn initialConfig = [uplinkSpeed, downlinkSpeed]( - HwSwitch* hwSwitch, - const std::vector& ports) { - auto numUplinks = getUplinksCount(hwSwitch, uplinkSpeed, downlinkSpeed); - if (!numUplinks) { - return utility::oneL3IntfNPortConfig(hwSwitch, ports); - } - /* - * Based on the uplink/downlink speed, use the ConfigFactory to create - * agent config to mimic the production config. For instance, in TH, - * 100Gx10G as config type will create 100G uplinks and 10G downlinks - */ + AgentEnsembleSwitchConfigFn initialConfig = + [uplinkSpeed, downlinkSpeed]( + HwSwitch* hwSwitch, const std::vector& ports) { + auto numUplinks = getUplinksCount(hwSwitch, uplinkSpeed, downlinkSpeed); + if (!numUplinks) { + return utility::oneL3IntfNPortConfig(hwSwitch, ports); + } + /* + * Based on the uplink/downlink speed, use the ConfigFactory to create + * agent config to mimic the production config. For instance, in TH, + * 100Gx10G as config type will create 100G uplinks and 10G downlinks + */ - auto config = utility::createUplinkDownlinkConfig( - hwSwitch, - ports, - numUplinks.value(), - uplinkSpeed, - downlinkSpeed, - hwSwitch->getPlatform()->getAsic()->desiredLoopbackMode()); - utility::addProdFeaturesToConfig(config, hwSwitch); - return config; - }; + auto config = utility::createUplinkDownlinkConfig( + hwSwitch, + ports, + numUplinks.value(), + uplinkSpeed, + downlinkSpeed, + hwSwitch->getPlatform()->getAsic()->desiredLoopbackMode()); + utility::addProdFeaturesToConfig(config, hwSwitch); + return config; + }; suspender.dismiss(); { diff --git a/fboss/agent/hw/benchmarks/HwRouteScaleBenchmarkHelpers.h b/fboss/agent/hw/benchmarks/HwRouteScaleBenchmarkHelpers.h index 746335736f0eb..813fa6b92632e 100644 --- a/fboss/agent/hw/benchmarks/HwRouteScaleBenchmarkHelpers.h +++ b/fboss/agent/hw/benchmarks/HwRouteScaleBenchmarkHelpers.h @@ -38,10 +38,10 @@ namespace facebook::fboss { template void routeAddDelBenchmarker(bool measureAdd) { folly::BenchmarkSuspender suspender; - AgentEnsembleConfigFn initialConfigFn = [](HwSwitch* hwSwitch, - const std::vector& ports) { - return utility::onePortPerInterfaceConfig(hwSwitch, ports); - }; + AgentEnsembleSwitchConfigFn initialConfigFn = + [](HwSwitch* hwSwitch, const std::vector& ports) { + return utility::onePortPerInterfaceConfig(hwSwitch, ports); + }; auto ensemble = createAgentEnsemble(initialConfigFn); ensemble->startAgent(); auto* sw = ensemble->getSw(); diff --git a/fboss/agent/test/AgentEnsemble.cpp b/fboss/agent/test/AgentEnsemble.cpp index 09b1be59eba61..cce8066bf70be 100644 --- a/fboss/agent/test/AgentEnsemble.cpp +++ b/fboss/agent/test/AgentEnsemble.cpp @@ -39,7 +39,7 @@ void AgentEnsemble::setupEnsemble( char** argv, uint32_t hwFeaturesDesired, PlatformInitFn initPlatform, - AgentEnsembleConfigFn initialConfig) { + AgentEnsembleSwitchConfigFn initialConfig) { auto* initializer = agentInitializer(); initializer->createSwitch(argc, argv, hwFeaturesDesired, initPlatform); @@ -185,7 +185,7 @@ void ensembleMain(int argc, char* argv[], PlatformInitFn initPlatform) { } std::unique_ptr createAgentEnsemble( - AgentEnsembleConfigFn initialConfigFn, + AgentEnsembleSwitchConfigFn initialConfigFn, uint32_t featuresDesired) { auto ensemble = std::make_unique(); ensemble->setupEnsemble( diff --git a/fboss/agent/test/AgentEnsemble.h b/fboss/agent/test/AgentEnsemble.h index 77ebe9052119a..87fe56452df87 100644 --- a/fboss/agent/test/AgentEnsemble.h +++ b/fboss/agent/test/AgentEnsemble.h @@ -14,7 +14,7 @@ DECLARE_bool(setup_for_warmboot); namespace facebook::fboss { -using AgentEnsembleConfigFn = std::function< +using AgentEnsembleSwitchConfigFn = std::function< cfg::SwitchConfig(HwSwitch* hwSwitch, const std::vector&)>; class AgentEnsemble { @@ -28,7 +28,7 @@ class AgentEnsemble { char** argv, uint32_t hwFeaturesDesired, PlatformInitFn initPlatform, - AgentEnsembleConfigFn initConfig); + AgentEnsembleSwitchConfigFn initConfig); void startAgent(); @@ -90,7 +90,7 @@ class AgentEnsemble { void ensembleMain(int argc, char* argv[], PlatformInitFn initPlatform); std::unique_ptr createAgentEnsemble( - AgentEnsembleConfigFn initialConfigFn, + AgentEnsembleSwitchConfigFn initialConfigFn, uint32_t featuresDesired = (HwSwitch::FeaturesDesired::PACKET_RX_DESIRED | HwSwitch::FeaturesDesired::LINKSCAN_DESIRED)); From 1cdb8107d03e81a2387ba6dca7f48c75fe1ca4db Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Fri, 3 Feb 2023 11:13:34 -0800 Subject: [PATCH 079/280] Support PMD diagnostics with tajo sdk 1.42.8 Differential Revision: D42969887 fbshipit-source-id: 772d8faddddb503ff1b11c182c624dd57d4167f1 --- fboss/agent/hw/sai/api/LoggingUtil.h | 2 +- fboss/agent/hw/sai/api/PortApi.h | 4 ++-- fboss/agent/hw/sai/api/SaiAttribute.h | 2 +- fboss/agent/hw/sai/api/SaiDefaultAttributeValues.h | 2 +- fboss/agent/hw/sai/api/Traits.h | 2 +- fboss/agent/hw/sai/fake/FakeSaiPort.cpp | 4 ++-- fboss/agent/hw/sai/switch/SaiPortManager.cpp | 4 ++-- fboss/agent/hw/sai/switch/SaiPortManager.h | 2 +- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 6 +++--- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fboss/agent/hw/sai/api/LoggingUtil.h b/fboss/agent/hw/sai/api/LoggingUtil.h index 1a220a2bd9c15..5ba66eced33fd 100644 --- a/fboss/agent/hw/sai/api/LoggingUtil.h +++ b/fboss/agent/hw/sai/api/LoggingUtil.h @@ -255,7 +255,7 @@ struct formatter { } }; -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) // Formatting for sai_port_lane_latch_status_list_t template <> struct formatter { diff --git a/fboss/agent/hw/sai/api/PortApi.h b/fboss/agent/hw/sai/api/PortApi.h index be184d78f4562..77694aee8e087 100644 --- a/fboss/agent/hw/sai/api/PortApi.h +++ b/fboss/agent/hw/sai/api/PortApi.h @@ -247,7 +247,7 @@ struct SaiPortTraits { SAI_PORT_ATTR_QOS_PFC_PRIORITY_TO_QUEUE_MAP, SaiObjectIdT, SaiObjectIdDefault>; -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) using RxSignalDetect = SaiAttribute< EnumType, SAI_PORT_ATTR_RX_SIGNAL_DETECT, @@ -416,7 +416,7 @@ SAI_ATTRIBUTE_NAME(Port, IngressPriorityGroupList) SAI_ATTRIBUTE_NAME(Port, NumberOfIngressPriorityGroups) SAI_ATTRIBUTE_NAME(Port, QosTcToPriorityGroupMap) SAI_ATTRIBUTE_NAME(Port, QosPfcPriorityToQueueMap) -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) SAI_ATTRIBUTE_NAME(Port, RxSignalDetect) SAI_ATTRIBUTE_NAME(Port, RxLockStatus) #endif diff --git a/fboss/agent/hw/sai/api/SaiAttribute.h b/fboss/agent/hw/sai/api/SaiAttribute.h index 139e9824c801e..2de487036e908 100644 --- a/fboss/agent/hw/sai/api/SaiAttribute.h +++ b/fboss/agent/hw/sai/api/SaiAttribute.h @@ -165,7 +165,7 @@ DEFINE_extract(std::vector, s32list); DEFINE_extract(std::vector, qosmap); DEFINE_extract(std::vector, porteyevalues); DEFINE_extract(std::vector, porterror); -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) DEFINE_extract( std::vector, portlanelatchstatuslist); diff --git a/fboss/agent/hw/sai/api/SaiDefaultAttributeValues.h b/fboss/agent/hw/sai/api/SaiDefaultAttributeValues.h index 96ba4e020bc41..c058145a8833d 100644 --- a/fboss/agent/hw/sai/api/SaiDefaultAttributeValues.h +++ b/fboss/agent/hw/sai/api/SaiDefaultAttributeValues.h @@ -121,7 +121,7 @@ struct SaiPortErrStatusDefault { } }; -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) struct SaiPortLaneLatchStatusDefault { sai_port_lane_latch_status_t operator()() const { return sai_port_lane_latch_status_t{0, {false, false}}; diff --git a/fboss/agent/hw/sai/api/Traits.h b/fboss/agent/hw/sai/api/Traits.h index 172a96e226eca..f5c963264d280 100644 --- a/fboss/agent/hw/sai/api/Traits.h +++ b/fboss/agent/hw/sai/api/Traits.h @@ -125,7 +125,7 @@ struct WrappedSaiType> { using value = sai_port_err_status_list_t; }; -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) template <> struct WrappedSaiType> { using value = sai_port_lane_latch_status_list_t; diff --git a/fboss/agent/hw/sai/fake/FakeSaiPort.cpp b/fboss/agent/hw/sai/fake/FakeSaiPort.cpp index 903842e0a0136..7b68f3657ea90 100644 --- a/fboss/agent/hw/sai/fake/FakeSaiPort.cpp +++ b/fboss/agent/hw/sai/fake/FakeSaiPort.cpp @@ -477,7 +477,7 @@ sai_status_t set_port_attribute_fn( .list[j]; } } break; -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) case SAI_PORT_ATTR_RX_SIGNAL_DETECT: { port.portRxSignalDetect.count = static_cast( @@ -735,7 +735,7 @@ sai_status_t get_port_attribute_fn( attr[i].value.porteyevalues.list[j] = port.portEyeValues.list[j]; } break; -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) case SAI_PORT_ATTR_RX_SIGNAL_DETECT: attr[i].value.portlanelatchstatuslist.count = port.portRxSignalDetect.count; diff --git a/fboss/agent/hw/sai/switch/SaiPortManager.cpp b/fboss/agent/hw/sai/switch/SaiPortManager.cpp index 5eb74862c50ac..5230cdd426408 100644 --- a/fboss/agent/hw/sai/switch/SaiPortManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiPortManager.cpp @@ -1094,7 +1094,7 @@ bool SaiPortManager::fecStatsSupported(PortID portId) const { defined(SAI_VERSION_8_2_0_0_DNX_ODP) || \ defined(SAI_VERSION_8_2_0_0_SIM_ODP) || \ defined(TAJO_SDK_VERSION_1_42_4) || defined(SAI_VERSION_9_0_EA_ODP) || \ - defined(SAI_VERSION_9_0_EA_DNX_ODP) + defined(SAI_VERSION_9_0_EA_DNX_ODP) || defined(TAJO_SDK_VERSION_1_42_8) return true; #endif } @@ -1781,7 +1781,7 @@ std::vector SaiPortManager::getPortEyeValues( saiPortId, SaiPortTraits::Attributes::PortEyeValues{}); } -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) std::vector SaiPortManager::getRxSignalDetect( PortSaiId saiPortId, uint8_t numPmdLanes) const { diff --git a/fboss/agent/hw/sai/switch/SaiPortManager.h b/fboss/agent/hw/sai/switch/SaiPortManager.h index c83990f84f4af..81f9eec0c730c 100644 --- a/fboss/agent/hw/sai/switch/SaiPortManager.h +++ b/fboss/agent/hw/sai/switch/SaiPortManager.h @@ -186,7 +186,7 @@ class SaiPortManager { PortSaiId saiPortId) const; std::vector getPortErrStatus( PortSaiId saiPortId) const; -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) std::vector getRxSignalDetect( PortSaiId saiPortId, uint8_t numPmdLanes) const; diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index 8b92d1f0c0230..60698c3d32f0f 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -1274,7 +1274,7 @@ void SaiSwitch::updatePmdInfo( laneStats[laneId] = laneStat; } -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) auto pmdSignalDetect = managerTable_->portManager().getRxSignalDetect( port->adapterKey(), numPmdLanes); for (auto pmd : pmdSignalDetect) { @@ -1398,14 +1398,14 @@ void SaiSwitch::updatePcsInfo( } bool SaiSwitch::rxSignalDetectSupportedInSdk() const { -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) return true; #endif return false; } bool SaiSwitch::rxLockStatusSupportedInSdk() const { -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) return true; #endif return false; From 676ef4dd64775d01c0297deabdb3c374e67c49e4 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 3 Feb 2023 12:00:29 -0800 Subject: [PATCH 080/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fb303/commit/fe085c9684137a229b34d82342f1b6878ecf908a https://github.com/facebook/fbthrift/commit/b41f44e98b42d4051ecb1914ceb077033ae555b2 https://github.com/facebook/folly/commit/78fa9a6c29ff00daf0063bc0d1126797170f328b https://github.com/facebook/proxygen/commit/db79e34cc7c21ec29efdd9447cd26b8a1d33a7e8 https://github.com/facebook/wangle/commit/69e730680a5d96323726ba68195abddc0335285a https://github.com/facebook/watchman/commit/f66a630c32f6becd0c84945d487991723d0aab0e https://github.com/facebookexperimental/edencommon/commit/15a5b3a1c375d61a3585833bef87697e7a6f162a https://github.com/facebookexperimental/rust-shed/commit/45c11c140422c8a69cc3651d38089a453a605a58 https://github.com/facebookincubator/fizz/commit/6d5e6577cc86d97db0340beb05ecded66baec7d5 https://github.com/facebookincubator/katran/commit/b99bdd699344ba373bc2d5b8173b761715350fb8 https://github.com/facebookincubator/mvfst/commit/a610e9349967c83e5081a6bd11dbf0ad401a9a76 https://github.com/facebookincubator/velox/commit/53ac12690becb303cfda38862c25e5596bc229d6 Reviewed By: jailby fbshipit-source-id: 3d0d702c70d42fd12a6dfb11fddc7f1a30c43f5c --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 8de3e3330a7a9..d7d7dfdafe396 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 7e07abbe0ff21797e1ebf901b891ebc243e7c369 +Subproject commit b41f44e98b42d4051ecb1914ceb077033ae555b2 diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index e9e708c2b3970..3a9a425239611 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit ba013d4da0854b57e9646b75c694f6061b4613ae +Subproject commit 78fa9a6c29ff00daf0063bc0d1126797170f328b diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index bad7390dfd795..b4f0722668016 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit b9c48881ea253f1037a5b28161fb74784393d4ba +Subproject commit 69e730680a5d96323726ba68195abddc0335285a From 99726e57e23068076cf8b45611e004c952d9b506 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Fri, 3 Feb 2023 12:48:07 -0800 Subject: [PATCH 081/280] platform config function for agent ensemble Summary: as titled. allow applications to provide platform specific settings which may not exist in config file but overriden by application Reviewed By: msomasundaran Differential Revision: D42953105 Privacy Context Container: L1125642 fbshipit-source-id: 74fc2a43660baa29f1d081b7b44a1b39e90aa850 --- fboss/agent/test/AgentEnsemble.cpp | 18 ++++++++++++++++-- fboss/agent/test/AgentEnsemble.h | 8 +++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/fboss/agent/test/AgentEnsemble.cpp b/fboss/agent/test/AgentEnsemble.cpp index cce8066bf70be..9bb7decc5b133 100644 --- a/fboss/agent/test/AgentEnsemble.cpp +++ b/fboss/agent/test/AgentEnsemble.cpp @@ -39,7 +39,16 @@ void AgentEnsemble::setupEnsemble( char** argv, uint32_t hwFeaturesDesired, PlatformInitFn initPlatform, - AgentEnsembleSwitchConfigFn initialConfig) { + AgentEnsembleSwitchConfigFn initialConfigFn, + AgentEnsemblePlatformConfigFn platformConfigFn) { + if (platformConfigFn) { + auto agentConf = + AgentConfig::fromFile(AgentEnsemble::getInputConfigFile())->thrift; + platformConfigFn(*(agentConf.platform())); + // some platform config may need cold boots. so dump the config before + // creating a switch + writeConfig(agentConf); + } auto* initializer = agentInitializer(); initializer->createSwitch(argc, argv, hwFeaturesDesired, initPlatform); @@ -51,7 +60,7 @@ void AgentEnsemble::setupEnsemble( for (const auto& port : portsByControllingPort) { masterLogicalPortIds_.push_back(port.first); } - initialConfig_ = initialConfig(getHw(), masterLogicalPortIds_); + initialConfig_ = initialConfigFn(getHw(), masterLogicalPortIds_); writeConfig(initialConfig_); // reload the new config getPlatform()->reloadConfig(); @@ -75,6 +84,11 @@ void AgentEnsemble::writeConfig(const cfg::SwitchConfig& config) { auto* initializer = agentInitializer(); auto agentConfig = initializer->sw()->getPlatform()->config()->thrift; agentConfig.sw() = config; + writeConfig(agentConfig); +} + +void AgentEnsemble::writeConfig(const cfg::AgentConfig& agentConfig) { + auto* initializer = agentInitializer(); auto newAgentConfig = AgentConfig( agentConfig, apache::thrift::SimpleJSONSerializer::serialize( diff --git a/fboss/agent/test/AgentEnsemble.h b/fboss/agent/test/AgentEnsemble.h index 87fe56452df87..a890df9107543 100644 --- a/fboss/agent/test/AgentEnsemble.h +++ b/fboss/agent/test/AgentEnsemble.h @@ -2,6 +2,8 @@ #pragma once +#include +#include #include #include #include @@ -16,6 +18,7 @@ namespace facebook::fboss { using AgentEnsembleSwitchConfigFn = std::function< cfg::SwitchConfig(HwSwitch* hwSwitch, const std::vector&)>; +using AgentEnsemblePlatformConfigFn = std::function; class AgentEnsemble { public: @@ -28,7 +31,9 @@ class AgentEnsemble { char** argv, uint32_t hwFeaturesDesired, PlatformInitFn initPlatform, - AgentEnsembleSwitchConfigFn initConfig); + AgentEnsembleSwitchConfigFn initConfig, + AgentEnsemblePlatformConfigFn platformConfig = + AgentEnsemblePlatformConfigFn()); void startAgent(); @@ -79,6 +84,7 @@ class AgentEnsemble { private: void writeConfig(const cfg::SwitchConfig& config); + void writeConfig(const cfg::AgentConfig& config); AgentInitializer agentInitializer_{}; cfg::SwitchConfig initialConfig_; From 271ecbaa0ed72f35f79565fe67740dbf62a45e1f Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Fri, 3 Feb 2023 12:48:07 -0800 Subject: [PATCH 082/280] pulled up teflow stats collection benchmark Summary: as titled. Reviewed By: msomasundaran Differential Revision: D42891401 fbshipit-source-id: 2169f4e8d9b75d743b18a900c94687c87565ebea --- cmake/AgentHwBcmBenchmarks.cmake | 2 +- cmake/AgentHwBenchmarks.cmake | 3 +- .../HwTeFlowStatsCollectionBenchmark.cpp | 50 +++++++++++++------ fboss/agent/hw/test/HwTeFlowTestUtils.cpp | 22 +++++++- fboss/agent/hw/test/HwTeFlowTestUtils.h | 5 ++ fboss/agent/test/AgentEnsemble.cpp | 43 ++++++++++++---- fboss/agent/test/AgentEnsemble.h | 6 ++- 7 files changed, 100 insertions(+), 31 deletions(-) diff --git a/cmake/AgentHwBcmBenchmarks.cmake b/cmake/AgentHwBcmBenchmarks.cmake index 69a15d9b8e6b9..b03a8742afcff 100644 --- a/cmake/AgentHwBcmBenchmarks.cmake +++ b/cmake/AgentHwBcmBenchmarks.cmake @@ -383,7 +383,7 @@ target_link_libraries(bcm_teflow_stats_collection_speed hw_teflow_stats_collection_speed bcm_teflow_utils -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark diff --git a/cmake/AgentHwBenchmarks.cmake b/cmake/AgentHwBenchmarks.cmake index c3caff27ff8f7..a806b9be22d31 100644 --- a/cmake/AgentHwBenchmarks.cmake +++ b/cmake/AgentHwBenchmarks.cmake @@ -199,7 +199,8 @@ add_library(hw_teflow_stats_collection_speed target_link_libraries(hw_teflow_stats_collection_speed config_factory hw_teflow_utils - hw_benchmark_main + agent_ensemble + agent_benchmarks Folly::folly ) diff --git a/fboss/agent/hw/benchmarks/HwTeFlowStatsCollectionBenchmark.cpp b/fboss/agent/hw/benchmarks/HwTeFlowStatsCollectionBenchmark.cpp index acaa1d35cc89b..3a5791f459943 100644 --- a/fboss/agent/hw/benchmarks/HwTeFlowStatsCollectionBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwTeFlowStatsCollectionBenchmark.cpp @@ -11,13 +11,13 @@ #include "fboss/agent/Platform.h" #include "fboss/agent/SwitchStats.h" #include "fboss/agent/hw/test/ConfigFactory.h" -#include "fboss/agent/hw/test/HwSwitchEnsemble.h" -#include "fboss/agent/hw/test/HwSwitchEnsembleFactory.h" #include "fboss/agent/hw/test/HwTeFlowTestUtils.h" #include "fboss/agent/hw/test/HwTestTeFlowUtils.h" #include "fboss/agent/test/EcmpSetupHelper.h" #include "fboss/lib/FunctionCallTimeReporter.h" +#include "fboss/agent/benchmarks/AgentBenchmarks.h" + #include #include #include @@ -37,28 +37,48 @@ BENCHMARK(HwTeFlowStatsCollection) { uint32_t numEntries = FLAGS_teflow_scale_entries; // @lint-ignore CLANGTIDY FLAGS_enable_exact_match = true; + std::unique_ptr ensemble{}; + + AgentEnsembleSwitchConfigFn initialConfigFn = + [](HwSwitch* hwSwitch, const std::vector& ports) { + CHECK_GT(ports.size(), 0); + return utility::onePortPerInterfaceConfig( + hwSwitch, {ports[0], ports[1]}, cfg::PortLoopbackMode::MAC); + }; + + AgentEnsemblePlatformConfigFn platformConfigFn = + [](cfg::PlatformConfig& config) { + if (!(config.chip()->getType() == config.chip()->bcm)) { + return; + } + auto& bcm = *(config.chip()->bcm_ref()); + // enable exact match in platform config + AgentEnsemble::enableExactMatch(bcm); + }; + folly::BenchmarkSuspender suspender; - auto ensemble = createHwEnsemble(HwSwitchEnsemble::getAllFeatures()); - auto hwSwitch = ensemble->getHwSwitch(); - std::vector ports = { - ensemble->masterLogicalPortIds()[0], ensemble->masterLogicalPortIds()[1]}; - CHECK_GT(ports.size(), 0); - auto config = utility::onePortPerInterfaceConfig( - hwSwitch, ports, cfg::PortLoopbackMode::MAC); - ensemble->applyInitialConfig(config); + ensemble = createAgentEnsemble(initialConfigFn, platformConfigFn); + ensemble->startAgent(); + const auto& ports = ensemble->masterLogicalPortIds(); + auto hwSwitch = ensemble->getHw(); auto ecmpHelper = - utility::EcmpSetupAnyNPorts6(ensemble->getProgrammedState(), RouterID(0)); + utility::EcmpSetupAnyNPorts6(ensemble->getSw()->getState(), RouterID(0)); // Setup EM Config - utility::setExactMatchCfg(ensemble.get(), prefixLength); + auto state = ensemble->getSw()->getState(); + utility::setExactMatchCfg(&state, prefixLength); + ensemble->applyNewState(state); // Resolve nextHops + CHECK_GE(ports.size(), 2); ensemble->applyNewState(ecmpHelper.resolveNextHops( - ensemble->getProgrammedState(), {PortDescriptor(ports[0])})); + ensemble->getSw()->getState(), {PortDescriptor(ports[0])})); ensemble->applyNewState(ecmpHelper.resolveNextHops( - ensemble->getProgrammedState(), {PortDescriptor(ports[1])})); + ensemble->getSw()->getState(), {PortDescriptor(ports[1])})); // Add Entries auto flowEntries = utility::makeFlowEntries( "100", nextHopAddr, ifName, ports[0], numEntries); - utility::addFlowEntries(ensemble.get(), flowEntries); + state = ensemble->getSw()->getState(); + utility::addFlowEntries(&state, flowEntries); + ensemble->applyNewState(state, true /* rollback on fail */); CHECK_EQ(utility::getNumTeFlowEntries(hwSwitch), numEntries); // Measure stats collection time for 9K entries SwitchStats dummy; diff --git a/fboss/agent/hw/test/HwTeFlowTestUtils.cpp b/fboss/agent/hw/test/HwTeFlowTestUtils.cpp index 4a16bcb9a9043..d20df442cd0e1 100644 --- a/fboss/agent/hw/test/HwTeFlowTestUtils.cpp +++ b/fboss/agent/hw/test/HwTeFlowTestUtils.cpp @@ -19,15 +19,24 @@ using folly::IPAddress; using folly::StringPiece; void setExactMatchCfg(HwSwitchEnsemble* hwSwitchEnsemble, int prefixLength) { + auto newState = hwSwitchEnsemble->getProgrammedState(); + setExactMatchCfg(&newState, prefixLength); + hwSwitchEnsemble->applyNewState(newState); +} + +void setExactMatchCfg(std::shared_ptr* state, int prefixLength) { cfg::ExactMatchTableConfig exactMatchTableConfigs; std::string teFlowTableName(cfg::switch_config_constants::TeFlowTableName()); exactMatchTableConfigs.name() = teFlowTableName; exactMatchTableConfigs.dstPrefixLength() = prefixLength; - auto newState = hwSwitchEnsemble->getProgrammedState()->clone(); + auto newState = *state; + if (newState->isPublished()) { + newState = newState->clone(); + } auto newSwitchSettings = newState->getSwitchSettings()->clone(); newSwitchSettings->setExactMatchTableConfig({exactMatchTableConfigs}); newState->resetSwitchSettings(newSwitchSettings); - hwSwitchEnsemble->applyNewState(newState); + *state = newState; } IpPrefix ipPrefix(StringPiece ip, int length) { @@ -107,6 +116,15 @@ void addFlowEntries( hwEnsemble->applyNewState(state, true); } +void addFlowEntries( + std::shared_ptr* state, + std::vector>& flowEntries) { + auto teFlows = (*state)->getTeFlowTable()->modify(state); + for (auto& flowEntry : flowEntries) { + teFlows->addNode(flowEntry); + } +} + void deleteFlowEntry( HwSwitchEnsemble* hwEnsemble, std::shared_ptr& flowEntry) { diff --git a/fboss/agent/hw/test/HwTeFlowTestUtils.h b/fboss/agent/hw/test/HwTeFlowTestUtils.h index 4c35a8f292fde..d6b131c986099 100644 --- a/fboss/agent/hw/test/HwTeFlowTestUtils.h +++ b/fboss/agent/hw/test/HwTeFlowTestUtils.h @@ -21,6 +21,8 @@ namespace facebook::fboss::utility { void setExactMatchCfg(HwSwitchEnsemble* hwSwitchEnsemble, int prefixLength); +void setExactMatchCfg(std::shared_ptr* state, int prefixLength); + TeFlow makeFlowKey(std::string dstIp, uint16_t srcPort); std::shared_ptr makeFlowEntry( @@ -37,6 +39,9 @@ void addFlowEntry( void addFlowEntries( HwSwitchEnsemble* hwEnsemble, std::vector>& flowEntries); +void addFlowEntries( + std::shared_ptr* state, + std::vector>& flowEntries); void deleteFlowEntry( HwSwitchEnsemble* hwEnsemble, diff --git a/fboss/agent/test/AgentEnsemble.cpp b/fboss/agent/test/AgentEnsemble.cpp index 9bb7decc5b133..6dcc754b7245e 100644 --- a/fboss/agent/test/AgentEnsemble.cpp +++ b/fboss/agent/test/AgentEnsemble.cpp @@ -41,13 +41,17 @@ void AgentEnsemble::setupEnsemble( PlatformInitFn initPlatform, AgentEnsembleSwitchConfigFn initialConfigFn, AgentEnsemblePlatformConfigFn platformConfigFn) { + // to ensure FLAGS_config is set, as this is used in case platform config is + // overriden by the application. + gflags::ParseCommandLineFlags(&argc, &argv, false); + if (platformConfigFn) { auto agentConf = AgentConfig::fromFile(AgentEnsemble::getInputConfigFile())->thrift; platformConfigFn(*(agentConf.platform())); - // some platform config may need cold boots. so dump the config before + // some platform config may need cold boots. so overwrite the config before // creating a switch - writeConfig(agentConf); + writeConfig(agentConf, FLAGS_config); } auto* initializer = agentInitializer(); initializer->createSwitch(argc, argv, hwFeaturesDesired, initPlatform); @@ -89,15 +93,21 @@ void AgentEnsemble::writeConfig(const cfg::SwitchConfig& config) { void AgentEnsemble::writeConfig(const cfg::AgentConfig& agentConfig) { auto* initializer = agentInitializer(); - auto newAgentConfig = AgentConfig( - agentConfig, - apache::thrift::SimpleJSONSerializer::serialize( - agentConfig)); auto testConfigDir = initializer->sw()->getPlatform()->getPersistentStateDir() + "/agent_ensemble/"; utilCreateDir(testConfigDir); auto fileName = testConfigDir + configFile_; + writeConfig(agentConfig, fileName); +} + +void AgentEnsemble::writeConfig( + const cfg::AgentConfig& agentConfig, + const std::string& fileName) { + auto newAgentConfig = AgentConfig( + agentConfig, + apache::thrift::SimpleJSONSerializer::serialize( + agentConfig)); newAgentConfig.dumpConfig(fileName); if (kInputConfigFile.empty()) { // saving the original config file. @@ -165,13 +175,18 @@ void AgentEnsemble::gracefulExit() { } std::shared_ptr AgentEnsemble::applyNewState( - const std::shared_ptr& state) { + const std::shared_ptr& state, + bool transaction) { if (!state) { return getSw()->getState(); } - getSw()->updateStateBlocking( - "apply new state", - [state](const std::shared_ptr&) { return state; }); + transaction + ? getSw()->updateStateWithHwFailureProtection( + "apply new state with failure protection", + [state](const std::shared_ptr&) { return state; }) + : getSw()->updateStateBlocking( + "apply new state", + [state](const std::shared_ptr&) { return state; }); return getSw()->getState(); } @@ -200,10 +215,16 @@ void ensembleMain(int argc, char* argv[], PlatformInitFn initPlatform) { std::unique_ptr createAgentEnsemble( AgentEnsembleSwitchConfigFn initialConfigFn, + AgentEnsemblePlatformConfigFn platformConfigFn, uint32_t featuresDesired) { auto ensemble = std::make_unique(); ensemble->setupEnsemble( - kArgc, kArgv, featuresDesired, kPlatformInitFn, initialConfigFn); + kArgc, + kArgv, + featuresDesired, + kPlatformInitFn, + initialConfigFn, + platformConfigFn); return ensemble; } diff --git a/fboss/agent/test/AgentEnsemble.h b/fboss/agent/test/AgentEnsemble.h index a890df9107543..2c926acc1c2f8 100644 --- a/fboss/agent/test/AgentEnsemble.h +++ b/fboss/agent/test/AgentEnsemble.h @@ -60,7 +60,8 @@ class AgentEnsemble { } std::shared_ptr applyNewState( - const std::shared_ptr& state); + const std::shared_ptr& state, + bool transaction = false); const std::vector& masterLogicalPortIds() const; @@ -85,6 +86,7 @@ class AgentEnsemble { private: void writeConfig(const cfg::SwitchConfig& config); void writeConfig(const cfg::AgentConfig& config); + void writeConfig(const cfg::AgentConfig& config, const std::string& file); AgentInitializer agentInitializer_{}; cfg::SwitchConfig initialConfig_; @@ -97,6 +99,8 @@ void ensembleMain(int argc, char* argv[], PlatformInitFn initPlatform); std::unique_ptr createAgentEnsemble( AgentEnsembleSwitchConfigFn initialConfigFn, + AgentEnsemblePlatformConfigFn platformConfigFn = + AgentEnsemblePlatformConfigFn(), uint32_t featuresDesired = (HwSwitch::FeaturesDesired::PACKET_RX_DESIRED | HwSwitch::FeaturesDesired::LINKSCAN_DESIRED)); From bd58013369e6661e76e442e0dbf6d0ed54509c20 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Fri, 3 Feb 2023 12:48:07 -0800 Subject: [PATCH 083/280] pull up teflow scale add and delete at agent layer Summary: as titled. Reviewed By: msomasundaran Differential Revision: D42893552 fbshipit-source-id: b1289f2feac84ed7a492328eb2fbab5813b45024 --- cmake/AgentHwBcmBenchmarks.cmake | 6 +-- cmake/AgentHwBenchmarks.cmake | 6 ++- .../HwTeFlowScaleBenchmarkHelper.cpp | 52 +++++++++++++------ fboss/agent/hw/test/HwTeFlowTestUtils.cpp | 13 +++-- fboss/agent/hw/test/HwTeFlowTestUtils.h | 3 ++ 5 files changed, 54 insertions(+), 26 deletions(-) diff --git a/cmake/AgentHwBcmBenchmarks.cmake b/cmake/AgentHwBcmBenchmarks.cmake index b03a8742afcff..8a7faccbca915 100644 --- a/cmake/AgentHwBcmBenchmarks.cmake +++ b/cmake/AgentHwBcmBenchmarks.cmake @@ -344,12 +344,11 @@ target_link_libraries(bcm_teflow_scale_add -Wl,--whole-archive bcm config - bcm_switch_ensemble config_factory hw_teflow_scale_add bcm_teflow_utils -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark @@ -361,12 +360,11 @@ target_link_libraries(bcm_teflow_scale_del -Wl,--whole-archive bcm config - bcm_switch_ensemble config_factory hw_teflow_scale_del bcm_teflow_utils -Wl,--no-whole-archive - hw_benchmark_main + bcm_agent_benchmarks_main Folly::folly ${OPENNSA} Folly::follybenchmark diff --git a/cmake/AgentHwBenchmarks.cmake b/cmake/AgentHwBenchmarks.cmake index a806b9be22d31..e319826aaf156 100644 --- a/cmake/AgentHwBenchmarks.cmake +++ b/cmake/AgentHwBenchmarks.cmake @@ -177,7 +177,8 @@ add_library(hw_teflow_scale_add target_link_libraries(hw_teflow_scale_add config_factory hw_teflow_utils - hw_benchmark_main + agent_ensemble + agent_benchmarks Folly::folly ) @@ -188,7 +189,8 @@ add_library(hw_teflow_scale_del target_link_libraries(hw_teflow_scale_del config_factory hw_teflow_utils - hw_benchmark_main + agent_ensemble + agent_benchmarks Folly::folly ) diff --git a/fboss/agent/hw/benchmarks/HwTeFlowScaleBenchmarkHelper.cpp b/fboss/agent/hw/benchmarks/HwTeFlowScaleBenchmarkHelper.cpp index 317f38127fce6..235804ca50050 100644 --- a/fboss/agent/hw/benchmarks/HwTeFlowScaleBenchmarkHelper.cpp +++ b/fboss/agent/hw/benchmarks/HwTeFlowScaleBenchmarkHelper.cpp @@ -11,6 +11,7 @@ #include "fboss/agent/hw/benchmarks/HwTeFlowScaleBenchmarkHelper.h" #include "fboss/agent/Platform.h" #include "fboss/agent/SwitchStats.h" +#include "fboss/agent/benchmarks/AgentBenchmarks.h" #include "fboss/agent/hw/test/ConfigFactory.h" #include "fboss/agent/hw/test/HwSwitchEnsemble.h" #include "fboss/agent/hw/test/HwSwitchEnsembleFactory.h" @@ -37,35 +38,54 @@ void teFlowAddDelEntriesBenchmarkHelper(bool measureAdd) { // @lint-ignore CLANGTIDY FLAGS_enable_exact_match = true; folly::BenchmarkSuspender suspender; - auto ensemble = createHwEnsemble(HwSwitchEnsemble::getAllFeatures()); - auto hwSwitch = ensemble->getHwSwitch(); - std::vector ports = { - ensemble->masterLogicalPortIds()[0], ensemble->masterLogicalPortIds()[1]}; - CHECK_GT(ports.size(), 0); - auto config = utility::onePortPerInterfaceConfig( - hwSwitch, ports, cfg::PortLoopbackMode::MAC); - ensemble->applyInitialConfig(config); - auto ecmpHelper = - utility::EcmpSetupAnyNPorts6(ensemble->getProgrammedState(), RouterID(0)); + + AgentEnsembleSwitchConfigFn initialConfigFn = + [](HwSwitch* hwSwitch, const std::vector& ports) { + CHECK_GT(ports.size(), 0); + return utility::onePortPerInterfaceConfig( + hwSwitch, {ports[0], ports[1]}, cfg::PortLoopbackMode::MAC); + }; + AgentEnsemblePlatformConfigFn platformConfigFn = + [](cfg::PlatformConfig& config) { + if (!(config.chip()->getType() == config.chip()->bcm)) { + return; + } + auto& bcm = *(config.chip()->bcm_ref()); + // enable exact match in platform config + AgentEnsemble::enableExactMatch(bcm); + }; + auto ensemble = createAgentEnsemble(initialConfigFn, platformConfigFn); + ensemble->startAgent(); + auto ports = ensemble->masterLogicalPortIds(); + auto hwSwitch = ensemble->getHw(); + auto state = ensemble->getSw()->getState(); + auto ecmpHelper = utility::EcmpSetupAnyNPorts6(state, RouterID(0)); // Setup EM Config - utility::setExactMatchCfg(ensemble.get(), prefixLength); + utility::setExactMatchCfg(&state, prefixLength); + ensemble->applyNewState(state); // Resolve nextHops + CHECK_GE(ports.size(), 2); ensemble->applyNewState(ecmpHelper.resolveNextHops( - ensemble->getProgrammedState(), {PortDescriptor(ports[0])})); + ensemble->getSw()->getState(), {PortDescriptor(ports[0])})); ensemble->applyNewState(ecmpHelper.resolveNextHops( - ensemble->getProgrammedState(), {PortDescriptor(ports[1])})); + ensemble->getSw()->getState(), {PortDescriptor(ports[1])})); // Add Entries auto flowEntries = makeFlowEntries("100", nextHopAddr, ifName, ports[0], numEntries); if (measureAdd) { + state = ensemble->getSw()->getState(); + utility::addFlowEntries(&state, flowEntries); suspender.dismiss(); - utility::addFlowEntries(ensemble.get(), flowEntries); + state = ensemble->applyNewState(state, true /* rollback on fail */); suspender.rehire(); } else { - utility::addFlowEntries(ensemble.get(), flowEntries); + state = ensemble->getSw()->getState(); + utility::addFlowEntries(&state, flowEntries); + state = ensemble->applyNewState(state, true /* rollback on fail */); CHECK_EQ(utility::getNumTeFlowEntries(hwSwitch), numEntries); + utility::deleteFlowEntries(&state, flowEntries); suspender.dismiss(); - utility::deleteFlowEntries(ensemble.get(), flowEntries); + state = ensemble->applyNewState(state, true /* rollback on fail */); suspender.rehire(); } } diff --git a/fboss/agent/hw/test/HwTeFlowTestUtils.cpp b/fboss/agent/hw/test/HwTeFlowTestUtils.cpp index d20df442cd0e1..60d44824a18e2 100644 --- a/fboss/agent/hw/test/HwTeFlowTestUtils.cpp +++ b/fboss/agent/hw/test/HwTeFlowTestUtils.cpp @@ -138,13 +138,18 @@ void deleteFlowEntry( void deleteFlowEntries( HwSwitchEnsemble* hwEnsemble, std::vector>& flowEntries) { - auto teFlows = hwEnsemble->getProgrammedState()->getTeFlowTable()->clone(); + auto newState = hwEnsemble->getProgrammedState(); + deleteFlowEntries(&newState, flowEntries); + hwEnsemble->applyNewState(newState); +} + +void deleteFlowEntries( + std::shared_ptr* state, + std::vector>& flowEntries) { + auto teFlows = (*state)->getTeFlowTable()->modify(state); for (auto& flowEntry : flowEntries) { teFlows->removeNode(flowEntry); } - auto newState = hwEnsemble->getProgrammedState()->clone(); - newState->resetTeFlowTable(teFlows); - hwEnsemble->applyNewState(newState); } void modifyFlowEntry( diff --git a/fboss/agent/hw/test/HwTeFlowTestUtils.h b/fboss/agent/hw/test/HwTeFlowTestUtils.h index d6b131c986099..d893c6f1c7b9f 100644 --- a/fboss/agent/hw/test/HwTeFlowTestUtils.h +++ b/fboss/agent/hw/test/HwTeFlowTestUtils.h @@ -50,6 +50,9 @@ void deleteFlowEntry( void deleteFlowEntries( HwSwitchEnsemble* hwEnsemble, std::vector>& flowEntries); +void deleteFlowEntries( + std::shared_ptr* state, + std::vector>& flowEntries); void modifyFlowEntry( HwSwitchEnsemble* hwEnsemble, From 8911ebd3123736323a12ffb18a6f663de17aa19d Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Fri, 3 Feb 2023 12:50:03 -0800 Subject: [PATCH 084/280] Get HwInPauseDiscardsTests working on makalu Summary: As titled Differential Revision: D42953609 fbshipit-source-id: a62416f88f02d7adfed4745a20c31b56866dd82b --- .../hw/test/dataplane_tests/HwInPauseDiscardsTests.cpp | 6 +++++- installer/centos-7-x86_64/run_scripts/run_test.py | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwInPauseDiscardsTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwInPauseDiscardsTests.cpp index 0758140eb8383..7983788e9a18b 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwInPauseDiscardsTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwInPauseDiscardsTests.cpp @@ -88,8 +88,12 @@ class HwInPauseDiscardsCounterTest : public HwLinkStateDependentTest { cfg::AsicType::ASIC_TYPE_EBRO ? 0 : 1; + auto expectedDiscardsIncrement = + isSupported(HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS) + ? expectedPktCount + : 0; EXPECT_EQ( - expectedPktCount, + expectedDiscardsIncrement, *portStatsAfter.inDiscardsRaw_() - *portStatsBefore.inDiscardsRaw_()); EXPECT_EQ( expectedPktCount, diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 79cbc97a9c4f4..f003f725f7067 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -42,7 +42,8 @@ # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwJumboFramesTest.* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoopBackTest.* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwL4PortBlackHolingTest.* -# +# Counter tests +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwInPauseDiscardsCounterTest.* # Load Balancer Tests # UCMP support lacking DNX # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV4.*:-*Ucmp*:-*Shrink* From cf1008364c78b0c41c7b5f7ce200e51947d8bd44 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 3 Feb 2023 12:54:02 -0800 Subject: [PATCH 085/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/c219abe11d8a74de5d85d29b0c05988e0316a7f5 https://github.com/facebook/fb303/commit/c189dd03e0c3ae24bd6abea094e114170c386ef7 https://github.com/facebook/fbthrift/commit/f667b8e875a7649fef0e0f6b4a93bfc2989cbc20 https://github.com/facebook/proxygen/commit/669f37e95c237f2bd6ac4d6c18084e5fbff63407 https://github.com/facebook/rocksdb/commit/390cc0b1560decc80ef92306721b549607eaa6e0 https://github.com/facebook/wangle/commit/a7f6ffa1d5cb78020556fa6cfb6f97f68a19f142 https://github.com/facebook/watchman/commit/84b36ea4a17800da80b3f3a08121b4d608ad9882 https://github.com/facebookexperimental/edencommon/commit/3562772a9ad4f711f681762792d6556ab8723116 https://github.com/facebookexperimental/rust-shed/commit/d94e69fa299d1ed7bccc731d252a8596b19bbb0e https://github.com/facebookincubator/fizz/commit/3e377082df8760515ce5324951da93e4bfc3473c https://github.com/facebookincubator/katran/commit/c41a0f53d0c05398cb21a5fc2b455f8936982999 https://github.com/facebookincubator/mvfst/commit/e7b0542215f33ad9436b43e58236c91e87e576f4 https://github.com/facebookincubator/velox/commit/9b5088ab7b3bfa9db132e3357fec5240966070c6 Reviewed By: jailby fbshipit-source-id: db28993a9029ee09b21a82812eda08dfa4a5ad41 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index d7d7dfdafe396..0a9a34ec252fa 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit b41f44e98b42d4051ecb1914ceb077033ae555b2 +Subproject commit f667b8e875a7649fef0e0f6b4a93bfc2989cbc20 diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index b4f0722668016..6c3080a874e23 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 69e730680a5d96323726ba68195abddc0335285a +Subproject commit a7f6ffa1d5cb78020556fa6cfb6f97f68a19f142 From 7a9c11ace2828b4ba1798e5b52f040423d6919fe Mon Sep 17 00:00:00 2001 From: Ron He Date: Fri, 3 Feb 2023 13:58:43 -0800 Subject: [PATCH 086/280] Handle not implemented error in sai_get_object_count Summary: As titled. DNX objects such as system port will return `SAI_STATUS_NOT_SUPPORTED` starting 9.0. In both cases of not supported and not implemented, return count zero for get object count. Reviewed By: simuthus-fb Differential Revision: D43001629 Privacy Context Container: L1125642 fbshipit-source-id: 5a7e1f86a56e65b7171e381e0615ba85c8cd1dee --- fboss/agent/hw/sai/api/SaiObjectApi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fboss/agent/hw/sai/api/SaiObjectApi.h b/fboss/agent/hw/sai/api/SaiObjectApi.h index 92143be2f3309..43e0917c08b0b 100644 --- a/fboss/agent/hw/sai/api/SaiObjectApi.h +++ b/fboss/agent/hw/sai/api/SaiObjectApi.h @@ -52,7 +52,8 @@ uint32_t getObjectCount(sai_object_id_t switch_id) { sai_status_t status = sai_get_object_count(switch_id, SaiObjectTraits::ObjectType, &count); // For objects that are not supported yet by SAI SDK, return count 0. - if (status == SAI_STATUS_NOT_IMPLEMENTED) { + if (status == SAI_STATUS_NOT_IMPLEMENTED || + status == SAI_STATUS_NOT_SUPPORTED) { return 0; } saiCheckError( From 627c87492ba800ed748453a53b869f3be1321aae Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Fri, 3 Feb 2023 15:23:12 -0800 Subject: [PATCH 087/280] enable src port qualifier for tajo sdk > 1.58.0 Summary: As titled, enable src port qualifier for tajo SDK > 1.58.0. This diff should not affect any of the existing 1.42.1 or 1.42.8 SDK. I will run a Sflow or MPLS tests (which leverages src port as a qualifier on 1.58) and follow up on the failures. Reviewed By: nivinl Differential Revision: D42971721 fbshipit-source-id: a3ee26db891f0927feb42e67c45d22cac1b70a58 --- .../hw/sai/switch/SaiAclTableManager.cpp | 13 ++++++++++++- fboss/agent/hw/switch_asics/EbroAsic.cpp | 2 +- .../hw/test/dataplane_tests/HwMPLSTests.cpp | 19 +++++++++++++++---- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/fboss/agent/hw/sai/switch/SaiAclTableManager.cpp b/fboss/agent/hw/sai/switch/SaiAclTableManager.cpp index 9d306e6b2aeb6..ad4d31bf1beb8 100644 --- a/fboss/agent/hw/sai/switch/SaiAclTableManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiAclTableManager.cpp @@ -917,8 +917,16 @@ AclEntrySaiId SaiAclTableManager::addAclEntry( fieldNeighborDstUserMeta.has_value() || platform_->getAsic()->isSupported(HwAsic::Feature::EMPTY_ACL_MATCHER)); if (fieldSrcPort.has_value()) { - matcherIsValid &= platform_->getAsic()->isSupported( + auto srcPortQualifierSupported = platform_->getAsic()->isSupported( HwAsic::Feature::SAI_ACL_ENTRY_SRC_PORT_QUALIFIER); + bool isTajo = platform_->getAsic()->getAsicVendor() == + HwAsic::AsicVendor::ASIC_VENDOR_TAJO; + if (isTajo) { +#if !defined(TAJO_SDK_VERSION_1_58_0) && !defined(TAJO_SDK_VERSION_1_60_0) + srcPortQualifierSupported = false; +#endif + } + matcherIsValid &= srcPortQualifierSupported; } auto actionIsValid = (aclActionPacketAction.has_value() || aclActionCounter.has_value() || @@ -1173,6 +1181,9 @@ std::set SaiAclTableManager::getSupportedQualifierSet() cfg::AclTableQualifier::LOOKUP_CLASS_NEIGHBOR, cfg::AclTableQualifier::LOOKUP_CLASS_ROUTE}; +#if defined(TAJO_SDK_VERSION_1_58_0) || defined(TAJO_SDK_VERSION_1_60_0) + tajoQualifiers.insert(cfg::AclTableQualifier::SRC_PORT); +#endif return tajoQualifiers; } else if (isIndus) { // TODO(skhare) diff --git a/fboss/agent/hw/switch_asics/EbroAsic.cpp b/fboss/agent/hw/switch_asics/EbroAsic.cpp index 394437e0844b7..6fc1658d3084f 100644 --- a/fboss/agent/hw/switch_asics/EbroAsic.cpp +++ b/fboss/agent/hw/switch_asics/EbroAsic.cpp @@ -63,6 +63,7 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::P4_WARMBOOT: case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: + case HwAsic::Feature::SAI_ACL_ENTRY_SRC_PORT_QUALIFIER: return true; // VOQ vs NPU mode dependent features case HwAsic::Feature::BRIDGE_PORT_8021Q: @@ -94,7 +95,6 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::EGRESS_MIRRORING: case HwAsic::Feature::EGRESS_SFLOW: case HwAsic::Feature::SAI_LAG_HASH: - case HwAsic::Feature::SAI_ACL_ENTRY_SRC_PORT_QUALIFIER: case HwAsic::Feature::MACSEC: case HwAsic::Feature::SAI_HASH_FIELDS_CLEAR_BEFORE_SET: case HwAsic::Feature::SAI_MPLS_QOS: diff --git a/fboss/agent/hw/test/dataplane_tests/HwMPLSTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwMPLSTests.cpp index 52dd07af79547..82d555cb21558 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwMPLSTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwMPLSTests.cpp @@ -45,10 +45,22 @@ namespace facebook::fboss { template class HwMPLSTest : public HwLinkStateDependentTest { struct HwPacketVerifier { + bool isSrcPortQualifierSupported() { + auto srcPortQualifierSupported = + ensemble_->getPlatform()->getAsic()->isSupported( + HwAsic::Feature::SAI_ACL_ENTRY_SRC_PORT_QUALIFIER); + bool isTajo = ensemble_->getPlatform()->getAsic()->getAsicVendor() == + HwAsic::AsicVendor::ASIC_VENDOR_TAJO; + if (isTajo) { +#if !defined(TAJO_SDK_VERSION_1_58_0) && !defined(TAJO_SDK_VERSION_1_60_0) + srcPortQualifierSupported = false; +#endif + } + return srcPortQualifierSupported; + } HwPacketVerifier(HwSwitchEnsemble* ensemble, PortID port, MPLSHdr hdr) : ensemble_(ensemble), entry_{}, snooper_{}, expectedHdr_(hdr) { - if (!ensemble->getPlatform()->getAsic()->isSupported( - HwAsic::Feature::SAI_ACL_ENTRY_SRC_PORT_QUALIFIER)) { + if (!isSrcPortQualifierSupported()) { return; } // capture packet exiting port (entering back due to loopback) @@ -58,8 +70,7 @@ class HwMPLSTest : public HwLinkStateDependentTest { } ~HwPacketVerifier() { - if (!ensemble_->getPlatform()->getAsic()->isSupported( - HwAsic::Feature::SAI_ACL_ENTRY_SRC_PORT_QUALIFIER)) { + if (!isSrcPortQualifierSupported()) { return; } auto pkt = snooper_->waitForPacket(10); From 87ac44c350bfe0c25c01b7872bb519b050c5a8a4 Mon Sep 17 00:00:00 2001 From: Rajan Kumar Date: Fri, 3 Feb 2023 17:36:42 -0800 Subject: [PATCH 088/280] Make wedge_qsfp_util --batch_ops command work Summary: Somehow the batch_ops command had stopped working. This diff fixes it Reviewed By: harshitgulati18 Differential Revision: D42974151 Privacy Context Container: L1158612 fbshipit-source-id: 2be35bedd137cef9b94779d8aa484a7c28ad34b5 --- fboss/util/qsfp_util_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fboss/util/qsfp_util_main.cpp b/fboss/util/qsfp_util_main.cpp index 4be1bef6d4546..45b4090e4c188 100644 --- a/fboss/util/qsfp_util_main.cpp +++ b/fboss/util/qsfp_util_main.cpp @@ -169,7 +169,7 @@ int main(int argc, char* argv[]) { FLAGS_update_module_firmware || FLAGS_get_module_fw_info || FLAGS_app_sel || FLAGS_cdb_command || FLAGS_update_bulk_module_fw || FLAGS_vdm_info || FLAGS_prbs_start || FLAGS_prbs_stop || - FLAGS_prbs_stats || FLAGS_module_io_stats); + FLAGS_prbs_stats || FLAGS_module_io_stats || FLAGS_batch_ops); if (FLAGS_direct_i2c || !printInfo) { try { From 7898c14839e3afb914f60b97b8201cbb0ee5d2de Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Fri, 3 Feb 2023 21:26:41 -0800 Subject: [PATCH 089/280] Compute max cores from config dsfNode config + hack for HwTests Summary: We were hard coding the max cores information in our code to [10, 20] * numAsicCores. However we should really be pulling this out from DsfNodes map from config, since that's the authoritative source of DSF topology. I had to add a hack for HwTest - multipleDsfNode, since the sai test config template has only a single dsf node config. Will figure out a way to get this info to init with HwTests Differential Revision: D43015564 Privacy Context Container: L1125642 fbshipit-source-id: f7e0f3f5de6cdd3aafaaef165e9016f85f51ef2f --- fboss/agent/platforms/sai/SaiPlatform.cpp | 38 +++++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/fboss/agent/platforms/sai/SaiPlatform.cpp b/fboss/agent/platforms/sai/SaiPlatform.cpp index b1a0d2f14a288..ec6efcd01c53a 100644 --- a/fboss/agent/platforms/sai/SaiPlatform.cpp +++ b/fboss/agent/platforms/sai/SaiPlatform.cpp @@ -13,7 +13,9 @@ #include "fboss/agent/SwSwitch.h" #include "fboss/agent/hw/HwSwitchWarmBootHelper.h" #include "fboss/agent/hw/sai/switch/SaiSwitch.h" +#include "fboss/agent/hw/switch_asics/EbroAsic.h" #include "fboss/agent/hw/switch_asics/HwAsic.h" +#include "fboss/agent/hw/switch_asics/IndusAsic.h" #include "fboss/agent/platforms/sai/SaiBcmDarwinPlatformPort.h" #include "fboss/agent/platforms/sai/SaiBcmElbertPlatformPort.h" #include "fboss/agent/platforms/sai/SaiBcmFujiPlatformPort.h" @@ -349,16 +351,32 @@ SaiSwitchTraits::CreateAttributes SaiPlatform::getSwitchAttributes( : SAI_SWITCH_TYPE_FABRIC; switchId = swId; if (swType == cfg::SwitchType::VOQ) { - // TODO - compute this information from config. Note that - // the this computation assumes symmetric deployment, - // viz all VOQ switch nodes are the HW type and thus - // have the same number of cores as this VOQ switches. - // For a mixed HW deployment, update config to reflect - // ASIC type to switch mapping, then use that information - // to compute total cores in VOQ switch cluster. - cores = getAsic()->getAsicType() == cfg::AsicType::ASIC_TYPE_EBRO - ? 10 - : 20 * getAsic()->getNumCores(); + auto agentCfg = config(); + CHECK(agentCfg) << " agent config must be set "; + uint32_t systemCores = 0; + const IndusAsic indus(cfg::SwitchType::VOQ, 0, std::nullopt); + const EbroAsic ebro(cfg::SwitchType::VOQ, 0, std::nullopt); + for (const auto& [id, dsfNode] : *agentCfg->thrift.sw()->dsfNodes()) { + if (dsfNode.type() != cfg::DsfNodeType::INTERFACE_NODE) { + continue; + } + switch (*dsfNode.asicType()) { + case cfg::AsicType::ASIC_TYPE_INDUS: + systemCores += indus.getNumCores(); + break; + case cfg::AsicType::ASIC_TYPE_EBRO: + systemCores += ebro.getNumCores(); + break; + default: + throw FbossError("Unexpected asic type: ", *dsfNode.asicType()); + } + } + // FIXME: for some HwTest we create multiple DsfNode config + // as part of the test. This though is done post init and + // does not get factored in MaxSystemCores setting here. + // Fix this by percolating this information to init. + uint32_t minCores = 2 * getAsic()->getNumCores(); + cores = std::max(minCores, systemCores); sysPortConfigs = SaiSwitchTraits::Attributes::SysPortConfigList{ getInternalSystemPortConfig()}; } From 259a9bab44a178190d43680a4946e8dcfb11316e Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Fri, 3 Feb 2023 21:26:41 -0800 Subject: [PATCH 090/280] Add dsf nodes member in HwSwitchEnsembleInitInfo to allow overrides Summary: DsfNodes map gets looked at during switch create for computing max system cores. In prod config we have this as part of agent config. However in tests we will vary DsfNodes map based on the type of test. So allow for overrides in tests Differential Revision: D43016742 Privacy Context Container: L1125642 fbshipit-source-id: b0658b25fd78b3ed9b2e5e5d2eae3420bb0a1363 --- fboss/agent/hw/test/HwSwitchEnsemble.h | 1 + 1 file changed, 1 insertion(+) diff --git a/fboss/agent/hw/test/HwSwitchEnsemble.h b/fboss/agent/hw/test/HwSwitchEnsemble.h index dffa7a205798c..831b2fc73ea57 100644 --- a/fboss/agent/hw/test/HwSwitchEnsemble.h +++ b/fboss/agent/hw/test/HwSwitchEnsemble.h @@ -77,6 +77,7 @@ class HwSwitchEnsemble : public HwSwitch::Callback { void stopObservers(); struct HwSwitchEnsembleInitInfo { std::optional overrideTransceiverInfo; + std::optional> dsfNodes; }; enum Feature : uint32_t { PACKET_RX, From 487eef22d33b4f3d5de6bce34af1dc82f3fc6607 Mon Sep 17 00:00:00 2001 From: Siva Muthusamy Date: Sat, 4 Feb 2023 07:17:45 -0800 Subject: [PATCH 091/280] Update the stable commit hashes to latest Summary: Update the stable commit hashes to latest Differential Revision: D43018700 fbshipit-source-id: 30e44b5acae2cc24e8ea9dd5f528237d614f3c28 --- .../github_hashes_02032023_173642.tar.gz | Bin 0 -> 622 bytes fboss/stable_commits/latest_stable_hashes.tar.gz | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 fboss/stable_commits/github_hashes_02032023_173642.tar.gz diff --git a/fboss/stable_commits/github_hashes_02032023_173642.tar.gz b/fboss/stable_commits/github_hashes_02032023_173642.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..bf59fb516295e87002702d736df2d7f348705848 GIT binary patch literal 622 zcmV-!0+Ib6iwFS!%iUuD1MS&cjuJr>24J4ug9$D`J#{@*>u>?4t^>+UPoVKKiHVDG zp%$YLCWO!+lnMUd1A&HwCV&5@yXd%GuJYU2RZ+vn%)YnhuU`K6wtFqKe%}7uOlZkQ zncd@z1SwXtxw-Cc{j%MRVLhKu_*_|UuD?6I#pnEUdE8v@AUHjLp`=CrJ^YdX-Ev%P zs^Nnn9%&jVZZ;5 zL()1aL$MZ0(j*d*9m^Pv@R1B96I{^f|1Fr(e?_Wy|J(H<`rpHT|C4Y&XHu>EDio<> zwjq{4UKi08X52PATPmafw_r;D$HjVC$MZ+P>HQbPg#P!i-~VbYM^_x1z*hTODix|W z>flwZNqXl~OcK}sH(^5mht=w9@ALoeZy@x)gZ=)qtHB4`ie4*G4(-9Jm?#S&EqiWP z098pB(f?a;y#JrW!`-U<%>X!~|3;zzUF`QiaJ97tkxgpL{#_Qv);14nwAHuwToAqr zEz$p5aJ2u+hqR4h9M{O@6Z{;Q&x z$;n(DTQb6=VwBY0h}>3yMYlDe(yS8ZKL7v#0000000000000000000006=d)0Ud03 IasW^O0BiL`dH?_b literal 0 HcmV?d00001 diff --git a/fboss/stable_commits/latest_stable_hashes.tar.gz b/fboss/stable_commits/latest_stable_hashes.tar.gz index d5ad281bde094..3e71d0b030dd1 120000 --- a/fboss/stable_commits/latest_stable_hashes.tar.gz +++ b/fboss/stable_commits/latest_stable_hashes.tar.gz @@ -1 +1 @@ -github_hashes_02012023_170524.tar.gz \ No newline at end of file +github_hashes_02032023_173642.tar.gz \ No newline at end of file From f7685cb51507b0914a93938ff843585e2f931c3f Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Sat, 4 Feb 2023 09:15:53 -0800 Subject: [PATCH 092/280] Read PMD diagnostics on Ebro ASIC Reviewed By: rajank7 Differential Revision: D43015974 Privacy Context Container: L1125642 fbshipit-source-id: a06e04d1b73a382239233546d93360543bd402e2 --- fboss/agent/hw/switch_asics/EbroAsic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fboss/agent/hw/switch_asics/EbroAsic.cpp b/fboss/agent/hw/switch_asics/EbroAsic.cpp index 6fc1658d3084f..7e66302433e32 100644 --- a/fboss/agent/hw/switch_asics/EbroAsic.cpp +++ b/fboss/agent/hw/switch_asics/EbroAsic.cpp @@ -64,6 +64,8 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::P4_WARMBOOT: case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: case HwAsic::Feature::SAI_ACL_ENTRY_SRC_PORT_QUALIFIER: + case HwAsic::Feature::PMD_RX_LOCK_STATUS: + case HwAsic::Feature::PMD_RX_SIGNAL_DETECT: return true; // VOQ vs NPU mode dependent features case HwAsic::Feature::BRIDGE_PORT_8021Q: @@ -107,8 +109,6 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::PORT_EYE_VALUES: case HwAsic::Feature::SAI_MPLS_TTL_1_TRAP: case HwAsic::Feature::SAI_MPLS_LABEL_LOOKUP_FAIL_COUNTER: - case HwAsic::Feature::PMD_RX_LOCK_STATUS: - case HwAsic::Feature::PMD_RX_SIGNAL_DETECT: case HwAsic::Feature::SAI_PORT_ERR_STATUS: case HwAsic::Feature::EXACT_MATCH: case HwAsic::Feature::FEC_CORRECTED_BITS: From 99c826147cec028561b80b073e794c5071842f6d Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Sat, 4 Feb 2023 09:15:53 -0800 Subject: [PATCH 093/280] Added support for reading PCS and FEC Lane diagnostics with SAI Summary: as titled. Added support for reading the SAI_PORT_ATTR_FEC_ALIGNMENT_LOCK and SAI_PORT_ATTR_PCS_RX_LINK_STATUS SAI attributes Reviewed By: rajank7 Differential Revision: D43015975 Privacy Context Container: L1125642 fbshipit-source-id: ef148ab34ac413f4b87667774b4816819c275cc3 --- fboss/agent/hw/sai/api/LoggingUtil.h | 18 +++++++++++ fboss/agent/hw/sai/api/PortApi.h | 10 +++++++ fboss/agent/hw/sai/api/SaiAttribute.h | 1 + .../hw/sai/api/SaiDefaultAttributeValues.h | 6 ++++ fboss/agent/hw/sai/api/Traits.h | 5 ++++ fboss/agent/hw/sai/fake/FakeSaiPort.cpp | 30 +++++++++++++++++++ fboss/agent/hw/sai/fake/FakeSaiPort.h | 2 ++ 7 files changed, 72 insertions(+) diff --git a/fboss/agent/hw/sai/api/LoggingUtil.h b/fboss/agent/hw/sai/api/LoggingUtil.h index 5ba66eced33fd..d0d63dd02459e 100644 --- a/fboss/agent/hw/sai/api/LoggingUtil.h +++ b/fboss/agent/hw/sai/api/LoggingUtil.h @@ -277,6 +277,24 @@ struct formatter { latchStatus.value.changed); } }; + +// Formatting for sai_latch_status_t +template <> +struct formatter { + template + constexpr auto parse(ParseContext& ctx) { + return ctx.begin(); + } + + template + auto format(const sai_latch_status_t& latchStatus, FormatContext& ctx) { + return format_to( + ctx.out(), + "latch_status.current_status: {}, latch_status.changed: {}", + latchStatus.current_status, + latchStatus.changed); + } +}; #endif // Formatting for AclEntryField diff --git a/fboss/agent/hw/sai/api/PortApi.h b/fboss/agent/hw/sai/api/PortApi.h index 77694aee8e087..3cc1812b0d615 100644 --- a/fboss/agent/hw/sai/api/PortApi.h +++ b/fboss/agent/hw/sai/api/PortApi.h @@ -256,6 +256,14 @@ struct SaiPortTraits { EnumType, SAI_PORT_ATTR_RX_LOCK_STATUS, std::vector>; + using FecAlignmentLock = SaiAttribute< + EnumType, + SAI_PORT_ATTR_FEC_ALIGNMENT_LOCK, + std::vector>; + using PcsRxLinkStatus = SaiAttribute< + EnumType, + SAI_PORT_ATTR_PCS_RX_LINK_STATUS, + sai_latch_status_t>; #endif #if SAI_API_VERSION >= SAI_VERSION(1, 9, 0) using InterFrameGap = SaiAttribute< @@ -419,6 +427,8 @@ SAI_ATTRIBUTE_NAME(Port, QosPfcPriorityToQueueMap) #if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) SAI_ATTRIBUTE_NAME(Port, RxSignalDetect) SAI_ATTRIBUTE_NAME(Port, RxLockStatus) +SAI_ATTRIBUTE_NAME(Port, FecAlignmentLock) +SAI_ATTRIBUTE_NAME(Port, PcsRxLinkStatus) #endif #if SAI_API_VERSION >= SAI_VERSION(1, 9, 0) SAI_ATTRIBUTE_NAME(Port, InterFrameGap) diff --git a/fboss/agent/hw/sai/api/SaiAttribute.h b/fboss/agent/hw/sai/api/SaiAttribute.h index 2de487036e908..c6f2235f97cd7 100644 --- a/fboss/agent/hw/sai/api/SaiAttribute.h +++ b/fboss/agent/hw/sai/api/SaiAttribute.h @@ -169,6 +169,7 @@ DEFINE_extract(std::vector, porterror); DEFINE_extract( std::vector, portlanelatchstatuslist); +DEFINE_extract(sai_latch_status_t, latchstatus); #endif DEFINE_extract(facebook::fboss::AclEntryFieldU8, aclfield); DEFINE_extract(facebook::fboss::AclEntryFieldU16, aclfield); diff --git a/fboss/agent/hw/sai/api/SaiDefaultAttributeValues.h b/fboss/agent/hw/sai/api/SaiDefaultAttributeValues.h index c058145a8833d..449bc4937e242 100644 --- a/fboss/agent/hw/sai/api/SaiDefaultAttributeValues.h +++ b/fboss/agent/hw/sai/api/SaiDefaultAttributeValues.h @@ -127,6 +127,12 @@ struct SaiPortLaneLatchStatusDefault { return sai_port_lane_latch_status_t{0, {false, false}}; } }; + +struct SaiLatchStatusDefault { + sai_latch_status_t operator()() const { + return sai_latch_status_t(); + } +}; #endif #if SAI_API_VERSION >= SAI_VERSION(1, 8, 1) diff --git a/fboss/agent/hw/sai/api/Traits.h b/fboss/agent/hw/sai/api/Traits.h index f5c963264d280..9cf0c4827dc67 100644 --- a/fboss/agent/hw/sai/api/Traits.h +++ b/fboss/agent/hw/sai/api/Traits.h @@ -130,6 +130,11 @@ template <> struct WrappedSaiType> { using value = sai_port_lane_latch_status_list_t; }; + +template <> +struct WrappedSaiType { + using value = sai_latch_status_t; +}; #endif template <> diff --git a/fboss/agent/hw/sai/fake/FakeSaiPort.cpp b/fboss/agent/hw/sai/fake/FakeSaiPort.cpp index 7b68f3657ea90..928bdb8d60dd6 100644 --- a/fboss/agent/hw/sai/fake/FakeSaiPort.cpp +++ b/fboss/agent/hw/sai/fake/FakeSaiPort.cpp @@ -508,6 +508,25 @@ sai_status_t set_port_attribute_fn( .list[j]; } } break; + case SAI_PORT_ATTR_FEC_ALIGNMENT_LOCK: { + port.portFecAlignmentLockStatus.count = + static_cast( + attr->value.portlanelatchstatuslist) + .count; + auto& fecAMLockStatusList = port.portFecAlignmentLockStatus.list; + auto fecAMLockStatusVector = std::vector(); + fecAMLockStatusVector.resize(port.portFecAlignmentLockStatus.count); + fecAMLockStatusList = fecAMLockStatusVector.data(); + for (int j = 0; j < port.portFecAlignmentLockStatus.count; j++) { + fecAMLockStatusList[j] = static_cast( + attr->value.portlanelatchstatuslist) + .list[j]; + } + } break; + case SAI_PORT_ATTR_PCS_RX_LINK_STATUS: { + port.portPcsLinkStatus = static_cast( + attr->value.latchstatus); + } break; #endif case SAI_PORT_ATTR_ERR_STATUS_LIST: { port.portError.count = @@ -752,6 +771,17 @@ sai_status_t get_port_attribute_fn( port.portRxLockStatus.list[j]; } break; + case SAI_PORT_ATTR_FEC_ALIGNMENT_LOCK: + attr[i].value.portlanelatchstatuslist.count = + port.portFecAlignmentLockStatus.count; + for (int j = 0; j < port.portFecAlignmentLockStatus.count; j++) { + attr[i].value.portlanelatchstatuslist.list[j] = + port.portFecAlignmentLockStatus.list[j]; + } + break; + case SAI_PORT_ATTR_PCS_RX_LINK_STATUS: + attr[i].value.latchstatus = port.portPcsLinkStatus; + break; #endif case SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL_MODE: attr[i].value.u32 = static_cast(port.priorityFlowControlMode); diff --git a/fboss/agent/hw/sai/fake/FakeSaiPort.h b/fboss/agent/hw/sai/fake/FakeSaiPort.h index 5c3ac3760b9b4..a6b099b444f3d 100644 --- a/fboss/agent/hw/sai/fake/FakeSaiPort.h +++ b/fboss/agent/hw/sai/fake/FakeSaiPort.h @@ -66,6 +66,8 @@ struct FakePort { #if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) sai_port_lane_latch_status_list_t portRxSignalDetect; sai_port_lane_latch_status_list_t portRxLockStatus; + sai_port_lane_latch_status_list_t portFecAlignmentLockStatus; + sai_latch_status_t portPcsLinkStatus; #endif sai_port_priority_flow_control_mode_t priorityFlowControlMode{ SAI_PORT_PRIORITY_FLOW_CONTROL_MODE_COMBINED}; From 8e0b6f58c5c4e1cb85d25695065484eda48a3393 Mon Sep 17 00:00:00 2001 From: Nivin Lawrence Date: Sat, 4 Feb 2023 09:24:37 -0800 Subject: [PATCH 094/280] Add support for shared/headroom watermark stats in SAI Summary: Adding support to get shared/headroom watermark stats for ingress buffer pool. Differential Revision: D42826374 fbshipit-source-id: 3d251114225f52ad86033b9c666089ec92565296 --- fboss/agent/hw/sai/switch/SaiBufferManager.h | 3 +++ fboss/agent/hw/sai/switch/oss/SaiBufferManager.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/fboss/agent/hw/sai/switch/SaiBufferManager.h b/fboss/agent/hw/sai/switch/SaiBufferManager.h index f7564386c5b90..db4e81527596f 100644 --- a/fboss/agent/hw/sai/switch/SaiBufferManager.h +++ b/fboss/agent/hw/sai/switch/SaiBufferManager.h @@ -62,6 +62,9 @@ class SaiBufferManager { private: void publishDeviceWatermark(uint64_t peakBytes) const; + void publishGlobalWatermarks( + const uint64_t& globalHeadroomBytes, + const uint64_t& globalSharedBytes) const; SaiBufferProfileTraits::CreateAttributes profileCreateAttrs( const PortQueue& queue) const; SaiBufferProfileTraits::CreateAttributes ingressProfileCreateAttrs( diff --git a/fboss/agent/hw/sai/switch/oss/SaiBufferManager.cpp b/fboss/agent/hw/sai/switch/oss/SaiBufferManager.cpp index c75ad73d62c47..be0e17c47b6a1 100644 --- a/fboss/agent/hw/sai/switch/oss/SaiBufferManager.cpp +++ b/fboss/agent/hw/sai/switch/oss/SaiBufferManager.cpp @@ -13,4 +13,7 @@ namespace facebook::fboss { void SaiBufferManager::publishDeviceWatermark(uint64_t /*peakBytes*/) const {} +void SaiBufferManager::publishGlobalWatermarks( + const uint64_t& /*globalHeadroomBytes*/, + const uint64_t& /*globalSharedBytes*/) const {}; } // namespace facebook::fboss From 172bf7f9334b464ac043010d7c6c867c7a7818c0 Mon Sep 17 00:00:00 2001 From: Nivin Lawrence Date: Sat, 4 Feb 2023 09:24:37 -0800 Subject: [PATCH 095/280] Poll ingress buffer pool shared/headroom watermark stats in SAI Summary: Adding support to poll shared/headroom watermark stats for ingress buffer pool. Support for headroom watermark is only available in Indus until CS00012274607 is addressed for XGS. Differential Revision: D42826373 fbshipit-source-id: 09976d9858be7dad16df0a90153ff69139ccb06b --- .../agent/hw/sai/switch/SaiBufferManager.cpp | 54 ++++++++++++++++--- fboss/agent/hw/sai/switch/SaiBufferManager.h | 2 + 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/fboss/agent/hw/sai/switch/SaiBufferManager.cpp b/fboss/agent/hw/sai/switch/SaiBufferManager.cpp index 8e586c26c8af9..6a4d6c114a06f 100644 --- a/fboss/agent/hw/sai/switch/SaiBufferManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiBufferManager.cpp @@ -237,16 +237,58 @@ SaiBufferPoolHandle* SaiBufferManager::getEgressBufferPoolHandle() const { : egressBufferPoolHandle_.get(); } -void SaiBufferManager::updateStats() { - auto bufferPoolHandle = getEgressBufferPoolHandle(); - if (bufferPoolHandle) { - bufferPoolHandle->bufferPool->updateStats(); - auto counters = bufferPoolHandle->bufferPool->getStats(); +void SaiBufferManager::updateEgressBufferPoolStats() { + if (!egressBufferPoolHandle_) { + // Applies to platforms with SHARED_INGRESS_EGRESS_BUFFER_POOL, where + // watermarks are polled as part of ingress itself. + return; + } + egressBufferPoolHandle_->bufferPool->updateStats(); + auto counters = egressBufferPoolHandle_->bufferPool->getStats(); + deviceWatermarkBytes_ = counters[SAI_BUFFER_POOL_STAT_WATERMARK_BYTES]; +} + +void SaiBufferManager::updateIngressBufferPoolStats() { + auto ingressBufferPoolHandle = getIngressBufferPoolHandle(); + if (!ingressBufferPoolHandle) { + return; + } + static std::vector counterIdsToReadAndClear; + if (!counterIdsToReadAndClear.size()) { + // TODO: Request for per ITM buffer pool stats in SAI + counterIdsToReadAndClear.push_back(SAI_BUFFER_POOL_STAT_WATERMARK_BYTES); + if (platform_->getAsic()->getAsicType() == cfg::AsicType::ASIC_TYPE_INDUS) { + // TODO: Wait for the fix for CS00012274607 to enable this for all! + counterIdsToReadAndClear.push_back( + SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES); + } + } + ingressBufferPoolHandle->bufferPool->updateStats( + counterIdsToReadAndClear, SAI_STATS_MODE_READ_AND_CLEAR); + auto counters = ingressBufferPoolHandle->bufferPool->getStats(); + auto maxGlobalSharedBytes = counters[SAI_BUFFER_POOL_STAT_WATERMARK_BYTES]; + auto maxGlobalHeadroomBytes = + counters[SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES]; + publishGlobalWatermarks(maxGlobalHeadroomBytes, maxGlobalSharedBytes); + + if (platform_->getAsic()->isSupported( + HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL)) { + /* + * There is only a single buffer pool for these devices and hence the + * same stats needs to be updated as device watermark as well. + */ deviceWatermarkBytes_ = counters[SAI_BUFFER_POOL_STAT_WATERMARK_BYTES]; - publishDeviceWatermark(deviceWatermarkBytes_); } } +void SaiBufferManager::updateStats() { + updateIngressBufferPoolStats(); + updateEgressBufferPoolStats(); + // Device watermarks are collected from ingress for some and egress for + // some other platforms, hence publish it here. + publishDeviceWatermark(deviceWatermarkBytes_); +} + SaiBufferProfileTraits::CreateAttributes SaiBufferManager::profileCreateAttrs( const PortQueue& queue) const { SaiBufferProfileTraits::Attributes::PoolId pool{ diff --git a/fboss/agent/hw/sai/switch/SaiBufferManager.h b/fboss/agent/hw/sai/switch/SaiBufferManager.h index db4e81527596f..047d9ff251b5b 100644 --- a/fboss/agent/hw/sai/switch/SaiBufferManager.h +++ b/fboss/agent/hw/sai/switch/SaiBufferManager.h @@ -51,6 +51,8 @@ class SaiBufferManager { const std::optional ingressPgCfg = std::nullopt); void updateStats(); + void updateIngressBufferPoolStats(); + void updateEgressBufferPoolStats(); void createIngressBufferPool(const std::shared_ptr port); uint64_t getDeviceWatermarkBytes() const { return deviceWatermarkBytes_; From bac182d31991cb3202d31b1ace79795a68ea40be Mon Sep 17 00:00:00 2001 From: Nivin Lawrence Date: Sat, 4 Feb 2023 09:24:37 -0800 Subject: [PATCH 096/280] Move PFC counter get functions outside class Summary: Used in the next set of diffs, to pass the counter get function as param to PFC tests, so that we can use PFC test dependent counters validated as well. Modified the counter collection to use waitPortStatsCondition() instead of the wait loop. Reviewed By: jasmeetbagga Differential Revision: D42949323 fbshipit-source-id: 98429ffcabac15ba16397b79c25cfa05e4592976 --- .../dataplane_tests/HwTrafficPfcTests.cpp | 90 +++++++++++-------- 1 file changed, 52 insertions(+), 38 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwTrafficPfcTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwTrafficPfcTests.cpp index e1fd793fc6e8e..40259ec4d2f25 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwTrafficPfcTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwTrafficPfcTests.cpp @@ -1,6 +1,7 @@ #include "fboss/agent/Platform.h" #include "fboss/agent/hw/test/ConfigFactory.h" #include "fboss/agent/hw/test/HwLinkStateDependentTest.h" +#include "fboss/agent/hw/test/HwTest.h" #include "fboss/agent/hw/test/HwTestPacketUtils.h" #include "fboss/agent/test/EcmpSetupHelper.h" @@ -15,6 +16,51 @@ using folly::IPAddress; using folly::IPAddressV6; using std::string; +namespace { +std::tuple getPfcTxRxXonHwPortStats( + const facebook::fboss::HwPortStats& portStats, + const int pfcPriority) { + return { + portStats.get_outPfc_().at(pfcPriority), + portStats.get_inPfc_().at(pfcPriority), + portStats.get_inPfcXon_().at(pfcPriority)}; +} + +bool getPfcCountersRetry( + facebook::fboss::HwSwitchEnsemble* ensemble, + const facebook::fboss::PortID& portId, + const int pfcPriority) { + int txPfcCtr = 0, rxPfcCtr = 0, rxPfcXonCtr = 0; + + auto pfcCountersIncrementing = [&](const auto& newStats) { + auto portStatsIter = newStats.find(portId); + std::tie(txPfcCtr, rxPfcCtr, rxPfcXonCtr) = + getPfcTxRxXonHwPortStats(portStatsIter->second, pfcPriority); + XLOG(DBG0) << " Port: " << portId << " PFC TX/RX PFC/RX_PFC_XON " + << txPfcCtr << "/" << rxPfcCtr << "/" << rxPfcXonCtr + << ", priority: " << pfcPriority; + if (txPfcCtr > 0 && rxPfcCtr > 0 && rxPfcXonCtr > 0) { + return true; + } + return false; + }; + + return ensemble->waitPortStatsCondition( + pfcCountersIncrementing, 10, std::chrono::milliseconds(500)); +} + +void validatePfcCounters( + facebook::fboss::HwSwitchEnsemble* ensemble, + const int pri, + const std::vector& portIds) { + // no need t retry if looking for baseline counter + for (const auto& portId : portIds) { + EXPECT_TRUE(getPfcCountersRetry(ensemble, portId, pri)); + } +} + +} // namespace + namespace facebook::fboss { class HwTrafficPfcTest : public HwLinkStateDependentTest { @@ -184,13 +230,10 @@ class HwTrafficPfcTest : public HwLinkStateDependentTest { } std::tuple getTxRxXonPfcCounters( - const PortID& portId, + const facebook::fboss::PortID& portId, const int pfcPriority) { - int txPfcCtr = getLatestPortStats(portId).get_outPfc_().at(pfcPriority); - int rxPfcCtr = getLatestPortStats(portId).get_inPfc_().at(pfcPriority); - int rxPfcXonCtr = - getLatestPortStats(portId).get_inPfcXon_().at(pfcPriority); - return {txPfcCtr, rxPfcCtr, rxPfcXonCtr}; + auto portStats = getLatestPortStats(portId); + return getPfcTxRxXonHwPortStats(portStats, pfcPriority); } void validateInitPfcCounters( @@ -210,38 +253,6 @@ class HwTrafficPfcTest : public HwLinkStateDependentTest { } } - bool getPfcCountersRetry(const PortID& portId, const int pfcPriority) { - int txPfcCtr = 0, rxPfcCtr = 0, rxPfcXonCtr = 0; - int retries = 5; - bool countersIncrementing = false; - // retry as long as we can OR we get an expected output - while (retries--) { - // sleep for a bit before checking counters - std::this_thread::sleep_for(std::chrono::seconds(1)); - std::tie(txPfcCtr, rxPfcCtr, rxPfcXonCtr) = - getTxRxXonPfcCounters(portId, pfcPriority); - if (txPfcCtr > 0 && rxPfcCtr > 0 && rxPfcXonCtr > 0) { - // there is no undoing this state - countersIncrementing = true; - break; - } - }; - XLOG(DBG0) << " Port: " << portId << " PFC TX/RX PFC/RX_PFC_XON " - << txPfcCtr << "/" << rxPfcCtr << "/" << rxPfcXonCtr - << ", priority: " << pfcPriority; - if (countersIncrementing) { - return true; - } - return false; - } - - void validatePfcCounters(const int pri, const std::vector& portIds) { - // no need t retry if looking for baseline counter - for (const auto& portId : portIds) { - EXPECT_TRUE(getPfcCountersRetry(portId, pri)); - } - } - void validateIngressDropCounters(const std::vector& portIds) { for (const auto& portId : portIds) { auto portStats = getHwSwitchEnsemble()->getLatestPortStats(portId); @@ -266,6 +277,7 @@ class HwTrafficPfcTest : public HwLinkStateDependentTest { pumpTraffic(trafficClass); // ensure counter is > 0, after the traffic validatePfcCounters( + getHwSwitchEnsemble(), pfcPriority, {masterLogicalInterfacePortIds()[0], masterLogicalInterfacePortIds()[1]}); @@ -297,6 +309,7 @@ class HwTrafficPfcTest : public HwLinkStateDependentTest { pumpTraffic(trafficClass); // ensure counter is > 0, after the traffic validatePfcCounters( + getHwSwitchEnsemble(), pfcPriority, {masterLogicalInterfacePortIds()[0], masterLogicalInterfacePortIds()[1]}); @@ -331,6 +344,7 @@ class HwTrafficPfcTest : public HwLinkStateDependentTest { pumpTraffic(trafficClass); // ensure counter is > 0, after the traffic validatePfcCounters( + getHwSwitchEnsemble(), pfcPriority, {masterLogicalInterfacePortIds()[0], masterLogicalInterfacePortIds()[1]}); From 44c0378ad1c746bd38ef762f6e00750c1a6c2406 Mon Sep 17 00:00:00 2001 From: Nivin Lawrence Date: Sat, 4 Feb 2023 09:24:37 -0800 Subject: [PATCH 097/280] HwTest to validate buffer pool watermarks Summary: Add a new test to validate buffer pool watermark works. Differential Revision: D42939780 fbshipit-source-id: ea94c9c684025c3b9cf2aad0ea310036b38ae0b9 --- .../dataplane_tests/HwTrafficPfcTests.cpp | 48 +++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwTrafficPfcTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwTrafficPfcTests.cpp index 40259ec4d2f25..229e6f57cfb3a 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwTrafficPfcTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwTrafficPfcTests.cpp @@ -1,4 +1,7 @@ +#include + #include "fboss/agent/Platform.h" +#include "fboss/agent/SwitchStats.h" #include "fboss/agent/hw/test/ConfigFactory.h" #include "fboss/agent/hw/test/HwLinkStateDependentTest.h" #include "fboss/agent/hw/test/HwTest.h" @@ -59,6 +62,30 @@ void validatePfcCounters( } } +void validateBufferPoolWatermarkCounters( + facebook::fboss::HwSwitchEnsemble* ensemble, + const int /* pri */, + const std::vector& /* portIds */) { + int retries = 5; + uint64_t globalSharedWatermarks{}; + while (retries-- && !globalSharedWatermarks) { + // TODO: Migrate to a waitStatsCondition() util + std::this_thread::sleep_for(std::chrono::seconds(1)); + facebook::fboss::SwitchStats dummy; + ensemble->getHwSwitch()->updateStats(&dummy); + auto counters = facebook::fb303::fbData->getRegexCounters( + {"buffer_watermark_global_shared.*.p100.60"}); + for (const auto& ctr : counters) { + if (ctr.second) { + globalSharedWatermarks = ctr.second; + XLOG(DBG0) << ctr.first << " : " << ctr.second; + break; + } + } + } + EXPECT_TRUE(globalSharedWatermarks > 0); +} + } // namespace namespace facebook::fboss { @@ -264,7 +291,14 @@ class HwTrafficPfcTest : public HwLinkStateDependentTest { } protected: - void runTestWithDefaultPfcCfg(const int trafficClass, const int pfcPriority) { + void runTestWithDefaultPfcCfg( + const int trafficClass, + const int pfcPriority, + std::function& portIds)> validateCounterFn = + validatePfcCounters) { auto setup = [&]() { setupConfigAndEcmpTraffic(); validateInitPfcCounters( @@ -275,8 +309,8 @@ class HwTrafficPfcTest : public HwLinkStateDependentTest { auto verify = [&]() { // ensure counter is 0 before we start traffic pumpTraffic(trafficClass); - // ensure counter is > 0, after the traffic - validatePfcCounters( + // check counters are as expected + validateCounterFn( getHwSwitchEnsemble(), pfcPriority, {masterLogicalInterfacePortIds()[0], @@ -496,6 +530,14 @@ TEST_F(HwTrafficPfcTest, verifyPfcDefault) { runTestWithDefaultPfcCfg(trafficClass, pfcPriority); } +TEST_F(HwTrafficPfcTest, verifyBufferPoolWatermarks) { + // default to map dscp to priority = 0 + const int trafficClass = 0; + const int pfcPriority = 0; + runTestWithDefaultPfcCfg( + trafficClass, pfcPriority, validateBufferPoolWatermarkCounters); +} + TEST_F(HwTrafficPfcTest, verifyPfcWithGlobalHeadRoomToZero) { const int trafficClass = 0; const int pfcPriority = 0; From 0f3bea2468e0731976c59d89de846b8be68e63d9 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Sat, 4 Feb 2023 13:15:49 -0800 Subject: [PATCH 098/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/feb1cb7293d074663af3342662077fc82f8873e9 https://github.com/facebook/fb303/commit/c9df8c67e65d7bb74fef9c0d623400a3f7a318aa https://github.com/facebook/fbthrift/commit/2027f8efa95d3f59632243e0da37c1fa3977546e https://github.com/facebook/wangle/commit/f4102cc305c1a40b76afc59af8e7efd26e6a2b91 https://github.com/facebook/watchman/commit/1259a53ac172d68e2c657135fd2064afe214a086 https://github.com/facebookexperimental/rust-shed/commit/d7e305df58752948347adef8ddcf61f3262ca488 https://github.com/facebookincubator/katran/commit/3b0449ed599c2b3f2cd30f32060e79e96ccee85a Reviewed By: jailby fbshipit-source-id: d0adbb356a3170d11333b3a7b71b62b0d4843229 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 0a9a34ec252fa..719512d29dda2 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit f667b8e875a7649fef0e0f6b4a93bfc2989cbc20 +Subproject commit 2027f8efa95d3f59632243e0da37c1fa3977546e diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 6c3080a874e23..8e3f081f28b31 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit a7f6ffa1d5cb78020556fa6cfb6f97f68a19f142 +Subproject commit f4102cc305c1a40b76afc59af8e7efd26e6a2b91 From b53142384cd672fc554d254a1ace7c148f5eaafe Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Sat, 4 Feb 2023 14:03:43 -0800 Subject: [PATCH 099/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/0ab752374fa5d5b916fc1141c4ad78177bd4fab6 https://github.com/facebook/fb303/commit/c785daf09d47f7debb7e96ebc61fa4bc7ab74b36 https://github.com/facebook/fbthrift/commit/ffe39d66d518f5cedb76133e15e48b2d4b446281 https://github.com/facebook/watchman/commit/9b5a2f4ef5b26a2ac73463671a924175db35e3ad https://github.com/facebookexperimental/rust-shed/commit/1a6536dc8a7a01ba969f99085e9b370987af3bc7 Reviewed By: jailby fbshipit-source-id: 9d4388a5a3138e1ccab1cd949febda181449e674 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 719512d29dda2..5c5ad3d8d9627 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 2027f8efa95d3f59632243e0da37c1fa3977546e +Subproject commit ffe39d66d518f5cedb76133e15e48b2d4b446281 From 2488f49ad7163c12cdade3d8a538b345a1797974 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sat, 4 Feb 2023 19:42:53 -0800 Subject: [PATCH 100/280] SaiRxPacket: accept optional VLAN in setSrcVlan Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D41228853 Privacy Context Container: L1125642 fbshipit-source-id: 9c81a7c884ca538ffcc44d3b7a0a1bcef823cf45 --- fboss/agent/hw/sai/switch/SaiRxPacket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fboss/agent/hw/sai/switch/SaiRxPacket.h b/fboss/agent/hw/sai/switch/SaiRxPacket.h index fa4a1ef418267..7765032998e23 100644 --- a/fboss/agent/hw/sai/switch/SaiRxPacket.h +++ b/fboss/agent/hw/sai/switch/SaiRxPacket.h @@ -40,7 +40,7 @@ class SaiRxPacket : public RxPacket { /* * Set the VLAN on which this packet was received. */ - void setSrcVlan(VlanID srcVlan) { + void setSrcVlan(std::optional srcVlan) { srcVlan_ = srcVlan; } From 285fadabe380f459e19636acc614b9838bef80a7 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sat, 4 Feb 2023 19:42:53 -0800 Subject: [PATCH 101/280] VOQ/Fabric switch: rxcallback should not assign VLAN to pkt Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D41229314 Privacy Context Container: L1125642 fbshipit-source-id: e4de00ecb1074c1e46184a0e41aad72292da4f7b --- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 71 +++++++++++++++---------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index 60698c3d32f0f..c68b1e82e3a2c 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -2002,7 +2002,16 @@ void SaiSwitch::packetRxCallbackPort( bool allowMissingSrcPort, cfg::PacketRxReason rxReason) { PortID swPortId(0); - VlanID swVlanId(0); + std::optional swVlanId = (switchType_ == cfg::SwitchType::VOQ || + switchType_ == cfg::SwitchType::FABRIC) + ? std::nullopt + : std::make_optional(VlanID(0)); + auto swVlanIdStr = [swVlanId]() { + return swVlanId.has_value() + ? folly::to(static_cast(swVlanId.value())) + : "None"; + }; + auto rxPacket = std::make_unique( buffer_size, buffer, PortID(0), VlanID(0), rxReason); const auto portItr = concurrentIndices_->portIds.find(portSaiId); @@ -2023,35 +2032,39 @@ void SaiSwitch::packetRxCallbackPort( * We use the cached cpu port id to avoid holding manager table locks in * the Rx path. */ - if (portSaiId == getCPUPortSaiId() || - (allowMissingSrcPort && portItr == concurrentIndices_->portIds.cend())) { - folly::io::Cursor cursor(rxPacket->buf()); - EthHdr ethHdr{cursor}; - auto vlanTags = ethHdr.getVlanTags(); - if (vlanTags.size() == 1) { - swVlanId = VlanID(vlanTags[0].vid()); - XLOG(DBG6) << "Rx packet on cpu port. " - << "Found vlan from packet: " << swVlanId; - } else { - XLOG(ERR) << "RX packet on cpu port has no vlan tag " - << "or multiple vlan tags: 0x" << std::hex << portSaiId; - return; - } - } else if (portItr == concurrentIndices_->portIds.cend()) { - // TODO: add counter to keep track of spurious rx packet - XLOG(DBG) << "RX packet had port with unknown sai id: 0x" << std::hex - << portSaiId; - return; - } else { - swPortId = portItr->second; - const auto vlanItr = - concurrentIndices_->vlanIds.find(PortDescriptorSaiId(portSaiId)); - if (vlanItr == concurrentIndices_->vlanIds.cend()) { - XLOG(ERR) << "RX packet had port in no known vlan: 0x" << std::hex + if (!(switchType_ == cfg::SwitchType::VOQ || + switchType_ == cfg::SwitchType::FABRIC)) { + if (portSaiId == getCPUPortSaiId() || + (allowMissingSrcPort && + portItr == concurrentIndices_->portIds.cend())) { + folly::io::Cursor cursor(rxPacket->buf()); + EthHdr ethHdr{cursor}; + auto vlanTags = ethHdr.getVlanTags(); + if (vlanTags.size() == 1) { + swVlanId = VlanID(vlanTags[0].vid()); + XLOG(DBG6) << "Rx packet on cpu port. " + << "Found vlan from packet: " << swVlanIdStr(); + } else { + XLOG(ERR) << "RX packet on cpu port has no vlan tag " + << "or multiple vlan tags: 0x" << std::hex << portSaiId; + return; + } + } else if (portItr == concurrentIndices_->portIds.cend()) { + // TODO: add counter to keep track of spurious rx packet + XLOG(DBG) << "RX packet had port with unknown sai id: 0x" << std::hex << portSaiId; return; + } else { + swPortId = portItr->second; + const auto vlanItr = + concurrentIndices_->vlanIds.find(PortDescriptorSaiId(portSaiId)); + if (vlanItr == concurrentIndices_->vlanIds.cend()) { + XLOG(ERR) << "RX packet had port in no known vlan: 0x" << std::hex + << portSaiId; + return; + } + swVlanId = vlanItr->second; } - swVlanId = vlanItr->second; } /* @@ -2059,8 +2072,10 @@ void SaiSwitch::packetRxCallbackPort( */ rxPacket->setSrcPort(swPortId); rxPacket->setSrcVlan(swVlanId); - XLOG(DBG6) << "Rx packet on port: " << swPortId << " vlan: " << swVlanId + + XLOG(DBG6) << "Rx packet on port: " << swPortId << " vlan: " << swVlanIdStr() << " trap: " << packetRxReasonToString(rxReason); + folly::io::Cursor c0(rxPacket->buf()); XLOG(DBG6) << PktUtil::hexDump(c0); callback_->packetReceived(std::move(rxPacket)); From ac440bc1c0477e089951a9bcaf4e650009cbbc15 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sat, 4 Feb 2023 19:42:53 -0800 Subject: [PATCH 102/280] VOQ/Fabric switch: rxcallback to assign portID Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D42460925 Privacy Context Container: L1125642 fbshipit-source-id: 4b2b77a30b6ed8f389d7e92a4116751a298c3953 --- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index c68b1e82e3a2c..76d3a684fb8d9 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -2065,6 +2065,19 @@ void SaiSwitch::packetRxCallbackPort( } swVlanId = vlanItr->second; } + } else { // VOQ / FABRIC + if (portSaiId != getCPUPortSaiId()) { + if (portItr == concurrentIndices_->portIds.cend()) { + // TODO: add counter to keep track of spurious rx packet + XLOG(ERR) << "RX packet had port with unknown sai id: 0x" << std::hex + << portSaiId; + return; + } else { + swPortId = portItr->second; + XLOG(DBG6) << "VOQ RX packet with sai id: 0x" << std::hex << portSaiId + << " portID: " << swPortId; + } + } } /* From 61be756e633ef9c47bdaf8be108e8cb61bf017dc Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sat, 4 Feb 2023 19:42:53 -0800 Subject: [PATCH 103/280] ApplyThriftConfig: pseudoVlanData structure for interfaceIDs corresponding to a port Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D42464993 Privacy Context Container: L1125642 fbshipit-source-id: fc6b7a039a01ff3f44e6a4089d2a3b423028c9ef --- fboss/agent/ApplyThriftConfig.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index efcea95c4db16..90824c1d2b0df 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -280,6 +280,7 @@ class ThriftConfigApplier { std::pair getSystemLacpConfig(); uint8_t computeMinimumLinkCount(const cfg::AggregatePort& cfg); std::shared_ptr updateVlans(); + std::shared_ptr updatePseudoVlans(); std::shared_ptr createVlan(const cfg::Vlan* config); std::shared_ptr updateVlan( const std::shared_ptr& orig, @@ -764,6 +765,26 @@ shared_ptr ThriftConfigApplier::run() { changed = true; } } + + { + auto switchType = *cfg_->switchSettings()->switchType(); + + // VOQ/Fabric switches require that the packets are not tagged with any + // VLAN. We are gradually enhancing wedge_agent to handle tagged as well as + // untagged packets. During this transition, we will use VlanID 0 as + // "pseudoVlan" to populate SwitchState/Neighbor cache etc. data structures. + // Once the wedge_agent changes are complete, we will no longer need + // pseudoVlan notion. + if (switchType == cfg::SwitchType::VOQ || + switchType == cfg::SwitchType::FABRIC) { + auto pseudoVlans = updatePseudoVlans(); + if (pseudoVlans) { + new_->resetVlans(std::move(pseudoVlans)); + changed = true; + } + } + } + if (!changed) { return nullptr; } @@ -2136,6 +2157,11 @@ shared_ptr ThriftConfigApplier::updateVlan( return newVlan; } +shared_ptr ThriftConfigApplier::updatePseudoVlans() { + // TODO(skhare) implement + return nullptr; +} + std::shared_ptr ThriftConfigApplier::updateQosPolicies() { QosPolicyMap::NodeContainer newQosPolicies; bool changed = false; From f244f929a76a27ff2d6a5568c3dccbab5032c5eb Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sat, 4 Feb 2023 19:42:53 -0800 Subject: [PATCH 104/280] Set isLocal to false before programming remote neighbors Summary: A neighbor is local only to the DSF Node the neighbor was resolved on, but it is remote for every other DSF Node. When a DSF node publishes its neighbor entries, that carries isLocal = True. Every DSF node subscriber needs to set isLocal = False before programming it. This diff performs that. Reviewed By: jasmeetbagga Differential Revision: D42493215 Privacy Context Container: L1125642 fbshipit-source-id: 5cef101216a12e8bb0374b1b59023ff6f71a92d9 --- fboss/agent/DsfSubscriber.cpp | 73 +++++++++++++++++-------- fboss/agent/test/DsfSubscriberTests.cpp | 19 ++++++- 2 files changed, 68 insertions(+), 24 deletions(-) diff --git a/fboss/agent/DsfSubscriber.cpp b/fboss/agent/DsfSubscriber.cpp index acb4d4d539f67..d6d6fdaecc3bd 100644 --- a/fboss/agent/DsfSubscriber.cpp +++ b/fboss/agent/DsfSubscriber.cpp @@ -55,40 +55,67 @@ void DsfSubscriber::scheduleUpdate( } bool changed{false}; auto out = in->clone(); - auto processDelta = [&](auto& delta, auto& mapToUpdate) { - DeltaFunctions::forEachChanged( - delta, - [&](const auto& oldNode, const auto& newNode) { - if (*oldNode != *newNode) { - // Compare contents as we reconstructed - // map from deserialized FSDB - // subscriptions. So can't just rely on - // pointer comparison here. - mapToUpdate->updateNode(newNode); - changed = true; - } - }, - [&](const auto& newNode) { - mapToUpdate->addNode(newNode); - changed = true; - }, - [&](const auto& rmNode) { - mapToUpdate->removeNode(rmNode); - changed = true; - }); + + auto makeRemoteSysPort = [&](const auto& node) { return node; }; + auto makeRemoteRif = [&](const auto& node) { + auto clonedNode = node->clone(); + + if (node->isPublished()) { + clonedNode->setArpTable(node->getArpTable()->toThrift()); + clonedNode->setNdpTable(node->getNdpTable()->toThrift()); + } + + // Local neighbor entry on one DSF node is remote neighbor entry on + // every other DSF node. Thus, for neighbor entry received from other + // DSF nodes, set isLocal = False before programming it. + for (const auto& arpEntry : *clonedNode->getArpTable()) { + arpEntry.second->setIsLocal(false); + } + for (const auto& ndpEntry : *clonedNode->getNdpTable()) { + ndpEntry.second->setIsLocal(false); + } + + return clonedNode; }; + + auto processDelta = + [&](auto& delta, auto& mapToUpdate, auto& makeRemote) { + DeltaFunctions::forEachChanged( + delta, + [&](const auto& oldNode, const auto& newNode) { + if (*oldNode != *newNode) { + // Compare contents as we reconstructed + // map from deserialized FSDB + // subscriptions. So can't just rely on + // pointer comparison here. + auto clonedNode = makeRemote(newNode); + mapToUpdate->updateNode(clonedNode); + changed = true; + } + }, + [&](const auto& newNode) { + auto clonedNode = makeRemote(newNode); + mapToUpdate->addNode(clonedNode); + changed = true; + }, + [&](const auto& rmNode) { + mapToUpdate->removeNode(rmNode); + changed = true; + }); + }; + if (newSysPorts) { auto origSysPorts = out->getSystemPorts(nodeSwitchId); thrift_cow::ThriftMapDelta delta( origSysPorts.get(), newSysPorts.get()); auto remoteSysPorts = out->getRemoteSystemPorts()->modify(&out); - processDelta(delta, remoteSysPorts); + processDelta(delta, remoteSysPorts, makeRemoteSysPort); } if (newRifs) { auto origRifs = out->getInterfaces(nodeSwitchId); InterfaceMapDelta delta(origRifs.get(), newRifs.get()); auto remoteRifs = out->getRemoteInterfaces()->modify(&out); - processDelta(delta, remoteRifs); + processDelta(delta, remoteRifs, makeRemoteRif); } if (FLAGS_dsf_subscriber_cache_updated_state) { cachedState_ = out; diff --git a/fboss/agent/test/DsfSubscriberTests.cpp b/fboss/agent/test/DsfSubscriberTests.cpp index 1bb8597fe7cac..6744bc5fe027d 100644 --- a/fboss/agent/test/DsfSubscriberTests.cpp +++ b/fboss/agent/test/DsfSubscriberTests.cpp @@ -78,6 +78,21 @@ TEST_F(DsfSubscriberTest, scheduleUpdate) { TEST_F(DsfSubscriberTest, setupNeighbors) { auto updateAndCompareTables = [this](const auto& sysPorts, const auto& rifs) { + rifs->publish(); + + // dsfSubscriber_->scheduleUpdate is expected to set isLocal to False, and + // rest of the structure should remain the same. + auto expectedRifs = InterfaceMap(rifs->toThrift()); + for (auto intfIter : expectedRifs) { + auto& intf = intfIter.second; + for (auto& ndpEntry : *intf->getNdpTable()) { + ndpEntry.second->setIsLocal(false); + } + for (auto& arpEntry : *intf->getArpTable()) { + arpEntry.second->setIsLocal(false); + } + } + dsfSubscriber_->scheduleUpdate( sysPorts, rifs, "switch", SwitchID(kRemoteSwitchId)); waitForStateUpdates(sw_); @@ -85,7 +100,8 @@ TEST_F(DsfSubscriberTest, setupNeighbors) { sysPorts->toThrift(), sw_->getState()->getRemoteSystemPorts()->toThrift()); EXPECT_EQ( - rifs->toThrift(), sw_->getState()->getRemoteInterfaces()->toThrift()); + expectedRifs.toThrift(), + sw_->getState()->getRemoteInterfaces()->toThrift()); }; { // No neighbors @@ -110,6 +126,7 @@ TEST_F(DsfSubscriberTest, setupNeighbors) { port.portType() = cfg::PortDescriptorType::SystemPort; nbr.portId() = port; nbr.interfaceId() = rif; + nbr.isLocal() = true; folly::IPAddress ipAddr(ip); if (ipAddr.isV6()) { ndpTable.insert({ip, nbr}); From a81b48b88af86cf525c3c5a66301833c1d686dbc Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sat, 4 Feb 2023 19:42:53 -0800 Subject: [PATCH 105/280] DsfSubscriberTests to verify if programmed nbrs are different Summary: As titled. See comments in the code Reviewed By: jasmeetbagga Differential Revision: D42521385 Privacy Context Container: L1125642 fbshipit-source-id: ac8a0730682d3a297e3cd076efee1e767893cc00 --- fboss/agent/test/DsfSubscriberTests.cpp | 59 ++++++++++++++----------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/fboss/agent/test/DsfSubscriberTests.cpp b/fboss/agent/test/DsfSubscriberTests.cpp index 6744bc5fe027d..0a98791c46e94 100644 --- a/fboss/agent/test/DsfSubscriberTests.cpp +++ b/fboss/agent/test/DsfSubscriberTests.cpp @@ -77,37 +77,46 @@ TEST_F(DsfSubscriberTest, scheduleUpdate) { } TEST_F(DsfSubscriberTest, setupNeighbors) { - auto updateAndCompareTables = [this](const auto& sysPorts, const auto& rifs) { - rifs->publish(); + auto updateAndCompareTables = + [this](const auto& sysPorts, const auto& rifs, bool noNeighbors = false) { + rifs->publish(); - // dsfSubscriber_->scheduleUpdate is expected to set isLocal to False, and - // rest of the structure should remain the same. - auto expectedRifs = InterfaceMap(rifs->toThrift()); - for (auto intfIter : expectedRifs) { - auto& intf = intfIter.second; - for (auto& ndpEntry : *intf->getNdpTable()) { - ndpEntry.second->setIsLocal(false); + // dsfSubscriber_->scheduleUpdate is expected to set isLocal to False, + // and rest of the structure should remain the same. + auto expectedRifs = InterfaceMap(rifs->toThrift()); + for (auto intfIter : expectedRifs) { + auto& intf = intfIter.second; + for (auto& ndpEntry : *intf->getNdpTable()) { + ndpEntry.second->setIsLocal(false); + } + for (auto& arpEntry : *intf->getArpTable()) { + arpEntry.second->setIsLocal(false); } - for (auto& arpEntry : *intf->getArpTable()) { - arpEntry.second->setIsLocal(false); - } - } + } - dsfSubscriber_->scheduleUpdate( - sysPorts, rifs, "switch", SwitchID(kRemoteSwitchId)); - waitForStateUpdates(sw_); - EXPECT_EQ( - sysPorts->toThrift(), - sw_->getState()->getRemoteSystemPorts()->toThrift()); - EXPECT_EQ( - expectedRifs.toThrift(), - sw_->getState()->getRemoteInterfaces()->toThrift()); - }; + dsfSubscriber_->scheduleUpdate( + sysPorts, rifs, "switch", SwitchID(kRemoteSwitchId)); + waitForStateUpdates(sw_); + EXPECT_EQ( + sysPorts->toThrift(), + sw_->getState()->getRemoteSystemPorts()->toThrift()); + EXPECT_EQ( + expectedRifs.toThrift(), + sw_->getState()->getRemoteInterfaces()->toThrift()); + + // neighbor entries are modified to set isLocal=false + // Thus, if neighbor table is non-empty, programmed vs. actually + // programmed would be unequal. + EXPECT_TRUE( + rifs->toThrift() != + sw_->getState()->getRemoteInterfaces()->toThrift() || + noNeighbors); + }; { // No neighbors auto sysPorts = makeSysPorts(); auto rifs = makeRifs(sysPorts.get()); - updateAndCompareTables(sysPorts, rifs); + updateAndCompareTables(sysPorts, rifs, true /* noNeighbors */); } auto makeNbrs = []() { state::NeighborEntries ndpTable, arpTable; @@ -174,7 +183,7 @@ TEST_F(DsfSubscriberTest, setupNeighbors) { // clear neighbors auto sysPorts = makeSysPorts(); auto rifs = makeRifs(sysPorts.get()); - updateAndCompareTables(sysPorts, rifs); + updateAndCompareTables(sysPorts, rifs, true /* noNeighbors */); } } } // namespace facebook::fboss From 2cbf2b8525eb6704d64df50986478eb0ab973658 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sat, 4 Feb 2023 19:42:53 -0800 Subject: [PATCH 106/280] DsfSubscriberTests: refactor setupNeighbors Summary: No functional change. Leveraged by stacked diff. Reviewed By: jasmeetbagga Differential Revision: D42537588 Privacy Context Container: L1125642 fbshipit-source-id: 957b95d2d7ff4883ab71ae94deafeaeef35c665d --- fboss/agent/test/DsfSubscriberTests.cpp | 163 +++++++++++++----------- 1 file changed, 88 insertions(+), 75 deletions(-) diff --git a/fboss/agent/test/DsfSubscriberTests.cpp b/fboss/agent/test/DsfSubscriberTests.cpp index 0a98791c46e94..8bb646ffb27cb 100644 --- a/fboss/agent/test/DsfSubscriberTests.cpp +++ b/fboss/agent/test/DsfSubscriberTests.cpp @@ -77,47 +77,47 @@ TEST_F(DsfSubscriberTest, scheduleUpdate) { } TEST_F(DsfSubscriberTest, setupNeighbors) { - auto updateAndCompareTables = - [this](const auto& sysPorts, const auto& rifs, bool noNeighbors = false) { - rifs->publish(); + auto updateAndCompareTables = [this]( + const auto& sysPorts, + const auto& rifs, + bool publishState, + bool noNeighbors = false) { + if (publishState) { + rifs->publish(); + } - // dsfSubscriber_->scheduleUpdate is expected to set isLocal to False, - // and rest of the structure should remain the same. - auto expectedRifs = InterfaceMap(rifs->toThrift()); - for (auto intfIter : expectedRifs) { - auto& intf = intfIter.second; - for (auto& ndpEntry : *intf->getNdpTable()) { - ndpEntry.second->setIsLocal(false); - } - for (auto& arpEntry : *intf->getArpTable()) { - arpEntry.second->setIsLocal(false); + // dsfSubscriber_->scheduleUpdate is expected to set isLocal to False, + // and rest of the structure should remain the same. + auto expectedRifs = InterfaceMap(rifs->toThrift()); + for (auto intfIter : expectedRifs) { + auto& intf = intfIter.second; + for (auto& ndpEntry : *intf->getNdpTable()) { + ndpEntry.second->setIsLocal(false); + } + for (auto& arpEntry : *intf->getArpTable()) { + arpEntry.second->setIsLocal(false); } - } + } - dsfSubscriber_->scheduleUpdate( - sysPorts, rifs, "switch", SwitchID(kRemoteSwitchId)); - waitForStateUpdates(sw_); - EXPECT_EQ( - sysPorts->toThrift(), - sw_->getState()->getRemoteSystemPorts()->toThrift()); - EXPECT_EQ( - expectedRifs.toThrift(), - sw_->getState()->getRemoteInterfaces()->toThrift()); + dsfSubscriber_->scheduleUpdate( + sysPorts, rifs, "switch", SwitchID(kRemoteSwitchId)); + waitForStateUpdates(sw_); + EXPECT_EQ( + sysPorts->toThrift(), + sw_->getState()->getRemoteSystemPorts()->toThrift()); + EXPECT_EQ( + expectedRifs.toThrift(), + sw_->getState()->getRemoteInterfaces()->toThrift()); - // neighbor entries are modified to set isLocal=false - // Thus, if neighbor table is non-empty, programmed vs. actually + // neighbor entries are modified to set isLocal=false + // Thus, if neighbor table is non-empty, programmed vs. actually // programmed would be unequal. - EXPECT_TRUE( - rifs->toThrift() != - sw_->getState()->getRemoteInterfaces()->toThrift() || + EXPECT_TRUE( + rifs->toThrift() != + sw_->getState()->getRemoteInterfaces()->toThrift() || noNeighbors); - }; - { - // No neighbors - auto sysPorts = makeSysPorts(); - auto rifs = makeRifs(sysPorts.get()); - updateAndCompareTables(sysPorts, rifs, true /* noNeighbors */); - } + }; + auto makeNbrs = []() { state::NeighborEntries ndpTable, arpTable; std::map ip2Rif = { @@ -145,45 +145,58 @@ TEST_F(DsfSubscriberTest, setupNeighbors) { } return std::make_pair(ndpTable, arpTable); }; - { - // add neighbors - auto sysPorts = makeSysPorts(); - auto rifs = makeRifs(sysPorts.get()); - auto firstRif = kSysPortRangeMin + 1; - auto [ndpTable, arpTable] = makeNbrs(); - (*rifs)[firstRif]->setNdpTable(ndpTable); - (*rifs)[firstRif]->setArpTable(arpTable); - updateAndCompareTables(sysPorts, rifs); - } - { - // update neighbors - auto sysPorts = makeSysPorts(); - auto rifs = makeRifs(sysPorts.get()); - auto firstRif = kSysPortRangeMin + 1; - auto [ndpTable, arpTable] = makeNbrs(); - ndpTable.begin()->second.mac() = "06:05:04:03:02:01"; - arpTable.begin()->second.mac() = "06:05:04:03:02:01"; - (*rifs)[firstRif]->setNdpTable(ndpTable); - (*rifs)[firstRif]->setArpTable(arpTable); - updateAndCompareTables(sysPorts, rifs); - } - { - // delete neighbors - auto sysPorts = makeSysPorts(); - auto rifs = makeRifs(sysPorts.get()); - auto firstRif = kSysPortRangeMin + 1; - auto [ndpTable, arpTable] = makeNbrs(); - ndpTable.erase(ndpTable.begin()); - arpTable.erase(arpTable.begin()); - (*rifs)[firstRif]->setNdpTable(ndpTable); - (*rifs)[firstRif]->setArpTable(arpTable); - updateAndCompareTables(sysPorts, rifs); - } - { - // clear neighbors - auto sysPorts = makeSysPorts(); - auto rifs = makeRifs(sysPorts.get()); - updateAndCompareTables(sysPorts, rifs, true /* noNeighbors */); - } + + auto verifySetupNeighbors = [&](bool publishState) { + { + // No neighbors + auto sysPorts = makeSysPorts(); + auto rifs = makeRifs(sysPorts.get()); + updateAndCompareTables( + sysPorts, rifs, publishState, true /* noNeighbors */); + } + { + // add neighbors + auto sysPorts = makeSysPorts(); + auto rifs = makeRifs(sysPorts.get()); + auto firstRif = kSysPortRangeMin + 1; + auto [ndpTable, arpTable] = makeNbrs(); + (*rifs)[firstRif]->setNdpTable(ndpTable); + (*rifs)[firstRif]->setArpTable(arpTable); + updateAndCompareTables(sysPorts, rifs, publishState); + } + { + // update neighbors + auto sysPorts = makeSysPorts(); + auto rifs = makeRifs(sysPorts.get()); + auto firstRif = kSysPortRangeMin + 1; + auto [ndpTable, arpTable] = makeNbrs(); + ndpTable.begin()->second.mac() = "06:05:04:03:02:01"; + arpTable.begin()->second.mac() = "06:05:04:03:02:01"; + (*rifs)[firstRif]->setNdpTable(ndpTable); + (*rifs)[firstRif]->setArpTable(arpTable); + updateAndCompareTables(sysPorts, rifs, publishState); + } + { + // delete neighbors + auto sysPorts = makeSysPorts(); + auto rifs = makeRifs(sysPorts.get()); + auto firstRif = kSysPortRangeMin + 1; + auto [ndpTable, arpTable] = makeNbrs(); + ndpTable.erase(ndpTable.begin()); + arpTable.erase(arpTable.begin()); + (*rifs)[firstRif]->setNdpTable(ndpTable); + (*rifs)[firstRif]->setArpTable(arpTable); + updateAndCompareTables(sysPorts, rifs, publishState); + } + { + // clear neighbors + auto sysPorts = makeSysPorts(); + auto rifs = makeRifs(sysPorts.get()); + updateAndCompareTables( + sysPorts, rifs, publishState, true /* noNeighbors */); + } + }; + + verifySetupNeighbors(true /* publishState */); } } // namespace facebook::fboss From 234bc8878da19609116b6b50f0f2e1e2122a3095 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sat, 4 Feb 2023 19:42:53 -0800 Subject: [PATCH 107/280] DsfSubscriberTests: to pass published and unpublished rifs Summary: As titled Reviewed By: jasmeetbagga Differential Revision: D42537587 Privacy Context Container: L1125642 fbshipit-source-id: 67bb5e945034438e122d676f84fedaff571ee4eb --- fboss/agent/test/DsfSubscriberTests.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fboss/agent/test/DsfSubscriberTests.cpp b/fboss/agent/test/DsfSubscriberTests.cpp index 8bb646ffb27cb..0c14bf83a927e 100644 --- a/fboss/agent/test/DsfSubscriberTests.cpp +++ b/fboss/agent/test/DsfSubscriberTests.cpp @@ -111,11 +111,13 @@ TEST_F(DsfSubscriberTest, setupNeighbors) { // neighbor entries are modified to set isLocal=false // Thus, if neighbor table is non-empty, programmed vs. actually - // programmed would be unequal. + // programmed would be unequal for published state. + // for unpublished state, the passed state would be modified, and thus, + // programmed vs actually programmed state would be equal. EXPECT_TRUE( rifs->toThrift() != sw_->getState()->getRemoteInterfaces()->toThrift() || - noNeighbors); + noNeighbors || !publishState); }; auto makeNbrs = []() { @@ -197,6 +199,7 @@ TEST_F(DsfSubscriberTest, setupNeighbors) { } }; + verifySetupNeighbors(false /* publishState */); verifySetupNeighbors(true /* publishState */); } } // namespace facebook::fboss From 9a7558b16dfd72a49f4dda117a00d438bdebe3c2 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sat, 4 Feb 2023 20:06:29 -0800 Subject: [PATCH 108/280] Plumbing for overriding DsfNodes Summary: As titled Reviewed By: harshitgulati18 Differential Revision: D43017374 Privacy Context Container: L1125642 fbshipit-source-id: 69bf5179dc291625e6d7a9a37a553ce304dd22a2 --- fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp | 1 + fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp | 5 +++++ fboss/agent/hw/test/HwTest.cpp | 1 + fboss/agent/hw/test/HwTest.h | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp index 7ec4d5de9d4f6..0e1251c15a8e8 100644 --- a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp +++ b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp @@ -201,6 +201,7 @@ void BcmSwitchEnsemble::runDiagCommand( void BcmSwitchEnsemble::init( const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info) { + CHECK(!info.dsfNodes.has_value()) << " Dsf nodes not support in BCM tests"; auto platform = createTestPlatform(); auto bcmTestPlatform = static_cast(platform.get()); std::unique_ptr agentConfig; diff --git a/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp b/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp index fe45815bc885a..84a2d624e80f4 100644 --- a/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp +++ b/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp @@ -140,6 +140,11 @@ void SaiSwitchEnsemble::init( } else { agentConfig = AgentConfig::fromDefaultFile(); } + if (info.dsfNodes.has_value()) { + cfg::AgentConfig thrift = agentConfig->thrift; + thrift.sw()->dsfNodes() = *info.dsfNodes; + agentConfig = std::make_unique(thrift, ""); + } initFlagDefaults(*agentConfig->thrift.defaultCommandLineArgs()); auto platform = initSaiPlatform(std::move(agentConfig), getHwSwitchFeatures()); diff --git a/fboss/agent/hw/test/HwTest.cpp b/fboss/agent/hw/test/HwTest.cpp index eeaeaa11dc0e5..8001dbba08d6b 100644 --- a/fboss/agent/hw/test/HwTest.cpp +++ b/fboss/agent/hw/test/HwTest.cpp @@ -91,6 +91,7 @@ void HwTest::SetUp() { folly::SingletonVault::singleton()->reenableInstances(); HwSwitchEnsemble::HwSwitchEnsembleInitInfo initInfo; initInfo.overrideTransceiverInfo = overrideTransceiverInfo(); + initInfo.dsfNodes = overrideDsfNodes(); // Set watermark stats update interval to 0 so we always refresh BST stats // in each updateStats call FLAGS_update_watermark_stats_interval_s = 0; diff --git a/fboss/agent/hw/test/HwTest.h b/fboss/agent/hw/test/HwTest.h index 587cebc3af498..b17c0e334f110 100644 --- a/fboss/agent/hw/test/HwTest.h +++ b/fboss/agent/hw/test/HwTest.h @@ -167,6 +167,10 @@ class HwTest : public ::testing::Test, virtual std::optional overrideTransceiverInfo() const { return std::nullopt; } + virtual std::optional> overrideDsfNodes() + const { + return std::nullopt; + } std::shared_ptr applyNewStateImpl( const std::shared_ptr& newState, From 2bd12aaf17f1dfa54d186ede4da1ca2152ebd843 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sat, 4 Feb 2023 20:06:29 -0800 Subject: [PATCH 109/280] To override dsfNodes map, we need the map from input config Summary: As titled Reviewed By: harshitgulati18 Differential Revision: D43019350 Privacy Context Container: L1125642 fbshipit-source-id: 13e2a82bedccc91b3a88243d6292bc2258582297 --- .../agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp | 17 +++++++++++------ fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.h | 1 + fboss/agent/hw/test/HwSwitchEnsemble.h | 3 +++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp b/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp index 84a2d624e80f4..2e9b50f6bb96e 100644 --- a/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp +++ b/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp @@ -38,6 +38,7 @@ DECLARE_bool(setup_thrift); DECLARE_string(config); namespace { +using namespace facebook::fboss; using folly::AsyncSignalHandler; void initFlagDefaults(const std::map& defaults) { @@ -62,6 +63,10 @@ class SignalHandler : public AsyncSignalHandler { private: }; +std::unique_ptr getAgentConfig() { + return FLAGS_config.empty() ? AgentConfig::fromDefaultFile() + : AgentConfig::fromFile(FLAGS_config); +} } // namespace namespace facebook::fboss { @@ -132,14 +137,14 @@ void SaiSwitchEnsemble::runDiagCommand( std::make_unique(clientInfo)); } +std::map SaiSwitchEnsemble::dsfNodesFromInputConfig() + const { + return *getAgentConfig()->thrift.sw()->dsfNodes(); +} + void SaiSwitchEnsemble::init( const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info) { - std::unique_ptr agentConfig; - if (!FLAGS_config.empty()) { - agentConfig = AgentConfig::fromFile(FLAGS_config); - } else { - agentConfig = AgentConfig::fromDefaultFile(); - } + auto agentConfig = getAgentConfig(); if (info.dsfNodes.has_value()) { cfg::AgentConfig thrift = agentConfig->thrift; thrift.sw()->dsfNodes() = *info.dsfNodes; diff --git a/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.h b/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.h index 137de20b6c024..4349d77062e8d 100644 --- a/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.h +++ b/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.h @@ -67,6 +67,7 @@ class SaiSwitchEnsemble : public HwSwitchEnsemble { bool isSai() const override { return true; } + std::map dsfNodesFromInputConfig() const override; private: std::unique_ptr setupThrift() override { diff --git a/fboss/agent/hw/test/HwSwitchEnsemble.h b/fboss/agent/hw/test/HwSwitchEnsemble.h index 831b2fc73ea57..cd427d06705da 100644 --- a/fboss/agent/hw/test/HwSwitchEnsemble.h +++ b/fboss/agent/hw/test/HwSwitchEnsemble.h @@ -121,6 +121,9 @@ class HwSwitchEnsemble : public HwSwitch::Callback { const HwAsic* getAsic() const { return getPlatform()->getAsic(); } + virtual std::map dsfNodesFromInputConfig() const { + return {}; + } virtual void init( const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& /*info*/) = 0; From 04d94d6a04b0ce124d8c2f290d6731679050afea Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sat, 4 Feb 2023 20:06:29 -0800 Subject: [PATCH 110/280] s/createHwEnsemble/createAndInitHwEnsemble Summary: Subsequent diffs will abstract out a createHwEnsemble (w/o init) abstraction Reviewed By: harshitgulati18 Differential Revision: D43019397 Privacy Context Container: L1125642 fbshipit-source-id: 9596bb5e80c7bf3528a2955b3cc9781713a1968f --- fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp | 2 +- fboss/agent/hw/benchmarks/HwEcmpShrinkSpeedBenchmark.cpp | 2 +- .../HwEcmpShrinkWithCompetingRouteUpdatesBenchmark.cpp | 2 +- fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp | 2 +- fboss/agent/hw/benchmarks/HwRibSyncFibBenchmark.cpp | 2 +- fboss/agent/hw/benchmarks/HwRxSlowPathBenchmark.cpp | 2 +- fboss/agent/hw/benchmarks/HwStatsCollectionBenchmark.cpp | 2 +- fboss/agent/hw/benchmarks/HwTxSlowPathBenchmark.cpp | 2 +- fboss/agent/hw/benchmarks/HwWarmbootExitBenchmark.cpp | 2 +- fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp | 2 +- fboss/agent/hw/test/HwSwitchEnsembleFactory.h | 2 +- fboss/agent/hw/test/HwTest.cpp | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp b/fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp index 273b2cee26e33..4ccda56fa3c52 100644 --- a/fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp +++ b/fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp @@ -16,7 +16,7 @@ namespace facebook::fboss { -std::unique_ptr createHwEnsemble( +std::unique_ptr createAndInitHwEnsemble( const HwSwitchEnsemble::Features& featuresDesired, const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info) { auto ensemble = std::make_unique(featuresDesired); diff --git a/fboss/agent/hw/benchmarks/HwEcmpShrinkSpeedBenchmark.cpp b/fboss/agent/hw/benchmarks/HwEcmpShrinkSpeedBenchmark.cpp index 4418c9b41a574..2da50f49798e4 100644 --- a/fboss/agent/hw/benchmarks/HwEcmpShrinkSpeedBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwEcmpShrinkSpeedBenchmark.cpp @@ -29,7 +29,7 @@ using utility::getEcmpSizeInHw; BENCHMARK(HwEcmpGroupShrink) { folly::BenchmarkSuspender suspender; constexpr int kEcmpWidth = 4; - auto ensemble = createHwEnsemble(HwSwitchEnsemble::getAllFeatures()); + auto ensemble = createAndInitHwEnsemble(HwSwitchEnsemble::getAllFeatures()); auto hwSwitch = ensemble->getHwSwitch(); auto config = utility::onePortPerInterfaceConfig( hwSwitch, ensemble->masterLogicalPortIds()); diff --git a/fboss/agent/hw/benchmarks/HwEcmpShrinkWithCompetingRouteUpdatesBenchmark.cpp b/fboss/agent/hw/benchmarks/HwEcmpShrinkWithCompetingRouteUpdatesBenchmark.cpp index 50aeaae75b942..10375989d55ac 100644 --- a/fboss/agent/hw/benchmarks/HwEcmpShrinkWithCompetingRouteUpdatesBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwEcmpShrinkWithCompetingRouteUpdatesBenchmark.cpp @@ -32,7 +32,7 @@ using utility::getEcmpSizeInHw; BENCHMARK(HwEcmpGroupShrinkWithCompetingRouteUpdates) { folly::BenchmarkSuspender suspender; constexpr int kEcmpWidth = 4; - auto ensemble = createHwEnsemble( + auto ensemble = createAndInitHwEnsemble( {HwSwitchEnsemble::LINKSCAN, HwSwitchEnsemble::PACKET_RX}); auto hwSwitch = ensemble->getHwSwitch(); diff --git a/fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp b/fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp index 7518eada55608..874f4080972e8 100644 --- a/fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp @@ -23,7 +23,7 @@ namespace facebook::fboss { BENCHMARK(RibResolutionBenchmark) { folly::BenchmarkSuspender suspender; - auto ensemble = createHwEnsemble(HwSwitchEnsemble::getAllFeatures()); + auto ensemble = createAndInitHwEnsemble(HwSwitchEnsemble::getAllFeatures()); auto config = utility::onePortPerInterfaceConfig( ensemble->getHwSwitch(), ensemble->masterLogicalPortIds()); ensemble->applyInitialConfig(config); diff --git a/fboss/agent/hw/benchmarks/HwRibSyncFibBenchmark.cpp b/fboss/agent/hw/benchmarks/HwRibSyncFibBenchmark.cpp index 2df2df9b1c719..43302e68c6750 100644 --- a/fboss/agent/hw/benchmarks/HwRibSyncFibBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwRibSyncFibBenchmark.cpp @@ -23,7 +23,7 @@ namespace facebook::fboss { BENCHMARK(RibSyncFibBenchmark) { folly::BenchmarkSuspender suspender; - auto ensemble = createHwEnsemble(HwSwitchEnsemble::getAllFeatures()); + auto ensemble = createAndInitHwEnsemble(HwSwitchEnsemble::getAllFeatures()); auto config = utility::onePortPerInterfaceConfig( ensemble->getHwSwitch(), ensemble->masterLogicalPortIds()); ensemble->applyInitialConfig(config); diff --git a/fboss/agent/hw/benchmarks/HwRxSlowPathBenchmark.cpp b/fboss/agent/hw/benchmarks/HwRxSlowPathBenchmark.cpp index ebf5457223cb6..b2575526b1bc6 100644 --- a/fboss/agent/hw/benchmarks/HwRxSlowPathBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwRxSlowPathBenchmark.cpp @@ -41,7 +41,7 @@ const std::string kDstIp = "2620:0:1cfe:face:b00c::4"; void runRxSlowPathBenchmark() { constexpr int kEcmpWidth = 1; - auto ensemble = createHwEnsemble(HwSwitchEnsemble::getAllFeatures()); + auto ensemble = createAndInitHwEnsemble(HwSwitchEnsemble::getAllFeatures()); auto hwSwitch = ensemble->getHwSwitch(); auto portUsed = ensemble->masterLogicalPortIds()[0]; auto config = utility::oneL3IntfConfig(hwSwitch, portUsed); diff --git a/fboss/agent/hw/benchmarks/HwStatsCollectionBenchmark.cpp b/fboss/agent/hw/benchmarks/HwStatsCollectionBenchmark.cpp index d65d7dc282a4e..d6c29c4a528bd 100644 --- a/fboss/agent/hw/benchmarks/HwStatsCollectionBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwStatsCollectionBenchmark.cpp @@ -42,7 +42,7 @@ RouteNextHopSet makeNextHops(std::vector ipsAsStrings) { */ BENCHMARK(HwStatsCollection) { folly::BenchmarkSuspender suspender; - auto ensemble = createHwEnsemble({HwSwitchEnsemble::LINKSCAN}); + auto ensemble = createAndInitHwEnsemble({HwSwitchEnsemble::LINKSCAN}); auto hwSwitch = ensemble->getHwSwitch(); std::vector ports = ensemble->masterLogicalPortIds(); // maximum 48 master logical ports (taken from wedge400) to get diff --git a/fboss/agent/hw/benchmarks/HwTxSlowPathBenchmark.cpp b/fboss/agent/hw/benchmarks/HwTxSlowPathBenchmark.cpp index a180cafde7dc1..39efde725cb1b 100644 --- a/fboss/agent/hw/benchmarks/HwTxSlowPathBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwTxSlowPathBenchmark.cpp @@ -42,7 +42,7 @@ std::pair getOutPktsAndBytes( void runTxSlowPathBenchmark() { constexpr int kEcmpWidth = 1; - auto ensemble = createHwEnsemble(HwSwitchEnsemble::getAllFeatures()); + auto ensemble = createAndInitHwEnsemble(HwSwitchEnsemble::getAllFeatures()); auto hwSwitch = ensemble->getHwSwitch(); auto portUsed = ensemble->masterLogicalPortIds()[0]; auto config = utility::oneL3IntfConfig(hwSwitch, portUsed); diff --git a/fboss/agent/hw/benchmarks/HwWarmbootExitBenchmark.cpp b/fboss/agent/hw/benchmarks/HwWarmbootExitBenchmark.cpp index d2e5f2daf4806..cdcfe7ff28de2 100644 --- a/fboss/agent/hw/benchmarks/HwWarmbootExitBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwWarmbootExitBenchmark.cpp @@ -36,7 +36,7 @@ DEFINE_bool( namespace facebook::fboss { void runBenchmark() { - auto ensemble = createHwEnsemble(HwSwitchEnsemble::getAllFeatures()); + auto ensemble = createAndInitHwEnsemble(HwSwitchEnsemble::getAllFeatures()); auto hwSwitch = ensemble->getHwSwitch(); auto config = utility::onePortPerInterfaceConfig( hwSwitch, ensemble->masterLogicalPortIds()); diff --git a/fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp b/fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp index 70b434fc6f1fb..3831f0e58cd38 100644 --- a/fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp +++ b/fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp @@ -16,7 +16,7 @@ namespace facebook::fboss { -std::unique_ptr createHwEnsemble( +std::unique_ptr createAndInitHwEnsemble( const HwSwitchEnsemble::Features& featuresDesired, const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info) { auto ensemble = std::make_unique(featuresDesired); diff --git a/fboss/agent/hw/test/HwSwitchEnsembleFactory.h b/fboss/agent/hw/test/HwSwitchEnsembleFactory.h index 6834fb8161d86..d100d6e9cb2c6 100644 --- a/fboss/agent/hw/test/HwSwitchEnsembleFactory.h +++ b/fboss/agent/hw/test/HwSwitchEnsembleFactory.h @@ -25,7 +25,7 @@ namespace facebook::fboss { * members - HwSwitch, Platform) interfaces. */ -std::unique_ptr createHwEnsemble( +std::unique_ptr createAndInitHwEnsemble( const HwSwitchEnsemble::Features& featuresDesired, const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info = HwSwitchEnsemble::HwSwitchEnsembleInitInfo{}); diff --git a/fboss/agent/hw/test/HwTest.cpp b/fboss/agent/hw/test/HwTest.cpp index 8001dbba08d6b..665e0b0393c78 100644 --- a/fboss/agent/hw/test/HwTest.cpp +++ b/fboss/agent/hw/test/HwTest.cpp @@ -95,7 +95,7 @@ void HwTest::SetUp() { // Set watermark stats update interval to 0 so we always refresh BST stats // in each updateStats call FLAGS_update_watermark_stats_interval_s = 0; - hwSwitchEnsemble_ = createHwEnsemble(featuresDesired(), initInfo); + hwSwitchEnsemble_ = createAndInitHwEnsemble(featuresDesired(), initInfo); hwSwitchEnsemble_->addHwEventObserver(this); if (getHwSwitch()->getBootType() == BootType::WARM_BOOT) { // For warm boots, in wedge_agent at this point we would From 0640f4175e1193f9924051d83f08ed3e55d49ca4 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sat, 4 Feb 2023 20:06:29 -0800 Subject: [PATCH 111/280] Break HwSwitchEnsemble create and init into 2 steps Summary: As titled. This will let us insert any HwTest specific overrides into enemble init info, while leveraging a created ensemble. A ensemble object will let us pull out (for e.g.) dsf nodes map from the passed in config. Reviewed By: harshitgulati18 Differential Revision: D43023644 Privacy Context Container: L1125642 fbshipit-source-id: de81cd492b46685af9386fbad16c3b03783a2bcd --- fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp | 7 ++++++- fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp | 7 ++++++- fboss/agent/hw/test/HwSwitchEnsembleFactory.h | 3 +++ fboss/agent/hw/test/HwTest.cpp | 3 ++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp b/fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp index 4ccda56fa3c52..1d4e0fd4e2753 100644 --- a/fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp +++ b/fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp @@ -16,10 +16,15 @@ namespace facebook::fboss { +std::unique_ptr createHwEnsemble( + const HwSwitchEnsemble::Features& featuresDesired) { + return std::make_unique(featuresDesired); +} + std::unique_ptr createAndInitHwEnsemble( const HwSwitchEnsemble::Features& featuresDesired, const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info) { - auto ensemble = std::make_unique(featuresDesired); + auto ensemble = createHwEnsemble(featuresDesired); ensemble->init(info); return ensemble; } diff --git a/fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp b/fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp index 3831f0e58cd38..f31c888cbe033 100644 --- a/fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp +++ b/fboss/agent/hw/sai/hw_test/HwSwitchEnsembleFactory.cpp @@ -16,10 +16,15 @@ namespace facebook::fboss { +std::unique_ptr createHwEnsemble( + const HwSwitchEnsemble::Features& featuresDesired) { + return std::make_unique(featuresDesired); +} + std::unique_ptr createAndInitHwEnsemble( const HwSwitchEnsemble::Features& featuresDesired, const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info) { - auto ensemble = std::make_unique(featuresDesired); + auto ensemble = createHwEnsemble(featuresDesired); ensemble->init(info); return ensemble; } diff --git a/fboss/agent/hw/test/HwSwitchEnsembleFactory.h b/fboss/agent/hw/test/HwSwitchEnsembleFactory.h index d100d6e9cb2c6..addf97f56909e 100644 --- a/fboss/agent/hw/test/HwSwitchEnsembleFactory.h +++ b/fboss/agent/hw/test/HwSwitchEnsembleFactory.h @@ -25,6 +25,9 @@ namespace facebook::fboss { * members - HwSwitch, Platform) interfaces. */ +std::unique_ptr createHwEnsemble( + const HwSwitchEnsemble::Features& featuresDesired); + std::unique_ptr createAndInitHwEnsemble( const HwSwitchEnsemble::Features& featuresDesired, const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info = diff --git a/fboss/agent/hw/test/HwTest.cpp b/fboss/agent/hw/test/HwTest.cpp index 665e0b0393c78..ba4b5bcd3cb7f 100644 --- a/fboss/agent/hw/test/HwTest.cpp +++ b/fboss/agent/hw/test/HwTest.cpp @@ -95,7 +95,8 @@ void HwTest::SetUp() { // Set watermark stats update interval to 0 so we always refresh BST stats // in each updateStats call FLAGS_update_watermark_stats_interval_s = 0; - hwSwitchEnsemble_ = createAndInitHwEnsemble(featuresDesired(), initInfo); + hwSwitchEnsemble_ = createHwEnsemble(featuresDesired()); + hwSwitchEnsemble_->init(initInfo); hwSwitchEnsemble_->addHwEventObserver(this); if (getHwSwitch()->getBootType() == BootType::WARM_BOOT) { // For warm boots, in wedge_agent at this point we would From cacdcf2410337a27f8bcd56428a90d79e36b489a Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sat, 4 Feb 2023 20:06:29 -0800 Subject: [PATCH 112/280] More plumbing for overriding dsf nodes Summary: - We need current set of dsf nodes as input to overrideDsfNodes, provide that. - Better naming for overrideDsfNodes map variable Reviewed By: harshitgulati18 Differential Revision: D43023739 Privacy Context Container: L1125642 fbshipit-source-id: b43afed0f4b4da5a414acbe00f3b692ac51eba60 --- fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp | 3 ++- fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp | 4 ++-- fboss/agent/hw/test/HwSwitchEnsemble.h | 2 +- fboss/agent/hw/test/HwTest.cpp | 3 ++- fboss/agent/hw/test/HwTest.h | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp index 0e1251c15a8e8..a19e0220d05cb 100644 --- a/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp +++ b/fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp @@ -201,7 +201,8 @@ void BcmSwitchEnsemble::runDiagCommand( void BcmSwitchEnsemble::init( const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info) { - CHECK(!info.dsfNodes.has_value()) << " Dsf nodes not support in BCM tests"; + CHECK(!info.overrideDsfNodes.has_value()) + << " Dsf nodes not supported in BCM tests"; auto platform = createTestPlatform(); auto bcmTestPlatform = static_cast(platform.get()); std::unique_ptr agentConfig; diff --git a/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp b/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp index 2e9b50f6bb96e..3d74948e25f95 100644 --- a/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp +++ b/fboss/agent/hw/sai/hw_test/SaiSwitchEnsemble.cpp @@ -145,9 +145,9 @@ std::map SaiSwitchEnsemble::dsfNodesFromInputConfig() void SaiSwitchEnsemble::init( const HwSwitchEnsemble::HwSwitchEnsembleInitInfo& info) { auto agentConfig = getAgentConfig(); - if (info.dsfNodes.has_value()) { + if (info.overrideDsfNodes.has_value()) { cfg::AgentConfig thrift = agentConfig->thrift; - thrift.sw()->dsfNodes() = *info.dsfNodes; + thrift.sw()->dsfNodes() = *info.overrideDsfNodes; agentConfig = std::make_unique(thrift, ""); } initFlagDefaults(*agentConfig->thrift.defaultCommandLineArgs()); diff --git a/fboss/agent/hw/test/HwSwitchEnsemble.h b/fboss/agent/hw/test/HwSwitchEnsemble.h index cd427d06705da..8e1817c062eb5 100644 --- a/fboss/agent/hw/test/HwSwitchEnsemble.h +++ b/fboss/agent/hw/test/HwSwitchEnsemble.h @@ -77,7 +77,7 @@ class HwSwitchEnsemble : public HwSwitch::Callback { void stopObservers(); struct HwSwitchEnsembleInitInfo { std::optional overrideTransceiverInfo; - std::optional> dsfNodes; + std::optional> overrideDsfNodes; }; enum Feature : uint32_t { PACKET_RX, diff --git a/fboss/agent/hw/test/HwTest.cpp b/fboss/agent/hw/test/HwTest.cpp index ba4b5bcd3cb7f..e848d5a8accc0 100644 --- a/fboss/agent/hw/test/HwTest.cpp +++ b/fboss/agent/hw/test/HwTest.cpp @@ -91,11 +91,12 @@ void HwTest::SetUp() { folly::SingletonVault::singleton()->reenableInstances(); HwSwitchEnsemble::HwSwitchEnsembleInitInfo initInfo; initInfo.overrideTransceiverInfo = overrideTransceiverInfo(); - initInfo.dsfNodes = overrideDsfNodes(); // Set watermark stats update interval to 0 so we always refresh BST stats // in each updateStats call FLAGS_update_watermark_stats_interval_s = 0; hwSwitchEnsemble_ = createHwEnsemble(featuresDesired()); + initInfo.overrideDsfNodes = + overrideDsfNodes(hwSwitchEnsemble_->dsfNodesFromInputConfig()); hwSwitchEnsemble_->init(initInfo); hwSwitchEnsemble_->addHwEventObserver(this); if (getHwSwitch()->getBootType() == BootType::WARM_BOOT) { diff --git a/fboss/agent/hw/test/HwTest.h b/fboss/agent/hw/test/HwTest.h index b17c0e334f110..b5fc852314170 100644 --- a/fboss/agent/hw/test/HwTest.h +++ b/fboss/agent/hw/test/HwTest.h @@ -167,8 +167,8 @@ class HwTest : public ::testing::Test, virtual std::optional overrideTransceiverInfo() const { return std::nullopt; } - virtual std::optional> overrideDsfNodes() - const { + virtual std::optional> overrideDsfNodes( + const std::map& /*curDsfNodes*/) const { return std::nullopt; } From 0695ad3f9970849d99fd29b54950dd33c5f8bcf5 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Sun, 5 Feb 2023 15:45:14 -0800 Subject: [PATCH 113/280] Move createMakaluWedgeManager to base WedgeManagerInit.cpp Differential Revision: D43027525 fbshipit-source-id: 44a5bdd4f0912db4c5bb2b410be5e2a66a195d53 --- cmake/QsfpServicePlatformsWedge.cmake | 1 + .../platforms/wedge/WedgeManagerInit.cpp | 12 ++++++++++++ .../platforms/wedge/oss/WedgeManagerInit.cpp | 4 ---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cmake/QsfpServicePlatformsWedge.cmake b/cmake/QsfpServicePlatformsWedge.cmake index f4911134d9983..63b4579ad17e3 100644 --- a/cmake/QsfpServicePlatformsWedge.cmake +++ b/cmake/QsfpServicePlatformsWedge.cmake @@ -23,6 +23,7 @@ target_link_libraries(qsfp_platforms_wedge wedge100_platform_mapping wedge40_platform_mapping kamet_platform_mapping + makalu_platform_mapping platform_base qsfp_config ) diff --git a/fboss/qsfp_service/platforms/wedge/WedgeManagerInit.cpp b/fboss/qsfp_service/platforms/wedge/WedgeManagerInit.cpp index 6bd8b70a63cf4..d6b546f7cf739 100644 --- a/fboss/qsfp_service/platforms/wedge/WedgeManagerInit.cpp +++ b/fboss/qsfp_service/platforms/wedge/WedgeManagerInit.cpp @@ -10,8 +10,10 @@ #include "fboss/qsfp_service/platforms/wedge/WedgeManagerInit.h" #include "fboss/agent/platforms/common/kamet/KametPlatformMapping.h" +#include "fboss/agent/platforms/common/makalu/MakaluPlatformMapping.h" #include "fboss/lib/bsp/BspGenericSystemContainer.h" #include "fboss/lib/bsp/kamet/KametBspPlatformMapping.h" +#include "fboss/lib/bsp/makalu/MakaluBspPlatformMapping.h" #include "fboss/lib/platforms/PlatformProductInfo.h" #include "fboss/qsfp_service/platforms/wedge/BspWedgeManager.h" #include "fboss/qsfp_service/platforms/wedge/GalaxyManager.h" @@ -67,5 +69,15 @@ std::unique_ptr createKametWedgeManager() { std::make_unique(), PlatformMode::KAMET); } + +std::unique_ptr createMakaluWedgeManager() { + auto systemContainer = + BspGenericSystemContainer::getInstance().get(); + return std::make_unique( + systemContainer, + std::make_unique(systemContainer), + std::make_unique(), + PlatformMode::MAKALU); +} } // namespace fboss } // namespace facebook diff --git a/fboss/qsfp_service/platforms/wedge/oss/WedgeManagerInit.cpp b/fboss/qsfp_service/platforms/wedge/oss/WedgeManagerInit.cpp index 09fba2f63765e..814e0fb38f1ea 100644 --- a/fboss/qsfp_service/platforms/wedge/oss/WedgeManagerInit.cpp +++ b/fboss/qsfp_service/platforms/wedge/oss/WedgeManagerInit.cpp @@ -47,9 +47,5 @@ std::unique_ptr createSandiaWedgeManager() { return std::unique_ptr{}; } -std::unique_ptr createMakaluWedgeManager() { - return std::unique_ptr{}; -} - } // namespace fboss } // namespace facebook From c24324d9ca63f72211a08156fcc3b40e43d9dce3 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Sun, 5 Feb 2023 15:45:14 -0800 Subject: [PATCH 114/280] Handle makalu in OSS build of wedge_qsfp_util Summary: as titled. Added changes to create TransceiverI2CApi and TransceiverPlatformApi for Makalu in oss build of wedge_qsfp_util Differential Revision: D43027524 Privacy Context Container: L1125642 fbshipit-source-id: 3d43b8340fdee3045b5a61b0353fc6a026fc70ed --- fboss/util/oss/wedge_qsfp_util.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/fboss/util/oss/wedge_qsfp_util.cpp b/fboss/util/oss/wedge_qsfp_util.cpp index 2dd86c1d8659f..b72ca3c7f6696 100644 --- a/fboss/util/oss/wedge_qsfp_util.cpp +++ b/fboss/util/oss/wedge_qsfp_util.cpp @@ -4,6 +4,7 @@ #include "fboss/lib/bsp/BspIOBus.h" #include "fboss/lib/bsp/BspTransceiverApi.h" #include "fboss/lib/bsp/kamet/KametBspPlatformMapping.h" +#include "fboss/lib/bsp/makalu/MakaluBspPlatformMapping.h" #include "fboss/lib/platforms/PlatformProductInfo.h" #include "fboss/lib/usb/GalaxyI2CBus.h" #include "fboss/lib/usb/Wedge100I2CBus.h" @@ -34,6 +35,12 @@ std::pair, int> getTransceiverAPI() { .get(); auto ioBus = std::make_unique(systemContainer); return std::make_pair(std::move(ioBus), 0); + } else if (FLAGS_platform == "makalu") { + auto systemContainer = + BspGenericSystemContainer::getInstance() + .get(); + auto ioBus = std::make_unique(systemContainer); + return std::make_pair(std::move(ioBus), 0); } else { fprintf(stderr, "Unknown platform %s\n", FLAGS_platform.c_str()); return std::make_pair(nullptr, EX_USAGE); @@ -50,6 +57,12 @@ std::pair, int> getTransceiverAPI() { BspGenericSystemContainer::getInstance().get(); auto ioBus = std::make_unique(systemContainer); return std::make_pair(std::move(ioBus), 0); + } else if (mode == PlatformMode::MAKALU) { + auto systemContainer = + BspGenericSystemContainer::getInstance() + .get(); + auto ioBus = std::make_unique(systemContainer); + return std::make_pair(std::move(ioBus), 0); } // TODO(klahey): Should probably verify the other chip architecture. @@ -72,6 +85,8 @@ getTransceiverPlatformAPI(TransceiverI2CApi* i2cBus) { // Fpga object if (FLAGS_platform == "kamet") { mode = PlatformMode::KAMET; + } else if (FLAGS_platform == "makalu") { + mode = PlatformMode::MAKALU; } } else { // If the platform is not provided by the user then use current hardware's @@ -88,6 +103,12 @@ getTransceiverPlatformAPI(TransceiverI2CApi* i2cBus) { BspGenericSystemContainer::getInstance().get(); return std::make_pair( std::make_unique(systemContainer), 0); + } else if (mode == PlatformMode::MAKALU) { + auto systemContainer = + BspGenericSystemContainer::getInstance() + .get(); + return std::make_pair( + std::make_unique(systemContainer), 0); } return std::make_pair(nullptr, EX_USAGE); } From d4086f01715fa779cc16202f1fe02c45089ec105 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Sun, 5 Feb 2023 15:48:18 -0800 Subject: [PATCH 115/280] Added feature for reading PCS and FEC Lane diagnostics Summary: as titled. Will enable it on Ebro ASIC later in the stack Differential Revision: D43015977 Privacy Context Container: L1125642 fbshipit-source-id: 441bf272b4d42f01a1fdbd929cd9e496000068e7 --- fboss/agent/hw/switch_asics/EbroAsic.cpp | 2 ++ fboss/agent/hw/switch_asics/GaronneAsic.cpp | 2 ++ fboss/agent/hw/switch_asics/HwAsic.h | 2 ++ fboss/agent/hw/switch_asics/IndusAsic.cpp | 2 ++ fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp | 2 ++ fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp | 2 ++ fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp | 2 ++ fboss/agent/hw/switch_asics/TomahawkAsic.cpp | 2 ++ fboss/agent/hw/switch_asics/Trident2Asic.cpp | 2 ++ 9 files changed, 18 insertions(+) diff --git a/fboss/agent/hw/switch_asics/EbroAsic.cpp b/fboss/agent/hw/switch_asics/EbroAsic.cpp index 7e66302433e32..a396dcda41ae3 100644 --- a/fboss/agent/hw/switch_asics/EbroAsic.cpp +++ b/fboss/agent/hw/switch_asics/EbroAsic.cpp @@ -127,6 +127,8 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::DLB: + case HwAsic::Feature::FEC_AM_LOCK_STATUS: + case HwAsic::Feature::PCS_RX_LINK_STATUS: return false; } return false; diff --git a/fboss/agent/hw/switch_asics/GaronneAsic.cpp b/fboss/agent/hw/switch_asics/GaronneAsic.cpp index 91465530ea0ba..1b1a85609b946 100644 --- a/fboss/agent/hw/switch_asics/GaronneAsic.cpp +++ b/fboss/agent/hw/switch_asics/GaronneAsic.cpp @@ -128,6 +128,8 @@ bool GaronneAsic::isSupported(Feature feature) const { case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::DLB: case HwAsic::Feature::P4_WARMBOOT: + case HwAsic::Feature::FEC_AM_LOCK_STATUS: + case HwAsic::Feature::PCS_RX_LINK_STATUS: return false; } return false; diff --git a/fboss/agent/hw/switch_asics/HwAsic.h b/fboss/agent/hw/switch_asics/HwAsic.h index e0a59db700597..6b3ad2a4b765d 100644 --- a/fboss/agent/hw/switch_asics/HwAsic.h +++ b/fboss/agent/hw/switch_asics/HwAsic.h @@ -126,6 +126,8 @@ class HwAsic { DLB, P4_WARMBOOT, IN_PAUSE_INCREMENTS_DISCARDS, + FEC_AM_LOCK_STATUS, + PCS_RX_LINK_STATUS, }; enum class AsicMode { diff --git a/fboss/agent/hw/switch_asics/IndusAsic.cpp b/fboss/agent/hw/switch_asics/IndusAsic.cpp index 0d41a634fe733..9cf54edef83da 100644 --- a/fboss/agent/hw/switch_asics/IndusAsic.cpp +++ b/fboss/agent/hw/switch_asics/IndusAsic.cpp @@ -124,6 +124,8 @@ bool IndusAsic::isSupported(Feature feature) const { case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::DLB: case HwAsic::Feature::P4_WARMBOOT: + case HwAsic::Feature::FEC_AM_LOCK_STATUS: + case HwAsic::Feature::PCS_RX_LINK_STATUS: return false; } return false; diff --git a/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp b/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp index 1b47ed7b389a6..8489536aae932 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp +++ b/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp @@ -119,6 +119,8 @@ bool Tomahawk3Asic::isSupported(Feature feature) const { case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::P4_WARMBOOT: + case HwAsic::Feature::FEC_AM_LOCK_STATUS: + case HwAsic::Feature::PCS_RX_LINK_STATUS: return false; } return false; diff --git a/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp b/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp index e633a169158e6..aaf6e5d97d332 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp +++ b/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp @@ -140,6 +140,8 @@ bool Tomahawk4Asic::isSupported(Feature feature) const { case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::P4_WARMBOOT: + case HwAsic::Feature::FEC_AM_LOCK_STATUS: + case HwAsic::Feature::PCS_RX_LINK_STATUS: return false; } return false; diff --git a/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp b/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp index a932dd0067b35..5bed9af8b9726 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp +++ b/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp @@ -120,6 +120,8 @@ bool Tomahawk5Asic::isSupported(Feature feature) const { case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::P4_WARMBOOT: + case HwAsic::Feature::FEC_AM_LOCK_STATUS: + case HwAsic::Feature::PCS_RX_LINK_STATUS: return false; } return false; diff --git a/fboss/agent/hw/switch_asics/TomahawkAsic.cpp b/fboss/agent/hw/switch_asics/TomahawkAsic.cpp index 0eb707a68132a..08c6dba862f56 100644 --- a/fboss/agent/hw/switch_asics/TomahawkAsic.cpp +++ b/fboss/agent/hw/switch_asics/TomahawkAsic.cpp @@ -119,6 +119,8 @@ bool TomahawkAsic::isSupported(Feature feature) const { case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::DLB: case HwAsic::Feature::P4_WARMBOOT: + case HwAsic::Feature::FEC_AM_LOCK_STATUS: + case HwAsic::Feature::PCS_RX_LINK_STATUS: return false; } return false; diff --git a/fboss/agent/hw/switch_asics/Trident2Asic.cpp b/fboss/agent/hw/switch_asics/Trident2Asic.cpp index 1d43773fdc839..955e2780999be 100644 --- a/fboss/agent/hw/switch_asics/Trident2Asic.cpp +++ b/fboss/agent/hw/switch_asics/Trident2Asic.cpp @@ -119,6 +119,8 @@ bool Trident2Asic::isSupported(Feature feature) const { case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::DLB: case HwAsic::Feature::P4_WARMBOOT: + case HwAsic::Feature::FEC_AM_LOCK_STATUS: + case HwAsic::Feature::PCS_RX_LINK_STATUS: return false; } return false; From 1cfcb9cfc9cfa3c3e7a2af118a23af67fa8d40ef Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sun, 5 Feb 2023 17:25:02 -0800 Subject: [PATCH 116/280] Create a MultiDsfNodes test abstraction and get rid of max cores hack Summary: As titled. Have MultiDsfNodes provide the right number of dsf nodes so we can compute MaxSystemCores correctly during init. Differential Revision: D43026059 Privacy Context Container: L1125642 fbshipit-source-id: 27dc02e7a2759ea80a29b26b2ccdd15074aa34d3 --- fboss/agent/hw/test/HwVoqSwitchTests.cpp | 38 +++++++++++++++++------ fboss/agent/platforms/sai/SaiPlatform.cpp | 7 +---- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/fboss/agent/hw/test/HwVoqSwitchTests.cpp b/fboss/agent/hw/test/HwVoqSwitchTests.cpp index f8e9450b51a42..88929dc2319ff 100644 --- a/fboss/agent/hw/test/HwVoqSwitchTests.cpp +++ b/fboss/agent/hw/test/HwVoqSwitchTests.cpp @@ -544,16 +544,6 @@ TEST_F(HwVoqSwitchTest, rxPacketToCpu) { verifyAcrossWarmBoots([] {}, verify); } -TEST_F(HwVoqSwitchTest, multipleDsfNodes) { - auto setup = [this]() { - auto cfg = initialConfig(); - auto otherDsfNodeCfg = utility::dsfNodeConfig(*getPlatform()->getAsic()); - cfg.dsfNodes()->insert({*otherDsfNodeCfg.switchId(), otherDsfNodeCfg}); - applyNewConfig(cfg); - }; - verifyAcrossWarmBoots(setup, [] {}); -} - TEST_F(HwVoqSwitchTest, AclQualifiers) { auto setup = [=]() { auto newCfg = initialConfig(); @@ -598,4 +588,32 @@ TEST_F(HwVoqSwitchTest, checkFabricReachability) { [] {}, [this]() { checkFabricReachability(getHwSwitch()); }); } +class HwVoqSwitchWithMultipleDsfNodesTest : public HwVoqSwitchTest { + public: + cfg::SwitchConfig initialConfig() const override { + auto cfg = HwVoqSwitchTest::initialConfig(); + cfg.dsfNodes() = *overrideDsfNodes(*cfg.dsfNodes()); + return cfg; + } + std::optional> overrideDsfNodes( + const std::map& curDsfNodes) const override { + CHECK(!curDsfNodes.empty()); + auto dsfNodes = curDsfNodes; + const auto& firstDsfNode = dsfNodes.begin()->second; + CHECK(firstDsfNode.systemPortRange().has_value()); + auto asic = HwAsic::makeAsic( + *firstDsfNode.asicType(), + cfg::SwitchType::VOQ, + *firstDsfNode.switchId(), + *firstDsfNode.systemPortRange()); + auto otherDsfNodeCfg = utility::dsfNodeConfig(*asic); + dsfNodes.insert({*otherDsfNodeCfg.switchId(), otherDsfNodeCfg}); + return dsfNodes; + } +}; + +TEST_F(HwVoqSwitchWithMultipleDsfNodesTest, twoDsfNodes) { + verifyAcrossWarmBoots([] {}, [] {}); +} + } // namespace facebook::fboss diff --git a/fboss/agent/platforms/sai/SaiPlatform.cpp b/fboss/agent/platforms/sai/SaiPlatform.cpp index ec6efcd01c53a..4b85cbda412b4 100644 --- a/fboss/agent/platforms/sai/SaiPlatform.cpp +++ b/fboss/agent/platforms/sai/SaiPlatform.cpp @@ -371,12 +371,7 @@ SaiSwitchTraits::CreateAttributes SaiPlatform::getSwitchAttributes( throw FbossError("Unexpected asic type: ", *dsfNode.asicType()); } } - // FIXME: for some HwTest we create multiple DsfNode config - // as part of the test. This though is done post init and - // does not get factored in MaxSystemCores setting here. - // Fix this by percolating this information to init. - uint32_t minCores = 2 * getAsic()->getNumCores(); - cores = std::max(minCores, systemCores); + cores = systemCores; sysPortConfigs = SaiSwitchTraits::Attributes::SysPortConfigList{ getInternalSystemPortConfig()}; } From ea46f7a8c857bc9f036fee4548db1e2c8b9a8dfd Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sun, 5 Feb 2023 17:25:02 -0800 Subject: [PATCH 117/280] Greenlight HwVoqSwitchWithMultipleDsfNodesTest.* Summary: As titled Reviewed By: harshitgulati18 Differential Revision: D43023891 fbshipit-source-id: 01c4b911051329621615d51393646c965da45006 --- installer/centos-7-x86_64/run_scripts/run_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index f003f725f7067..f4d98166e2d1c 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -38,6 +38,7 @@ # Basic VOQ switch tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwVoqSwitchTest* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwVoqSwitchWithFabriPortsTest.* +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwVoqSwitchWithMultipleDsfNodesTest.* # Basic forwarding tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwJumboFramesTest.* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoopBackTest.* From 3b6a6e9bcf311378594f852950393117d8b5800a Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sun, 5 Feb 2023 17:25:02 -0800 Subject: [PATCH 118/280] Fabric reachability test should be run with fabric ports enabled Summary: As titled Reviewed By: harshitgulati18 Differential Revision: D43024076 fbshipit-source-id: 3b868453413069ab730f6d1a1507a058bd330836 --- fboss/agent/hw/test/HwVoqSwitchTests.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fboss/agent/hw/test/HwVoqSwitchTests.cpp b/fboss/agent/hw/test/HwVoqSwitchTests.cpp index 88929dc2319ff..a823e1e5ecf7b 100644 --- a/fboss/agent/hw/test/HwVoqSwitchTests.cpp +++ b/fboss/agent/hw/test/HwVoqSwitchTests.cpp @@ -373,6 +373,11 @@ TEST_F(HwVoqSwitchWithFabricPortsTest, collectStats) { verifyAcrossWarmBoots([] {}, verify); } +TEST_F(HwVoqSwitchWithFabricPortsTest, checkFabricReachability) { + verifyAcrossWarmBoots( + [] {}, [this]() { checkFabricReachability(getHwSwitch()); }); +} + TEST_F(HwVoqSwitchTest, remoteSystemPort) { auto setup = [this]() { addRemoteSysPort(SystemPortID(401)); }; verifyAcrossWarmBoots(setup, [] {}); @@ -583,11 +588,6 @@ TEST_F(HwVoqSwitchTest, AclCounter) { verifyAcrossWarmBoots(setup, verify); } -TEST_F(HwVoqSwitchTest, checkFabricReachability) { - verifyAcrossWarmBoots( - [] {}, [this]() { checkFabricReachability(getHwSwitch()); }); -} - class HwVoqSwitchWithMultipleDsfNodesTest : public HwVoqSwitchTest { public: cfg::SwitchConfig initialConfig() const override { From 52f142a2f0fd0b7ddcc2682f6cb7207d228cc42b Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sun, 5 Feb 2023 17:25:02 -0800 Subject: [PATCH 119/280] Update instructions for Kamet and Makalu test runs Summary: As titled Reviewed By: nivinl Differential Revision: D43026926 fbshipit-source-id: c0d520d76978990f8259a5676910e2cce9065682 --- installer/centos-7-x86_64/run_scripts/run_test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index f4d98166e2d1c..21874a3f9516e 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -35,6 +35,8 @@ # ./run_test.py sai --config fuji.agent.materialized_JSON --filter HwVlanTest.VlanApplyConfig --sdk_logging /root/skhare/sai_replayer_logs --no-oss --sai-bin /root/skhare/sai_test-brcm-7.2.0.0_odp --mgmt-if eth0 # # All tests matching following filter are expected to PASS on Makalu +# Note: For Makalu test runs suffix --coldboot_only to all tests. Warm boot +# is not yet supported on Makalu # Basic VOQ switch tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwVoqSwitchTest* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwVoqSwitchWithFabriPortsTest.* @@ -64,6 +66,8 @@ # --filter=HwAclStatTest.*:-*AclStatCreate:*AclStatCreateShared:*AclStatCreateMultiple:*AclStatMultipleActions:*AclStatDeleteShared*:*AclStatDeleteSharedPostWarmBoot:*AclStatRename*:*AclStatModify:*AclStatShuffle:*StatNumberOfCounters:*AclStatChangeCounterType # All tests matching following filter are expected to PASS on Kamet +# Note: For Kamet test runs suffix --coldboot_only to all tests. Warm boot +# is not yet supported on Kamet # ./run_test.py sai --config kamet.agent.materialized_JSON --filter=HwFabricSwitchTest* OPT_ARG_COLDBOOT = "--coldboot_only" From 3b10223af977a4743d5b682730effcd41107ffc1 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sun, 5 Feb 2023 17:25:02 -0800 Subject: [PATCH 120/280] Update list of tests that pass in voq, fabric mode on 400c Summary: As titled. We will use this list to communicate with vendor on what tests are expected to pass for these switches Differential Revision: D43033604 fbshipit-source-id: c5018ebc03f68d7e73a358475bf3aee82d353913 --- .../centos-7-x86_64/run_scripts/run_test.py | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 21874a3f9516e..9723018a74787 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -34,8 +34,37 @@ # Running non-OSS: # ./run_test.py sai --config fuji.agent.materialized_JSON --filter HwVlanTest.VlanApplyConfig --sdk_logging /root/skhare/sai_replayer_logs --no-oss --sai-bin /root/skhare/sai_test-brcm-7.2.0.0_odp --mgmt-if eth0 # -# All tests matching following filter are expected to PASS on Makalu -# Note: For Makalu test runs suffix --coldboot_only to all tests. Warm boot +# All tests matching the following filters pass on w400C in VOQ mode +# Note: For w400c (VOQ) mode test runs, suffix --coldboot_only to all tests. +# Warm boot# is not yet supported on w400c in voq mode. +# VOQ tests +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwVoqSwitchTest.*:-*sendPacketCpu*:*trapPktsOnPort*:*AclQualifier* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwVoqSwitchWithFabricPortsTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwVoqSwitchWithMultipleDsfNodesTest.* +# +# Basic forwarding tests +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwLoopBackTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwL4PortBlackHolingTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwJumboFramesTest.* +# Route programming tests +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwRouteTest/1.*:-*Mpls* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwRouteTest/1.*:-*Mpls* +# ACL tests +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclCounterTest.*:-*Sport*:*BumpOn*Cpu* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=SaiAclTableRecreateTests.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclPriorityTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclMatchActionsTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclStatTest.* +# Counter Tests +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwInDiscardsCounterTest.* +# +# All tests matching the following filters pass on w400C in fabric mode +# Note: For w400c (fabric) mode test runs, suffix --coldboot_only to all tests. +# Warm boot# is not yet supported on w400c in fabric mode. +# ./run_test.py sai --config wedge400c_fabric.agent.materialized_JSON --filter=HwFabricSwitchTest.* + +# All tests matching following filters are expected to PASS on Makalu +# Note: For Makalu test runs, suffix --coldboot_only to all tests. Warm boot # is not yet supported on Makalu # Basic VOQ switch tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwVoqSwitchTest* @@ -66,7 +95,7 @@ # --filter=HwAclStatTest.*:-*AclStatCreate:*AclStatCreateShared:*AclStatCreateMultiple:*AclStatMultipleActions:*AclStatDeleteShared*:*AclStatDeleteSharedPostWarmBoot:*AclStatRename*:*AclStatModify:*AclStatShuffle:*StatNumberOfCounters:*AclStatChangeCounterType # All tests matching following filter are expected to PASS on Kamet -# Note: For Kamet test runs suffix --coldboot_only to all tests. Warm boot +# Note: For Kamet test runs, suffix --coldboot_only to all tests. Warm boot # is not yet supported on Kamet # ./run_test.py sai --config kamet.agent.materialized_JSON --filter=HwFabricSwitchTest* From a9c7fb878167cdd478fc5c4d077e016abbe89754 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 121/280] TestUtils: helpers to add/remove switchID for VOQ switch Summary: As titled. Leveraged by later stacked diffs. In addition to setting/unsetting switchID, for VOQ switches we need to add/remove other implicit config as well viz.: dsfNode map, recycle port RIF. Reviewed By: jasmeetbagga Differential Revision: D42557651 Privacy Context Container: L1125642 fbshipit-source-id: b48d5e1c64cbf968df25648400032ee38cc99533 --- fboss/agent/test/TestUtils.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/fboss/agent/test/TestUtils.cpp b/fboss/agent/test/TestUtils.cpp index 5d34fe67726cf..a8f74d9351cf0 100644 --- a/fboss/agent/test/TestUtils.cpp +++ b/fboss/agent/test/TestUtils.cpp @@ -236,6 +236,34 @@ cfg::SwitchConfig testConfigAImpl(bool isMhnic, cfg::SwitchType switchType) { return cfg; } +void removeSwitchID(cfg::SwitchConfig& newCfg, int64_t oldSwitchId) { + CHECK(*newCfg.switchSettings()->switchType() == cfg::SwitchType::VOQ); + CHECK(newCfg.switchSettings()->switchId()); + CHECK(*newCfg.switchSettings()->switchId() == oldSwitchId); + + newCfg.switchSettings()->switchId().reset(); + newCfg.dsfNodes()->erase(oldSwitchId); + + cfg::DsfNode oldNode = makeDsfNodeCfg(oldSwitchId); + newCfg.interfaces()->erase( + std::remove_if( + newCfg.interfaces()->begin(), + newCfg.interfaces()->end(), + [&](auto& interface) { + return *interface.intfID() == recycleSysPortId(oldNode); + }), + newCfg.interfaces()->end()); +} + +void addSwitchID(cfg::SwitchConfig& newCfg, int64_t newSwitchId) { + CHECK(*newCfg.switchSettings()->switchType() == cfg::SwitchType::VOQ); + CHECK(!newCfg.switchSettings()->switchId()); + + newCfg.switchSettings()->switchId() = newSwitchId; + newCfg.dsfNodes()->insert({newSwitchId, makeDsfNodeCfg(newSwitchId)}); + addRecyclePortRif(newCfg.dsfNodes()->find(newSwitchId)->second, newCfg); +} + } // namespace namespace facebook::fboss { From 0518d9ddeadc55724a311004cb2f176defeddff4 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 122/280] TestUtils.cpp: updateSwitchID to remove then add Summary: The current implementation overwrites switchID but adds/appends to dsfNodes map and list of interfaces, which is incorrect during an update opration. Instead, remove old config (switchID, dsfNode entry, recycle port entry) and then add new. Reviewed By: jasmeetbagga Differential Revision: D42557652 Privacy Context Container: L1125642 fbshipit-source-id: 7b50444dde3f7aef5a8674c7d0ea7d517632d0dd --- fboss/agent/state/tests/SystemPortTests.cpp | 2 +- fboss/agent/test/TestUtils.cpp | 10 ++++++---- fboss/agent/test/TestUtils.h | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fboss/agent/state/tests/SystemPortTests.cpp b/fboss/agent/state/tests/SystemPortTests.cpp index cb954e76ae508..34fe8bbf910d1 100644 --- a/fboss/agent/state/tests/SystemPortTests.cpp +++ b/fboss/agent/state/tests/SystemPortTests.cpp @@ -120,7 +120,7 @@ TEST(SystemPort, sysPortApplyConfigSwitchIdChange) { ASSERT_NE(nullptr, stateV1); EXPECT_EQ(stateV1->getSystemPorts()->size(), stateV1->getPorts()->size()); auto prevSwitchId = *config.switchSettings()->switchId(); - config = updateSwitchID(config, 2); + config = updateSwitchID(config, prevSwitchId, 2); auto stateV2 = publishAndApplyConfig(stateV1, &config, platform.get()); ASSERT_NE(nullptr, stateV2); diff --git a/fboss/agent/test/TestUtils.cpp b/fboss/agent/test/TestUtils.cpp index a8f74d9351cf0..212344585bae8 100644 --- a/fboss/agent/test/TestUtils.cpp +++ b/fboss/agent/test/TestUtils.cpp @@ -283,14 +283,16 @@ std::shared_ptr makeSysPort( sysPort->setQosPolicy(qosPolicy); return sysPort; } + cfg::SwitchConfig updateSwitchID( const cfg::SwitchConfig& origCfg, + int64_t oldSwitchId, int64_t newSwitchId) { auto newCfg{origCfg}; - CHECK(origCfg.switchSettings()->switchId()); - newCfg.switchSettings()->switchId() = newSwitchId; - newCfg.dsfNodes()->insert({newSwitchId, makeDsfNodeCfg(newSwitchId)}); - addRecyclePortRif(newCfg.dsfNodes()->find(newSwitchId)->second, newCfg); + + removeSwitchID(newCfg, oldSwitchId); + addSwitchID(newCfg, newSwitchId); + return newCfg; } diff --git a/fboss/agent/test/TestUtils.h b/fboss/agent/test/TestUtils.h index f1778c16521bd..8810b59ed3346 100644 --- a/fboss/agent/test/TestUtils.h +++ b/fboss/agent/test/TestUtils.h @@ -94,6 +94,7 @@ cfg::DsfNode makeDsfNodeCfg( cfg::SwitchConfig updateSwitchID( const cfg::SwitchConfig& origCfg, + int64_t oldSwitchId, int64_t newSwitchId); std::shared_ptr makeSysPort( From 93db332317efc2f4858d52c441077673922a8f7d Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 123/280] Skip updateVlans for VOQ/Fabric switches Summary: As titled. See comments in the code for why. updatePseudoVlan diff is stacked. Reviewed By: jasmeetbagga Differential Revision: D43031621 Privacy Context Container: L1125642 fbshipit-source-id: 222d8b9e6128f3dfdad8928cc21561d147707dd6 --- fboss/agent/ApplyThriftConfig.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index 90824c1d2b0df..daeeb09ea1f78 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -2059,6 +2059,24 @@ uint8_t ThriftConfigApplier::computeMinimumLinkCount( } shared_ptr ThriftConfigApplier::updateVlans() { + // TODO(skhare) + // VOQ/Fabric switches require that the packets are not tagged with any + // VLAN. We are gradually enhancing wedge_agent to handle tagged as well as + // untagged packets. During this transition, we will use PseudoVlan (VlanID + // 0) to populate SwitchState/Neighbor cache etc. data structures. + // Thus, for VOQ/Fabric switches, cfg_ will not carry vlan, but after + // updatePseudoVlan() runs, origVlans will carry pseudoVlan which will be + // removed by updateVlans() processig. + // Avoid it by skipping updateVlans() for VOQ/Fabric switches. + // Once wedge_agent changes are complete, we can remove this check as + // cfg_->vlans and origVlans will always be empty for VOQ/Fabric switches and + // then this function will be a no-op + auto switchType = *cfg_->switchSettings()->switchType(); + if (switchType == cfg::SwitchType::VOQ || + switchType == cfg::SwitchType::FABRIC) { + return nullptr; + } + auto origVlans = orig_->getVlans(); VlanMap::NodeContainer newVlans; bool changed = false; From e5d8495c1ba5af4bde9d7fcd19045a973a077c74 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 124/280] TestUtils remove pseudo vlan from TestUtils config Summary: This will be added implicity by ApplyThriftConfig updatePseudoVlans(), diff stacked. No need to carry this in the config. Reviewed By: jasmeetbagga Differential Revision: D43031622 Privacy Context Container: L1125642 fbshipit-source-id: af5540b3c2825fd0ad8f4de6a288173f59e3053c --- fboss/agent/test/TestUtils.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fboss/agent/test/TestUtils.cpp b/fboss/agent/test/TestUtils.cpp index 212344585bae8..419c3a4d7556b 100644 --- a/fboss/agent/test/TestUtils.cpp +++ b/fboss/agent/test/TestUtils.cpp @@ -177,10 +177,6 @@ cfg::SwitchConfig testConfigAImpl(bool isMhnic, cfg::SwitchType switchType) { cfg.vlanPorts()[p].logicalPort() = p + kInterfacePortIdBegin; cfg.vlanPorts()[p].vlanID() = p < 10 + kInterfacePortIdBegin ? 1 : 55; } - } else { - cfg.vlans()->resize(1); - cfg.vlans()[0].id() = 0; - cfg.vlans()[0].name() = "Vlan0"; } cfg.interfaces()->resize(2); From 7de476562abe6e5b24216fb5f138b00cdb2cafb6 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 125/280] Add interface IP addrs to pseudoVlan's nbr response table Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. applicable for voq switches only Reviewed By: jasmeetbagga Differential Revision: D42464991 Privacy Context Container: L1125642 fbshipit-source-id: 32d9ad57043bf9d637280afe1ffc37185f98eae2 --- fboss/agent/ApplyThriftConfig.cpp | 97 ++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 2 deletions(-) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index daeeb09ea1f78..e700c17d284f3 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -89,6 +89,8 @@ namespace { const uint8_t kV6LinkLocalAddrMask{64}; +facebook::fboss::VlanID kPseudoVlanID(0); + // Only one buffer pool is supported systemwide. Variable to track the name // and validate during a config change. std::optional sharedBufferPoolName; @@ -281,6 +283,8 @@ class ThriftConfigApplier { uint8_t computeMinimumLinkCount(const cfg::AggregatePort& cfg); std::shared_ptr updateVlans(); std::shared_ptr updatePseudoVlans(); + shared_ptr createPseudoVlan(); + shared_ptr updatePseudoVlan(const shared_ptr& orig); std::shared_ptr createVlan(const cfg::Vlan* config); std::shared_ptr updateVlan( const std::shared_ptr& orig, @@ -332,6 +336,7 @@ class ThriftConfigApplier { IPAddr ip, IntefaceIpInfo addrInfo); bool updateNeighborResponseTables(Vlan* vlan, const cfg::Vlan* config); + bool updateNbrResponseTablesFromAllIntfCfg(Vlan* vlan); bool updateDhcpOverrides(Vlan* vlan, const cfg::Vlan* config); std::shared_ptr updateInterfaces(); shared_ptr createInterface( @@ -2176,8 +2181,51 @@ shared_ptr ThriftConfigApplier::updateVlan( } shared_ptr ThriftConfigApplier::updatePseudoVlans() { - // TODO(skhare) implement - return nullptr; + auto switchType = *cfg_->switchSettings()->switchType(); + CHECK( + switchType == cfg::SwitchType::VOQ || + switchType == cfg::SwitchType::FABRIC); + + auto origVlans = orig_->getVlans(); + auto origVlan = origVlans->getVlanIf(kPseudoVlanID); + VlanMap::NodeContainer newVlans; + bool changed = false; + + shared_ptr newVlan; + if (origVlan) { + // update pseudo VLAN + newVlan = updatePseudoVlan(origVlan); + } else { + newVlan = createPseudoVlan(); + } + + changed |= updateMap(&newVlans, origVlan, newVlan); + + if (!changed) { + return nullptr; + } + + return origVlans->clone(std::move(newVlans)); +} + +shared_ptr ThriftConfigApplier::updatePseudoVlan( + const shared_ptr& orig) { + auto newVlan = orig->clone(); + bool changed_neighbor_table = + updateNbrResponseTablesFromAllIntfCfg(newVlan.get()); + + if (!changed_neighbor_table) { + return nullptr; + } + + return newVlan; +} + +shared_ptr ThriftConfigApplier::createPseudoVlan() { + auto vlan = make_shared(kPseudoVlanID, std::string("pseudoVlan")); + updateNbrResponseTablesFromAllIntfCfg(vlan.get()); + + return vlan; } std::shared_ptr ThriftConfigApplier::updateQosPolicies() { @@ -2925,6 +2973,51 @@ ThriftConfigApplier::updateNeighborResponseEntry( } } +bool ThriftConfigApplier::updateNbrResponseTablesFromAllIntfCfg(Vlan* vlan) { + auto arpChanged = false, ndpChanged = false; + auto origArp = vlan->getArpResponseTable(); + auto origNdp = vlan->getNdpResponseTable(); + ArpResponseTable::NodeContainer arpTable; + NdpResponseTable::NodeContainer ndpTable; + + // Add every interface IP address to neighbor response table for pseudo vlan. + for (const auto& interfaceCfg : *cfg_->interfaces()) { + auto mac = getInterfaceMac(&interfaceCfg); + auto intfID = InterfaceID(*interfaceCfg.intfID()); + auto addresses = getInterfaceAddresses(&interfaceCfg); + + for (const auto& [ip, mask] : addresses) { + if (ip.isV4()) { + auto origNode = origArp->getEntry(ip.asV4()); + auto newNode = updateNeighborResponseEntry( + origNode, + ip.asV4(), + ThriftConfigApplier::IntefaceIpInfo{mask, mac, intfID}); + arpChanged |= updateMap(&arpTable, origNode, newNode); + } else { + auto origNode = origNdp->getEntry(ip.asV6()); + auto newNode = updateNeighborResponseEntry( + origNode, + ip.asV6(), + ThriftConfigApplier::IntefaceIpInfo{mask, mac, intfID}); + ndpChanged |= updateMap(&ndpTable, origNode, newNode); + } + } + } + + arpChanged |= origArp->size() != arpTable.size(); + ndpChanged |= origNdp->size() != ndpTable.size(); + + if (arpChanged) { + vlan->setArpResponseTable(origArp->clone(std::move(arpTable))); + } + if (ndpChanged) { + vlan->setNdpResponseTable(origNdp->clone(std::move(ndpTable))); + } + + return arpChanged || ndpChanged; +} + bool ThriftConfigApplier::updateNeighborResponseTables( Vlan* vlan, const cfg::Vlan* config) { From 6e9fd30dd5bc35eea57162d31390d58f794371c9 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 126/280] Only add unique entries to nbr response table Summary: As titled. Reviewed By: jasmeetbagga Differential Revision: D42806502 Privacy Context Container: L1125642 fbshipit-source-id: 50506daaf701d62609c0601d78629af2c7e774ac --- fboss/agent/ApplyThriftConfig.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index e700c17d284f3..1bd0eaa08b49a 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -2980,6 +2980,8 @@ bool ThriftConfigApplier::updateNbrResponseTablesFromAllIntfCfg(Vlan* vlan) { ArpResponseTable::NodeContainer arpTable; NdpResponseTable::NodeContainer ndpTable; + std::set> ipAddrsAdded; + // Add every interface IP address to neighbor response table for pseudo vlan. for (const auto& interfaceCfg : *cfg_->interfaces()) { auto mac = getInterfaceMac(&interfaceCfg); @@ -2987,6 +2989,13 @@ bool ThriftConfigApplier::updateNbrResponseTablesFromAllIntfCfg(Vlan* vlan) { auto addresses = getInterfaceAddresses(&interfaceCfg); for (const auto& [ip, mask] : addresses) { + auto ipAndMask = std::make_pair(ip, mask); + auto it = ipAddrsAdded.find(ipAndMask); + if (it != ipAddrsAdded.end()) { + continue; + } + ipAddrsAdded.insert(ipAndMask); + if (ip.isV4()) { auto origNode = origArp->getEntry(ip.asV4()); auto newNode = updateNeighborResponseEntry( From cfe1d78d4eeab3a88ff13decd3d30252bb258d01 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 127/280] Verify if pseudo vlans are programmed correctly Summary: As titled. Reviewed By: jasmeetbagga Differential Revision: D42542475 fbshipit-source-id: 534b507e8741129ae5487918fd85584c56fb9a06 --- fboss/agent/state/tests/InterfaceTests.cpp | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/fboss/agent/state/tests/InterfaceTests.cpp b/fboss/agent/state/tests/InterfaceTests.cpp index eecef954baa7b..b6dbe6fd3db5d 100644 --- a/fboss/agent/state/tests/InterfaceTests.cpp +++ b/fboss/agent/state/tests/InterfaceTests.cpp @@ -678,3 +678,54 @@ TEST(Interface, getInterfacePorts) { auto intf = stateV1->getInterfaces()->begin()->second; EXPECT_EQ(getPortsForInterface(intf->getID(), stateV1).size(), 11); } + +TEST(Interface, verifyPseudoVlanProcessing) { + auto platform = createMockPlatform(); + auto stateV0 = make_shared(); + + auto verifyConfigPseudoVlansMatch = [](const auto& config, + const auto& state) { + for (const auto& interfaceCfg : *config.interfaces()) { + for (const auto& addr : *interfaceCfg.ipAddresses()) { + auto ipAddr = folly::IPAddress::createNetwork(addr, -1, false).first; + auto expectedMac = interfaceCfg.mac(); + auto expectedIntfID = interfaceCfg.intfID(); + + if (ipAddr.isV4()) { + auto arpResponseEntry = state->getVlans() + ->getVlan(VlanID(0)) + ->getArpResponseTable() + ->getEntry(ipAddr.asV4()); + EXPECT_TRUE(arpResponseEntry != nullptr); + // no MAC for recycle port RIFs + if (expectedMac) { + EXPECT_EQ(*expectedMac, arpResponseEntry->getMac().toString()); + } + EXPECT_EQ( + InterfaceID(*expectedIntfID), arpResponseEntry->getInterfaceID()); + } else { + auto ndpResponseEntry = state->getVlans() + ->getVlan(VlanID(0)) + ->getNdpResponseTable() + ->getEntry(ipAddr.asV6()); + EXPECT_TRUE(ndpResponseEntry != nullptr); + // no MAC for recycle port RIFs + if (expectedMac) { + EXPECT_EQ(*expectedMac, ndpResponseEntry->getMac().toString()); + } + EXPECT_EQ( + InterfaceID(*expectedIntfID), ndpResponseEntry->getInterfaceID()); + } + } + } + }; + + // Verify if pseudo vlans are populated correctly + auto config = testConfigA(cfg::SwitchType::VOQ); + auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); + verifyConfigPseudoVlansMatch(config, stateV1); + + // Apply same config, and verify no change in pseudo vlans + auto stateV2 = publishAndApplyConfig(stateV1, &config, platform.get()); + EXPECT_EQ(nullptr, stateV2); +} From 31dc3649e204a08d158e1c0c01d9f71ed1f346e9 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 128/280] Verify if pseudo vlans on interface remove, modify Summary: As titled. Reviewed By: jasmeetbagga Differential Revision: D42542476 Privacy Context Container: L1125642 fbshipit-source-id: 8b1322bf9ba25958754285fbb4086ffb25c08720 --- fboss/agent/state/tests/InterfaceTests.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fboss/agent/state/tests/InterfaceTests.cpp b/fboss/agent/state/tests/InterfaceTests.cpp index b6dbe6fd3db5d..5dc8b72b2f0c6 100644 --- a/fboss/agent/state/tests/InterfaceTests.cpp +++ b/fboss/agent/state/tests/InterfaceTests.cpp @@ -728,4 +728,20 @@ TEST(Interface, verifyPseudoVlanProcessing) { // Apply same config, and verify no change in pseudo vlans auto stateV2 = publishAndApplyConfig(stateV1, &config, platform.get()); EXPECT_EQ(nullptr, stateV2); + + // Apply modified config (2 interfaces => 1 interface), and verify if pseudo + // vlans are populated correctly + auto config2 = testConfigA(cfg::SwitchType::VOQ); + config2.interfaces()->resize(1); + auto stateV3 = publishAndApplyConfig(stateV1, &config2, platform.get()); + verifyConfigPseudoVlansMatch(config2, stateV3); + + // Modify an interface (e.g. MAC addr for an interface), and verify if pseudo + // vlans are populated correctly + auto config3 = testConfigA(cfg::SwitchType::VOQ); + auto currMac = folly::MacAddress(*config3.interfaces()[0].mac()); + auto newMac = folly::MacAddress::fromHBO(currMac.u64HBO() + 1); + config3.interfaces()[0].mac() = newMac.toString(); + auto stateV4 = publishAndApplyConfig(stateV1, &config3, platform.get()); + verifyConfigPseudoVlansMatch(config3, stateV4); } From c3033d5656df5840456c93976b4bea2ff30f2fb8 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 129/280] Set interface in configs for vlans Summary: Stacked diff populates interfaceIDs for a port in the switch state. For non-VOQ switches, this is implemented as follows: - determine vlan to interface mapping from config - for every port in config: find vlan the port belongs to lookup vlan to interface mapping use it to populate interface for that port Thus, we need all the above fields populated in the config. These fields are always populated in the production config, but some unit tests didn't always populate these fields correctly, so fix it.' Reviewed By: jasmeetbagga Differential Revision: D42606086 Privacy Context Container: L1125642 fbshipit-source-id: 31ad62c85c3ec87036ecf84b17b88344de7718cf --- fboss/agent/state/tests/PortTests.cpp | 6 ++++++ fboss/agent/state/tests/ThriftySwitchStateTests.cpp | 13 ++++++++----- fboss/agent/state/tests/VlanTests.cpp | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/fboss/agent/state/tests/PortTests.cpp b/fboss/agent/state/tests/PortTests.cpp index 411361e8a310c..c06301c74af5e 100644 --- a/fboss/agent/state/tests/PortTests.cpp +++ b/fboss/agent/state/tests/PortTests.cpp @@ -144,6 +144,12 @@ TEST(Port, applyConfig) { *config.vlanPorts()[0].logicalPort() = 1; *config.vlanPorts()[0].vlanID() = 2021; *config.vlanPorts()[0].emitTags() = false; + config.vlans()->resize(3); + *config.vlans()[2].id() = 2021; + config.interfaces()->resize(3); + *config.interfaces()[2].intfID() = 2021; + *config.interfaces()[2].vlanID() = 2021; + config.interfaces()[2].mac() = "00:00:00:00:00:21"; Port::VlanMembership expectedVlansV2; expectedVlansV2.insert(make_pair(VlanID(2021), Port::VlanInfo(false))); diff --git a/fboss/agent/state/tests/ThriftySwitchStateTests.cpp b/fboss/agent/state/tests/ThriftySwitchStateTests.cpp index 01adfc023fc2b..35291aec03e97 100644 --- a/fboss/agent/state/tests/ThriftySwitchStateTests.cpp +++ b/fboss/agent/state/tests/ThriftySwitchStateTests.cpp @@ -277,15 +277,18 @@ TEST(ThriftySwitchState, InterfaceMap) { config.vlans()->resize(2); *config.vlans()[0].id() = 1; config.vlans()[0].intfID() = 1; - *config.vlans()[1].id() = 2; - config.vlans()[1].intfID() = 2; + + *config.vlans()[1].id() = 55; + config.vlans()[1].intfID() = 55; + config.interfaces()->resize(2); *config.interfaces()[0].intfID() = 1; *config.interfaces()[0].vlanID() = 1; config.interfaces()[0].mac() = "00:00:00:00:00:11"; - *config.interfaces()[1].intfID() = 2; - *config.interfaces()[1].vlanID() = 2; - config.interfaces()[1].mac() = "00:00:00:00:00:22"; + + *config.interfaces()[1].intfID() = 55; + *config.interfaces()[1].vlanID() = 55; + config.interfaces()[1].mac() = "00:00:00:00:00:55"; auto endState = publishAndApplyConfig(startState, &config, platform.get()); ASSERT_NE(nullptr, endState); diff --git a/fboss/agent/state/tests/VlanTests.cpp b/fboss/agent/state/tests/VlanTests.cpp index 9443c0b85a421..cf955786fef47 100644 --- a/fboss/agent/state/tests/VlanTests.cpp +++ b/fboss/agent/state/tests/VlanTests.cpp @@ -88,6 +88,10 @@ TEST(Vlan, applyConfig) { config.vlanPorts()[1].vlanID() = 1234; config.vlanPorts()[1].emitTags() = true; + config.interfaces()->resize(1); + config.interfaces()[0].intfID() = 1234; + config.interfaces()[0].vlanID() = 1234; + Vlan::MemberPorts expectedPorts; expectedPorts.insert(std::make_pair(1, false)); expectedPorts.insert(std::make_pair(2, true)); From 4778f05b6fa24818fb2d6271d47a0df25bc843c3 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 130/280] Data structure for interfaceIDs corresponding to a port Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D42606087 Privacy Context Container: L1125642 fbshipit-source-id: 94fa06d0c4ac5f74a85d051a0b726526eb89c30d --- fboss/agent/switch_state.thrift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fboss/agent/switch_state.thrift b/fboss/agent/switch_state.thrift index 94a32b8befada..38f77edc0d6fb 100644 --- a/fboss/agent/switch_state.thrift +++ b/fboss/agent/switch_state.thrift @@ -119,6 +119,20 @@ struct PortFields { 38: optional mka_structs.MKASak txSecureAssociationKey; 39: bool macsecDesired = false; 40: bool dropUnencrypted = false; + // List of interfaces for given port: + // + // For the systems with VLAN based RIFs (non-VOQ/non-FABRIC): + // - A port could be part of multiple VLANs. + // - every VLAN corresponds to an interface. + // - interfaceIDs contains the list of interfaces for VLANs the port is + // part of. + // - In practice, a port is only part of single VLAN, so this vector always + // has size of 1. + // + // For the systems with Port based RIFs (VOQ/FABRIC switches): + // - interfaceIDs contains single element viz. the interface corresponding + // to this port. + 41: list interfaceIDs; } struct SystemPortFields { From f787ef8464c3e8debf8247dd54b9be854af8a48c Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 131/280] Get/set methods for PortFields: interfaceIDs Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D42606088 Privacy Context Container: L1125642 fbshipit-source-id: 7bc418f724620331b1657164f5450aeb3a3ca388 --- fboss/agent/state/Port.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fboss/agent/state/Port.h b/fboss/agent/state/Port.h index 7053dfa498dc7..59a121a5e121d 100644 --- a/fboss/agent/state/Port.h +++ b/fboss/agent/state/Port.h @@ -614,6 +614,14 @@ class Port : public ThriftStructNode { set(pinCfgs); } + auto getInterfaceIDs() const { + return safe_cref(); + } + + void setInterfaceIDs(const std::vector& interfaceIDs) { + set(interfaceIDs); + } + static std::shared_ptr fromFollyDynamic(const folly::dynamic& dyn) { auto fields = PortFields::fromFollyDynamic(dyn); return std::make_shared(fields.toThrift()); From 08bddf77004462e894fc98f024ede348351ffda8 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 132/280] Populate interfaceIDs for port in the switch state Summary: Summary VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D42606085 Privacy Context Container: L1125642 fbshipit-source-id: 26e86240d299a0f2623052c397d26f664c21448f --- fboss/agent/ApplyThriftConfig.cpp | 99 ++++++++++++++++++++++++++----- 1 file changed, 83 insertions(+), 16 deletions(-) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index 1bd0eaa08b49a..f49db3bb87957 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -398,6 +398,10 @@ class ThriftConfigApplier { void validateUdfConfig(const UdfConfig& newUdfConfig); std::shared_ptr updateUdfConfig(bool* changed); + void processInterfaceForPortForNonVoqSwitches(); + void processInterfaceForPortForVoqSwitches(); + void processInterfaceForPort(); + std::shared_ptr orig_; std::shared_ptr new_; const cfg::SwitchConfig* cfg_{nullptr}; @@ -423,6 +427,7 @@ class ThriftConfigApplier { flat_map portVlans_; flat_map vlanPorts_; flat_map vlanInterfaces_; + flat_map> port2InterfaceId_; }; shared_ptr ThriftConfigApplier::run() { @@ -457,22 +462,6 @@ shared_ptr ThriftConfigApplier::run() { } } - { - auto newPorts = updatePorts(new_->getTransceivers()); - if (newPorts) { - new_->resetPorts(std::move(newPorts)); - if (new_->getSwitchSettings()->getSwitchType() == cfg::SwitchType::VOQ) { - CHECK(cfg_->switchSettings()->switchId().has_value()) - << "Switch id must be set for VOQ switch"; - new_->resetSystemPorts(updateSystemPorts( - new_->getPorts(), - new_->getSwitchSettings()->getSwitchId(), - new_->getSwitchSettings()->getSystemPortRange())); - } - changed = true; - } - } - { auto newSwitchSettings = updateSwitchSettings(); if (newSwitchSettings) { @@ -489,6 +478,25 @@ shared_ptr ThriftConfigApplier::run() { changed = true; } } + + processInterfaceForPort(); + + { + auto newPorts = updatePorts(new_->getTransceivers()); + if (newPorts) { + new_->resetPorts(std::move(newPorts)); + if (new_->getSwitchSettings()->getSwitchType() == cfg::SwitchType::VOQ) { + CHECK(cfg_->switchSettings()->switchId().has_value()) + << "Switch id must be set for VOQ switch"; + new_->resetSystemPorts(updateSystemPorts( + new_->getPorts(), + new_->getSwitchSettings()->getSwitchId(), + new_->getSwitchSettings()->getSystemPortRange())); + } + changed = true; + } + } + { auto newAggPorts = updateAggregatePorts(); if (newAggPorts) { @@ -1062,6 +1070,64 @@ void ThriftConfigApplier::processVlanPorts() { } } +void ThriftConfigApplier::processInterfaceForPortForVoqSwitches() { + auto systemPortRange = new_->getSwitchSettings()->getSystemPortRange(); + for (const auto& portCfg : *cfg_->ports()) { + auto portType = *portCfg.portType(); + auto portID = PortID(*portCfg.logicalID()); + + switch (portType) { + case cfg::PortType::INTERFACE_PORT: + case cfg::PortType::RECYCLE_PORT: { + // system port is 1:1 with every interface and recycle port. + // interface is 1:1 with system port. + // InterfaceID is chosen to be the same as systemPortID. Thus: + auto interfaceID = SystemPortID{*systemPortRange->minimum() + portID}; + port2InterfaceId_[portID].push_back(interfaceID); + } break; + case cfg::PortType::FABRIC_PORT: + case cfg::PortType::CPU_PORT: + // no interface for fabric/cpu port + break; + } + } +} + +void ThriftConfigApplier::processInterfaceForPortForNonVoqSwitches() { + flat_map vlan2InterfaceId; + for (const auto& interfaceCfg : *cfg_->interfaces()) { + vlan2InterfaceId[VlanID(*interfaceCfg.vlanID())] = + InterfaceID(*interfaceCfg.intfID()); + } + + for (const auto& portCfg : *cfg_->ports()) { + auto portID = PortID(*portCfg.logicalID()); + + for (const auto& [vlanID, vlanInfo] : portVlans_[portID]) { + auto it = vlan2InterfaceId.find(vlanID); + if (it == vlan2InterfaceId.end()) { + throw FbossError("VLAN ", vlanID, " has no interface"); + } + port2InterfaceId_[portID].push_back(it->second); + } + } +} + +void ThriftConfigApplier::processInterfaceForPort() { + // Build Port -> interface mappings in port2InterfaceId_ + auto switchType = *cfg_->switchSettings()->switchType(); + switch (switchType) { + case cfg::SwitchType::VOQ: + case cfg::SwitchType::FABRIC: + processInterfaceForPortForVoqSwitches(); + break; + case cfg::SwitchType::NPU: + case cfg::SwitchType::PHY: + processInterfaceForPortForNonVoqSwitches(); + break; + } +} + void ThriftConfigApplier::updateVlanInterfaces(const Interface* intf) { if (intf->getType() != cfg::InterfaceType::VLAN) { return; @@ -1880,6 +1946,7 @@ shared_ptr ThriftConfigApplier::updatePort( newPort->setProfileConfig(*newProfileConfigRef); newPort->resetPinConfigs(newPinConfigs); newPort->setPortType(*portConf->portType()); + newPort->setInterfaceIDs(port2InterfaceId_[orig->getID()]); return newPort; } From 8b70d248afab0d32ee158353b213e079bd7e68d7 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 133/280] Non-VOQ: test if interface for port is populated correctly Summary: As titled. Reviewed By: jasmeetbagga Differential Revision: D42644810 Privacy Context Container: L1125642 fbshipit-source-id: f3c484db31d65a57779fbf39d7ae4eea57586a02 --- fboss/agent/state/tests/PortTests.cpp | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/fboss/agent/state/tests/PortTests.cpp b/fboss/agent/state/tests/PortTests.cpp index c06301c74af5e..c18ea2f499977 100644 --- a/fboss/agent/state/tests/PortTests.cpp +++ b/fboss/agent/state/tests/PortTests.cpp @@ -21,9 +21,11 @@ #include "fboss/agent/state/SwitchState.h" #include "fboss/agent/test/TestUtils.h" +#include #include using namespace facebook::fboss; +using boost::container::flat_map; using std::make_pair; using std::make_shared; using std::shared_ptr; @@ -858,3 +860,51 @@ TEST(Port, portSerilization) { validateNodeSerialization(*port); } + +TEST(Port, verifyInterfaceIDsForNonVoqSwitches) { + auto platform = createMockPlatform(); + auto stateV0 = make_shared(); + auto config = testConfigA(); + + auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); + ASSERT_NE(nullptr, stateV1); + + auto getExpectedPort2Interface = [](const auto& config) { + flat_map vlan2Interface; + for (const auto& interfaceCfg : *config.interfaces()) { + vlan2Interface[VlanID(*interfaceCfg.vlanID())] = *interfaceCfg.intfID(); + } + + flat_map port2Vlans; + for (const auto& vp : *config.vlanPorts()) { + PortID portID(*vp.logicalPort()); + VlanID vlanID(*vp.vlanID()); + + port2Vlans[portID].insert( + std::make_pair(vlanID, Port::VlanInfo(*vp.emitTags()))); + } + + flat_map port2Interface; + for (const auto& portCfg : *config.ports()) { + auto portID = PortID(*portCfg.logicalID()); + for (const auto& [vlanID, vlanInfo] : port2Vlans[portID]) { + auto it = vlan2Interface.find(vlanID); + EXPECT_TRUE(it != vlan2Interface.end()); + port2Interface.insert(std::make_pair(portID, it->second)); + } + } + return port2Interface; + }; + + auto expectedPort2Interface = getExpectedPort2Interface(config); + + for (const auto& port : std::as_const(*(stateV1->getPorts()))) { + for (const auto& intfID : *port.second->getInterfaceIDs()) { + auto portID = port.second->getID(); + auto expectedIntfID = expectedPort2Interface[portID]; + auto gotIntfID = int(intfID->cref()); + + EXPECT_EQ(expectedIntfID, gotIntfID); + } + } +} From 5502ade9dcaef19329a33c7165a146ba995f8bd1 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 134/280] VOQ: test if interface for port is populated correctly Summary: As titled. Reviewed By: jasmeetbagga Differential Revision: D42644811 Privacy Context Container: L1125642 fbshipit-source-id: 7bae09617c085d53789d5d71bda531c7b8d5b77a --- fboss/agent/state/tests/PortTests.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/fboss/agent/state/tests/PortTests.cpp b/fboss/agent/state/tests/PortTests.cpp index c18ea2f499977..1e933ae4d8879 100644 --- a/fboss/agent/state/tests/PortTests.cpp +++ b/fboss/agent/state/tests/PortTests.cpp @@ -908,3 +908,26 @@ TEST(Port, verifyInterfaceIDsForNonVoqSwitches) { } } } + +TEST(Port, verifyInterfaceIDsForVoqSwitches) { + auto platform = createMockPlatform(); + auto stateV0 = make_shared(); + auto config = testConfigA(cfg::SwitchType::VOQ); + + auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); + ASSERT_NE(nullptr, stateV1); + + auto dsfIter = config.dsfNodes()->find( + static_cast(*config.switchSettings()->switchId())); + EXPECT_TRUE(dsfIter != config.dsfNodes()->end()); + auto myNode = dsfIter->second; + + for (const auto& port : std::as_const(*(stateV1->getPorts()))) { + for (const auto& intfID : *port.second->getInterfaceIDs()) { + auto expectedIntfID = + *myNode.systemPortRange()->minimum() + port.second->getID(); + auto gotIntfID = static_cast(intfID->cref()); + EXPECT_EQ(expectedIntfID, gotIntfID); + } + } +} From 882045eb710292bfc8e24f15e1646bcb996ace27 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 135/280] Refactor neighbor entry program entry logic Summary: programEntry logic for VOQ switches would different from existing programEntry logic for NPU switches. Start refactoring code towards that. Later stacked diff would add logic for voq switches Reviewed By: jasmeetbagga Differential Revision: D42666740 Privacy Context Container: L1125642 fbshipit-source-id: f1b968da2bc0c058a605800c1d2656c835769aa8 --- fboss/agent/NeighborCacheImpl-defs.h | 45 ++++++++++++++++++++++++++-- fboss/agent/NeighborCacheImpl.h | 3 ++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/fboss/agent/NeighborCacheImpl-defs.h b/fboss/agent/NeighborCacheImpl-defs.h index 4ebe8383ddc9a..8a0881b2a9ca0 100644 --- a/fboss/agent/NeighborCacheImpl-defs.h +++ b/fboss/agent/NeighborCacheImpl-defs.h @@ -64,6 +64,30 @@ bool checkVlanAndIntf( template void NeighborCacheImpl::programEntry(Entry* entry) { + SwSwitch::StateUpdateFn updateFn; + + switch (sw_->getState()->getSwitchSettings()->getSwitchType()) { + case cfg::SwitchType::NPU: + updateFn = getUpdateFnToProgramEntryForNpu(entry); + break; + case cfg::SwitchType::VOQ: + updateFn = getUpdateFnToProgramEntryForVoq(entry); + break; + case cfg::SwitchType::FABRIC: + case cfg::SwitchType::PHY: + throw FbossError( + "Programming entry is not supported for switch type: ", + (sw_->getState()->getSwitchSettings()->getSwitchType())); + } + + sw_->updateState( + folly::to("add neighbor ", entry->getFields().ip), + std::move(updateFn)); +} + +template +SwSwitch::StateUpdateFn +NeighborCacheImpl::getUpdateFnToProgramEntryForNpu(Entry* entry) { CHECK(!entry->isPending()); auto fields = entry->getFields(); @@ -108,8 +132,25 @@ void NeighborCacheImpl::programEntry(Entry* entry) { return newState; }; - sw_->updateState( - folly::to("add neighbor ", fields.ip), std::move(updateFn)); + return updateFn; +} + +template +SwSwitch::StateUpdateFn +NeighborCacheImpl::getUpdateFnToProgramEntryForVoq(Entry* entry) { + CHECK(!entry->isPending()); + + auto fields = entry->getFields(); + auto updateFn = [this, + fields](const std::shared_ptr& state) mutable + -> std::shared_ptr { + std::shared_ptr newState{state}; + + // TODO + return newState; + }; + + return updateFn; } template diff --git a/fboss/agent/NeighborCacheImpl.h b/fboss/agent/NeighborCacheImpl.h index 45552459c2144..a332dfdfbea5f 100644 --- a/fboss/agent/NeighborCacheImpl.h +++ b/fboss/agent/NeighborCacheImpl.h @@ -131,6 +131,9 @@ class NeighborCacheImpl { void programEntry(Entry* entry); void programPendingEntry(Entry* entry, bool force = false); + SwSwitch::StateUpdateFn getUpdateFnToProgramEntryForNpu(Entry* entry); + SwSwitch::StateUpdateFn getUpdateFnToProgramEntryForVoq(Entry* entry); + void processEntry(AddressType ip); // Pass in a non-null flushed if you care whether an entry From 7de4a701e047347a9101575cf930714eb8cc4f79 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 18:25:30 -0800 Subject: [PATCH 136/280] templated helper getTable for interface Summary: As titled. Used by later stacked diffs. Reviewed By: jasmeetbagga Differential Revision: D42667156 Privacy Context Container: L1125642 fbshipit-source-id: 53df25d702addcd44a25a6ee1da546b470f0e253 --- fboss/agent/state/Interface.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fboss/agent/state/Interface.h b/fboss/agent/state/Interface.h index e35d3de20d84d..a6c2385606d4d 100644 --- a/fboss/agent/state/Interface.h +++ b/fboss/agent/state/Interface.h @@ -199,6 +199,15 @@ class Interface : public ThriftStructNode { set(isStateSyncDisabled); } + template + auto getTable() const { + if constexpr (std::is_same_v) { + return getArpTable(); + } else if constexpr (std::is_same_v) { + return getNdpTable(); + } + } + std::shared_ptr getArpTable() const { return get(); } From 877f24e2232698698b76c77eeeadde71b82975a3 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 137/280] LinkNeighbor: make vlan optional Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D42667803 Privacy Context Container: L1125642 fbshipit-source-id: 3573eff8ce03a737dcd760b860cc40b4bb72264f --- fboss/agent/LldpManager.cpp | 2 +- fboss/agent/lldp/LinkNeighbor.cpp | 10 ++++++---- fboss/agent/lldp/LinkNeighbor.h | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fboss/agent/LldpManager.cpp b/fboss/agent/LldpManager.cpp index d82e2d43d117c..9686733f69cd2 100644 --- a/fboss/agent/LldpManager.cpp +++ b/fboss/agent/LldpManager.cpp @@ -93,7 +93,7 @@ void LldpManager::handlePacket( sw_->stats()->LldpRecvdPkt(); bool ret = neighbor->parseLldpPdu( - pkt->getSrcPort(), pkt->getSrcVlan(), src, ETHERTYPE_LLDP, &cursor); + pkt->getSrcPort(), pkt->getSrcVlanIf(), src, ETHERTYPE_LLDP, &cursor); if (!ret) { // LinkNeighbor will have already logged a message about the error. diff --git a/fboss/agent/lldp/LinkNeighbor.cpp b/fboss/agent/lldp/LinkNeighbor.cpp index aa99be8daac2b..d27eb072da3e0 100644 --- a/fboss/agent/lldp/LinkNeighbor.cpp +++ b/fboss/agent/lldp/LinkNeighbor.cpp @@ -110,7 +110,7 @@ std::string LinkNeighbor::humanReadableNetAddr(const std::string& data) { bool LinkNeighbor::parseLldpPdu( PortID srcPort, - VlanID vlan, + std::optional vlanID, folly::MacAddress srcMac, uint16_t ethertype, folly::io::Cursor* cursor) { @@ -120,7 +120,8 @@ bool LinkNeighbor::parseLldpPdu( ref() = lldp::LinkProtocol::LLDP; ref() = srcPort; - ref() = vlan; + // TODO(skhare) make localVlan optional + ref() = vlanID.has_value() ? vlanID.value() : 0; ref() = srcMac.u64NBO(); bool chassisIdPresent{false}; @@ -245,7 +246,7 @@ void LinkNeighbor::parseLldpSystemCaps(Cursor* cursor, uint16_t length) { bool LinkNeighbor::parseCdpPdu( PortID srcPort, - VlanID vlan, + std::optional vlanID, MacAddress srcMac, uint16_t ethertype, folly::io::Cursor* cursor) { @@ -257,7 +258,8 @@ bool LinkNeighbor::parseCdpPdu( ref() = lldp::LinkProtocol::CDP; ref() = srcPort; - ref() = vlan; + // TODO(skhare) make localVlan optional + ref() = vlanID.has_value() ? vlanID.value() : 0; ref() = srcMac.u64NBO(); try { diff --git a/fboss/agent/lldp/LinkNeighbor.h b/fboss/agent/lldp/LinkNeighbor.h index 9c84d9b22f59f..29b849407c190 100644 --- a/fboss/agent/lldp/LinkNeighbor.h +++ b/fboss/agent/lldp/LinkNeighbor.h @@ -184,7 +184,7 @@ class LinkNeighbor */ bool parseLldpPdu( PortID srcPort, - VlanID vlan, + std::optional vlanID, folly::MacAddress srcMac, uint16_t ethertype, folly::io::Cursor* cursor); @@ -204,7 +204,7 @@ class LinkNeighbor */ bool parseCdpPdu( PortID srcPort, - VlanID vlan, + std::optional vlanID, folly::MacAddress srcMac, uint16_t ethertype, folly::io::Cursor* cursor); From c7ba8efb360e0819aacf3ead04f28f9b55f941a7 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 138/280] Extend LinkNeighborTest to parse optional vlan Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D42667802 Privacy Context Container: L1125642 fbshipit-source-id: 6d1d0311e08e1b1baf0010760008ae5b132d3fc5 --- fboss/agent/lldp/test/LinkNeighborTest.cpp | 74 ++++++++++++---------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/fboss/agent/lldp/test/LinkNeighborTest.cpp b/fboss/agent/lldp/test/LinkNeighborTest.cpp index 2d37b784c33f3..c8ebe25e7e924 100644 --- a/fboss/agent/lldp/test/LinkNeighborTest.cpp +++ b/fboss/agent/lldp/test/LinkNeighborTest.cpp @@ -50,41 +50,45 @@ const uint8_t basicLldpPacket[] = { }; TEST(LinkNeighbor, parseLldp) { - IOBuf iob(IOBuf::WRAP_BUFFER, basicLldpPacket, sizeof(basicLldpPacket)); - Cursor cursor(&iob); - - // Parse the data - MacAddress destMac = PktUtil::readMac(&cursor); - EXPECT_EQ(MacAddress("01:80:c2:00:00:0e"), destMac); - MacAddress srcMac = PktUtil::readMac(&cursor); - EXPECT_EQ(MacAddress("2c:54:2d:f5:89:3e"), srcMac); - uint16_t ethertype = cursor.readBE(); - EXPECT_EQ(0x88cc, ethertype); - - LinkNeighbor info; - PortID srcPort{0}; - VlanID srcVlan{1}; - bool ret = info.parseLldpPdu(srcPort, srcVlan, srcMac, ethertype, &cursor); - ASSERT_TRUE(ret); - - EXPECT_EQ(lldp::LinkProtocol::LLDP, info.getProtocol()); - EXPECT_EQ(lldp::LldpChassisIdType::MAC_ADDRESS, info.getChassisIdType()); - EXPECT_EQ("\x2c\x54\x2d\xf5\x89\x3e", info.getChassisId()); - - EXPECT_EQ(lldp::LldpPortIdType::INTERFACE_NAME, info.getPortIdType()); - EXPECT_EQ("Ethernet1/23", info.getPortId()); - - EXPECT_EQ(seconds(120), info.getTTL()); - auto expire = steady_clock::now() + seconds(120); - auto delta = expire - info.getExpirationTime(); - EXPECT_LE(delta, seconds(1)); - EXPECT_GE(delta, seconds(0)); - - EXPECT_EQ(0x0014, info.getCapabilities()); - EXPECT_EQ(0x0014, info.getEnabledCapabilities()); - - EXPECT_EQ("rsw1br.07.prn2.facebook.com.facebook.com", info.getSystemName()); - EXPECT_EQ("SERVERS", info.getPortDescription()); + auto parseLldpHelper = [](std::optional srcVlan) { + IOBuf iob(IOBuf::WRAP_BUFFER, basicLldpPacket, sizeof(basicLldpPacket)); + Cursor cursor(&iob); + + // Parse the data + MacAddress destMac = PktUtil::readMac(&cursor); + EXPECT_EQ(MacAddress("01:80:c2:00:00:0e"), destMac); + MacAddress srcMac = PktUtil::readMac(&cursor); + EXPECT_EQ(MacAddress("2c:54:2d:f5:89:3e"), srcMac); + uint16_t ethertype = cursor.readBE(); + EXPECT_EQ(0x88cc, ethertype); + + LinkNeighbor info; + PortID srcPort{0}; + bool ret = info.parseLldpPdu(srcPort, srcVlan, srcMac, ethertype, &cursor); + ASSERT_TRUE(ret); + + EXPECT_EQ(lldp::LinkProtocol::LLDP, info.getProtocol()); + EXPECT_EQ(lldp::LldpChassisIdType::MAC_ADDRESS, info.getChassisIdType()); + EXPECT_EQ("\x2c\x54\x2d\xf5\x89\x3e", info.getChassisId()); + + EXPECT_EQ(lldp::LldpPortIdType::INTERFACE_NAME, info.getPortIdType()); + EXPECT_EQ("Ethernet1/23", info.getPortId()); + + EXPECT_EQ(seconds(120), info.getTTL()); + auto expire = steady_clock::now() + seconds(120); + auto delta = expire - info.getExpirationTime(); + EXPECT_LE(delta, seconds(1)); + EXPECT_GE(delta, seconds(0)); + + EXPECT_EQ(0x0014, info.getCapabilities()); + EXPECT_EQ(0x0014, info.getEnabledCapabilities()); + + EXPECT_EQ("rsw1br.07.prn2.facebook.com.facebook.com", info.getSystemName()); + EXPECT_EQ("SERVERS", info.getPortDescription()); + }; + + parseLldpHelper(VlanID(1)); + parseLldpHelper(std::nullopt /* VlanID */); } const uint8_t badLldpPacket[] = { From 6120e35d9d8b07eb857f57364f56669393d476b7 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 139/280] non-opt port desctiptor for sendUnicastNeighborSolicitation Summary: The only caller is NdpCache::checkReachability. And it always has a valid portDescriptor that I can pass to sendUnicastNeighborSolicitation. This helps later stacked diffs. Reviewed By: jasmeetbagga Differential Revision: D42695077 Privacy Context Container: L1125642 fbshipit-source-id: f44339614f86f86a4c1ba20d793736a5a1c628a7 --- fboss/agent/IPv6Handler.cpp | 2 +- fboss/agent/IPv6Handler.h | 3 +-- fboss/agent/NdpCache.cpp | 10 +--------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/fboss/agent/IPv6Handler.cpp b/fboss/agent/IPv6Handler.cpp index 73f7d7c8dee72..9b8438960b163 100644 --- a/fboss/agent/IPv6Handler.cpp +++ b/fboss/agent/IPv6Handler.cpp @@ -709,7 +709,7 @@ void IPv6Handler::sendUnicastNeighborSolicitation( const folly::IPAddressV6& srcIP, const folly::MacAddress& srcMac, const VlanID& vlanID, - const std::optional& portDescriptor) { + const PortDescriptor& portDescriptor) { auto state = sw->getState(); auto vlan = state->getVlans()->getVlanIf(vlanID); if (!Interface::isIpAttached(targetIP, vlan->getInterfaceID(), state)) { diff --git a/fboss/agent/IPv6Handler.h b/fboss/agent/IPv6Handler.h index 473d635d9f5da..37b111b0b8e76 100644 --- a/fboss/agent/IPv6Handler.h +++ b/fboss/agent/IPv6Handler.h @@ -101,8 +101,7 @@ class IPv6Handler : public StateObserver { const folly::IPAddressV6& srcIP, const folly::MacAddress& srcMac, const VlanID& vlanID, - const std::optional& portDescriptor = - std::optional()); + const PortDescriptor& portDescriptor); private: struct ICMPHeaders; diff --git a/fboss/agent/NdpCache.cpp b/fboss/agent/NdpCache.cpp index ef9f468be6fbf..d2589d738c473 100644 --- a/fboss/agent/NdpCache.cpp +++ b/fboss/agent/NdpCache.cpp @@ -149,16 +149,8 @@ inline void NdpCache::checkReachability( srcIP = srcIntf->getAddressToReach(targetIP)->first.asV6(); } // unicast solicitation - std::optional portDescriptor; - portDescriptor.emplace(port); IPv6Handler::sendUnicastNeighborSolicitation( - getSw(), - targetIP, - targetMac, - srcIP, - srcMac, - vlan->getID(), - portDescriptor); + getSw(), targetIP, targetMac, srcIP, srcMac, vlan->getID(), port); } inline void NdpCache::probeFor(folly::IPAddressV6 ip) const { From 2d20a18592902f2c6ec82008ccbb41872e4b81ef Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 140/280] Populate interfaceIDs for ports in TestUtils Summary: As titled. ApplyThriftConfig populats this, and different places in the code will ASSERT for this to be populated. Thus, also populate this while populating a SwitchState by hand in a test config. Reviewed By: jasmeetbagga Differential Revision: D42695076 Privacy Context Container: L1125642 fbshipit-source-id: 0dad928ee14bcca28638f15cde31f2b1a333356c --- fboss/agent/test/TestUtils.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fboss/agent/test/TestUtils.cpp b/fboss/agent/test/TestUtils.cpp index 419c3a4d7556b..a3465f2e1cf18 100644 --- a/fboss/agent/test/TestUtils.cpp +++ b/fboss/agent/test/TestUtils.cpp @@ -478,6 +478,7 @@ shared_ptr testStateA() { vlan1->addPort(PortID(idx), false); auto port = state->getPorts()->getPortIf(PortID(idx)); port->addVlan(vlan1->getID(), false); + port->setInterfaceIDs({1}); } // Add VLAN 55, and ports 11-20 which belong to it. auto vlan55 = make_shared(VlanID(55), std::string("Vlan55")); @@ -487,6 +488,7 @@ shared_ptr testStateA() { vlan55->addPort(PortID(idx), false); auto port = state->getPorts()->getPortIf(PortID(idx)); port->addVlan(vlan55->getID(), false); + port->setInterfaceIDs({55}); } // Add Interface 1 to VLAN 1 auto intf1 = make_shared( From 8326e50d2280f94b7324071b2720a4aafb0a09a7 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 141/280] Helper method: get interfaceID for port Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. This diff: see title. Reviewed By: jasmeetbagga Differential Revision: D42695078 Privacy Context Container: L1125642 fbshipit-source-id: a8c3875cc352fd2972ec35188dc47946f08db8d2 --- fboss/agent/SwSwitch.cpp | 10 ++++++++++ fboss/agent/SwSwitch.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/fboss/agent/SwSwitch.cpp b/fboss/agent/SwSwitch.cpp index fd8e08af371f7..5afdc70c6de22 100644 --- a/fboss/agent/SwSwitch.cpp +++ b/fboss/agent/SwSwitch.cpp @@ -2092,4 +2092,14 @@ std::optional SwSwitch::getCPUVlan() const { : std::make_optional(VlanID(4095)); } +InterfaceID SwSwitch::getInterfaceIDForPort(PortID portID) const { + auto port = getState()->getPorts()->getPortIf(portID); + CHECK(port); + // On VOQ/Fabric switches, port and interface have 1:1 relation. + // For non VOQ/Fabric switches, in practice, a port is always part of a + // single VLAN (and thus single interface). + CHECK_EQ(port->getInterfaceIDs()->size(), 1); + return InterfaceID(port->getInterfaceIDs()->at(0)->cref()); +} + } // namespace facebook::fboss diff --git a/fboss/agent/SwSwitch.h b/fboss/agent/SwSwitch.h index bcd0c641e578c..47d8e653530e6 100644 --- a/fboss/agent/SwSwitch.h +++ b/fboss/agent/SwSwitch.h @@ -773,6 +773,8 @@ class SwSwitch : public HwSwitch::Callback { VlanID getVlanIDHelper(std::optional vlanID) const; + InterfaceID getInterfaceIDForPort(PortID portID) const; + private: void updateStateBlockingImpl( folly::StringPiece name, From 5b10b6bff0d3ae80875197f9f1bd96fdb1d621e3 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 142/280] Add util getSwitchIntfIPv6 Summary: Earlier, we had to derive IP addrs from vlan (getSwitchVlanIPv6). But, now callers can derive interface from port, and thus get the interface IP addr directly using this new util. We will update all getSwitchVlanIPv6 callsites and then remove getSwitchVlanIPv6 (later stacked diffs). For now, refactor common code. Reviewed By: jasmeetbagga Differential Revision: D42698790 Privacy Context Container: L1125642 fbshipit-source-id: 787db1905fb330266eee1880fc24acb18b2fc6d5 --- fboss/agent/Utils.cpp | 30 +++++++++++++++++++++--------- fboss/agent/Utils.h | 9 +++++++++ fboss/agent/state/Interface.h | 1 + 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/fboss/agent/Utils.cpp b/fboss/agent/Utils.cpp index fc4858be3cd06..ee5a620d45d46 100644 --- a/fboss/agent/Utils.cpp +++ b/fboss/agent/Utils.cpp @@ -55,6 +55,17 @@ UnicastRoute makeUnicastRouteHelper( nr.adminDistance() = admin; return nr; } + +IPAddressV6 getIPv6Address(InterfaceID intfID, Interface::AddressesType addrs) { + for (auto iter : std::as_const(*addrs)) { + auto address = folly::IPAddress(iter.first); + if (address.isV6()) { + return address.asV6(); + } + } + throw FbossError("Cannot find IPv6 address for interface ", intfID); +} + } // namespace void utilCreateDir(folly::StringPiece path) { try { @@ -110,16 +121,17 @@ IPAddressV4 getSwitchVlanIP( IPAddressV6 getSwitchVlanIPv6( const std::shared_ptr& state, VlanID vlan) { - IPAddressV6 switchIp; auto vlanInterface = state->getInterfaces()->getInterfaceInVlan(vlan); - for (auto iter : std::as_const(*vlanInterface->getAddresses())) { - auto address = folly::IPAddress(iter.first); - if (address.isV6()) { - switchIp = address.asV6(); - return switchIp; - } - } - throw FbossError("Cannot find IPv6 address for vlan ", vlan); + + return getIPv6Address(vlanInterface->getID(), vlanInterface->getAddresses()); +} + +IPAddressV6 getSwitchIntfIPv6( + const std::shared_ptr& state, + InterfaceID intfID) { + auto interface = state->getInterfaces()->getInterface(intfID); + + return getIPv6Address(intfID, interface->getAddresses()); } void incNiceValue(const uint32_t increment) { diff --git a/fboss/agent/Utils.h b/fboss/agent/Utils.h index 57d6c196b0605..3eb25606c4a90 100644 --- a/fboss/agent/Utils.h +++ b/fboss/agent/Utils.h @@ -78,6 +78,15 @@ folly::IPAddressV6 getSwitchVlanIPv6( const std::shared_ptr& state, VlanID vlan); +/** + * Helper function to get an IPv6 address for a particular interface + * used to set src IP address for DHCPv6 and ICMPv6 packets + * throw an FbossError in case no IPv6 address exists. + */ +folly::IPAddressV6 getSwitchIntfIPv6( + const std::shared_ptr& state, + InterfaceID intfID); + /** * Helper function to get an IPvv6 address of any(first) interface. */ diff --git a/fboss/agent/state/Interface.h b/fboss/agent/state/Interface.h index a6c2385606d4d..b629634a2ff28 100644 --- a/fboss/agent/state/Interface.h +++ b/fboss/agent/state/Interface.h @@ -97,6 +97,7 @@ RESOLVE_STRUCT_MEMBER(Interface, switch_state_tags::ndpTable, NdpTable) class Interface : public ThriftStructNode { public: using Base = ThriftStructNode; + using AddressesType = Base::Fields::TypeFor; using Addresses = std::map; Interface( InterfaceID id, From 323e53332b8b6a14e53d5eaca46901c994fdcec8 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 143/280] Remove unncessary dup portID from IPv6Handler::handlePacket Summary: This is assigned previously to variable port, and the same value is assigned to a different variable and used later (it does not change in between). Remove the unncessary dup. Reviewed By: jasmeetbagga Differential Revision: D42699147 Privacy Context Container: L1125642 fbshipit-source-id: 4b450262a217ddc2aee09daf371cc186b4c03f41 --- fboss/agent/IPv6Handler.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fboss/agent/IPv6Handler.cpp b/fboss/agent/IPv6Handler.cpp index 9b8438960b163..9e3d97eb5fc77 100644 --- a/fboss/agent/IPv6Handler.cpp +++ b/fboss/agent/IPv6Handler.cpp @@ -219,12 +219,11 @@ void IPv6Handler::handlePacket( // packets destined for us // Anything not handled by the controller, we will forward it to the host, // i.e. ping, ssh, bgp... - PortID portID = pkt->getSrcPort(); if (ipv6.payloadLength > intf->getMtu()) { // Generate PTB as interface to dst intf has MTU smaller than payload sendICMPv6PacketTooBig( - portID, pkt->getSrcVlan(), src, dst, ipv6, intf->getMtu(), cursor); - sw_->portStats(portID)->pktDropped(); + port, pkt->getSrcVlan(), src, dst, ipv6, intf->getMtu(), cursor); + sw_->portStats(port)->pktDropped(); return; } if (ipv6.nextHeader == static_cast(IP_PROTO::IP_PROTO_IPV6_ICMP)) { @@ -236,9 +235,9 @@ void IPv6Handler::handlePacket( } if (sw_->sendPacketToHost(intf->getID(), std::move(pkt))) { - sw_->portStats(portID)->pktToHost(l3Len); + sw_->portStats(port)->pktToHost(l3Len); } else { - sw_->portStats(portID)->pktDropped(); + sw_->portStats(port)->pktDropped(); } return; } From ba7b9a85e2168a51bad2a6b6f688ec839bf81058 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 144/280] Pass portID arg to sendICMPv6TimeExceeded Summary: As titled. used by later stacked diff to derive interfaceID from port Reviewed By: jasmeetbagga Differential Revision: D42699146 Privacy Context Container: L1125642 fbshipit-source-id: a12d7895d04d096b2e06ee44455a798c8958e8b8 --- fboss/agent/IPv6Handler.cpp | 4 +++- fboss/agent/IPv6Handler.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fboss/agent/IPv6Handler.cpp b/fboss/agent/IPv6Handler.cpp index 9e3d97eb5fc77..d40e51ba18265 100644 --- a/fboss/agent/IPv6Handler.cpp +++ b/fboss/agent/IPv6Handler.cpp @@ -211,7 +211,8 @@ void IPv6Handler::handlePacket( sw_->portStats(port)->ipv6HopExceeded(); // Look up cpu mac from platform MacAddress cpuMac = sw_->getPlatform()->getLocalMac(); - sendICMPv6TimeExceeded(pkt->getSrcVlan(), cpuMac, cpuMac, ipv6, cursor); + sendICMPv6TimeExceeded( + port, pkt->getSrcVlan(), cpuMac, cpuMac, ipv6, cursor); return; } @@ -549,6 +550,7 @@ void IPv6Handler::handleNeighborAdvertisement( } void IPv6Handler::sendICMPv6TimeExceeded( + PortID srcPort, VlanID srcVlan, MacAddress dst, MacAddress src, diff --git a/fboss/agent/IPv6Handler.h b/fboss/agent/IPv6Handler.h index 37b111b0b8e76..40f8498df1e57 100644 --- a/fboss/agent/IPv6Handler.h +++ b/fboss/agent/IPv6Handler.h @@ -116,6 +116,7 @@ class IPv6Handler : public StateObserver { void intfDeleted(const Interface* intf); void sendICMPv6TimeExceeded( + PortID srcPort, VlanID srcVlan, folly::MacAddress dst, folly::MacAddress src, From 4d0999cd9c38d9bfde8c117bc353948025001a2e Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 145/280] IPv6Handler: getSwitchIntfIPv6 instead of getSwitchVlanIPv6 Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. As titled, so it works with NPU as well as VOQ switches. Reviewed By: jasmeetbagga Differential Revision: D42699145 Privacy Context Container: L1125642 fbshipit-source-id: bad8a8a4fbcb9ed718aeff75108eecdd773b41c8 --- fboss/agent/IPv6Handler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fboss/agent/IPv6Handler.cpp b/fboss/agent/IPv6Handler.cpp index d40e51ba18265..18762a92e8268 100644 --- a/fboss/agent/IPv6Handler.cpp +++ b/fboss/agent/IPv6Handler.cpp @@ -580,7 +580,7 @@ void IPv6Handler::sendICMPv6TimeExceeded( IPAddressV6 srcIp; try { - srcIp = getSwitchVlanIPv6(state, srcVlan); + srcIp = getSwitchIntfIPv6(state, sw_->getInterfaceIDForPort(srcPort)); } catch (const std::exception& ex) { srcIp = getAnyIntfIPv6(state); } @@ -630,7 +630,8 @@ void IPv6Handler::sendICMPv6PacketTooBig( sendCursor->push(cursor, remainingLength); }; - IPAddressV6 srcIp = getSwitchVlanIPv6(state, srcVlan); + IPAddressV6 srcIp = + getSwitchIntfIPv6(state, sw_->getInterfaceIDForPort(srcPort)); auto icmpPkt = createICMPv6Pkt( sw_, dst, From c774777696edeff05700a7bfdf21491905586ddc Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Sun, 5 Feb 2023 22:45:25 -0800 Subject: [PATCH 146/280] IPv6Handler: Handle optional vlan in sendICMPv6* Summary: VOQ/Fabric switches require that the packets are not tagged with VLAN. This diff is part of the diff stack that enhances wedge_agent to deal with VLAN tagged as well as untagged packets. Reviewed By: jasmeetbagga Differential Revision: D42714169 Privacy Context Container: L1125642 fbshipit-source-id: 647053cdabaec7d9a6d0a8447df58907846469fa --- fboss/agent/IPv6Handler.cpp | 30 +++++++++++++++++++++--------- fboss/agent/IPv6Handler.h | 4 ++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/fboss/agent/IPv6Handler.cpp b/fboss/agent/IPv6Handler.cpp index 18762a92e8268..e4f43315ad915 100644 --- a/fboss/agent/IPv6Handler.cpp +++ b/fboss/agent/IPv6Handler.cpp @@ -134,12 +134,16 @@ void IPv6Handler::handlePacket( MacAddress dst, MacAddress src, Cursor cursor) { + auto vlanID = pkt->getSrcVlanIf(); + auto vlanIDStr = vlanID.has_value() + ? folly::to(static_cast(vlanID.value())) + : "None"; const uint32_t l3Len = pkt->getLength() - (cursor - Cursor(pkt->buf())); IPv6Hdr ipv6(cursor); // note: advances our cursor object XLOG(DBG4) << "IPv6 (" << l3Len << " bytes)" " port: " - << pkt->getSrcPort() << " vlan: " << pkt->getSrcVlan() + << pkt->getSrcPort() << " vlan: " << vlanIDStr << " src: " << ipv6.srcAddr.str() << " (" << src << ")" << " dst: " << ipv6.dstAddr.str() << " (" << dst << ")" << " nextHeader: " << static_cast(ipv6.nextHeader); @@ -188,11 +192,13 @@ void IPv6Handler::handlePacket( // Forward multicast packet directly to corresponding host interface // and let Linux handle it. In software we consume ICMPv6 Multicast // packets for function of NDP protocol, rest all are forwarded to host. - intf = interfaceMap->getInterfaceInVlanIf(pkt->getSrcVlan()); + auto intfID = sw_->getInterfaceIDForPort(port); + intf = state->getInterfaces()->getInterfaceIf(intfID); } else if (ipv6.dstAddr.isLinkLocal()) { // Forward link-local packet directly to corresponding host interface // provided desAddr is assigned to that interface. - intf = interfaceMap->getInterfaceInVlanIf(pkt->getSrcVlan()); + auto intfID = sw_->getInterfaceIDForPort(port); + intf = state->getInterfaces()->getInterfaceIf(intfID); if (intf && !(intf->hasAddress(ipv6.dstAddr))) { intf = nullptr; } @@ -211,8 +217,7 @@ void IPv6Handler::handlePacket( sw_->portStats(port)->ipv6HopExceeded(); // Look up cpu mac from platform MacAddress cpuMac = sw_->getPlatform()->getLocalMac(); - sendICMPv6TimeExceeded( - port, pkt->getSrcVlan(), cpuMac, cpuMac, ipv6, cursor); + sendICMPv6TimeExceeded(port, vlanID, cpuMac, cpuMac, ipv6, cursor); return; } @@ -551,7 +556,7 @@ void IPv6Handler::handleNeighborAdvertisement( void IPv6Handler::sendICMPv6TimeExceeded( PortID srcPort, - VlanID srcVlan, + std::optional srcVlan, MacAddress dst, MacAddress src, IPv6Hdr& v6Hdr, @@ -596,8 +601,12 @@ void IPv6Handler::sendICMPv6TimeExceeded( ICMPv6Code::ICMPV6_CODE_TIME_EXCEEDED_HOPLIMIT_EXCEEDED, icmpPayloadLength, serializeBody); + + auto srcVlanStr = srcVlan.has_value() + ? folly::to(static_cast(srcVlan.value())) + : "None"; XLOG(DBG4) << "sending ICMPv6 Time Exceeded with srcMac " << src - << " dstMac: " << dst << " vlan: " << srcVlan + << " dstMac: " << dst << " vlan: " << srcVlanStr << " dstIp: " << v6Hdr.srcAddr.str() << " srcIP: " << srcIp.str() << " bodyLength: " << icmpPayloadLength; sw_->sendPacketSwitchedAsync(std::move(icmpPkt)); @@ -605,7 +614,7 @@ void IPv6Handler::sendICMPv6TimeExceeded( void IPv6Handler::sendICMPv6PacketTooBig( PortID srcPort, - VlanID srcVlan, + std::optional srcVlan, folly::MacAddress dst, folly::MacAddress src, IPv6Hdr& v6Hdr, @@ -644,8 +653,11 @@ void IPv6Handler::sendICMPv6PacketTooBig( bodyLength, serializeBody); + auto srcVlanStr = srcVlan.has_value() + ? folly::to(static_cast(srcVlan.value())) + : "None"; XLOG(DBG4) << "sending ICMPv6 Packet Too Big with srcMac " << src - << " dstMac: " << dst << " vlan: " << srcVlan + << " dstMac: " << dst << " vlan: " << srcVlanStr << " dstIp: " << v6Hdr.srcAddr.str() << " srcIP: " << srcIp.str() << " bodyLength: " << bodyLength; sw_->sendPacketSwitchedAsync(std::move(icmpPkt)); diff --git a/fboss/agent/IPv6Handler.h b/fboss/agent/IPv6Handler.h index 40f8498df1e57..0466884a58b1a 100644 --- a/fboss/agent/IPv6Handler.h +++ b/fboss/agent/IPv6Handler.h @@ -117,7 +117,7 @@ class IPv6Handler : public StateObserver { void sendICMPv6TimeExceeded( PortID srcPort, - VlanID srcVlan, + std::optional srcVlan, folly::MacAddress dst, folly::MacAddress src, IPv6Hdr& v6Hdr, @@ -125,7 +125,7 @@ class IPv6Handler : public StateObserver { void sendICMPv6PacketTooBig( PortID srcPort, - VlanID srcVlan, + std::optional srcVlan, folly::MacAddress dst, folly::MacAddress src, IPv6Hdr& v6Hdr, From e4fb6f15bad27c1898a78eb8cad678a1c2347a97 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sun, 5 Feb 2023 23:46:11 -0800 Subject: [PATCH 147/280] Create correct interface config when switch type == VOQ Summary: As titled. Make test config reflect what we have in prod on voq switches Reviewed By: nivinl Differential Revision: D43034769 Privacy Context Container: L1125642 fbshipit-source-id: ddc1e343a5a7deba57ed37dd5dd690089c236781 --- fboss/agent/test/TestUtils.cpp | 98 ++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 47 deletions(-) diff --git a/fboss/agent/test/TestUtils.cpp b/fboss/agent/test/TestUtils.cpp index a3465f2e1cf18..5c3bc6434a0e6 100644 --- a/fboss/agent/test/TestUtils.cpp +++ b/fboss/agent/test/TestUtils.cpp @@ -177,58 +177,62 @@ cfg::SwitchConfig testConfigAImpl(bool isMhnic, cfg::SwitchType switchType) { cfg.vlanPorts()[p].logicalPort() = p + kInterfacePortIdBegin; cfg.vlanPorts()[p].vlanID() = p < 10 + kInterfacePortIdBegin ? 1 : 55; } - } - - cfg.interfaces()->resize(2); - cfg.interfaces()[0].intfID() = 1; - cfg.interfaces()[0].routerID() = 0; - if (switchType == cfg::SwitchType::NPU) { + cfg.interfaces()->resize(2); + cfg.interfaces()[0].intfID() = 1; + cfg.interfaces()[0].routerID() = 0; cfg.interfaces()[0].vlanID() = 1; - } - cfg.interfaces()[0].name() = "fboss1"; - cfg.interfaces()[0].mac() = "00:02:00:00:00:01"; - cfg.interfaces()[0].mtu() = 9000; - cfg.interfaces()[0].ipAddresses()->resize(4); - cfg.interfaces()[0].ipAddresses()[0] = "10.0.0.1/24"; - cfg.interfaces()[0].ipAddresses()[1] = "192.168.0.1/24"; - cfg.interfaces()[0].ipAddresses()[2] = "2401:db00:2110:3001::0001/64"; - cfg.interfaces()[0].ipAddresses()[3] = "fe80::/64"; // link local - - cfg.interfaces()[1].intfID() = 55; - cfg.interfaces()[1].routerID() = 0; - if (switchType == cfg::SwitchType::NPU) { + cfg.interfaces()[0].name() = "fboss1"; + cfg.interfaces()[0].mac() = "00:02:00:00:00:01"; + cfg.interfaces()[0].mtu() = 9000; + cfg.interfaces()[0].ipAddresses()->resize(4); + cfg.interfaces()[0].ipAddresses()[0] = "10.0.0.1/24"; + cfg.interfaces()[0].ipAddresses()[1] = "192.168.0.1/24"; + cfg.interfaces()[0].ipAddresses()[2] = "2401:db00:2110:3001::0001/64"; + cfg.interfaces()[0].ipAddresses()[3] = "fe80::/64"; // link local + + cfg.interfaces()[1].intfID() = 55; + cfg.interfaces()[1].routerID() = 0; cfg.interfaces()[1].vlanID() = 55; - } - cfg.interfaces()[1].name() = "fboss55"; - cfg.interfaces()[1].mac() = "00:02:00:00:00:55"; - cfg.interfaces()[1].mtu() = 9000; - cfg.interfaces()[1].ipAddresses()->resize(4); - cfg.interfaces()[1].ipAddresses()[0] = "10.0.55.1/24"; - cfg.interfaces()[1].ipAddresses()[1] = "192.168.55.1/24"; - cfg.interfaces()[1].ipAddresses()[2] = "2401:db00:2110:3055::0001/64"; - cfg.interfaces()[1].ipAddresses()[3] = "169.254.0.0/16"; // link local - - if (switchType != cfg::SwitchType::NPU) { + cfg.interfaces()[1].name() = "fboss55"; + cfg.interfaces()[1].mac() = "00:02:00:00:00:55"; + cfg.interfaces()[1].mtu() = 9000; + cfg.interfaces()[1].ipAddresses()->resize(4); + cfg.interfaces()[1].ipAddresses()[0] = "10.0.55.1/24"; + cfg.interfaces()[1].ipAddresses()[1] = "192.168.55.1/24"; + cfg.interfaces()[1].ipAddresses()[2] = "2401:db00:2110:3055::0001/64"; + cfg.interfaces()[1].ipAddresses()[3] = "169.254.0.0/16"; // link local + } else { cfg.switchSettings()->switchId() = 1; - } - if (switchType == cfg::SwitchType::VOQ) { - cfg::DsfNode myNode = makeDsfNodeCfg(1); - cfg.dsfNodes()->insert({*myNode.switchId(), myNode}); - cfg::Port recyclePort; - recyclePort.logicalID() = 1; - recyclePort.name() = "rcy1/1/1"; - recyclePort.speed() = cfg::PortSpeed::HUNDREDG; - recyclePort.profileID() = - cfg::PortProfileID::PROFILE_100G_4_NRZ_CL91_COPPER; - recyclePort.portType() = cfg::PortType::RECYCLE_PORT; - cfg.ports()->push_back(recyclePort); - addRecyclePortRif(myNode, cfg); - } - if (switchType == cfg::SwitchType::VOQ) { - for (auto& intf : *cfg.interfaces()) { - intf.type() = cfg::InterfaceType::SYSTEM_PORT; + if (switchType == cfg::SwitchType::VOQ) { + cfg::DsfNode myNode = makeDsfNodeCfg(1); + cfg.dsfNodes()->insert({*myNode.switchId(), myNode}); + cfg.interfaces()->resize(kPortCount); + CHECK(myNode.systemPortRange().has_value()); + for (auto i = 0; i < kPortCount; ++i) { + auto intfId = + *cfg.ports()[i].logicalID() + *myNode.systemPortRange()->minimum(); + cfg.interfaces()[i].intfID() = intfId; + cfg.interfaces()[i].routerID() = 0; + cfg.interfaces()[i].type() = cfg::InterfaceType::SYSTEM_PORT; + cfg.interfaces()[i].name() = folly::sformat("fboss{}", intfId); + cfg.interfaces()[i].mac() = "00:02:00:00:00:55"; + cfg.interfaces()[i].mtu() = 9000; + cfg.interfaces()[i].ipAddresses()->resize(1); + cfg.interfaces()[i].ipAddresses()[0] = folly::sformat( + "2401:db00:2110:30{}::1/64", *cfg.ports()[i].logicalID()); + } + cfg::Port recyclePort; + recyclePort.logicalID() = 1; + recyclePort.name() = "rcy1/1/1"; + recyclePort.speed() = cfg::PortSpeed::HUNDREDG; + recyclePort.profileID() = + cfg::PortProfileID::PROFILE_100G_4_NRZ_CL91_COPPER; + recyclePort.portType() = cfg::PortType::RECYCLE_PORT; + cfg.ports()->push_back(recyclePort); + addRecyclePortRif(myNode, cfg); } } + return cfg; } From 95e36e532f480bc4d91c6691da5da4b33a9d16a4 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 6 Feb 2023 05:21:40 -0800 Subject: [PATCH 148/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/d506ac06dc6164f18132d5cca6881b79924712db https://github.com/facebook/litho/commit/d6530520bc688fab0cbbad290cb51e0fae25e821 Reviewed By: jailby fbshipit-source-id: 9cc9edab28ae3966213bba998509c70d7a560eee --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index 3a9a425239611..f6eb3d00d3bab 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 78fa9a6c29ff00daf0063bc0d1126797170f328b +Subproject commit d506ac06dc6164f18132d5cca6881b79924712db From 0ded56aa5d18044802838006402e4287607a38ab Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 6 Feb 2023 13:53:18 -0800 Subject: [PATCH 149/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/16667cd0a122f1a649590c95a8497314e9dfc89e https://github.com/facebook/folly/commit/ab50ffbe5d2bba06f25bb5d9b405e3f7dd40d71f https://github.com/facebook/proxygen/commit/5609263914f8583904fa32dedbf55039c5ca3407 https://github.com/facebook/watchman/commit/873d32faa296a0beba0a8cfdca3c9992330eec1f https://github.com/facebookexperimental/rust-shed/commit/885afcb11d04db1fd59d1e2acdd18cc095f45eb2 https://github.com/facebookincubator/velox/commit/c4d62cd1837d8bc8938e5c53e47428b73879b48c Reviewed By: yns88 fbshipit-source-id: 9f899081e8ef5ecd486e980f1437666fb8eb9663 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 5c5ad3d8d9627..f1b03b7fa23e9 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit ffe39d66d518f5cedb76133e15e48b2d4b446281 +Subproject commit 4ca2375744460ba006f1fba04cd3a72fccf09eb4 diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index f6eb3d00d3bab..0b9f8a0ebb82c 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit d506ac06dc6164f18132d5cca6881b79924712db +Subproject commit ab50ffbe5d2bba06f25bb5d9b405e3f7dd40d71f diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 8e3f081f28b31..b1809502c765d 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit f4102cc305c1a40b76afc59af8e7efd26e6a2b91 +Subproject commit 972446ed10b0f0925ce0e96968f41a4ab8d4417b From d07332f784fea6283cb4033071a697fcc685bcc6 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Mon, 6 Feb 2023 14:45:37 -0800 Subject: [PATCH 150/280] Consolidate the cmake files per service Summary: The content is not much, easier to humanly parse these configs this way. There is consistency of one .cmake file per service Reviewed By: binhuang00 Differential Revision: D43016060 fbshipit-source-id: 5316ade055b39c0c4beb9d4b6d77d8ea4da9d38e --- cmake/PlatformDataCorralService.cmake | 13 +++++++++++ cmake/PlatformDataCorralServiceIf.cmake | 17 -------------- cmake/PlatformFanService.cmake | 20 ++++++++++++++++ cmake/PlatformFanServiceHwTest.cmake | 15 ------------ cmake/PlatformFanServiceIf.cmake | 12 ---------- cmake/PlatformRackmon.cmake | 14 +++++++++++ cmake/PlatformRackmonIf.cmake | 17 -------------- cmake/PlatformSensorService.cmake | 31 +++++++++++++++++++++++++ cmake/PlatformSensorServiceHwTest.cmake | 15 ------------ cmake/PlatformSensorServiceIf.cmake | 24 ------------------- 10 files changed, 78 insertions(+), 100 deletions(-) delete mode 100644 cmake/PlatformDataCorralServiceIf.cmake delete mode 100644 cmake/PlatformFanServiceHwTest.cmake delete mode 100644 cmake/PlatformFanServiceIf.cmake delete mode 100644 cmake/PlatformRackmonIf.cmake delete mode 100644 cmake/PlatformSensorServiceHwTest.cmake delete mode 100644 cmake/PlatformSensorServiceIf.cmake diff --git a/cmake/PlatformDataCorralService.cmake b/cmake/PlatformDataCorralService.cmake index 1331b0d9d8368..63114c9ab67c4 100644 --- a/cmake/PlatformDataCorralService.cmake +++ b/cmake/PlatformDataCorralService.cmake @@ -3,6 +3,19 @@ # In general, libraries and binaries in fboss/foo/bar are built by # cmake/FooBar.cmake +add_fbthrift_cpp_library( + data_corral_service_cpp2 + fboss/platform/data_corral_service/if/data_corral_service.thrift + SERVICES + DataCorralServiceThrift + OPTIONS + json + reflection + DEPENDS + fb303_cpp2 + fboss_cpp2 +) + add_library(data_corral_service_lib fboss/platform/data_corral_service/DataCorralServiceImpl.cpp fboss/platform/data_corral_service/DataCorralServiceThriftHandler.cpp diff --git a/cmake/PlatformDataCorralServiceIf.cmake b/cmake/PlatformDataCorralServiceIf.cmake deleted file mode 100644 index 86ec59ab07ad0..0000000000000 --- a/cmake/PlatformDataCorralServiceIf.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# CMake to build libraries and binaries in fboss/agent - -# In general, libraries and binaries in fboss/foo/bar are built by -# cmake/FooBar.cmake - -add_fbthrift_cpp_library( - data_corral_service_cpp2 - fboss/platform/data_corral_service/if/data_corral_service.thrift - SERVICES - DataCorralServiceThrift - OPTIONS - json - reflection - DEPENDS - fb303_cpp2 - fboss_cpp2 -) diff --git a/cmake/PlatformFanService.cmake b/cmake/PlatformFanService.cmake index 606ed13160508..17d01ec47e01a 100644 --- a/cmake/PlatformFanService.cmake +++ b/cmake/PlatformFanService.cmake @@ -3,6 +3,15 @@ # In general, libraries and binaries in fboss/foo/bar are built by # cmake/FooBar.cmake +add_fbthrift_cpp_library( + fan_config_structs_types_cpp2 + fboss/platform/fan_service/if/fan_config_structs.thrift + OPTIONS + json + reflection +) + + add_library(fan_service_lib fboss/platform/fan_service/Bsp.cpp fboss/platform/fan_service/ControlLogic.cpp @@ -40,3 +49,14 @@ target_link_libraries(fan_service fan_service_lib fb303::fb303 ) + +add_library(fan_service_hw_tests + fboss/platform/fan_service/hw_test/FanServiceTest.cpp +) + +target_link_libraries(fan_service_hw_tests + fan_service_lib + Folly::folly + ${GTEST} + ${LIBGMOCK_LIBRARIES} +) diff --git a/cmake/PlatformFanServiceHwTest.cmake b/cmake/PlatformFanServiceHwTest.cmake deleted file mode 100644 index 48e86d958287b..0000000000000 --- a/cmake/PlatformFanServiceHwTest.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# Make to build libraries and binaries in fboss/platform/fan_service - -# In general, libraries and binaries in fboss/foo/bar are built by -# cmake/FooBar.cmake - -add_library(fan_service_hw_tests - fboss/platform/fan_service/hw_test/FanServiceTest.cpp -) - -target_link_libraries(fan_service_hw_tests - fan_service_lib - Folly::folly - ${GTEST} - ${LIBGMOCK_LIBRARIES} -) diff --git a/cmake/PlatformFanServiceIf.cmake b/cmake/PlatformFanServiceIf.cmake deleted file mode 100644 index c6f576263a8b1..0000000000000 --- a/cmake/PlatformFanServiceIf.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# CMake to build libraries and binaries in fboss/agent - -# In general, libraries and binaries in fboss/foo/bar are built by -# cmake/FooBar.cmake - -add_fbthrift_cpp_library( - fan_config_structs_types_cpp2 - fboss/platform/fan_service/if/fan_config_structs.thrift - OPTIONS - json - reflection -) diff --git a/cmake/PlatformRackmon.cmake b/cmake/PlatformRackmon.cmake index 41f7cad7ae074..08837a0fde031 100644 --- a/cmake/PlatformRackmon.cmake +++ b/cmake/PlatformRackmon.cmake @@ -8,6 +8,20 @@ add_custom_command( DEPENDS fboss/platform/rackmon/configs/interface/rackmon.conf fboss/platform/rackmon/configs/interface/rackmon_pls.conf fboss/platform/rackmon/configs/register_map/orv2_psu.json ) +add_fbthrift_cpp_library( + rackmon_cpp2 + fboss/platform/rackmon/if/rackmonsvc.thrift + SERVICES + RackmonCtrl + OPTIONS + json + reflection + DEPENDS + fb303_cpp2 + fboss_cpp2 +) + + add_library(rackmon_lib fboss/platform/rackmon/RackmonThriftHandler.cpp fboss/platform/rackmon/Device.cpp diff --git a/cmake/PlatformRackmonIf.cmake b/cmake/PlatformRackmonIf.cmake deleted file mode 100644 index b284edd521d0c..0000000000000 --- a/cmake/PlatformRackmonIf.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# CMake to build libraries and binaries in fboss/agent - -# In general, libraries and binaries in fboss/foo/bar are built by -# cmake/FooBar.cmake - -add_fbthrift_cpp_library( - rackmon_cpp2 - fboss/platform/rackmon/if/rackmonsvc.thrift - SERVICES - RackmonCtrl - OPTIONS - json - reflection - DEPENDS - fb303_cpp2 - fboss_cpp2 -) diff --git a/cmake/PlatformSensorService.cmake b/cmake/PlatformSensorService.cmake index 18356be952d1d..1a27c7d8d9807 100644 --- a/cmake/PlatformSensorService.cmake +++ b/cmake/PlatformSensorService.cmake @@ -3,6 +3,26 @@ # In general, libraries and binaries in fboss/foo/bar are built by # cmake/FooBar.cmake +add_fbthrift_cpp_library( + sensor_service_cpp2 + fboss/platform/sensor_service/if/sensor_service.thrift + SERVICES + SensorServiceThrift + OPTIONS + json + reflection + DEPENDS + fboss_cpp2 +) + +add_fbthrift_cpp_library( + sensor_config_cpp2 + fboss/platform/sensor_service/if/sensor_config.thrift + OPTIONS + json + reflection +) + add_library(sensor_service_lib fboss/platform/sensor_service/FsdbSyncer.cpp fboss/platform/sensor_service/Flags.cpp @@ -33,3 +53,14 @@ target_link_libraries(sensor_service sensor_service_lib fb303::fb303 ) + +add_executable(sensors_test + fboss/platform/sensor_service/hw_test/Main.cpp + fboss/platform/sensor_service/hw_test/SensorsTest.cpp +) + +target_link_libraries(sensors_test + sensor_service_lib + ${GTEST} + ${LIBGMOCK_LIBRARIES} +) diff --git a/cmake/PlatformSensorServiceHwTest.cmake b/cmake/PlatformSensorServiceHwTest.cmake deleted file mode 100644 index 47b81a7b8e580..0000000000000 --- a/cmake/PlatformSensorServiceHwTest.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# Make to build libraries and binaries in fboss/platform/weutils - -# In general, libraries and binaries in fboss/foo/bar are built by -# cmake/FooBar.cmake - -add_executable(sensors_test - fboss/platform/sensor_service/hw_test/Main.cpp - fboss/platform/sensor_service/hw_test/SensorsTest.cpp -) - -target_link_libraries(sensors_test - sensor_service_lib - ${GTEST} - ${LIBGMOCK_LIBRARIES} -) diff --git a/cmake/PlatformSensorServiceIf.cmake b/cmake/PlatformSensorServiceIf.cmake deleted file mode 100644 index a493b83a5aacd..0000000000000 --- a/cmake/PlatformSensorServiceIf.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# CMake to build libraries and binaries in fboss/agent - -# In general, libraries and binaries in fboss/foo/bar are built by -# cmake/FooBar.cmake - -add_fbthrift_cpp_library( - sensor_service_cpp2 - fboss/platform/sensor_service/if/sensor_service.thrift - SERVICES - SensorServiceThrift - OPTIONS - json - reflection - DEPENDS - fboss_cpp2 -) - -add_fbthrift_cpp_library( - sensor_config_cpp2 - fboss/platform/sensor_service/if/sensor_config.thrift - OPTIONS - json - reflection -) From edab99ee6debfc624dd012fff0e65fe0ec41cd16 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Mon, 6 Feb 2023 14:45:37 -0800 Subject: [PATCH 151/280] Rename config_path flag to config_file Reviewed By: jasmeetbagga Differential Revision: D43016062 fbshipit-source-id: e95ac9915818524ef847064797c664f64947a6b5 --- fboss/platform/sensor_service/Flags.cpp | 4 ++-- fboss/platform/sensor_service/Flags.h | 2 +- fboss/platform/sensor_service/Main.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fboss/platform/sensor_service/Flags.cpp b/fboss/platform/sensor_service/Flags.cpp index 892467b288d4d..9ceb8519ef776 100644 --- a/fboss/platform/sensor_service/Flags.cpp +++ b/fboss/platform/sensor_service/Flags.cpp @@ -23,7 +23,7 @@ DEFINE_int32( DEFINE_int32(thrift_port, 5970, "Port for the thrift service"); DEFINE_string( - config_path, + config_file, "", - "Optional platform sensor configuration file path. " + "Optional platform sensor configuration file. " "If empty we pick the platform default config"); diff --git a/fboss/platform/sensor_service/Flags.h b/fboss/platform/sensor_service/Flags.h index 61ccaebae7155..3ad8151ec0772 100644 --- a/fboss/platform/sensor_service/Flags.h +++ b/fboss/platform/sensor_service/Flags.h @@ -15,4 +15,4 @@ DECLARE_uint32(sensor_fetch_interval); DECLARE_int32(stats_publish_interval); DECLARE_int32(thrift_port); -DECLARE_string(config_path); +DECLARE_string(config_file); diff --git a/fboss/platform/sensor_service/Main.cpp b/fboss/platform/sensor_service/Main.cpp index 053e2a35c10f8..8c77cf7e7b983 100644 --- a/fboss/platform/sensor_service/Main.cpp +++ b/fboss/platform/sensor_service/Main.cpp @@ -20,7 +20,7 @@ int main(int argc, char** argv) { helpers::init(argc, argv); - auto serviceImpl = std::make_shared(FLAGS_config_path); + auto serviceImpl = std::make_shared(FLAGS_config_file); // Fetch sensor data once to warmup serviceImpl->fetchSensorData(); From 440b26f065aced4b77a611415a24123f86289eac Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Mon, 6 Feb 2023 14:45:37 -0800 Subject: [PATCH 152/280] Add informative log messages for config processing Reviewed By: jasmeetbagga Differential Revision: D43016061 fbshipit-source-id: 0dad2d78332010c7dcc8b0cf1e3887bd0384c95e --- fboss/platform/config_lib/oss/ConfigLib.cpp | 6 ++++-- fboss/platform/sensor_service/SensorServiceImpl.cpp | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fboss/platform/config_lib/oss/ConfigLib.cpp b/fboss/platform/config_lib/oss/ConfigLib.cpp index 7fe562d55fc6c..4ced9da3fd5d6 100644 --- a/fboss/platform/config_lib/oss/ConfigLib.cpp +++ b/fboss/platform/config_lib/oss/ConfigLib.cpp @@ -6,12 +6,14 @@ namespace facebook::fboss::platform::config_lib { std::string getSensorServiceConfig( const std::optional& /* platformName */) { - throw std::runtime_error("Unimplemented function"); + throw std::runtime_error( + "Unimplemented function. Specify config_file explicitly"); } std::string getFbdevdConfig( const std::optional& /* platformName */) { - throw std::runtime_error("Unimplemented function"); + throw std::runtime_error( + "Unimplemented function. Specify config_file explicitly"); } } // namespace facebook::fboss::platform::config_lib diff --git a/fboss/platform/sensor_service/SensorServiceImpl.cpp b/fboss/platform/sensor_service/SensorServiceImpl.cpp index e967e7a2ec5c7..3f0757c14aeb8 100644 --- a/fboss/platform/sensor_service/SensorServiceImpl.cpp +++ b/fboss/platform/sensor_service/SensorServiceImpl.cpp @@ -46,10 +46,14 @@ void SensorServiceImpl::init() { std::string sensorConfJson; // Check if conf file name is set, if not, set the default name if (confFileName_.empty()) { + XLOG(INFO) << "No config file was provided. Inferring from config_lib"; sensorConfJson = config_lib::getSensorServiceConfig(); - } else if (!folly::readFile(confFileName_.c_str(), sensorConfJson)) { - throw std::runtime_error( - "Can not find sensor config file: " + confFileName_); + } else { + XLOG(INFO) << "Using config file: " << confFileName_; + if (!folly::readFile(confFileName_.c_str(), sensorConfJson)) { + throw std::runtime_error( + "Can not find sensor config file: " + confFileName_); + } } // Clear everything before init From a1e9c14742b6488934ce0255a15087966cd23307 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Mon, 6 Feb 2023 14:45:37 -0800 Subject: [PATCH 153/280] Ensure the hw test passes in OSS Summary: Previously this was failing on empty config file Reviewed By: jasmeetbagga Differential Revision: D43016063 fbshipit-source-id: 0c182a82c0530a9f81534cb45138250144a924a6 --- fboss/platform/sensor_service/hw_test/SensorsTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fboss/platform/sensor_service/hw_test/SensorsTest.cpp b/fboss/platform/sensor_service/hw_test/SensorsTest.cpp index 2d87260de15a8..a5c92f05560c7 100644 --- a/fboss/platform/sensor_service/hw_test/SensorsTest.cpp +++ b/fboss/platform/sensor_service/hw_test/SensorsTest.cpp @@ -25,7 +25,7 @@ SensorsTest::~SensorsTest() {} void SensorsTest::SetUp() { thriftHandler_ = std::make_shared( - std::make_shared("")); + std::make_shared(FLAGS_config_file)); } void SensorsTest::TearDown() {} From dda919d80404f740df3360a35fb9634b03ebbde0 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Mon, 6 Feb 2023 14:45:37 -0800 Subject: [PATCH 154/280] Rename sensor_service hw test Reviewed By: jasmeetbagga Differential Revision: D43016059 fbshipit-source-id: d61288d9c6948d890b3fabbc5139838fbdb8ad7c --- cmake/PlatformSensorService.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/PlatformSensorService.cmake b/cmake/PlatformSensorService.cmake index 1a27c7d8d9807..2c12c7e68826c 100644 --- a/cmake/PlatformSensorService.cmake +++ b/cmake/PlatformSensorService.cmake @@ -54,12 +54,12 @@ target_link_libraries(sensor_service fb303::fb303 ) -add_executable(sensors_test +add_executable(sensor_service_hw_test fboss/platform/sensor_service/hw_test/Main.cpp fboss/platform/sensor_service/hw_test/SensorsTest.cpp ) -target_link_libraries(sensors_test +target_link_libraries(sensor_service_hw_test sensor_service_lib ${GTEST} ${LIBGMOCK_LIBRARIES} From 9f341ecf309ac38133e9c73895679d4cb7cf5ae9 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 6 Feb 2023 14:47:08 -0800 Subject: [PATCH 155/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/92121b9f9ae4d33c271bd215dda46ecb20c45444 https://github.com/pytorch/kineto/commit/5da6a2eb47ac1bbdcf3ab85721428904f3defb6f Reviewed By: yns88 fbshipit-source-id: 8bc7657056b5d84376555b71c95df468b9c81935 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index f1b03b7fa23e9..3ee1c1b2e4d13 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 4ca2375744460ba006f1fba04cd3a72fccf09eb4 +Subproject commit 92121b9f9ae4d33c271bd215dda46ecb20c45444 From f35527397ae926dc00b0a7ba8ca62eaf2e337237 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 6 Feb 2023 15:35:58 -0800 Subject: [PATCH 156/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/43812649679d9011f26819dca0f2949e88fac26f https://github.com/facebook/rocksdb/commit/92e8874654b0f28107967a50a13be28e81357a30 https://github.com/facebookresearch/vrs/commit/139fa2b55b90fa66c221594d36d8eae40255aad4 Reviewed By: yns88 fbshipit-source-id: 0561924845b6b2ffba7a395d2b99c79c26089ea6 --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index 0b9f8a0ebb82c..931d2b69b0841 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit ab50ffbe5d2bba06f25bb5d9b405e3f7dd40d71f +Subproject commit 43812649679d9011f26819dca0f2949e88fac26f From b93f73db5456ff1f0426b1261494d53594380f43 Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Mon, 6 Feb 2023 16:23:15 -0800 Subject: [PATCH 157/280] Non-voq: skip populating intfID if port disabled && no intfID for vlan Summary: D42606085 attempts to populate interfaceIDs for all ports. However: On BcmSwitch, subsumed ports are part of the config but disabled. These ports have ingressVlan 4094. There is no interface corresponidng to these vlans. Thus, skip setting intfID for such ports. However, non-subsumed ports can be disabled too. Thus, skip populating intfID if the port is disabled && no intfID for vlan. if no intfID found for an enabled port, throw error. Reviewed By: jasmeetbagga Differential Revision: D43060476 Privacy Context Container: L1125642 fbshipit-source-id: 82006069af02518ccf79862702e01fc741388aef --- fboss/agent/ApplyThriftConfig.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index f49db3bb87957..669323ccea874 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -1105,8 +1105,17 @@ void ThriftConfigApplier::processInterfaceForPortForNonVoqSwitches() { for (const auto& [vlanID, vlanInfo] : portVlans_[portID]) { auto it = vlan2InterfaceId.find(vlanID); + // Skip if vlan has no interface && port is not enabled if (it == vlan2InterfaceId.end()) { - throw FbossError("VLAN ", vlanID, " has no interface"); + if (*portCfg.state() != cfg::PortState::ENABLED) { + continue; + } + throw FbossError( + "VLAN ", + vlanID, + " has no interface, even when corresp port ", + portID, + " is enabled"); } port2InterfaceId_[portID].push_back(it->second); } From 6029948bb338ec539007f9608e3d1d68d6e10a5b Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 6 Feb 2023 16:28:14 -0800 Subject: [PATCH 158/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/cf2cd8fcfff35f20f54382328682b11a3a5febcb https://github.com/facebook/proxygen/commit/ee0dbe9f63cc38604036a6481c707cc11be77da6 https://github.com/facebookincubator/mvfst/commit/392d28c02139609d87a25ac33174e482b03d9974 https://github.com/pytorch/kineto/commit/720d81ecb20961184c580e67893e645389b0cb3f Reviewed By: yns88 fbshipit-source-id: 0ac8911348b37f6fe48a8f33fa001c0655f0d7ab --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 3ee1c1b2e4d13..fc0e911fbb978 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 92121b9f9ae4d33c271bd215dda46ecb20c45444 +Subproject commit cf2cd8fcfff35f20f54382328682b11a3a5febcb From 05afa44a0ee7aa9ab41fced368d9c627204a2563 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 6 Feb 2023 17:15:51 -0800 Subject: [PATCH 159/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/fb120798a77ce73555cdbfcdccb338998896c6ce https://github.com/facebook/rocksdb/commit/9b663313880b556b77b9baa69b374bb4a35b8616 Reviewed By: yns88 fbshipit-source-id: 66b09295ebf7bca4681a85d82f8dafbc23e3b47a --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index 931d2b69b0841..b2ca221b47207 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 43812649679d9011f26819dca0f2949e88fac26f +Subproject commit fb120798a77ce73555cdbfcdccb338998896c6ce From 5be1da75fb7c4dd3644c5d464aebfe8750e98977 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Mon, 6 Feb 2023 17:53:34 -0800 Subject: [PATCH 160/280] Added a helper to return RS-FEC lanes for a given speed Summary: as titled. Will be used later in the stack to read the appropriate number of FEC Alignment Marker status from the IPHYs. Reviewed By: jasmeetbagga Differential Revision: D43015971 Privacy Context Container: L1125642 fbshipit-source-id: 3542cba69ca7e65a04adbf49d6b7f6bc23cf1fdd --- fboss/lib/phy/PhyUtils.cpp | 18 ++++++++++++++++++ fboss/lib/phy/PhyUtils.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/fboss/lib/phy/PhyUtils.cpp b/fboss/lib/phy/PhyUtils.cpp index ead669b366902..b25e0b5cf42e5 100644 --- a/fboss/lib/phy/PhyUtils.cpp +++ b/fboss/lib/phy/PhyUtils.cpp @@ -22,6 +22,24 @@ bool isReedSolomonFec(phy::FecMode fec) { return false; } +uint8_t reedSolomonFecLanes(cfg::PortSpeed speed) { + switch (speed) { + case cfg::PortSpeed::TWENTYFIVEG: + return 1; + case cfg::PortSpeed::FIFTYG: + case cfg::PortSpeed::FIFTYTHREEPOINTONETWOFIVEG: + return 2; + case cfg::PortSpeed::HUNDREDG: + return 4; + case cfg::PortSpeed::TWOHUNDREDG: + return 8; + case cfg::PortSpeed::FOURHUNDREDG: + return 16; + default: + return 0; + } +} + double ber(uint64_t erroredBits, cfg::PortSpeed speed, uint64_t timeDeltaInSeconds) { double totalBits = diff --git a/fboss/lib/phy/PhyUtils.h b/fboss/lib/phy/PhyUtils.h index 917a7c70654c2..e26ade5059c2e 100644 --- a/fboss/lib/phy/PhyUtils.h +++ b/fboss/lib/phy/PhyUtils.h @@ -2,6 +2,7 @@ #pragma once +#include #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/lib/phy/gen-cpp2/phy_types.h" @@ -9,6 +10,8 @@ namespace facebook::fboss::utility { bool isReedSolomonFec(phy::FecMode fec); +uint8_t reedSolomonFecLanes(cfg::PortSpeed speed); + double ber(uint64_t erroredBits, cfg::PortSpeed speed, uint64_t timeDeltaInSeconds); From afafeef6e48f47afe2f86e9a780fe173dc0bea40 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 6 Feb 2023 18:09:36 -0800 Subject: [PATCH 161/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/879b2bef323d664a92904c799278ed8b423784a9 https://github.com/facebook/proxygen/commit/c3c29735c195dd2daa0cc9effb944af9041eb42a https://github.com/facebook/watchman/commit/5cba53852d5970c5fa6c5ffe8f35afc908b77279 https://github.com/facebookexperimental/edencommon/commit/d85adc31fe524d93179924546a481e83785fbb49 https://github.com/facebookincubator/mvfst/commit/c2564ae252d68543e189381c39832bae601fa49b Reviewed By: yns88 fbshipit-source-id: 557e5718812b8c74399a6eb76d754384731eab32 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index fc0e911fbb978..5d8fcdeb2a735 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit cf2cd8fcfff35f20f54382328682b11a3a5febcb +Subproject commit 879b2bef323d664a92904c799278ed8b423784a9 From 404ae8035cb4f1eaefb64fd0f4378ca609b9d40f Mon Sep 17 00:00:00 2001 From: Ron He Date: Mon, 6 Feb 2023 19:33:50 -0800 Subject: [PATCH 162/280] Support reading thrift state in replay test Summary: As titled. Need to update switch state replay tests to read thrift state. This is towards supporting N-SDK warmboot tests. Reviewed By: jasmeetbagga Differential Revision: D43010446 Privacy Context Container: L1125642 fbshipit-source-id: 3e33592fa9d9d0b9ef5000e9d9a54a67c3c6a309 --- .../agent/hw/test/HwSwitchStateReplayTest.cpp | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/fboss/agent/hw/test/HwSwitchStateReplayTest.cpp b/fboss/agent/hw/test/HwSwitchStateReplayTest.cpp index 845993169bedc..13717fd6e3cb6 100644 --- a/fboss/agent/hw/test/HwSwitchStateReplayTest.cpp +++ b/fboss/agent/hw/test/HwSwitchStateReplayTest.cpp @@ -31,13 +31,28 @@ namespace facebook::fboss { class HwSwitchStateReplayTest : public HwTest { std::shared_ptr getWarmBootState() { if (FLAGS_replay_switch_state_file.size()) { - std::string warmBootJson; - auto ret = - folly::readFile(FLAGS_replay_switch_state_file.c_str(), warmBootJson); + std::vector bytes; + auto ret = folly::readFile(FLAGS_replay_switch_state_file.c_str(), bytes); sysCheckError( ret, "Unable to read switch state from : ", FLAGS_replay_switch_state_file); + // By default parse switch state as thrift + state::WarmbootState thriftState; + auto buf = folly::IOBuf::copyBuffer(bytes.data(), bytes.size()); + apache::thrift::BinaryProtocolReader reader; + reader.setInput(buf.get()); + try { + thriftState.read(&reader); + return SwitchState::fromThrift(*thriftState.swSwitchState()); + } catch (const std::exception& e) { + XLOG(INFO) + << "Failed to parse replay switch state file to thrift. Falling back to json."; + } + + // Failed to parse thrift - fall back to JSON. + std::string warmBootJson( + reinterpret_cast(bytes.data()), bytes.size()); return SwitchState::fromFollyDynamic( folly::parseJson(warmBootJson)["swSwitch"]); } From 4bfc9fa40519486b25ee6f97edd61b697a5bb847 Mon Sep 17 00:00:00 2001 From: Ron He Date: Mon, 6 Feb 2023 19:33:50 -0800 Subject: [PATCH 163/280] Create flag to skip setting src mac Summary: During N-SDK warmboots, SDK would complain modifying source mac if we move SDK state from prod switch to test switch. Therefore, creating a flag to skip setting src mac during warmboot. This would help successful warmboot init when applying SDK state + switch state. Reviewed By: jasmeetbagga Differential Revision: D43011076 Privacy Context Container: L1125642 fbshipit-source-id: 5524820c6c2af1bda42eef40ac34f555270091b8 --- fboss/agent/hw/sai/switch/SaiSwitchManager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fboss/agent/hw/sai/switch/SaiSwitchManager.cpp b/fboss/agent/hw/sai/switch/SaiSwitchManager.cpp index c79bb13391e23..501d980b80440 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitchManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitchManager.cpp @@ -36,6 +36,11 @@ DEFINE_uint32( 1, "Counter refresh interval in seconds. Set it to 0 to fetch stats from HW"); +DEFINE_bool( + skip_setting_src_mac, + false, + "Flag to indicate whether to skip setting source mac in Sai switch during wb"); + namespace { using namespace facebook::fboss; sai_hash_algorithm_t toSaiHashAlgo(cfg::HashingAlgorithm algo) { @@ -74,8 +79,10 @@ SaiSwitchManager::SaiSwitchManager( platform->getSwitchAttributes(true, switchType, switchId), swId); // Load all switch attributes switch_ = std::make_unique(newSwitchId); - switch_->setOptionalAttribute( - SaiSwitchTraits::Attributes::SrcMac{platform->getLocalMac()}); + if (!FLAGS_skip_setting_src_mac) { + switch_->setOptionalAttribute( + SaiSwitchTraits::Attributes::SrcMac{platform->getLocalMac()}); + } switch_->setOptionalAttribute(SaiSwitchTraits::Attributes::MacAgingTime{ platform->getDefaultMacAgingTime()}); } else { From c88ab1b7356349cd2bd01303ef6ce29e63da37c1 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Mon, 6 Feb 2023 20:17:13 -0800 Subject: [PATCH 164/280] Fix includes in sensor_service/test Summary: fix ordering to adhere with cpp styling Reviewed By: jasmeetbagga Differential Revision: D43068466 fbshipit-source-id: 0c8c380bbfc122e66651f50deef2a878f0fcfe6a --- .../platform/sensor_service/test/SensorServiceImplTest.cpp | 6 +++--- fboss/platform/sensor_service/test/TestUtils.cpp | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fboss/platform/sensor_service/test/SensorServiceImplTest.cpp b/fboss/platform/sensor_service/test/SensorServiceImplTest.cpp index 6465dddda8575..3b349a4bdfd92 100644 --- a/fboss/platform/sensor_service/test/SensorServiceImplTest.cpp +++ b/fboss/platform/sensor_service/test/SensorServiceImplTest.cpp @@ -1,12 +1,12 @@ // (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. -#include "fboss/platform/sensor_service/SensorServiceImpl.h" #include +#include + #include "fboss/platform/helpers/Utils.h" +#include "fboss/platform/sensor_service/SensorServiceImpl.h" #include "fboss/platform/sensor_service/test/TestUtils.h" -#include - using namespace facebook::fboss::platform::sensor_service; namespace facebook::fboss { diff --git a/fboss/platform/sensor_service/test/TestUtils.cpp b/fboss/platform/sensor_service/test/TestUtils.cpp index 02ecafec88826..74db0fbd9bd1b 100644 --- a/fboss/platform/sensor_service/test/TestUtils.cpp +++ b/fboss/platform/sensor_service/test/TestUtils.cpp @@ -1,9 +1,10 @@ // (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. -#include "fboss/platform/sensor_service/test/TestUtils.h" #include #include -#include "thrift/lib/cpp2/protocol/Serializer.h" +#include + +#include "fboss/platform/sensor_service/test/TestUtils.h" using namespace facebook::fboss::platform::sensor_service; From 5ee6b5475387df07eb66ca482fdcdd4e28566325 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Mon, 6 Feb 2023 20:17:13 -0800 Subject: [PATCH 165/280] Build sensor_service_impl_test in oss Reviewed By: jasmeetbagga Differential Revision: D43068465 fbshipit-source-id: 8c6b601c21e2d0d9dd3bf37f9ca8a3ff4d7d0195 --- cmake/PlatformSensorService.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/PlatformSensorService.cmake b/cmake/PlatformSensorService.cmake index 2c12c7e68826c..976460ee0139d 100644 --- a/cmake/PlatformSensorService.cmake +++ b/cmake/PlatformSensorService.cmake @@ -64,3 +64,15 @@ target_link_libraries(sensor_service_hw_test ${GTEST} ${LIBGMOCK_LIBRARIES} ) + +add_executable(sensor_service_impl_test + fboss/platform/sensor_service/test/SensorServiceImplTest.cpp + fboss/platform/sensor_service/test/TestUtils.cpp +) + +target_link_libraries(sensor_service_impl_test + platform_utils + sensor_service_lib + ${GTEST} + ${LIBGMOCK_LIBRARIES} +) From a0e2d61e7131bdc75862272923e5ab31ff9200d7 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Mon, 6 Feb 2023 20:17:13 -0800 Subject: [PATCH 166/280] Build fan_service_hw_test as executable in oss Reviewed By: jasmeetbagga Differential Revision: D43068464 fbshipit-source-id: 5f2492414550c56f1de70dd2c7e7104660f2e3c0 --- cmake/PlatformFanService.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/PlatformFanService.cmake b/cmake/PlatformFanService.cmake index 17d01ec47e01a..9a1a365f77e5c 100644 --- a/cmake/PlatformFanService.cmake +++ b/cmake/PlatformFanService.cmake @@ -50,11 +50,11 @@ target_link_libraries(fan_service fb303::fb303 ) -add_library(fan_service_hw_tests +add_executable(fan_service_hw_test fboss/platform/fan_service/hw_test/FanServiceTest.cpp ) -target_link_libraries(fan_service_hw_tests +target_link_libraries(fan_service_hw_test fan_service_lib Folly::folly ${GTEST} From 130f43e9faacde1c5ba0b4946f31cdb616e319c1 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Mon, 6 Feb 2023 20:17:13 -0800 Subject: [PATCH 167/280] Build the sw unittest in oss Reviewed By: jasmeetbagga Differential Revision: D43068467 fbshipit-source-id: 68727005df92c179af5fd2f10576236d7520327e --- cmake/PlatformFanService.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/PlatformFanService.cmake b/cmake/PlatformFanService.cmake index 9a1a365f77e5c..e27e03ffe0681 100644 --- a/cmake/PlatformFanService.cmake +++ b/cmake/PlatformFanService.cmake @@ -50,6 +50,18 @@ target_link_libraries(fan_service fb303::fb303 ) +add_executable(fan_service_sw_test + fboss/platform/fan_service/tests/BspTests.cpp + fboss/platform/fan_service/tests/ServiceConfigTests.cpp +) + +target_link_libraries(fan_service_sw_test + fan_service_lib + Folly::folly + ${GTEST} + ${LIBGMOCK_LIBRARIES} +) + add_executable(fan_service_hw_test fboss/platform/fan_service/hw_test/FanServiceTest.cpp ) From dc299269a60c744c8e2428890eb75600f84b1d3c Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Mon, 6 Feb 2023 20:28:19 -0800 Subject: [PATCH 168/280] Get hash consistency tests runnable on voq switches + more greelighting of tests Summary: As titled. The HwHashConsistencyTest still fail on makalu but this diff atleast makes them runnable Differential Revision: D42892409 fbshipit-source-id: b74aec1828a32e16a06ac80fb6e8a0203c8791ff --- .../dataplane_tests/HwHashConsistencyTest.cpp | 50 ++++++++++++------- .../centos-7-x86_64/run_scripts/run_test.py | 2 + 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp index c729f5004bcd8..d3a1700d8de82 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp @@ -7,6 +7,7 @@ #include "fboss/agent/hw/test/HwTestEcmpUtils.h" #include "fboss/agent/hw/test/HwTestPacketUtils.h" #include "fboss/agent/hw/test/LoadBalancerUtils.h" +#include "fboss/lib/CommonUtils.h" namespace { facebook::fboss::RoutePrefixV6 kDefaultRoute{folly::IPAddressV6(), 0}; @@ -26,7 +27,7 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { ecmpHelper_ = std::make_unique( getProgrammedState(), kRid); for (auto i = 0; i < kEcmpWidth4; i++) { - ports_[i] = masterLogicalPortIds()[i]; + ports_[i] = masterLogicalInterfacePortIds()[i]; } /* experiments revealed these which L4 ports map to which switch port */ @@ -47,6 +48,7 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { udpPortsForSai_[1] = 10006; udpPortsForSai_[2] = 10002; udpPortsForSai_[3] = 10003; + } else { tcpPortsForSai_[0] = 10003; tcpPortsForSai_[1] = 10000; @@ -91,14 +93,20 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { resolve ? resolveNhops({ports_[index]}) : unresolveNhops({ports_[index]}); } - uint16_t getFlowPort(int index, bool isSai, FlowType type) { + uint16_t getFlowPort(int index, bool isSai, FlowType type) const { switch (type) { case FlowType::TCP: - return isSai ? tcpPortsForSai_[index] : tcpPorts_[index]; + return isSai ? tcpPortsForSai_.find(index)->second + : tcpPorts_.find(index)->second; case FlowType::UDP: - return isSai ? udpPortsForSai_[index] : udpPorts_[index]; + return isSai ? udpPortsForSai_.find(index)->second + : udpPorts_.find(index)->second; } } + uint16_t getFlowPort(int index, FlowType type) const { + auto isSai = getHwSwitchEnsemble()->isSai(); + return getFlowPort(index, isSai, type); + } void sendFlowWithPort(uint16_t port, FlowType type) { auto vlanId = utility::firstVlanID(initialConfig()); @@ -132,12 +140,27 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { break; } } - void sendFlow(int index, FlowType type) { - auto isSai = getHwSwitchEnsemble()->isSai(); - auto port = getFlowPort(index, isSai, type); + auto port = getFlowPort(index, type); sendFlowWithPort(port, type); } + void verifyFlowEgress(int index, FlowType flowType) { + XLOG(DBG2) << " For flow port: " << getFlowPort(index, flowType) + << " expecting increment of 1 on port at index: " << index; + WITH_RETRIES({ + EXPECT_EVENTUALLY_EQ( + getPortOutPkts(this->getLatestPortStats(ports_[index])), 1); + auto pktCnt = 0; + for (auto i = 0; i < kEcmpWidth4; i++) { + auto pkts = getPortOutPkts(this->getLatestPortStats(ports_[i])); + XLOG(DBG2) << " For flow port: " << getFlowPort(index, flowType) + << " pkt egress increment on port at index: " << i + << " is: " << pkts; + pktCnt += pkts; + } + EXPECT_EVENTUALLY_EQ(pktCnt, 1); + }); + } void programRoute() { std::vector weights(4, ECMP_WEIGHT); @@ -183,15 +206,6 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { programRoute(); } - void verifyFlowEgress(int index) { - ASSERT_EQ(getPortOutPkts(this->getLatestPortStats(ports_[index])), 1); - uint8_t pktCnt = 0; - for (auto i = 0; i < kEcmpWidth4; i++) { - pktCnt += getPortOutPkts(this->getLatestPortStats(ports_[i])); - } - EXPECT_EQ(pktCnt, 1); - } - protected: std::unique_ptr ecmpHelper_; std::array ports_{}; @@ -212,7 +226,7 @@ TEST_F(HwHashConsistencyTest, TcpEgressLinks) { for (auto i = 0; i < kEcmpWidth4; i++) { clearPortStats(); sendFlow(i /* flow i */, FlowType::TCP); - verifyFlowEgress(i /* flow i */); + verifyFlowEgress(i /* flow i */, FlowType::TCP); } }; verifyAcrossWarmBoots(setup, verify); @@ -259,7 +273,7 @@ TEST_F(HwHashConsistencyTest, UdpEgressLinks) { for (auto i = 0; i < kEcmpWidth4; i++) { clearPortStats(); sendFlow(i /* ith flow */, FlowType::UDP); - verifyFlowEgress(i /* ith flow */); + verifyFlowEgress(i /* ith flow */, FlowType::UDP); } }; verifyAcrossWarmBoots(setup, verify); diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 9723018a74787..b617d2c274c59 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -80,6 +80,8 @@ # UCMP support lacking DNX # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV4.*:-*Ucmp*:-*Shrink* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV6.*:-*Ucmp*:-*Shrink* +# LB Tests with ROCE traffic +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerNegativeTestV6RoCE.* # Route programming tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwAlpmStressTest.* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=SaiNextHopGroupTest:-*addNextHopGroupPortDown* From 1395f6e50399c8b8d1403b897cf85411351f45ea Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 6 Feb 2023 20:54:31 -0800 Subject: [PATCH 169/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/f5641439382254134d192ca8fe3c9af23f87b5fa https://github.com/facebook/rocksdb/commit/54d72085b521c73bc4cce256b44fc1025ef9b77d Reviewed By: yns88 fbshipit-source-id: 23b75ac4e848d34f953b6b218e1b0e2d31c9ae09 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 5d8fcdeb2a735..9ea393b87c493 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 879b2bef323d664a92904c799278ed8b423784a9 +Subproject commit f5641439382254134d192ca8fe3c9af23f87b5fa From 04d744b996815a8cc85a2bf3fea0ebf30f2d6625 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Mon, 6 Feb 2023 21:31:52 -0800 Subject: [PATCH 170/280] Add a check for interface id falling within sys port range Summary: As titled. With this I had to also get rid of a couple of test which were changing switch id, type on the fly w/o updating other aspects of the config. We could make those work with appropriate changes to test configs, but since we never plan to change switch type, id dynamically on a box, omit the tests Reviewed By: nivinl Differential Revision: D43036629 Privacy Context Container: L1125642 fbshipit-source-id: 2947517e5b3f7a96e2c44eca55dcedfec9efdad8 --- fboss/agent/ApplyThriftConfig.cpp | 19 ++++++++++ .../agent/state/tests/SwitchSettingsTests.cpp | 15 -------- fboss/agent/state/tests/SystemPortTests.cpp | 35 ------------------- 3 files changed, 19 insertions(+), 50 deletions(-) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index 669323ccea874..c07a3076f2e15 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -3156,6 +3156,25 @@ std::shared_ptr ThriftConfigApplier::updateInterfaces() { auto origIntf = origIntfs->getInterfaceIf(id); shared_ptr newIntf; auto newAddrs = getInterfaceAddresses(&interfaceCfg); + if (interfaceCfg.type() == cfg::InterfaceType::SYSTEM_PORT) { + auto mySwitchId = cfg_->switchSettings()->switchId(); + CHECK(mySwitchId.has_value()); + auto myDsfNode = cfg_->dsfNodes()->find(*mySwitchId)->second; + auto sysPortRange = myDsfNode.systemPortRange(); + CHECK(sysPortRange.has_value()); + if (interfaceCfg.intfID() < sysPortRange->minimum() || + interfaceCfg.intfID() > sysPortRange->maximum()) { + throw FbossError( + "Interface intfID :", + *interfaceCfg.intfID(), + "is out of range for this VOQ switch intfID: ", + *mySwitchId, + "sys port range, min: ", + *sysPortRange->minimum(), + " max: ", + *sysPortRange->maximum()); + } + } if (origIntf) { newIntf = updateInterface(origIntf, &interfaceCfg, newAddrs); ++numExistingProcessed; diff --git a/fboss/agent/state/tests/SwitchSettingsTests.cpp b/fboss/agent/state/tests/SwitchSettingsTests.cpp index e6da751ec828b..8dcd5c225f62e 100644 --- a/fboss/agent/state/tests/SwitchSettingsTests.cpp +++ b/fboss/agent/state/tests/SwitchSettingsTests.cpp @@ -305,21 +305,6 @@ TEST(SwitchSettingsTest, applyVoqSwitch) { EXPECT_EQ(switchSettingsV1->getSwitchType(), cfg::SwitchType::VOQ); EXPECT_EQ(switchSettingsV1->getSwitchId(), 1); validateNodeSerialization(*switchSettingsV1); - - // Flip back to NPU switch type - *config.switchSettings()->switchType() = cfg::SwitchType::NPU; - config.switchSettings()->switchId().reset(); - EXPECT_FALSE(config.switchSettings()->switchId().has_value()); - - auto stateV2 = publishAndApplyConfig(stateV1, &config, platform.get()); - EXPECT_NE(nullptr, stateV2); - auto switchSettingsV2 = stateV2->getSwitchSettings(); - ASSERT_NE(nullptr, switchSettingsV2); - EXPECT_FALSE(switchSettingsV2->isPublished()); - EXPECT_EQ(switchSettingsV2->getSwitchType(), cfg::SwitchType::NPU); - EXPECT_FALSE(switchSettingsV2->getSwitchId().has_value()); - validateNodeSerialization(*switchSettingsV2); - EXPECT_EQ(nullptr, publishAndApplyConfig(stateV2, &config, platform.get())); } TEST(SwitchSettingsTest, applyExactMatchTableConfig) { diff --git a/fboss/agent/state/tests/SystemPortTests.cpp b/fboss/agent/state/tests/SystemPortTests.cpp index 34fe8bbf910d1..7fef6c778f0ce 100644 --- a/fboss/agent/state/tests/SystemPortTests.cpp +++ b/fboss/agent/state/tests/SystemPortTests.cpp @@ -98,41 +98,6 @@ TEST(SystemPort, sysPortApplyConfig) { EXPECT_EQ(stateV2->getSystemPorts()->size(), stateV2->getPorts()->size() - 1); } -TEST(SystemPort, sysPortApplyConfigSwitchTypeChange) { - auto platform = createMockPlatform(); - auto stateV0 = std::make_shared(); - auto config = testConfigA(cfg::SwitchType::VOQ); - auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); - ASSERT_NE(nullptr, stateV1); - EXPECT_EQ(stateV1->getSystemPorts()->size(), stateV1->getPorts()->size()); - config.switchSettings()->switchType() = cfg::SwitchType::NPU; - config.switchSettings()->switchId().reset(); - auto stateV2 = publishAndApplyConfig(stateV1, &config, platform.get()); - ASSERT_NE(nullptr, stateV2); - EXPECT_EQ(stateV2->getSystemPorts()->size(), 0); -} - -TEST(SystemPort, sysPortApplyConfigSwitchIdChange) { - auto platform = createMockPlatform(); - auto stateV0 = std::make_shared(); - auto config = testConfigA(cfg::SwitchType::VOQ); - auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); - ASSERT_NE(nullptr, stateV1); - EXPECT_EQ(stateV1->getSystemPorts()->size(), stateV1->getPorts()->size()); - auto prevSwitchId = *config.switchSettings()->switchId(); - config = updateSwitchID(config, prevSwitchId, 2); - - auto stateV2 = publishAndApplyConfig(stateV1, &config, platform.get()); - ASSERT_NE(nullptr, stateV2); - EXPECT_EQ( - stateV2->getSystemPorts()->size(), stateV1->getSystemPorts()->size()); - - for (const auto& idAndSysPort : std::as_const(*stateV2->getSystemPorts())) { - const auto& sysPort = idAndSysPort.second; - EXPECT_EQ(sysPort->getSwitchId(), SwitchID(2)); - } -} - TEST(SystemPort, sysPortNameApplyConfig) { auto platform = createMockPlatform(); auto stateV0 = std::make_shared(); From 1bbb6b6a7563174dc70e9fc14fbb72952c9935a5 Mon Sep 17 00:00:00 2001 From: Rajan Kumar Date: Mon, 6 Feb 2023 22:27:37 -0800 Subject: [PATCH 171/280] Removed strick check for channels in getChannelFlags() Summary: We see from the log file that the CMIS optics goes for remediation where the application code is being programmed. For some time the optics returns all garbled data causing even the EEPROM checksum to fail. The random data returned by the optics causes its current application to be identified as wrong value and it starts referring to wrong channel id which causes the crash. When optics is in stable state then all its register values are correct but only during initialization time, its value are random. In this diff we hav removed the strict check for the channel id in getChannelFlag and printing the error so that we will come to know what is causing this issue in future. This issue is rare to happen. Reviewed By: harshitgulati18 Differential Revision: D43034243 fbshipit-source-id: 992d0174bca4f8ef51cc596938645ffa7a9e8ed7 --- fboss/qsfp_service/module/cmis/CmisModule.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fboss/qsfp_service/module/cmis/CmisModule.cpp b/fboss/qsfp_service/module/cmis/CmisModule.cpp index dda54500d7abd..8f8f95f570a6c 100644 --- a/fboss/qsfp_service/module/cmis/CmisModule.cpp +++ b/fboss/qsfp_service/module/cmis/CmisModule.cpp @@ -927,7 +927,11 @@ FlagLevels CmisModule::getChannelFlags(CmisField field, int channel) { int dataAddress; CHECK_GE(channel, 0); - CHECK_LE(channel, 8); + if (channel > 8) { + QSFP_LOG(ERR, this) << folly::sformat( + "getChannelFlags: Channel id {:d} is invalid", channel); + return FlagLevels{}; + } getQsfpFieldAddress(field, dataAddress, offset, length); const uint8_t* data = getQsfpValuePtr(dataAddress, offset, length); From 2baa5ef69c6975472d456f20ccafc70daaa7a000 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Mon, 6 Feb 2023 22:53:37 -0800 Subject: [PATCH 172/280] Add interface modify API + UTs Summary: As titled Reviewed By: shri-khare Differential Revision: D43068452 Privacy Context Container: L1125642 fbshipit-source-id: d48c44db19d77d4e1822ee582a3ff3e74cdfc580 --- fboss/agent/state/Interface.cpp | 13 +++++++++++++ fboss/agent/state/Interface.h | 1 + fboss/agent/state/InterfaceMap.cpp | 5 +++++ fboss/agent/state/InterfaceMap.h | 1 + fboss/agent/state/tests/InterfaceTests.cpp | 19 +++++++++++++++++++ 5 files changed, 39 insertions(+) diff --git a/fboss/agent/state/Interface.cpp b/fboss/agent/state/Interface.cpp index 4e83cd5d757c9..f96a55f1a5127 100644 --- a/fboss/agent/state/Interface.cpp +++ b/fboss/agent/state/Interface.cpp @@ -194,6 +194,19 @@ bool Interface::isIpAttached( return intf->canReachAddress(ip); } +Interface* Interface::modify(std::shared_ptr* state) { + if (!isPublished()) { + CHECK(!(*state)->isPublished()); + return this; + } + + InterfaceMap* interfaces = (*state)->getInterfaces()->modify(state); + auto newInterface = clone(); + auto* ptr = newInterface.get(); + interfaces->updateInterface(std::move(newInterface)); + return ptr; +} + template class ThriftStructNode; } // namespace facebook::fboss diff --git a/fboss/agent/state/Interface.h b/fboss/agent/state/Interface.h index b629634a2ff28..0e243ad2419ea 100644 --- a/fboss/agent/state/Interface.h +++ b/fboss/agent/state/Interface.h @@ -165,6 +165,7 @@ class Interface : public ThriftStructNode { return getType() == cfg::InterfaceType::VLAN ? getVlanID() : VlanID(0); } + Interface* modify(std::shared_ptr* state); int getMtu() const { return get()->cref(); } diff --git a/fboss/agent/state/InterfaceMap.cpp b/fboss/agent/state/InterfaceMap.cpp index c6d58ccc9e453..d66f1411948f9 100644 --- a/fboss/agent/state/InterfaceMap.cpp +++ b/fboss/agent/state/InterfaceMap.cpp @@ -83,6 +83,11 @@ void InterfaceMap::addInterface(const std::shared_ptr& interface) { addNode(interface); } +void InterfaceMap::updateInterface( + const std::shared_ptr& interface) { + updateNode(interface); +} + InterfaceMap* InterfaceMap::modify(std::shared_ptr* state) { if (!isPublished()) { CHECK(!(*state)->isPublished()); diff --git a/fboss/agent/state/InterfaceMap.h b/fboss/agent/state/InterfaceMap.h index 340074d2c7020..b6a396bad77db 100644 --- a/fboss/agent/state/InterfaceMap.h +++ b/fboss/agent/state/InterfaceMap.h @@ -106,6 +106,7 @@ class InterfaceMap : public ThriftMapNode { */ void addInterface(const std::shared_ptr& interface); + void updateInterface(const std::shared_ptr& interface); /* * Serialize to a folly::dynamic object diff --git a/fboss/agent/state/tests/InterfaceTests.cpp b/fboss/agent/state/tests/InterfaceTests.cpp index 5dc8b72b2f0c6..541def2b8efca 100644 --- a/fboss/agent/state/tests/InterfaceTests.cpp +++ b/fboss/agent/state/tests/InterfaceTests.cpp @@ -745,3 +745,22 @@ TEST(Interface, verifyPseudoVlanProcessing) { auto stateV4 = publishAndApplyConfig(stateV1, &config3, platform.get()); verifyConfigPseudoVlansMatch(config3, stateV4); } + +TEST(Interface, modify) { + auto platform = createMockPlatform(); + auto stateV0 = std::make_shared(); + auto config = testConfigA(); + auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); + ASSERT_NE(nullptr, stateV1); + auto intf = stateV1->getInterfaces()->begin()->second; + auto intfModified = intf->modify(&stateV1); + EXPECT_EQ(intf.get(), intfModified); + intf->publish(); + intfModified = intf->modify(&stateV1); + EXPECT_NE(intf.get(), intfModified); + auto oldMtu = intfModified->getMtu(); + auto newMtu = oldMtu + 1000; + intfModified->setMtu(newMtu); + EXPECT_EQ( + stateV1->getInterfaces()->getInterface(intf->getID())->getMtu(), newMtu); +} From c3b0b2669c9a4c4b48e7968238c3ae45a35adb31 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Mon, 6 Feb 2023 22:53:37 -0800 Subject: [PATCH 173/280] Neighbor table modify on Interface Summary: As titled Reviewed By: shri-khare Differential Revision: D43070382 Privacy Context Container: L1125642 fbshipit-source-id: f064b81ece5dffa320cf5ad191d03ed38e3397cf --- fboss/agent/state/NeighborTable-defs.h | 33 ++++++++++++++++++++++++++ fboss/agent/state/NeighborTable.h | 8 ++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/fboss/agent/state/NeighborTable-defs.h b/fboss/agent/state/NeighborTable-defs.h index c3e3f974a7d2a..6cf7c9f38d1c3 100644 --- a/fboss/agent/state/NeighborTable-defs.h +++ b/fboss/agent/state/NeighborTable-defs.h @@ -58,6 +58,39 @@ SUBCLASS* NeighborTable::modify( return newTablePtr; } +template +SUBCLASS* NeighborTable::modify( + Interface** interface, + std::shared_ptr* state) { + if (!this->isPublished()) { + CHECK(!(*state)->isPublished()); + return boost::polymorphic_downcast(this); + } + + *interface = (*interface)->modify(state); + auto newTable = this->clone(); + (*interface)->setNeighborEntryTable(newTable->toThrift()); + return (*interface)->getNeighborEntryTable().get(); +} + +template +SUBCLASS* NeighborTable::modify( + InterfaceID interfaceId, + std::shared_ptr* state) { + if (!this->isPublished()) { + CHECK(!(*state)->isPublished()); + return boost::polymorphic_downcast(this); + } + // Make clone of table + auto newTable = this->clone(); + // Make clone of interface + auto interfacePtr = + (*state)->getInterfaces()->getInterface(interfaceId).get(); + interfacePtr = interfacePtr->modify(state); + interfacePtr->setNeighborEntryTable(newTable->toThrift()); + return interfacePtr->getNeighborEntryTable().get(); +} + template void NeighborTable::addEntry( AddressType ip, diff --git a/fboss/agent/state/NeighborTable.h b/fboss/agent/state/NeighborTable.h index a94e22ac7194f..34740f3286121 100644 --- a/fboss/agent/state/NeighborTable.h +++ b/fboss/agent/state/NeighborTable.h @@ -21,6 +21,7 @@ namespace facebook::fboss { class SwitchState; class Vlan; +class Interface; template struct NeighborTableTraits { @@ -94,15 +95,16 @@ class NeighborTable std::shared_ptr getEntryIf(AddressType ip) const { return this->getNodeIf(ip.str()); } - - SUBCLASS* modify(Vlan** vlan, std::shared_ptr* state); - /** * Return a modifiable version of current table. If the table is cloned, all * nodes to the root are cloned, and cloned state is put in the output * parameter. */ + + SUBCLASS* modify(Vlan** vlan, std::shared_ptr* state); SUBCLASS* modify(VlanID vlanId, std::shared_ptr* state); + SUBCLASS* modify(Interface** intf, std::shared_ptr* state); + SUBCLASS* modify(InterfaceID intfId, std::shared_ptr* state); void addEntry( AddressType ip, From c77fd9f4addf81a9b816d7689fb68baa5b4fdda0 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Mon, 6 Feb 2023 22:53:37 -0800 Subject: [PATCH 174/280] Towards getting neighbor tests working on voq switches Summary: - Abstract out kVlanID, kIntfID apis to pull the right values - Abstract out a getNeighborTable helper to pull neighbor table. For VOQ switches (and soon for all switches) neighbor table will be on interface object Reviewed By: shri-khare Differential Revision: D43070406 fbshipit-source-id: fc6cdbe6b650a983bffcafa24f0a9cff04d84a7b --- fboss/agent/hw/test/HwNeighborTests.cpp | 60 +++++++++++++++---------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/fboss/agent/hw/test/HwNeighborTests.cpp b/fboss/agent/hw/test/HwNeighborTests.cpp index 554e9cdac3d75..7115096bab93d 100644 --- a/fboss/agent/hw/test/HwNeighborTests.cpp +++ b/fboss/agent/hw/test/HwNeighborTests.cpp @@ -8,6 +8,7 @@ #include "fboss/agent/hw/test/HwLinkStateDependentTest.h" #include "fboss/agent/hw/test/HwTest.h" #include "fboss/agent/hw/test/HwTestNeighborUtils.h" +#include "fboss/agent/hw/test/HwTestPacketUtils.h" #include "fboss/agent/test/TrunkUtils.h" using namespace ::testing; @@ -83,22 +84,46 @@ class HwNeighborTest : public HwLinkStateDependentTest { } return cfg; } + VlanID kVlanID() const { + if (getProgrammedState()->getSwitchSettings()->getSwitchType() == + cfg::SwitchType::NPU) { + auto vlanId = utility::firstVlanID(getProgrammedState()); + CHECK(vlanId.has_value()); + return *vlanId; + } + XLOG(FATAL) << " No vlans on non-npu switches"; + } + InterfaceID kIntfID() const { + if (getProgrammedState()->getSwitchSettings()->getSwitchType() == + cfg::SwitchType::NPU) { + return InterfaceID(static_cast(kVlanID())); + } + XLOG(FATAL) << "TODO: VOQ switch support"; + } PortDescriptor portDescriptor() { - if (programToTrunk) + if (programToTrunk) { return PortDescriptor(kAggID); + } return PortDescriptor(masterLogicalPortIds()[0]); } + auto getNeighborTable(std::shared_ptr state) { + if (state->getSwitchSettings()->getSwitchType() == cfg::SwitchType::NPU) { + return state->getVlans() + ->getVlan(kVlanID()) + ->template getNeighborTable() + ->modify(kVlanID(), &state); + } + XLOG(FATAL) << "TODO: VOQ switch support"; + } std::shared_ptr addNeighbor( const std::shared_ptr& inState) { auto ip = NeighborT::getNeighborAddress(); auto outState{inState->clone()}; - auto neighborTable = outState->getVlans() - ->getVlan(kVlanID) - ->template getNeighborTable() - ->modify(kVlanID, &outState); - neighborTable->addPendingEntry(ip, kIntfID); + + auto neighborTable = getNeighborTable(outState); + neighborTable->addPendingEntry(ip, kIntfID()); return outState; } @@ -107,11 +132,7 @@ class HwNeighborTest : public HwLinkStateDependentTest { auto ip = NeighborT::getNeighborAddress(); auto outState{inState->clone()}; - auto neighborTable = outState->getVlans() - ->getVlan(kVlanID) - ->template getNeighborTable() - ->modify(kVlanID, &outState); - + auto neighborTable = getNeighborTable(outState); neighborTable->removeEntry(ip); return outState; } @@ -121,17 +142,13 @@ class HwNeighborTest : public HwLinkStateDependentTest { std::optional lookupClass = std::nullopt) { auto ip = NeighborT::getNeighborAddress(); auto outState{inState->clone()}; - auto neighborTable = outState->getVlans() - ->getVlan(kVlanID) - ->template getNeighborTable() - ->modify(kVlanID, &outState); - + auto neighborTable = getNeighborTable(outState); auto lookupClassValue = lookupClass ? lookupClass.value() : kLookupClass; neighborTable->updateEntry( ip, kNeighborMac, portDescriptor(), - kIntfID, + kIntfID(), NeighborState::REACHABLE, lookupClassValue); return outState; @@ -149,13 +166,13 @@ class HwNeighborTest : public HwLinkStateDependentTest { * Resolved entry should have a classID associated with it. */ auto gotClassid = utility::getNbrClassId( - this->getHwSwitch(), kIntfID, NeighborT::getNeighborAddress()); + this->getHwSwitch(), kIntfID(), NeighborT::getNeighborAddress()); EXPECT_TRUE(programToTrunk || classID == gotClassid.value()); } bool nbrExists() const { return utility::nbrExists( - this->getHwSwitch(), this->kIntfID, this->getNeighborAddress()); + this->getHwSwitch(), this->kIntfID(), this->getNeighborAddress()); } folly::IPAddress getNeighborAddress() const { return NeighborT::getNeighborAddress(); @@ -163,12 +180,9 @@ class HwNeighborTest : public HwLinkStateDependentTest { bool isProgrammedToCPU() const { return utility::nbrProgrammedToCpu( - this->getHwSwitch(), kIntfID, this->getNeighborAddress()); + this->getHwSwitch(), kIntfID(), this->getNeighborAddress()); } - const VlanID kVlanID{utility::kBaseVlanId}; - const InterfaceID kIntfID{utility::kBaseVlanId}; - const folly::MacAddress kNeighborMac{"2:3:4:5:6:7"}; const cfg::AclLookupClass kLookupClass{ cfg::AclLookupClass::CLASS_QUEUE_PER_HOST_QUEUE_2}; From 98bb1f08d9301d1a7d9fd046cf1ea0a25e2a2b58 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Mon, 6 Feb 2023 23:57:36 -0800 Subject: [PATCH 175/280] Added FEC Alignment marker status to PhyInfo Summary: as titled. Certain PHYs (Ebro Asic) support reading this status. Useful for triaging link issues. Reviewed By: jasmeetbagga Differential Revision: D43015973 Privacy Context Container: L1125642 fbshipit-source-id: 0e14c1cf5ebde8888580ee51e4320eb79b70d99d --- fboss/lib/phy/phy.thrift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fboss/lib/phy/phy.thrift b/fboss/lib/phy/phy.thrift index 5b30733e4fb4e..c3397fb30688d 100644 --- a/fboss/lib/phy/phy.thrift +++ b/fboss/lib/phy/phy.thrift @@ -362,6 +362,17 @@ struct PcsInfo { struct PcsState { 1: optional bool pcsRxStatusLive; 2: optional bool pcsRxStatusLatched; + 3: optional RsFecState rsFecState; +} + +struct RsFecState { + 1: map lanes; +} + +struct RsFecLaneState { + 1: i16 lane; + 2: optional bool fecAlignmentLockLive; + 3: optional bool fecAlignmentLockChanged; } struct PcsStats { From 0dfaf3241478654682fdd52aac29d79b991ced04 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Mon, 6 Feb 2023 23:57:36 -0800 Subject: [PATCH 176/280] Added functions to read PCS and FEC State in SaiPortManager Summary: as titled. Reading the SAI attributes for PCS and FEC state in SaiPortManager. This will be called from updateIPhyInfo in next diff which periodically reads other PHY diagnostics. Reviewed By: rajank7 Differential Revision: D43015970 Privacy Context Container: L1125642 fbshipit-source-id: 169db0448aa014c5b4c7f35ac5c97ef55ddb0e06 --- fboss/agent/hw/sai/switch/SaiPortManager.cpp | 24 ++++++++++++++++++++ fboss/agent/hw/sai/switch/SaiPortManager.h | 5 ++++ 2 files changed, 29 insertions(+) diff --git a/fboss/agent/hw/sai/switch/SaiPortManager.cpp b/fboss/agent/hw/sai/switch/SaiPortManager.cpp index 5230cdd426408..7b8b5cb9c811b 100644 --- a/fboss/agent/hw/sai/switch/SaiPortManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiPortManager.cpp @@ -1808,6 +1808,30 @@ std::vector SaiPortManager::getRxLockStatus( SaiPortTraits::Attributes::RxLockStatus{ std::vector(numPmdLanes)}); } + +std::vector +SaiPortManager::getFecAlignmentLockStatus( + PortSaiId saiPortId, + uint8_t numFecLanes) const { + if (!platform_->getAsic()->isSupported(HwAsic::Feature::FEC_AM_LOCK_STATUS)) { + return std::vector(); + } + + return SaiApiTable::getInstance()->portApi().getAttribute( + saiPortId, + SaiPortTraits::Attributes::FecAlignmentLock{ + std::vector(numFecLanes)}); +} + +std::optional SaiPortManager::getPcsRxLinkStatus( + PortSaiId saiPortId) const { + if (!platform_->getAsic()->isSupported(HwAsic::Feature::PCS_RX_LINK_STATUS)) { + return std::nullopt; + } + + return SaiApiTable::getInstance()->portApi().getAttribute( + saiPortId, SaiPortTraits::Attributes::PcsRxLinkStatus{}); +} #endif std::vector SaiPortManager::getPortErrStatus( diff --git a/fboss/agent/hw/sai/switch/SaiPortManager.h b/fboss/agent/hw/sai/switch/SaiPortManager.h index 81f9eec0c730c..0b9a0a1c2a9e2 100644 --- a/fboss/agent/hw/sai/switch/SaiPortManager.h +++ b/fboss/agent/hw/sai/switch/SaiPortManager.h @@ -193,6 +193,11 @@ class SaiPortManager { std::vector getRxLockStatus( PortSaiId saiPortId, uint8_t numPmdLanes) const; + std::vector getFecAlignmentLockStatus( + PortSaiId saiPortId, + uint8_t numFecLanes) const; + std::optional getPcsRxLinkStatus( + PortSaiId saiPortId) const; #endif void enableAfeAdaptiveMode(PortID portId); From 93afbd9b770b7d7f9b1dc544cc2035bc45600689 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Tue, 7 Feb 2023 02:14:23 -0800 Subject: [PATCH 177/280] Clone udpPorts from tcp ports array, they are the same Summary: As titled Reviewed By: nivinl Differential Revision: D43075398 fbshipit-source-id: b61980ee89d2104090cb28b7d75ac378a747116c --- .../agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp index d3a1700d8de82..e044ef10b5a16 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp @@ -54,11 +54,7 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { tcpPortsForSai_[1] = 10000; tcpPortsForSai_[2] = 10002; tcpPortsForSai_[3] = 10001; - - udpPortsForSai_[0] = 10003; - udpPortsForSai_[1] = 10000; - udpPortsForSai_[2] = 10002; - udpPortsForSai_[3] = 10001; + udpPortsForSai_ = tcpPortsForSai_; } } From 5d6a5b1878c4eec90bb16459513518f51849985c Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Tue, 7 Feb 2023 03:13:31 -0800 Subject: [PATCH 178/280] Use tcvrState and tcvrStats in wedge_qsfp_util Reviewed By: rajank7 Differential Revision: D43050185 Privacy Context Container: L1125642 fbshipit-source-id: a96938f804c2d86fef4a3d57a436b694a786f221 --- fboss/util/wedge_qsfp_util.cpp | 68 ++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/fboss/util/wedge_qsfp_util.cpp b/fboss/util/wedge_qsfp_util.cpp index 4b8e22847c274..7a7f0a3dbd2e8 100644 --- a/fboss/util/wedge_qsfp_util.cpp +++ b/fboss/util/wedge_qsfp_util.cpp @@ -1041,7 +1041,7 @@ std::map fetchDataFromQsfpService( std::vector presentPorts; for (auto& qsfpInfo : qsfpInfoMap) { - if (*qsfpInfo.second.present()) { + if (*can_throw(qsfpInfo.second.tcvrState())->present()) { presentPorts.push_back(qsfpInfo.first); } } @@ -1580,25 +1580,28 @@ void printThresholds(const AlarmThreshold& thresholds) { void printManagementInterface( const TransceiverInfo& transceiverInfo, const char* fmt) { - if (auto mgmtInterface = transceiverInfo.transceiverManagementInterface()) { + const TcvrState& tcvrState = *can_throw(transceiverInfo.tcvrState()); + if (auto mgmtInterface = tcvrState.transceiverManagementInterface()) { printf(fmt, apache::thrift::util::enumNameSafe(*mgmtInterface).c_str()); } } void printVerboseInfo(const TransceiverInfo& transceiverInfo) { - auto globalSensors = transceiverInfo.sensor(); + const TcvrState& tcvrState = *can_throw(transceiverInfo.tcvrState()); + const TcvrStats& tcvrStats = *can_throw(transceiverInfo.tcvrStats()); + auto globalSensors = tcvrStats.sensor(); if (globalSensors) { printGlobalInterruptFlags(*globalSensors); } - printChannelInterruptFlags(*(transceiverInfo.channels())); - if (auto thresholds = transceiverInfo.thresholds()) { + printChannelInterruptFlags(*(tcvrStats.channels())); + if (auto thresholds = tcvrState.thresholds()) { printThresholds(*thresholds); } } void printVendorInfo(const TransceiverInfo& transceiverInfo) { - if (auto vendor = transceiverInfo.vendor()) { + if (auto vendor = can_throw(transceiverInfo.tcvrState())->vendor()) { auto vendorInfo = *vendor; printf(" Vendor Info:\n"); auto name = *(vendorInfo.name()); @@ -1646,24 +1649,26 @@ void printCableInfo(const Cable& cable) { } void printDomMonitors(const TransceiverInfo& transceiverInfo) { - auto globalSensors = transceiverInfo.sensor(); - printLaneDomMonitors(*(transceiverInfo.channels())); + const TcvrStats& tcvrStats = *can_throw(transceiverInfo.tcvrStats()); + auto globalSensors = tcvrStats.sensor(); + printLaneDomMonitors(*(tcvrStats.channels())); if (globalSensors) { printGlobalDomMonitors(*globalSensors); } } void printSignalsAndSettings(const TransceiverInfo& transceiverInfo) { - auto settings = *(transceiverInfo.settings()); + const TcvrState& tcvrState = *can_throw(transceiverInfo.tcvrState()); + auto settings = *(tcvrState.settings()); // TODO(ccpowers): This is to support tx signals in both hostSignals (new) // and mediaSignals(deprecated). Once more of the fleet has the new flags, // we should remove support for the tx flags in mediaLaneSignals auto hasNewTxFlags = false; - if (auto hostSignals = transceiverInfo.hostLaneSignals()) { + if (auto hostSignals = tcvrState.hostLaneSignals()) { printHostLaneSignals(*hostSignals); hasNewTxFlags = hostSignals->size() > 0 && hostSignals->begin()->txLos(); } - if (auto mediaSignals = transceiverInfo.mediaLaneSignals()) { + if (auto mediaSignals = tcvrState.mediaLaneSignals()) { printMediaLaneSignals(*mediaSignals, !hasNewTxFlags); } if (auto hostSettings = settings.hostLaneSettings()) { @@ -1678,18 +1683,19 @@ void printSff8472DetailService( const TransceiverInfo& transceiverInfo, unsigned int port, bool /* verbose */) { - auto settings = *(transceiverInfo.settings()); + const TcvrState& tcvrState = *can_throw(transceiverInfo.tcvrState()); + auto settings = *(tcvrState.settings()); printf("Port %d\n", port); // ------ Module Status ------- printf(" Module Status:\n"); - if (auto identifier = transceiverInfo.identifier()) { + if (auto identifier = tcvrState.identifier()) { printf( " Transceiver Identifier: %s\n", apache::thrift::util::enumNameSafe(*identifier).c_str()); } - if (auto stateMachineState = transceiverInfo.stateMachineState()) { + if (auto stateMachineState = tcvrState.stateMachineState()) { printf( " StateMachine State: %s\n", apache::thrift::util::enumNameSafe(*stateMachineState).c_str()); @@ -1722,27 +1728,29 @@ void printSffDetailService( const TransceiverInfo& transceiverInfo, unsigned int port, bool verbose) { - auto settings = *(transceiverInfo.settings()); + const TcvrState& tcvrState = *can_throw(transceiverInfo.tcvrState()); + + auto& settings = *(tcvrState.settings()); printf("Port %d\n", port); // ------ Module Status ------- printf(" Module Status:\n"); - if (auto identifier = transceiverInfo.identifier()) { + if (auto identifier = tcvrState.identifier()) { printf( " Transceiver Identifier: %s\n", apache::thrift::util::enumNameSafe(*identifier).c_str()); } - if (auto status = transceiverInfo.status()) { + if (auto status = tcvrState.status()) { printf(" InterruptL: 0x%02x\n", *(status->interruptL())); printf(" Data_Not_Ready: 0x%02x\n", *(status->dataNotReady())); } - if (auto ext = transceiverInfo.extendedSpecificationComplianceCode()) { + if (auto ext = tcvrState.extendedSpecificationComplianceCode()) { printf( " Extended Specification Compliance Code: %s\n", apache::thrift::util::enumNameSafe(*(ext)).c_str()); } - if (auto stateMachineState = transceiverInfo.stateMachineState()) { + if (auto stateMachineState = tcvrState.stateMachineState()) { printf( " StateMachine State: %s\n", apache::thrift::util::enumNameSafe(*stateMachineState).c_str()); @@ -1759,13 +1767,13 @@ void printSffDetailService( printVendorInfo(transceiverInfo); - if (auto cable = transceiverInfo.cable()) { + if (auto cable = tcvrState.cable()) { printCableInfo(*cable); } - if (transceiverInfo.eepromCsumValid().has_value()) { + if (tcvrState.eepromCsumValid().has_value()) { printf( " EEPROM Checksum: %s\n", - *transceiverInfo.eepromCsumValid() ? "Valid" : "Invalid"); + *tcvrState.eepromCsumValid() ? "Valid" : "Invalid"); } printf(" Module Control:\n"); printf( @@ -2015,10 +2023,13 @@ void printCmisDetailService( const TransceiverInfo& transceiverInfo, unsigned int port, bool verbose) { - auto moduleStatus = transceiverInfo.status(); - auto channels = *(transceiverInfo.channels()); + const TcvrState& tcvrState = *can_throw(transceiverInfo.tcvrState()); + const TcvrStats& tcvrStats = *can_throw(transceiverInfo.tcvrStats()); + + auto moduleStatus = tcvrState.status(); + auto channels = *(tcvrStats.channels()); printf("Port %d\n", port); - auto settings = *(transceiverInfo.settings()); + auto settings = *(tcvrState.settings()); printManagementInterface( transceiverInfo, " Transceiver Management Interface: %s\n"); @@ -2029,7 +2040,7 @@ void printCmisDetailService( apache::thrift::util::enumNameSafe(*(moduleStatus->cmisModuleState())) .c_str()); } - if (auto stateMachineState = transceiverInfo.stateMachineState()) { + if (auto stateMachineState = tcvrState.stateMachineState()) { printf( " StateMachine State: %s\n", apache::thrift::util::enumNameSafe(*stateMachineState).c_str()); @@ -2058,7 +2069,7 @@ void printCmisDetailService( if (verbose) { printVerboseInfo(transceiverInfo); } - if (transceiverInfo.eepromCsumValid().has_value()) { + if (tcvrState.eepromCsumValid().has_value()) { printf( " EEPROM Checksum: %s\n", *transceiverInfo.eepromCsumValid() ? "Valid" : "Invalid"); @@ -2286,7 +2297,8 @@ void printPortDetailService( const TransceiverInfo& transceiverInfo, unsigned int port, bool verbose) { - if (auto mgmtInterface = transceiverInfo.transceiverManagementInterface()) { + if (auto mgmtInterface = can_throw(transceiverInfo.tcvrState()) + ->transceiverManagementInterface()) { if (*mgmtInterface == TransceiverManagementInterface::SFF) { printSffDetailService(transceiverInfo, port, verbose); } else if (*mgmtInterface == TransceiverManagementInterface::SFF8472) { From 039220c32278b60e68aad540e8da934958088b81 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 7 Feb 2023 06:14:49 -0800 Subject: [PATCH 179/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fb303/commit/696fd2cf542524abdf82d69d985bfaf3ae6ac57d https://github.com/facebook/litho/commit/8ce83d944c340c5ddebd5f7f94401231003655c5 https://github.com/facebook/wangle/commit/9b9ff0db1d1f90e6950f04da7c855121282a4a9f https://github.com/facebookincubator/fizz/commit/24c4b2d055d190ffa619c88e9b1054f093e8cc13 Reviewed By: yns88 fbshipit-source-id: a888f7e3ee7fbb368c08b08721c0f2039a295b8c --- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index b1809502c765d..77d65d5760056 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 972446ed10b0f0925ce0e96968f41a4ab8d4417b +Subproject commit 9b9ff0db1d1f90e6950f04da7c855121282a4a9f From 05e3a07d6ed55e64771f7f8214e37c512f7a0e84 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 7 Feb 2023 07:04:53 -0800 Subject: [PATCH 180/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/749e4e556910605f27af4a404cdf3c3f7280eafc https://github.com/facebookincubator/mvfst/commit/c397e59ca267e44335448baddfb2f35709ce35e2 https://github.com/facebookincubator/sks/commit/2c151bccb0f6ec1db62da04d9eacd8fcd5ebd6d9 Reviewed By: yns88 fbshipit-source-id: 002a2061c862de22cab389959563d0ef09a4fe34 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 9ea393b87c493..c99548aa07354 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit f5641439382254134d192ca8fe3c9af23f87b5fa +Subproject commit 749e4e556910605f27af4a404cdf3c3f7280eafc From a2cea0e09d98b44b9e20de7975ff186830a37e82 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Tue, 7 Feb 2023 08:11:19 -0800 Subject: [PATCH 181/280] Use array instead of map where size is known at compile time Summary: As titled Differential Revision: D43075742 fbshipit-source-id: f7b1e884207df466761797b08d62bdab08b7396a --- .../dataplane_tests/HwHashConsistencyTest.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp index e044ef10b5a16..e5f2e84a0761f 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp @@ -92,11 +92,9 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { uint16_t getFlowPort(int index, bool isSai, FlowType type) const { switch (type) { case FlowType::TCP: - return isSai ? tcpPortsForSai_.find(index)->second - : tcpPorts_.find(index)->second; + return isSai ? tcpPortsForSai_[index] : tcpPorts_[index]; case FlowType::UDP: - return isSai ? udpPortsForSai_.find(index)->second - : udpPorts_.find(index)->second; + return isSai ? udpPortsForSai_[index] : udpPorts_[index]; } } uint16_t getFlowPort(int index, FlowType type) const { @@ -204,11 +202,11 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { protected: std::unique_ptr ecmpHelper_; - std::array ports_{}; - std::map tcpPorts_{}; - std::map udpPorts_{}; - std::map tcpPortsForSai_{}; - std::map udpPortsForSai_{}; + std::array ports_{}; + std::array tcpPorts_{}; + std::array udpPorts_{}; + std::array tcpPortsForSai_{}; + std::array udpPortsForSai_{}; }; TEST_F(HwHashConsistencyTest, TcpEgressLinks) { From 1b45bd6c901d7e55d8be96b90135d297154b33f3 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Tue, 7 Feb 2023 09:03:34 -0800 Subject: [PATCH 182/280] Allow specifying both src and dst ports in HwHashConsistencyTests Summary: For Makalu we need to have src port != dst port for selecting different links on a ecmp group Reviewed By: nivinl Differential Revision: D43075841 fbshipit-source-id: 0555ea5066b28fb2abf4191841d60c2f1d35a23d --- .../dataplane_tests/HwHashConsistencyTest.cpp | 67 ++++++++++--------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp index e5f2e84a0761f..186815fe804bc 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp @@ -31,29 +31,29 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { } /* experiments revealed these which L4 ports map to which switch port */ - tcpPorts_[0] = 10001; - tcpPorts_[1] = 10005; - tcpPorts_[2] = 10007; - tcpPorts_[3] = 10000; + tcpPorts_[0] = {10001, 10001}; + tcpPorts_[1] = {10005, 10005}; + tcpPorts_[2] = {10007, 10007}; + tcpPorts_[3] = {10000, 10000}; udpPorts_ = tcpPorts_; if (getPlatform()->getAsic()->getAsicType() == cfg::AsicType::ASIC_TYPE_EBRO) { - tcpPortsForSai_[0] = 10002; - tcpPortsForSai_[1] = 10004; - tcpPortsForSai_[2] = 10000; - tcpPortsForSai_[3] = 10001; + tcpPortsForSai_[0] = {10002, 10002}; + tcpPortsForSai_[1] = {10004, 10004}; + tcpPortsForSai_[2] = {10000, 10000}; + tcpPortsForSai_[3] = {10001, 10001}; - udpPortsForSai_[0] = 10000; - udpPortsForSai_[1] = 10006; - udpPortsForSai_[2] = 10002; - udpPortsForSai_[3] = 10003; + udpPortsForSai_[0] = {10000, 10000}; + udpPortsForSai_[1] = {10006, 10006}; + udpPortsForSai_[2] = {10002, 10002}; + udpPortsForSai_[3] = {10003, 10003}; } else { - tcpPortsForSai_[0] = 10003; - tcpPortsForSai_[1] = 10000; - tcpPortsForSai_[2] = 10002; - tcpPortsForSai_[3] = 10001; + tcpPortsForSai_[0] = {10003, 10003}; + tcpPortsForSai_[1] = {10000, 10000}; + tcpPortsForSai_[2] = {10002, 10002}; + tcpPortsForSai_[3] = {10001, 10001}; udpPortsForSai_ = tcpPortsForSai_; } } @@ -89,7 +89,8 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { resolve ? resolveNhops({ports_[index]}) : unresolveNhops({ports_[index]}); } - uint16_t getFlowPort(int index, bool isSai, FlowType type) const { + std::pair + getFlowPort(int index, bool isSai, FlowType type) const { switch (type) { case FlowType::TCP: return isSai ? tcpPortsForSai_[index] : tcpPorts_[index]; @@ -97,12 +98,12 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { return isSai ? udpPortsForSai_[index] : udpPorts_[index]; } } - uint16_t getFlowPort(int index, FlowType type) const { + std::pair getFlowPort(int index, FlowType type) const { auto isSai = getHwSwitchEnsemble()->isSai(); return getFlowPort(index, isSai, type); } - void sendFlowWithPort(uint16_t port, FlowType type) { + void sendFlowWithPort(uint16_t l4SrcPort, uint16_t l4DstPort, FlowType type) { auto vlanId = utility::firstVlanID(initialConfig()); auto dstMac = utility::getFirstInterfaceMac(getProgrammedState()); @@ -113,8 +114,8 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { dstMac, folly::IPAddressV6("2401:db00:11c:8202:0:0:0:100"), folly::IPAddressV6("2401:db00:11c:8200:0:0:0:104"), - port, - port); + l4SrcPort, + l4DstPort); auto udpPkt = utility::makeUDPTxPacket( getHwSwitch(), vlanId, @@ -122,8 +123,8 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { dstMac, folly::IPAddressV6("2401:db00:11c:8202:0:0:0:100"), folly::IPAddressV6("2401:db00:11c:8200:0:0:0:104"), - port, - port); + l4SrcPort, + l4DstPort); switch (type) { case FlowType::TCP: @@ -135,19 +136,23 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { } } void sendFlow(int index, FlowType type) { - auto port = getFlowPort(index, type); - sendFlowWithPort(port, type); + auto srcAndDstPort = getFlowPort(index, type); + sendFlowWithPort(srcAndDstPort.first, srcAndDstPort.second, type); } void verifyFlowEgress(int index, FlowType flowType) { - XLOG(DBG2) << " For flow port: " << getFlowPort(index, flowType) + auto srcAndDstPort = getFlowPort(index, flowType); + XLOG(DBG2) << " For flow ports: (" << srcAndDstPort.first << ", " + << srcAndDstPort.second << ")" << " expecting increment of 1 on port at index: " << index; WITH_RETRIES({ EXPECT_EVENTUALLY_EQ( getPortOutPkts(this->getLatestPortStats(ports_[index])), 1); auto pktCnt = 0; for (auto i = 0; i < kEcmpWidth4; i++) { + srcAndDstPort = getFlowPort(index, flowType); auto pkts = getPortOutPkts(this->getLatestPortStats(ports_[i])); - XLOG(DBG2) << " For flow port: " << getFlowPort(index, flowType) + XLOG(DBG2) << " For flow ports: (" << srcAndDstPort.first << ", " + << srcAndDstPort.second << ")" << " pkt egress increment on port at index: " << i << " is: " << pkts; pktCnt += pkts; @@ -203,10 +208,10 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { protected: std::unique_ptr ecmpHelper_; std::array ports_{}; - std::array tcpPorts_{}; - std::array udpPorts_{}; - std::array tcpPortsForSai_{}; - std::array udpPortsForSai_{}; + std::array, kEcmpWidth4> tcpPorts_{}; + std::array, kEcmpWidth4> udpPorts_{}; + std::array, kEcmpWidth4> tcpPortsForSai_{}; + std::array, kEcmpWidth4> udpPortsForSai_{}; }; TEST_F(HwHashConsistencyTest, TcpEgressLinks) { From ddaf39ded00cec9d4471dd1032d573421d29d1bd Mon Sep 17 00:00:00 2001 From: Nivin Lawrence Date: Tue, 7 Feb 2023 11:18:37 -0800 Subject: [PATCH 183/280] Enable PFC tests for Indus and greenlight the same Summary: Make sure PFC programming tests work for Indus as well. OK : 5 FAILED : 0 SKIPPED : 0 TIMEOUT : 0 ``` Reviewed By: jasmeetbagga Differential Revision: D43050864 fbshipit-source-id: 91291d8403614f481f7db9cf7aa835d2be64e5ee --- fboss/agent/hw/test/HwPfcTests.cpp | 5 ++--- installer/centos-7-x86_64/run_scripts/run_test.py | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fboss/agent/hw/test/HwPfcTests.cpp b/fboss/agent/hw/test/HwPfcTests.cpp index 1c1551e4a3ea8..d22114cbc3d68 100644 --- a/fboss/agent/hw/test/HwPfcTests.cpp +++ b/fboss/agent/hw/test/HwPfcTests.cpp @@ -19,9 +19,8 @@ namespace facebook::fboss { class HwPfcTest : public HwTest { protected: cfg::SwitchConfig initialConfig() const { - std::vector ports = { - masterLogicalInterfacePortIds()[0], masterLogicalInterfacePortIds()[1]}; - return utility::onePortPerInterfaceConfig(getHwSwitch(), std::move(ports)); + return utility::onePortPerInterfaceConfig( + getHwSwitch(), masterLogicalPortIds()); } // Basic config with 2 L3 interface config diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index b617d2c274c59..4e8f5644efca7 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -95,6 +95,8 @@ # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=SaiAclTableRecreateTests.* # ./run_test.py sai --config makalu.agent.materialized_JSON # --filter=HwAclStatTest.*:-*AclStatCreate:*AclStatCreateShared:*AclStatCreateMultiple:*AclStatMultipleActions:*AclStatDeleteShared*:*AclStatDeleteSharedPostWarmBoot:*AclStatRename*:*AclStatModify:*AclStatShuffle:*StatNumberOfCounters:*AclStatChangeCounterType +# PFC tests +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwPfcTest.*:-*Watchdog* # All tests matching following filter are expected to PASS on Kamet # Note: For Kamet test runs, suffix --coldboot_only to all tests. Warm boot From 2fa83224887fa3ba3c4c138a807062e01df2326d Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 7 Feb 2023 11:38:13 -0800 Subject: [PATCH 184/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/9796f9b7f56f1a2e2d77fdd7a6798470c0bdf277 https://github.com/facebook/fbthrift/commit/eca963c8455773378badd68cc43cceb9f4cd64f2 https://github.com/facebook/rocksdb/commit/68fa90ca434257c66a543e3524cd79062ea51ced Reviewed By: yns88 fbshipit-source-id: fd71f912477cba864379c1b5f5914a8ba9733c0f --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index c99548aa07354..cfecccb4b174b 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 749e4e556910605f27af4a404cdf3c3f7280eafc +Subproject commit eca963c8455773378badd68cc43cceb9f4cd64f2 From 6b7d9526acc91c073a462b42e00e90bc0fc0448c Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Tue, 7 Feb 2023 12:24:11 -0800 Subject: [PATCH 185/280] Get neighbor tests ready for VOQ switches Summary: As titled. - Use interface to pull out neighbor tables - Only look at interface ports when programming neighbors Reviewed By: shri-khare Differential Revision: D43072245 fbshipit-source-id: abab6574c934f7c5e50b26e7f57d6a4afa165835 --- fboss/agent/hw/test/HwNeighborTests.cpp | 38 ++++++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/fboss/agent/hw/test/HwNeighborTests.cpp b/fboss/agent/hw/test/HwNeighborTests.cpp index 7115096bab93d..7a803c2bdbc8e 100644 --- a/fboss/agent/hw/test/HwNeighborTests.cpp +++ b/fboss/agent/hw/test/HwNeighborTests.cpp @@ -94,34 +94,50 @@ class HwNeighborTest : public HwLinkStateDependentTest { XLOG(FATAL) << " No vlans on non-npu switches"; } InterfaceID kIntfID() const { - if (getProgrammedState()->getSwitchSettings()->getSwitchType() == - cfg::SwitchType::NPU) { + auto switchType = + getProgrammedState()->getSwitchSettings()->getSwitchType(); + if (switchType == cfg::SwitchType::NPU) { return InterfaceID(static_cast(kVlanID())); + } else if (switchType == cfg::SwitchType::VOQ) { + CHECK(!programToTrunk) << " Trunks not supported yet on VOQ switches"; + auto portId = this->portDescriptor().phyPortID(); + return InterfaceID((*getProgrammedState() + ->getPorts() + ->getPort(portId) + ->getInterfaceIDs() + ->begin()) + ->toThrift()); } - XLOG(FATAL) << "TODO: VOQ switch support"; + XLOG(FATAL) << "Unexpected switch type " << static_cast(switchType); } - PortDescriptor portDescriptor() { + PortDescriptor portDescriptor() const { if (programToTrunk) { return PortDescriptor(kAggID); } - return PortDescriptor(masterLogicalPortIds()[0]); + return PortDescriptor(masterLogicalInterfacePortIds()[0]); } auto getNeighborTable(std::shared_ptr state) { - if (state->getSwitchSettings()->getSwitchType() == cfg::SwitchType::NPU) { + auto switchType = + getProgrammedState()->getSwitchSettings()->getSwitchType(); + if (switchType == cfg::SwitchType::NPU) { return state->getVlans() ->getVlan(kVlanID()) ->template getNeighborTable() ->modify(kVlanID(), &state); + } else if (switchType == cfg::SwitchType::VOQ) { + return state->getInterfaces() + ->getInterface(kIntfID()) + ->template getNeighborEntryTable() + ->modify(kIntfID(), &state); } - XLOG(FATAL) << "TODO: VOQ switch support"; + XLOG(FATAL) << "Unexpected switch type " << static_cast(switchType); } std::shared_ptr addNeighbor( const std::shared_ptr& inState) { auto ip = NeighborT::getNeighborAddress(); auto outState{inState->clone()}; - auto neighborTable = getNeighborTable(outState); neighborTable->addPendingEntry(ip, kIntfID()); return outState; @@ -279,7 +295,7 @@ TYPED_TEST(HwNeighborTest, LinkDownOnResolvedEntry) { auto state = this->addNeighbor(this->getProgrammedState()); auto newState = this->resolveNeighbor(state); newState = this->applyNewState(newState); - this->bringDownPort(this->masterLogicalPortIds()[0]); + this->bringDownPort(this->masterLogicalInterfacePortIds()[0]); }; auto verify = [this]() { // There is a behavior differnce b/w SAI and BcmSwitch on link down @@ -301,8 +317,8 @@ TYPED_TEST(HwNeighborTest, LinkDownAndUpOnResolvedEntry) { auto state = this->addNeighbor(this->getProgrammedState()); auto newState = this->resolveNeighbor(state); newState = this->applyNewState(newState); - this->bringDownPort(this->masterLogicalPortIds()[0]); - this->bringUpPort(this->masterLogicalPortIds()[0]); + this->bringDownPort(this->masterLogicalInterfacePortIds()[0]); + this->bringUpPort(this->masterLogicalInterfacePortIds()[0]); }; auto verify = [this]() { // There is a behavior differnce b/w SAI and BcmSwitch on link down From 350604d12d77fe9f265e7ea57bbce8b7749f8b1e Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Tue, 7 Feb 2023 12:48:23 -0800 Subject: [PATCH 186/280] Get hash consistency tests working on Makalu Summary: For makalu both src and dst port need to be varied to vary the egress link Reviewed By: nivinl Differential Revision: D43076910 fbshipit-source-id: f13a39cbe10b57de44ea13c9b7fd72ff309eb0ed --- .../hw/test/dataplane_tests/HwHashConsistencyTest.cpp | 11 +++++++++-- installer/centos-7-x86_64/run_scripts/run_test.py | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp index 186815fe804bc..e578c85795a25 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwHashConsistencyTest.cpp @@ -37,8 +37,8 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { tcpPorts_[3] = {10000, 10000}; udpPorts_ = tcpPorts_; - if (getPlatform()->getAsic()->getAsicType() == - cfg::AsicType::ASIC_TYPE_EBRO) { + auto asicType = getPlatform()->getAsic()->getAsicType(); + if (asicType == cfg::AsicType::ASIC_TYPE_EBRO) { tcpPortsForSai_[0] = {10002, 10002}; tcpPortsForSai_[1] = {10004, 10004}; tcpPortsForSai_[2] = {10000, 10000}; @@ -49,6 +49,13 @@ class HwHashConsistencyTest : public HwLinkStateDependentTest { udpPortsForSai_[2] = {10002, 10002}; udpPortsForSai_[3] = {10003, 10003}; + } else if (asicType == cfg::AsicType::ASIC_TYPE_INDUS) { + tcpPortsForSai_[0] = {10002, 10010}; + tcpPortsForSai_[1] = {10002, 10006}; + tcpPortsForSai_[2] = {10002, 10014}; + tcpPortsForSai_[3] = {10002, 10002}; + udpPortsForSai_ = tcpPortsForSai_; + } else { tcpPortsForSai_[0] = {10003, 10003}; tcpPortsForSai_[1] = {10000, 10000}; diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 4e8f5644efca7..953153ac86860 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -77,9 +77,10 @@ # Counter tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwInPauseDiscardsCounterTest.* # Load Balancer Tests -# UCMP support lacking DNX +# UCMP support lacking in DNX # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV4.*:-*Ucmp*:-*Shrink* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV6.*:-*Ucmp*:-*Shrink* +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwHashConsistencyTest.*:-*EcmpExpand*:*MemberOrder* # LB Tests with ROCE traffic # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerNegativeTestV6RoCE.* # Route programming tests From 6ecbd12c7479ee14b3aaa5c5fb347d268b20b370 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Tue, 7 Feb 2023 13:21:54 -0800 Subject: [PATCH 187/280] Update PCS and FEC state in PhyInfo Summary: Adding code to update the PCS link status and FEC Lane State in the PhyInfo that is periodically updated for all PHYs. These attributes are only supported in SAI version >= 1.10.3 and Tajo SDK 1.42.8 (which backported the SAI spec changes to it's corresponding SAI version 1.7.4). These attributes are also guarded by HwAsic Features. None of the ASICs have these features enabled currently. Will enable it on Ebro asic in next diff. Reviewed By: rajank7 Differential Revision: D43015972 Privacy Context Container: L1125642 fbshipit-source-id: 6e1f28e3292c0acb28c52587f469842c02f8198a --- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 41 +++++++++++++++++++++++-- fboss/agent/hw/sai/switch/SaiSwitch.h | 4 ++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index 76d3a684fb8d9..4c6336cfa6c5b 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -1181,12 +1181,14 @@ std::map SaiSwitch::updateAllPhyInfoLocked() { // Update PCS Info updatePcsInfo( *phyParams.line(), + *(*phyParams.state()).line(), *(*phyParams.stats()).line(), swPort, phy::Side::LINE, lastPhyInfo, fb303PortStat, - *phyParams.speed()); + *phyParams.speed(), + portHandle->port); // Update Reconciliation Sublayer (RS) Info updateRsInfo( @@ -1351,17 +1353,50 @@ void SaiSwitch::updatePmdInfo( void SaiSwitch::updatePcsInfo( phy::PhySideInfo& sideInfo, + phy::PhySideState& sideState, phy::PhySideStats& sideStats, PortID swPort, phy::Side side, phy::PhyInfo& lastPhyInfo, const HwPortFb303Stats* fb303PortStat, - cfg::PortSpeed speed) { + cfg::PortSpeed speed, + std::shared_ptr port) { auto fecMode = getPortFECMode(swPort); + + phy::PcsState pcsState; +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) + if (auto pcsLinkStatus = + managerTable_->portManager().getPcsRxLinkStatus(port->adapterKey())) { + pcsState.pcsRxStatusLive() = pcsLinkStatus->current_status; + pcsState.pcsRxStatusLatched() = pcsLinkStatus->changed; + } +#endif + if (utility::isReedSolomonFec(fecMode)) { phy::PcsStats pcsStats; phy::PcsInfo pcsInfo; phy::RsFecInfo rsFec; + +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) + auto fecLanes = utility::reedSolomonFecLanes(speed); + auto fecAmLock = managerTable_->portManager().getFecAlignmentLockStatus( + port->adapterKey(), fecLanes); + phy::RsFecState fecState; + for (auto fecAm : fecAmLock) { + // SDKs sometimes return data for more FEC lanes than the FEC block on the + // port actually uses + if (fecAm.lane < fecLanes) { + phy::RsFecLaneState fecLaneState; + fecLaneState.lane() = fecAm.lane; + fecLaneState.fecAlignmentLockLive() = fecAm.value.current_status; + fecLaneState.fecAlignmentLockChanged() = fecAm.value.changed; + + fecState.lanes()[fecAm.lane] = fecLaneState; + } + } + pcsState.rsFecState() = fecState; +#endif + rsFec.correctedCodewords() = *(fb303PortStat->portStats().fecCorrectableErrors()); rsFec.uncorrectedCodewords() = @@ -1395,6 +1430,8 @@ void SaiSwitch::updatePcsInfo( sideInfo.pcs() = pcsInfo; sideStats.pcs() = pcsStats; } + + sideState.pcs() = pcsState; } bool SaiSwitch::rxSignalDetectSupportedInSdk() const { diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.h b/fboss/agent/hw/sai/switch/SaiSwitch.h index 3a3f63ddf50f2..039293e193585 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.h +++ b/fboss/agent/hw/sai/switch/SaiSwitch.h @@ -330,12 +330,14 @@ class SaiSwitch : public HwSwitch { void updatePcsInfo( phy::PhySideInfo& sideInfo, + phy::PhySideState& sideState, phy::PhySideStats& sideStats, PortID swPort, phy::Side side, phy::PhyInfo& lastPhyInfo, const HwPortFb303Stats* fb303PortStat, - cfg::PortSpeed speed); + cfg::PortSpeed speed, + std::shared_ptr port); void updateRsInfo( phy::PhySideInfo& sideInfo, From 92b824cfcca7d50199800157e9b4a88ce36a1e97 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Tue, 7 Feb 2023 13:21:54 -0800 Subject: [PATCH 188/280] Enable reading of PCS and FEC status on Ebro ASIC Summary: Vendor has supported this on 1.42.8 SDK, hence enabling the feature for this ASIC Reviewed By: rajank7 Differential Revision: D43015978 Privacy Context Container: L1125642 fbshipit-source-id: 1e8848404f5e3ad59bac15f5f336ab7a328091c5 --- fboss/agent/hw/switch_asics/EbroAsic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fboss/agent/hw/switch_asics/EbroAsic.cpp b/fboss/agent/hw/switch_asics/EbroAsic.cpp index a396dcda41ae3..0340df857c854 100644 --- a/fboss/agent/hw/switch_asics/EbroAsic.cpp +++ b/fboss/agent/hw/switch_asics/EbroAsic.cpp @@ -66,6 +66,8 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::SAI_ACL_ENTRY_SRC_PORT_QUALIFIER: case HwAsic::Feature::PMD_RX_LOCK_STATUS: case HwAsic::Feature::PMD_RX_SIGNAL_DETECT: + case HwAsic::Feature::FEC_AM_LOCK_STATUS: + case HwAsic::Feature::PCS_RX_LINK_STATUS: return true; // VOQ vs NPU mode dependent features case HwAsic::Feature::BRIDGE_PORT_8021Q: @@ -127,8 +129,6 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::DLB: - case HwAsic::Feature::FEC_AM_LOCK_STATUS: - case HwAsic::Feature::PCS_RX_LINK_STATUS: return false; } return false; From 6b30f05ad0c3ba5286b9b499cfc8c751ffbecbc4 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Tue, 7 Feb 2023 13:21:54 -0800 Subject: [PATCH 189/280] Display FEC Lane State in show interface phy FBOSS2 CLI Summary: as titled. Reviewed By: rajank7 Differential Revision: D43015969 Privacy Context Container: L1125642 fbshipit-source-id: b02680d789e4283d86dee2d3f4fe7c9c64340c02 --- .../show/interface/phy/CmdShowInterfacePhy.h | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/fboss/cli/fboss2/commands/show/interface/phy/CmdShowInterfacePhy.h b/fboss/cli/fboss2/commands/show/interface/phy/CmdShowInterfacePhy.h index 64a231e56e627..38fc75429ba15 100644 --- a/fboss/cli/fboss2/commands/show/interface/phy/CmdShowInterfacePhy.h +++ b/fboss/cli/fboss2/commands/show/interface/phy/CmdShowInterfacePhy.h @@ -230,14 +230,46 @@ class CmdShowInterfacePhy if (sideState.pcs().has_value() || sideStats.pcs().has_value()) { Table pcsTable; Table rsFecTable; - bool hasPcsData{false}, hasRsFecData{false}; + Table rsFecStateTable; + bool hasPcsData{false}, hasRsFecData{false}, hasRsFecState{false}; if (sideState.pcs().has_value()) { if (auto pcsRxStatusLive = sideState.pcs()->pcsRxStatusLive()) { + pcsTable.setHeader({prefix + "PCS", ""}); pcsTable.addRow( {prefix + "PCS RX Link Status Live", makeColorCellForLiveFlag(std::to_string(*pcsRxStatusLive))}); + if (auto pcsRxStatusLatched = sideState.pcs()->pcsRxStatusLatched()) { + pcsTable.addRow( + {prefix + "PCS RX Link Status Changed", + std::to_string(*pcsRxStatusLatched)}); + } hasPcsData = true; } + if (auto rsFecState = sideState.pcs()->rsFecState()) { + rsFecStateTable.setHeader( + {prefix + "RS FEC State", + "Lane", + "Alignment Lock Live", + "Alignment Lock Changed"}); + for (auto& fecLaneState : *rsFecState->lanes()) { + std::string fecAmLive = "N/A"; + std::string fecAmChanged = "N/A"; + if (auto fecAmLiveState = + fecLaneState.second.fecAlignmentLockLive()) { + fecAmLive = std::to_string(*fecAmLiveState); + } + if (auto fecAmChangedState = + fecLaneState.second.fecAlignmentLockChanged()) { + fecAmChanged = std::to_string(*fecAmChangedState); + } + rsFecStateTable.addRow( + {"", + std::to_string(*(fecLaneState.second.lane())), + makeColorCellForLiveFlag(fecAmLive), + fecAmChanged}); + } + hasRsFecState = true; + } } if (sideStats.pcs().has_value()) { if (auto rsFec = sideStats.pcs()->rsFec()) { @@ -254,12 +286,14 @@ class CmdShowInterfacePhy hasRsFecData = true; } if (hasPcsData) { - pcsTable.setHeader({prefix + "PCS", ""}); out << pcsTable; } if (hasRsFecData) { out << rsFecTable; } + if (hasRsFecState) { + out << rsFecStateTable; + } } } From ae74201961b22dac86e1641587d3171f44728e82 Mon Sep 17 00:00:00 2001 From: Wei Dai Date: Tue, 7 Feb 2023 14:11:34 -0800 Subject: [PATCH 190/280] properly program hw lane list for TH4 10G ports Summary: As titled, current TH4 port lane programming was assuming each physical port has two serdes lanes. However, this does not work with 10G port speed, where only single serdes lane used. It needs both SAI fix in D43015273 and fboss agent fix in this diff. Reviewed By: shri-khare Differential Revision: D43068136 fbshipit-source-id: f7534fe0292f23046d12cc1c21b23b7d9811dd3a --- .../hw/sai/switch/npu/SaiPortManager.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp b/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp index dc31c26731594..e39cefe9b5cd0 100644 --- a/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp +++ b/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp @@ -326,12 +326,17 @@ SaiPortTraits::CreateAttributes SaiPortManager::attributesFromSwPort( if (!hwLaneListIsPmdLaneList_) { // On Tomahawk4, HwLaneList means physical port list instead of pmd lane // list for now. One physical port maps to two pmd lanes. So, do the - // conversion here PMD lanes ==> physical ports [1,2,3,4] ==> [1,2] + // conversion here PMD lanes ==> physical ports, e.g. + // [1,2,3,4] ==> [1,2] // [5,6,7,8] ==> [3,4] // ...... + // If only has one lane (e.g. 10G case), map to one physical port, e.g. + // [1] ==> [1] + // [5] ==> [3] + // ...... std::vector pportList; - for (int i = 0; i < hwLaneList.size() / 2; i++) { - pportList.push_back(hwLaneList[i * 2 + 1] / 2); + for (int i = 0; i < std::max(1, (int)hwLaneList.size() / 2); i++) { + pportList.push_back((hwLaneList[i * 2] + 1) / 2); } hwLaneList = pportList; } @@ -562,8 +567,12 @@ void SaiPortManager::programSerdes( auto numPmdLanes = portKey.value().size(); if (!hwLaneListIsPmdLaneList_) { // On Tomahawk4, HwLaneList means physical port list instead of pmd lane - // list for now. One physical port maps to two pmd lanes. - numPmdLanes *= 2; + // list for now. One physical port maps to two pmd lanes, except for one + // lane use case like 10G. + if (static_cast(GET_ATTR( + Port, Speed, saiPort->attributes())) >= cfg::PortSpeed::FORTYG) { + numPmdLanes *= 2; + } } if (numExpectedTxLanes) { CHECK_EQ(numExpectedTxLanes, numPmdLanes) From 4d9919a4d34608b1e31dd7adf281b0fc864e274f Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 7 Feb 2023 16:05:30 -0800 Subject: [PATCH 191/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/7aa9ab0a0a2ef5ed46054f75ecc894ce563c78b9 https://github.com/facebook/fbthrift/commit/26d96289456b4fae90960c75b96ba3e3b43c0c27 https://github.com/facebook/folly/commit/c6c274f1450b05f66c707e871e7457f4d5ac7181 https://github.com/pytorch/fbgemm/commit/abefe30be07a726cb1b70100613fbe0ac5771924 Reviewed By: yns88 fbshipit-source-id: 9079d4ce52366b5dae30778ed5d3c63b0af06bcf --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index cfecccb4b174b..3db48dce448fb 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit eca963c8455773378badd68cc43cceb9f4cd64f2 +Subproject commit 26d96289456b4fae90960c75b96ba3e3b43c0c27 diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index b2ca221b47207..8ea670c90b915 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit fb120798a77ce73555cdbfcdccb338998896c6ce +Subproject commit c6c274f1450b05f66c707e871e7457f4d5ac7181 From 6c24da6623d9b371f947416d75f81e920f233101 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 7 Feb 2023 16:55:13 -0800 Subject: [PATCH 192/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/2cd3f55a2018432f4ff76ab8c499b2e211751aa2 https://github.com/facebook/fbthrift/commit/c2bd9e10c8ff5057898f622b717af29b02346009 https://github.com/facebook/proxygen/commit/965bed3e6dc8481636aac74e06e39e9b3e38b7d6 https://github.com/facebook/watchman/commit/cd8aaef71c9b5c9d4de21838df8b13e8bc52a085 https://github.com/facebookincubator/mvfst/commit/65d974e4ce8767e7ff7c76005a5ceef0ac04b6d6 https://github.com/facebookincubator/velox/commit/6f393339c4528e7ac8db475acb6f41c1111875c8 Reviewed By: yns88 fbshipit-source-id: 4df0483d738953d70b57f5b70c68a96e6b087bf2 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 3db48dce448fb..7b924f99ed29c 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 26d96289456b4fae90960c75b96ba3e3b43c0c27 +Subproject commit c2bd9e10c8ff5057898f622b717af29b02346009 From ebea399384768fbc52cf32f270a9c85f7c43593b Mon Sep 17 00:00:00 2001 From: Bin Huang Date: Tue, 7 Feb 2023 17:22:08 -0800 Subject: [PATCH 193/280] Add OSS cmake file Summary: #astitle Reviewed By: somasun Differential Revision: D43064891 fbshipit-source-id: bce1d5c3b0aae3d6c6bdb532b09caf54845fac1e --- cmake/PlatformFbdevd.cmake | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 cmake/PlatformFbdevd.cmake diff --git a/cmake/PlatformFbdevd.cmake b/cmake/PlatformFbdevd.cmake new file mode 100644 index 0000000000000..b8dbb5f9069d3 --- /dev/null +++ b/cmake/PlatformFbdevd.cmake @@ -0,0 +1,59 @@ +# Make to build libraries and binaries in fboss/platform/fbdevd + +# In general, libraries and binaries in fboss/foo/bar are built by +# cmake/FooBar.cmake + +add_fbthrift_cpp_library( + fbdevd_cpp2 + fboss/platform/fbdevd/if/fbdevd.thrift + SERVICES + FbdevManager + OPTIONS + json + reflection +) + +add_fbthrift_cpp_library( + gpio_cpp2 + fboss/platform/fbdevd/if/gpio.thrift + OPTIONS + json + reflection +) + +add_fbthrift_cpp_library( + i2c_cpp2 + fboss/platform/fbdevd/if/i2c.thrift + OPTIONS + json + reflection +) + + +add_library(fbdevd_lib + fboss/platform/fbdevd/FbdevdImpl.cpp + fboss/platform/fbdevd/Flags.cpp + fboss/platform/fbdevd/FruManager.cpp + fboss/platform/fbdevd/I2cController.cpp +) + +target_link_libraries(fbdevd_lib + log_thrift_call + common_file_utils + platform_utils + platform_config_lib + fbdevd_cpp2 + gpio_cpp2 + i2c_cpp2 + Folly::folly + FBThrift::thriftcpp2 +) + +add_executable(fbdevd + fboss/platform/fbdevd/Main.cpp +) + +target_link_libraries(fbdevd + fbdevd_lib + fb303::fb303 +) From 180794e542a09904c57b84bdb06165d7f69f91f7 Mon Sep 17 00:00:00 2001 From: Priyank Warkhede Date: Tue, 7 Feb 2023 17:41:19 -0800 Subject: [PATCH 194/280] Fix agent crash on graceful stop Summary: After D41848250 disabled Thrift duplex, agent process crashes were observed during graceful shutdown due to Thrift worker thread attemping to process read request even after ThriftServer::stopListening() was called. With Thrift duplex disabled, to gracefully stop the server, use ThriftServer::stop() API which stops listening for new connections, closes existing connections and shuts down worker threads. Reviewed By: msomasundaran Differential Revision: D42865656 fbshipit-source-id: d03c27534362d7e1152de840fe8f012a715617b1 --- fboss/agent/Main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fboss/agent/Main.cpp b/fboss/agent/Main.cpp index 95323965e428d..6197053ea9349 100644 --- a/fboss/agent/Main.cpp +++ b/fboss/agent/Main.cpp @@ -299,9 +299,11 @@ int AgentInitializer::initAgent() { } void AgentInitializer::stopServices() { + // stop Thrift server: stop all worker threads and // stop accepting new connections - server_->stopListening(); - XLOG(DBG2) << "Stopped thrift server listening"; + XLOG(DBG2) << "Stopping thrift server"; + server_->stop(); + XLOG(DBG2) << "Stopped thrift server"; initializer_->stopFunctionScheduler(); XLOG(DBG2) << "Stopped stats FunctionScheduler"; fbossFinalize(); From f47f13db8ba409e0be0db701045025b25c5af375 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 7 Feb 2023 18:13:54 -0800 Subject: [PATCH 195/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/063a235608d1880848ec72fa4d72604d31220a9d https://github.com/facebook/rocksdb/commit/876d2815921172c1f21b2be5b453d5c8499c42cd https://github.com/facebook/wangle/commit/29250e77353a128f76fc2ba228fe1c95f03ab161 https://github.com/facebookexperimental/edencommon/commit/9f591dfcd36b7fb2cf1ace0c5425ff84e803eeb7 https://github.com/facebookexperimental/rust-shed/commit/6aa75f2e7036d5b906cd884bf8f3b85a3edc8ced https://github.com/facebookincubator/fizz/commit/1ef19e9b9157dd58683a703973f232ea0a197320 https://github.com/facebookincubator/velox/commit/f288ebb418e9612de34cf9f346e66c3681b81654 https://github.com/pytorch/fbgemm/commit/c557583f8a3ae157fd940ec3f86de9cf714c1582 Reviewed By: yns88 fbshipit-source-id: 8a7ad47e03adf26018794940610520791383b18c --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 7b924f99ed29c..abfcdb7e51f67 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit c2bd9e10c8ff5057898f622b717af29b02346009 +Subproject commit 063a235608d1880848ec72fa4d72604d31220a9d diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 77d65d5760056..51e329f5d7fdf 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 9b9ff0db1d1f90e6950f04da7c855121282a4a9f +Subproject commit 29250e77353a128f76fc2ba228fe1c95f03ab161 From d4421bd17691e15b1ace3295146a633cbb590541 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Tue, 7 Feb 2023 18:18:40 -0800 Subject: [PATCH 196/280] Ensure the right fbossInit functions are linked for binaries Reviewed By: mikechoifb Differential Revision: D43100354 Privacy Context Container: L1125642 fbshipit-source-id: 5046ccc749723bf42f5c5c430389f255c124e549 --- fboss/agent/Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fboss/agent/Main.cpp b/fboss/agent/Main.cpp index 6197053ea9349..8a268d6cee403 100644 --- a/fboss/agent/Main.cpp +++ b/fboss/agent/Main.cpp @@ -22,7 +22,7 @@ #include "fboss/agent/AgentConfig.h" #include "fboss/agent/AlpmUtils.h" #include "fboss/agent/ApplyThriftConfig.h" -#include "fboss/agent/FbossInit.h" +#include "fboss/agent/FbossInit.h" // @manual #include "fboss/agent/HwSwitch.h" #include "fboss/agent/Platform.h" #include "fboss/agent/RestartTimeTracker.h" From cc68b04a47586c9a74b28b50dbc0014aafbe2d64 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Tue, 7 Feb 2023 19:04:37 -0800 Subject: [PATCH 197/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/92a39e93454dd2799e4288c7e11b9b069cb6660b https://github.com/facebook/proxygen/commit/9b9c0cf50ba26a5a78ac2ea9d8623ccbcddbac73 https://github.com/facebookincubator/mvfst/commit/7b810a0fa92e7712f34ce0c57d29974aedf8c209 Reviewed By: yns88 fbshipit-source-id: 40c0fa32d2b0a90014055b750ac53471d818a369 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index abfcdb7e51f67..611e5c885ed54 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 063a235608d1880848ec72fa4d72604d31220a9d +Subproject commit 92a39e93454dd2799e4288c7e11b9b069cb6660b From 81627a6ed4d0167eca671b3025aa2e37a19fcf61 Mon Sep 17 00:00:00 2001 From: Jitendra Verma Date: Tue, 7 Feb 2023 20:59:22 -0800 Subject: [PATCH 198/280] Move and update SwitchStats wiki under feature Summary: Moved switch stats wiki under fboss agent features. Restructured and updated the contents. Reviewed By: msomasundaran Differential Revision: D43105146 Privacy Context Container: L1125642 fbshipit-source-id: 219d49c7a06fb7bdd5ea423cf3880d12b725faa6 --- fboss/agent/wiki/concepts/features/index.rst | 1 + fboss/agent/wiki/concepts/features/stats.rst | 164 +++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 fboss/agent/wiki/concepts/features/stats.rst diff --git a/fboss/agent/wiki/concepts/features/index.rst b/fboss/agent/wiki/concepts/features/index.rst index 6f70d53616cbf..c6058d7f84d48 100644 --- a/fboss/agent/wiki/concepts/features/index.rst +++ b/fboss/agent/wiki/concepts/features/index.rst @@ -11,3 +11,4 @@ tunnel_intfs watermark_stats acls + stats diff --git a/fboss/agent/wiki/concepts/features/stats.rst b/fboss/agent/wiki/concepts/features/stats.rst new file mode 100644 index 0000000000000..b2dd6fcb7b8da --- /dev/null +++ b/fboss/agent/wiki/concepts/features/stats.rst @@ -0,0 +1,164 @@ +Switch Statistics +================= + +Feature Description +==================== + +Overview +========= + +Sometimes when debugging detailed networking problems or tracking new +statistics, understanding the low-level details of how statistics +are generated and tracked across the FBOSS agent are important. In +particular, for performance reasons, collection of switch statistics are +done periodically (e.g., once per second, one per minute, etc.) and you +need to know how the statistics are collected to understand what they're +actually telling you. + +Design +======= + +Many of the statistics can update at full line rate (>10 billion +packets per second) which is faster than even the beefiest CPUs can +handle. So the Broadcom chips (really, all packet forwarding ASICs) +expose statistics as hardware registers for the software agents (e.g., +FBOSS) to read periodically. + +FBOSS launches a thread 'updateCounters' to read the hardware statistics +once per second and stores the values for thrift/fb303. As a result, +making thrift/fb303 calls to the switch to read a counter faster than +once per second is useless, because internally the counter is only +updating from the hardware once per second. + +Unfortunately, there is an additional complication. At the +bottom of the updateCounters call stack is a Broadcom API call, +e.g., bcm_cosq_stat_get(unit, port, queue, type, &value ) or +bcm_stat_get(unit, port, &value). where critically, the 'value' +here is typically a 64 bit value. In practice, this is itself a layer +of abstraction because some of the underlying hardware counters are not +64-bit values. + +For counters that are 64-bit, the SDK function calls directly pull from +the hardware registers (read: this is the simple case). + +However, for the purpose of saving bits, particularly the port stats +counters (e.g., rx packets received), it's too expensive from a hardware +design standpoint to have a 64 bit counter for each port for each type +of counter (unicast, broadcast, dropped, etc.). As a result, some of the +underlying hardware counters are smaller than 64 bits. To maintain the +abstraction of a 64 bit counter, internally the SDK itself launches its +own statics tracking thread that periodically copies from the hardware +counter. + +This SDK thread performs the following algorithm: + +- reads $value from the underlying hardware counter (e.g., an 32 bit counter) +- if $value is less than $old_value, declare a counter wrap (assume a single counter wrap!): $virtual_value += 2^32 +- Adds the updated value to a 64 bit $virtual_value region: $virtual_value += $value - $old_value Note: if there was a counter wrap, $value minus $old_value will be negative but will still do the right thing. +- $old_value = $value + +and the SDK call returns the $virtual_value. + +The Broadcom 'bcm_stat_interval' SDK parameter sets that period (in +milliseconds) though FBOSS's bcm.conf does not change it from its default +value of 1 second: + +$ fboss_bcm_shell localhost --command 'counter' + +Current settings: Interval=1000000 <--- this is in micro seconds +PortBitMap=0x000000000000000000000000000000000000000000000001ffffffffffffffff, +cpu,xe DMA=True For more information, check out the ./doc/counter.txt +file in any SDK source directory! + +In theory, we could remove the thread polling step and directly DMA +our counters into the region of memory used by agent to export to +fb303. Whether this would have value or not is TBD, but good to know +it's possible. + +Design: State Propagation +========================== + +- Packet arrives and hardware counter is immediately incremented +- Broadcom SDK thread periodically copies from hardware register (<64 bit) into main memory 64-bit counter: currently 1/second +- FBOSS agent periodically calls a 'get stat' SDK call to copy from the SDK memory into memory in agent that's referenced in thrift/fb303 calls: currently 1/second +- fbagent periodically calls getCounters() on agent to get list of counters and then copies all counter data into its memory:currently 1/minute +- ODS periodically calls into fbagent to pull counters into ODS's long term time series storage: currently every 1-5 minutes depending on counter configuration + + +Design: Timing Implications for ~1 Second Monitoring +===================================================== + +Given the under the covers implementation and the interaction between +the Broadcom SDK periodic counter thread and the FBOSS thread counter, +it's possible for a packet that's counted by the hardware at time t=0 +to not show up in fb303 getCounter until 2 full seconds later, e.g., +if we just missed the Broadcom SDK counter thread scheduling (1 second +per update) and that thread is just slightly out of sync with the FBOSS +updateCounters thread (also 1 second). For right now, that's probably +ok, but it would be easy to tweak (e.g., by reducing either of these +intervals) and perhaps even possible to remove (e.g., by going to DMA). + +Scale +====== + +N/A + + +Use Case: Statistics Runbook for a Single Switch +================================================= + +All FBOSS statistics are exported via the fb303 interface (running on +agent's thrift port - 5909), so any of the following will work: + +- Get a list of statistics/counters we track from a switch (e.g., "rsw1ao.21.snc1"): fb303c getCounters -s rsw1ao.21.snc1:5909 +- Grab a specific statistic (e.g., "cpu.queue2.in_pkts.sum") once a second: watch -n1 fb303c -s rsw1ao.21.snc1:5909 getCounter cpu.queue2.in_pkts.sum +- Grab a graphical view of counters and current values: 'bunnylol fb303 rsw1ao.21.snc1' in your favorite webbrowser +- View stats as a graphical time series: 'bunnylol fb303/graph' in your favorite webbrowser + +Note that when trying to view statistics across multiple switches, +particularly over time, using ODS is probably a better tool to view +this information. + + +Use Case: Exporting Statistics Off Box (e.g., to ODS) +====================================================== + +Similar to other Facebook services, once statistics are available from +agent via fb303, then fbagent (not to be confused with wedge_agent) polls +the statistics from agent once per minute. Then, ODS polls from fbagent +typically once every one to five minutes, depending on the counter. So +the question of "where do I look at the statistics" comes down to "how +fresh do you need the data". + +Configuration +============== + +The feature is enabled by default, no configuration knobs available. + +Build and test +=============== + +N/A + +Debug +====== + +N/A + +Sample Output +============== + +fb303c getCounters -s rsw001.p006.f02.snc1:5909 | grep warm_boot + "warm_boot.configured.stage_duration_ms": 1197, + "warm_boot.fib_synced_bgp.stage_duration_ms": 2625, + "warm_boot.fib_synced_openr.stage_duration_ms": 1757, + "warm_boot.initialized.stage_duration_ms": 8670, + "warm_boot.parent_process_started.stage_duration_ms": 18040, + "warm_boot.process_started.stage_duration_ms": 10000, + "warm_boot.shutdown.stage_duration_ms": 6666, + "warm_boot.total_duration_ms": 44573, + +watch -n1 fb303c -s rsw001.p006.f02.snc1:5909 getCounter warm_boot.fib_synced_openr.stage_duration_ms +Every 1.0s: fb303c -s rsw001.p006.f02.snc1:5909 getCounter warm_boot.fib_synced_openr.stage_duration_ms + +rsw001.p006.f02.snc1:5909 1757 From 7338a020731ad93967025f9b0d0d201b4399aa47 Mon Sep 17 00:00:00 2001 From: Rajan Kumar Date: Tue, 7 Feb 2023 23:29:45 -0800 Subject: [PATCH 199/280] Add better message for PIM type read failure Summary: We print "PIM type can't be determined" when FPGA does not return expected PIM types. We need to differentiate between cases where PIM type register read failed (due to bad FPGA, PIM not inserted correctly etc) versus when FPGA reported wrong value. In case of read failure, the PCI returns all 1's so we can identify the bad read that way Reviewed By: birdsoup Differential Revision: D43095118 fbshipit-source-id: 7400173ba37ef7a8e7d51d140963d1638657aae2 --- fboss/lib/fpga/FbDomFpga.cpp | 4 ++++ fboss/lib/fpga/MinipackSystemContainer.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/fboss/lib/fpga/FbDomFpga.cpp b/fboss/lib/fpga/FbDomFpga.cpp index baf516b30b2b1..5ff3b1f0bb019 100644 --- a/fboss/lib/fpga/FbDomFpga.cpp +++ b/fboss/lib/fpga/FbDomFpga.cpp @@ -132,6 +132,10 @@ FbDomFpga::PimType FbDomFpga::getPimType() { case static_cast(FbDomFpga::PimType::MINIPACK_16Q): case static_cast(FbDomFpga::PimType::MINIPACK_16O): return static_cast(curPimTypeReg); + case kFacebookFpgaPimTypeBase: + throw FbossError( + "Error in reading PIM Type from DOM FPGA, register value:", + curPimTypeReg); default: throw FbossError( "Unrecognized pim type with register value:", curPimTypeReg); diff --git a/fboss/lib/fpga/MinipackSystemContainer.cpp b/fboss/lib/fpga/MinipackSystemContainer.cpp index cc49568b2e45b..f80e596fb4802 100644 --- a/fboss/lib/fpga/MinipackSystemContainer.cpp +++ b/fboss/lib/fpga/MinipackSystemContainer.cpp @@ -56,6 +56,12 @@ MultiPimPlatformPimContainer::PimType MinipackSystemContainer::getPimType( return MultiPimPlatformPimContainer::PimType::MINIPACK_16Q; case kMinipack16OPimVal: return MultiPimPlatformPimContainer::PimType::MINIPACK_16O; + case kFacebookFpgaPimTypeBase: + throw FbossError( + "Error in reading PIM Type from DOM FPGA, register value: ", + curPimTypeReg, + " for pim:", + pim); default: throw FbossError( "Unrecognized pim type with register value:", From 57d944b543e78dbf487dc3d633a639059046d421 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Wed, 8 Feb 2023 01:39:28 -0800 Subject: [PATCH 200/280] Don't program class id in every neighbor test Summary: We already have a nbr test that programs and then updates classid. So don't reverify class id programming in every test. We lack class id support in VOQ switches right now, the change here lets us run more tests on such switches. The test for class id programming still fails on VOQ switches, which is as expected Differential Revision: D43109224 fbshipit-source-id: 202582caa44a0e55871646357b39b15ad08e3579 --- fboss/agent/hw/test/HwNeighborTests.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/fboss/agent/hw/test/HwNeighborTests.cpp b/fboss/agent/hw/test/HwNeighborTests.cpp index 7a803c2bdbc8e..407b2955acaa4 100644 --- a/fboss/agent/hw/test/HwNeighborTests.cpp +++ b/fboss/agent/hw/test/HwNeighborTests.cpp @@ -159,14 +159,13 @@ class HwNeighborTest : public HwLinkStateDependentTest { auto ip = NeighborT::getNeighborAddress(); auto outState{inState->clone()}; auto neighborTable = getNeighborTable(outState); - auto lookupClassValue = lookupClass ? lookupClass.value() : kLookupClass; neighborTable->updateEntry( ip, kNeighborMac, portDescriptor(), kIntfID(), NeighborState::REACHABLE, - lookupClassValue); + lookupClass); return outState; } @@ -183,6 +182,7 @@ class HwNeighborTest : public HwLinkStateDependentTest { */ auto gotClassid = utility::getNbrClassId( this->getHwSwitch(), kIntfID(), NeighborT::getNeighborAddress()); + XLOG(INFO) << " GOT CLASSID: " << gotClassid.value(); EXPECT_TRUE(programToTrunk || classID == gotClassid.value()); } @@ -223,18 +223,16 @@ TYPED_TEST(HwNeighborTest, ResolvePendingEntry) { auto newState = this->resolveNeighbor(state); this->applyNewState(newState); }; - auto verify = [this]() { - EXPECT_FALSE(this->isProgrammedToCPU()); - this->verifyClassId(static_cast(this->kLookupClass)); - }; + auto verify = [this]() { EXPECT_FALSE(this->isProgrammedToCPU()); }; this->verifyAcrossWarmBoots(setup, verify); } TYPED_TEST(HwNeighborTest, ResolvePendingEntryThenChangeLookupClass) { auto setup = [this]() { auto state = this->addNeighbor(this->getProgrammedState()); - auto newState = this->resolveNeighbor(state); + auto newState = this->resolveNeighbor(state, this->kLookupClass); this->applyNewState(newState); + this->verifyClassId(static_cast(this->kLookupClass)); newState = this->resolveNeighbor(state, this->kLookupClass2); this->applyNewState(newState); }; @@ -306,7 +304,6 @@ TYPED_TEST(HwNeighborTest, LinkDownOnResolvedEntry) { // egress to neighbor entry is not updated on link down // if it is not part of ecmp group EXPECT_FALSE(this->isProgrammedToCPU()); - this->verifyClassId(static_cast(this->kLookupClass)); } }; this->verifyAcrossWarmBoots(setup, verify); @@ -329,7 +326,6 @@ TYPED_TEST(HwNeighborTest, LinkDownAndUpOnResolvedEntry) { // egress to neighbor entry is not updated on link down // if it is not part of ecmp group EXPECT_FALSE(this->isProgrammedToCPU()); - this->verifyClassId(static_cast(this->kLookupClass)); } }; From 1277023f21773c1ba628dda6300cfa800b22ffe5 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Wed, 8 Feb 2023 08:41:50 -0800 Subject: [PATCH 201/280] Greenlight HwNeighborTest on Voq switches Summary: As titled Differential Revision: D43109716 fbshipit-source-id: 916aa9a621d6e147ce69ce7b50f75d8166c1a633 --- .../centos-7-x86_64/run_scripts/run_test.py | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 953153ac86860..6256ed915794b 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -43,20 +43,23 @@ # ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwVoqSwitchWithMultipleDsfNodesTest.* # # Basic forwarding tests -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwLoopBackTest.* -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwL4PortBlackHolingTest.* -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwJumboFramesTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwLoopBackTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwL4PortBlackHolingTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwJumboFramesTest.* # Route programming tests -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwRouteTest/1.*:-*Mpls* -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwRouteTest/1.*:-*Mpls* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwRouteTest/0.*:-*Mpls* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwRouteTest/1.*:-*Mpls* +# Neighbor programming tests +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwNeighborTest/0.*:-*LookupClass +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwNeighborTest/2.*:-*LookupClass # ACL tests -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclCounterTest.*:-*Sport*:*BumpOn*Cpu* -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=SaiAclTableRecreateTests.* -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclPriorityTest.* -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclMatchActionsTest.* -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclStatTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclCounterTest.*:-*Sport*:*BumpOn*Cpu* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=SaiAclTableRecreateTests.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclPriorityTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclMatchActionsTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwAclStatTest.* # Counter Tests -# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwInDiscardsCounterTest.* +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwInDiscardsCounterTest.* # # All tests matching the following filters pass on w400C in fabric mode # Note: For w400c (fabric) mode test runs, suffix --coldboot_only to all tests. @@ -86,6 +89,9 @@ # Route programming tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwAlpmStressTest.* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=SaiNextHopGroupTest:-*addNextHopGroupPortDown* +# Neighbor programming tests +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwNeighborTest/0.*:-*LookupClass +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwNeighborTest/2.*:-*LookupClass # V4 routes # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwRouteTest/0.*:-*Mpls*:*ClassId*:*ClassID* # V6 routes From 1dfb39a37c71ad564b57509d71c256733cf4ac26 Mon Sep 17 00:00:00 2001 From: Peyman Gardideh Date: Wed, 8 Feb 2023 08:46:11 -0800 Subject: [PATCH 202/280] Add warn to lldp Summary: This command seems to work fine in fboss2. With a few bug fixes in parent diff we should have feature parity. Looking at stats it still looks like the fboss-py version is used more than fboss2 so for now just adding a warning to migrate more users over. Once we have more usages in fboss2 I'll make this more aggressive Will wait a day/two after parent diff lands before landing this to give time for fboss2 conveyor Reviewed By: shri-khare Differential Revision: D41741330 fbshipit-source-id: b90af5cb197cf2b1a2514b9904d52967ec79a63f --- fboss/py/fboss/cli/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fboss/py/fboss/cli/cli.py b/fboss/py/fboss/cli/cli.py index 383496e0d2806..8bc48d5fab43e 100755 --- a/fboss/py/fboss/cli/cli.py +++ b/fboss/py/fboss/cli/cli.py @@ -215,6 +215,7 @@ class LldpCli(object): help="Level of verbosity indicated by count, i.e -vvv", ) @click.pass_obj + @fboss2_deprecate("show lldp", level=DeprecationLevel.WARN) def lldp(cli_opts, port, verbose): """Show LLDP neighbors""" lldp.LldpCmd(cli_opts).run(port, verbose) From d9fafdea656ccacef6d8f6617ae440ff4fe4d4b1 Mon Sep 17 00:00:00 2001 From: Peyman Gardideh Date: Wed, 8 Feb 2023 09:22:30 -0800 Subject: [PATCH 203/280] Populate port name in port stats Summary: Looks like this was never populated and was always defaulted as empty string. Populating to reduce confusion when published to fsdb/nsdb (network analytics team noticed this) Reviewed By: jasmeetbagga Differential Revision: D43102739 fbshipit-source-id: 79368f99e5e3fa6cd72d7439d283d3f3169eb9c3 --- fboss/agent/hw/HwBasePortFb303Stats.h | 2 +- fboss/agent/hw/HwPortFb303Stats.h | 6 ++++++ fboss/agent/hw/HwSysPortFb303Stats.h | 6 ++++++ fboss/agent/hw/test/HwPortFb303StatsTests.cpp | 8 ++++++++ fboss/agent/hw/test/HwSysPortFb303StatsTests.cpp | 8 ++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/fboss/agent/hw/HwBasePortFb303Stats.h b/fboss/agent/hw/HwBasePortFb303Stats.h index dff362c9b895a..cf36a8925de77 100644 --- a/fboss/agent/hw/HwBasePortFb303Stats.h +++ b/fboss/agent/hw/HwBasePortFb303Stats.h @@ -34,7 +34,7 @@ class HwBasePortFb303Stats { return portName_; } - void portNameChanged(const std::string& newName) { + virtual void portNameChanged(const std::string& newName) { auto oldPortName = portName_; portName_ = newName; reinitStats(oldPortName); diff --git a/fboss/agent/hw/HwPortFb303Stats.h b/fboss/agent/hw/HwPortFb303Stats.h index 38e9722367396..4e2c00966d535 100644 --- a/fboss/agent/hw/HwPortFb303Stats.h +++ b/fboss/agent/hw/HwPortFb303Stats.h @@ -27,6 +27,7 @@ class HwPortFb303Stats : public HwBasePortFb303Stats { const std::string& portName, QueueId2Name queueId2Name = {}) : HwBasePortFb303Stats(portName, queueId2Name) { + portStats_.portName_() = portName; reinitStats(std::nullopt); } @@ -35,6 +36,11 @@ class HwPortFb303Stats : public HwBasePortFb303Stats { const HwPortStats& latestStats, const std::chrono::seconds& retrievedAt); + virtual void portNameChanged(const std::string& newName) override { + portStats_.portName_() = newName; + HwBasePortFb303Stats::portNameChanged(newName); + } + const HwPortStats& portStats() const { return portStats_; } diff --git a/fboss/agent/hw/HwSysPortFb303Stats.h b/fboss/agent/hw/HwSysPortFb303Stats.h index f8b4b0fac75b3..0b70869db8475 100644 --- a/fboss/agent/hw/HwSysPortFb303Stats.h +++ b/fboss/agent/hw/HwSysPortFb303Stats.h @@ -27,6 +27,7 @@ class HwSysPortFb303Stats : public HwBasePortFb303Stats { const std::string& portName, QueueId2Name queueId2Name = {}) : HwBasePortFb303Stats(portName, queueId2Name) { + portStats_.portName_() = portName; reinitStats(std::nullopt); } @@ -35,6 +36,11 @@ class HwSysPortFb303Stats : public HwBasePortFb303Stats { const HwSysPortStats& latestStats, const std::chrono::seconds& retrievedAt); + virtual void portNameChanged(const std::string& newName) override { + portStats_.portName_() = newName; + HwBasePortFb303Stats::portNameChanged(newName); + } + const HwSysPortStats& portStats() const { return portStats_; } diff --git a/fboss/agent/hw/test/HwPortFb303StatsTests.cpp b/fboss/agent/hw/test/HwPortFb303StatsTests.cpp index d57f44c6c54e5..3c6786dc5f3b1 100644 --- a/fboss/agent/hw/test/HwPortFb303StatsTests.cpp +++ b/fboss/agent/hw/test/HwPortFb303StatsTests.cpp @@ -317,6 +317,14 @@ TEST(HwPortFb303Stats, UpdateStats) { verifyUpdatedStats(portStats); } +TEST(HwPortFb303StatsTest, PortName) { + constexpr auto kNewPortName = "eth1/2/1"; + HwPortFb303Stats stats(kPortName, kQueue2Name); + EXPECT_EQ(*stats.portStats().portName_(), kPortName); + stats.portNameChanged(kNewPortName); + EXPECT_EQ(*stats.portStats().portName_(), kNewPortName); +} + TEST(HwPortFb303StatsTest, RenameQueue) { HwPortFb303Stats stats(kPortName, kQueue2Name); stats.queueChanged(1, "platinum"); diff --git a/fboss/agent/hw/test/HwSysPortFb303StatsTests.cpp b/fboss/agent/hw/test/HwSysPortFb303StatsTests.cpp index 5282d67f09e5e..5691d1349e49c 100644 --- a/fboss/agent/hw/test/HwSysPortFb303StatsTests.cpp +++ b/fboss/agent/hw/test/HwSysPortFb303StatsTests.cpp @@ -116,6 +116,14 @@ TEST(HwSysPortFb303Stats, UpdateStats) { verifyUpdatedStats(portStats); } +TEST(HwSysPortFb303StatsTest, PortName) { + constexpr auto kNewPortName = "eth1/2/1"; + HwSysPortFb303Stats stats(kPortName, kQueue2Name); + EXPECT_EQ(*stats.portStats().portName_(), kPortName); + stats.portNameChanged(kNewPortName); + EXPECT_EQ(*stats.portStats().portName_(), kNewPortName); +} + TEST(HwSysPortFb303StatsTest, RenameQueue) { HwSysPortFb303Stats stats(kPortName, kQueue2Name); stats.queueChanged(1, "platinum"); From 33aa8ae02e6efe31dbeffe784da55f604a7078bf Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Wed, 8 Feb 2023 09:46:20 -0800 Subject: [PATCH 204/280] add ttl/counter qualifiers for sdk 1.58.0/1.60.0 Summary: As titled, add ttl/counter qualifiers and actions for SDK 1.58.0 and 1.60.0. For Tajo, the first ACL table qualifier acts as the super set since it defines the key profile. For all ACL group tests, include TTL and Counter for SDK 1.58.0 and 1.60.0 so that subsequent tables can be created with TTL qualifier only. Differential Revision: D43103366 fbshipit-source-id: 3647750f9d4ebad842e650f4b67cfd06acf4b2b8 --- .../hw/sai/hw_test/SaiAclTableGroupTests.cpp | 14 +++++++----- .../HwTestDscpMarkingUtils.cpp | 22 ++++++++++++------- .../HwTestQueuePerHostUtils.cpp | 16 ++++++++++---- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/fboss/agent/hw/sai/hw_test/SaiAclTableGroupTests.cpp b/fboss/agent/hw/sai/hw_test/SaiAclTableGroupTests.cpp index fb8b593ef37ac..8a738b5cb1289 100644 --- a/fboss/agent/hw/sai/hw_test/SaiAclTableGroupTests.cpp +++ b/fboss/agent/hw/sai/hw_test/SaiAclTableGroupTests.cpp @@ -59,13 +59,17 @@ class SaiAclTableGroupTest : public HwTest { } void addAclTable1(cfg::SwitchConfig& cfg) { + std::vector qualifiers = { + cfg::AclTableQualifier::DSCP}; + std::vector actions = { + cfg::AclTableActionType::PACKET_ACTION}; +#if defined(TAJO_SDK_VERSION_1_58_0) || defined(TAJO_SDK_VERSION_1_60_0) + qualifiers.push_back(cfg::AclTableQualifier::TTL); + actions.push_back(cfg::AclTableActionType::COUNTER); +#endif // table1 with dscp matcher ACL entry utility::addAclTable( - &cfg, - kAclTable1(), - 1 /* priority */, - {cfg::AclTableActionType::PACKET_ACTION}, - {cfg::AclTableQualifier::DSCP}); + &cfg, kAclTable1(), 1 /* priority */, actions, qualifiers); } void addAclTable2(cfg::SwitchConfig& cfg) { diff --git a/fboss/agent/hw/test/dataplane_tests/HwTestDscpMarkingUtils.cpp b/fboss/agent/hw/test/dataplane_tests/HwTestDscpMarkingUtils.cpp index 6b32d10c18c27..223f8c1263f20 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwTestDscpMarkingUtils.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwTestDscpMarkingUtils.cpp @@ -160,6 +160,18 @@ void addDscpAclEntryWithCounter( // Utility to add ICP Marking ACL table to a multi acl table group void addDscpAclTable(cfg::SwitchConfig* config, int16_t priority) { + std::vector qualifiers = { + cfg::AclTableQualifier::L4_SRC_PORT, + cfg::AclTableQualifier::L4_DST_PORT, + cfg::AclTableQualifier::IP_PROTOCOL, + cfg::AclTableQualifier::ICMPV4_TYPE, + cfg::AclTableQualifier::ICMPV4_CODE, + cfg::AclTableQualifier::ICMPV6_TYPE, + cfg::AclTableQualifier::ICMPV6_CODE, + cfg::AclTableQualifier::DSCP}; +#if defined(TAJO_SDK_VERSION_1_58_0) || defined(TAJO_SDK_VERSION_1_60_0) + qualifiers.push_back(cfg::AclTableQualifier::TTL); +#endif utility::addAclTable( config, getDscpAclTableName(), @@ -168,14 +180,8 @@ void addDscpAclTable(cfg::SwitchConfig* config, int16_t priority) { cfg::AclTableActionType::COUNTER, cfg::AclTableActionType::SET_TC, cfg::AclTableActionType::SET_DSCP}, - {cfg::AclTableQualifier::L4_SRC_PORT, - cfg::AclTableQualifier::L4_DST_PORT, - cfg::AclTableQualifier::IP_PROTOCOL, - cfg::AclTableQualifier::ICMPV4_TYPE, - cfg::AclTableQualifier::ICMPV4_CODE, - cfg::AclTableQualifier::ICMPV6_TYPE, - cfg::AclTableQualifier::ICMPV6_CODE, - cfg::AclTableQualifier::DSCP}); + qualifiers); + addDscpAclEntryWithCounter(config, getDscpAclTableName()); } } // namespace facebook::fboss::utility diff --git a/fboss/agent/hw/test/dataplane_tests/HwTestQueuePerHostUtils.cpp b/fboss/agent/hw/test/dataplane_tests/HwTestQueuePerHostUtils.cpp index 1522db3bd7c0d..f3e46f8121aae 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwTestQueuePerHostUtils.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwTestQueuePerHostUtils.cpp @@ -275,14 +275,22 @@ void addQueuePerHostAclEntry( // Utility to add {L2, neighbor, route}-Acl Table to Multi Acl table group void addQueuePerHostAclTables(cfg::SwitchConfig* config, int16_t priority) { + std::vector qualifiers = { + cfg::AclTableQualifier::LOOKUP_CLASS_L2, + cfg::AclTableQualifier::LOOKUP_CLASS_NEIGHBOR, + cfg::AclTableQualifier::LOOKUP_CLASS_ROUTE}; + std::vector actions = { + cfg::AclTableActionType::PACKET_ACTION, cfg::AclTableActionType::SET_TC}; +#if defined(TAJO_SDK_VERSION_1_58_0) || defined(TAJO_SDK_VERSION_1_60_0) + qualifiers.push_back(cfg::AclTableQualifier::TTL); + actions.push_back(cfg::AclTableActionType::COUNTER); +#endif utility::addAclTable( config, getQueuePerHostAclTableName(), priority, // priority - {cfg::AclTableActionType::PACKET_ACTION, cfg::AclTableActionType::SET_TC}, - {cfg::AclTableQualifier::LOOKUP_CLASS_L2, - cfg::AclTableQualifier::LOOKUP_CLASS_NEIGHBOR, - cfg::AclTableQualifier::LOOKUP_CLASS_ROUTE}); + actions, + qualifiers); addQueuePerHostAclEntry(config, getQueuePerHostAclTableName()); } From 45d0ac4b554a4befd2a3e8ab470ef0463dc0a24a Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Wed, 8 Feb 2023 09:46:20 -0800 Subject: [PATCH 205/280] fix oss pcs rx link status cast Summary: As titled, fix oss pcs rx link status cast Reviewed By: harshitgulati18 Differential Revision: D43110947 fbshipit-source-id: 0848ec96672a7cca851ba29c32b05f68db6c42a4 --- fboss/agent/hw/sai/fake/FakeSaiPort.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fboss/agent/hw/sai/fake/FakeSaiPort.cpp b/fboss/agent/hw/sai/fake/FakeSaiPort.cpp index 928bdb8d60dd6..1d6b972542641 100644 --- a/fboss/agent/hw/sai/fake/FakeSaiPort.cpp +++ b/fboss/agent/hw/sai/fake/FakeSaiPort.cpp @@ -524,8 +524,8 @@ sai_status_t set_port_attribute_fn( } } break; case SAI_PORT_ATTR_PCS_RX_LINK_STATUS: { - port.portPcsLinkStatus = static_cast( - attr->value.latchstatus); + port.portPcsLinkStatus = + static_cast(attr->value.latchstatus); } break; #endif case SAI_PORT_ATTR_ERR_STATUS_LIST: { From 0b042a5c9c5e0b2679e56b27c027f66ac9f325a8 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 8 Feb 2023 10:35:33 -0800 Subject: [PATCH 206/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/0573178bb142c595b2faaf0b41ce5d3aec98b1e3 https://github.com/facebook/fbthrift/commit/13a10b0c8a7626e54e21d4586496708cb9355d31 Reviewed By: yns88 fbshipit-source-id: 6f078df22d41b2fbd12778ecdb62f0ca68cf2671 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 611e5c885ed54..4506fe97de813 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 92a39e93454dd2799e4288c7e11b9b069cb6660b +Subproject commit 13a10b0c8a7626e54e21d4586496708cb9355d31 From 3dfc8bd4ae1b93e827a068b2cc7652846ccf61ee Mon Sep 17 00:00:00 2001 From: Marco Kawajiri Date: Wed, 8 Feb 2023 10:41:05 -0800 Subject: [PATCH 207/280] Support ModbusDeviceType.ORV3_BBU Summary: Newer wedge400 versions introduced `ORV3_BBU` objects but there was no corresponding struct on `rackmonsvc.thrift` causing this exception in Central Proxy: ``` [2023-02-07 13:19:42,144] ERROR: Error while trying to GET https://rsw045-oob.p058.f01.nha2.tfbnw.net:8443/api/sys/modbus/registers: KeyError('ORV3_BBU') (restapi.py:479) Traceback (most recent call last): File "thrift.py3/types.pyx", line 635, in thrift.py3.types.EnumMeta.__getitem__ File "rackmonsvc/types.pyx", line 191, in rackmonsvc.types.__ModbusDeviceTypeMeta.__getattribute__ File "thrift.py3/types.pyx", line 510, in thrift.py3.types.EnumData.get_by_name AttributeError: 'ModbusDeviceType' has no attribute 'ORV3_BBU' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "openbmc/lib/restapi.py", line 460, in get_rackdata_orv3 ] = rackmonsvc.types.ModbusDeviceType[ File "thrift.py3/types.pyx", line 637, in thrift.py3.types.EnumMeta.__getitem__ KeyError: 'ORV3_BBU' ``` Still working on unit tests and issue tasker coverage, will try landing this early to recover visibility on those devices. Reviewed By: cjcon90 Differential Revision: D43120917 fbshipit-source-id: 2adb391f999d6d0282d4416721cb911913da2548 --- fboss/platform/rackmon/if/rackmonsvc.thrift | 1 + 1 file changed, 1 insertion(+) diff --git a/fboss/platform/rackmon/if/rackmonsvc.thrift b/fboss/platform/rackmon/if/rackmonsvc.thrift index 8773f108f695b..66809bff4ff09 100644 --- a/fboss/platform/rackmon/if/rackmonsvc.thrift +++ b/fboss/platform/rackmon/if/rackmonsvc.thrift @@ -36,6 +36,7 @@ enum ModbusDeviceType { ORV2_PSU = 0, ORV3_PSU = 1, ORV3_RPU = 2, + ORV3_BBU = 3, } /* From 3e0708191a7507f90a8a4d749a99310022031c2e Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 8 Feb 2023 13:27:36 -0800 Subject: [PATCH 208/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/b704064b3ab24bd4056dace71020c51dc212a635 https://github.com/facebook/rocksdb/commit/77b61abc7b644c7519093c7b51bc20896945015e https://github.com/facebookincubator/velox/commit/f54056df095c60ef7765b425d1682615c1054ba8 Reviewed By: yns88 fbshipit-source-id: 5e4e84e533e44aeb952abdcaaaacf693d9bbd7ac --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 4506fe97de813..aaf9196d978cc 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 13a10b0c8a7626e54e21d4586496708cb9355d31 +Subproject commit b704064b3ab24bd4056dace71020c51dc212a635 From 7a6cb5c81a43104cd5483aa3963d7b99dafc3b1b Mon Sep 17 00:00:00 2001 From: Rohit Puri Date: Wed, 8 Feb 2023 14:58:25 -0800 Subject: [PATCH 209/280] Thrift change to add neighbor reachability map. Summary: Idea is to deprecate lldp struct and use this more generic one in future. But for now, create a new one and use for DSF only. Continue to use the same "switch_config.LLDPTag" instead of inventing new enum for storing remote . Reviewed By: jasmeetbagga Differential Revision: D43075711 Privacy Context Container: L1125642 fbshipit-source-id: a594128b24563668a2841a68b3c8910eec2e4cc5 --- fboss/agent/switch_config.thrift | 12 ++++++++++++ fboss/agent/switch_state.thrift | 1 + 2 files changed, 13 insertions(+) diff --git a/fboss/agent/switch_config.thrift b/fboss/agent/switch_config.thrift index 0c772be8d79c8..9ce25c0ce58c6 100644 --- a/fboss/agent/switch_config.thrift +++ b/fboss/agent/switch_config.thrift @@ -849,6 +849,12 @@ enum PortType { CPU_PORT = 2, RECYCLE_PORT = 3, } + +struct PortNeighbor { + 1: string remoteSystem; + 2: string remotePort; +} + /** * Configuration for a single logical port */ @@ -995,6 +1001,12 @@ struct Port { * Port type to convey type for this port */ 27: PortType portType = PortType.INTERFACE_PORT; + + /* + * List of neighbors reachable over this link + * includes information on remote system and ports + */ + 28: list expectedNeighborReachability = []; } enum LacpPortRate { diff --git a/fboss/agent/switch_state.thrift b/fboss/agent/switch_state.thrift index 38f77edc0d6fb..5a879e2967465 100644 --- a/fboss/agent/switch_state.thrift +++ b/fboss/agent/switch_state.thrift @@ -133,6 +133,7 @@ struct PortFields { // - interfaceIDs contains single element viz. the interface corresponding // to this port. 41: list interfaceIDs; + 42: list expectedNeighborReachability; } struct SystemPortFields { From 50b8e71949fc848b95987c7a94e02b048b12ab63 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Wed, 8 Feb 2023 15:31:28 -0800 Subject: [PATCH 210/280] Remove dependency of external/py on fboss/agent:error Reviewed By: jasmeetbagga Differential Revision: D43098568 fbshipit-source-id: b86dd16c776bf1d7bb1e70398e507f9588ed2455 --- fboss/lib/config/PlatformConfigUtils.h | 1 - fboss/lib/phy/ExternalPhyPortStatsUtils.cpp | 1 + fboss/lib/phy/ExternalPhyPortStatsUtils.h | 1 - fboss/lib/phy/PhyManager.h | 1 + fboss/qsfp_service/TransceiverManager.cpp | 5 ++++- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fboss/lib/config/PlatformConfigUtils.h b/fboss/lib/config/PlatformConfigUtils.h index 90a42ae0625a3..a870232c515f8 100644 --- a/fboss/lib/config/PlatformConfigUtils.h +++ b/fboss/lib/config/PlatformConfigUtils.h @@ -9,7 +9,6 @@ */ #pragma once -#include "fboss/agent/Platform.h" #include "fboss/agent/gen-cpp2/platform_config_types.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/types.h" diff --git a/fboss/lib/phy/ExternalPhyPortStatsUtils.cpp b/fboss/lib/phy/ExternalPhyPortStatsUtils.cpp index 2bf9b70750e15..a292578bd4d6b 100644 --- a/fboss/lib/phy/ExternalPhyPortStatsUtils.cpp +++ b/fboss/lib/phy/ExternalPhyPortStatsUtils.cpp @@ -10,6 +10,7 @@ #include "fboss/lib/phy/ExternalPhyPortStatsUtils.h" #include +#include #include diff --git a/fboss/lib/phy/ExternalPhyPortStatsUtils.h b/fboss/lib/phy/ExternalPhyPortStatsUtils.h index c95b5583dfdb0..465bece9bdfa9 100644 --- a/fboss/lib/phy/ExternalPhyPortStatsUtils.h +++ b/fboss/lib/phy/ExternalPhyPortStatsUtils.h @@ -10,7 +10,6 @@ #pragma once #include "common/stats/MonotonicCounter.h" -#include "fboss/agent/if/gen-cpp2/FbossCtrl.h" #include "fboss/lib/phy/ExternalPhy.h" #include diff --git a/fboss/lib/phy/PhyManager.h b/fboss/lib/phy/PhyManager.h index 979decc70449d..3ce849237ebfd 100644 --- a/fboss/lib/phy/PhyManager.h +++ b/fboss/lib/phy/PhyManager.h @@ -5,6 +5,7 @@ #include "fboss/agent/FbossError.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/hw/gen-cpp2/hardware_stats_types.h" +#include "fboss/agent/if/gen-cpp2/ctrl_types.h" #include "fboss/agent/types.h" #include "fboss/lib/phy/ExternalPhy.h" #include "fboss/lib/phy/ExternalPhyPortStatsUtils.h" diff --git a/fboss/qsfp_service/TransceiverManager.cpp b/fboss/qsfp_service/TransceiverManager.cpp index 6dea8c5954112..cf5bf2ea2271d 100644 --- a/fboss/qsfp_service/TransceiverManager.cpp +++ b/fboss/qsfp_service/TransceiverManager.cpp @@ -1,6 +1,10 @@ // Copyright 2021-present Facebook. All Rights Reserved. #include "fboss/qsfp_service/TransceiverManager.h" +#include +#include +#include + #include "fboss/agent/AgentConfig.h" #include "fboss/agent/FbossError.h" #include "fboss/agent/Utils.h" @@ -13,7 +17,6 @@ #include "fboss/lib/thrift_service_client/ThriftServiceClient.h" #include "fboss/qsfp_service/TransceiverStateMachineUpdate.h" #include "fboss/qsfp_service/if/gen-cpp2/transceiver_types.h" -#include "folly/DynamicConverter.h" using namespace std::chrono; From cf17319b8aeec7300c62574359138eb6b1d22bf3 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Wed, 8 Feb 2023 15:31:28 -0800 Subject: [PATCH 211/280] Remove dependency from agent/rib on fboss/agent:error Reviewed By: jasmeetbagga Differential Revision: D43098567 fbshipit-source-id: c2d839e676a4fd50d2aa6ea91632e1938177ee61 --- fboss/agent/rib/ConfigApplier.cpp | 1 - fboss/agent/rib/RoutingInformationBase.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/fboss/agent/rib/ConfigApplier.cpp b/fboss/agent/rib/ConfigApplier.cpp index 91adb51347f0f..552f342e2d2b2 100644 --- a/fboss/agent/rib/ConfigApplier.cpp +++ b/fboss/agent/rib/ConfigApplier.cpp @@ -9,7 +9,6 @@ */ #include "fboss/agent/rib/ConfigApplier.h" -#include "fboss/agent/rib/ForwardingInformationBaseUpdater.h" #include "fboss/agent/rib/RouteUpdater.h" #include "fboss/agent/rib/RoutingInformationBase.h" diff --git a/fboss/agent/rib/RoutingInformationBase.cpp b/fboss/agent/rib/RoutingInformationBase.cpp index dfd8a0021ba1d..0e3947591bd1d 100644 --- a/fboss/agent/rib/RoutingInformationBase.cpp +++ b/fboss/agent/rib/RoutingInformationBase.cpp @@ -16,7 +16,6 @@ #include "fboss/agent/Utils.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/rib/ConfigApplier.h" -#include "fboss/agent/rib/ForwardingInformationBaseUpdater.h" #include "fboss/agent/rib/NetworkToRouteMap.h" #include "fboss/agent/state/ForwardingInformationBase.h" #include "fboss/agent/state/ForwardingInformationBaseContainer.h" From bfa59992036b2a7839d6eb82041a171136f277a5 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 8 Feb 2023 17:07:31 -0800 Subject: [PATCH 212/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/wangle/commit/8d7bdc4180a1962df6e40fe0c0a6424dad1b85dc Reviewed By: yns88 fbshipit-source-id: 8c8cb7b524305ee99eda6e7eb443ba4293cb2329 --- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 51e329f5d7fdf..32ffcd82e1aea 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 29250e77353a128f76fc2ba228fe1c95f03ab161 +Subproject commit 8d7bdc4180a1962df6e40fe0c0a6424dad1b85dc From bcee52a809360711c93fda30b704c9b003270b12 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 8 Feb 2023 20:09:06 -0800 Subject: [PATCH 213/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fb303/commit/58456f78d21d7ac9b42a131d48138d42331f6444 https://github.com/facebook/folly/commit/b9af1a661fcca3af8dae958b8012605e96e57ca1 Reviewed By: yns88 fbshipit-source-id: f6b673f58ddbe932506cf2d8f81a63511287bc8b --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index aaf9196d978cc..48d42de0f0fa6 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit b704064b3ab24bd4056dace71020c51dc212a635 +Subproject commit 99c4683a5a7b7efa240ab3dded78daefb470c106 diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index 8ea670c90b915..a587a851a17d5 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit c6c274f1450b05f66c707e871e7457f4d5ac7181 +Subproject commit b9af1a661fcca3af8dae958b8012605e96e57ca1 From caa8a6ae006fb6dca68c4c8912bc97e250f3317b Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Wed, 8 Feb 2023 20:11:29 -0800 Subject: [PATCH 214/280] Remove :recursive_glob_headers dependency from :core Reviewed By: jasmeetbagga Differential Revision: D43125457 fbshipit-source-id: 42564384fb5987d31520af6192a1b6affa6726dd --- fboss/agent/Main.cpp | 2 +- fboss/agent/SwSwitch.cpp | 1 - fboss/agent/test/SwSwitchTest.cpp | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/fboss/agent/Main.cpp b/fboss/agent/Main.cpp index 8a268d6cee403..6197053ea9349 100644 --- a/fboss/agent/Main.cpp +++ b/fboss/agent/Main.cpp @@ -22,7 +22,7 @@ #include "fboss/agent/AgentConfig.h" #include "fboss/agent/AlpmUtils.h" #include "fboss/agent/ApplyThriftConfig.h" -#include "fboss/agent/FbossInit.h" // @manual +#include "fboss/agent/FbossInit.h" #include "fboss/agent/HwSwitch.h" #include "fboss/agent/Platform.h" #include "fboss/agent/RestartTimeTracker.h" diff --git a/fboss/agent/SwSwitch.cpp b/fboss/agent/SwSwitch.cpp index 5afdc70c6de22..d835359ed31f5 100644 --- a/fboss/agent/SwSwitch.cpp +++ b/fboss/agent/SwSwitch.cpp @@ -54,7 +54,6 @@ #include "fboss/agent/SwSwitchRouteUpdateWrapper.h" #include "fboss/agent/SwitchStats.h" #include "fboss/agent/TeFlowNexthopHandler.h" -#include "fboss/agent/ThriftHandler.h" #include "fboss/agent/TunManager.h" #include "fboss/agent/TxPacket.h" #include "fboss/agent/Utils.h" diff --git a/fboss/agent/test/SwSwitchTest.cpp b/fboss/agent/test/SwSwitchTest.cpp index 1086a3196b02b..2db9707b6e99b 100644 --- a/fboss/agent/test/SwSwitchTest.cpp +++ b/fboss/agent/test/SwSwitchTest.cpp @@ -12,7 +12,6 @@ #include "fboss/agent/ArpHandler.h" #include "fboss/agent/FbossHwUpdateError.h" -#include "fboss/agent/Main.h" #include "fboss/agent/NeighborUpdater.h" #include "fboss/agent/PortStats.h" #include "fboss/agent/SwitchStats.h" From acf60d110bfed394a29b2355341797d12d3ba64b Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Wed, 8 Feb 2023 20:11:29 -0800 Subject: [PATCH 215/280] Rename NeighborUpdater.def to NeighborUpdater-defs.h Reviewed By: jasmeetbagga Differential Revision: D43125455 fbshipit-source-id: 020a52cc344226d4e7229103cdb8e8cb736c473c --- .../{NeighborUpdater.def => NeighborUpdater-defs.h} | 10 ++++++---- fboss/agent/NeighborUpdater.h | 4 ++-- fboss/agent/NeighborUpdaterImpl.h | 4 ++-- fboss/agent/NeighborUpdaterNoopImpl.h | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) rename fboss/agent/{NeighborUpdater.def => NeighborUpdater-defs.h} (94%) diff --git a/fboss/agent/NeighborUpdater.def b/fboss/agent/NeighborUpdater-defs.h similarity index 94% rename from fboss/agent/NeighborUpdater.def rename to fboss/agent/NeighborUpdater-defs.h index 936ea954492d7..e91f2a9997509 100644 --- a/fboss/agent/NeighborUpdater.def +++ b/fboss/agent/NeighborUpdater-defs.h @@ -1,9 +1,9 @@ /* * This file is used to generate class interfaces and implementations for - * `NeighborUpdater`, `NeighborUpdaterImpl` and `NeighborUpdaterNoopImpl`. Having the definition in a - * centralized place ensures that these classes are in sync and agree on the - * argument types being used. - * This file defines a couple of utility macros, followed by multiple calls to + * `NeighborUpdater`, `NeighborUpdaterImpl` and `NeighborUpdaterNoopImpl`. + * Having the definition in a centralized place ensures that these classes are + * in sync and agree on the argument types being used. This file defines a + * couple of utility macros, followed by multiple calls to * `NEIGHBOR_UPDATER_METHOD()`. This macro is *not* defined in this file; it's * the job of the caller to define a `NEIGHBOR_UPDATER_METHOD()` first, and * *then* include this file. @@ -12,6 +12,8 @@ * this technique. */ +// clang-format off + #define GET_MACRO(_IGNORED,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,NAME,...) NAME #define ARG_LIST_0(ARG_LIST_ENTRY_CB) diff --git a/fboss/agent/NeighborUpdater.h b/fboss/agent/NeighborUpdater.h index 9bc1bf3550acd..ed09ef21f4f2f 100644 --- a/fboss/agent/NeighborUpdater.h +++ b/fboss/agent/NeighborUpdater.h @@ -60,7 +60,7 @@ class NeighborUpdater : public StateObserver { void stateUpdated(const StateDelta& delta) override; - // Zero-cost forwarders. See comment in NeighborUpdater.def. + // Zero-cost forwarders. See comment in NeighborUpdater-defs.h. #define ARG_TEMPLATE_PARAMETER(TYPE, NAME) typename T_##NAME #define ARG_RVALUE_REF_TYPE(TYPE, NAME) T_##NAME&& NAME #define ARG_FORWARDER(TYPE, NAME) std::forward(NAME) @@ -86,7 +86,7 @@ class NeighborUpdater : public StateObserver { return std::visit([&](auto&& arg) { return arg.NAME(); }, *impl); \ }); \ } -#include "fboss/agent/NeighborUpdater.def" +#include "fboss/agent/NeighborUpdater-defs.h" #undef NEIGHBOR_UPDATER_METHOD public: diff --git a/fboss/agent/NeighborUpdaterImpl.h b/fboss/agent/NeighborUpdaterImpl.h index fc1a3b1d6dbbf..8596db5a78997 100644 --- a/fboss/agent/NeighborUpdaterImpl.h +++ b/fboss/agent/NeighborUpdaterImpl.h @@ -63,12 +63,12 @@ class NeighborUpdaterImpl { // because only NeighborUpdater should be using this class and that is marked // as a friend class anyway. // - // See comment in NeighborUpdater.def + // See comment in NeighborUpdater-defs.h private: #define ARG_LIST_ENTRY(TYPE, NAME) TYPE NAME #define NEIGHBOR_UPDATER_METHOD(VISIBILITY, NAME, RETURN_TYPE, ...) \ RETURN_TYPE NAME(ARG_LIST(ARG_LIST_ENTRY, ##__VA_ARGS__)); -#include "fboss/agent/NeighborUpdater.def" +#include "fboss/agent/NeighborUpdater-defs.h" #undef NEIGHBOR_UPDATER_METHOD std::shared_ptr createCaches( diff --git a/fboss/agent/NeighborUpdaterNoopImpl.h b/fboss/agent/NeighborUpdaterNoopImpl.h index d7e89d0acb040..56c14690749c9 100644 --- a/fboss/agent/NeighborUpdaterNoopImpl.h +++ b/fboss/agent/NeighborUpdaterNoopImpl.h @@ -36,7 +36,7 @@ class NeighborUpdaterNoopImpl { #define ARG_LIST_ENTRY(TYPE, NAME) TYPE NAME #define NEIGHBOR_UPDATER_METHOD(VISIBILITY, NAME, RETURN_TYPE, ...) \ RETURN_TYPE NAME(ARG_LIST(ARG_LIST_ENTRY, ##__VA_ARGS__)); -#include "fboss/agent/NeighborUpdater.def" +#include "fboss/agent/NeighborUpdater-defs.h" #undef NEIGHBOR_UPDATER_METHOD void portChanged( From 27c66e62d5303b4e215b943896b2411d23c188e7 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 8 Feb 2023 20:55:07 -0800 Subject: [PATCH 216/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/proxygen/commit/5c50ba2294c7de876473f224194adf9161d08b46 https://github.com/facebook/rocksdb/commit/34bb3ddc43b592e3da663d0d31c062522efe1c58 https://github.com/facebook/wangle/commit/240d0350bf9c29075f444147d06be6176b6d15c0 https://github.com/facebookexperimental/edencommon/commit/ffb92f259fe2eff4366dbaed49a9756ae1f535c5 https://github.com/facebookincubator/fizz/commit/abeaf53457ce30b427fd2776a869ba2e5d5eb3fc https://github.com/facebookincubator/katran/commit/0bd293a15d81d0804ebd321b3dbddc1edab722c5 https://github.com/facebookincubator/mvfst/commit/eda044bebe6e9fc2491c21e8f5898b5e32a4f15f https://github.com/facebookincubator/velox/commit/731831c72d4932c7ae8e8c8e69a17248738b72d7 https://github.com/facebookresearch/vrs/commit/869a0927245c5f2e01db58c78368cb1dd188eb9f Reviewed By: yns88 fbshipit-source-id: 31aaedac9dbc4e504c6a56697d4e678ed1303e52 --- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 32ffcd82e1aea..fcf43bd14c762 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 8d7bdc4180a1962df6e40fe0c0a6424dad1b85dc +Subproject commit 240d0350bf9c29075f444147d06be6176b6d15c0 From 8ee7702517b97ea55d14039bbb2c9715c999807a Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Wed, 8 Feb 2023 21:09:17 -0800 Subject: [PATCH 217/280] Back out "IPv6Handler: Handle optional vlan in sendICMPv6*" Summary: Original commit changeset: 647053cdabae Original Phabricator Diff: D42714169 daiwei1983 observed that getInterfaceIDForPort's CHECK(port) seems crashing agent when receiving an ipv6 packet with src_port=0. For example, I canary latest trunk codes on rsw001.p001.f03.snc1 and got agent crash at P617443389. Will debug and fix this, in the meanwhile, reverting the diff. Reviewed By: daiwei1983 Differential Revision: D43138602 Privacy Context Container: L1125642 fbshipit-source-id: 7443d3da8c0a09fd7ded525ad1a0764a364cc3db --- fboss/agent/IPv6Handler.cpp | 30 +++++++++--------------------- fboss/agent/IPv6Handler.h | 4 ++-- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/fboss/agent/IPv6Handler.cpp b/fboss/agent/IPv6Handler.cpp index e4f43315ad915..18762a92e8268 100644 --- a/fboss/agent/IPv6Handler.cpp +++ b/fboss/agent/IPv6Handler.cpp @@ -134,16 +134,12 @@ void IPv6Handler::handlePacket( MacAddress dst, MacAddress src, Cursor cursor) { - auto vlanID = pkt->getSrcVlanIf(); - auto vlanIDStr = vlanID.has_value() - ? folly::to(static_cast(vlanID.value())) - : "None"; const uint32_t l3Len = pkt->getLength() - (cursor - Cursor(pkt->buf())); IPv6Hdr ipv6(cursor); // note: advances our cursor object XLOG(DBG4) << "IPv6 (" << l3Len << " bytes)" " port: " - << pkt->getSrcPort() << " vlan: " << vlanIDStr + << pkt->getSrcPort() << " vlan: " << pkt->getSrcVlan() << " src: " << ipv6.srcAddr.str() << " (" << src << ")" << " dst: " << ipv6.dstAddr.str() << " (" << dst << ")" << " nextHeader: " << static_cast(ipv6.nextHeader); @@ -192,13 +188,11 @@ void IPv6Handler::handlePacket( // Forward multicast packet directly to corresponding host interface // and let Linux handle it. In software we consume ICMPv6 Multicast // packets for function of NDP protocol, rest all are forwarded to host. - auto intfID = sw_->getInterfaceIDForPort(port); - intf = state->getInterfaces()->getInterfaceIf(intfID); + intf = interfaceMap->getInterfaceInVlanIf(pkt->getSrcVlan()); } else if (ipv6.dstAddr.isLinkLocal()) { // Forward link-local packet directly to corresponding host interface // provided desAddr is assigned to that interface. - auto intfID = sw_->getInterfaceIDForPort(port); - intf = state->getInterfaces()->getInterfaceIf(intfID); + intf = interfaceMap->getInterfaceInVlanIf(pkt->getSrcVlan()); if (intf && !(intf->hasAddress(ipv6.dstAddr))) { intf = nullptr; } @@ -217,7 +211,8 @@ void IPv6Handler::handlePacket( sw_->portStats(port)->ipv6HopExceeded(); // Look up cpu mac from platform MacAddress cpuMac = sw_->getPlatform()->getLocalMac(); - sendICMPv6TimeExceeded(port, vlanID, cpuMac, cpuMac, ipv6, cursor); + sendICMPv6TimeExceeded( + port, pkt->getSrcVlan(), cpuMac, cpuMac, ipv6, cursor); return; } @@ -556,7 +551,7 @@ void IPv6Handler::handleNeighborAdvertisement( void IPv6Handler::sendICMPv6TimeExceeded( PortID srcPort, - std::optional srcVlan, + VlanID srcVlan, MacAddress dst, MacAddress src, IPv6Hdr& v6Hdr, @@ -601,12 +596,8 @@ void IPv6Handler::sendICMPv6TimeExceeded( ICMPv6Code::ICMPV6_CODE_TIME_EXCEEDED_HOPLIMIT_EXCEEDED, icmpPayloadLength, serializeBody); - - auto srcVlanStr = srcVlan.has_value() - ? folly::to(static_cast(srcVlan.value())) - : "None"; XLOG(DBG4) << "sending ICMPv6 Time Exceeded with srcMac " << src - << " dstMac: " << dst << " vlan: " << srcVlanStr + << " dstMac: " << dst << " vlan: " << srcVlan << " dstIp: " << v6Hdr.srcAddr.str() << " srcIP: " << srcIp.str() << " bodyLength: " << icmpPayloadLength; sw_->sendPacketSwitchedAsync(std::move(icmpPkt)); @@ -614,7 +605,7 @@ void IPv6Handler::sendICMPv6TimeExceeded( void IPv6Handler::sendICMPv6PacketTooBig( PortID srcPort, - std::optional srcVlan, + VlanID srcVlan, folly::MacAddress dst, folly::MacAddress src, IPv6Hdr& v6Hdr, @@ -653,11 +644,8 @@ void IPv6Handler::sendICMPv6PacketTooBig( bodyLength, serializeBody); - auto srcVlanStr = srcVlan.has_value() - ? folly::to(static_cast(srcVlan.value())) - : "None"; XLOG(DBG4) << "sending ICMPv6 Packet Too Big with srcMac " << src - << " dstMac: " << dst << " vlan: " << srcVlanStr + << " dstMac: " << dst << " vlan: " << srcVlan << " dstIp: " << v6Hdr.srcAddr.str() << " srcIP: " << srcIp.str() << " bodyLength: " << bodyLength; sw_->sendPacketSwitchedAsync(std::move(icmpPkt)); diff --git a/fboss/agent/IPv6Handler.h b/fboss/agent/IPv6Handler.h index 0466884a58b1a..40f8498df1e57 100644 --- a/fboss/agent/IPv6Handler.h +++ b/fboss/agent/IPv6Handler.h @@ -117,7 +117,7 @@ class IPv6Handler : public StateObserver { void sendICMPv6TimeExceeded( PortID srcPort, - std::optional srcVlan, + VlanID srcVlan, folly::MacAddress dst, folly::MacAddress src, IPv6Hdr& v6Hdr, @@ -125,7 +125,7 @@ class IPv6Handler : public StateObserver { void sendICMPv6PacketTooBig( PortID srcPort, - std::optional srcVlan, + VlanID srcVlan, folly::MacAddress dst, folly::MacAddress src, IPv6Hdr& v6Hdr, From cf94bf87ab3d3f0aacf6e98c153736e36f263e9d Mon Sep 17 00:00:00 2001 From: "Shrikrishna (Shri) Khare" Date: Wed, 8 Feb 2023 21:09:17 -0800 Subject: [PATCH 218/280] Back out "IPv6Handler: getSwitchIntfIPv6 instead of getSwitchVlanIPv6" Summary: Original commit changeset: bad8a8a4fbcb Original Phabricator Diff: D42699145 daiwei1983 observed that getInterfaceIDForPort's CHECK(port) seems crashing agent when receiving an ipv6 packet with src_port=0. For example, I canary latest trunk codes on rsw001.p001.f03.snc1 and got agent crash at P617443389. Will debug and fix this, in the meanwhile, reverting the diff. Reviewed By: daiwei1983 Differential Revision: D43142592 Privacy Context Container: L1125642 fbshipit-source-id: 093972534eb50e439acc3ed7ef21589cfaa33cdf --- fboss/agent/IPv6Handler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fboss/agent/IPv6Handler.cpp b/fboss/agent/IPv6Handler.cpp index 18762a92e8268..d40e51ba18265 100644 --- a/fboss/agent/IPv6Handler.cpp +++ b/fboss/agent/IPv6Handler.cpp @@ -580,7 +580,7 @@ void IPv6Handler::sendICMPv6TimeExceeded( IPAddressV6 srcIp; try { - srcIp = getSwitchIntfIPv6(state, sw_->getInterfaceIDForPort(srcPort)); + srcIp = getSwitchVlanIPv6(state, srcVlan); } catch (const std::exception& ex) { srcIp = getAnyIntfIPv6(state); } @@ -630,8 +630,7 @@ void IPv6Handler::sendICMPv6PacketTooBig( sendCursor->push(cursor, remainingLength); }; - IPAddressV6 srcIp = - getSwitchIntfIPv6(state, sw_->getInterfaceIDForPort(srcPort)); + IPAddressV6 srcIp = getSwitchVlanIPv6(state, srcVlan); auto icmpPkt = createICMPv6Pkt( sw_, dst, From 59fe8706341f60e61605a2bdc8f952c925632bc0 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 8 Feb 2023 21:46:18 -0800 Subject: [PATCH 219/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/dce7feb9811767baeff5dbf23fb42b962cae6d58 Reviewed By: yns88 fbshipit-source-id: 6e473a5fa0c40fbef42ad2e72b8ede7e544592ed --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 48d42de0f0fa6..e9ad7e6047fe2 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 99c4683a5a7b7efa240ab3dded78daefb470c106 +Subproject commit dce7feb9811767baeff5dbf23fb42b962cae6d58 From 401638f7bdb4cfc72c2e60375977c75ebaf9a825 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Wed, 8 Feb 2023 23:31:10 -0800 Subject: [PATCH 220/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/5259adb6a30c42bdf2968a07be5830f6448cec4b Reviewed By: yns88 fbshipit-source-id: 4b25241af0b782e5d2e7b65aa4a4b349c0a4317c --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index e9ad7e6047fe2..d4a3c0b4b727b 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit dce7feb9811767baeff5dbf23fb42b962cae6d58 +Subproject commit 5259adb6a30c42bdf2968a07be5830f6448cec4b From 902e200c24cf21073e1a6db607f531a52bbeb35e Mon Sep 17 00:00:00 2001 From: Siva Muthusamy Date: Thu, 9 Feb 2023 01:13:22 -0800 Subject: [PATCH 221/280] Update the stable commit hashes to latest Summary: Update the stable commit hashes to latest Differential Revision: D43148118 fbshipit-source-id: 147a83556591d9fd8fe3df9288e9366b0b9b3ac1 --- .../github_hashes_02082023_170731.tar.gz | Bin 0 -> 619 bytes fboss/stable_commits/latest_stable_hashes.tar.gz | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 fboss/stable_commits/github_hashes_02082023_170731.tar.gz diff --git a/fboss/stable_commits/github_hashes_02082023_170731.tar.gz b/fboss/stable_commits/github_hashes_02082023_170731.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4f040fd12bce780d1420148a4a8047791b4d465f GIT binary patch literal 619 zcmV-x0+jt9iwFP|TjXN^1MS&cjuJr_1z?`tg9$D`t?U0+t-}SFx(+BaJ%Pr{BqlD# zg<6b0m@s4-gfhYNJrL-S(B#yqs!ql2a+TlCE=n|P?d*Gd|LWzBZ@bUZn8)kC&7@Im zwcWkWgcO?fY;G@mTfb~KV_47U6TVm0o6Fx$Z}BnzT<$lQ8wAJaFSR1%-@_mI-z>+) zHojkk&7z!jG)&B&$QWY{xBQJX7WwyZF#j4-iNo;m3Rcz56e$M*n-*@4qwFt4dn5W#5pm zg;+U3fpU!6X~(JU4ag+){~Ao`|F~E$>v;MUaD4xzFogd1@WlGh!nC-e4pEty+XFe} zHWpesN+c_DQc?xdSpToWg#Hh!)z|L(f5Q6T#eV-2CB>#nV?`9U5+xQ~9LvJSay8k8 z#L`Lh{~A2s|Igv>W>x-X0yv@nR-*r1JhA`J9CI?#i6A|xT&WmQi%23+ODBgcqq7imajCL|NifBQHh|GIp5IB6L;e*SNd7>xP9hyD3qmMVSm z(M!uYTSra@7TU9}N~;of%K~eK^B({J00000000000000000000004mQegaw9Et3FH F006UyM1=qV literal 0 HcmV?d00001 diff --git a/fboss/stable_commits/latest_stable_hashes.tar.gz b/fboss/stable_commits/latest_stable_hashes.tar.gz index 3e71d0b030dd1..93c4196be60ca 120000 --- a/fboss/stable_commits/latest_stable_hashes.tar.gz +++ b/fboss/stable_commits/latest_stable_hashes.tar.gz @@ -1 +1 @@ -github_hashes_02032023_173642.tar.gz \ No newline at end of file +github_hashes_02082023_170731.tar.gz \ No newline at end of file From 0a58d381e3e48e91e265c0050609d023fd81c3e5 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 9 Feb 2023 01:15:06 -0800 Subject: [PATCH 222/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/988b674939bddd4fd2fda9c5d591e4e0f080b9fc Reviewed By: yns88 fbshipit-source-id: 7bf7d72b8ee2a21b86a6ac0950a0746810136931 --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index a587a851a17d5..b0607efdf3341 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit b9af1a661fcca3af8dae958b8012605e96e57ca1 +Subproject commit 988b674939bddd4fd2fda9c5d591e4e0f080b9fc From e0abc68a23e6e3f6b8f81a5908d8ea7cfbb2ce27 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 9 Feb 2023 02:04:23 -0800 Subject: [PATCH 223/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/ef8f370386bd1b899e0e99ee2c1f9faf96ef08ba https://github.com/facebook/proxygen/commit/e9d1495afd2bc6f69ff5fa1ea77cb539ad8dbcb8 Reviewed By: yns88 fbshipit-source-id: d882de6c6e158c37631020377ca18a43d9b1b473 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index d4a3c0b4b727b..d6f2d2d1c109f 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 5259adb6a30c42bdf2968a07be5830f6448cec4b +Subproject commit ef8f370386bd1b899e0e99ee2c1f9faf96ef08ba From 56610b7705a9bcf8d514c5f01d562daa9dd4b981 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 05:15:36 -0800 Subject: [PATCH 224/280] Add SaiPortDescriptor API on neighbor variant Summary: As titled. Will be used in subsequent diffs to match against ports down event port ids Reviewed By: phshaikh, nivinl Differential Revision: D43144945 fbshipit-source-id: 33d0729879facef08befa95cd844f9f0197b5d22 --- .../agent/hw/sai/switch/SaiNeighborManager.cpp | 4 +++- fboss/agent/hw/sai/switch/SaiNeighborManager.h | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/fboss/agent/hw/sai/switch/SaiNeighborManager.cpp b/fboss/agent/hw/sai/switch/SaiNeighborManager.cpp index 3191370b84d01..8c81418538c91 100644 --- a/fboss/agent/hw/sai/switch/SaiNeighborManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiNeighborManager.cpp @@ -267,7 +267,9 @@ PortRifNeighbor::PortRifNeighbor( std::optional metadata, std::optional encapIndex, bool isLocal) - : manager_(manager), handle_(std::make_unique()) { + : manager_(manager), + saiPortAndIntf_(saiPortAndIntf), + handle_(std::make_unique()) { const auto& ip = std::get(intfIDAndIpAndMac); auto rifSaiId = std::get(saiPortAndIntf); auto adapterHostKey = SaiNeighborTraits::NeighborEntry( diff --git a/fboss/agent/hw/sai/switch/SaiNeighborManager.h b/fboss/agent/hw/sai/switch/SaiNeighborManager.h index 734beeb0d723b..8589bfbc1dc6b 100644 --- a/fboss/agent/hw/sai/switch/SaiNeighborManager.h +++ b/fboss/agent/hw/sai/switch/SaiNeighborManager.h @@ -71,11 +71,11 @@ class ManagedVlanRifNeighbor : public SaiObjectEventAggregateSubscriber< std::string toString() const; - private: SaiPortDescriptor getSaiPortDesc() const { return std::get(saiPortAndIntf_); } + private: RouterInterfaceSaiId getRouterInterfaceSaiId() const { return std::get(saiPortAndIntf_); } @@ -98,6 +98,7 @@ class PortRifNeighbor { std::optional metadata, std::optional encapIndex, bool isLocal); + void handleLinkDown() { // TODO } @@ -106,15 +107,23 @@ class PortRifNeighbor { return handle_.get(); } void notifySubscribers() const { - // TODO + // noop } std::string toString() const { return fmt::format("{}", neighbor_->attributes()); } + SaiPortDescriptor getSaiPortDesc() const { + return std::get(saiPortAndIntf_); + } private: + RouterInterfaceSaiId getRouterInterfaceSaiId() const { + return std::get(saiPortAndIntf_); + } + SaiNeighborManager* manager_; + std::tuple saiPortAndIntf_; std::shared_ptr neighbor_; std::unique_ptr handle_; }; @@ -147,6 +156,10 @@ class SaiNeighborEntry { return std::visit( [](auto& handle) { return handle->toString(); }, neighbor_); } + SaiPortDescriptor getSaiPortDesc() const { + return std::visit( + [](auto& handle) { return handle->getSaiPortDesc(); }, neighbor_); + } private: std::variant< From 165e6974a07b9416d270aef053478e13897ae50b Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 05:15:36 -0800 Subject: [PATCH 225/280] For VOQ Switches pass link down event to Neighbor manager Summary: In VOQ switches there are not FDB entries. So directly send the event to neighbor manager Reviewed By: nivinl Differential Revision: D43145226 Privacy Context Container: L1125642 fbshipit-source-id: a5a728fca1fbf30bde7b7a51421b93843a6e1eb0 --- fboss/agent/hw/sai/switch/SaiNeighborManager.h | 5 ++++- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fboss/agent/hw/sai/switch/SaiNeighborManager.h b/fboss/agent/hw/sai/switch/SaiNeighborManager.h index 8589bfbc1dc6b..a43a1087e54e8 100644 --- a/fboss/agent/hw/sai/switch/SaiNeighborManager.h +++ b/fboss/agent/hw/sai/switch/SaiNeighborManager.h @@ -102,7 +102,6 @@ class PortRifNeighbor { void handleLinkDown() { // TODO } - SaiNeighborHandle* getHandle() const { return handle_.get(); } @@ -209,6 +208,10 @@ class SaiNeighborManager { std::string listManagedObjects() const; SwitchSaiId getSwitchSaiId() const; + void handleLinkDown(const SaiPortDescriptor& /*port*/) { + // TODO + } + private: SaiNeighborHandle* getNeighborHandleImpl( const SaiNeighborTraits::NeighborEntry& entry) const; diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index 4c6336cfa6c5b..887b566757e1e 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -1653,6 +1653,14 @@ void SaiSwitch::linkStateChangedCallbackBottomHalf( } } managerTable_->fdbManager().handleLinkDown(SaiPortDescriptor(swPortId)); + if (getPlatform()->getAsic()->getSwitchType() == cfg::SwitchType::VOQ) { + // On VOQ switches, there are not FDB entries. Rather we only have + // L3 ports which in turn are associated with RIFs or type (system) + // port. Neighbors then tied to these RIFs. So we need to directly + // signal Port RIF neighbors of a corresponding link going down. + managerTable_->neighborManager().handleLinkDown( + SaiPortDescriptor(swPortId)); + } /* * Enable AFE adaptive mode (S249471) on TAJO platforms when a port * flaps From 94c4c0bc1766db066aec3553102893901e02c641 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 05:15:36 -0800 Subject: [PATCH 226/280] Get fast path ecmp shrink working for VOQ switches Summary: As titled. For VOQ switches there are no FDB entries to send link events to. Instead for VOQ switches, send link events directly to neighbors, which will then post them to (subscribing/matching) next hops and cause ecmp group shrink Reviewed By: nivinl Differential Revision: D43145459 Privacy Context Container: L1125642 fbshipit-source-id: 5542eb4b84f1d7ddb2abfc59ad1a236039b35ace --- .../hw/sai/switch/SaiNeighborManager.cpp | 22 +++++++++++++++++++ .../agent/hw/sai/switch/SaiNeighborManager.h | 9 +++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/fboss/agent/hw/sai/switch/SaiNeighborManager.cpp b/fboss/agent/hw/sai/switch/SaiNeighborManager.cpp index 8c81418538c91..0c8c2be2c27f7 100644 --- a/fboss/agent/hw/sai/switch/SaiNeighborManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiNeighborManager.cpp @@ -379,6 +379,28 @@ void ManagedVlanRifNeighbor::handleLinkDown() { .notifyLinkDown(object->adapterHostKey()); } +void PortRifNeighbor::handleLinkDown() { + XLOGF( + DBG2, + "neighbor {} notifying link down to subscribed next hops", + neighbor_->adapterHostKey()); + SaiObjectEventPublisher::getInstance() + ->get() + .notifyLinkDown(neighbor_->adapterHostKey()); +} + +void SaiNeighborManager::handleLinkDown(const SaiPortDescriptor& port) { + CHECK(platform_->getAsic()->getSwitchType() == cfg::SwitchType::VOQ); + for (auto& [nbrEntry, neighbor] : neighbors_) { + if (neighbor->getRifType() != cfg::InterfaceType::SYSTEM_PORT) { + continue; + } + if (neighbor->getSaiPortDesc() == port) { + neighbor->handleLinkDown(); + } + } +} + template SaiNeighborTraits::NeighborEntry SaiNeighborManager::saiEntryFromSwEntry( const std::shared_ptr& swEntry); diff --git a/fboss/agent/hw/sai/switch/SaiNeighborManager.h b/fboss/agent/hw/sai/switch/SaiNeighborManager.h index a43a1087e54e8..3da5a7dd1d8bc 100644 --- a/fboss/agent/hw/sai/switch/SaiNeighborManager.h +++ b/fboss/agent/hw/sai/switch/SaiNeighborManager.h @@ -99,9 +99,8 @@ class PortRifNeighbor { std::optional encapIndex, bool isLocal); - void handleLinkDown() { - // TODO - } + void handleLinkDown(); + SaiNeighborHandle* getHandle() const { return handle_.get(); } @@ -208,9 +207,7 @@ class SaiNeighborManager { std::string listManagedObjects() const; SwitchSaiId getSwitchSaiId() const; - void handleLinkDown(const SaiPortDescriptor& /*port*/) { - // TODO - } + void handleLinkDown(const SaiPortDescriptor& /*port*/); private: SaiNeighborHandle* getNeighborHandleImpl( From 40db6d6fad4bb74306f63b7c82530ed94853aff8 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 10:20:30 -0800 Subject: [PATCH 227/280] Get HwEcmpTest.ResolvePendingResolveNexthop working on VOQ Switch Summary: Bug here was that we were assuming nbr table is always on vlans. Differential Revision: D43149329 fbshipit-source-id: db26d57bdd04f4b1cddf443bf0290ab2904b0c13 --- fboss/agent/hw/test/HwEcmpTests.cpp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/fboss/agent/hw/test/HwEcmpTests.cpp b/fboss/agent/hw/test/HwEcmpTests.cpp index ee9ab4591b9dd..f199d12549138 100644 --- a/fboss/agent/hw/test/HwEcmpTests.cpp +++ b/fboss/agent/hw/test/HwEcmpTests.cpp @@ -99,6 +99,25 @@ class HwEcmpTest : public HwLinkStateDependentTest { void verifyResolvedUcmp( const folly::CIDRNetwork& routePrefix, const std::vector& hwWs); + + auto getNdpTable(PortDescriptor port, std::shared_ptr& state) { + auto switchType = + getProgrammedState()->getSwitchSettings()->getSwitchType(); + if (switchType == cfg::SwitchType::NPU) { + auto vlanId = ecmpHelper_->getVlan(port, getProgrammedState()); + return state->getVlans()->getVlan(*vlanId)->getNdpTable()->modify( + *vlanId, &state); + } else { + auto portId = port.phyPortID(); + InterfaceID intfId( + (*state->getPorts()->getPort(portId)->getInterfaceIDs()->begin()) + ->toThrift()); + return state->getInterfaces() + ->getInterface(intfId) + ->getNdpTable() + ->modify(intfId, &state); + } + } }; void HwEcmpTest::programResolvedUcmp( @@ -444,9 +463,7 @@ TEST_F(HwEcmpTest, ResolvePendingResolveNexthop) { for (auto i = 0; i < 2; i++) { const auto& ecmpNextHop = ecmpHelper_->nhop(i); auto port = ecmpNextHop.portDesc; - auto vlanId = ecmpHelper_->getVlan(port, getProgrammedState()); - auto ntable = state0->getVlans()->getVlan(*vlanId)->getNdpTable()->modify( - *vlanId, &state0); + auto ntable = getNdpTable(port, state0); auto entry = ntable->getEntry(ecmpNextHop.ip); auto intfId = entry->getIntfID(); ntable->removeEntry(ecmpNextHop.ip); @@ -460,10 +477,7 @@ TEST_F(HwEcmpTest, ResolvePendingResolveNexthop) { for (auto i = 0; i < 2; i++) { const auto& ecmpNextHop = ecmpHelper_->nhop(i); auto port = ecmpNextHop.portDesc; - auto vlanId = ecmpHelper_->getVlan(port, getProgrammedState()); - auto ntable = state1->getVlans()->getVlan(*vlanId)->getNdpTable()->modify( - *vlanId, &state1); - + auto ntable = getNdpTable(port, state1); auto entry = entries[port]; ntable->updateEntry(NeighborEntryFields::fromThrift( entry->toThrift())); From 916e55364900c8ec884fa0af444ca66cda16b0f5 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 9 Feb 2023 14:02:58 -0800 Subject: [PATCH 228/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/563aa29fe2e68427f65ccd0995a15754e803705a https://github.com/facebookincubator/velox/commit/47b84235942893cc1e9759171e7fd21fd167a545 Reviewed By: yns88 fbshipit-source-id: a1ce442ad937cabe50a1fa59f463bec414d45287 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index d6f2d2d1c109f..18010b80cdfe9 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit ef8f370386bd1b899e0e99ee2c1f9faf96ef08ba +Subproject commit 563aa29fe2e68427f65ccd0995a15754e803705a From 393ea09937b490c4475b0fb12fa44b43957b1a9d Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Thu, 9 Feb 2023 15:04:57 -0800 Subject: [PATCH 229/280] migrate port pg config to thrift cow Summary: as titled. this object was still subclassing thrifty base. Reviewed By: peygar Differential Revision: D43142160 fbshipit-source-id: cf0ee8255f0df3ae9255ec7d6735bcbf8e98d40f --- .../hw/bcm/BcmPortIngressBufferManager.cpp | 18 +-- fboss/agent/state/Port.cpp | 3 +- fboss/agent/state/PortPgConfig.cpp | 2 +- fboss/agent/state/PortPgConfig.h | 112 +++++++++++++----- 4 files changed, 91 insertions(+), 44 deletions(-) diff --git a/fboss/agent/hw/bcm/BcmPortIngressBufferManager.cpp b/fboss/agent/hw/bcm/BcmPortIngressBufferManager.cpp index b237bf8c062b4..bd485f2d60052 100644 --- a/fboss/agent/hw/bcm/BcmPortIngressBufferManager.cpp +++ b/fboss/agent/hw/bcm/BcmPortIngressBufferManager.cpp @@ -428,15 +428,15 @@ void BcmPortIngressBufferManager::programIngressBuffers( } const PortPgConfig& getDefaultPriorityGroupSettings() { - static const PortPgConfig portPgConfig{PortPgFields{ - kDefaultPortPgId, - utility::bcmAlphaToCfgAlpha(kDefaultPgAlpha), - std::nullopt, - kDefaultMinLimitBytes, - kDefaultHeadroomLimitBytes, - kdefaultResumeOffsetBytes, - "", - }}; + static const PortPgConfig portPgConfig{PortPgConfig::makeThrift( + kDefaultPortPgId, // id + utility::bcmAlphaToCfgAlpha(kDefaultPgAlpha), // scaling factor + std::nullopt, // name + kDefaultMinLimitBytes, // minLimitBytes + kDefaultHeadroomLimitBytes, // headroomLimitBytes + kdefaultResumeOffsetBytes, // resumeOffsetBytes + "" // bufferPoolName + )}; return portPgConfig; } diff --git a/fboss/agent/state/Port.cpp b/fboss/agent/state/Port.cpp index 03de02cd81bbc..607a86203300f 100644 --- a/fboss/agent/state/Port.cpp +++ b/fboss/agent/state/Port.cpp @@ -137,8 +137,7 @@ PortFields PortFields::fromThrift(state::PortFields const& portThrift) { std::vector tmpPfcPriorities; PortPgConfigs tmpPgConfigs; for (const auto& pgConfig : pgConfigs.value()) { - tmpPgConfigs.push_back( - std::make_shared(PortPgFields::fromThrift(pgConfig))); + tmpPgConfigs.push_back(std::make_shared(pgConfig)); tmpPfcPriorities.push_back(static_cast(*pgConfig.id())); } port.pgConfigs = tmpPgConfigs; diff --git a/fboss/agent/state/PortPgConfig.cpp b/fboss/agent/state/PortPgConfig.cpp index 02a16b3f26d0d..9c7292394d323 100644 --- a/fboss/agent/state/PortPgConfig.cpp +++ b/fboss/agent/state/PortPgConfig.cpp @@ -81,6 +81,6 @@ PortPgFields PortPgFields::fromThrift(state::PortPgFields const& portPgThrift) { return portPg; } -template class NodeBaseT; +template class ThriftStructNode; } // namespace facebook::fboss diff --git a/fboss/agent/state/PortPgConfig.h b/fboss/agent/state/PortPgConfig.h index e20fc924b527d..b584d004c882a 100644 --- a/fboss/agent/state/PortPgConfig.h +++ b/fboss/agent/state/PortPgConfig.h @@ -9,6 +9,7 @@ */ #pragma once +#include "Thrifty.h" #include "fboss/agent/FbossError.h" #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/gen-cpp2/switch_state_types.h" @@ -62,95 +63,142 @@ struct PortPgFields : public ThriftyFields { std::optional bufferPoolConfigPtr; }; +USE_THRIFT_COW(PortPgConfig); +RESOLVE_STRUCT_MEMBER( + PortPgConfig, + switch_state_tags::bufferPoolConfig, + BufferPoolCfg); + /* * PortPgConfig defines the behaviour of the per port queues */ class PortPgConfig - : public ThriftyBaseT { + : public ThriftStructNode { public: + using BaseT = ThriftStructNode; explicit PortPgConfig(uint8_t id) { - writableFields()->id = id; - } - - bool operator==(const PortPgConfig& portPg) const { - return getFields()->id == portPg.getID() && - getFields()->minLimitBytes == portPg.getMinLimitBytes() && - getFields()->scalingFactor == portPg.getScalingFactor() && - getFields()->name == portPg.getName() && - getFields()->headroomLimitBytes == portPg.getHeadroomLimitBytes() && - getFields()->resumeOffsetBytes == portPg.getResumeOffsetBytes() && - getFields()->bufferPoolName == portPg.getBufferPoolName(); - } - bool operator!=(const PortPgConfig& portPg) const { - return !(*this == portPg); + set(id); } // std::string toString() const; uint8_t getID() const { - return getFields()->id; + return safe_cref()->toThrift(); } int getMinLimitBytes() const { - return getFields()->minLimitBytes; + return safe_cref()->toThrift(); } void setMinLimitBytes(int minLimitBytes) { - writableFields()->minLimitBytes = minLimitBytes; + ref() = minLimitBytes; } std::optional getScalingFactor() const { - return getFields()->scalingFactor; + if (auto scalingFactor = safe_cref()) { + cfg::MMUScalingFactor cfgMMUScalingFactor{}; + apache::thrift::util::tryParseEnum( + scalingFactor->toThrift(), &cfgMMUScalingFactor); + return cfgMMUScalingFactor; + } + return std::nullopt; } void setScalingFactor(cfg::MMUScalingFactor scalingFactor) { - writableFields()->scalingFactor = scalingFactor; + set( + apache::thrift::util::enumName(scalingFactor)); } std::optional getName() const { - return getFields()->name; + if (auto name = safe_cref()) { + return name->toThrift(); + } + return std::nullopt; } void setName(const std::string& name) { - writableFields()->name = name; + set(name); } std::optional getHeadroomLimitBytes() const { - return getFields()->headroomLimitBytes; + if (auto headroomLimitBytes = + safe_cref()) { + return headroomLimitBytes->toThrift(); + } + return std::nullopt; } void setHeadroomLimitBytes(int headroomLimitBytes) { - writableFields()->headroomLimitBytes = headroomLimitBytes; + set(headroomLimitBytes); } std::optional getResumeOffsetBytes() const { - return getFields()->resumeOffsetBytes; + if (auto resumeOffsetBytes = + safe_cref()) { + return resumeOffsetBytes->toThrift(); + } + return std::nullopt; } void setResumeOffsetBytes(int resumeOffsetBytes) { - writableFields()->resumeOffsetBytes = resumeOffsetBytes; + set(resumeOffsetBytes); } std::string getBufferPoolName() const { - return getFields()->bufferPoolName; + return safe_cref()->toThrift(); } void setBufferPoolName(const std::string& name) { - writableFields()->bufferPoolName = name; + ref() = name; } std::optional getBufferPoolConfig() const { - return getFields()->bufferPoolConfigPtr; + if (auto bufferPoolConfigPtr = + safe_cref()) { + return bufferPoolConfigPtr; + } + return std::nullopt; } void setBufferPoolConfig(BufferPoolCfgPtr bufferPoolConfigPtr) { - writableFields()->bufferPoolConfigPtr = bufferPoolConfigPtr; + ref() = bufferPoolConfigPtr; + } + + static state::PortPgFields makeThrift( + uint8_t id, + std::optional scalingFactor, + const std::optional& name, + int minLimitBytes, + std::optional headroomLimitBytes, + std::optional resumeOffsetBytes, + const std::string& bufferPoolName, + const std::optional& bufferPoolConfig = + std::nullopt) { + state::PortPgFields obj{}; + obj.id() = id; + if (scalingFactor) { + obj.scalingFactor() = apache::thrift::util::enumName(*scalingFactor); + } + if (name) { + obj.name() = *name; + } + obj.minLimitBytes() = minLimitBytes; + if (headroomLimitBytes) { + obj.headroomLimitBytes() = *headroomLimitBytes; + } + if (resumeOffsetBytes) { + obj.resumeOffsetBytes() = *resumeOffsetBytes; + } + obj.bufferPoolName() = bufferPoolName; + if (bufferPoolConfig) { + obj.bufferPoolConfig() = *bufferPoolConfig; + } + return obj; } private: // Inherit the constructors required for clone() - using ThriftyBaseT:: - ThriftyBaseT; + using BaseT::BaseT; friend class CloneAllocator; }; From 5b71fa6af4db6821472e318dfb0f8a41a90bad9d Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Thu, 9 Feb 2023 17:00:43 -0800 Subject: [PATCH 230/280] delete ThriftBaseT class Summary: as titled. this is obsolete Reviewed By: peygar Differential Revision: D43142189 fbshipit-source-id: 23060a6e315eef784e39b1d7cbcd4b4b71aeb567 --- fboss/agent/state/Thrifty.h | 75 ------------------------------------- 1 file changed, 75 deletions(-) diff --git a/fboss/agent/state/Thrifty.h b/fboss/agent/state/Thrifty.h index 0ca981fcef054..55ef1712d4246 100644 --- a/fboss/agent/state/Thrifty.h +++ b/fboss/agent/state/Thrifty.h @@ -522,81 +522,6 @@ class ThriftyNodeMapT : public NodeMapT { } }; -// -// Special version of NodeBaseT that features methods to convert -// object to/from JSON using Thrift serializers. For this to work -// one must supply Thrift type (ThrifT) that stores FieldsT state. -// -// TODO: in future, FieldsT and ThrifT should be one type -// -template -class ThriftyBaseT : public NodeBaseT { - static_assert(std::is_base_of_v, FieldsT>); - - public: - using BaseT = NodeBaseT; - using BaseT::BaseT; - using Fields = FieldsT; - using ThriftType = ThriftT; - - static std::shared_ptr fromThrift(const ThriftT& obj) { - auto fields = FieldsT::fromThrift(obj); - return std::make_shared(fields); - } - - static std::shared_ptr fromFollyDynamic(folly::dynamic const& dyn) { - if (ThriftyUtils::nodeNeedsMigration(dyn)) { - return fromJson(folly::toJson(FieldsT::migrateToThrifty(dyn))); - } else { - // Schema is up to date meaning there is no migration required - return fromJson(folly::toJson(dyn)); - } - } - - static std::shared_ptr fromJson(const folly::fbstring& jsonStr) { - auto inBuf = - folly::IOBuf::wrapBufferAsValue(jsonStr.data(), jsonStr.size()); - auto obj = apache::thrift::SimpleJSONSerializer::deserialize( - folly::io::Cursor{&inBuf}); - return ThriftyBaseT::fromThrift(obj); - } - - ThriftT toThrift() const { - return this->getFields()->toThrift(); - } - - std::string str() const { - auto obj = this->toThrift(); - std::string jsonStr; - apache::thrift::SimpleJSONSerializer::serialize(obj, &jsonStr); - return jsonStr; - } - - folly::dynamic toFollyDynamic() const override final { - auto dyn = folly::parseJson(this->str()); - FieldsT::migrateFromThrifty(dyn); - return dyn; - } - - // for testing purposes - folly::dynamic toFollyDynamicLegacy() const { - return this->getFields()->toFollyDynamicLegacy(); - } - - static std::shared_ptr fromFollyDynamicLegacy( - folly::dynamic const& dyn) { - return std::make_shared(FieldsT::fromFollyDynamicLegacy(dyn)); - } - - bool operator==(const BaseT& rhs) const { - return *this->getFields() == *rhs.getFields(); - } - - bool operator!=(const ThriftyBaseT& rhs) const { - return !(*this == rhs); - } -}; - template struct ThriftStructNode : public thrift_cow:: From 440dc5a2b6655fbef4d319393d98a50144893685 Mon Sep 17 00:00:00 2001 From: Rohit Puri Date: Thu, 9 Feb 2023 17:06:21 -0800 Subject: [PATCH 231/280] Add neighbor reachability state support. Summary: Same. Reviewed By: zechengh09 Differential Revision: D43075739 Privacy Context Container: L1125642 fbshipit-source-id: 3f4a25c7cabcc5a805bab5ab7d3b7f21f605664b --- fboss/agent/ApplyThriftConfig.cpp | 4 ++++ fboss/agent/state/Port.cpp | 4 ++++ fboss/agent/state/Port.h | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index c07a3076f2e15..915e531de03c5 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -1917,6 +1917,8 @@ shared_ptr ThriftConfigApplier::updatePort( *portConf->loopbackMode() == orig->getLoopbackMode() && mirrorsUnChanged && newQosPolicy == orig->getQosPolicy() && *portConf->expectedLLDPValues() == orig->getLLDPValidations() && + *portConf->expectedNeighborReachability() == + orig->getExpectedNeighborValues()->toThrift() && *portConf->maxFrameSize() == orig->getMaxFrameSize() && lookupClassesUnchanged && profileConfigUnchanged && pinConfigsUnchanged && *portConf->portType() == orig->getPortType()) { @@ -1956,6 +1958,8 @@ shared_ptr ThriftConfigApplier::updatePort( newPort->resetPinConfigs(newPinConfigs); newPort->setPortType(*portConf->portType()); newPort->setInterfaceIDs(port2InterfaceId_[orig->getID()]); + newPort->setExpectedNeighborReachability( + *portConf->expectedNeighborReachability()); return newPort; } diff --git a/fboss/agent/state/Port.cpp b/fboss/agent/state/Port.cpp index 607a86203300f..c31da64322190 100644 --- a/fboss/agent/state/Port.cpp +++ b/fboss/agent/state/Port.cpp @@ -189,6 +189,8 @@ PortFields PortFields::fromThrift(state::PortFields const& portThrift) { } port.expectedLLDPValues = *portThrift.expectedLLDPValues(); + port.expectedNeighborReachability = + *portThrift.expectedNeighborReachability(); for (const auto& rxSak : *portThrift.rxSecureAssociationKeys()) { port.rxSecureAssociationKeys.emplace(rxSakFromThrift(rxSak)); @@ -307,6 +309,7 @@ state::PortFields PortFields::toThrift() const { } *port.expectedLLDPValues() = expectedLLDPValues; + *port.expectedNeighborReachability() = expectedNeighborReachability; for (const auto& [mkaSakKey, mkaSak] : rxSecureAssociationKeys) { port.rxSecureAssociationKeys()->push_back(rxSakToThrift(mkaSakKey, mkaSak)); @@ -334,6 +337,7 @@ bool PortFields::operator==(const PortFields& other) const { ingressMirror == other.ingressMirror && egressMirror == other.egressMirror && qosPolicy == other.qosPolicy && expectedLLDPValues == other.expectedLLDPValues && + expectedNeighborReachability == other.expectedNeighborReachability && lookupClassesToDistrubuteTrafficOn == other.lookupClassesToDistrubuteTrafficOn && profileID == other.profileID && maxFrameSize == other.maxFrameSize && diff --git a/fboss/agent/state/Port.h b/fboss/agent/state/Port.h index 59a121a5e121d..798d0668eb061 100644 --- a/fboss/agent/state/Port.h +++ b/fboss/agent/state/Port.h @@ -45,6 +45,7 @@ struct PortFields : public ThriftyFields { using VlanMembership = boost::container::flat_map; using LLDPValidations = std::map; + using NeighborReachability = std::vector; enum class OperState { DOWN = 0, @@ -117,6 +118,7 @@ struct PortFields : public ThriftyFields { std::optional egressMirror; std::optional qosPolicy; LLDPValidations expectedLLDPValues; + NeighborReachability expectedNeighborReachability; std::vector lookupClassesToDistrubuteTrafficOn; cfg::PortProfileID profileID{cfg::PortProfileID::PROFILE_DEFAULT}; // Default value from switch_config.thrift @@ -153,6 +155,7 @@ class Port : public ThriftStructNode { using VlanMembership = PortFields::VlanMembership; using OperState = PortFields::OperState; using LLDPValidations = PortFields::LLDPValidations; + using NeighborReachability = PortFields::NeighborReachability; using MKASakKey = PortFields::MKASakKey; using RxSaks = PortFields::RxSaks; using PfcPriorityList = thrift_cow::detail::ReferenceWrapper< @@ -558,10 +561,18 @@ class Port : public ThriftStructNode { return cref()->toThrift(); } + auto getExpectedNeighborValues() const { + return safe_cref(); + } + void setExpectedLLDPValues(LLDPValidations vals) { set(vals); } + void setExpectedNeighborReachability(const NeighborReachability& vals) { + set(vals); + } + std::vector getLookupClassesToDistributeTrafficOn() const { // THRIFT_COPY From d651b1886d445b7dc8b86c1557a77f77ed2bcdee Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 17:24:28 -0800 Subject: [PATCH 232/280] Greenlight HwEcmp tests on VOQ switches Summary: As titled Differential Revision: D43149464 fbshipit-source-id: 47155141d6c172d9690a8486dae563449ce3713f --- installer/centos-7-x86_64/run_scripts/run_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 6256ed915794b..8032a15ee517f 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -41,7 +41,8 @@ # ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwVoqSwitchTest.*:-*sendPacketCpu*:*trapPktsOnPort*:*AclQualifier* # ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwVoqSwitchWithFabricPortsTest.* # ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwVoqSwitchWithMultipleDsfNodesTest.* -# +# ECMP Tests +# ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwEcmpTest.* # Basic forwarding tests # ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwLoopBackTest.* # ./run_test.py sai --config wedge400c_voq.agent.materialized_JSON --filter=HwL4PortBlackHolingTest.* @@ -79,6 +80,8 @@ # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwL4PortBlackHolingTest.* # Counter tests # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwInPauseDiscardsCounterTest.* +# ECMP Tests +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwEcmpTest.*:-*Ucmp* # Load Balancer Tests # UCMP support lacking in DNX # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV4.*:-*Ucmp*:-*Shrink* From 371bef7582c2fe5f341ca2d75e1573e9c41d159d Mon Sep 17 00:00:00 2001 From: Rohit Puri Date: Thu, 9 Feb 2023 18:11:40 -0800 Subject: [PATCH 233/280] Add neighbor reachability state tests. Summary: Same. Reviewed By: zechengh09 Differential Revision: D43129168 fbshipit-source-id: 2e266bff4a81330bb2411833513b1498fbc2ce8b --- fboss/agent/state/tests/PortTests.cpp | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/fboss/agent/state/tests/PortTests.cpp b/fboss/agent/state/tests/PortTests.cpp index 1e933ae4d8879..6217b95f7d26c 100644 --- a/fboss/agent/state/tests/PortTests.cpp +++ b/fboss/agent/state/tests/PortTests.cpp @@ -832,6 +832,14 @@ TEST(Port, portSerilization) { port->setExpectedLLDPValues(lldpMap); EXPECT_EQ(port->getLLDPValidations().size(), 1); + // expected Neighbor reachability values + EXPECT_TRUE(port->getExpectedNeighborValues()->empty()); + cfg::PortNeighbor nbr; + nbr.remoteSystem() = "RemoteA"; + nbr.remotePort() = "portA"; + port->setExpectedNeighborReachability({nbr}); + EXPECT_EQ(port->getExpectedNeighborValues()->size(), 1); + // RxSaks EXPECT_TRUE( port->cref()->empty()); @@ -931,3 +939,27 @@ TEST(Port, verifyInterfaceIDsForVoqSwitches) { } } } + +TEST(Port, verifyNeighborReachability) { + auto platform = createMockPlatform(); + auto stateV0 = make_shared(); + auto config = testConfigA(cfg::SwitchType::VOQ); + + cfg::PortNeighbor nbr; + nbr.remoteSystem() = "RemoteA"; + nbr.remotePort() = "portA"; + + config.ports()[0].expectedNeighborReachability() = {nbr}; + auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); + ASSERT_NE(nullptr, stateV1); + + for (const auto& nbrIter : *(stateV1->getPorts() + ->getPortIf(PortID(1)) + ->getExpectedNeighborValues())) { + EXPECT_EQ( + nbrIter->cref()->toThrift(), + "RemoteA"); + EXPECT_EQ( + nbrIter->cref()->toThrift(), "portA"); + } +} From e6db6b4c60ba839f44f7acee6f7c2dcfa84f673f Mon Sep 17 00:00:00 2001 From: Bin Huang Date: Thu, 9 Feb 2023 19:05:25 -0800 Subject: [PATCH 234/280] Fix cmake dependency issue Summary: While build with SAI_ONLY=1, the build fail with the following error: ``` ./fboss/platform/fbdevd/if/gen-cpp2/fbdevd_types.h:13:10: fatal error: fboss/platform/fbdevd/if/gen-cpp2/i2c_types.h: No such file or directory #include "fboss/platform/fbdevd/if/gen-cpp2/i2c_types.h" ``` This diff fixes the above issue Reviewed By: peygar Differential Revision: D43173381 fbshipit-source-id: 8eb2f9b17780e25bc7383c9219d0678800cd9e28 --- cmake/PlatformFbdevd.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/PlatformFbdevd.cmake b/cmake/PlatformFbdevd.cmake index b8dbb5f9069d3..0dc4cdd3c9ccd 100644 --- a/cmake/PlatformFbdevd.cmake +++ b/cmake/PlatformFbdevd.cmake @@ -11,6 +11,9 @@ add_fbthrift_cpp_library( OPTIONS json reflection + DEPENDS + gpio_cpp2 + i2c_cpp2 ) add_fbthrift_cpp_library( From cb97fa1f95dba1ec50b7a4f0008d9b30d1da0736 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Thu, 9 Feb 2023 20:58:52 -0800 Subject: [PATCH 235/280] test ensemble interface Summary: an interface for test ensemble, to be supported by both hw test ensemble and agent ensemble Reviewed By: msomasundaran Differential Revision: D43097724 Privacy Context Container: L1125642 fbshipit-source-id: af3e4fd0b522aa5898372b528457fbfcc2678225 --- fboss/agent/hw/test/HwSwitchEnsemble.h | 16 ++++++++------- fboss/agent/test/TestEnsembleIf.h | 27 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 fboss/agent/test/TestEnsembleIf.h diff --git a/fboss/agent/hw/test/HwSwitchEnsemble.h b/fboss/agent/hw/test/HwSwitchEnsemble.h index 8e1817c062eb5..62c2493223007 100644 --- a/fboss/agent/hw/test/HwSwitchEnsemble.h +++ b/fboss/agent/hw/test/HwSwitchEnsemble.h @@ -17,6 +17,7 @@ #include "fboss/agent/if/gen-cpp2/ctrl_types.h" #include "fboss/agent/platforms/tests/utils/TestPlatformTypes.h" #include "fboss/agent/rib/RoutingInformationBase.h" +#include "fboss/agent/test/TestEnsembleIf.h" #include "fboss/agent/types.h" #include @@ -39,7 +40,7 @@ class Platform; class SwitchState; class HwLinkStateToggler; -class HwSwitchEnsemble : public HwSwitch::Callback { +class HwSwitchEnsemble : public TestEnsembleIf { public: class HwSwitchEventObserverIf { public: @@ -91,17 +92,18 @@ class HwSwitchEnsemble : public HwSwitch::Callback { ~HwSwitchEnsemble() override; std::shared_ptr applyNewState( std::shared_ptr newState, - bool rollbackOnHwOverflow = false) { + bool rollbackOnHwOverflow = false) override { return applyNewStateImpl(newState, false, rollbackOnHwOverflow); } std::shared_ptr applyNewStateTransaction( std::shared_ptr newState) { return applyNewStateImpl(newState, true); } - void applyInitialConfig(const cfg::SwitchConfig& cfg); - std::shared_ptr applyNewConfig(const cfg::SwitchConfig& config); + void applyInitialConfig(const cfg::SwitchConfig& cfg) override; + std::shared_ptr applyNewConfig( + const cfg::SwitchConfig& config) override; - std::shared_ptr getProgrammedState() const; + std::shared_ptr getProgrammedState() const override; HwLinkStateToggler* getLinkToggler() { return linkToggler_.get(); } @@ -114,8 +116,8 @@ class HwSwitchEnsemble : public HwSwitch::Callback { virtual const Platform* getPlatform() const { return platform_.get(); } - virtual HwSwitch* getHwSwitch(); - virtual const HwSwitch* getHwSwitch() const { + HwSwitch* getHwSwitch() override; + const HwSwitch* getHwSwitch() const override { return const_cast(this)->getHwSwitch(); } const HwAsic* getAsic() const { diff --git a/fboss/agent/test/TestEnsembleIf.h b/fboss/agent/test/TestEnsembleIf.h new file mode 100644 index 0000000000000..1967809a1ff82 --- /dev/null +++ b/fboss/agent/test/TestEnsembleIf.h @@ -0,0 +1,27 @@ +// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. + +#pragma once + +#include "fboss/agent/HwSwitch.h" + +#include "fboss/agent/gen-cpp2/switch_config_types.h" + +namespace facebook::fboss { + +class SwitchState; + +class TestEnsembleIf : public HwSwitch::Callback { + public: + ~TestEnsembleIf() override {} + virtual std::shared_ptr applyNewState( + std::shared_ptr state, + bool rollbackOnHwOverflow = false) = 0; + virtual void applyInitialConfig(const cfg::SwitchConfig& config) = 0; + virtual std::shared_ptr applyNewConfig( + const cfg::SwitchConfig& config) = 0; + virtual std::shared_ptr getProgrammedState() const = 0; + virtual HwSwitch* getHwSwitch() = 0; + virtual const HwSwitch* getHwSwitch() const = 0; +}; + +} // namespace facebook::fboss From ad217c9e876f800fbaeb0e68809c2ea8cf3ee6ca Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 9 Feb 2023 21:17:06 -0800 Subject: [PATCH 236/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/wangle/commit/8a5f2315a523963ef283ff64ec118947d422ce1c https://github.com/facebookexperimental/edencommon/commit/62fba8fc8e02b59b38af16aa0faa287c6adbbccd https://github.com/facebookincubator/fizz/commit/61854322a4903bae347bd45f538946aa003af0e8 https://github.com/facebookincubator/katran/commit/5da7627ded3060b394d0051c6befdb46609445a9 https://github.com/facebookincubator/mvfst/commit/e07080b06e125f86e01924e360869079c4d3ed49 Reviewed By: yns88 fbshipit-source-id: f094f11cc1a485739bb048824941b14519dbd039 --- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index fcf43bd14c762..c786e522805a3 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 240d0350bf9c29075f444147d06be6176b6d15c0 +Subproject commit 8a5f2315a523963ef283ff64ec118947d422ce1c From 2dba38901fa843c7624357f786006c51786e59c9 Mon Sep 17 00:00:00 2001 From: Senthilkumaran Rajan Date: Thu, 9 Feb 2023 21:39:06 -0800 Subject: [PATCH 237/280] Thrift changes for DLB Summary: Thrift changes for DLB Differential Revision: D43166108 fbshipit-source-id: 401f8ae641c50a491c12a6fe8adb256d9a076174 --- fboss/agent/switch_config.thrift | 27 +++++++++++++++++++++++++++ fboss/agent/switch_state.thrift | 1 + 2 files changed, 28 insertions(+) diff --git a/fboss/agent/switch_config.thrift b/fboss/agent/switch_config.thrift index 9ce25c0ce58c6..23ecad8561e7a 100644 --- a/fboss/agent/switch_config.thrift +++ b/fboss/agent/switch_config.thrift @@ -1444,6 +1444,8 @@ struct ExactMatchTableConfig { 2: optional i32 dstPrefixLength; } +const i16 DEFAULT_FLOWLET_TABLE_SIZE = 4096; + /* * Switch specific settings: global to the switch */ @@ -1629,6 +1631,30 @@ struct UdfConfig { 2: map udfPacketMatcher; } +struct FlowletSwitchingConfig { + // wait for lack of activitiy interval on the flow before load balancing + 1: i16 inactivityIntervalUsecs; + // flow set table size + 2: i16 flowletTableSize = DEFAULT_FLOWLET_TABLE_SIZE; + // EWMA (exponentially weighted moving average) of historical member load in bytes + 3: i16 dynamicEgressLoadExponent; + // EWMA of historical member queued bytes + 4: i16 dynamicQueueExponent; + // minimum threshold, in bytes, used to quantize historical member queued bytes + 5: i32 dynamicQueueMinThresholdBytes; + // maximum threshold, in bytes, used to quantize historical member queued bytes + 6: i32 dynamicQueueMaxThresholdBytes; + // number of times historical member load and queued bytes are computed in a second + 7: i32 dynamicSampleRate; + // TODO move the following 3 port params to port specific structure + // port scaling factor for dynamic load balancing + 8: optional i16 portScalingFactor; + // weight of traffic load in determining ports quality + 9: optional i16 portLoadWeight; + // weight of total queue size in determining port quality + 10: optional i16 portQueueWeight; +} + /** * The configuration for a switch. * @@ -1754,4 +1780,5 @@ struct SwitchConfig { // will be populated to reflect global DSF node info 48: map dsfNodes = {}; 49: optional UdfConfig udfConfig; + 50: optional FlowletSwitchingConfig flowletSwitchingConfig; } diff --git a/fboss/agent/switch_state.thrift b/fboss/agent/switch_state.thrift index 5a879e2967465..ff7f5b8112a98 100644 --- a/fboss/agent/switch_state.thrift +++ b/fboss/agent/switch_state.thrift @@ -565,6 +565,7 @@ struct SwitchState { 32: optional QosPolicyFields defaultDataPlaneQosPolicy; 33: map dsfNodes; 34: switch_config.UdfConfig udfConfig; + 35: optional switch_config.FlowletSwitchingConfig flowletSwitchingConfig; // Remote objects 500: map remoteSystemPortMap; 501: map remoteInterfaceMap; From 016a90a9410c7e0d83616428708f2c7ea9a3fca8 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 22:11:30 -0800 Subject: [PATCH 238/280] Sysport range is optional in DsfNode, reflect that in switch state Summary: Sys port range is only set in INs Reviewed By: nivinl Differential Revision: D43167942 Privacy Context Container: L1125642 fbshipit-source-id: 5c8507344a536925f5b0c5ed3fad681a90a8059d --- fboss/agent/ApplyThriftConfig.cpp | 3 ++- fboss/agent/Utils.cpp | 5 +++-- fboss/agent/state/DsfNode.cpp | 8 ++++++-- fboss/agent/state/DsfNode.h | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index 915e531de03c5..84f4e0b9b67e7 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -821,7 +821,8 @@ void ThriftConfigApplier::processUpdatedDsfNodes() { thrift_cow::ThriftMapDelta delta( orig_->getDsfNodes().get(), new_->getDsfNodes().get()); auto getRecyclePortId = [](const std::shared_ptr& node) { - return *node->getSystemPortRange().minimum() + 1; + CHECK(node->getSystemPortRange().has_value()); + return *node->getSystemPortRange()->minimum() + 1; }; auto isLocal = [mySwitchId, this](const std::shared_ptr& node) { return SwitchID(*mySwitchId) == node->getSwitchId(); diff --git a/fboss/agent/Utils.cpp b/fboss/agent/Utils.cpp index ee5a620d45d46..974f9fa8ea5b4 100644 --- a/fboss/agent/Utils.cpp +++ b/fboss/agent/Utils.cpp @@ -314,11 +314,12 @@ PortID getPortID( SystemPortID sysPortId, const std::shared_ptr& state) { auto mySwitchId = state->getSwitchSettings()->getSwitchId(); - CHECK(mySwitchId); + CHECK(mySwitchId.has_value()); auto sysPortRange = state->getDsfNodes() ->getDsfNodeIf(SwitchID(*mySwitchId)) ->getSystemPortRange(); - return PortID(static_cast(sysPortId) - *sysPortRange.minimum()); + CHECK(sysPortRange.has_value()); + return PortID(static_cast(sysPortId) - *sysPortRange->minimum()); } std::vector getPortsForInterface( diff --git a/fboss/agent/state/DsfNode.cpp b/fboss/agent/state/DsfNode.cpp index 940c56ff6ace6..821a17da48b41 100644 --- a/fboss/agent/state/DsfNode.cpp +++ b/fboss/agent/state/DsfNode.cpp @@ -43,8 +43,12 @@ void DsfNode::setLoopbackIps(const std::vector& loopbackIps) { set(loopbackIps); } -cfg::Range64 DsfNode::getSystemPortRange() const { - return get()->toThrift(); +std::optional DsfNode::getSystemPortRange() const { + std::optional sysPortRange; + if (get()) { + sysPortRange = get()->toThrift(); + } + return sysPortRange; } folly::MacAddress DsfNode::getMac() const { diff --git a/fboss/agent/state/DsfNode.h b/fboss/agent/state/DsfNode.h index d23942d91d905..61c2d392730f0 100644 --- a/fboss/agent/state/DsfNode.h +++ b/fboss/agent/state/DsfNode.h @@ -37,7 +37,7 @@ class DsfNode : public ThriftStructNode { } std::set getLoopbackIpsSorted() const; void setLoopbackIps(const std::vector& loopbackIps); - cfg::Range64 getSystemPortRange() const; + std::optional getSystemPortRange() const; folly::MacAddress getMac() const; static std::shared_ptr fromFollyDynamic(const folly::dynamic& entry); From f07a7b78919be656929d968b57dad996ae4ad099 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 22:11:30 -0800 Subject: [PATCH 239/280] Make nodeMac optional for Dsf node Summary: Only IN DSF Nodes have this populated Differential Revision: D43170136 fbshipit-source-id: 1b146514b01ed5965475ce99fcbb6148b93a384f --- fboss/agent/ApplyThriftConfig.cpp | 6 ++++-- fboss/agent/state/DsfNode.cpp | 8 ++++++-- fboss/agent/state/DsfNode.h | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fboss/agent/ApplyThriftConfig.cpp b/fboss/agent/ApplyThriftConfig.cpp index 84f4e0b9b67e7..80e9f71c09d7e 100644 --- a/fboss/agent/ApplyThriftConfig.cpp +++ b/fboss/agent/ApplyThriftConfig.cpp @@ -859,7 +859,8 @@ void ThriftConfigApplier::processUpdatedDsfNodes() { addresses.insert(network); state::NeighborEntryFields neighbor; neighbor.ipaddress() = network.first.str(); - neighbor.mac() = node->getMac().toString(); + CHECK(node->getMac().has_value()); + neighbor.mac() = node->getMac()->toString(); neighbor.portId()->portType() = cfg::PortDescriptorType::SystemPort; neighbor.portId()->portId() = recyclePortId; neighbor.interfaceId() = recyclePortId; @@ -910,12 +911,13 @@ void ThriftConfigApplier::processUpdatedDsfNodes() { auto sysPorts = new_->getRemoteSystemPorts()->clone(); sysPorts->addNode(sysPort); new_->resetRemoteSystemPorts(sysPorts); + CHECK(node->getMac().has_value()); auto intf = std::make_shared( InterfaceID(recyclePortId), RouterID(0), std::optional(std::nullopt), folly::StringPiece(sysPort->getPortName()), - node->getMac(), + *node->getMac(), 9000, true, true, diff --git a/fboss/agent/state/DsfNode.cpp b/fboss/agent/state/DsfNode.cpp index 821a17da48b41..3bfdf700b59e2 100644 --- a/fboss/agent/state/DsfNode.cpp +++ b/fboss/agent/state/DsfNode.cpp @@ -51,8 +51,12 @@ std::optional DsfNode::getSystemPortRange() const { return sysPortRange; } -folly::MacAddress DsfNode::getMac() const { - return folly::MacAddress(get()->cref()); +std::optional DsfNode::getMac() const { + std::optional mac; + if (get().has_value()) { + mac = folly::MacAddress(get()->cref()); + } + return mac; } std::shared_ptr DsfNode::fromFollyDynamic( diff --git a/fboss/agent/state/DsfNode.h b/fboss/agent/state/DsfNode.h index 61c2d392730f0..bb993b57afbbe 100644 --- a/fboss/agent/state/DsfNode.h +++ b/fboss/agent/state/DsfNode.h @@ -38,7 +38,7 @@ class DsfNode : public ThriftStructNode { std::set getLoopbackIpsSorted() const; void setLoopbackIps(const std::vector& loopbackIps); std::optional getSystemPortRange() const; - folly::MacAddress getMac() const; + std::optional getMac() const; static std::shared_ptr fromFollyDynamic(const folly::dynamic& entry); From 5149bf56eb91c7528fc98133c0ea0097f1022af3 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 22:11:30 -0800 Subject: [PATCH 240/280] s/XPHY_SAI_WARMBOOT/WARMBOOT - since the query is whether WB is supported or not Summary: As titled. Only one use of this attribute was in phy. Changed that to query the right feature Reviewed By: zechengh09 Differential Revision: D43173245 Privacy Context Container: L1125642 fbshipit-source-id: dff124ceff07c936e26e9b082ef71cede9ccc660 --- fboss/agent/hw/switch_asics/EbroAsic.cpp | 2 +- fboss/agent/hw/switch_asics/GaronneAsic.cpp | 2 +- fboss/agent/hw/switch_asics/HwAsic.h | 2 +- fboss/agent/hw/switch_asics/IndusAsic.cpp | 2 +- fboss/agent/hw/switch_asics/MarvelPhyAsic.cpp | 2 +- fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp | 2 +- fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp | 2 +- fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp | 2 +- fboss/agent/hw/switch_asics/TomahawkAsic.cpp | 2 +- fboss/agent/hw/switch_asics/Trident2Asic.cpp | 2 +- fboss/lib/phy/SaiPhyManager.cpp | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fboss/agent/hw/switch_asics/EbroAsic.cpp b/fboss/agent/hw/switch_asics/EbroAsic.cpp index 0340df857c854..455894da5981b 100644 --- a/fboss/agent/hw/switch_asics/EbroAsic.cpp +++ b/fboss/agent/hw/switch_asics/EbroAsic.cpp @@ -71,6 +71,7 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { return true; // VOQ vs NPU mode dependent features case HwAsic::Feature::BRIDGE_PORT_8021Q: + case HwAsic::Feature::WARMBOOT: return getSwitchType() == cfg::SwitchType::NPU; case HwAsic::Feature::RESERVED_ENCAP_INDEX_RANGE: return getSwitchType() == cfg::SwitchType::VOQ; @@ -126,7 +127,6 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::FABRIC_TX_QUEUES: case HwAsic::Feature::SAI_PORT_VCO_CHANGE: case HwAsic::Feature::SAI_TTL0_PACKET_FORWARD_ENABLE: - case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::DLB: return false; diff --git a/fboss/agent/hw/switch_asics/GaronneAsic.cpp b/fboss/agent/hw/switch_asics/GaronneAsic.cpp index 1b1a85609b946..0d24e5de8c53e 100644 --- a/fboss/agent/hw/switch_asics/GaronneAsic.cpp +++ b/fboss/agent/hw/switch_asics/GaronneAsic.cpp @@ -57,6 +57,7 @@ bool GaronneAsic::isSupported(Feature feature) const { case HwAsic::Feature::SAI_MPLS_INSEGMENT: case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: + case HwAsic::Feature::WARMBOOT: return true; case HwAsic::Feature::HOSTTABLE: case HwAsic::Feature::HASH_FIELDS_CUSTOMIZATION: @@ -124,7 +125,6 @@ bool GaronneAsic::isSupported(Feature feature) const { case HwAsic::Feature::FABRIC_TX_QUEUES: case HwAsic::Feature::SAI_PORT_VCO_CHANGE: case HwAsic::Feature::SAI_TTL0_PACKET_FORWARD_ENABLE: - case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::DLB: case HwAsic::Feature::P4_WARMBOOT: diff --git a/fboss/agent/hw/switch_asics/HwAsic.h b/fboss/agent/hw/switch_asics/HwAsic.h index 6b3ad2a4b765d..66df48d3afa50 100644 --- a/fboss/agent/hw/switch_asics/HwAsic.h +++ b/fboss/agent/hw/switch_asics/HwAsic.h @@ -120,7 +120,7 @@ class HwAsic { FABRIC_TX_QUEUES, SAI_PORT_VCO_CHANGE, SAI_TTL0_PACKET_FORWARD_ENABLE, - XPHY_SAI_WARMBOOT, + WARMBOOT, SHARED_INGRESS_EGRESS_BUFFER_POOL, ROUTE_METADATA, DLB, diff --git a/fboss/agent/hw/switch_asics/IndusAsic.cpp b/fboss/agent/hw/switch_asics/IndusAsic.cpp index 9cf54edef83da..9667c8882b03e 100644 --- a/fboss/agent/hw/switch_asics/IndusAsic.cpp +++ b/fboss/agent/hw/switch_asics/IndusAsic.cpp @@ -120,7 +120,7 @@ bool IndusAsic::isSupported(Feature feature) const { case HwAsic::Feature::XPHY_PORT_STATE_TOGGLE: case HwAsic::Feature::SAI_PORT_GET_PMD_LANES: case HwAsic::Feature::SAI_PORT_VCO_CHANGE: - case HwAsic::Feature::XPHY_SAI_WARMBOOT: + case HwAsic::Feature::WARMBOOT: case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::DLB: case HwAsic::Feature::P4_WARMBOOT: diff --git a/fboss/agent/hw/switch_asics/MarvelPhyAsic.cpp b/fboss/agent/hw/switch_asics/MarvelPhyAsic.cpp index 57cd6c0e09680..f763681177bb2 100644 --- a/fboss/agent/hw/switch_asics/MarvelPhyAsic.cpp +++ b/fboss/agent/hw/switch_asics/MarvelPhyAsic.cpp @@ -15,7 +15,7 @@ bool MarvelPhyAsic::isSupported(Feature feature) const { return true; // TODO(rajank): // Enable PHY Warmboot once tested - case HwAsic::Feature::XPHY_SAI_WARMBOOT: + case HwAsic::Feature::WARMBOOT: return false; default: return false; diff --git a/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp b/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp index 8489536aae932..b43793af2fcbb 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp +++ b/fboss/agent/hw/switch_asics/Tomahawk3Asic.cpp @@ -74,6 +74,7 @@ bool Tomahawk3Asic::isSupported(Feature feature) const { case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::DLB: case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: + case HwAsic::Feature::WARMBOOT: return true; case HwAsic::Feature::HOSTTABLE_FOR_HOSTROUTES: @@ -116,7 +117,6 @@ bool Tomahawk3Asic::isSupported(Feature feature) const { case HwAsic::Feature::FABRIC_TX_QUEUES: case HwAsic::Feature::SAI_PORT_VCO_CHANGE: case HwAsic::Feature::SAI_TTL0_PACKET_FORWARD_ENABLE: - case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::P4_WARMBOOT: case HwAsic::Feature::FEC_AM_LOCK_STATUS: diff --git a/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp b/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp index aaf6e5d97d332..890e9e9241748 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp +++ b/fboss/agent/hw/switch_asics/Tomahawk4Asic.cpp @@ -93,6 +93,7 @@ bool Tomahawk4Asic::isSupported(Feature feature) const { case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::DLB: case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: + case HwAsic::Feature::WARMBOOT: return true; // features only supported by B0 version, or any physical device // where used chip is always B0. @@ -137,7 +138,6 @@ bool Tomahawk4Asic::isSupported(Feature feature) const { case HwAsic::Feature::XPHY_PORT_STATE_TOGGLE: case HwAsic::Feature::FABRIC_TX_QUEUES: case HwAsic::Feature::SAI_TTL0_PACKET_FORWARD_ENABLE: - case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::P4_WARMBOOT: case HwAsic::Feature::FEC_AM_LOCK_STATUS: diff --git a/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp b/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp index 5bed9af8b9726..8d9295de33617 100644 --- a/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp +++ b/fboss/agent/hw/switch_asics/Tomahawk5Asic.cpp @@ -78,6 +78,7 @@ bool Tomahawk5Asic::isSupported(Feature feature) const { case HwAsic::Feature::WEIGHTED_NEXTHOPGROUP_MEMBER: case HwAsic::Feature::DLB: case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: + case HwAsic::Feature::WARMBOOT: return true; // features not working well with bcmsim case HwAsic::Feature::MIRROR_PACKET_TRUNCATION: @@ -117,7 +118,6 @@ bool Tomahawk5Asic::isSupported(Feature feature) const { case HwAsic::Feature::XPHY_PORT_STATE_TOGGLE: case HwAsic::Feature::FABRIC_TX_QUEUES: case HwAsic::Feature::SAI_TTL0_PACKET_FORWARD_ENABLE: - case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::P4_WARMBOOT: case HwAsic::Feature::FEC_AM_LOCK_STATUS: diff --git a/fboss/agent/hw/switch_asics/TomahawkAsic.cpp b/fboss/agent/hw/switch_asics/TomahawkAsic.cpp index 08c6dba862f56..283aaf527a1fe 100644 --- a/fboss/agent/hw/switch_asics/TomahawkAsic.cpp +++ b/fboss/agent/hw/switch_asics/TomahawkAsic.cpp @@ -63,6 +63,7 @@ bool TomahawkAsic::isSupported(Feature feature) const { case HwAsic::Feature::QOS_MAP_GLOBAL: case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: + case HwAsic::Feature::WARMBOOT: return true; case HwAsic::Feature::HOSTTABLE_FOR_HOSTROUTES: @@ -115,7 +116,6 @@ bool TomahawkAsic::isSupported(Feature feature) const { case HwAsic::Feature::FABRIC_TX_QUEUES: case HwAsic::Feature::SAI_PORT_VCO_CHANGE: case HwAsic::Feature::SAI_TTL0_PACKET_FORWARD_ENABLE: - case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::DLB: case HwAsic::Feature::P4_WARMBOOT: diff --git a/fboss/agent/hw/switch_asics/Trident2Asic.cpp b/fboss/agent/hw/switch_asics/Trident2Asic.cpp index 955e2780999be..413338f88989e 100644 --- a/fboss/agent/hw/switch_asics/Trident2Asic.cpp +++ b/fboss/agent/hw/switch_asics/Trident2Asic.cpp @@ -46,6 +46,7 @@ bool Trident2Asic::isSupported(Feature feature) const { case HwAsic::Feature::ECMP_MEMBER_WIDTH_INTROSPECTION: case HwAsic::Feature::ROUTE_METADATA: case HwAsic::Feature::IN_PAUSE_INCREMENTS_DISCARDS: + case HwAsic::Feature::WARMBOOT: return true; case HwAsic::Feature::ERSPANv6: @@ -115,7 +116,6 @@ bool Trident2Asic::isSupported(Feature feature) const { case HwAsic::Feature::FABRIC_TX_QUEUES: case HwAsic::Feature::SAI_PORT_VCO_CHANGE: case HwAsic::Feature::SAI_TTL0_PACKET_FORWARD_ENABLE: - case HwAsic::Feature::XPHY_SAI_WARMBOOT: case HwAsic::Feature::SHARED_INGRESS_EGRESS_BUFFER_POOL: case HwAsic::Feature::DLB: case HwAsic::Feature::P4_WARMBOOT: diff --git a/fboss/lib/phy/SaiPhyManager.cpp b/fboss/lib/phy/SaiPhyManager.cpp index f99746309d896..f449c5944b9d6 100644 --- a/fboss/lib/phy/SaiPhyManager.cpp +++ b/fboss/lib/phy/SaiPhyManager.cpp @@ -1097,7 +1097,7 @@ void SaiPhyManager::gracefulExit() { for (auto& platformItr : pimPlatform) { GlobalXphyID xphyID = platformItr.first; if (!getSaiPlatform(xphyID)->getAsic()->isSupported( - HwAsic::Feature::XPHY_SAI_WARMBOOT)) { + HwAsic::Feature::WARMBOOT)) { XLOG(DBG3) << "gracefulExit: Warmboot not supported for this platform"; return; } From 4fd7431c004a47bb88722f19fe88ce6d5422fbfb Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 22:11:30 -0800 Subject: [PATCH 241/280] Only warmboot if the ASIC supports it Summary: Currently our VOQ ASICs don't support WB so by trying to WB on them we hit errors on the WB exit path. This causes us to not run many tests giving us poorer test coverage. Instead, just limit WBs to where we have support for it. Differential Revision: D43174693 Privacy Context Container: L1125642 fbshipit-source-id: b7dfd959c489219d09a0e43305a51a30b6f6374c --- fboss/agent/HwSwitch.cpp | 8 ++++++++ fboss/agent/HwSwitch.h | 4 +--- fboss/agent/hw/test/HwTest.h | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fboss/agent/HwSwitch.cpp b/fboss/agent/HwSwitch.cpp index db2f2ea3761ea..2e4b3d7148d0e 100644 --- a/fboss/agent/HwSwitch.cpp +++ b/fboss/agent/HwSwitch.cpp @@ -72,4 +72,12 @@ uint32_t HwSwitch::generateDeterministicSeed(LoadBalancerID loadBalancerID) { return generateDeterministicSeed( loadBalancerID, getPlatform()->getLocalMac()); } + +void HwSwitch::gracefulExit( + folly::dynamic& follySwitchState, + state::WarmbootState& thriftSwitchState) { + if (getPlatform()->getAsic()->isSupported(HwAsic::Feature::WARMBOOT)) { + gracefulExitImpl(follySwitchState, thriftSwitchState); + } +} } // namespace facebook::fboss diff --git a/fboss/agent/HwSwitch.h b/fboss/agent/HwSwitch.h index d63978985cf1a..702c2637e4554 100644 --- a/fboss/agent/HwSwitch.h +++ b/fboss/agent/HwSwitch.h @@ -275,9 +275,7 @@ class HwSwitch { */ void gracefulExit( folly::dynamic& follySwitchState, - state::WarmbootState& thriftSwitchState) { - gracefulExitImpl(follySwitchState, thriftSwitchState); - } + state::WarmbootState& thriftSwitchState); /* * Get Hw Switch state in a folly::dynamic diff --git a/fboss/agent/hw/test/HwTest.h b/fboss/agent/hw/test/HwTest.h index b5fc852314170..b72e658684fe5 100644 --- a/fboss/agent/hw/test/HwTest.h +++ b/fboss/agent/hw/test/HwTest.h @@ -133,7 +133,7 @@ class HwTest : public ::testing::Test, logStage("verifyPostWarmboot()"); verifyPostWarmboot(); } - if (FLAGS_setup_for_warmboot) { + if (FLAGS_setup_for_warmboot && isSupported(HwAsic::Feature::WARMBOOT)) { logStage("tearDownSwitchEnsemble() for warmboot"); tearDownSwitchEnsemble(true); } From 95d9a6fc788e4abe38bc9c9e5cc3d8a3e9ec9ef4 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 22:11:30 -0800 Subject: [PATCH 242/280] Greenlight more voq tests now that WB is disabled Summary: As titled. More tests become runnable now Reviewed By: nivinl Differential Revision: D43175623 fbshipit-source-id: 5c8efa7dbf1758418c18c2f288ee32498d650774 --- installer/centos-7-x86_64/run_scripts/run_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 8032a15ee517f..7729db2e813d3 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -84,8 +84,8 @@ # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwEcmpTest.*:-*Ucmp* # Load Balancer Tests # UCMP support lacking in DNX -# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV4.*:-*Ucmp*:-*Shrink* -# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV6.*:-*Ucmp*:-*Shrink* +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV4.*:-*Ucmp* +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerTestV6.*:-*Ucmp* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwHashConsistencyTest.*:-*EcmpExpand*:*MemberOrder* # LB Tests with ROCE traffic # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwLoadBalancerNegativeTestV6RoCE.* From ed08744f89f4288c91d3c90253d186df48ea0fe5 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Thu, 9 Feb 2023 22:11:30 -0800 Subject: [PATCH 243/280] Add FNs to DsfNodes map in test config Summary: In prod configs we have both IN/FN reflect that in tests as well. Reviewed By: nivinl Differential Revision: D43177286 fbshipit-source-id: e00c1b8988ae5b6e054a25ec819b764bd56a10c7 --- fboss/agent/state/tests/DsfNodeTests.cpp | 22 +++++++++++----------- fboss/agent/test/TestUtils.cpp | 21 ++++++++++++++------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/fboss/agent/state/tests/DsfNodeTests.cpp b/fboss/agent/state/tests/DsfNodeTests.cpp index a895b77c398a7..5a2ca5714a949 100644 --- a/fboss/agent/state/tests/DsfNodeTests.cpp +++ b/fboss/agent/state/tests/DsfNodeTests.cpp @@ -91,13 +91,13 @@ TEST(DsfNode, dsfNodeApplyConfig) { auto config = testConfigA(cfg::SwitchType::VOQ); auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); ASSERT_NE(nullptr, stateV1); - EXPECT_EQ(stateV1->getDsfNodes()->size(), 1); + EXPECT_EQ(stateV1->getDsfNodes()->size(), 2); // Add node - config.dsfNodes()->insert({2, makeDsfNodeCfg(2)}); + config.dsfNodes()->insert({5, makeDsfNodeCfg(5)}); auto stateV2 = publishAndApplyConfig(stateV1, &config, platform.get()); ASSERT_NE(nullptr, stateV2); - EXPECT_EQ(stateV2->getDsfNodes()->size(), 2); + EXPECT_EQ(stateV2->getDsfNodes()->size(), 3); EXPECT_EQ( stateV2->getRemoteSystemPorts()->size(), stateV1->getRemoteSystemPorts()->size() + 1); @@ -106,13 +106,13 @@ TEST(DsfNode, dsfNodeApplyConfig) { stateV1->getRemoteInterfaces()->size() + 1); // Update node - config.dsfNodes()->erase(2); - auto updatedDsfNode = makeDsfNodeCfg(2); + config.dsfNodes()->erase(5); + auto updatedDsfNode = makeDsfNodeCfg(5); updatedDsfNode.name() = "newName"; - config.dsfNodes()->insert({2, updatedDsfNode}); + config.dsfNodes()->insert({5, updatedDsfNode}); auto stateV3 = publishAndApplyConfig(stateV2, &config, platform.get()); ASSERT_NE(nullptr, stateV3); - EXPECT_EQ(stateV3->getDsfNodes()->size(), 2); + EXPECT_EQ(stateV3->getDsfNodes()->size(), 3); EXPECT_EQ( stateV3->getRemoteSystemPorts()->size(), stateV2->getRemoteSystemPorts()->size()); @@ -121,10 +121,10 @@ TEST(DsfNode, dsfNodeApplyConfig) { stateV2->getRemoteInterfaces()->size()); // Erase node - config.dsfNodes()->erase(2); + config.dsfNodes()->erase(5); auto stateV4 = publishAndApplyConfig(stateV3, &config, platform.get()); ASSERT_NE(nullptr, stateV4); - EXPECT_EQ(stateV4->getDsfNodes()->size(), 1); + EXPECT_EQ(stateV4->getDsfNodes()->size(), 2); EXPECT_EQ( stateV4->getRemoteSystemPorts()->size(), stateV3->getRemoteSystemPorts()->size() - 1); @@ -139,13 +139,13 @@ TEST(DsfNode, dsfNodeUpdateLocalDsfNodeConfig) { auto config = testConfigA(cfg::SwitchType::VOQ); auto stateV1 = publishAndApplyConfig(stateV0, &config, platform.get()); ASSERT_NE(nullptr, stateV1); - EXPECT_EQ(stateV1->getDsfNodes()->size(), 1); + EXPECT_EQ(stateV1->getDsfNodes()->size(), 2); EXPECT_GT(config.dsfNodes()[1].loopbackIps()->size(), 0); config.dsfNodes()[1].loopbackIps()->clear(); EXPECT_EQ(config.dsfNodes()[1].loopbackIps()->size(), 0); auto stateV2 = publishAndApplyConfig(stateV1, &config, platform.get()); ASSERT_NE(nullptr, stateV2); - EXPECT_EQ(stateV1->getDsfNodes()->size(), 1); + EXPECT_EQ(stateV1->getDsfNodes()->size(), 2); } TEST(DSFNode, loopackIpsSorted) { diff --git a/fboss/agent/test/TestUtils.cpp b/fboss/agent/test/TestUtils.cpp index 5c3bc6434a0e6..cd19f2cbfcdae 100644 --- a/fboss/agent/test/TestUtils.cpp +++ b/fboss/agent/test/TestUtils.cpp @@ -204,6 +204,7 @@ cfg::SwitchConfig testConfigAImpl(bool isMhnic, cfg::SwitchType switchType) { } else { cfg.switchSettings()->switchId() = 1; if (switchType == cfg::SwitchType::VOQ) { + // Add config for VOQ DsfNode cfg::DsfNode myNode = makeDsfNodeCfg(1); cfg.dsfNodes()->insert({*myNode.switchId(), myNode}); cfg.interfaces()->resize(kPortCount); @@ -230,6 +231,10 @@ cfg::SwitchConfig testConfigAImpl(bool isMhnic, cfg::SwitchType switchType) { recyclePort.portType() = cfg::PortType::RECYCLE_PORT; cfg.ports()->push_back(recyclePort); addRecyclePortRif(myNode, cfg); + // Add a fabric node to DSF node as well. In prod DsfNode map will have + // both IN and FN nodes + auto fnNode = makeDsfNodeCfg(2, cfg::DsfNodeType::FABRIC_NODE); + cfg.dsfNodes()->insert({*fnNode.switchId(), fnNode}); } } @@ -301,13 +306,15 @@ cfg::DsfNode makeDsfNodeCfg(int64_t switchId, cfg::DsfNodeType type) { dsfNodeCfg.switchId() = switchId; dsfNodeCfg.name() = folly::sformat("dsfNodeCfg{}", switchId); dsfNodeCfg.type() = type; - const auto kBlockSize{100}; - cfg::Range64 sysPortRange; - sysPortRange.minimum() = switchId * kBlockSize; - sysPortRange.maximum() = switchId * kBlockSize + kBlockSize; - dsfNodeCfg.systemPortRange() = sysPortRange; - dsfNodeCfg.loopbackIps() = getLoopbackIps(switchId); - dsfNodeCfg.nodeMac() = "02:00:00:00:0F:0B"; + if (type == cfg::DsfNodeType::INTERFACE_NODE) { + const auto kBlockSize{100}; + cfg::Range64 sysPortRange; + sysPortRange.minimum() = switchId * kBlockSize; + sysPortRange.maximum() = switchId * kBlockSize + kBlockSize; + dsfNodeCfg.systemPortRange() = sysPortRange; + dsfNodeCfg.loopbackIps() = getLoopbackIps(switchId); + dsfNodeCfg.nodeMac() = "02:00:00:00:0F:0B"; + } dsfNodeCfg.asicType() = cfg::AsicType::ASIC_TYPE_MOCK; return dsfNodeCfg; } From 365c6026802f3fc8583969c8121e4112be8c0a96 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Thu, 9 Feb 2023 22:11:38 -0800 Subject: [PATCH 244/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/7c5353c07e90247b78ef98f9ee86bec8abca0a82 https://github.com/facebook/fbthrift/commit/619d10a0f655984a580b9bbd1674d90e68ed6cb0 https://github.com/facebook/proxygen/commit/d158d810d181b1a29b6923edc83de812542c3ce6 https://github.com/facebookincubator/velox/commit/fb33fbfec589547c1eda6ac1b9aa5dcb18f9c66f https://github.com/facebookresearch/vrs/commit/204e8eea5e3750f7f6e6105ef0d08a772884ad44 Reviewed By: yns88 fbshipit-source-id: 6e6b18f338714ecbf9e696e319321d70507cdb15 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 18010b80cdfe9..63c2deb0e9067 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 563aa29fe2e68427f65ccd0995a15754e803705a +Subproject commit 619d10a0f655984a580b9bbd1674d90e68ed6cb0 From c0232b5f49387122b49d15b3ca5dc172ebc2ed25 Mon Sep 17 00:00:00 2001 From: Siva Muthusamy Date: Thu, 9 Feb 2023 22:18:28 -0800 Subject: [PATCH 245/280] Update OSS' Makalu and Kamet configs Summary: Update OSS' Makalu and Kamet configs to latest Differential Revision: D43180847 fbshipit-source-id: 84573ef34b62d7202273ab808c4470f6bf4ebc79 --- fboss/bcm_sai_configs/kamet.agent.materialized_JSON | 1 + fboss/bcm_sai_configs/makalu.agent.materialized_JSON | 1 + 2 files changed, 2 insertions(+) diff --git a/fboss/bcm_sai_configs/kamet.agent.materialized_JSON b/fboss/bcm_sai_configs/kamet.agent.materialized_JSON index 9fb775e80c39e..4530534909556 100644 --- a/fboss/bcm_sai_configs/kamet.agent.materialized_JSON +++ b/fboss/bcm_sai_configs/kamet.agent.materialized_JSON @@ -1404,6 +1404,7 @@ "sai_pkt_rx_cfg_ppc": "16", "sai_pkt_rx_custom_cfg": "1", "sai_pkt_rx_pkt_size": "16512", + "sai_trigger_linkscan_remote_local_faults": "0", "sai_uncached_port_stats": "0x1", "sai_vfp_smac_drop_filter_disable": "1", "schan_intr_enable.BCM8879X": "0", diff --git a/fboss/bcm_sai_configs/makalu.agent.materialized_JSON b/fboss/bcm_sai_configs/makalu.agent.materialized_JSON index edc79cacc407c..1713aad30d6c1 100644 --- a/fboss/bcm_sai_configs/makalu.agent.materialized_JSON +++ b/fboss/bcm_sai_configs/makalu.agent.materialized_JSON @@ -2369,6 +2369,7 @@ "sai_pkt_rx_custom_cfg": "1", "sai_pkt_rx_pkt_size": "16512", "sai_recycle_port_lane_base": "220", + "sai_trigger_linkscan_remote_local_faults": "0", "sai_uncached_port_stats": "0x1", "sai_vfp_smac_drop_filter_disable": "1", "sat_enable.BCM8885X": "1", From 013d3fd92c22399fa19ee6ea2d2fe69f55e17d3f Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Fri, 10 Feb 2023 01:25:17 -0800 Subject: [PATCH 246/280] agent ensemble to support test ensemble interface Summary: as titled Reviewed By: jasmeetbagga Differential Revision: D43102983 Privacy Context Container: L1125642 fbshipit-source-id: 35534a26869997fc6f69785545cf94e4152d4427 --- fboss/agent/test/AgentEnsemble.cpp | 6 ++-- fboss/agent/test/AgentEnsemble.h | 49 +++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/fboss/agent/test/AgentEnsemble.cpp b/fboss/agent/test/AgentEnsemble.cpp index 6dcc754b7245e..546e53e571926 100644 --- a/fboss/agent/test/AgentEnsemble.cpp +++ b/fboss/agent/test/AgentEnsemble.cpp @@ -125,7 +125,9 @@ AgentEnsemble::~AgentEnsemble() { initializer->stopAgent(false); } -void AgentEnsemble::applyNewConfig(cfg::SwitchConfig& config, bool activate) { +void AgentEnsemble::applyNewConfig( + const cfg::SwitchConfig& config, + bool activate) { writeConfig(config); if (activate) { getSw()->applyConfig("applying new config", config); @@ -175,7 +177,7 @@ void AgentEnsemble::gracefulExit() { } std::shared_ptr AgentEnsemble::applyNewState( - const std::shared_ptr& state, + std::shared_ptr state, bool transaction) { if (!state) { return getSw()->getState(); diff --git a/fboss/agent/test/AgentEnsemble.h b/fboss/agent/test/AgentEnsemble.h index 2c926acc1c2f8..119a73c75cd46 100644 --- a/fboss/agent/test/AgentEnsemble.h +++ b/fboss/agent/test/AgentEnsemble.h @@ -7,9 +7,11 @@ #include #include #include +#include "fboss/agent/L2Entry.h" #include "fboss/agent/Main.h" #include "fboss/agent/test/RouteDistributionGenerator.h" +#include "fboss/agent/test/TestEnsembleIf.h" DECLARE_string(config); DECLARE_bool(setup_for_warmboot); @@ -20,7 +22,7 @@ using AgentEnsembleSwitchConfigFn = std::function< cfg::SwitchConfig(HwSwitch* hwSwitch, const std::vector&)>; using AgentEnsemblePlatformConfigFn = std::function; -class AgentEnsemble { +class AgentEnsemble : public TestEnsembleIf { public: AgentEnsemble() {} explicit AgentEnsemble(const std::string& configFileName); @@ -37,7 +39,7 @@ class AgentEnsemble { void startAgent(); - void applyNewConfig(cfg::SwitchConfig& config, bool activate = true); + void applyNewConfig(const cfg::SwitchConfig& config, bool activate); const AgentInitializer* agentInitializer() const { return &agentInitializer_; @@ -51,6 +53,20 @@ class AgentEnsemble { return agentInitializer_.sw(); } + std::shared_ptr getProgrammedState() const override { + return getSw()->getState(); + } + + void applyInitialConfig(const cfg::SwitchConfig& /* config */) override { + throw FbossError("Not Implement"); + } + + std::shared_ptr applyNewConfig( + const cfg::SwitchConfig& config) override { + applyNewConfig(config, true); + return getProgrammedState(); + } + Platform* getPlatform() const { return agentInitializer_.platform(); } @@ -60,8 +76,8 @@ class AgentEnsemble { } std::shared_ptr applyNewState( - const std::shared_ptr& state, - bool transaction = false); + std::shared_ptr state, + bool transaction = false) override; const std::vector& masterLogicalPortIds() const; @@ -83,6 +99,31 @@ class AgentEnsemble { static std::string getInputConfigFile(); + void packetReceived(std::unique_ptr /*pkt*/) noexcept override {} + + void linkStateChanged( + PortID /*port*/, + bool /*up*/, + std::optional /*iPhyFaultStatus*/ = + std::nullopt) override {} + + void l2LearningUpdateReceived( + L2Entry /* l2Entry */, + L2EntryUpdateType /*l2EntryUpdateType*/) override {} + + void exitFatal() const noexcept override {} + + void pfcWatchdogStateChanged(const PortID& /*port*/, const bool /*deadlock*/) + override {} + + HwSwitch* getHwSwitch() override { + return getHw(); + } + + const HwSwitch* getHwSwitch() const override { + return getHw(); + } + private: void writeConfig(const cfg::SwitchConfig& config); void writeConfig(const cfg::AgentConfig& config); From 27d4b69d10c69e47a166dcf8962c8ef443ca1c9b Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 10 Feb 2023 02:11:57 -0800 Subject: [PATCH 247/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/ocamlrep/commit/51857d5dcb0a82f5293b8a0c8e3cd16f28b55544 https://github.com/facebook/wangle/commit/31f17272bf194affdf323971eef9a7d2ecbcb6ec https://github.com/facebookincubator/katran/commit/bd8489814c9694488e97975c016be5fdb1ba43ad https://github.com/facebookincubator/mvfst/commit/e058ee301807c6faf363f6988206706eb5b428ce Reviewed By: yns88 fbshipit-source-id: eebaa17c5ac055663e55ec787f02aa1d7672daa3 --- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index c786e522805a3..409dea0a86400 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 8a5f2315a523963ef283ff64ec118947d422ce1c +Subproject commit 31f17272bf194affdf323971eef9a7d2ecbcb6ec From 18e1295f947b70f5ca8293179d1c81a91c833291 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Fri, 10 Feb 2023 02:31:58 -0800 Subject: [PATCH 248/280] Watermark stat collection for VOQs Summary: As titled. This currently fails, so I won't land this diff. Working with vendor on a CSP to resolve Reviewed By: nivinl Differential Revision: D42395938 fbshipit-source-id: 0a56b14e7fae19aefe47bcf83b2f6f78f0facc20 --- fboss/agent/hw/sai/switch/SaiQueueManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fboss/agent/hw/sai/switch/SaiQueueManager.cpp b/fboss/agent/hw/sai/switch/SaiQueueManager.cpp index 471de996efc24..ccff2979aaaf0 100644 --- a/fboss/agent/hw/sai/switch/SaiQueueManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiQueueManager.cpp @@ -406,7 +406,8 @@ void SaiQueueManager::updateStats( queueHandle->queue->updateStats( nonWatermarkStatsReadAndClear, SAI_STATS_MODE_READ_AND_CLEAR); if (updateWatermarks) { - // TODO collect watermarks on VOQ + queueHandle->queue->updateStats( + watermarkStatsReadAndClear, SAI_STATS_MODE_READ_AND_CLEAR); } const auto& counters = queueHandle->queue->getStats(); auto queueId = SaiApiTable::getInstance()->queueApi().getAttribute( From 0d1a215cc2d45a2b55af9633176ed5964f7f41dc Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Fri, 10 Feb 2023 10:27:37 -0800 Subject: [PATCH 249/280] Fix data race with the read/write of lastDownTime_ Summary: Fixes the following TSAN data race - ``` Write of size 8 at 0x7b8400009888 by thread T40 (mutexes: write M507916304074681368, read M61215687833552496): #0 facebook::fboss::QsfpModule::markLastDownTime() fboss/qsfp_service/module/QsfpModule.cpp:951 (qsfp_service+0x206ea68) #1 facebook::fboss::TransceiverManager::markLastDownTime(facebook::fboss::TransceiverID) fboss/qsfp_service/TransceiverManager.cpp:1279 (qsfp_service+0x2143c4a) #2 void facebook::fboss::markLastDownTime_impl::operator() > const&) fboss/qsfp_service/TransceiverManager.cpp:1257 (qsfp_service+0x212d79a) #4 facebook::fboss::TransceiverManager::refreshStateMachines() fboss/qsfp_service/TransceiverManager.cpp:978 (qsfp_service+0x2142a52) ``` Reviewed By: rajank7 Differential Revision: D43183960 Privacy Context Container: L1125642 fbshipit-source-id: 9169d1ea2f03db86cbfa20b9f3e615b0871ea2ec --- fboss/qsfp_service/module/QsfpModule.cpp | 10 +++++----- fboss/qsfp_service/module/QsfpModule.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fboss/qsfp_service/module/QsfpModule.cpp b/fboss/qsfp_service/module/QsfpModule.cpp index 2bcec379bfc30..caf5afc2b19f3 100644 --- a/fboss/qsfp_service/module/QsfpModule.cpp +++ b/fboss/qsfp_service/module/QsfpModule.cpp @@ -646,10 +646,10 @@ bool QsfpModule::shouldRemediateLocked() { // `FLAGS_remediate_interval`, instead we just need to wait for // `FLAGS_initial_remediate_interval`. (D26014510) bool remediationCooled = false; - if (lastDownTime_ > lastRemediateTime_) { - // New lastDownTime_ means the port just recently went down - remediationCooled = - (now - lastDownTime_) > FLAGS_initial_remediate_interval; + auto lastDownTime = lastDownTime_.load(); + if (lastDownTime > lastRemediateTime_) { + // New lastDownTime means the port just recently went down + remediationCooled = (now - lastDownTime) > FLAGS_initial_remediate_interval; } else { remediationCooled = (now - lastRemediateTime_) > FLAGS_remediate_interval; } @@ -948,7 +948,7 @@ bool QsfpModule::tryRemediateLocked() { } void QsfpModule::markLastDownTime() { - lastDownTime_ = std::time(nullptr); + lastDownTime_.store(std::time(nullptr)); } /* diff --git a/fboss/qsfp_service/module/QsfpModule.h b/fboss/qsfp_service/module/QsfpModule.h index 7760087215206..276db2c96c50d 100644 --- a/fboss/qsfp_service/module/QsfpModule.h +++ b/fboss/qsfp_service/module/QsfpModule.h @@ -217,7 +217,7 @@ class QsfpModule : public Transceiver { void markLastDownTime() override; time_t getLastDownTime() const override { - return lastDownTime_; + return lastDownTime_.load(); } phy::PrbsStats getPortPrbsStats(phy::Side side) override { @@ -268,7 +268,7 @@ class QsfpModule : public Transceiver { time_t lastRemediateTime_{0}; // last time we know that no port was up on this transceiver. - time_t lastDownTime_{0}; + std::atomic lastDownTime_{0}; // Diagnostic capabilities of the module folly::Synchronized> diagsCapability_; From 286422c07f5c6a369bf47e62830ae464581adcc9 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 10 Feb 2023 12:12:05 -0800 Subject: [PATCH 250/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/62bebb2de535213d67912b155081126530158752 https://github.com/facebookresearch/vrs/commit/65ac2f8743973c85711de08c4c155eea6688682d https://github.com/pytorch/fbgemm/commit/03b2046676707da64504e898490ab46104d4682a Reviewed By: yns88 fbshipit-source-id: 747c0d2411ce72b52d4c9ed2c2871288d3e91467 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 63c2deb0e9067..e966cb8485ade 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 619d10a0f655984a580b9bbd1674d90e68ed6cb0 +Subproject commit 62bebb2de535213d67912b155081126530158752 From 2fc68e92261ca052036fcec4854ed6911a374f17 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 10 Feb 2023 13:12:23 -0800 Subject: [PATCH 251/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/e79c3f02d390dac8bbd214e4e312e693548c0abf https://github.com/facebook/watchman/commit/0f958ec5b7e9d0e54fe8831cd25e2b8cd73ba687 https://github.com/facebookincubator/velox/commit/c6b69effdcf6dcb567bdace655c73023d3419f76 Reviewed By: yns88 fbshipit-source-id: 802180bfb56356cc65d5a2f96e50018865015fc0 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index e966cb8485ade..2181da48d539b 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 62bebb2de535213d67912b155081126530158752 +Subproject commit e79c3f02d390dac8bbd214e4e312e693548c0abf From 47ff4a32f46e6cd286226a51033650b8241bcd25 Mon Sep 17 00:00:00 2001 From: Rohit Puri Date: Fri, 10 Feb 2023 13:24:58 -0800 Subject: [PATCH 252/280] Add Out pfc statistics collection Summary: It was mistakenly removed. (D41702623 (https://github.com/facebook/fboss/commit/a77127966455bd721d3f442d7e824daf97b7df6f)) Adding it back. Differential Revision: D43194117 Privacy Context Container: L1125642 fbshipit-source-id: 9a204aa83eacab455bd31e5f0baad003930de14c --- fboss/agent/hw/bcm/BcmPort.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fboss/agent/hw/bcm/BcmPort.cpp b/fboss/agent/hw/bcm/BcmPort.cpp index 7b5bfb0a89750..27a2b8bdc41b2 100644 --- a/fboss/agent/hw/bcm/BcmPort.cpp +++ b/fboss/agent/hw/bcm/BcmPort.cpp @@ -1641,6 +1641,10 @@ void BcmPort::updatePortPfcStats( } } + // out pfc collection + updateStat( + now, kOutPfc(), snmpBcmTxPFCControlFrame, &(*portStats.outPfcCtrl_())); + /* * PFC count will be subtracted from the discards to compute the actual * discards Read discards first followed by PFC count. This will ensure that From 60b0d3dd8efd017fc099e3deb14783019d468039 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 10 Feb 2023 14:13:00 -0800 Subject: [PATCH 253/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/597ac1d2bb69f75594b459266d68e9d4bbf86c30 https://github.com/facebookincubator/velox/commit/cb932771a4887024cfc291e8072e55b6759b5549 Reviewed By: yns88 fbshipit-source-id: a5176396999ea7e2dc07f73ba3b288a12813d919 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 2181da48d539b..a375ad6e33ce5 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit e79c3f02d390dac8bbd214e4e312e693548c0abf +Subproject commit 597ac1d2bb69f75594b459266d68e9d4bbf86c30 From f747d40ff00fe30987ac347b27f3147067312b46 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Fri, 10 Feb 2023 14:14:08 -0800 Subject: [PATCH 254/280] Remove some @manual dependencies from fboss/agent:core Reviewed By: jasmeetbagga Differential Revision: D43169689 fbshipit-source-id: 7a8d9158686cc19a6b2fa8f39ae34f40046781e5 --- fboss/agent/hw/test/HwRouteScaleTest.cpp | 1 - fboss/agent/test/MultiNodeTest.cpp | 1 - fboss/agent/test/TestUtils.cpp | 1 - fboss/agent/test/integration_tests/AgentIntegrationTest.cpp | 1 - fboss/agent/test/link_tests/LinkTest.cpp | 1 - fboss/agent/test/soak_tests/InterruptTest.cpp | 1 - fboss/agent/test/soak_tests/SoakTest.cpp | 1 - 7 files changed, 7 deletions(-) diff --git a/fboss/agent/hw/test/HwRouteScaleTest.cpp b/fboss/agent/hw/test/HwRouteScaleTest.cpp index f7a9ba0a5d0ec..adc3c23003eae 100644 --- a/fboss/agent/hw/test/HwRouteScaleTest.cpp +++ b/fboss/agent/hw/test/HwRouteScaleTest.cpp @@ -10,7 +10,6 @@ #include "fboss/agent/hw/test/HwTest.h" -#include "fboss/agent/platforms/tests/utils/CreateTestPlatform.h" #include "fboss/agent/test/RouteScaleGenerators.h" #include "fboss/agent/HwSwitch.h" diff --git a/fboss/agent/test/MultiNodeTest.cpp b/fboss/agent/test/MultiNodeTest.cpp index c37f6a8f3ccef..59131d76147f0 100644 --- a/fboss/agent/test/MultiNodeTest.cpp +++ b/fboss/agent/test/MultiNodeTest.cpp @@ -16,7 +16,6 @@ #include "fboss/agent/AgentConfig.h" #include "fboss/agent/SwSwitch.h" #include "fboss/agent/hw/test/ConfigFactory.h" -#include "fboss/agent/platforms/wedge/WedgePlatformInit.h" #include "fboss/agent/state/Port.h" #include "fboss/agent/state/SwitchState.h" #include "fboss/agent/test/MultiNodeTest.h" diff --git a/fboss/agent/test/TestUtils.cpp b/fboss/agent/test/TestUtils.cpp index cd19f2cbfcdae..1a994c34ed823 100644 --- a/fboss/agent/test/TestUtils.cpp +++ b/fboss/agent/test/TestUtils.cpp @@ -19,7 +19,6 @@ #include "fboss/agent/gen-cpp2/switch_config_types.h" #include "fboss/agent/hw/mock/MockHwSwitch.h" #include "fboss/agent/hw/mock/MockPlatform.h" -#include "fboss/agent/platforms/wedge/WedgePlatformInit.h" #include "fboss/agent/state/Interface.h" #include "fboss/agent/state/Port.h" #include "fboss/agent/state/RouteNextHop.h" diff --git a/fboss/agent/test/integration_tests/AgentIntegrationTest.cpp b/fboss/agent/test/integration_tests/AgentIntegrationTest.cpp index 376aea3f3873f..2a1c34648d6e4 100644 --- a/fboss/agent/test/integration_tests/AgentIntegrationTest.cpp +++ b/fboss/agent/test/integration_tests/AgentIntegrationTest.cpp @@ -14,7 +14,6 @@ #include "fboss/agent/hw/test/ConfigFactory.h" #include "fboss/agent/hw/test/HwTestPacketUtils.h" #include "fboss/agent/hw/test/LoadBalancerUtils.h" -#include "fboss/agent/platforms/wedge/WedgePlatformInit.h" #include "fboss/agent/state/SwitchState.h" #include "fboss/agent/test/EcmpSetupHelper.h" #include "fboss/agent/test/integration_tests/AgentIntegrationTest.h" diff --git a/fboss/agent/test/link_tests/LinkTest.cpp b/fboss/agent/test/link_tests/LinkTest.cpp index 3e5708f814475..c74e86efde445 100644 --- a/fboss/agent/test/link_tests/LinkTest.cpp +++ b/fboss/agent/test/link_tests/LinkTest.cpp @@ -11,7 +11,6 @@ #include "fboss/agent/hw/gen-cpp2/hardware_stats_types.h" #include "fboss/agent/hw/test/LoadBalancerUtils.h" #include "fboss/agent/hw/test/dataplane_tests/HwTestQosUtils.h" -#include "fboss/agent/platforms/wedge/WedgePlatformInit.h" #include "fboss/agent/state/Port.h" #include "fboss/agent/state/PortMap.h" #include "fboss/agent/state/SwitchState.h" diff --git a/fboss/agent/test/soak_tests/InterruptTest.cpp b/fboss/agent/test/soak_tests/InterruptTest.cpp index 89cb5c03ff81c..ccc1003098834 100644 --- a/fboss/agent/test/soak_tests/InterruptTest.cpp +++ b/fboss/agent/test/soak_tests/InterruptTest.cpp @@ -12,7 +12,6 @@ #include "fboss/agent/hw/test/ConfigFactory.h" #include "fboss/agent/hw/test/HwTestPacketUtils.h" #include "fboss/agent/hw/test/LoadBalancerUtils.h" -#include "fboss/agent/platforms/wedge/WedgePlatformInit.h" #include "fboss/agent/state/SwitchState.h" #include "fboss/agent/test/CounterCache.h" diff --git a/fboss/agent/test/soak_tests/SoakTest.cpp b/fboss/agent/test/soak_tests/SoakTest.cpp index 7a01eaa7c84ff..5600a77b385b3 100644 --- a/fboss/agent/test/soak_tests/SoakTest.cpp +++ b/fboss/agent/test/soak_tests/SoakTest.cpp @@ -3,7 +3,6 @@ #include #include -#include "fboss/agent/platforms/wedge/WedgePlatformInit.h" #include "fboss/agent/test/soak_tests/SoakTest.h" DEFINE_int32(soak_loops, -1, "Number of soak test loops to run"); From fde6080d750f03b3525b4c2030781c6a39db37c5 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Fri, 10 Feb 2023 14:14:08 -0800 Subject: [PATCH 255/280] Unravel agent/hw/test dependency from fboss/agent:core Summary: Inernal: fboss/agent:core had a manual dependency on hw/test:recursive_glob_headers. So, anyone fboss/agent:core ended up linking all the hw/test code. Clean up this dependency bloat Reviewed By: jasmeetbagga Differential Revision: D43169690 fbshipit-source-id: ddef6cfa535c57ac1c7eec5b71290cfa5ded5098 --- fboss/agent/hw/sai/hw_test/HwTestMplsUtils.cpp | 6 ++++-- fboss/agent/hw/test/HwTestMplsUtils.h | 1 - fboss/agent/hw/test/dataplane_tests/HwTestUtils.cpp | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fboss/agent/hw/sai/hw_test/HwTestMplsUtils.cpp b/fboss/agent/hw/sai/hw_test/HwTestMplsUtils.cpp index 96f95b0b27d5c..787b0ec7993b4 100644 --- a/fboss/agent/hw/sai/hw_test/HwTestMplsUtils.cpp +++ b/fboss/agent/hw/sai/hw_test/HwTestMplsUtils.cpp @@ -9,6 +9,10 @@ */ #include "fboss/agent/hw/test/HwTestMplsUtils.h" + +#include +#include + #include "fboss/agent/hw/sai/api/MplsApi.h" #include "fboss/agent/hw/sai/api/RouteApi.h" #include "fboss/agent/hw/sai/api/SaiApiTable.h" @@ -21,8 +25,6 @@ #include "fboss/agent/hw/sai/switch/SaiVirtualRouterManager.h" #include "fboss/agent/hw/test/HwSwitchEnsemble.h" -#include - extern "C" { #include } diff --git a/fboss/agent/hw/test/HwTestMplsUtils.h b/fboss/agent/hw/test/HwTestMplsUtils.h index 725d799f70b1f..bd621dbd2f598 100644 --- a/fboss/agent/hw/test/HwTestMplsUtils.h +++ b/fboss/agent/hw/test/HwTestMplsUtils.h @@ -9,7 +9,6 @@ */ #pragma once #include -#include "fboss/agent/hw/test/HwTest.h" #include "fboss/agent/state/LabelForwardingAction.h" #include "fboss/agent/test/EcmpSetupHelper.h" #include "fboss/agent/types.h" diff --git a/fboss/agent/hw/test/dataplane_tests/HwTestUtils.cpp b/fboss/agent/hw/test/dataplane_tests/HwTestUtils.cpp index c79b371fd325f..3525bf900ccb4 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwTestUtils.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwTestUtils.cpp @@ -12,7 +12,6 @@ #include "fboss/agent/TxPacket.h" #include "fboss/agent/hw/test/HwTestAclUtils.h" #include "fboss/agent/hw/test/HwTestCoppUtils.h" -#include "fboss/agent/hw/test/TrafficPolicyUtils.h" #include From 985016f45b0ffc4caf7dbac65f128e6fc4a3d9f6 Mon Sep 17 00:00:00 2001 From: Manikandan Somasundaram Date: Fri, 10 Feb 2023 14:14:08 -0800 Subject: [PATCH 256/280] Unravel agent/test dependency from fboss/agent:core Summary: Inernal: fboss/agent:core had a manual dependency on agent/test:recursive_glob_headers. So, anyone fboss/agent:core ended up linking all the agent/test code. Clean up this dependency bloat Reviewed By: jasmeetbagga Differential Revision: D43169686 fbshipit-source-id: 1c677c32554dfab79b3bf905e5c2517afb15c414 --- fboss/agent/hw/mock/MockTestHandle.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/fboss/agent/hw/mock/MockTestHandle.cpp b/fboss/agent/hw/mock/MockTestHandle.cpp index 9a56264361e02..8bc36b5b8910e 100644 --- a/fboss/agent/hw/mock/MockTestHandle.cpp +++ b/fboss/agent/hw/mock/MockTestHandle.cpp @@ -13,7 +13,6 @@ #include #include "fboss/agent/hw/mock/MockRxPacket.h" -#include "fboss/agent/test/TestUtils.h" namespace facebook::fboss { From 0e9843a8cac041b239215a1565cea2f2b757084a Mon Sep 17 00:00:00 2001 From: Srikrishna Gopu Date: Fri, 10 Feb 2023 14:18:31 -0800 Subject: [PATCH 257/280] enable multiple acl table + route counter + mpls for tajo sdk Summary: As titled, enable multiple acl table + route counter feature for tajo SDK This diff ensures 1.42.1 and 1.42.8 should not be impacted when enabling this feature knobs and should affect only 1.60.0 Reviewed By: jasmeetbagga Differential Revision: D43162978 fbshipit-source-id: f6d278c775e508d45b14b7ea3c0c2f614a42c963 --- fboss/agent/hw/bcm/tests/HwTestRouteUtils.cpp | 5 +++++ fboss/agent/hw/sai/hw_test/HwTestCoppUtils.cpp | 2 ++ fboss/agent/hw/sai/hw_test/HwTestRouteUtils.cpp | 9 +++++++++ .../hw/sai/hw_test/SaiAclTableGroupTests.cpp | 7 ++++++- .../SaiAclTableGroupTrafficTests.cpp | 14 ++++++++++++-- fboss/agent/hw/sai/switch/SaiAclTableManager.cpp | 16 ++++++++-------- .../hw/sai/switch/SaiDebugCounterManager.cpp | 9 +++++++-- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 16 ++++++++++++---- fboss/agent/hw/sai/switch/SaiSwitchManager.cpp | 3 +++ fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp | 2 ++ fboss/agent/hw/switch_asics/EbroAsic.cpp | 12 ++++++------ fboss/agent/hw/test/HwTestRouteUtils.h | 2 ++ .../test/dataplane_tests/HwRouteOverflowTest.cpp | 3 ++- .../hw/test/dataplane_tests/HwRouteStatTests.cpp | 3 +-- 14 files changed, 77 insertions(+), 26 deletions(-) diff --git a/fboss/agent/hw/bcm/tests/HwTestRouteUtils.cpp b/fboss/agent/hw/bcm/tests/HwTestRouteUtils.cpp index 613d3bea5f1eb..615a7d0f136fc 100644 --- a/fboss/agent/hw/bcm/tests/HwTestRouteUtils.cpp +++ b/fboss/agent/hw/bcm/tests/HwTestRouteUtils.cpp @@ -255,4 +255,9 @@ bool isHwRoutePresent( return isRoutePresent(bcmSwitch->getUnit(), rid, cidrNetwork); } +bool isRouteCounterSupported(const HwSwitch* hwSwitch) { + return hwSwitch->getPlatform()->getAsic()->isSupported( + HwAsic::Feature::ROUTE_COUNTERS); +} + } // namespace facebook::fboss::utility diff --git a/fboss/agent/hw/sai/hw_test/HwTestCoppUtils.cpp b/fboss/agent/hw/sai/hw_test/HwTestCoppUtils.cpp index 3ebb1ada398a5..65295b0082463 100644 --- a/fboss/agent/hw/sai/hw_test/HwTestCoppUtils.cpp +++ b/fboss/agent/hw/sai/hw_test/HwTestCoppUtils.cpp @@ -93,8 +93,10 @@ std::vector getCoppRxReasonToQueues( }; if (hwAsic->isSupported(HwAsic::Feature::SAI_MPLS_TTL_1_TRAP)) { +#if !defined(TAJO_SDK_VERSION_1_42_1) && !defined(TAJO_SDK_VERSION_1_42_8) rxReasonToQueues.push_back(ControlPlane::makeRxReasonToQueueEntry( cfg::PacketRxReason::MPLS_TTL_1, kCoppLowPriQueueId)); +#endif } #if !defined(SAI_VERSION_5_1_0_3_ODP) rxReasonToQueues.push_back(ControlPlane::makeRxReasonToQueueEntry( diff --git a/fboss/agent/hw/sai/hw_test/HwTestRouteUtils.cpp b/fboss/agent/hw/sai/hw_test/HwTestRouteUtils.cpp index 0ead38ad64748..12ce7d958eebb 100644 --- a/fboss/agent/hw/sai/hw_test/HwTestRouteUtils.cpp +++ b/fboss/agent/hw/sai/hw_test/HwTestRouteUtils.cpp @@ -184,4 +184,13 @@ bool isHwRoutePresent( return true; } + +bool isRouteCounterSupported(const HwSwitch* hwSwitch) { + bool routeCountersSupported = hwSwitch->getPlatform()->getAsic()->isSupported( + HwAsic::Feature::ROUTE_COUNTERS); +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + routeCountersSupported = false; +#endif + return routeCountersSupported; +} } // namespace facebook::fboss::utility diff --git a/fboss/agent/hw/sai/hw_test/SaiAclTableGroupTests.cpp b/fboss/agent/hw/sai/hw_test/SaiAclTableGroupTests.cpp index 8a738b5cb1289..e96918123feb6 100644 --- a/fboss/agent/hw/sai/hw_test/SaiAclTableGroupTests.cpp +++ b/fboss/agent/hw/sai/hw_test/SaiAclTableGroupTests.cpp @@ -55,7 +55,12 @@ class SaiAclTableGroupTest : public HwTest { } bool isSupported() const { - return HwTest::isSupported(HwAsic::Feature::MULTIPLE_ACL_TABLES); + bool multipleAclTableSupport = + HwTest::isSupported(HwAsic::Feature::MULTIPLE_ACL_TABLES); +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + multipleAclTableSupport = false; +#endif + return multipleAclTableSupport; } void addAclTable1(cfg::SwitchConfig& cfg) { diff --git a/fboss/agent/hw/sai/hw_test/dataplane_tests/SaiAclTableGroupTrafficTests.cpp b/fboss/agent/hw/sai/hw_test/dataplane_tests/SaiAclTableGroupTrafficTests.cpp index 3e434cf64a810..a1eae66092b70 100644 --- a/fboss/agent/hw/sai/hw_test/dataplane_tests/SaiAclTableGroupTrafficTests.cpp +++ b/fboss/agent/hw/sai/hw_test/dataplane_tests/SaiAclTableGroupTrafficTests.cpp @@ -331,7 +331,12 @@ class SaiAclTableGroupTrafficTest : public HwLinkStateDependentTest { } void verifyMultipleAclTablesHelper(bool frontPanel) { - ASSERT_TRUE(HwTest::isSupported(HwAsic::Feature::MULTIPLE_ACL_TABLES)); + bool multipleAclTableSupport = + HwTest::isSupported(HwAsic::Feature::MULTIPLE_ACL_TABLES); +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + multipleAclTableSupport = false; +#endif + ASSERT_TRUE(multipleAclTableSupport); auto setup = [this]() { resolveNeigborAndProgramRoutes(*helper_, kEcmpWidth); @@ -457,7 +462,12 @@ class SaiAclTableGroupTrafficTest : public HwLinkStateDependentTest { } void verifyDscpTtlAclTablesHelper(bool frontPanel) { - ASSERT_TRUE(HwTest::isSupported(HwAsic::Feature::MULTIPLE_ACL_TABLES)); + bool multipleAclTableSupport = + HwTest::isSupported(HwAsic::Feature::MULTIPLE_ACL_TABLES); +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + multipleAclTableSupport = false; +#endif + ASSERT_TRUE(multipleAclTableSupport); auto setup = [this]() { resolveNeigborAndProgramRoutes(*helper_, kEcmpWidth); diff --git a/fboss/agent/hw/sai/switch/SaiAclTableManager.cpp b/fboss/agent/hw/sai/switch/SaiAclTableManager.cpp index ad4d31bf1beb8..0a2db7e0ebbbc 100644 --- a/fboss/agent/hw/sai/switch/SaiAclTableManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiAclTableManager.cpp @@ -919,13 +919,9 @@ AclEntrySaiId SaiAclTableManager::addAclEntry( if (fieldSrcPort.has_value()) { auto srcPortQualifierSupported = platform_->getAsic()->isSupported( HwAsic::Feature::SAI_ACL_ENTRY_SRC_PORT_QUALIFIER); - bool isTajo = platform_->getAsic()->getAsicVendor() == - HwAsic::AsicVendor::ASIC_VENDOR_TAJO; - if (isTajo) { -#if !defined(TAJO_SDK_VERSION_1_58_0) && !defined(TAJO_SDK_VERSION_1_60_0) - srcPortQualifierSupported = false; +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + srcPortQualifierSupported = false; #endif - } matcherIsValid &= srcPortQualifierSupported; } auto actionIsValid = @@ -1412,8 +1408,12 @@ bool SaiAclTableManager::areQualifiersSupportedInDefaultAclTable( void SaiAclTableManager::recreateAclTable( std::shared_ptr& aclTable, const SaiAclTableTraits::CreateAttributes& newAttributes) { - if (!platform_->getAsic()->isSupported( - HwAsic::Feature::SAI_ACL_TABLE_UPDATE)) { + bool aclTableUpdateSupport = + platform_->getAsic()->isSupported(HwAsic::Feature::SAI_ACL_TABLE_UPDATE); +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + aclTableUpdateSupport = false; +#endif + if (!aclTableUpdateSupport) { XLOG(WARNING) << "feature to update acl table is not supported"; return; } diff --git a/fboss/agent/hw/sai/switch/SaiDebugCounterManager.cpp b/fboss/agent/hw/sai/switch/SaiDebugCounterManager.cpp index ee3ab290c4425..a0a1a00f5051e 100644 --- a/fboss/agent/hw/sai/switch/SaiDebugCounterManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiDebugCounterManager.cpp @@ -45,10 +45,15 @@ void SaiDebugCounterManager::setupPortL3BlackHoleCounter() { } void SaiDebugCounterManager::setupMPLSLookupFailedCounter() { - if (!platform_->getAsic()->isSupported( - HwAsic::Feature::SAI_MPLS_LABEL_LOOKUP_FAIL_COUNTER)) { + bool mplsLookupFailCounterSupport = platform_->getAsic()->isSupported( + HwAsic::Feature::SAI_MPLS_LABEL_LOOKUP_FAIL_COUNTER); +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + mplsLookupFailCounterSupport = false; +#endif + if (!mplsLookupFailCounterSupport) { return; } + #if SAI_API_VERSION >= SAI_VERSION(1, 9, 0) SaiDebugCounterTraits::CreateAttributes attrs{ SAI_DEBUG_COUNTER_TYPE_PORT_IN_DROP_REASONS, diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index 887b566757e1e..2df62b7dfff8a 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -791,8 +791,12 @@ std::shared_ptr SaiSwitch::stateChangedImpl( &SaiTunnelManager::addTunnel, &SaiTunnelManager::removeTunnel); - if (FLAGS_enable_acl_table_group && - platform_->getAsic()->isSupported(HwAsic::Feature::MULTIPLE_ACL_TABLES)) { + bool multipleAclTableSupport = + platform_->getAsic()->isSupported(HwAsic::Feature::MULTIPLE_ACL_TABLES); +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + multipleAclTableSupport = false; +#endif + if (FLAGS_enable_acl_table_group && multipleAclTableSupport) { processDelta( delta.getAclTableGroupsDelta(), managerTable_->aclTableGroupManager(), @@ -846,10 +850,14 @@ std::shared_ptr SaiSwitch::stateChangedImpl( newRequiredQualifiers = delta.getAclsDelta().getNew()->requiredQualifiers(); } + bool aclTableUpdateSupport = platform_->getAsic()->isSupported( + HwAsic::Feature::SAI_ACL_TABLE_UPDATE); +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + aclTableUpdateSupport = false; +#endif if (!oldRequiredQualifiers.empty() && oldRequiredQualifiers != newRequiredQualifiers && - platform_->getAsic()->isSupported( - HwAsic::Feature::SAI_ACL_TABLE_UPDATE) && + aclTableUpdateSupport && !managerTable_->aclTableManager() .areQualifiersSupportedInDefaultAclTable(newRequiredQualifiers)) { // qualifiers changed and default acl table doesn't support all of them, diff --git a/fboss/agent/hw/sai/switch/SaiSwitchManager.cpp b/fboss/agent/hw/sai/switch/SaiSwitchManager.cpp index 501d980b80440..510eba643af1d 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitchManager.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitchManager.cpp @@ -549,6 +549,9 @@ bool SaiSwitchManager::isGlobalQoSMapSupported() const { bool SaiSwitchManager::isMplsQoSMapSupported() const { #if defined(SAI_VERSION_5_1_0_3_ODP) || defined(SAI_VERSION_7_2_0_0_ODP) return false; +#endif +#if defined(TAJO_SDK_VERSION_1_42_1) || defined(TAJO_SDK_VERSION_1_42_8) + return false; #endif return platform_->getAsic()->isSupported(HwAsic::Feature::SAI_MPLS_QOS); } diff --git a/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp b/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp index e39cefe9b5cd0..ec88eed749283 100644 --- a/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp +++ b/fboss/agent/hw/sai/switch/npu/SaiPortManager.cpp @@ -99,8 +99,10 @@ void SaiPortManager::fillInSupportedStats(PortID port) { } if (platform_->getAsic()->isSupported( HwAsic::Feature::SAI_MPLS_LABEL_LOOKUP_FAIL_COUNTER)) { +#if !defined(TAJO_SDK_VERSION_1_42_1) && !defined(TAJO_SDK_VERSION_1_42_8) counterIds.emplace_back(managerTable_->debugCounterManager() .getMPLSLookupFailedCounterStatId()); +#endif } if (platform_->getAsic()->isSupported(HwAsic::Feature::PFC)) { counterIds.reserve( diff --git a/fboss/agent/hw/switch_asics/EbroAsic.cpp b/fboss/agent/hw/switch_asics/EbroAsic.cpp index 455894da5981b..cc69d0fae389e 100644 --- a/fboss/agent/hw/switch_asics/EbroAsic.cpp +++ b/fboss/agent/hw/switch_asics/EbroAsic.cpp @@ -68,6 +68,12 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::PMD_RX_SIGNAL_DETECT: case HwAsic::Feature::FEC_AM_LOCK_STATUS: case HwAsic::Feature::PCS_RX_LINK_STATUS: + case HwAsic::Feature::SAI_MPLS_TTL_1_TRAP: + case HwAsic::Feature::SAI_MPLS_LABEL_LOOKUP_FAIL_COUNTER: + case HwAsic::Feature::SAI_MPLS_QOS: + case HwAsic::Feature::SAI_ACL_TABLE_UPDATE: + case HwAsic::Feature::ROUTE_COUNTERS: + case HwAsic::Feature::MULTIPLE_ACL_TABLES: return true; // VOQ vs NPU mode dependent features case HwAsic::Feature::BRIDGE_PORT_8021Q: @@ -102,16 +108,10 @@ bool EbroAsic::isSupportedNonFabric(Feature feature) const { case HwAsic::Feature::SAI_LAG_HASH: case HwAsic::Feature::MACSEC: case HwAsic::Feature::SAI_HASH_FIELDS_CLEAR_BEFORE_SET: - case HwAsic::Feature::SAI_MPLS_QOS: case HwAsic::Feature::EMPTY_ACL_MATCHER: - case HwAsic::Feature::ROUTE_COUNTERS: - case HwAsic::Feature::MULTIPLE_ACL_TABLES: case HwAsic::Feature::ROUTE_FLEX_COUNTERS: case HwAsic::Feature::FEC_DIAG_COUNTERS: - case HwAsic::Feature::SAI_ACL_TABLE_UPDATE: case HwAsic::Feature::PORT_EYE_VALUES: - case HwAsic::Feature::SAI_MPLS_TTL_1_TRAP: - case HwAsic::Feature::SAI_MPLS_LABEL_LOOKUP_FAIL_COUNTER: case HwAsic::Feature::SAI_PORT_ERR_STATUS: case HwAsic::Feature::EXACT_MATCH: case HwAsic::Feature::FEC_CORRECTED_BITS: diff --git a/fboss/agent/hw/test/HwTestRouteUtils.h b/fboss/agent/hw/test/HwTestRouteUtils.h index 293f69be02382..1eb8c6f3f4fde 100644 --- a/fboss/agent/hw/test/HwTestRouteUtils.h +++ b/fboss/agent/hw/test/HwTestRouteUtils.h @@ -59,4 +59,6 @@ bool isHwRoutePresent( RouterID rid, const folly::CIDRNetwork& cidrNetwork); +bool isRouteCounterSupported(const HwSwitch* hwSwitch); + } // namespace facebook::fboss::utility diff --git a/fboss/agent/hw/test/dataplane_tests/HwRouteOverflowTest.cpp b/fboss/agent/hw/test/dataplane_tests/HwRouteOverflowTest.cpp index 52340a2817ac8..f88a4f58addb5 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwRouteOverflowTest.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwRouteOverflowTest.cpp @@ -10,6 +10,7 @@ #include "fboss/agent/FbossHwUpdateError.h" #include "fboss/agent/HwSwitch.h" +#include "fboss/agent/hw/test/HwTestRouteUtils.h" #include "fboss/agent/hw/test/dataplane_tests/HwOverflowTest.h" #include "fboss/agent/test/RouteScaleGenerators.h" #include "fboss/lib/platforms/PlatformProductInfo.h" @@ -122,7 +123,7 @@ class HwRouteCounterOverflowTest : public HwOverflowTest { }; TEST_F(HwRouteCounterOverflowTest, overflowRouteCounters) { - if (!getPlatform()->getAsic()->isSupported(HwAsic::Feature::ROUTE_COUNTERS)) { + if (!utility::isRouteCounterSupported(getHwSwitch())) { return; } applyNewState( diff --git a/fboss/agent/hw/test/dataplane_tests/HwRouteStatTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwRouteStatTests.cpp index 9e09981be7582..38cd859c03109 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwRouteStatTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwRouteStatTests.cpp @@ -137,8 +137,7 @@ class HwRouteStatTest : public HwLinkStateDependentTest { } bool skipTest() const { - return !getPlatform()->getAsic()->isSupported( - HwAsic::Feature::ROUTE_COUNTERS); + return !utility::isRouteCounterSupported(getHwSwitch()); } std::unique_ptr ecmpHelper6_; From ae21a1cbed3ebdc3deabb35e6fca4d61388021a9 Mon Sep 17 00:00:00 2001 From: Wei Dai Date: Fri, 10 Feb 2023 15:12:32 -0800 Subject: [PATCH 258/280] add initial platform mapping for Montblanc Summary: As title, add intiial platform mapping for Montblanc based on config generated in D43105100 Reviewed By: jasmeetbagga Differential Revision: D43172057 fbshipit-source-id: 70be6c872b0112bfb3612e835a4da5ea07d731fe --- cmake/AgentPlatformsCommonMontblanc.cmake | 12 + fboss/agent/hw/sai/diag/DiagShell.cpp | 3 + .../dataplane_tests/HwRouteOverflowTest.cpp | 2 + .../montblanc/MontblancPlatformMapping.cpp | 29843 ++++++++++++++++ .../montblanc/MontblancPlatformMapping.h | 27 + fboss/lib/platforms/PlatformMode.h | 3 + .../test/hw_test/HwFirmwareTest.cpp | 1 + 7 files changed, 29891 insertions(+) create mode 100644 cmake/AgentPlatformsCommonMontblanc.cmake create mode 100644 fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.cpp create mode 100644 fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.h diff --git a/cmake/AgentPlatformsCommonMontblanc.cmake b/cmake/AgentPlatformsCommonMontblanc.cmake new file mode 100644 index 0000000000000..96c73ed214d17 --- /dev/null +++ b/cmake/AgentPlatformsCommonMontblanc.cmake @@ -0,0 +1,12 @@ +# CMake to build libraries and binaries in fboss/agent/platforms/common/montblanc + +# In general, libraries and binaries in fboss/foo/bar are built by +# cmake/FooBar.cmake + +add_library(montblanc_platform_mapping + fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.cpp +) + +target_link_libraries(montblanc_platform_mapping + platform_mapping +) diff --git a/fboss/agent/hw/sai/diag/DiagShell.cpp b/fboss/agent/hw/sai/diag/DiagShell.cpp index 2b305f95ddb91..d5694d250c785 100644 --- a/fboss/agent/hw/sai/diag/DiagShell.cpp +++ b/fboss/agent/hw/sai/diag/DiagShell.cpp @@ -157,6 +157,7 @@ std::unique_ptr DiagShell::makeRepl() const { case PlatformMode::DARWIN: case PlatformMode::MAKALU: case PlatformMode::KAMET: + case PlatformMode::MONTBLANC: return std::make_unique(hw_->getSaiSwitchId()); case PlatformMode::WEDGE400C: case PlatformMode::WEDGE400C_SIM: @@ -377,6 +378,7 @@ std::string DiagCmdServer::getDelimiterDiagCmd(const std::string& UUID) const { case PlatformMode::DARWIN: case PlatformMode::MAKALU: case PlatformMode::KAMET: + case PlatformMode::MONTBLANC: return UUID + "\n"; case PlatformMode::WEDGE400C: case PlatformMode::WEDGE400C_SIM: @@ -412,6 +414,7 @@ std::string& DiagCmdServer::cleanUpOutput( case PlatformMode::DARWIN: case PlatformMode::MAKALU: case PlatformMode::KAMET: + case PlatformMode::MONTBLANC: // Clean up the back of the string if (!output.empty() && !input.empty()) { std::string shell = "drivshell>"; diff --git a/fboss/agent/hw/test/dataplane_tests/HwRouteOverflowTest.cpp b/fboss/agent/hw/test/dataplane_tests/HwRouteOverflowTest.cpp index f88a4f58addb5..76553c0699852 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwRouteOverflowTest.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwRouteOverflowTest.cpp @@ -91,6 +91,8 @@ TEST_F(HwOverflowTest, overflowRoutes) { case PlatformMode::KAMET: // No overflow test for KAMET yet break; + case PlatformMode::MONTBLANC: + break; } if (routeChunks.size() == 0) { return; diff --git a/fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.cpp b/fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.cpp new file mode 100644 index 0000000000000..e734f91782e14 --- /dev/null +++ b/fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.cpp @@ -0,0 +1,29843 @@ +/* + * Copyright (c) 2004-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +#include "fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.h" + +namespace { +constexpr auto kJsonPlatformMappingStr = R"( +{ + "ports": { + "1": { + "mapping": { + "id": 1, + "name": "eth1/14/1", + "controllingPort": 1, + "pins": [ + { + "a": { + "chip": "BC0", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/14", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC0", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/14", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC0", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/14", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC0", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/14", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC0", + "lane": 0 + } + }, + { + "id": { + "chip": "BC0", + "lane": 1 + } + }, + { + "id": { + "chip": "BC0", + "lane": 2 + } + }, + { + "id": { + "chip": "BC0", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/14", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC0", + "lane": 0 + } + }, + { + "id": { + "chip": "BC0", + "lane": 1 + } + }, + { + "id": { + "chip": "BC0", + "lane": 2 + } + }, + { + "id": { + "chip": "BC0", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/14", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 2 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC0", + "lane": 0 + } + }, + { + "id": { + "chip": "BC0", + "lane": 1 + } + }, + { + "id": { + "chip": "BC0", + "lane": 2 + } + }, + { + "id": { + "chip": "BC0", + "lane": 3 + } + }, + { + "id": { + "chip": "BC0", + "lane": 4 + } + }, + { + "id": { + "chip": "BC0", + "lane": 5 + } + }, + { + "id": { + "chip": "BC0", + "lane": 6 + } + }, + { + "id": { + "chip": "BC0", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/14", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 7 + } + } + ] + } + } + } + }, + "2": { + "mapping": { + "id": 2, + "name": "eth1/14/2", + "controllingPort": 1, + "pins": [ + { + "a": { + "chip": "BC0", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/14", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC0", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/14", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC0", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/14", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC0", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/14", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC0", + "lane": 4 + } + }, + { + "id": { + "chip": "BC0", + "lane": 5 + } + }, + { + "id": { + "chip": "BC0", + "lane": 6 + } + }, + { + "id": { + "chip": "BC0", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/14", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC0", + "lane": 4 + } + }, + { + "id": { + "chip": "BC0", + "lane": 5 + } + }, + { + "id": { + "chip": "BC0", + "lane": 6 + } + }, + { + "id": { + "chip": "BC0", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/14", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/14", + "lane": 7 + } + } + ] + } + } + } + }, + "3": { + "mapping": { + "id": 3, + "name": "eth1/1/1", + "controllingPort": 3, + "pins": [ + { + "a": { + "chip": "BC1", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/1", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC1", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/1", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC1", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/1", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC1", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/1", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC1", + "lane": 0 + } + }, + { + "id": { + "chip": "BC1", + "lane": 1 + } + }, + { + "id": { + "chip": "BC1", + "lane": 2 + } + }, + { + "id": { + "chip": "BC1", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/1", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC1", + "lane": 0 + } + }, + { + "id": { + "chip": "BC1", + "lane": 1 + } + }, + { + "id": { + "chip": "BC1", + "lane": 2 + } + }, + { + "id": { + "chip": "BC1", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/1", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 4 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC1", + "lane": 0 + } + }, + { + "id": { + "chip": "BC1", + "lane": 1 + } + }, + { + "id": { + "chip": "BC1", + "lane": 2 + } + }, + { + "id": { + "chip": "BC1", + "lane": 3 + } + }, + { + "id": { + "chip": "BC1", + "lane": 4 + } + }, + { + "id": { + "chip": "BC1", + "lane": 5 + } + }, + { + "id": { + "chip": "BC1", + "lane": 6 + } + }, + { + "id": { + "chip": "BC1", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/1", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 7 + } + } + ] + } + } + } + }, + "4": { + "mapping": { + "id": 4, + "name": "eth1/1/2", + "controllingPort": 3, + "pins": [ + { + "a": { + "chip": "BC1", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/1", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC1", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/1", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC1", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/1", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC1", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/1", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC1", + "lane": 4 + } + }, + { + "id": { + "chip": "BC1", + "lane": 5 + } + }, + { + "id": { + "chip": "BC1", + "lane": 6 + } + }, + { + "id": { + "chip": "BC1", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/1", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC1", + "lane": 4 + } + }, + { + "id": { + "chip": "BC1", + "lane": 5 + } + }, + { + "id": { + "chip": "BC1", + "lane": 6 + } + }, + { + "id": { + "chip": "BC1", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/1", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/1", + "lane": 7 + } + } + ] + } + } + } + }, + "11": { + "mapping": { + "id": 11, + "name": "eth1/18/1", + "controllingPort": 11, + "pins": [ + { + "a": { + "chip": "BC2", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/18", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC2", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/18", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC2", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/18", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC2", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/18", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC2", + "lane": 0 + } + }, + { + "id": { + "chip": "BC2", + "lane": 1 + } + }, + { + "id": { + "chip": "BC2", + "lane": 2 + } + }, + { + "id": { + "chip": "BC2", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/18", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC2", + "lane": 0 + } + }, + { + "id": { + "chip": "BC2", + "lane": 1 + } + }, + { + "id": { + "chip": "BC2", + "lane": 2 + } + }, + { + "id": { + "chip": "BC2", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/18", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 12 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC2", + "lane": 0 + } + }, + { + "id": { + "chip": "BC2", + "lane": 1 + } + }, + { + "id": { + "chip": "BC2", + "lane": 2 + } + }, + { + "id": { + "chip": "BC2", + "lane": 3 + } + }, + { + "id": { + "chip": "BC2", + "lane": 4 + } + }, + { + "id": { + "chip": "BC2", + "lane": 5 + } + }, + { + "id": { + "chip": "BC2", + "lane": 6 + } + }, + { + "id": { + "chip": "BC2", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/18", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 7 + } + } + ] + } + } + } + }, + "12": { + "mapping": { + "id": 12, + "name": "eth1/18/2", + "controllingPort": 11, + "pins": [ + { + "a": { + "chip": "BC2", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/18", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC2", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/18", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC2", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/18", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC2", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/18", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC2", + "lane": 4 + } + }, + { + "id": { + "chip": "BC2", + "lane": 5 + } + }, + { + "id": { + "chip": "BC2", + "lane": 6 + } + }, + { + "id": { + "chip": "BC2", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/18", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC2", + "lane": 4 + } + }, + { + "id": { + "chip": "BC2", + "lane": 5 + } + }, + { + "id": { + "chip": "BC2", + "lane": 6 + } + }, + { + "id": { + "chip": "BC2", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/18", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/18", + "lane": 7 + } + } + ] + } + } + } + }, + "13": { + "mapping": { + "id": 13, + "name": "eth1/29/1", + "controllingPort": 13, + "pins": [ + { + "a": { + "chip": "BC3", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/29", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC3", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/29", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC3", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/29", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC3", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/29", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC3", + "lane": 0 + } + }, + { + "id": { + "chip": "BC3", + "lane": 1 + } + }, + { + "id": { + "chip": "BC3", + "lane": 2 + } + }, + { + "id": { + "chip": "BC3", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/29", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC3", + "lane": 0 + } + }, + { + "id": { + "chip": "BC3", + "lane": 1 + } + }, + { + "id": { + "chip": "BC3", + "lane": 2 + } + }, + { + "id": { + "chip": "BC3", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/29", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 14 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC3", + "lane": 0 + } + }, + { + "id": { + "chip": "BC3", + "lane": 1 + } + }, + { + "id": { + "chip": "BC3", + "lane": 2 + } + }, + { + "id": { + "chip": "BC3", + "lane": 3 + } + }, + { + "id": { + "chip": "BC3", + "lane": 4 + } + }, + { + "id": { + "chip": "BC3", + "lane": 5 + } + }, + { + "id": { + "chip": "BC3", + "lane": 6 + } + }, + { + "id": { + "chip": "BC3", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/29", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 7 + } + } + ] + } + } + } + }, + "14": { + "mapping": { + "id": 14, + "name": "eth1/29/2", + "controllingPort": 13, + "pins": [ + { + "a": { + "chip": "BC3", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/29", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC3", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/29", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC3", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/29", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC3", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/29", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC3", + "lane": 4 + } + }, + { + "id": { + "chip": "BC3", + "lane": 5 + } + }, + { + "id": { + "chip": "BC3", + "lane": 6 + } + }, + { + "id": { + "chip": "BC3", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/29", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC3", + "lane": 4 + } + }, + { + "id": { + "chip": "BC3", + "lane": 5 + } + }, + { + "id": { + "chip": "BC3", + "lane": 6 + } + }, + { + "id": { + "chip": "BC3", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/29", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/29", + "lane": 7 + } + } + ] + } + } + } + }, + "22": { + "mapping": { + "id": 22, + "name": "eth1/2/1", + "controllingPort": 22, + "pins": [ + { + "a": { + "chip": "BC4", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/2", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC4", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/2", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC4", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/2", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC4", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/2", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC4", + "lane": 0 + } + }, + { + "id": { + "chip": "BC4", + "lane": 1 + } + }, + { + "id": { + "chip": "BC4", + "lane": 2 + } + }, + { + "id": { + "chip": "BC4", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/2", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC4", + "lane": 0 + } + }, + { + "id": { + "chip": "BC4", + "lane": 1 + } + }, + { + "id": { + "chip": "BC4", + "lane": 2 + } + }, + { + "id": { + "chip": "BC4", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/2", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 23 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC4", + "lane": 0 + } + }, + { + "id": { + "chip": "BC4", + "lane": 1 + } + }, + { + "id": { + "chip": "BC4", + "lane": 2 + } + }, + { + "id": { + "chip": "BC4", + "lane": 3 + } + }, + { + "id": { + "chip": "BC4", + "lane": 4 + } + }, + { + "id": { + "chip": "BC4", + "lane": 5 + } + }, + { + "id": { + "chip": "BC4", + "lane": 6 + } + }, + { + "id": { + "chip": "BC4", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/2", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 7 + } + } + ] + } + } + } + }, + "23": { + "mapping": { + "id": 23, + "name": "eth1/2/2", + "controllingPort": 22, + "pins": [ + { + "a": { + "chip": "BC4", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/2", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC4", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/2", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC4", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/2", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC4", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/2", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC4", + "lane": 4 + } + }, + { + "id": { + "chip": "BC4", + "lane": 5 + } + }, + { + "id": { + "chip": "BC4", + "lane": 6 + } + }, + { + "id": { + "chip": "BC4", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/2", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC4", + "lane": 4 + } + }, + { + "id": { + "chip": "BC4", + "lane": 5 + } + }, + { + "id": { + "chip": "BC4", + "lane": 6 + } + }, + { + "id": { + "chip": "BC4", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/2", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/2", + "lane": 7 + } + } + ] + } + } + } + }, + "24": { + "mapping": { + "id": 24, + "name": "eth1/13/1", + "controllingPort": 24, + "pins": [ + { + "a": { + "chip": "BC5", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/13", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC5", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/13", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC5", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/13", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC5", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/13", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC5", + "lane": 0 + } + }, + { + "id": { + "chip": "BC5", + "lane": 1 + } + }, + { + "id": { + "chip": "BC5", + "lane": 2 + } + }, + { + "id": { + "chip": "BC5", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/13", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC5", + "lane": 0 + } + }, + { + "id": { + "chip": "BC5", + "lane": 1 + } + }, + { + "id": { + "chip": "BC5", + "lane": 2 + } + }, + { + "id": { + "chip": "BC5", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/13", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 25 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC5", + "lane": 0 + } + }, + { + "id": { + "chip": "BC5", + "lane": 1 + } + }, + { + "id": { + "chip": "BC5", + "lane": 2 + } + }, + { + "id": { + "chip": "BC5", + "lane": 3 + } + }, + { + "id": { + "chip": "BC5", + "lane": 4 + } + }, + { + "id": { + "chip": "BC5", + "lane": 5 + } + }, + { + "id": { + "chip": "BC5", + "lane": 6 + } + }, + { + "id": { + "chip": "BC5", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/13", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 7 + } + } + ] + } + } + } + }, + "25": { + "mapping": { + "id": 25, + "name": "eth1/13/2", + "controllingPort": 24, + "pins": [ + { + "a": { + "chip": "BC5", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/13", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC5", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/13", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC5", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/13", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC5", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/13", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC5", + "lane": 4 + } + }, + { + "id": { + "chip": "BC5", + "lane": 5 + } + }, + { + "id": { + "chip": "BC5", + "lane": 6 + } + }, + { + "id": { + "chip": "BC5", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/13", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC5", + "lane": 4 + } + }, + { + "id": { + "chip": "BC5", + "lane": 5 + } + }, + { + "id": { + "chip": "BC5", + "lane": 6 + } + }, + { + "id": { + "chip": "BC5", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/13", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/13", + "lane": 7 + } + } + ] + } + } + } + }, + "33": { + "mapping": { + "id": 33, + "name": "eth1/17/1", + "controllingPort": 33, + "pins": [ + { + "a": { + "chip": "BC6", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/17", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC6", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/17", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC6", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/17", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC6", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/17", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC6", + "lane": 0 + } + }, + { + "id": { + "chip": "BC6", + "lane": 1 + } + }, + { + "id": { + "chip": "BC6", + "lane": 2 + } + }, + { + "id": { + "chip": "BC6", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/17", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC6", + "lane": 0 + } + }, + { + "id": { + "chip": "BC6", + "lane": 1 + } + }, + { + "id": { + "chip": "BC6", + "lane": 2 + } + }, + { + "id": { + "chip": "BC6", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/17", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 34 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC6", + "lane": 0 + } + }, + { + "id": { + "chip": "BC6", + "lane": 1 + } + }, + { + "id": { + "chip": "BC6", + "lane": 2 + } + }, + { + "id": { + "chip": "BC6", + "lane": 3 + } + }, + { + "id": { + "chip": "BC6", + "lane": 4 + } + }, + { + "id": { + "chip": "BC6", + "lane": 5 + } + }, + { + "id": { + "chip": "BC6", + "lane": 6 + } + }, + { + "id": { + "chip": "BC6", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/17", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 7 + } + } + ] + } + } + } + }, + "34": { + "mapping": { + "id": 34, + "name": "eth1/17/2", + "controllingPort": 33, + "pins": [ + { + "a": { + "chip": "BC6", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/17", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC6", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/17", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC6", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/17", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC6", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/17", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC6", + "lane": 4 + } + }, + { + "id": { + "chip": "BC6", + "lane": 5 + } + }, + { + "id": { + "chip": "BC6", + "lane": 6 + } + }, + { + "id": { + "chip": "BC6", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/17", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC6", + "lane": 4 + } + }, + { + "id": { + "chip": "BC6", + "lane": 5 + } + }, + { + "id": { + "chip": "BC6", + "lane": 6 + } + }, + { + "id": { + "chip": "BC6", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/17", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/17", + "lane": 7 + } + } + ] + } + } + } + }, + "35": { + "mapping": { + "id": 35, + "name": "eth1/30/1", + "controllingPort": 35, + "pins": [ + { + "a": { + "chip": "BC7", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/30", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC7", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/30", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC7", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/30", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC7", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/30", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC7", + "lane": 0 + } + }, + { + "id": { + "chip": "BC7", + "lane": 1 + } + }, + { + "id": { + "chip": "BC7", + "lane": 2 + } + }, + { + "id": { + "chip": "BC7", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/30", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC7", + "lane": 0 + } + }, + { + "id": { + "chip": "BC7", + "lane": 1 + } + }, + { + "id": { + "chip": "BC7", + "lane": 2 + } + }, + { + "id": { + "chip": "BC7", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/30", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 36 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC7", + "lane": 0 + } + }, + { + "id": { + "chip": "BC7", + "lane": 1 + } + }, + { + "id": { + "chip": "BC7", + "lane": 2 + } + }, + { + "id": { + "chip": "BC7", + "lane": 3 + } + }, + { + "id": { + "chip": "BC7", + "lane": 4 + } + }, + { + "id": { + "chip": "BC7", + "lane": 5 + } + }, + { + "id": { + "chip": "BC7", + "lane": 6 + } + }, + { + "id": { + "chip": "BC7", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/30", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 7 + } + } + ] + } + } + } + }, + "36": { + "mapping": { + "id": 36, + "name": "eth1/30/2", + "controllingPort": 35, + "pins": [ + { + "a": { + "chip": "BC7", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/30", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC7", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/30", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC7", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/30", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC7", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/30", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC7", + "lane": 4 + } + }, + { + "id": { + "chip": "BC7", + "lane": 5 + } + }, + { + "id": { + "chip": "BC7", + "lane": 6 + } + }, + { + "id": { + "chip": "BC7", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/30", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC7", + "lane": 4 + } + }, + { + "id": { + "chip": "BC7", + "lane": 5 + } + }, + { + "id": { + "chip": "BC7", + "lane": 6 + } + }, + { + "id": { + "chip": "BC7", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/30", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/30", + "lane": 7 + } + } + ] + } + } + } + }, + "44": { + "mapping": { + "id": 44, + "name": "eth1/3/1", + "controllingPort": 44, + "pins": [ + { + "a": { + "chip": "BC8", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/3", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC8", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/3", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC8", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/3", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC8", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/3", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC8", + "lane": 0 + } + }, + { + "id": { + "chip": "BC8", + "lane": 1 + } + }, + { + "id": { + "chip": "BC8", + "lane": 2 + } + }, + { + "id": { + "chip": "BC8", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/3", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC8", + "lane": 0 + } + }, + { + "id": { + "chip": "BC8", + "lane": 1 + } + }, + { + "id": { + "chip": "BC8", + "lane": 2 + } + }, + { + "id": { + "chip": "BC8", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/3", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 45 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC8", + "lane": 0 + } + }, + { + "id": { + "chip": "BC8", + "lane": 1 + } + }, + { + "id": { + "chip": "BC8", + "lane": 2 + } + }, + { + "id": { + "chip": "BC8", + "lane": 3 + } + }, + { + "id": { + "chip": "BC8", + "lane": 4 + } + }, + { + "id": { + "chip": "BC8", + "lane": 5 + } + }, + { + "id": { + "chip": "BC8", + "lane": 6 + } + }, + { + "id": { + "chip": "BC8", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/3", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 7 + } + } + ] + } + } + } + }, + "45": { + "mapping": { + "id": 45, + "name": "eth1/3/2", + "controllingPort": 44, + "pins": [ + { + "a": { + "chip": "BC8", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/3", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC8", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/3", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC8", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/3", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC8", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/3", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC8", + "lane": 4 + } + }, + { + "id": { + "chip": "BC8", + "lane": 5 + } + }, + { + "id": { + "chip": "BC8", + "lane": 6 + } + }, + { + "id": { + "chip": "BC8", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/3", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC8", + "lane": 4 + } + }, + { + "id": { + "chip": "BC8", + "lane": 5 + } + }, + { + "id": { + "chip": "BC8", + "lane": 6 + } + }, + { + "id": { + "chip": "BC8", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/3", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/3", + "lane": 7 + } + } + ] + } + } + } + }, + "46": { + "mapping": { + "id": 46, + "name": "eth1/16/1", + "controllingPort": 46, + "pins": [ + { + "a": { + "chip": "BC9", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/16", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC9", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/16", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC9", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/16", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC9", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/16", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC9", + "lane": 0 + } + }, + { + "id": { + "chip": "BC9", + "lane": 1 + } + }, + { + "id": { + "chip": "BC9", + "lane": 2 + } + }, + { + "id": { + "chip": "BC9", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/16", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC9", + "lane": 0 + } + }, + { + "id": { + "chip": "BC9", + "lane": 1 + } + }, + { + "id": { + "chip": "BC9", + "lane": 2 + } + }, + { + "id": { + "chip": "BC9", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/16", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 47 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC9", + "lane": 0 + } + }, + { + "id": { + "chip": "BC9", + "lane": 1 + } + }, + { + "id": { + "chip": "BC9", + "lane": 2 + } + }, + { + "id": { + "chip": "BC9", + "lane": 3 + } + }, + { + "id": { + "chip": "BC9", + "lane": 4 + } + }, + { + "id": { + "chip": "BC9", + "lane": 5 + } + }, + { + "id": { + "chip": "BC9", + "lane": 6 + } + }, + { + "id": { + "chip": "BC9", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/16", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 7 + } + } + ] + } + } + } + }, + "47": { + "mapping": { + "id": 47, + "name": "eth1/16/2", + "controllingPort": 46, + "pins": [ + { + "a": { + "chip": "BC9", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/16", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC9", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/16", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC9", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/16", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC9", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/16", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC9", + "lane": 4 + } + }, + { + "id": { + "chip": "BC9", + "lane": 5 + } + }, + { + "id": { + "chip": "BC9", + "lane": 6 + } + }, + { + "id": { + "chip": "BC9", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/16", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC9", + "lane": 4 + } + }, + { + "id": { + "chip": "BC9", + "lane": 5 + } + }, + { + "id": { + "chip": "BC9", + "lane": 6 + } + }, + { + "id": { + "chip": "BC9", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/16", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/16", + "lane": 7 + } + } + ] + } + } + } + }, + "55": { + "mapping": { + "id": 55, + "name": "eth1/20/1", + "controllingPort": 55, + "pins": [ + { + "a": { + "chip": "BC10", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/20", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC10", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/20", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC10", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/20", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC10", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/20", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC10", + "lane": 0 + } + }, + { + "id": { + "chip": "BC10", + "lane": 1 + } + }, + { + "id": { + "chip": "BC10", + "lane": 2 + } + }, + { + "id": { + "chip": "BC10", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/20", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC10", + "lane": 0 + } + }, + { + "id": { + "chip": "BC10", + "lane": 1 + } + }, + { + "id": { + "chip": "BC10", + "lane": 2 + } + }, + { + "id": { + "chip": "BC10", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/20", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 56 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC10", + "lane": 0 + } + }, + { + "id": { + "chip": "BC10", + "lane": 1 + } + }, + { + "id": { + "chip": "BC10", + "lane": 2 + } + }, + { + "id": { + "chip": "BC10", + "lane": 3 + } + }, + { + "id": { + "chip": "BC10", + "lane": 4 + } + }, + { + "id": { + "chip": "BC10", + "lane": 5 + } + }, + { + "id": { + "chip": "BC10", + "lane": 6 + } + }, + { + "id": { + "chip": "BC10", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/20", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 7 + } + } + ] + } + } + } + }, + "56": { + "mapping": { + "id": 56, + "name": "eth1/20/2", + "controllingPort": 55, + "pins": [ + { + "a": { + "chip": "BC10", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/20", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC10", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/20", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC10", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/20", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC10", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/20", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC10", + "lane": 4 + } + }, + { + "id": { + "chip": "BC10", + "lane": 5 + } + }, + { + "id": { + "chip": "BC10", + "lane": 6 + } + }, + { + "id": { + "chip": "BC10", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/20", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC10", + "lane": 4 + } + }, + { + "id": { + "chip": "BC10", + "lane": 5 + } + }, + { + "id": { + "chip": "BC10", + "lane": 6 + } + }, + { + "id": { + "chip": "BC10", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/20", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/20", + "lane": 7 + } + } + ] + } + } + } + }, + "57": { + "mapping": { + "id": 57, + "name": "eth1/31/1", + "controllingPort": 57, + "pins": [ + { + "a": { + "chip": "BC11", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/31", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC11", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/31", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC11", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/31", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC11", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/31", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC11", + "lane": 0 + } + }, + { + "id": { + "chip": "BC11", + "lane": 1 + } + }, + { + "id": { + "chip": "BC11", + "lane": 2 + } + }, + { + "id": { + "chip": "BC11", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/31", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC11", + "lane": 0 + } + }, + { + "id": { + "chip": "BC11", + "lane": 1 + } + }, + { + "id": { + "chip": "BC11", + "lane": 2 + } + }, + { + "id": { + "chip": "BC11", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/31", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 58 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC11", + "lane": 0 + } + }, + { + "id": { + "chip": "BC11", + "lane": 1 + } + }, + { + "id": { + "chip": "BC11", + "lane": 2 + } + }, + { + "id": { + "chip": "BC11", + "lane": 3 + } + }, + { + "id": { + "chip": "BC11", + "lane": 4 + } + }, + { + "id": { + "chip": "BC11", + "lane": 5 + } + }, + { + "id": { + "chip": "BC11", + "lane": 6 + } + }, + { + "id": { + "chip": "BC11", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/31", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 7 + } + } + ] + } + } + } + }, + "58": { + "mapping": { + "id": 58, + "name": "eth1/31/2", + "controllingPort": 57, + "pins": [ + { + "a": { + "chip": "BC11", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/31", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC11", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/31", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC11", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/31", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC11", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/31", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC11", + "lane": 4 + } + }, + { + "id": { + "chip": "BC11", + "lane": 5 + } + }, + { + "id": { + "chip": "BC11", + "lane": 6 + } + }, + { + "id": { + "chip": "BC11", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/31", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC11", + "lane": 4 + } + }, + { + "id": { + "chip": "BC11", + "lane": 5 + } + }, + { + "id": { + "chip": "BC11", + "lane": 6 + } + }, + { + "id": { + "chip": "BC11", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/31", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/31", + "lane": 7 + } + } + ] + } + } + } + }, + "66": { + "mapping": { + "id": 66, + "name": "eth1/4/1", + "controllingPort": 66, + "pins": [ + { + "a": { + "chip": "BC12", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/4", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC12", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/4", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC12", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/4", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC12", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/4", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC12", + "lane": 0 + } + }, + { + "id": { + "chip": "BC12", + "lane": 1 + } + }, + { + "id": { + "chip": "BC12", + "lane": 2 + } + }, + { + "id": { + "chip": "BC12", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/4", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC12", + "lane": 0 + } + }, + { + "id": { + "chip": "BC12", + "lane": 1 + } + }, + { + "id": { + "chip": "BC12", + "lane": 2 + } + }, + { + "id": { + "chip": "BC12", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/4", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 67 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC12", + "lane": 0 + } + }, + { + "id": { + "chip": "BC12", + "lane": 1 + } + }, + { + "id": { + "chip": "BC12", + "lane": 2 + } + }, + { + "id": { + "chip": "BC12", + "lane": 3 + } + }, + { + "id": { + "chip": "BC12", + "lane": 4 + } + }, + { + "id": { + "chip": "BC12", + "lane": 5 + } + }, + { + "id": { + "chip": "BC12", + "lane": 6 + } + }, + { + "id": { + "chip": "BC12", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/4", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 7 + } + } + ] + } + } + } + }, + "67": { + "mapping": { + "id": 67, + "name": "eth1/4/2", + "controllingPort": 66, + "pins": [ + { + "a": { + "chip": "BC12", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/4", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC12", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/4", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC12", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/4", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC12", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/4", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC12", + "lane": 4 + } + }, + { + "id": { + "chip": "BC12", + "lane": 5 + } + }, + { + "id": { + "chip": "BC12", + "lane": 6 + } + }, + { + "id": { + "chip": "BC12", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/4", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC12", + "lane": 4 + } + }, + { + "id": { + "chip": "BC12", + "lane": 5 + } + }, + { + "id": { + "chip": "BC12", + "lane": 6 + } + }, + { + "id": { + "chip": "BC12", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/4", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/4", + "lane": 7 + } + } + ] + } + } + } + }, + "68": { + "mapping": { + "id": 68, + "name": "eth1/15/1", + "controllingPort": 68, + "pins": [ + { + "a": { + "chip": "BC13", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/15", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC13", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/15", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC13", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/15", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC13", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/15", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC13", + "lane": 0 + } + }, + { + "id": { + "chip": "BC13", + "lane": 1 + } + }, + { + "id": { + "chip": "BC13", + "lane": 2 + } + }, + { + "id": { + "chip": "BC13", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/15", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC13", + "lane": 0 + } + }, + { + "id": { + "chip": "BC13", + "lane": 1 + } + }, + { + "id": { + "chip": "BC13", + "lane": 2 + } + }, + { + "id": { + "chip": "BC13", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/15", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 69 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC13", + "lane": 0 + } + }, + { + "id": { + "chip": "BC13", + "lane": 1 + } + }, + { + "id": { + "chip": "BC13", + "lane": 2 + } + }, + { + "id": { + "chip": "BC13", + "lane": 3 + } + }, + { + "id": { + "chip": "BC13", + "lane": 4 + } + }, + { + "id": { + "chip": "BC13", + "lane": 5 + } + }, + { + "id": { + "chip": "BC13", + "lane": 6 + } + }, + { + "id": { + "chip": "BC13", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/15", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 7 + } + } + ] + } + } + } + }, + "69": { + "mapping": { + "id": 69, + "name": "eth1/15/2", + "controllingPort": 68, + "pins": [ + { + "a": { + "chip": "BC13", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/15", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC13", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/15", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC13", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/15", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC13", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/15", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC13", + "lane": 4 + } + }, + { + "id": { + "chip": "BC13", + "lane": 5 + } + }, + { + "id": { + "chip": "BC13", + "lane": 6 + } + }, + { + "id": { + "chip": "BC13", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/15", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC13", + "lane": 4 + } + }, + { + "id": { + "chip": "BC13", + "lane": 5 + } + }, + { + "id": { + "chip": "BC13", + "lane": 6 + } + }, + { + "id": { + "chip": "BC13", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/15", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/15", + "lane": 7 + } + } + ] + } + } + } + }, + "77": { + "mapping": { + "id": 77, + "name": "eth1/19/1", + "controllingPort": 77, + "pins": [ + { + "a": { + "chip": "BC14", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/19", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC14", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/19", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC14", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/19", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC14", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/19", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC14", + "lane": 0 + } + }, + { + "id": { + "chip": "BC14", + "lane": 1 + } + }, + { + "id": { + "chip": "BC14", + "lane": 2 + } + }, + { + "id": { + "chip": "BC14", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/19", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC14", + "lane": 0 + } + }, + { + "id": { + "chip": "BC14", + "lane": 1 + } + }, + { + "id": { + "chip": "BC14", + "lane": 2 + } + }, + { + "id": { + "chip": "BC14", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/19", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 78 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC14", + "lane": 0 + } + }, + { + "id": { + "chip": "BC14", + "lane": 1 + } + }, + { + "id": { + "chip": "BC14", + "lane": 2 + } + }, + { + "id": { + "chip": "BC14", + "lane": 3 + } + }, + { + "id": { + "chip": "BC14", + "lane": 4 + } + }, + { + "id": { + "chip": "BC14", + "lane": 5 + } + }, + { + "id": { + "chip": "BC14", + "lane": 6 + } + }, + { + "id": { + "chip": "BC14", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/19", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 7 + } + } + ] + } + } + } + }, + "78": { + "mapping": { + "id": 78, + "name": "eth1/19/2", + "controllingPort": 77, + "pins": [ + { + "a": { + "chip": "BC14", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/19", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC14", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/19", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC14", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/19", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC14", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/19", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC14", + "lane": 4 + } + }, + { + "id": { + "chip": "BC14", + "lane": 5 + } + }, + { + "id": { + "chip": "BC14", + "lane": 6 + } + }, + { + "id": { + "chip": "BC14", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/19", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC14", + "lane": 4 + } + }, + { + "id": { + "chip": "BC14", + "lane": 5 + } + }, + { + "id": { + "chip": "BC14", + "lane": 6 + } + }, + { + "id": { + "chip": "BC14", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/19", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/19", + "lane": 7 + } + } + ] + } + } + } + }, + "79": { + "mapping": { + "id": 79, + "name": "eth1/32/1", + "controllingPort": 79, + "pins": [ + { + "a": { + "chip": "BC15", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/32", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC15", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/32", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC15", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/32", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC15", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/32", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC15", + "lane": 0 + } + }, + { + "id": { + "chip": "BC15", + "lane": 1 + } + }, + { + "id": { + "chip": "BC15", + "lane": 2 + } + }, + { + "id": { + "chip": "BC15", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/32", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC15", + "lane": 0 + } + }, + { + "id": { + "chip": "BC15", + "lane": 1 + } + }, + { + "id": { + "chip": "BC15", + "lane": 2 + } + }, + { + "id": { + "chip": "BC15", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/32", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 80 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC15", + "lane": 0 + } + }, + { + "id": { + "chip": "BC15", + "lane": 1 + } + }, + { + "id": { + "chip": "BC15", + "lane": 2 + } + }, + { + "id": { + "chip": "BC15", + "lane": 3 + } + }, + { + "id": { + "chip": "BC15", + "lane": 4 + } + }, + { + "id": { + "chip": "BC15", + "lane": 5 + } + }, + { + "id": { + "chip": "BC15", + "lane": 6 + } + }, + { + "id": { + "chip": "BC15", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/32", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 7 + } + } + ] + } + } + } + }, + "80": { + "mapping": { + "id": 80, + "name": "eth1/32/2", + "controllingPort": 79, + "pins": [ + { + "a": { + "chip": "BC15", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/32", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC15", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/32", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC15", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/32", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC15", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/32", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC15", + "lane": 4 + } + }, + { + "id": { + "chip": "BC15", + "lane": 5 + } + }, + { + "id": { + "chip": "BC15", + "lane": 6 + } + }, + { + "id": { + "chip": "BC15", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/32", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC15", + "lane": 4 + } + }, + { + "id": { + "chip": "BC15", + "lane": 5 + } + }, + { + "id": { + "chip": "BC15", + "lane": 6 + } + }, + { + "id": { + "chip": "BC15", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/32", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/32", + "lane": 7 + } + } + ] + } + } + } + }, + "88": { + "mapping": { + "id": 88, + "name": "eth1/5/1", + "controllingPort": 88, + "pins": [ + { + "a": { + "chip": "BC16", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/5", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC16", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/5", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC16", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/5", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC16", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/5", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC16", + "lane": 0 + } + }, + { + "id": { + "chip": "BC16", + "lane": 1 + } + }, + { + "id": { + "chip": "BC16", + "lane": 2 + } + }, + { + "id": { + "chip": "BC16", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/5", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC16", + "lane": 0 + } + }, + { + "id": { + "chip": "BC16", + "lane": 1 + } + }, + { + "id": { + "chip": "BC16", + "lane": 2 + } + }, + { + "id": { + "chip": "BC16", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/5", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 89 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC16", + "lane": 0 + } + }, + { + "id": { + "chip": "BC16", + "lane": 1 + } + }, + { + "id": { + "chip": "BC16", + "lane": 2 + } + }, + { + "id": { + "chip": "BC16", + "lane": 3 + } + }, + { + "id": { + "chip": "BC16", + "lane": 4 + } + }, + { + "id": { + "chip": "BC16", + "lane": 5 + } + }, + { + "id": { + "chip": "BC16", + "lane": 6 + } + }, + { + "id": { + "chip": "BC16", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/5", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 7 + } + } + ] + } + } + } + }, + "89": { + "mapping": { + "id": 89, + "name": "eth1/5/2", + "controllingPort": 88, + "pins": [ + { + "a": { + "chip": "BC16", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/5", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC16", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/5", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC16", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/5", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC16", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/5", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC16", + "lane": 4 + } + }, + { + "id": { + "chip": "BC16", + "lane": 5 + } + }, + { + "id": { + "chip": "BC16", + "lane": 6 + } + }, + { + "id": { + "chip": "BC16", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/5", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC16", + "lane": 4 + } + }, + { + "id": { + "chip": "BC16", + "lane": 5 + } + }, + { + "id": { + "chip": "BC16", + "lane": 6 + } + }, + { + "id": { + "chip": "BC16", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/5", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/5", + "lane": 7 + } + } + ] + } + } + } + }, + "90": { + "mapping": { + "id": 90, + "name": "eth1/10/1", + "controllingPort": 90, + "pins": [ + { + "a": { + "chip": "BC17", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/10", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC17", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/10", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC17", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/10", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC17", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/10", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC17", + "lane": 0 + } + }, + { + "id": { + "chip": "BC17", + "lane": 1 + } + }, + { + "id": { + "chip": "BC17", + "lane": 2 + } + }, + { + "id": { + "chip": "BC17", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/10", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC17", + "lane": 0 + } + }, + { + "id": { + "chip": "BC17", + "lane": 1 + } + }, + { + "id": { + "chip": "BC17", + "lane": 2 + } + }, + { + "id": { + "chip": "BC17", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/10", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 91 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC17", + "lane": 0 + } + }, + { + "id": { + "chip": "BC17", + "lane": 1 + } + }, + { + "id": { + "chip": "BC17", + "lane": 2 + } + }, + { + "id": { + "chip": "BC17", + "lane": 3 + } + }, + { + "id": { + "chip": "BC17", + "lane": 4 + } + }, + { + "id": { + "chip": "BC17", + "lane": 5 + } + }, + { + "id": { + "chip": "BC17", + "lane": 6 + } + }, + { + "id": { + "chip": "BC17", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/10", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 7 + } + } + ] + } + } + } + }, + "91": { + "mapping": { + "id": 91, + "name": "eth1/10/2", + "controllingPort": 90, + "pins": [ + { + "a": { + "chip": "BC17", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/10", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC17", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/10", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC17", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/10", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC17", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/10", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC17", + "lane": 4 + } + }, + { + "id": { + "chip": "BC17", + "lane": 5 + } + }, + { + "id": { + "chip": "BC17", + "lane": 6 + } + }, + { + "id": { + "chip": "BC17", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/10", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC17", + "lane": 4 + } + }, + { + "id": { + "chip": "BC17", + "lane": 5 + } + }, + { + "id": { + "chip": "BC17", + "lane": 6 + } + }, + { + "id": { + "chip": "BC17", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/10", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/10", + "lane": 7 + } + } + ] + } + } + } + }, + "99": { + "mapping": { + "id": 99, + "name": "eth1/22/1", + "controllingPort": 99, + "pins": [ + { + "a": { + "chip": "BC18", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/22", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC18", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/22", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC18", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/22", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC18", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/22", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC18", + "lane": 0 + } + }, + { + "id": { + "chip": "BC18", + "lane": 1 + } + }, + { + "id": { + "chip": "BC18", + "lane": 2 + } + }, + { + "id": { + "chip": "BC18", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/22", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC18", + "lane": 0 + } + }, + { + "id": { + "chip": "BC18", + "lane": 1 + } + }, + { + "id": { + "chip": "BC18", + "lane": 2 + } + }, + { + "id": { + "chip": "BC18", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/22", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 100 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC18", + "lane": 0 + } + }, + { + "id": { + "chip": "BC18", + "lane": 1 + } + }, + { + "id": { + "chip": "BC18", + "lane": 2 + } + }, + { + "id": { + "chip": "BC18", + "lane": 3 + } + }, + { + "id": { + "chip": "BC18", + "lane": 4 + } + }, + { + "id": { + "chip": "BC18", + "lane": 5 + } + }, + { + "id": { + "chip": "BC18", + "lane": 6 + } + }, + { + "id": { + "chip": "BC18", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/22", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 7 + } + } + ] + } + } + } + }, + "100": { + "mapping": { + "id": 100, + "name": "eth1/22/2", + "controllingPort": 99, + "pins": [ + { + "a": { + "chip": "BC18", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/22", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC18", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/22", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC18", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/22", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC18", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/22", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC18", + "lane": 4 + } + }, + { + "id": { + "chip": "BC18", + "lane": 5 + } + }, + { + "id": { + "chip": "BC18", + "lane": 6 + } + }, + { + "id": { + "chip": "BC18", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/22", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC18", + "lane": 4 + } + }, + { + "id": { + "chip": "BC18", + "lane": 5 + } + }, + { + "id": { + "chip": "BC18", + "lane": 6 + } + }, + { + "id": { + "chip": "BC18", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/22", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/22", + "lane": 7 + } + } + ] + } + } + } + }, + "101": { + "mapping": { + "id": 101, + "name": "eth1/25/1", + "controllingPort": 101, + "pins": [ + { + "a": { + "chip": "BC19", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/25", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC19", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/25", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC19", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/25", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC19", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/25", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC19", + "lane": 0 + } + }, + { + "id": { + "chip": "BC19", + "lane": 1 + } + }, + { + "id": { + "chip": "BC19", + "lane": 2 + } + }, + { + "id": { + "chip": "BC19", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/25", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC19", + "lane": 0 + } + }, + { + "id": { + "chip": "BC19", + "lane": 1 + } + }, + { + "id": { + "chip": "BC19", + "lane": 2 + } + }, + { + "id": { + "chip": "BC19", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/25", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 102 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC19", + "lane": 0 + } + }, + { + "id": { + "chip": "BC19", + "lane": 1 + } + }, + { + "id": { + "chip": "BC19", + "lane": 2 + } + }, + { + "id": { + "chip": "BC19", + "lane": 3 + } + }, + { + "id": { + "chip": "BC19", + "lane": 4 + } + }, + { + "id": { + "chip": "BC19", + "lane": 5 + } + }, + { + "id": { + "chip": "BC19", + "lane": 6 + } + }, + { + "id": { + "chip": "BC19", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/25", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 7 + } + } + ] + } + } + } + }, + "102": { + "mapping": { + "id": 102, + "name": "eth1/25/2", + "controllingPort": 101, + "pins": [ + { + "a": { + "chip": "BC19", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/25", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC19", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/25", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC19", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/25", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC19", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/25", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC19", + "lane": 4 + } + }, + { + "id": { + "chip": "BC19", + "lane": 5 + } + }, + { + "id": { + "chip": "BC19", + "lane": 6 + } + }, + { + "id": { + "chip": "BC19", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/25", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC19", + "lane": 4 + } + }, + { + "id": { + "chip": "BC19", + "lane": 5 + } + }, + { + "id": { + "chip": "BC19", + "lane": 6 + } + }, + { + "id": { + "chip": "BC19", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/25", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/25", + "lane": 7 + } + } + ] + } + } + } + }, + "110": { + "mapping": { + "id": 110, + "name": "eth1/6/1", + "controllingPort": 110, + "pins": [ + { + "a": { + "chip": "BC20", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/6", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC20", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/6", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC20", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/6", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC20", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/6", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC20", + "lane": 0 + } + }, + { + "id": { + "chip": "BC20", + "lane": 1 + } + }, + { + "id": { + "chip": "BC20", + "lane": 2 + } + }, + { + "id": { + "chip": "BC20", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/6", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC20", + "lane": 0 + } + }, + { + "id": { + "chip": "BC20", + "lane": 1 + } + }, + { + "id": { + "chip": "BC20", + "lane": 2 + } + }, + { + "id": { + "chip": "BC20", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/6", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 111 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC20", + "lane": 0 + } + }, + { + "id": { + "chip": "BC20", + "lane": 1 + } + }, + { + "id": { + "chip": "BC20", + "lane": 2 + } + }, + { + "id": { + "chip": "BC20", + "lane": 3 + } + }, + { + "id": { + "chip": "BC20", + "lane": 4 + } + }, + { + "id": { + "chip": "BC20", + "lane": 5 + } + }, + { + "id": { + "chip": "BC20", + "lane": 6 + } + }, + { + "id": { + "chip": "BC20", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/6", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 7 + } + } + ] + } + } + } + }, + "111": { + "mapping": { + "id": 111, + "name": "eth1/6/2", + "controllingPort": 110, + "pins": [ + { + "a": { + "chip": "BC20", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/6", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC20", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/6", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC20", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/6", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC20", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/6", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC20", + "lane": 4 + } + }, + { + "id": { + "chip": "BC20", + "lane": 5 + } + }, + { + "id": { + "chip": "BC20", + "lane": 6 + } + }, + { + "id": { + "chip": "BC20", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/6", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC20", + "lane": 4 + } + }, + { + "id": { + "chip": "BC20", + "lane": 5 + } + }, + { + "id": { + "chip": "BC20", + "lane": 6 + } + }, + { + "id": { + "chip": "BC20", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/6", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/6", + "lane": 7 + } + } + ] + } + } + } + }, + "112": { + "mapping": { + "id": 112, + "name": "eth1/9/1", + "controllingPort": 112, + "pins": [ + { + "a": { + "chip": "BC21", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/9", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC21", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/9", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC21", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/9", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC21", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/9", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC21", + "lane": 0 + } + }, + { + "id": { + "chip": "BC21", + "lane": 1 + } + }, + { + "id": { + "chip": "BC21", + "lane": 2 + } + }, + { + "id": { + "chip": "BC21", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/9", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC21", + "lane": 0 + } + }, + { + "id": { + "chip": "BC21", + "lane": 1 + } + }, + { + "id": { + "chip": "BC21", + "lane": 2 + } + }, + { + "id": { + "chip": "BC21", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/9", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 113 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC21", + "lane": 0 + } + }, + { + "id": { + "chip": "BC21", + "lane": 1 + } + }, + { + "id": { + "chip": "BC21", + "lane": 2 + } + }, + { + "id": { + "chip": "BC21", + "lane": 3 + } + }, + { + "id": { + "chip": "BC21", + "lane": 4 + } + }, + { + "id": { + "chip": "BC21", + "lane": 5 + } + }, + { + "id": { + "chip": "BC21", + "lane": 6 + } + }, + { + "id": { + "chip": "BC21", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/9", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 7 + } + } + ] + } + } + } + }, + "113": { + "mapping": { + "id": 113, + "name": "eth1/9/2", + "controllingPort": 112, + "pins": [ + { + "a": { + "chip": "BC21", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/9", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC21", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/9", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC21", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/9", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC21", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/9", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC21", + "lane": 4 + } + }, + { + "id": { + "chip": "BC21", + "lane": 5 + } + }, + { + "id": { + "chip": "BC21", + "lane": 6 + } + }, + { + "id": { + "chip": "BC21", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/9", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC21", + "lane": 4 + } + }, + { + "id": { + "chip": "BC21", + "lane": 5 + } + }, + { + "id": { + "chip": "BC21", + "lane": 6 + } + }, + { + "id": { + "chip": "BC21", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/9", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/9", + "lane": 7 + } + } + ] + } + } + } + }, + "121": { + "mapping": { + "id": 121, + "name": "eth1/21/1", + "controllingPort": 121, + "pins": [ + { + "a": { + "chip": "BC22", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/21", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC22", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/21", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC22", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/21", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC22", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/21", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC22", + "lane": 0 + } + }, + { + "id": { + "chip": "BC22", + "lane": 1 + } + }, + { + "id": { + "chip": "BC22", + "lane": 2 + } + }, + { + "id": { + "chip": "BC22", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/21", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC22", + "lane": 0 + } + }, + { + "id": { + "chip": "BC22", + "lane": 1 + } + }, + { + "id": { + "chip": "BC22", + "lane": 2 + } + }, + { + "id": { + "chip": "BC22", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/21", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 122 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC22", + "lane": 0 + } + }, + { + "id": { + "chip": "BC22", + "lane": 1 + } + }, + { + "id": { + "chip": "BC22", + "lane": 2 + } + }, + { + "id": { + "chip": "BC22", + "lane": 3 + } + }, + { + "id": { + "chip": "BC22", + "lane": 4 + } + }, + { + "id": { + "chip": "BC22", + "lane": 5 + } + }, + { + "id": { + "chip": "BC22", + "lane": 6 + } + }, + { + "id": { + "chip": "BC22", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/21", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 7 + } + } + ] + } + } + } + }, + "122": { + "mapping": { + "id": 122, + "name": "eth1/21/2", + "controllingPort": 121, + "pins": [ + { + "a": { + "chip": "BC22", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/21", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC22", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/21", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC22", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/21", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC22", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/21", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC22", + "lane": 4 + } + }, + { + "id": { + "chip": "BC22", + "lane": 5 + } + }, + { + "id": { + "chip": "BC22", + "lane": 6 + } + }, + { + "id": { + "chip": "BC22", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/21", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC22", + "lane": 4 + } + }, + { + "id": { + "chip": "BC22", + "lane": 5 + } + }, + { + "id": { + "chip": "BC22", + "lane": 6 + } + }, + { + "id": { + "chip": "BC22", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/21", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/21", + "lane": 7 + } + } + ] + } + } + } + }, + "123": { + "mapping": { + "id": 123, + "name": "eth1/26/1", + "controllingPort": 123, + "pins": [ + { + "a": { + "chip": "BC23", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/26", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC23", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/26", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC23", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/26", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC23", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/26", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC23", + "lane": 0 + } + }, + { + "id": { + "chip": "BC23", + "lane": 1 + } + }, + { + "id": { + "chip": "BC23", + "lane": 2 + } + }, + { + "id": { + "chip": "BC23", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/26", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC23", + "lane": 0 + } + }, + { + "id": { + "chip": "BC23", + "lane": 1 + } + }, + { + "id": { + "chip": "BC23", + "lane": 2 + } + }, + { + "id": { + "chip": "BC23", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/26", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 124 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC23", + "lane": 0 + } + }, + { + "id": { + "chip": "BC23", + "lane": 1 + } + }, + { + "id": { + "chip": "BC23", + "lane": 2 + } + }, + { + "id": { + "chip": "BC23", + "lane": 3 + } + }, + { + "id": { + "chip": "BC23", + "lane": 4 + } + }, + { + "id": { + "chip": "BC23", + "lane": 5 + } + }, + { + "id": { + "chip": "BC23", + "lane": 6 + } + }, + { + "id": { + "chip": "BC23", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/26", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 7 + } + } + ] + } + } + } + }, + "124": { + "mapping": { + "id": 124, + "name": "eth1/26/2", + "controllingPort": 123, + "pins": [ + { + "a": { + "chip": "BC23", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/26", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC23", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/26", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC23", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/26", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC23", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/26", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC23", + "lane": 4 + } + }, + { + "id": { + "chip": "BC23", + "lane": 5 + } + }, + { + "id": { + "chip": "BC23", + "lane": 6 + } + }, + { + "id": { + "chip": "BC23", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/26", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC23", + "lane": 4 + } + }, + { + "id": { + "chip": "BC23", + "lane": 5 + } + }, + { + "id": { + "chip": "BC23", + "lane": 6 + } + }, + { + "id": { + "chip": "BC23", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/26", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/26", + "lane": 7 + } + } + ] + } + } + } + }, + "132": { + "mapping": { + "id": 132, + "name": "eth1/7/1", + "controllingPort": 132, + "pins": [ + { + "a": { + "chip": "BC24", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/7", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC24", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/7", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC24", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/7", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC24", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/7", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC24", + "lane": 0 + } + }, + { + "id": { + "chip": "BC24", + "lane": 1 + } + }, + { + "id": { + "chip": "BC24", + "lane": 2 + } + }, + { + "id": { + "chip": "BC24", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/7", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC24", + "lane": 0 + } + }, + { + "id": { + "chip": "BC24", + "lane": 1 + } + }, + { + "id": { + "chip": "BC24", + "lane": 2 + } + }, + { + "id": { + "chip": "BC24", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/7", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 133 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC24", + "lane": 0 + } + }, + { + "id": { + "chip": "BC24", + "lane": 1 + } + }, + { + "id": { + "chip": "BC24", + "lane": 2 + } + }, + { + "id": { + "chip": "BC24", + "lane": 3 + } + }, + { + "id": { + "chip": "BC24", + "lane": 4 + } + }, + { + "id": { + "chip": "BC24", + "lane": 5 + } + }, + { + "id": { + "chip": "BC24", + "lane": 6 + } + }, + { + "id": { + "chip": "BC24", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/7", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 7 + } + } + ] + } + } + } + }, + "133": { + "mapping": { + "id": 133, + "name": "eth1/7/2", + "controllingPort": 132, + "pins": [ + { + "a": { + "chip": "BC24", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/7", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC24", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/7", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC24", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/7", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC24", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/7", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC24", + "lane": 4 + } + }, + { + "id": { + "chip": "BC24", + "lane": 5 + } + }, + { + "id": { + "chip": "BC24", + "lane": 6 + } + }, + { + "id": { + "chip": "BC24", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/7", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC24", + "lane": 4 + } + }, + { + "id": { + "chip": "BC24", + "lane": 5 + } + }, + { + "id": { + "chip": "BC24", + "lane": 6 + } + }, + { + "id": { + "chip": "BC24", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/7", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/7", + "lane": 7 + } + } + ] + } + } + } + }, + "134": { + "mapping": { + "id": 134, + "name": "eth1/12/1", + "controllingPort": 134, + "pins": [ + { + "a": { + "chip": "BC25", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/12", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC25", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/12", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC25", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/12", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC25", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/12", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC25", + "lane": 0 + } + }, + { + "id": { + "chip": "BC25", + "lane": 1 + } + }, + { + "id": { + "chip": "BC25", + "lane": 2 + } + }, + { + "id": { + "chip": "BC25", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/12", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC25", + "lane": 0 + } + }, + { + "id": { + "chip": "BC25", + "lane": 1 + } + }, + { + "id": { + "chip": "BC25", + "lane": 2 + } + }, + { + "id": { + "chip": "BC25", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/12", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 135 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC25", + "lane": 0 + } + }, + { + "id": { + "chip": "BC25", + "lane": 1 + } + }, + { + "id": { + "chip": "BC25", + "lane": 2 + } + }, + { + "id": { + "chip": "BC25", + "lane": 3 + } + }, + { + "id": { + "chip": "BC25", + "lane": 4 + } + }, + { + "id": { + "chip": "BC25", + "lane": 5 + } + }, + { + "id": { + "chip": "BC25", + "lane": 6 + } + }, + { + "id": { + "chip": "BC25", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/12", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 7 + } + } + ] + } + } + } + }, + "135": { + "mapping": { + "id": 135, + "name": "eth1/12/2", + "controllingPort": 134, + "pins": [ + { + "a": { + "chip": "BC25", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/12", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC25", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/12", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC25", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/12", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC25", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/12", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC25", + "lane": 4 + } + }, + { + "id": { + "chip": "BC25", + "lane": 5 + } + }, + { + "id": { + "chip": "BC25", + "lane": 6 + } + }, + { + "id": { + "chip": "BC25", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/12", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC25", + "lane": 4 + } + }, + { + "id": { + "chip": "BC25", + "lane": 5 + } + }, + { + "id": { + "chip": "BC25", + "lane": 6 + } + }, + { + "id": { + "chip": "BC25", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/12", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/12", + "lane": 7 + } + } + ] + } + } + } + }, + "143": { + "mapping": { + "id": 143, + "name": "eth1/24/1", + "controllingPort": 143, + "pins": [ + { + "a": { + "chip": "BC26", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/24", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC26", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/24", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC26", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/24", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC26", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/24", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC26", + "lane": 0 + } + }, + { + "id": { + "chip": "BC26", + "lane": 1 + } + }, + { + "id": { + "chip": "BC26", + "lane": 2 + } + }, + { + "id": { + "chip": "BC26", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/24", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC26", + "lane": 0 + } + }, + { + "id": { + "chip": "BC26", + "lane": 1 + } + }, + { + "id": { + "chip": "BC26", + "lane": 2 + } + }, + { + "id": { + "chip": "BC26", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/24", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 144 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC26", + "lane": 0 + } + }, + { + "id": { + "chip": "BC26", + "lane": 1 + } + }, + { + "id": { + "chip": "BC26", + "lane": 2 + } + }, + { + "id": { + "chip": "BC26", + "lane": 3 + } + }, + { + "id": { + "chip": "BC26", + "lane": 4 + } + }, + { + "id": { + "chip": "BC26", + "lane": 5 + } + }, + { + "id": { + "chip": "BC26", + "lane": 6 + } + }, + { + "id": { + "chip": "BC26", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/24", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 7 + } + } + ] + } + } + } + }, + "144": { + "mapping": { + "id": 144, + "name": "eth1/24/2", + "controllingPort": 143, + "pins": [ + { + "a": { + "chip": "BC26", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/24", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC26", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/24", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC26", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/24", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC26", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/24", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC26", + "lane": 4 + } + }, + { + "id": { + "chip": "BC26", + "lane": 5 + } + }, + { + "id": { + "chip": "BC26", + "lane": 6 + } + }, + { + "id": { + "chip": "BC26", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/24", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC26", + "lane": 4 + } + }, + { + "id": { + "chip": "BC26", + "lane": 5 + } + }, + { + "id": { + "chip": "BC26", + "lane": 6 + } + }, + { + "id": { + "chip": "BC26", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/24", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/24", + "lane": 7 + } + } + ] + } + } + } + }, + "145": { + "mapping": { + "id": 145, + "name": "eth1/27/1", + "controllingPort": 145, + "pins": [ + { + "a": { + "chip": "BC27", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/27", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC27", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/27", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC27", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/27", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC27", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/27", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC27", + "lane": 0 + } + }, + { + "id": { + "chip": "BC27", + "lane": 1 + } + }, + { + "id": { + "chip": "BC27", + "lane": 2 + } + }, + { + "id": { + "chip": "BC27", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/27", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC27", + "lane": 0 + } + }, + { + "id": { + "chip": "BC27", + "lane": 1 + } + }, + { + "id": { + "chip": "BC27", + "lane": 2 + } + }, + { + "id": { + "chip": "BC27", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/27", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 146 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC27", + "lane": 0 + } + }, + { + "id": { + "chip": "BC27", + "lane": 1 + } + }, + { + "id": { + "chip": "BC27", + "lane": 2 + } + }, + { + "id": { + "chip": "BC27", + "lane": 3 + } + }, + { + "id": { + "chip": "BC27", + "lane": 4 + } + }, + { + "id": { + "chip": "BC27", + "lane": 5 + } + }, + { + "id": { + "chip": "BC27", + "lane": 6 + } + }, + { + "id": { + "chip": "BC27", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/27", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 7 + } + } + ] + } + } + } + }, + "146": { + "mapping": { + "id": 146, + "name": "eth1/27/2", + "controllingPort": 145, + "pins": [ + { + "a": { + "chip": "BC27", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/27", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC27", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/27", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC27", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/27", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC27", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/27", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC27", + "lane": 4 + } + }, + { + "id": { + "chip": "BC27", + "lane": 5 + } + }, + { + "id": { + "chip": "BC27", + "lane": 6 + } + }, + { + "id": { + "chip": "BC27", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/27", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC27", + "lane": 4 + } + }, + { + "id": { + "chip": "BC27", + "lane": 5 + } + }, + { + "id": { + "chip": "BC27", + "lane": 6 + } + }, + { + "id": { + "chip": "BC27", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/27", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/27", + "lane": 7 + } + } + ] + } + } + } + }, + "154": { + "mapping": { + "id": 154, + "name": "eth1/8/1", + "controllingPort": 154, + "pins": [ + { + "a": { + "chip": "BC28", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/8", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC28", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/8", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC28", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/8", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC28", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/8", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC28", + "lane": 0 + } + }, + { + "id": { + "chip": "BC28", + "lane": 1 + } + }, + { + "id": { + "chip": "BC28", + "lane": 2 + } + }, + { + "id": { + "chip": "BC28", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/8", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC28", + "lane": 0 + } + }, + { + "id": { + "chip": "BC28", + "lane": 1 + } + }, + { + "id": { + "chip": "BC28", + "lane": 2 + } + }, + { + "id": { + "chip": "BC28", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/8", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 155 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC28", + "lane": 0 + } + }, + { + "id": { + "chip": "BC28", + "lane": 1 + } + }, + { + "id": { + "chip": "BC28", + "lane": 2 + } + }, + { + "id": { + "chip": "BC28", + "lane": 3 + } + }, + { + "id": { + "chip": "BC28", + "lane": 4 + } + }, + { + "id": { + "chip": "BC28", + "lane": 5 + } + }, + { + "id": { + "chip": "BC28", + "lane": 6 + } + }, + { + "id": { + "chip": "BC28", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/8", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 7 + } + } + ] + } + } + } + }, + "155": { + "mapping": { + "id": 155, + "name": "eth1/8/2", + "controllingPort": 154, + "pins": [ + { + "a": { + "chip": "BC28", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/8", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC28", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/8", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC28", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/8", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC28", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/8", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC28", + "lane": 4 + } + }, + { + "id": { + "chip": "BC28", + "lane": 5 + } + }, + { + "id": { + "chip": "BC28", + "lane": 6 + } + }, + { + "id": { + "chip": "BC28", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/8", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC28", + "lane": 4 + } + }, + { + "id": { + "chip": "BC28", + "lane": 5 + } + }, + { + "id": { + "chip": "BC28", + "lane": 6 + } + }, + { + "id": { + "chip": "BC28", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/8", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/8", + "lane": 7 + } + } + ] + } + } + } + }, + "156": { + "mapping": { + "id": 156, + "name": "eth1/11/1", + "controllingPort": 156, + "pins": [ + { + "a": { + "chip": "BC29", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/11", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC29", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/11", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC29", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/11", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC29", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/11", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC29", + "lane": 0 + } + }, + { + "id": { + "chip": "BC29", + "lane": 1 + } + }, + { + "id": { + "chip": "BC29", + "lane": 2 + } + }, + { + "id": { + "chip": "BC29", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/11", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC29", + "lane": 0 + } + }, + { + "id": { + "chip": "BC29", + "lane": 1 + } + }, + { + "id": { + "chip": "BC29", + "lane": 2 + } + }, + { + "id": { + "chip": "BC29", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/11", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 157 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC29", + "lane": 0 + } + }, + { + "id": { + "chip": "BC29", + "lane": 1 + } + }, + { + "id": { + "chip": "BC29", + "lane": 2 + } + }, + { + "id": { + "chip": "BC29", + "lane": 3 + } + }, + { + "id": { + "chip": "BC29", + "lane": 4 + } + }, + { + "id": { + "chip": "BC29", + "lane": 5 + } + }, + { + "id": { + "chip": "BC29", + "lane": 6 + } + }, + { + "id": { + "chip": "BC29", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/11", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 7 + } + } + ] + } + } + } + }, + "157": { + "mapping": { + "id": 157, + "name": "eth1/11/2", + "controllingPort": 156, + "pins": [ + { + "a": { + "chip": "BC29", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/11", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC29", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/11", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC29", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/11", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC29", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/11", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC29", + "lane": 4 + } + }, + { + "id": { + "chip": "BC29", + "lane": 5 + } + }, + { + "id": { + "chip": "BC29", + "lane": 6 + } + }, + { + "id": { + "chip": "BC29", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/11", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC29", + "lane": 4 + } + }, + { + "id": { + "chip": "BC29", + "lane": 5 + } + }, + { + "id": { + "chip": "BC29", + "lane": 6 + } + }, + { + "id": { + "chip": "BC29", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/11", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/11", + "lane": 7 + } + } + ] + } + } + } + }, + "165": { + "mapping": { + "id": 165, + "name": "eth1/28/1", + "controllingPort": 165, + "pins": [ + { + "a": { + "chip": "BC30", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/28", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC30", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/28", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC30", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/28", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC30", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/28", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC30", + "lane": 0 + } + }, + { + "id": { + "chip": "BC30", + "lane": 1 + } + }, + { + "id": { + "chip": "BC30", + "lane": 2 + } + }, + { + "id": { + "chip": "BC30", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/28", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC30", + "lane": 0 + } + }, + { + "id": { + "chip": "BC30", + "lane": 1 + } + }, + { + "id": { + "chip": "BC30", + "lane": 2 + } + }, + { + "id": { + "chip": "BC30", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/28", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 166 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC30", + "lane": 0 + } + }, + { + "id": { + "chip": "BC30", + "lane": 1 + } + }, + { + "id": { + "chip": "BC30", + "lane": 2 + } + }, + { + "id": { + "chip": "BC30", + "lane": 3 + } + }, + { + "id": { + "chip": "BC30", + "lane": 4 + } + }, + { + "id": { + "chip": "BC30", + "lane": 5 + } + }, + { + "id": { + "chip": "BC30", + "lane": 6 + } + }, + { + "id": { + "chip": "BC30", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/28", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 7 + } + } + ] + } + } + } + }, + "166": { + "mapping": { + "id": 166, + "name": "eth1/28/2", + "controllingPort": 165, + "pins": [ + { + "a": { + "chip": "BC30", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/28", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC30", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/28", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC30", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/28", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC30", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/28", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC30", + "lane": 4 + } + }, + { + "id": { + "chip": "BC30", + "lane": 5 + } + }, + { + "id": { + "chip": "BC30", + "lane": 6 + } + }, + { + "id": { + "chip": "BC30", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/28", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC30", + "lane": 4 + } + }, + { + "id": { + "chip": "BC30", + "lane": 5 + } + }, + { + "id": { + "chip": "BC30", + "lane": 6 + } + }, + { + "id": { + "chip": "BC30", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/28", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/28", + "lane": 7 + } + } + ] + } + } + } + }, + "167": { + "mapping": { + "id": 167, + "name": "eth1/23/1", + "controllingPort": 167, + "pins": [ + { + "a": { + "chip": "BC31", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/23", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC31", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/23", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC31", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/23", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC31", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/23", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC31", + "lane": 0 + } + }, + { + "id": { + "chip": "BC31", + "lane": 1 + } + }, + { + "id": { + "chip": "BC31", + "lane": 2 + } + }, + { + "id": { + "chip": "BC31", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/23", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC31", + "lane": 0 + } + }, + { + "id": { + "chip": "BC31", + "lane": 1 + } + }, + { + "id": { + "chip": "BC31", + "lane": 2 + } + }, + { + "id": { + "chip": "BC31", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/23", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 168 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC31", + "lane": 0 + } + }, + { + "id": { + "chip": "BC31", + "lane": 1 + } + }, + { + "id": { + "chip": "BC31", + "lane": 2 + } + }, + { + "id": { + "chip": "BC31", + "lane": 3 + } + }, + { + "id": { + "chip": "BC31", + "lane": 4 + } + }, + { + "id": { + "chip": "BC31", + "lane": 5 + } + }, + { + "id": { + "chip": "BC31", + "lane": 6 + } + }, + { + "id": { + "chip": "BC31", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/23", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 7 + } + } + ] + } + } + } + }, + "168": { + "mapping": { + "id": 168, + "name": "eth1/23/2", + "controllingPort": 167, + "pins": [ + { + "a": { + "chip": "BC31", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/23", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC31", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/23", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC31", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/23", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC31", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/23", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC31", + "lane": 4 + } + }, + { + "id": { + "chip": "BC31", + "lane": 5 + } + }, + { + "id": { + "chip": "BC31", + "lane": 6 + } + }, + { + "id": { + "chip": "BC31", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/23", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC31", + "lane": 4 + } + }, + { + "id": { + "chip": "BC31", + "lane": 5 + } + }, + { + "id": { + "chip": "BC31", + "lane": 6 + } + }, + { + "id": { + "chip": "BC31", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/23", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/23", + "lane": 7 + } + } + ] + } + } + } + }, + "176": { + "mapping": { + "id": 176, + "name": "eth1/47/1", + "controllingPort": 176, + "pins": [ + { + "a": { + "chip": "BC32", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/47", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC32", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/47", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC32", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/47", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC32", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/47", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC32", + "lane": 0 + } + }, + { + "id": { + "chip": "BC32", + "lane": 1 + } + }, + { + "id": { + "chip": "BC32", + "lane": 2 + } + }, + { + "id": { + "chip": "BC32", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/47", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC32", + "lane": 0 + } + }, + { + "id": { + "chip": "BC32", + "lane": 1 + } + }, + { + "id": { + "chip": "BC32", + "lane": 2 + } + }, + { + "id": { + "chip": "BC32", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/47", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 177 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC32", + "lane": 0 + } + }, + { + "id": { + "chip": "BC32", + "lane": 1 + } + }, + { + "id": { + "chip": "BC32", + "lane": 2 + } + }, + { + "id": { + "chip": "BC32", + "lane": 3 + } + }, + { + "id": { + "chip": "BC32", + "lane": 4 + } + }, + { + "id": { + "chip": "BC32", + "lane": 5 + } + }, + { + "id": { + "chip": "BC32", + "lane": 6 + } + }, + { + "id": { + "chip": "BC32", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/47", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 7 + } + } + ] + } + } + } + }, + "177": { + "mapping": { + "id": 177, + "name": "eth1/47/2", + "controllingPort": 176, + "pins": [ + { + "a": { + "chip": "BC32", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/47", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC32", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/47", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC32", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/47", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC32", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/47", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC32", + "lane": 4 + } + }, + { + "id": { + "chip": "BC32", + "lane": 5 + } + }, + { + "id": { + "chip": "BC32", + "lane": 6 + } + }, + { + "id": { + "chip": "BC32", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/47", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC32", + "lane": 4 + } + }, + { + "id": { + "chip": "BC32", + "lane": 5 + } + }, + { + "id": { + "chip": "BC32", + "lane": 6 + } + }, + { + "id": { + "chip": "BC32", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/47", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/47", + "lane": 7 + } + } + ] + } + } + } + }, + "178": { + "mapping": { + "id": 178, + "name": "eth1/36/1", + "controllingPort": 178, + "pins": [ + { + "a": { + "chip": "BC33", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/36", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC33", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/36", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC33", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/36", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC33", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/36", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC33", + "lane": 0 + } + }, + { + "id": { + "chip": "BC33", + "lane": 1 + } + }, + { + "id": { + "chip": "BC33", + "lane": 2 + } + }, + { + "id": { + "chip": "BC33", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/36", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC33", + "lane": 0 + } + }, + { + "id": { + "chip": "BC33", + "lane": 1 + } + }, + { + "id": { + "chip": "BC33", + "lane": 2 + } + }, + { + "id": { + "chip": "BC33", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/36", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 179 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC33", + "lane": 0 + } + }, + { + "id": { + "chip": "BC33", + "lane": 1 + } + }, + { + "id": { + "chip": "BC33", + "lane": 2 + } + }, + { + "id": { + "chip": "BC33", + "lane": 3 + } + }, + { + "id": { + "chip": "BC33", + "lane": 4 + } + }, + { + "id": { + "chip": "BC33", + "lane": 5 + } + }, + { + "id": { + "chip": "BC33", + "lane": 6 + } + }, + { + "id": { + "chip": "BC33", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/36", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 7 + } + } + ] + } + } + } + }, + "179": { + "mapping": { + "id": 179, + "name": "eth1/36/2", + "controllingPort": 178, + "pins": [ + { + "a": { + "chip": "BC33", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/36", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC33", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/36", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC33", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/36", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC33", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/36", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC33", + "lane": 4 + } + }, + { + "id": { + "chip": "BC33", + "lane": 5 + } + }, + { + "id": { + "chip": "BC33", + "lane": 6 + } + }, + { + "id": { + "chip": "BC33", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/36", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC33", + "lane": 4 + } + }, + { + "id": { + "chip": "BC33", + "lane": 5 + } + }, + { + "id": { + "chip": "BC33", + "lane": 6 + } + }, + { + "id": { + "chip": "BC33", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/36", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/36", + "lane": 7 + } + } + ] + } + } + } + }, + "187": { + "mapping": { + "id": 187, + "name": "eth1/51/1", + "controllingPort": 187, + "pins": [ + { + "a": { + "chip": "BC34", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/51", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC34", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/51", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC34", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/51", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC34", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/51", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC34", + "lane": 0 + } + }, + { + "id": { + "chip": "BC34", + "lane": 1 + } + }, + { + "id": { + "chip": "BC34", + "lane": 2 + } + }, + { + "id": { + "chip": "BC34", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/51", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC34", + "lane": 0 + } + }, + { + "id": { + "chip": "BC34", + "lane": 1 + } + }, + { + "id": { + "chip": "BC34", + "lane": 2 + } + }, + { + "id": { + "chip": "BC34", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/51", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 188 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC34", + "lane": 0 + } + }, + { + "id": { + "chip": "BC34", + "lane": 1 + } + }, + { + "id": { + "chip": "BC34", + "lane": 2 + } + }, + { + "id": { + "chip": "BC34", + "lane": 3 + } + }, + { + "id": { + "chip": "BC34", + "lane": 4 + } + }, + { + "id": { + "chip": "BC34", + "lane": 5 + } + }, + { + "id": { + "chip": "BC34", + "lane": 6 + } + }, + { + "id": { + "chip": "BC34", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/51", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 7 + } + } + ] + } + } + } + }, + "188": { + "mapping": { + "id": 188, + "name": "eth1/51/2", + "controllingPort": 187, + "pins": [ + { + "a": { + "chip": "BC34", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/51", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC34", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/51", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC34", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/51", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC34", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/51", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC34", + "lane": 4 + } + }, + { + "id": { + "chip": "BC34", + "lane": 5 + } + }, + { + "id": { + "chip": "BC34", + "lane": 6 + } + }, + { + "id": { + "chip": "BC34", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/51", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC34", + "lane": 4 + } + }, + { + "id": { + "chip": "BC34", + "lane": 5 + } + }, + { + "id": { + "chip": "BC34", + "lane": 6 + } + }, + { + "id": { + "chip": "BC34", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/51", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/51", + "lane": 7 + } + } + ] + } + } + } + }, + "189": { + "mapping": { + "id": 189, + "name": "eth1/64/1", + "controllingPort": 189, + "pins": [ + { + "a": { + "chip": "BC35", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/64", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC35", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/64", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC35", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/64", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC35", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/64", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC35", + "lane": 0 + } + }, + { + "id": { + "chip": "BC35", + "lane": 1 + } + }, + { + "id": { + "chip": "BC35", + "lane": 2 + } + }, + { + "id": { + "chip": "BC35", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/64", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC35", + "lane": 0 + } + }, + { + "id": { + "chip": "BC35", + "lane": 1 + } + }, + { + "id": { + "chip": "BC35", + "lane": 2 + } + }, + { + "id": { + "chip": "BC35", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/64", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 190 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC35", + "lane": 0 + } + }, + { + "id": { + "chip": "BC35", + "lane": 1 + } + }, + { + "id": { + "chip": "BC35", + "lane": 2 + } + }, + { + "id": { + "chip": "BC35", + "lane": 3 + } + }, + { + "id": { + "chip": "BC35", + "lane": 4 + } + }, + { + "id": { + "chip": "BC35", + "lane": 5 + } + }, + { + "id": { + "chip": "BC35", + "lane": 6 + } + }, + { + "id": { + "chip": "BC35", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/64", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 7 + } + } + ] + } + } + } + }, + "190": { + "mapping": { + "id": 190, + "name": "eth1/64/2", + "controllingPort": 189, + "pins": [ + { + "a": { + "chip": "BC35", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/64", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC35", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/64", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC35", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/64", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC35", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/64", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC35", + "lane": 4 + } + }, + { + "id": { + "chip": "BC35", + "lane": 5 + } + }, + { + "id": { + "chip": "BC35", + "lane": 6 + } + }, + { + "id": { + "chip": "BC35", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/64", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC35", + "lane": 4 + } + }, + { + "id": { + "chip": "BC35", + "lane": 5 + } + }, + { + "id": { + "chip": "BC35", + "lane": 6 + } + }, + { + "id": { + "chip": "BC35", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/64", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/64", + "lane": 7 + } + } + ] + } + } + } + }, + "198": { + "mapping": { + "id": 198, + "name": "eth1/35/1", + "controllingPort": 198, + "pins": [ + { + "a": { + "chip": "BC36", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/35", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC36", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/35", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC36", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/35", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC36", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/35", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC36", + "lane": 0 + } + }, + { + "id": { + "chip": "BC36", + "lane": 1 + } + }, + { + "id": { + "chip": "BC36", + "lane": 2 + } + }, + { + "id": { + "chip": "BC36", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/35", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC36", + "lane": 0 + } + }, + { + "id": { + "chip": "BC36", + "lane": 1 + } + }, + { + "id": { + "chip": "BC36", + "lane": 2 + } + }, + { + "id": { + "chip": "BC36", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/35", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 199 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC36", + "lane": 0 + } + }, + { + "id": { + "chip": "BC36", + "lane": 1 + } + }, + { + "id": { + "chip": "BC36", + "lane": 2 + } + }, + { + "id": { + "chip": "BC36", + "lane": 3 + } + }, + { + "id": { + "chip": "BC36", + "lane": 4 + } + }, + { + "id": { + "chip": "BC36", + "lane": 5 + } + }, + { + "id": { + "chip": "BC36", + "lane": 6 + } + }, + { + "id": { + "chip": "BC36", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/35", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 7 + } + } + ] + } + } + } + }, + "199": { + "mapping": { + "id": 199, + "name": "eth1/35/2", + "controllingPort": 198, + "pins": [ + { + "a": { + "chip": "BC36", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/35", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC36", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/35", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC36", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/35", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC36", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/35", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC36", + "lane": 4 + } + }, + { + "id": { + "chip": "BC36", + "lane": 5 + } + }, + { + "id": { + "chip": "BC36", + "lane": 6 + } + }, + { + "id": { + "chip": "BC36", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/35", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC36", + "lane": 4 + } + }, + { + "id": { + "chip": "BC36", + "lane": 5 + } + }, + { + "id": { + "chip": "BC36", + "lane": 6 + } + }, + { + "id": { + "chip": "BC36", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/35", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/35", + "lane": 7 + } + } + ] + } + } + } + }, + "200": { + "mapping": { + "id": 200, + "name": "eth1/48/1", + "controllingPort": 200, + "pins": [ + { + "a": { + "chip": "BC37", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/48", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC37", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/48", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC37", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/48", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC37", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/48", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC37", + "lane": 0 + } + }, + { + "id": { + "chip": "BC37", + "lane": 1 + } + }, + { + "id": { + "chip": "BC37", + "lane": 2 + } + }, + { + "id": { + "chip": "BC37", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/48", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC37", + "lane": 0 + } + }, + { + "id": { + "chip": "BC37", + "lane": 1 + } + }, + { + "id": { + "chip": "BC37", + "lane": 2 + } + }, + { + "id": { + "chip": "BC37", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/48", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 201 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC37", + "lane": 0 + } + }, + { + "id": { + "chip": "BC37", + "lane": 1 + } + }, + { + "id": { + "chip": "BC37", + "lane": 2 + } + }, + { + "id": { + "chip": "BC37", + "lane": 3 + } + }, + { + "id": { + "chip": "BC37", + "lane": 4 + } + }, + { + "id": { + "chip": "BC37", + "lane": 5 + } + }, + { + "id": { + "chip": "BC37", + "lane": 6 + } + }, + { + "id": { + "chip": "BC37", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/48", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 7 + } + } + ] + } + } + } + }, + "201": { + "mapping": { + "id": 201, + "name": "eth1/48/2", + "controllingPort": 200, + "pins": [ + { + "a": { + "chip": "BC37", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/48", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC37", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/48", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC37", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/48", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC37", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/48", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC37", + "lane": 4 + } + }, + { + "id": { + "chip": "BC37", + "lane": 5 + } + }, + { + "id": { + "chip": "BC37", + "lane": 6 + } + }, + { + "id": { + "chip": "BC37", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/48", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC37", + "lane": 4 + } + }, + { + "id": { + "chip": "BC37", + "lane": 5 + } + }, + { + "id": { + "chip": "BC37", + "lane": 6 + } + }, + { + "id": { + "chip": "BC37", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/48", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/48", + "lane": 7 + } + } + ] + } + } + } + }, + "209": { + "mapping": { + "id": 209, + "name": "eth1/52/1", + "controllingPort": 209, + "pins": [ + { + "a": { + "chip": "BC38", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/52", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC38", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/52", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC38", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/52", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC38", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/52", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC38", + "lane": 0 + } + }, + { + "id": { + "chip": "BC38", + "lane": 1 + } + }, + { + "id": { + "chip": "BC38", + "lane": 2 + } + }, + { + "id": { + "chip": "BC38", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/52", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC38", + "lane": 0 + } + }, + { + "id": { + "chip": "BC38", + "lane": 1 + } + }, + { + "id": { + "chip": "BC38", + "lane": 2 + } + }, + { + "id": { + "chip": "BC38", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/52", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 210 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC38", + "lane": 0 + } + }, + { + "id": { + "chip": "BC38", + "lane": 1 + } + }, + { + "id": { + "chip": "BC38", + "lane": 2 + } + }, + { + "id": { + "chip": "BC38", + "lane": 3 + } + }, + { + "id": { + "chip": "BC38", + "lane": 4 + } + }, + { + "id": { + "chip": "BC38", + "lane": 5 + } + }, + { + "id": { + "chip": "BC38", + "lane": 6 + } + }, + { + "id": { + "chip": "BC38", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/52", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 7 + } + } + ] + } + } + } + }, + "210": { + "mapping": { + "id": 210, + "name": "eth1/52/2", + "controllingPort": 209, + "pins": [ + { + "a": { + "chip": "BC38", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/52", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC38", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/52", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC38", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/52", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC38", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/52", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC38", + "lane": 4 + } + }, + { + "id": { + "chip": "BC38", + "lane": 5 + } + }, + { + "id": { + "chip": "BC38", + "lane": 6 + } + }, + { + "id": { + "chip": "BC38", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/52", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC38", + "lane": 4 + } + }, + { + "id": { + "chip": "BC38", + "lane": 5 + } + }, + { + "id": { + "chip": "BC38", + "lane": 6 + } + }, + { + "id": { + "chip": "BC38", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/52", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/52", + "lane": 7 + } + } + ] + } + } + } + }, + "211": { + "mapping": { + "id": 211, + "name": "eth1/63/1", + "controllingPort": 211, + "pins": [ + { + "a": { + "chip": "BC39", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/63", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC39", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/63", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC39", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/63", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC39", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/63", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC39", + "lane": 0 + } + }, + { + "id": { + "chip": "BC39", + "lane": 1 + } + }, + { + "id": { + "chip": "BC39", + "lane": 2 + } + }, + { + "id": { + "chip": "BC39", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/63", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC39", + "lane": 0 + } + }, + { + "id": { + "chip": "BC39", + "lane": 1 + } + }, + { + "id": { + "chip": "BC39", + "lane": 2 + } + }, + { + "id": { + "chip": "BC39", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/63", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 212 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC39", + "lane": 0 + } + }, + { + "id": { + "chip": "BC39", + "lane": 1 + } + }, + { + "id": { + "chip": "BC39", + "lane": 2 + } + }, + { + "id": { + "chip": "BC39", + "lane": 3 + } + }, + { + "id": { + "chip": "BC39", + "lane": 4 + } + }, + { + "id": { + "chip": "BC39", + "lane": 5 + } + }, + { + "id": { + "chip": "BC39", + "lane": 6 + } + }, + { + "id": { + "chip": "BC39", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/63", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 7 + } + } + ] + } + } + } + }, + "212": { + "mapping": { + "id": 212, + "name": "eth1/63/2", + "controllingPort": 211, + "pins": [ + { + "a": { + "chip": "BC39", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/63", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC39", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/63", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC39", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/63", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC39", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/63", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC39", + "lane": 4 + } + }, + { + "id": { + "chip": "BC39", + "lane": 5 + } + }, + { + "id": { + "chip": "BC39", + "lane": 6 + } + }, + { + "id": { + "chip": "BC39", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/63", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC39", + "lane": 4 + } + }, + { + "id": { + "chip": "BC39", + "lane": 5 + } + }, + { + "id": { + "chip": "BC39", + "lane": 6 + } + }, + { + "id": { + "chip": "BC39", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/63", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/63", + "lane": 7 + } + } + ] + } + } + } + }, + "220": { + "mapping": { + "id": 220, + "name": "eth1/34/1", + "controllingPort": 220, + "pins": [ + { + "a": { + "chip": "BC40", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/34", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC40", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/34", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC40", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/34", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC40", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/34", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC40", + "lane": 0 + } + }, + { + "id": { + "chip": "BC40", + "lane": 1 + } + }, + { + "id": { + "chip": "BC40", + "lane": 2 + } + }, + { + "id": { + "chip": "BC40", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/34", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC40", + "lane": 0 + } + }, + { + "id": { + "chip": "BC40", + "lane": 1 + } + }, + { + "id": { + "chip": "BC40", + "lane": 2 + } + }, + { + "id": { + "chip": "BC40", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/34", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 221 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC40", + "lane": 0 + } + }, + { + "id": { + "chip": "BC40", + "lane": 1 + } + }, + { + "id": { + "chip": "BC40", + "lane": 2 + } + }, + { + "id": { + "chip": "BC40", + "lane": 3 + } + }, + { + "id": { + "chip": "BC40", + "lane": 4 + } + }, + { + "id": { + "chip": "BC40", + "lane": 5 + } + }, + { + "id": { + "chip": "BC40", + "lane": 6 + } + }, + { + "id": { + "chip": "BC40", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/34", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 7 + } + } + ] + } + } + } + }, + "221": { + "mapping": { + "id": 221, + "name": "eth1/34/2", + "controllingPort": 220, + "pins": [ + { + "a": { + "chip": "BC40", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/34", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC40", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/34", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC40", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/34", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC40", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/34", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC40", + "lane": 4 + } + }, + { + "id": { + "chip": "BC40", + "lane": 5 + } + }, + { + "id": { + "chip": "BC40", + "lane": 6 + } + }, + { + "id": { + "chip": "BC40", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/34", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC40", + "lane": 4 + } + }, + { + "id": { + "chip": "BC40", + "lane": 5 + } + }, + { + "id": { + "chip": "BC40", + "lane": 6 + } + }, + { + "id": { + "chip": "BC40", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/34", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/34", + "lane": 7 + } + } + ] + } + } + } + }, + "222": { + "mapping": { + "id": 222, + "name": "eth1/45/1", + "controllingPort": 222, + "pins": [ + { + "a": { + "chip": "BC41", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/45", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC41", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/45", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC41", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/45", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC41", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/45", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC41", + "lane": 0 + } + }, + { + "id": { + "chip": "BC41", + "lane": 1 + } + }, + { + "id": { + "chip": "BC41", + "lane": 2 + } + }, + { + "id": { + "chip": "BC41", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/45", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC41", + "lane": 0 + } + }, + { + "id": { + "chip": "BC41", + "lane": 1 + } + }, + { + "id": { + "chip": "BC41", + "lane": 2 + } + }, + { + "id": { + "chip": "BC41", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/45", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 223 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC41", + "lane": 0 + } + }, + { + "id": { + "chip": "BC41", + "lane": 1 + } + }, + { + "id": { + "chip": "BC41", + "lane": 2 + } + }, + { + "id": { + "chip": "BC41", + "lane": 3 + } + }, + { + "id": { + "chip": "BC41", + "lane": 4 + } + }, + { + "id": { + "chip": "BC41", + "lane": 5 + } + }, + { + "id": { + "chip": "BC41", + "lane": 6 + } + }, + { + "id": { + "chip": "BC41", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/45", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 7 + } + } + ] + } + } + } + }, + "223": { + "mapping": { + "id": 223, + "name": "eth1/45/2", + "controllingPort": 222, + "pins": [ + { + "a": { + "chip": "BC41", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/45", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC41", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/45", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC41", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/45", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC41", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/45", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC41", + "lane": 4 + } + }, + { + "id": { + "chip": "BC41", + "lane": 5 + } + }, + { + "id": { + "chip": "BC41", + "lane": 6 + } + }, + { + "id": { + "chip": "BC41", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/45", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC41", + "lane": 4 + } + }, + { + "id": { + "chip": "BC41", + "lane": 5 + } + }, + { + "id": { + "chip": "BC41", + "lane": 6 + } + }, + { + "id": { + "chip": "BC41", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/45", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/45", + "lane": 7 + } + } + ] + } + } + } + }, + "231": { + "mapping": { + "id": 231, + "name": "eth1/49/1", + "controllingPort": 231, + "pins": [ + { + "a": { + "chip": "BC42", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/49", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC42", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/49", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC42", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/49", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC42", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/49", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC42", + "lane": 0 + } + }, + { + "id": { + "chip": "BC42", + "lane": 1 + } + }, + { + "id": { + "chip": "BC42", + "lane": 2 + } + }, + { + "id": { + "chip": "BC42", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/49", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC42", + "lane": 0 + } + }, + { + "id": { + "chip": "BC42", + "lane": 1 + } + }, + { + "id": { + "chip": "BC42", + "lane": 2 + } + }, + { + "id": { + "chip": "BC42", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/49", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 232 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC42", + "lane": 0 + } + }, + { + "id": { + "chip": "BC42", + "lane": 1 + } + }, + { + "id": { + "chip": "BC42", + "lane": 2 + } + }, + { + "id": { + "chip": "BC42", + "lane": 3 + } + }, + { + "id": { + "chip": "BC42", + "lane": 4 + } + }, + { + "id": { + "chip": "BC42", + "lane": 5 + } + }, + { + "id": { + "chip": "BC42", + "lane": 6 + } + }, + { + "id": { + "chip": "BC42", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/49", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 7 + } + } + ] + } + } + } + }, + "232": { + "mapping": { + "id": 232, + "name": "eth1/49/2", + "controllingPort": 231, + "pins": [ + { + "a": { + "chip": "BC42", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/49", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC42", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/49", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC42", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/49", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC42", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/49", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC42", + "lane": 4 + } + }, + { + "id": { + "chip": "BC42", + "lane": 5 + } + }, + { + "id": { + "chip": "BC42", + "lane": 6 + } + }, + { + "id": { + "chip": "BC42", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/49", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC42", + "lane": 4 + } + }, + { + "id": { + "chip": "BC42", + "lane": 5 + } + }, + { + "id": { + "chip": "BC42", + "lane": 6 + } + }, + { + "id": { + "chip": "BC42", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/49", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/49", + "lane": 7 + } + } + ] + } + } + } + }, + "233": { + "mapping": { + "id": 233, + "name": "eth1/62/1", + "controllingPort": 233, + "pins": [ + { + "a": { + "chip": "BC43", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/62", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC43", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/62", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC43", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/62", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC43", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/62", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC43", + "lane": 0 + } + }, + { + "id": { + "chip": "BC43", + "lane": 1 + } + }, + { + "id": { + "chip": "BC43", + "lane": 2 + } + }, + { + "id": { + "chip": "BC43", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/62", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC43", + "lane": 0 + } + }, + { + "id": { + "chip": "BC43", + "lane": 1 + } + }, + { + "id": { + "chip": "BC43", + "lane": 2 + } + }, + { + "id": { + "chip": "BC43", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/62", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 234 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC43", + "lane": 0 + } + }, + { + "id": { + "chip": "BC43", + "lane": 1 + } + }, + { + "id": { + "chip": "BC43", + "lane": 2 + } + }, + { + "id": { + "chip": "BC43", + "lane": 3 + } + }, + { + "id": { + "chip": "BC43", + "lane": 4 + } + }, + { + "id": { + "chip": "BC43", + "lane": 5 + } + }, + { + "id": { + "chip": "BC43", + "lane": 6 + } + }, + { + "id": { + "chip": "BC43", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/62", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 7 + } + } + ] + } + } + } + }, + "234": { + "mapping": { + "id": 234, + "name": "eth1/62/2", + "controllingPort": 233, + "pins": [ + { + "a": { + "chip": "BC43", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/62", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC43", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/62", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC43", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/62", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC43", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/62", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC43", + "lane": 4 + } + }, + { + "id": { + "chip": "BC43", + "lane": 5 + } + }, + { + "id": { + "chip": "BC43", + "lane": 6 + } + }, + { + "id": { + "chip": "BC43", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/62", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC43", + "lane": 4 + } + }, + { + "id": { + "chip": "BC43", + "lane": 5 + } + }, + { + "id": { + "chip": "BC43", + "lane": 6 + } + }, + { + "id": { + "chip": "BC43", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/62", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/62", + "lane": 7 + } + } + ] + } + } + } + }, + "242": { + "mapping": { + "id": 242, + "name": "eth1/33/1", + "controllingPort": 242, + "pins": [ + { + "a": { + "chip": "BC44", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/33", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC44", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/33", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC44", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/33", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC44", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/33", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC44", + "lane": 0 + } + }, + { + "id": { + "chip": "BC44", + "lane": 1 + } + }, + { + "id": { + "chip": "BC44", + "lane": 2 + } + }, + { + "id": { + "chip": "BC44", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/33", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC44", + "lane": 0 + } + }, + { + "id": { + "chip": "BC44", + "lane": 1 + } + }, + { + "id": { + "chip": "BC44", + "lane": 2 + } + }, + { + "id": { + "chip": "BC44", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/33", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 243 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC44", + "lane": 0 + } + }, + { + "id": { + "chip": "BC44", + "lane": 1 + } + }, + { + "id": { + "chip": "BC44", + "lane": 2 + } + }, + { + "id": { + "chip": "BC44", + "lane": 3 + } + }, + { + "id": { + "chip": "BC44", + "lane": 4 + } + }, + { + "id": { + "chip": "BC44", + "lane": 5 + } + }, + { + "id": { + "chip": "BC44", + "lane": 6 + } + }, + { + "id": { + "chip": "BC44", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/33", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 7 + } + } + ] + } + } + } + }, + "243": { + "mapping": { + "id": 243, + "name": "eth1/33/2", + "controllingPort": 242, + "pins": [ + { + "a": { + "chip": "BC44", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/33", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC44", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/33", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC44", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/33", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC44", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/33", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC44", + "lane": 4 + } + }, + { + "id": { + "chip": "BC44", + "lane": 5 + } + }, + { + "id": { + "chip": "BC44", + "lane": 6 + } + }, + { + "id": { + "chip": "BC44", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/33", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC44", + "lane": 4 + } + }, + { + "id": { + "chip": "BC44", + "lane": 5 + } + }, + { + "id": { + "chip": "BC44", + "lane": 6 + } + }, + { + "id": { + "chip": "BC44", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/33", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/33", + "lane": 7 + } + } + ] + } + } + } + }, + "244": { + "mapping": { + "id": 244, + "name": "eth1/46/1", + "controllingPort": 244, + "pins": [ + { + "a": { + "chip": "BC45", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/46", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC45", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/46", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC45", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/46", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC45", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/46", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC45", + "lane": 0 + } + }, + { + "id": { + "chip": "BC45", + "lane": 1 + } + }, + { + "id": { + "chip": "BC45", + "lane": 2 + } + }, + { + "id": { + "chip": "BC45", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/46", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC45", + "lane": 0 + } + }, + { + "id": { + "chip": "BC45", + "lane": 1 + } + }, + { + "id": { + "chip": "BC45", + "lane": 2 + } + }, + { + "id": { + "chip": "BC45", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/46", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 245 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC45", + "lane": 0 + } + }, + { + "id": { + "chip": "BC45", + "lane": 1 + } + }, + { + "id": { + "chip": "BC45", + "lane": 2 + } + }, + { + "id": { + "chip": "BC45", + "lane": 3 + } + }, + { + "id": { + "chip": "BC45", + "lane": 4 + } + }, + { + "id": { + "chip": "BC45", + "lane": 5 + } + }, + { + "id": { + "chip": "BC45", + "lane": 6 + } + }, + { + "id": { + "chip": "BC45", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/46", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 7 + } + } + ] + } + } + } + }, + "245": { + "mapping": { + "id": 245, + "name": "eth1/46/2", + "controllingPort": 244, + "pins": [ + { + "a": { + "chip": "BC45", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/46", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC45", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/46", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC45", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/46", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC45", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/46", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC45", + "lane": 4 + } + }, + { + "id": { + "chip": "BC45", + "lane": 5 + } + }, + { + "id": { + "chip": "BC45", + "lane": 6 + } + }, + { + "id": { + "chip": "BC45", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/46", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC45", + "lane": 4 + } + }, + { + "id": { + "chip": "BC45", + "lane": 5 + } + }, + { + "id": { + "chip": "BC45", + "lane": 6 + } + }, + { + "id": { + "chip": "BC45", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/46", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/46", + "lane": 7 + } + } + ] + } + } + } + }, + "253": { + "mapping": { + "id": 253, + "name": "eth1/50/1", + "controllingPort": 253, + "pins": [ + { + "a": { + "chip": "BC46", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/50", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC46", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/50", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC46", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/50", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC46", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/50", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC46", + "lane": 0 + } + }, + { + "id": { + "chip": "BC46", + "lane": 1 + } + }, + { + "id": { + "chip": "BC46", + "lane": 2 + } + }, + { + "id": { + "chip": "BC46", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/50", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC46", + "lane": 0 + } + }, + { + "id": { + "chip": "BC46", + "lane": 1 + } + }, + { + "id": { + "chip": "BC46", + "lane": 2 + } + }, + { + "id": { + "chip": "BC46", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/50", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 254 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC46", + "lane": 0 + } + }, + { + "id": { + "chip": "BC46", + "lane": 1 + } + }, + { + "id": { + "chip": "BC46", + "lane": 2 + } + }, + { + "id": { + "chip": "BC46", + "lane": 3 + } + }, + { + "id": { + "chip": "BC46", + "lane": 4 + } + }, + { + "id": { + "chip": "BC46", + "lane": 5 + } + }, + { + "id": { + "chip": "BC46", + "lane": 6 + } + }, + { + "id": { + "chip": "BC46", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/50", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 7 + } + } + ] + } + } + } + }, + "254": { + "mapping": { + "id": 254, + "name": "eth1/50/2", + "controllingPort": 253, + "pins": [ + { + "a": { + "chip": "BC46", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/50", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC46", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/50", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC46", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/50", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC46", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/50", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC46", + "lane": 4 + } + }, + { + "id": { + "chip": "BC46", + "lane": 5 + } + }, + { + "id": { + "chip": "BC46", + "lane": 6 + } + }, + { + "id": { + "chip": "BC46", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/50", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC46", + "lane": 4 + } + }, + { + "id": { + "chip": "BC46", + "lane": 5 + } + }, + { + "id": { + "chip": "BC46", + "lane": 6 + } + }, + { + "id": { + "chip": "BC46", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/50", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/50", + "lane": 7 + } + } + ] + } + } + } + }, + "255": { + "mapping": { + "id": 255, + "name": "eth1/61/1", + "controllingPort": 255, + "pins": [ + { + "a": { + "chip": "BC47", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/61", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC47", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/61", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC47", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/61", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC47", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/61", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC47", + "lane": 0 + } + }, + { + "id": { + "chip": "BC47", + "lane": 1 + } + }, + { + "id": { + "chip": "BC47", + "lane": 2 + } + }, + { + "id": { + "chip": "BC47", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/61", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC47", + "lane": 0 + } + }, + { + "id": { + "chip": "BC47", + "lane": 1 + } + }, + { + "id": { + "chip": "BC47", + "lane": 2 + } + }, + { + "id": { + "chip": "BC47", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/61", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 256 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC47", + "lane": 0 + } + }, + { + "id": { + "chip": "BC47", + "lane": 1 + } + }, + { + "id": { + "chip": "BC47", + "lane": 2 + } + }, + { + "id": { + "chip": "BC47", + "lane": 3 + } + }, + { + "id": { + "chip": "BC47", + "lane": 4 + } + }, + { + "id": { + "chip": "BC47", + "lane": 5 + } + }, + { + "id": { + "chip": "BC47", + "lane": 6 + } + }, + { + "id": { + "chip": "BC47", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/61", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 7 + } + } + ] + } + } + } + }, + "256": { + "mapping": { + "id": 256, + "name": "eth1/61/2", + "controllingPort": 255, + "pins": [ + { + "a": { + "chip": "BC47", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/61", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC47", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/61", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC47", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/61", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC47", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/61", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC47", + "lane": 4 + } + }, + { + "id": { + "chip": "BC47", + "lane": 5 + } + }, + { + "id": { + "chip": "BC47", + "lane": 6 + } + }, + { + "id": { + "chip": "BC47", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/61", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC47", + "lane": 4 + } + }, + { + "id": { + "chip": "BC47", + "lane": 5 + } + }, + { + "id": { + "chip": "BC47", + "lane": 6 + } + }, + { + "id": { + "chip": "BC47", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/61", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/61", + "lane": 7 + } + } + ] + } + } + } + }, + "264": { + "mapping": { + "id": 264, + "name": "eth1/40/1", + "controllingPort": 264, + "pins": [ + { + "a": { + "chip": "BC48", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/40", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC48", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/40", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC48", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/40", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC48", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/40", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC48", + "lane": 0 + } + }, + { + "id": { + "chip": "BC48", + "lane": 1 + } + }, + { + "id": { + "chip": "BC48", + "lane": 2 + } + }, + { + "id": { + "chip": "BC48", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/40", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC48", + "lane": 0 + } + }, + { + "id": { + "chip": "BC48", + "lane": 1 + } + }, + { + "id": { + "chip": "BC48", + "lane": 2 + } + }, + { + "id": { + "chip": "BC48", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/40", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 265 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC48", + "lane": 0 + } + }, + { + "id": { + "chip": "BC48", + "lane": 1 + } + }, + { + "id": { + "chip": "BC48", + "lane": 2 + } + }, + { + "id": { + "chip": "BC48", + "lane": 3 + } + }, + { + "id": { + "chip": "BC48", + "lane": 4 + } + }, + { + "id": { + "chip": "BC48", + "lane": 5 + } + }, + { + "id": { + "chip": "BC48", + "lane": 6 + } + }, + { + "id": { + "chip": "BC48", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/40", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 7 + } + } + ] + } + } + } + }, + "265": { + "mapping": { + "id": 265, + "name": "eth1/40/2", + "controllingPort": 264, + "pins": [ + { + "a": { + "chip": "BC48", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/40", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC48", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/40", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC48", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/40", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC48", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/40", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC48", + "lane": 4 + } + }, + { + "id": { + "chip": "BC48", + "lane": 5 + } + }, + { + "id": { + "chip": "BC48", + "lane": 6 + } + }, + { + "id": { + "chip": "BC48", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/40", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC48", + "lane": 4 + } + }, + { + "id": { + "chip": "BC48", + "lane": 5 + } + }, + { + "id": { + "chip": "BC48", + "lane": 6 + } + }, + { + "id": { + "chip": "BC48", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/40", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/40", + "lane": 7 + } + } + ] + } + } + } + }, + "266": { + "mapping": { + "id": 266, + "name": "eth1/43/1", + "controllingPort": 266, + "pins": [ + { + "a": { + "chip": "BC49", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/43", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC49", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/43", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC49", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/43", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC49", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/43", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC49", + "lane": 0 + } + }, + { + "id": { + "chip": "BC49", + "lane": 1 + } + }, + { + "id": { + "chip": "BC49", + "lane": 2 + } + }, + { + "id": { + "chip": "BC49", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/43", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC49", + "lane": 0 + } + }, + { + "id": { + "chip": "BC49", + "lane": 1 + } + }, + { + "id": { + "chip": "BC49", + "lane": 2 + } + }, + { + "id": { + "chip": "BC49", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/43", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 267 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC49", + "lane": 0 + } + }, + { + "id": { + "chip": "BC49", + "lane": 1 + } + }, + { + "id": { + "chip": "BC49", + "lane": 2 + } + }, + { + "id": { + "chip": "BC49", + "lane": 3 + } + }, + { + "id": { + "chip": "BC49", + "lane": 4 + } + }, + { + "id": { + "chip": "BC49", + "lane": 5 + } + }, + { + "id": { + "chip": "BC49", + "lane": 6 + } + }, + { + "id": { + "chip": "BC49", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/43", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 7 + } + } + ] + } + } + } + }, + "267": { + "mapping": { + "id": 267, + "name": "eth1/43/2", + "controllingPort": 266, + "pins": [ + { + "a": { + "chip": "BC49", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/43", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC49", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/43", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC49", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/43", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC49", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/43", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC49", + "lane": 4 + } + }, + { + "id": { + "chip": "BC49", + "lane": 5 + } + }, + { + "id": { + "chip": "BC49", + "lane": 6 + } + }, + { + "id": { + "chip": "BC49", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/43", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC49", + "lane": 4 + } + }, + { + "id": { + "chip": "BC49", + "lane": 5 + } + }, + { + "id": { + "chip": "BC49", + "lane": 6 + } + }, + { + "id": { + "chip": "BC49", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/43", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/43", + "lane": 7 + } + } + ] + } + } + } + }, + "275": { + "mapping": { + "id": 275, + "name": "eth1/55/1", + "controllingPort": 275, + "pins": [ + { + "a": { + "chip": "BC50", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/55", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC50", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/55", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC50", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/55", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC50", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/55", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC50", + "lane": 0 + } + }, + { + "id": { + "chip": "BC50", + "lane": 1 + } + }, + { + "id": { + "chip": "BC50", + "lane": 2 + } + }, + { + "id": { + "chip": "BC50", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/55", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC50", + "lane": 0 + } + }, + { + "id": { + "chip": "BC50", + "lane": 1 + } + }, + { + "id": { + "chip": "BC50", + "lane": 2 + } + }, + { + "id": { + "chip": "BC50", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/55", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 276 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC50", + "lane": 0 + } + }, + { + "id": { + "chip": "BC50", + "lane": 1 + } + }, + { + "id": { + "chip": "BC50", + "lane": 2 + } + }, + { + "id": { + "chip": "BC50", + "lane": 3 + } + }, + { + "id": { + "chip": "BC50", + "lane": 4 + } + }, + { + "id": { + "chip": "BC50", + "lane": 5 + } + }, + { + "id": { + "chip": "BC50", + "lane": 6 + } + }, + { + "id": { + "chip": "BC50", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/55", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 7 + } + } + ] + } + } + } + }, + "276": { + "mapping": { + "id": 276, + "name": "eth1/55/2", + "controllingPort": 275, + "pins": [ + { + "a": { + "chip": "BC50", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/55", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC50", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/55", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC50", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/55", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC50", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/55", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC50", + "lane": 4 + } + }, + { + "id": { + "chip": "BC50", + "lane": 5 + } + }, + { + "id": { + "chip": "BC50", + "lane": 6 + } + }, + { + "id": { + "chip": "BC50", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/55", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC50", + "lane": 4 + } + }, + { + "id": { + "chip": "BC50", + "lane": 5 + } + }, + { + "id": { + "chip": "BC50", + "lane": 6 + } + }, + { + "id": { + "chip": "BC50", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/55", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/55", + "lane": 7 + } + } + ] + } + } + } + }, + "277": { + "mapping": { + "id": 277, + "name": "eth1/60/1", + "controllingPort": 277, + "pins": [ + { + "a": { + "chip": "BC51", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/60", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC51", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/60", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC51", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/60", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC51", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/60", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC51", + "lane": 0 + } + }, + { + "id": { + "chip": "BC51", + "lane": 1 + } + }, + { + "id": { + "chip": "BC51", + "lane": 2 + } + }, + { + "id": { + "chip": "BC51", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/60", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC51", + "lane": 0 + } + }, + { + "id": { + "chip": "BC51", + "lane": 1 + } + }, + { + "id": { + "chip": "BC51", + "lane": 2 + } + }, + { + "id": { + "chip": "BC51", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/60", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 278 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC51", + "lane": 0 + } + }, + { + "id": { + "chip": "BC51", + "lane": 1 + } + }, + { + "id": { + "chip": "BC51", + "lane": 2 + } + }, + { + "id": { + "chip": "BC51", + "lane": 3 + } + }, + { + "id": { + "chip": "BC51", + "lane": 4 + } + }, + { + "id": { + "chip": "BC51", + "lane": 5 + } + }, + { + "id": { + "chip": "BC51", + "lane": 6 + } + }, + { + "id": { + "chip": "BC51", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/60", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 7 + } + } + ] + } + } + } + }, + "278": { + "mapping": { + "id": 278, + "name": "eth1/60/2", + "controllingPort": 277, + "pins": [ + { + "a": { + "chip": "BC51", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/60", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC51", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/60", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC51", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/60", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC51", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/60", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC51", + "lane": 4 + } + }, + { + "id": { + "chip": "BC51", + "lane": 5 + } + }, + { + "id": { + "chip": "BC51", + "lane": 6 + } + }, + { + "id": { + "chip": "BC51", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/60", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC51", + "lane": 4 + } + }, + { + "id": { + "chip": "BC51", + "lane": 5 + } + }, + { + "id": { + "chip": "BC51", + "lane": 6 + } + }, + { + "id": { + "chip": "BC51", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/60", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/60", + "lane": 7 + } + } + ] + } + } + } + }, + "286": { + "mapping": { + "id": 286, + "name": "eth1/39/1", + "controllingPort": 286, + "pins": [ + { + "a": { + "chip": "BC52", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/39", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC52", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/39", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC52", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/39", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC52", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/39", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC52", + "lane": 0 + } + }, + { + "id": { + "chip": "BC52", + "lane": 1 + } + }, + { + "id": { + "chip": "BC52", + "lane": 2 + } + }, + { + "id": { + "chip": "BC52", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/39", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC52", + "lane": 0 + } + }, + { + "id": { + "chip": "BC52", + "lane": 1 + } + }, + { + "id": { + "chip": "BC52", + "lane": 2 + } + }, + { + "id": { + "chip": "BC52", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/39", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 287 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC52", + "lane": 0 + } + }, + { + "id": { + "chip": "BC52", + "lane": 1 + } + }, + { + "id": { + "chip": "BC52", + "lane": 2 + } + }, + { + "id": { + "chip": "BC52", + "lane": 3 + } + }, + { + "id": { + "chip": "BC52", + "lane": 4 + } + }, + { + "id": { + "chip": "BC52", + "lane": 5 + } + }, + { + "id": { + "chip": "BC52", + "lane": 6 + } + }, + { + "id": { + "chip": "BC52", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/39", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 7 + } + } + ] + } + } + } + }, + "287": { + "mapping": { + "id": 287, + "name": "eth1/39/2", + "controllingPort": 286, + "pins": [ + { + "a": { + "chip": "BC52", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/39", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC52", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/39", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC52", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/39", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC52", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/39", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC52", + "lane": 4 + } + }, + { + "id": { + "chip": "BC52", + "lane": 5 + } + }, + { + "id": { + "chip": "BC52", + "lane": 6 + } + }, + { + "id": { + "chip": "BC52", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/39", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC52", + "lane": 4 + } + }, + { + "id": { + "chip": "BC52", + "lane": 5 + } + }, + { + "id": { + "chip": "BC52", + "lane": 6 + } + }, + { + "id": { + "chip": "BC52", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/39", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/39", + "lane": 7 + } + } + ] + } + } + } + }, + "288": { + "mapping": { + "id": 288, + "name": "eth1/44/1", + "controllingPort": 288, + "pins": [ + { + "a": { + "chip": "BC53", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/44", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC53", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/44", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC53", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/44", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC53", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/44", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC53", + "lane": 0 + } + }, + { + "id": { + "chip": "BC53", + "lane": 1 + } + }, + { + "id": { + "chip": "BC53", + "lane": 2 + } + }, + { + "id": { + "chip": "BC53", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/44", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC53", + "lane": 0 + } + }, + { + "id": { + "chip": "BC53", + "lane": 1 + } + }, + { + "id": { + "chip": "BC53", + "lane": 2 + } + }, + { + "id": { + "chip": "BC53", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/44", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 289 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC53", + "lane": 0 + } + }, + { + "id": { + "chip": "BC53", + "lane": 1 + } + }, + { + "id": { + "chip": "BC53", + "lane": 2 + } + }, + { + "id": { + "chip": "BC53", + "lane": 3 + } + }, + { + "id": { + "chip": "BC53", + "lane": 4 + } + }, + { + "id": { + "chip": "BC53", + "lane": 5 + } + }, + { + "id": { + "chip": "BC53", + "lane": 6 + } + }, + { + "id": { + "chip": "BC53", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/44", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 7 + } + } + ] + } + } + } + }, + "289": { + "mapping": { + "id": 289, + "name": "eth1/44/2", + "controllingPort": 288, + "pins": [ + { + "a": { + "chip": "BC53", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/44", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC53", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/44", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC53", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/44", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC53", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/44", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC53", + "lane": 4 + } + }, + { + "id": { + "chip": "BC53", + "lane": 5 + } + }, + { + "id": { + "chip": "BC53", + "lane": 6 + } + }, + { + "id": { + "chip": "BC53", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/44", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC53", + "lane": 4 + } + }, + { + "id": { + "chip": "BC53", + "lane": 5 + } + }, + { + "id": { + "chip": "BC53", + "lane": 6 + } + }, + { + "id": { + "chip": "BC53", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/44", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/44", + "lane": 7 + } + } + ] + } + } + } + }, + "297": { + "mapping": { + "id": 297, + "name": "eth1/56/1", + "controllingPort": 297, + "pins": [ + { + "a": { + "chip": "BC54", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/56", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC54", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/56", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC54", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/56", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC54", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/56", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC54", + "lane": 0 + } + }, + { + "id": { + "chip": "BC54", + "lane": 1 + } + }, + { + "id": { + "chip": "BC54", + "lane": 2 + } + }, + { + "id": { + "chip": "BC54", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/56", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC54", + "lane": 0 + } + }, + { + "id": { + "chip": "BC54", + "lane": 1 + } + }, + { + "id": { + "chip": "BC54", + "lane": 2 + } + }, + { + "id": { + "chip": "BC54", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/56", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 298 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC54", + "lane": 0 + } + }, + { + "id": { + "chip": "BC54", + "lane": 1 + } + }, + { + "id": { + "chip": "BC54", + "lane": 2 + } + }, + { + "id": { + "chip": "BC54", + "lane": 3 + } + }, + { + "id": { + "chip": "BC54", + "lane": 4 + } + }, + { + "id": { + "chip": "BC54", + "lane": 5 + } + }, + { + "id": { + "chip": "BC54", + "lane": 6 + } + }, + { + "id": { + "chip": "BC54", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/56", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 7 + } + } + ] + } + } + } + }, + "298": { + "mapping": { + "id": 298, + "name": "eth1/56/2", + "controllingPort": 297, + "pins": [ + { + "a": { + "chip": "BC54", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/56", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC54", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/56", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC54", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/56", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC54", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/56", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC54", + "lane": 4 + } + }, + { + "id": { + "chip": "BC54", + "lane": 5 + } + }, + { + "id": { + "chip": "BC54", + "lane": 6 + } + }, + { + "id": { + "chip": "BC54", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/56", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC54", + "lane": 4 + } + }, + { + "id": { + "chip": "BC54", + "lane": 5 + } + }, + { + "id": { + "chip": "BC54", + "lane": 6 + } + }, + { + "id": { + "chip": "BC54", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/56", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/56", + "lane": 7 + } + } + ] + } + } + } + }, + "299": { + "mapping": { + "id": 299, + "name": "eth1/59/1", + "controllingPort": 299, + "pins": [ + { + "a": { + "chip": "BC55", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/59", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC55", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/59", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC55", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/59", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC55", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/59", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC55", + "lane": 0 + } + }, + { + "id": { + "chip": "BC55", + "lane": 1 + } + }, + { + "id": { + "chip": "BC55", + "lane": 2 + } + }, + { + "id": { + "chip": "BC55", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/59", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC55", + "lane": 0 + } + }, + { + "id": { + "chip": "BC55", + "lane": 1 + } + }, + { + "id": { + "chip": "BC55", + "lane": 2 + } + }, + { + "id": { + "chip": "BC55", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/59", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 300 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC55", + "lane": 0 + } + }, + { + "id": { + "chip": "BC55", + "lane": 1 + } + }, + { + "id": { + "chip": "BC55", + "lane": 2 + } + }, + { + "id": { + "chip": "BC55", + "lane": 3 + } + }, + { + "id": { + "chip": "BC55", + "lane": 4 + } + }, + { + "id": { + "chip": "BC55", + "lane": 5 + } + }, + { + "id": { + "chip": "BC55", + "lane": 6 + } + }, + { + "id": { + "chip": "BC55", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/59", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 7 + } + } + ] + } + } + } + }, + "300": { + "mapping": { + "id": 300, + "name": "eth1/59/2", + "controllingPort": 299, + "pins": [ + { + "a": { + "chip": "BC55", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/59", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC55", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/59", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC55", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/59", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC55", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/59", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC55", + "lane": 4 + } + }, + { + "id": { + "chip": "BC55", + "lane": 5 + } + }, + { + "id": { + "chip": "BC55", + "lane": 6 + } + }, + { + "id": { + "chip": "BC55", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/59", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC55", + "lane": 4 + } + }, + { + "id": { + "chip": "BC55", + "lane": 5 + } + }, + { + "id": { + "chip": "BC55", + "lane": 6 + } + }, + { + "id": { + "chip": "BC55", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/59", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/59", + "lane": 7 + } + } + ] + } + } + } + }, + "308": { + "mapping": { + "id": 308, + "name": "eth1/38/1", + "controllingPort": 308, + "pins": [ + { + "a": { + "chip": "BC56", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/38", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC56", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/38", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC56", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/38", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC56", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/38", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC56", + "lane": 0 + } + }, + { + "id": { + "chip": "BC56", + "lane": 1 + } + }, + { + "id": { + "chip": "BC56", + "lane": 2 + } + }, + { + "id": { + "chip": "BC56", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/38", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC56", + "lane": 0 + } + }, + { + "id": { + "chip": "BC56", + "lane": 1 + } + }, + { + "id": { + "chip": "BC56", + "lane": 2 + } + }, + { + "id": { + "chip": "BC56", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/38", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 309 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC56", + "lane": 0 + } + }, + { + "id": { + "chip": "BC56", + "lane": 1 + } + }, + { + "id": { + "chip": "BC56", + "lane": 2 + } + }, + { + "id": { + "chip": "BC56", + "lane": 3 + } + }, + { + "id": { + "chip": "BC56", + "lane": 4 + } + }, + { + "id": { + "chip": "BC56", + "lane": 5 + } + }, + { + "id": { + "chip": "BC56", + "lane": 6 + } + }, + { + "id": { + "chip": "BC56", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/38", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 7 + } + } + ] + } + } + } + }, + "309": { + "mapping": { + "id": 309, + "name": "eth1/38/2", + "controllingPort": 308, + "pins": [ + { + "a": { + "chip": "BC56", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/38", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC56", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/38", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC56", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/38", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC56", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/38", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC56", + "lane": 4 + } + }, + { + "id": { + "chip": "BC56", + "lane": 5 + } + }, + { + "id": { + "chip": "BC56", + "lane": 6 + } + }, + { + "id": { + "chip": "BC56", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/38", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC56", + "lane": 4 + } + }, + { + "id": { + "chip": "BC56", + "lane": 5 + } + }, + { + "id": { + "chip": "BC56", + "lane": 6 + } + }, + { + "id": { + "chip": "BC56", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/38", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/38", + "lane": 7 + } + } + ] + } + } + } + }, + "310": { + "mapping": { + "id": 310, + "name": "eth1/41/1", + "controllingPort": 310, + "pins": [ + { + "a": { + "chip": "BC57", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/41", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC57", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/41", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC57", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/41", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC57", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/41", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC57", + "lane": 0 + } + }, + { + "id": { + "chip": "BC57", + "lane": 1 + } + }, + { + "id": { + "chip": "BC57", + "lane": 2 + } + }, + { + "id": { + "chip": "BC57", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/41", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC57", + "lane": 0 + } + }, + { + "id": { + "chip": "BC57", + "lane": 1 + } + }, + { + "id": { + "chip": "BC57", + "lane": 2 + } + }, + { + "id": { + "chip": "BC57", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/41", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 311 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC57", + "lane": 0 + } + }, + { + "id": { + "chip": "BC57", + "lane": 1 + } + }, + { + "id": { + "chip": "BC57", + "lane": 2 + } + }, + { + "id": { + "chip": "BC57", + "lane": 3 + } + }, + { + "id": { + "chip": "BC57", + "lane": 4 + } + }, + { + "id": { + "chip": "BC57", + "lane": 5 + } + }, + { + "id": { + "chip": "BC57", + "lane": 6 + } + }, + { + "id": { + "chip": "BC57", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/41", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 7 + } + } + ] + } + } + } + }, + "311": { + "mapping": { + "id": 311, + "name": "eth1/41/2", + "controllingPort": 310, + "pins": [ + { + "a": { + "chip": "BC57", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/41", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC57", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/41", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC57", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/41", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC57", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/41", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC57", + "lane": 4 + } + }, + { + "id": { + "chip": "BC57", + "lane": 5 + } + }, + { + "id": { + "chip": "BC57", + "lane": 6 + } + }, + { + "id": { + "chip": "BC57", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/41", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC57", + "lane": 4 + } + }, + { + "id": { + "chip": "BC57", + "lane": 5 + } + }, + { + "id": { + "chip": "BC57", + "lane": 6 + } + }, + { + "id": { + "chip": "BC57", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/41", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/41", + "lane": 7 + } + } + ] + } + } + } + }, + "319": { + "mapping": { + "id": 319, + "name": "eth1/53/1", + "controllingPort": 319, + "pins": [ + { + "a": { + "chip": "BC58", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/53", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC58", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/53", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC58", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/53", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC58", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/53", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC58", + "lane": 0 + } + }, + { + "id": { + "chip": "BC58", + "lane": 1 + } + }, + { + "id": { + "chip": "BC58", + "lane": 2 + } + }, + { + "id": { + "chip": "BC58", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/53", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC58", + "lane": 0 + } + }, + { + "id": { + "chip": "BC58", + "lane": 1 + } + }, + { + "id": { + "chip": "BC58", + "lane": 2 + } + }, + { + "id": { + "chip": "BC58", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/53", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 320 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC58", + "lane": 0 + } + }, + { + "id": { + "chip": "BC58", + "lane": 1 + } + }, + { + "id": { + "chip": "BC58", + "lane": 2 + } + }, + { + "id": { + "chip": "BC58", + "lane": 3 + } + }, + { + "id": { + "chip": "BC58", + "lane": 4 + } + }, + { + "id": { + "chip": "BC58", + "lane": 5 + } + }, + { + "id": { + "chip": "BC58", + "lane": 6 + } + }, + { + "id": { + "chip": "BC58", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/53", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 7 + } + } + ] + } + } + } + }, + "320": { + "mapping": { + "id": 320, + "name": "eth1/53/2", + "controllingPort": 319, + "pins": [ + { + "a": { + "chip": "BC58", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/53", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC58", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/53", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC58", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/53", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC58", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/53", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC58", + "lane": 4 + } + }, + { + "id": { + "chip": "BC58", + "lane": 5 + } + }, + { + "id": { + "chip": "BC58", + "lane": 6 + } + }, + { + "id": { + "chip": "BC58", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/53", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC58", + "lane": 4 + } + }, + { + "id": { + "chip": "BC58", + "lane": 5 + } + }, + { + "id": { + "chip": "BC58", + "lane": 6 + } + }, + { + "id": { + "chip": "BC58", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/53", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/53", + "lane": 7 + } + } + ] + } + } + } + }, + "321": { + "mapping": { + "id": 321, + "name": "eth1/58/1", + "controllingPort": 321, + "pins": [ + { + "a": { + "chip": "BC59", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/58", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC59", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/58", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC59", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/58", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC59", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/58", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC59", + "lane": 0 + } + }, + { + "id": { + "chip": "BC59", + "lane": 1 + } + }, + { + "id": { + "chip": "BC59", + "lane": 2 + } + }, + { + "id": { + "chip": "BC59", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/58", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC59", + "lane": 0 + } + }, + { + "id": { + "chip": "BC59", + "lane": 1 + } + }, + { + "id": { + "chip": "BC59", + "lane": 2 + } + }, + { + "id": { + "chip": "BC59", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/58", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 322 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC59", + "lane": 0 + } + }, + { + "id": { + "chip": "BC59", + "lane": 1 + } + }, + { + "id": { + "chip": "BC59", + "lane": 2 + } + }, + { + "id": { + "chip": "BC59", + "lane": 3 + } + }, + { + "id": { + "chip": "BC59", + "lane": 4 + } + }, + { + "id": { + "chip": "BC59", + "lane": 5 + } + }, + { + "id": { + "chip": "BC59", + "lane": 6 + } + }, + { + "id": { + "chip": "BC59", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/58", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 7 + } + } + ] + } + } + } + }, + "322": { + "mapping": { + "id": 322, + "name": "eth1/58/2", + "controllingPort": 321, + "pins": [ + { + "a": { + "chip": "BC59", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/58", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC59", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/58", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC59", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/58", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC59", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/58", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC59", + "lane": 4 + } + }, + { + "id": { + "chip": "BC59", + "lane": 5 + } + }, + { + "id": { + "chip": "BC59", + "lane": 6 + } + }, + { + "id": { + "chip": "BC59", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/58", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC59", + "lane": 4 + } + }, + { + "id": { + "chip": "BC59", + "lane": 5 + } + }, + { + "id": { + "chip": "BC59", + "lane": 6 + } + }, + { + "id": { + "chip": "BC59", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/58", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/58", + "lane": 7 + } + } + ] + } + } + } + }, + "330": { + "mapping": { + "id": 330, + "name": "eth1/37/1", + "controllingPort": 330, + "pins": [ + { + "a": { + "chip": "BC60", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/37", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC60", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/37", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC60", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/37", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC60", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/37", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC60", + "lane": 0 + } + }, + { + "id": { + "chip": "BC60", + "lane": 1 + } + }, + { + "id": { + "chip": "BC60", + "lane": 2 + } + }, + { + "id": { + "chip": "BC60", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/37", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC60", + "lane": 0 + } + }, + { + "id": { + "chip": "BC60", + "lane": 1 + } + }, + { + "id": { + "chip": "BC60", + "lane": 2 + } + }, + { + "id": { + "chip": "BC60", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/37", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 331 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC60", + "lane": 0 + } + }, + { + "id": { + "chip": "BC60", + "lane": 1 + } + }, + { + "id": { + "chip": "BC60", + "lane": 2 + } + }, + { + "id": { + "chip": "BC60", + "lane": 3 + } + }, + { + "id": { + "chip": "BC60", + "lane": 4 + } + }, + { + "id": { + "chip": "BC60", + "lane": 5 + } + }, + { + "id": { + "chip": "BC60", + "lane": 6 + } + }, + { + "id": { + "chip": "BC60", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/37", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 7 + } + } + ] + } + } + } + }, + "331": { + "mapping": { + "id": 331, + "name": "eth1/37/2", + "controllingPort": 330, + "pins": [ + { + "a": { + "chip": "BC60", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/37", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC60", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/37", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC60", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/37", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC60", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/37", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC60", + "lane": 4 + } + }, + { + "id": { + "chip": "BC60", + "lane": 5 + } + }, + { + "id": { + "chip": "BC60", + "lane": 6 + } + }, + { + "id": { + "chip": "BC60", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/37", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC60", + "lane": 4 + } + }, + { + "id": { + "chip": "BC60", + "lane": 5 + } + }, + { + "id": { + "chip": "BC60", + "lane": 6 + } + }, + { + "id": { + "chip": "BC60", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/37", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/37", + "lane": 7 + } + } + ] + } + } + } + }, + "332": { + "mapping": { + "id": 332, + "name": "eth1/42/1", + "controllingPort": 332, + "pins": [ + { + "a": { + "chip": "BC61", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/42", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC61", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/42", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC61", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/42", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC61", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/42", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC61", + "lane": 0 + } + }, + { + "id": { + "chip": "BC61", + "lane": 1 + } + }, + { + "id": { + "chip": "BC61", + "lane": 2 + } + }, + { + "id": { + "chip": "BC61", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/42", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC61", + "lane": 0 + } + }, + { + "id": { + "chip": "BC61", + "lane": 1 + } + }, + { + "id": { + "chip": "BC61", + "lane": 2 + } + }, + { + "id": { + "chip": "BC61", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/42", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 333 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC61", + "lane": 0 + } + }, + { + "id": { + "chip": "BC61", + "lane": 1 + } + }, + { + "id": { + "chip": "BC61", + "lane": 2 + } + }, + { + "id": { + "chip": "BC61", + "lane": 3 + } + }, + { + "id": { + "chip": "BC61", + "lane": 4 + } + }, + { + "id": { + "chip": "BC61", + "lane": 5 + } + }, + { + "id": { + "chip": "BC61", + "lane": 6 + } + }, + { + "id": { + "chip": "BC61", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/42", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 7 + } + } + ] + } + } + } + }, + "333": { + "mapping": { + "id": 333, + "name": "eth1/42/2", + "controllingPort": 332, + "pins": [ + { + "a": { + "chip": "BC61", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/42", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC61", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/42", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC61", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/42", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC61", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/42", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC61", + "lane": 4 + } + }, + { + "id": { + "chip": "BC61", + "lane": 5 + } + }, + { + "id": { + "chip": "BC61", + "lane": 6 + } + }, + { + "id": { + "chip": "BC61", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/42", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC61", + "lane": 4 + } + }, + { + "id": { + "chip": "BC61", + "lane": 5 + } + }, + { + "id": { + "chip": "BC61", + "lane": 6 + } + }, + { + "id": { + "chip": "BC61", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/42", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/42", + "lane": 7 + } + } + ] + } + } + } + }, + "341": { + "mapping": { + "id": 341, + "name": "eth1/57/1", + "controllingPort": 341, + "pins": [ + { + "a": { + "chip": "BC62", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/57", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC62", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/57", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC62", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/57", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC62", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/57", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC62", + "lane": 0 + } + }, + { + "id": { + "chip": "BC62", + "lane": 1 + } + }, + { + "id": { + "chip": "BC62", + "lane": 2 + } + }, + { + "id": { + "chip": "BC62", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/57", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC62", + "lane": 0 + } + }, + { + "id": { + "chip": "BC62", + "lane": 1 + } + }, + { + "id": { + "chip": "BC62", + "lane": 2 + } + }, + { + "id": { + "chip": "BC62", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/57", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 342 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC62", + "lane": 0 + } + }, + { + "id": { + "chip": "BC62", + "lane": 1 + } + }, + { + "id": { + "chip": "BC62", + "lane": 2 + } + }, + { + "id": { + "chip": "BC62", + "lane": 3 + } + }, + { + "id": { + "chip": "BC62", + "lane": 4 + } + }, + { + "id": { + "chip": "BC62", + "lane": 5 + } + }, + { + "id": { + "chip": "BC62", + "lane": 6 + } + }, + { + "id": { + "chip": "BC62", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/57", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 7 + } + } + ] + } + } + } + }, + "342": { + "mapping": { + "id": 342, + "name": "eth1/57/2", + "controllingPort": 341, + "pins": [ + { + "a": { + "chip": "BC62", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/57", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC62", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/57", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC62", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/57", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC62", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/57", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC62", + "lane": 4 + } + }, + { + "id": { + "chip": "BC62", + "lane": 5 + } + }, + { + "id": { + "chip": "BC62", + "lane": 6 + } + }, + { + "id": { + "chip": "BC62", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/57", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC62", + "lane": 4 + } + }, + { + "id": { + "chip": "BC62", + "lane": 5 + } + }, + { + "id": { + "chip": "BC62", + "lane": 6 + } + }, + { + "id": { + "chip": "BC62", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/57", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/57", + "lane": 7 + } + } + ] + } + } + } + }, + "343": { + "mapping": { + "id": 343, + "name": "eth1/54/1", + "controllingPort": 343, + "pins": [ + { + "a": { + "chip": "BC63", + "lane": 0 + }, + "z": { + "end": { + "chip": "eth1/54", + "lane": 0 + } + } + }, + { + "a": { + "chip": "BC63", + "lane": 1 + }, + "z": { + "end": { + "chip": "eth1/54", + "lane": 1 + } + } + }, + { + "a": { + "chip": "BC63", + "lane": 2 + }, + "z": { + "end": { + "chip": "eth1/54", + "lane": 2 + } + } + }, + { + "a": { + "chip": "BC63", + "lane": 3 + }, + "z": { + "end": { + "chip": "eth1/54", + "lane": 3 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC63", + "lane": 0 + } + }, + { + "id": { + "chip": "BC63", + "lane": 1 + } + }, + { + "id": { + "chip": "BC63", + "lane": 2 + } + }, + { + "id": { + "chip": "BC63", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/54", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 3 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC63", + "lane": 0 + } + }, + { + "id": { + "chip": "BC63", + "lane": 1 + } + }, + { + "id": { + "chip": "BC63", + "lane": 2 + } + }, + { + "id": { + "chip": "BC63", + "lane": 3 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/54", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 3 + } + } + ] + } + }, + "39": { + "subsumedPorts": [ + 344 + ], + "pins": { + "iphy": [ + { + "id": { + "chip": "BC63", + "lane": 0 + } + }, + { + "id": { + "chip": "BC63", + "lane": 1 + } + }, + { + "id": { + "chip": "BC63", + "lane": 2 + } + }, + { + "id": { + "chip": "BC63", + "lane": 3 + } + }, + { + "id": { + "chip": "BC63", + "lane": 4 + } + }, + { + "id": { + "chip": "BC63", + "lane": 5 + } + }, + { + "id": { + "chip": "BC63", + "lane": 6 + } + }, + { + "id": { + "chip": "BC63", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/54", + "lane": 0 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 1 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 2 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 3 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 7 + } + } + ] + } + } + } + }, + "344": { + "mapping": { + "id": 344, + "name": "eth1/54/2", + "controllingPort": 343, + "pins": [ + { + "a": { + "chip": "BC63", + "lane": 4 + }, + "z": { + "end": { + "chip": "eth1/54", + "lane": 4 + } + } + }, + { + "a": { + "chip": "BC63", + "lane": 5 + }, + "z": { + "end": { + "chip": "eth1/54", + "lane": 5 + } + } + }, + { + "a": { + "chip": "BC63", + "lane": 6 + }, + "z": { + "end": { + "chip": "eth1/54", + "lane": 6 + } + } + }, + { + "a": { + "chip": "BC63", + "lane": 7 + }, + "z": { + "end": { + "chip": "eth1/54", + "lane": 7 + } + } + } + ], + "portType": 0 + }, + "supportedProfiles": { + "25": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC63", + "lane": 4 + } + }, + { + "id": { + "chip": "BC63", + "lane": 5 + } + }, + { + "id": { + "chip": "BC63", + "lane": 6 + } + }, + { + "id": { + "chip": "BC63", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/54", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 7 + } + } + ] + } + }, + "38": { + "pins": { + "iphy": [ + { + "id": { + "chip": "BC63", + "lane": 4 + } + }, + { + "id": { + "chip": "BC63", + "lane": 5 + } + }, + { + "id": { + "chip": "BC63", + "lane": 6 + } + }, + { + "id": { + "chip": "BC63", + "lane": 7 + } + } + ], + "transceiver": [ + { + "id": { + "chip": "eth1/54", + "lane": 4 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 5 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 6 + } + }, + { + "id": { + "chip": "eth1/54", + "lane": 7 + } + } + ] + } + } + } + } + }, + "chips": [ + { + "name": "BC1", + "type": 1, + "physicalID": 1 + }, + { + "name": "BC4", + "type": 1, + "physicalID": 4 + }, + { + "name": "BC8", + "type": 1, + "physicalID": 8 + }, + { + "name": "BC12", + "type": 1, + "physicalID": 12 + }, + { + "name": "BC16", + "type": 1, + "physicalID": 16 + }, + { + "name": "BC20", + "type": 1, + "physicalID": 20 + }, + { + "name": "BC24", + "type": 1, + "physicalID": 24 + }, + { + "name": "BC28", + "type": 1, + "physicalID": 28 + }, + { + "name": "BC21", + "type": 1, + "physicalID": 21 + }, + { + "name": "BC17", + "type": 1, + "physicalID": 17 + }, + { + "name": "BC29", + "type": 1, + "physicalID": 29 + }, + { + "name": "BC25", + "type": 1, + "physicalID": 25 + }, + { + "name": "BC5", + "type": 1, + "physicalID": 5 + }, + { + "name": "BC0", + "type": 1, + "physicalID": 0 + }, + { + "name": "BC13", + "type": 1, + "physicalID": 13 + }, + { + "name": "BC9", + "type": 1, + "physicalID": 9 + }, + { + "name": "BC6", + "type": 1, + "physicalID": 6 + }, + { + "name": "BC2", + "type": 1, + "physicalID": 2 + }, + { + "name": "BC14", + "type": 1, + "physicalID": 14 + }, + { + "name": "BC10", + "type": 1, + "physicalID": 10 + }, + { + "name": "BC22", + "type": 1, + "physicalID": 22 + }, + { + "name": "BC18", + "type": 1, + "physicalID": 18 + }, + { + "name": "BC31", + "type": 1, + "physicalID": 31 + }, + { + "name": "BC26", + "type": 1, + "physicalID": 26 + }, + { + "name": "BC19", + "type": 1, + "physicalID": 19 + }, + { + "name": "BC23", + "type": 1, + "physicalID": 23 + }, + { + "name": "BC27", + "type": 1, + "physicalID": 27 + }, + { + "name": "BC30", + "type": 1, + "physicalID": 30 + }, + { + "name": "BC3", + "type": 1, + "physicalID": 3 + }, + { + "name": "BC7", + "type": 1, + "physicalID": 7 + }, + { + "name": "BC11", + "type": 1, + "physicalID": 11 + }, + { + "name": "BC15", + "type": 1, + "physicalID": 15 + }, + { + "name": "BC44", + "type": 1, + "physicalID": 44 + }, + { + "name": "BC40", + "type": 1, + "physicalID": 40 + }, + { + "name": "BC36", + "type": 1, + "physicalID": 36 + }, + { + "name": "BC33", + "type": 1, + "physicalID": 33 + }, + { + "name": "BC60", + "type": 1, + "physicalID": 60 + }, + { + "name": "BC56", + "type": 1, + "physicalID": 56 + }, + { + "name": "BC52", + "type": 1, + "physicalID": 52 + }, + { + "name": "BC48", + "type": 1, + "physicalID": 48 + }, + { + "name": "BC57", + "type": 1, + "physicalID": 57 + }, + { + "name": "BC61", + "type": 1, + "physicalID": 61 + }, + { + "name": "BC49", + "type": 1, + "physicalID": 49 + }, + { + "name": "BC53", + "type": 1, + "physicalID": 53 + }, + { + "name": "BC41", + "type": 1, + "physicalID": 41 + }, + { + "name": "BC45", + "type": 1, + "physicalID": 45 + }, + { + "name": "BC32", + "type": 1, + "physicalID": 32 + }, + { + "name": "BC37", + "type": 1, + "physicalID": 37 + }, + { + "name": "BC42", + "type": 1, + "physicalID": 42 + }, + { + "name": "BC46", + "type": 1, + "physicalID": 46 + }, + { + "name": "BC34", + "type": 1, + "physicalID": 34 + }, + { + "name": "BC38", + "type": 1, + "physicalID": 38 + }, + { + "name": "BC58", + "type": 1, + "physicalID": 58 + }, + { + "name": "BC63", + "type": 1, + "physicalID": 63 + }, + { + "name": "BC50", + "type": 1, + "physicalID": 50 + }, + { + "name": "BC54", + "type": 1, + "physicalID": 54 + }, + { + "name": "BC62", + "type": 1, + "physicalID": 62 + }, + { + "name": "BC59", + "type": 1, + "physicalID": 59 + }, + { + "name": "BC55", + "type": 1, + "physicalID": 55 + }, + { + "name": "BC51", + "type": 1, + "physicalID": 51 + }, + { + "name": "BC47", + "type": 1, + "physicalID": 47 + }, + { + "name": "BC43", + "type": 1, + "physicalID": 43 + }, + { + "name": "BC39", + "type": 1, + "physicalID": 39 + }, + { + "name": "BC35", + "type": 1, + "physicalID": 35 + }, + { + "name": "eth1/1", + "type": 3, + "physicalID": 0 + }, + { + "name": "eth1/2", + "type": 3, + "physicalID": 1 + }, + { + "name": "eth1/3", + "type": 3, + "physicalID": 2 + }, + { + "name": "eth1/4", + "type": 3, + "physicalID": 3 + }, + { + "name": "eth1/5", + "type": 3, + "physicalID": 4 + }, + { + "name": "eth1/6", + "type": 3, + "physicalID": 5 + }, + { + "name": "eth1/7", + "type": 3, + "physicalID": 6 + }, + { + "name": "eth1/8", + "type": 3, + "physicalID": 7 + }, + { + "name": "eth1/9", + "type": 3, + "physicalID": 8 + }, + { + "name": "eth1/10", + "type": 3, + "physicalID": 9 + }, + { + "name": "eth1/11", + "type": 3, + "physicalID": 10 + }, + { + "name": "eth1/12", + "type": 3, + "physicalID": 11 + }, + { + "name": "eth1/13", + "type": 3, + "physicalID": 12 + }, + { + "name": "eth1/14", + "type": 3, + "physicalID": 13 + }, + { + "name": "eth1/15", + "type": 3, + "physicalID": 14 + }, + { + "name": "eth1/16", + "type": 3, + "physicalID": 15 + }, + { + "name": "eth1/17", + "type": 3, + "physicalID": 16 + }, + { + "name": "eth1/18", + "type": 3, + "physicalID": 17 + }, + { + "name": "eth1/19", + "type": 3, + "physicalID": 18 + }, + { + "name": "eth1/20", + "type": 3, + "physicalID": 19 + }, + { + "name": "eth1/21", + "type": 3, + "physicalID": 20 + }, + { + "name": "eth1/22", + "type": 3, + "physicalID": 21 + }, + { + "name": "eth1/23", + "type": 3, + "physicalID": 22 + }, + { + "name": "eth1/24", + "type": 3, + "physicalID": 23 + }, + { + "name": "eth1/25", + "type": 3, + "physicalID": 24 + }, + { + "name": "eth1/26", + "type": 3, + "physicalID": 25 + }, + { + "name": "eth1/27", + "type": 3, + "physicalID": 26 + }, + { + "name": "eth1/28", + "type": 3, + "physicalID": 27 + }, + { + "name": "eth1/29", + "type": 3, + "physicalID": 28 + }, + { + "name": "eth1/30", + "type": 3, + "physicalID": 29 + }, + { + "name": "eth1/31", + "type": 3, + "physicalID": 30 + }, + { + "name": "eth1/32", + "type": 3, + "physicalID": 31 + }, + { + "name": "eth1/33", + "type": 3, + "physicalID": 32 + }, + { + "name": "eth1/34", + "type": 3, + "physicalID": 33 + }, + { + "name": "eth1/35", + "type": 3, + "physicalID": 34 + }, + { + "name": "eth1/36", + "type": 3, + "physicalID": 35 + }, + { + "name": "eth1/37", + "type": 3, + "physicalID": 36 + }, + { + "name": "eth1/38", + "type": 3, + "physicalID": 37 + }, + { + "name": "eth1/39", + "type": 3, + "physicalID": 38 + }, + { + "name": "eth1/40", + "type": 3, + "physicalID": 39 + }, + { + "name": "eth1/41", + "type": 3, + "physicalID": 40 + }, + { + "name": "eth1/42", + "type": 3, + "physicalID": 41 + }, + { + "name": "eth1/43", + "type": 3, + "physicalID": 42 + }, + { + "name": "eth1/44", + "type": 3, + "physicalID": 43 + }, + { + "name": "eth1/45", + "type": 3, + "physicalID": 44 + }, + { + "name": "eth1/46", + "type": 3, + "physicalID": 45 + }, + { + "name": "eth1/47", + "type": 3, + "physicalID": 46 + }, + { + "name": "eth1/48", + "type": 3, + "physicalID": 47 + }, + { + "name": "eth1/49", + "type": 3, + "physicalID": 48 + }, + { + "name": "eth1/50", + "type": 3, + "physicalID": 49 + }, + { + "name": "eth1/51", + "type": 3, + "physicalID": 50 + }, + { + "name": "eth1/52", + "type": 3, + "physicalID": 51 + }, + { + "name": "eth1/53", + "type": 3, + "physicalID": 52 + }, + { + "name": "eth1/54", + "type": 3, + "physicalID": 53 + }, + { + "name": "eth1/55", + "type": 3, + "physicalID": 54 + }, + { + "name": "eth1/56", + "type": 3, + "physicalID": 55 + }, + { + "name": "eth1/57", + "type": 3, + "physicalID": 56 + }, + { + "name": "eth1/58", + "type": 3, + "physicalID": 57 + }, + { + "name": "eth1/59", + "type": 3, + "physicalID": 58 + }, + { + "name": "eth1/60", + "type": 3, + "physicalID": 59 + }, + { + "name": "eth1/61", + "type": 3, + "physicalID": 60 + }, + { + "name": "eth1/62", + "type": 3, + "physicalID": 61 + }, + { + "name": "eth1/63", + "type": 3, + "physicalID": 62 + }, + { + "name": "eth1/64", + "type": 3, + "physicalID": 63 + } + ], + "portConfigOverrides": [ + { + "factor": { + "profiles": [ + 25 + ] + }, + "pins": { + "iphy": [ + { + "id": { + "chip": "ALL", + "lane": 0 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 1 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 2 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 3 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + } + ] + } + }, + { + "factor": { + "profiles": [ + 38 + ] + }, + "pins": { + "iphy": [ + { + "id": { + "chip": "ALL", + "lane": 0 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 1 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 2 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 3 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + } + ] + } + }, + { + "factor": { + "profiles": [ + 39 + ] + }, + "pins": { + "iphy": [ + { + "id": { + "chip": "ALL", + "lane": 0 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 1 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 2 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 3 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 4 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 5 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 6 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + }, + { + "id": { + "chip": "ALL", + "lane": 7 + }, + "tx": { + "pre": -24, + "pre2": 0, + "main": 132, + "post": -12, + "post2": 0, + "post3": 0 + } + } + ] + } + } + ], + "platformSupportedProfiles": [ + { + "factor": { + "profileID": 25 + }, + "profile": { + "speed": 200000, + "iphy": { + "numLanes": 4, + "modulation": 2, + "fec": 11, + "medium": 3, + "interfaceMode": 3, + "interfaceType": 3 + } + } + }, + { + "factor": { + "profileID": 38 + }, + "profile": { + "speed": 400000, + "iphy": { + "numLanes": 4, + "modulation": 2, + "fec": 11, + "medium": 3, + "interfaceMode": 4, + "interfaceType": 4 + } + } + }, + { + "factor": { + "profileID": 39 + }, + "profile": { + "speed": 800000, + "iphy": { + "numLanes": 8, + "modulation": 2, + "fec": 11, + "medium": 3, + "interfaceMode": 4, + "interfaceType": 4 + } + } + } + ] +} +)"; +} // namespace + +namespace facebook { +namespace fboss { +MontblancPlatformMapping::MontblancPlatformMapping() + : PlatformMapping(kJsonPlatformMappingStr) {} + +} // namespace fboss +} // namespace facebook diff --git a/fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.h b/fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.h new file mode 100644 index 0000000000000..365a756724242 --- /dev/null +++ b/fboss/agent/platforms/common/montblanc/MontblancPlatformMapping.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2004-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ +#pragma once + +#include "fboss/agent/platforms/common/PlatformMapping.h" + +namespace facebook { +namespace fboss { + +class MontblancPlatformMapping : public PlatformMapping { + public: + MontblancPlatformMapping(); + + private: + // Forbidden copy constructor and assignment operator + MontblancPlatformMapping(MontblancPlatformMapping const&) = delete; + MontblancPlatformMapping& operator=(MontblancPlatformMapping const&) = delete; +}; +} // namespace fboss +} // namespace facebook diff --git a/fboss/lib/platforms/PlatformMode.h b/fboss/lib/platforms/PlatformMode.h index 75c812576f92b..5b8b371d0eba0 100644 --- a/fboss/lib/platforms/PlatformMode.h +++ b/fboss/lib/platforms/PlatformMode.h @@ -41,6 +41,7 @@ enum class PlatformMode : char { WEDGE400C_FABRIC, CLOUDRIPPER_VOQ, CLOUDRIPPER_FABRIC, + MONTBLANC, }; inline std::string toString(PlatformMode mode) { @@ -91,6 +92,8 @@ inline std::string toString(PlatformMode mode) { return "CLOUDRIPPER_VOQ"; case PlatformMode::CLOUDRIPPER_FABRIC: return "CLOUDRIPPER_FABRIC"; + case PlatformMode::MONTBLANC: + return "MONTBLANC"; } throw std::runtime_error("Unknown mode"); return "Unknown"; diff --git a/fboss/qsfp_service/test/hw_test/HwFirmwareTest.cpp b/fboss/qsfp_service/test/hw_test/HwFirmwareTest.cpp index 8bd1aa5dbe2f3..f119d4a6d1aca 100644 --- a/fboss/qsfp_service/test/hw_test/HwFirmwareTest.cpp +++ b/fboss/qsfp_service/test/hw_test/HwFirmwareTest.cpp @@ -39,6 +39,7 @@ TEST_F(HwTest, CheckDefaultXphyFirmwareVersion) { case PlatformMode::LASSEN: case PlatformMode::MAKALU: case PlatformMode::KAMET: + case PlatformMode::MONTBLANC: throw FbossError("No xphys to check FW version on"); case PlatformMode::ELBERT: desiredFw.version() = 1; From af5dea7658a7289f91c5a5200107e38af564ca83 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 10 Feb 2023 16:01:10 -0800 Subject: [PATCH 259/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/13e42616345daffe3f8a324b4db6dc799f249416 https://github.com/facebookincubator/mvfst/commit/dd9a75a641a205e3bb8e3354e38d9a3026275ffb Reviewed By: yns88 fbshipit-source-id: c801e9baaa9f28bbe39ec871b99cc104e82deece --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index b0607efdf3341..c593cb30a69b2 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 988b674939bddd4fd2fda9c5d591e4e0f080b9fc +Subproject commit 13e42616345daffe3f8a324b4db6dc799f249416 From 4898773b194a5c6aa7b232329c83d0e9c17e5eee Mon Sep 17 00:00:00 2001 From: Jeff Kim Date: Fri, 10 Feb 2023 16:38:30 -0800 Subject: [PATCH 260/280] Implement Show Hardware Objects Command Summary: I implemented a new command, show hw-object, for the FBOSS2 CLI. The user lists specific hardware object types (examples: PORT, VLAN, L2_ENTRY) as arguments for the command. The command will make a listHwObjects Thrift call and then present all information about each of the specified hardware object types from FBOSS Agent. Reviewed By: peygar Differential Revision: D43107599 Privacy Context Container: L1125585 fbshipit-source-id: c943efad9f92370a919571b04add200984a2fd02 --- fboss/cli/fboss2/CmdHandler.cpp | 2 + fboss/cli/fboss2/CmdList.cpp | 7 ++ fboss/cli/fboss2/CmdSubcommands.cpp | 5 ++ .../commands/show/hwobject/CmdShowHwObject.h | 47 +++++++++++ fboss/cli/fboss2/test/CmdArgsTest.cpp | 17 ++++ fboss/cli/fboss2/test/CmdShowHwObjectTest.cpp | 83 +++++++++++++++++++ fboss/cli/fboss2/test/MockClients.h | 3 + fboss/cli/fboss2/utils/CmdUtils.h | 16 ++++ 8 files changed, 180 insertions(+) create mode 100644 fboss/cli/fboss2/commands/show/hwobject/CmdShowHwObject.h create mode 100644 fboss/cli/fboss2/test/CmdShowHwObjectTest.cpp diff --git a/fboss/cli/fboss2/CmdHandler.cpp b/fboss/cli/fboss2/CmdHandler.cpp index 6e3f498f8d715..0ba532d70c25c 100644 --- a/fboss/cli/fboss2/CmdHandler.cpp +++ b/fboss/cli/fboss2/CmdHandler.cpp @@ -30,6 +30,7 @@ #include "fboss/cli/fboss2/commands/show/aggregateport/CmdShowAggregatePort.h" #include "fboss/cli/fboss2/commands/show/arp/CmdShowArp.h" #include "fboss/cli/fboss2/commands/show/fabric/CmdShowFabric.h" +#include "fboss/cli/fboss2/commands/show/hwobject/CmdShowHwObject.h" #include "fboss/cli/fboss2/commands/show/interface/CmdShowInterface.h" #include "fboss/cli/fboss2/commands/show/interface/counters/CmdShowInterfaceCounters.h" #include "fboss/cli/fboss2/commands/show/interface/counters/mka/CmdShowInterfaceCountersMKA.h" @@ -248,6 +249,7 @@ template void CmdHandler::run(); template void CmdHandler::run(); template void CmdHandler::run(); template void CmdHandler::run(); +template void CmdHandler::run(); template void CmdHandler::run(); template void CmdHandler::run(); diff --git a/fboss/cli/fboss2/CmdList.cpp b/fboss/cli/fboss2/CmdList.cpp index 77bddc037fecc..cedf8948832d0 100644 --- a/fboss/cli/fboss2/CmdList.cpp +++ b/fboss/cli/fboss2/CmdList.cpp @@ -30,6 +30,7 @@ #include "fboss/cli/fboss2/commands/show/aggregateport/CmdShowAggregatePort.h" #include "fboss/cli/fboss2/commands/show/arp/CmdShowArp.h" #include "fboss/cli/fboss2/commands/show/fabric/CmdShowFabric.h" +#include "fboss/cli/fboss2/commands/show/hwobject/CmdShowHwObject.h" #include "fboss/cli/fboss2/commands/show/interface/CmdShowInterface.h" #include "fboss/cli/fboss2/commands/show/interface/counters/CmdShowInterfaceCounters.h" #include "fboss/cli/fboss2/commands/show/interface/counters/mka/CmdShowInterfaceCountersMKA.h" @@ -245,6 +246,12 @@ const CommandTree& kCommandTree() { "Show teflow information", commandHandler}, + {"show", + "hw-object", + utils::ObjectArgTypeId::OBJECT_ARG_TYPE_ID_HW_OBJECT_LIST, + "Show HW Objects", + commandHandler}, + {"clear", "arp", utils::ObjectArgTypeId::OBJECT_ARG_TYPE_ID_NONE, diff --git a/fboss/cli/fboss2/CmdSubcommands.cpp b/fboss/cli/fboss2/CmdSubcommands.cpp index f94c801f7bbc1..a49b237142699 100644 --- a/fboss/cli/fboss2/CmdSubcommands.cpp +++ b/fboss/cli/fboss2/CmdSubcommands.cpp @@ -139,6 +139,11 @@ CmdSubcommands::addCommand(CLI::App& app, const Command& cmd, int depth) { args, "Client ID representing fsdb publishers/subscribers IDs e.g.\n" "'agent'\n"); + } else if ( + cmd.argType == + utils::ObjectArgTypeId::OBJECT_ARG_TYPE_ID_HW_OBJECT_LIST) { + subCmd->add_option( + "hw_object_type", args, "Hardware (HW) object type(s)\n"); } } else { subCmd->require_subcommand(); diff --git a/fboss/cli/fboss2/commands/show/hwobject/CmdShowHwObject.h b/fboss/cli/fboss2/commands/show/hwobject/CmdShowHwObject.h new file mode 100644 index 0000000000000..6f229e78e4039 --- /dev/null +++ b/fboss/cli/fboss2/commands/show/hwobject/CmdShowHwObject.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2004-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +#pragma once + +#include "fboss/cli/fboss2/CmdGlobalOptions.h" +#include "fboss/cli/fboss2/CmdHandler.h" +#include "fboss/cli/fboss2/utils/CmdUtils.h" + +namespace facebook::fboss { + +struct CmdShowHwObjectTraits : public BaseCommandTraits { + static constexpr utils::ObjectArgTypeId ObjectArgTypeId = + utils::ObjectArgTypeId::OBJECT_ARG_TYPE_ID_HW_OBJECT_LIST; + using ObjectArgType = utils::HwObjectList; + using RetType = std::string; +}; + +class CmdShowHwObject + : public CmdHandler { + public: + using ObjectArgType = CmdShowHwObjectTraits::ObjectArgType; + using RetType = CmdShowHwObjectTraits::RetType; + + RetType queryClient( + const HostInfo& hostInfo, + const ObjectArgType& queriedHwObjectTypes) { + std::string hwObjectInfo; + auto client = + utils::createClient(hostInfo); + client->sync_listHwObjects(hwObjectInfo, queriedHwObjectTypes.data(), true); + return hwObjectInfo; + } + + void printOutput(const RetType& hwObjectInfo, std::ostream& out = std::cout) { + out << hwObjectInfo << std::endl; + } +}; + +} // namespace facebook::fboss diff --git a/fboss/cli/fboss2/test/CmdArgsTest.cpp b/fboss/cli/fboss2/test/CmdArgsTest.cpp index b257037dceeeb..b023c3594ab4f 100644 --- a/fboss/cli/fboss2/test/CmdArgsTest.cpp +++ b/fboss/cli/fboss2/test/CmdArgsTest.cpp @@ -124,4 +124,21 @@ TEST(CmdArgsTest, FsdbPath) { EXPECT_THROW(utils::FsdbPath({"invalid", "args"}), std::runtime_error); } +TEST(CmdArgsTest, HwObjectList) { + // test valid arguments + ASSERT_NO_THROW(utils::HwObjectList({"PORT"})); + EXPECT_THAT( + utils::HwObjectList({"PORT"}).data(), ElementsAre(HwObjectType::PORT)); + ASSERT_NO_THROW(utils::HwObjectList({"LAG", "MIRROR"})); + EXPECT_THAT( + utils::HwObjectList({"LAG", "MIRROR"}).data(), + ElementsAre(HwObjectType::LAG, HwObjectType::MIRROR)); + + // test invalid arguments + ASSERT_THROW(utils::HwObjectList({"M"}), std::out_of_range); + ASSERT_THROW(utils::HwObjectList({""}), std::out_of_range); + ASSERT_THROW( + utils::HwObjectList({"QUEUE", "VLAN", "AAA"}), std::out_of_range); +} + } // namespace facebook::fboss diff --git a/fboss/cli/fboss2/test/CmdShowHwObjectTest.cpp b/fboss/cli/fboss2/test/CmdShowHwObjectTest.cpp new file mode 100644 index 0000000000000..cbc1792475d84 --- /dev/null +++ b/fboss/cli/fboss2/test/CmdShowHwObjectTest.cpp @@ -0,0 +1,83 @@ +// (c) Facebook, Inc. and its affiliates. Confidential and proprietary. + +#include +#include + +#include + +#include "fboss/agent/AddressUtil.h" +#include "fboss/agent/if/gen-cpp2/ctrl_types.h" +#include "fboss/cli/fboss2/utils/CmdClientUtils.h" + +#include "fboss/cli/fboss2/commands/show/hwobject/CmdShowHwObject.h" +#include "fboss/cli/fboss2/test/CmdHandlerTestBase.h" +#include "nettools/common/TestUtils.h" + +using namespace ::testing; + +namespace facebook::fboss { + +utils::HwObjectList createHwObjectTypes() { + utils::HwObjectList hwObjectTypes({"BUFFER", "DEBUG_COUNTER"}); + return hwObjectTypes; +} + +std::string createExpectedHwObjectInfo() { + return "Object type: buffer-pool\n" + "BufferPoolSaiId(1202590842881): (Type: 1, Size: 14758016, ThresholdMode: 1, nullopt)\n\n" + "Object type: buffer-profile\n" + "BufferProfileSaiId(107374182405): (PoolId: 1202590842881, ReservedBytes: 0, ThresholdMode: 1, SharedDynamicThreshold: 1, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n" + "BufferProfileSaiId(107374182404): (PoolId: 1202590842881, ReservedBytes: 0, ThresholdMode: 1, SharedDynamicThreshold: 0, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n" + "BufferProfileSaiId(107374182403): (PoolId: 1202590842881, ReservedBytes: 9984, ThresholdMode: 1, SharedDynamicThreshold: 3, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n" + "BufferProfileSaiId(107374182402): (PoolId: 1202590842881, ReservedBytes: 3328, ThresholdMode: 1, SharedDynamicThreshold: 0, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n" + "BufferProfileSaiId(107374182401): (PoolId: 1202590842881, ReservedBytes: 1664, ThresholdMode: 1, SharedDynamicThreshold: 1, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n\n" + "Object type: debug-counter\n" + "DebugCounterSaiId(365072220160): (Type: 0, BindMethod: 0, InDropReasons: [52])\n"; +} + +class CmdShowHwObjectTestFixture : public CmdHandlerTestBase { + public: + CmdShowHwObjectTraits::ObjectArgType queriedHwObjectTypes; + utils::HwObjectList mockHwObjectTypes; + std::string expectedHwObjectInfo; + + void SetUp() override { + CmdHandlerTestBase::SetUp(); + mockHwObjectTypes = createHwObjectTypes(); + expectedHwObjectInfo = createExpectedHwObjectInfo(); + } +}; + +TEST_F(CmdShowHwObjectTestFixture, queryClient) { + setupMockedAgentServer(); + EXPECT_CALL(getMockAgent(), listHwObjects(_, _, _)) + .WillOnce(Invoke([&](std::string& out, + std::unique_ptr>, + bool) { out = expectedHwObjectInfo; })); + + auto cmd = CmdShowHwObject(); + auto hwObjectInfo = cmd.queryClient(localhost(), mockHwObjectTypes); + EXPECT_THRIFT_EQ(hwObjectInfo, expectedHwObjectInfo); +} + +TEST_F(CmdShowHwObjectTestFixture, printOutput) { + std::stringstream ss; + CmdShowHwObject().printOutput(expectedHwObjectInfo, ss); + + std::string output = ss.str(); + std::string expectedOutput = + "Object type: buffer-pool\n" + "BufferPoolSaiId(1202590842881): (Type: 1, Size: 14758016, ThresholdMode: 1, nullopt)\n\n" + "Object type: buffer-profile\n" + "BufferProfileSaiId(107374182405): (PoolId: 1202590842881, ReservedBytes: 0, ThresholdMode: 1, SharedDynamicThreshold: 1, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n" + "BufferProfileSaiId(107374182404): (PoolId: 1202590842881, ReservedBytes: 0, ThresholdMode: 1, SharedDynamicThreshold: 0, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n" + "BufferProfileSaiId(107374182403): (PoolId: 1202590842881, ReservedBytes: 9984, ThresholdMode: 1, SharedDynamicThreshold: 3, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n" + "BufferProfileSaiId(107374182402): (PoolId: 1202590842881, ReservedBytes: 3328, ThresholdMode: 1, SharedDynamicThreshold: 0, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n" + "BufferProfileSaiId(107374182401): (PoolId: 1202590842881, ReservedBytes: 1664, ThresholdMode: 1, SharedDynamicThreshold: 1, XoffTh: 0, XonTh: 0, XonOffsetTh: 0)\n\n" + "Object type: debug-counter\n" + "DebugCounterSaiId(365072220160): (Type: 0, BindMethod: 0, InDropReasons: [52])\n\n"; + + EXPECT_EQ(output, expectedOutput); +} + +} // namespace facebook::fboss diff --git a/fboss/cli/fboss2/test/MockClients.h b/fboss/cli/fboss2/test/MockClients.h index 064bbcf7a1339..34bd9a8388f15 100644 --- a/fboss/cli/fboss2/test/MockClients.h +++ b/fboss/cli/fboss2/test/MockClients.h @@ -31,7 +31,10 @@ class MockFbossCtrlAgent : public FbossCtrlSvIf { (std::vector&)); using PortInfoMap = std::map&; + using Out = std::string&; + using HwObjects = std::unique_ptr>; MOCK_METHOD(void, getAllPortInfo, (PortInfoMap)); + MOCK_METHOD(void, listHwObjects, (Out, HwObjects, bool)); MOCK_METHOD(SSLType, getSSLPolicy, ()); MOCK_METHOD(void, setPortState, (int32_t, bool)); MOCK_METHOD( diff --git a/fboss/cli/fboss2/utils/CmdUtils.h b/fboss/cli/fboss2/utils/CmdUtils.h index b6a3f5c7c9256..273a3e8d09092 100644 --- a/fboss/cli/fboss2/utils/CmdUtils.h +++ b/fboss/cli/fboss2/utils/CmdUtils.h @@ -49,6 +49,7 @@ enum class ObjectArgTypeId : uint8_t { OBJECT_ARG_TYPE_ID_VIP_INJECTOR_ID, OBJECT_ARG_TYPE_ID_AREA_LIST, OBJECT_ARG_TYPE_ID_NODE_LIST, + OBJECT_ARG_TYPE_ID_HW_OBJECT_LIST, OBJECT_ARG_TYPE_DEBUG_LEVEL, OBJECT_ARG_TYPE_PRBS_COMPONENT, OBJECT_ARG_TYPE_PRBS_STATE, @@ -353,6 +354,21 @@ class FsdbClientId : public BaseObjectArgType { ObjectArgTypeId::OBJECT_ARG_TYPE_FSDB_CLIENT_ID; }; +class HwObjectList : public BaseObjectArgType { + public: + /* implicit */ HwObjectList() : BaseObjectArgType() {} + /* implicit */ HwObjectList(std::vector hwObjectTypeArgList) { + for (auto const& hwObjectTypeArg : hwObjectTypeArgList) { + HwObjectType hwObjectType = + apache::thrift::util::enumValueOrThrow(hwObjectTypeArg); + data_.push_back(hwObjectType); + } + } + + const static ObjectArgTypeId id = + ObjectArgTypeId::OBJECT_ARG_TYPE_ID_HW_OBJECT_LIST; +}; + // Called after CLI11 is initlized but before parsing, for any final // initialization steps void postAppInit(int argc, char* argv[], CLI::App& app); From a06e39428fd0cf31df78165cd7e158b31bd5aa83 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Fri, 10 Feb 2023 16:59:16 -0800 Subject: [PATCH 261/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/398b53bfe0851a067852137ee9a07e0a1fcd53b3 https://github.com/facebook/fbthrift/commit/38c2e4e29707ab59de520b0686f65b4df5c78f91 https://github.com/facebook/wangle/commit/eee50e500776f42fb1175afff953dfc3b0094778 https://github.com/facebookexperimental/edencommon/commit/407da76e3265af92bf9bccc882a90722cac47e42 https://github.com/facebookincubator/fizz/commit/465851ff421a3b71a33e636efb726879877e9286 https://github.com/facebookincubator/mvfst/commit/0be5980cd7fc4b2eca24656afe3456d92b4b8729 https://github.com/facebookincubator/velox/commit/9ba17cb92209ab01cf22006443a472ea84034561 Reviewed By: yns88 fbshipit-source-id: 9021734e657996087f5836f70dba4584407e3c94 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index a375ad6e33ce5..a8a2c1cad1bfb 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 597ac1d2bb69f75594b459266d68e9d4bbf86c30 +Subproject commit 38c2e4e29707ab59de520b0686f65b4df5c78f91 diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 409dea0a86400..140b9919ad3d1 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 31f17272bf194affdf323971eef9a7d2ecbcb6ec +Subproject commit eee50e500776f42fb1175afff953dfc3b0094778 From 60b05f010e253e44a8bb0047a16709a469a88bc9 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Sat, 11 Feb 2023 01:35:10 -0800 Subject: [PATCH 262/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/bb7273fa15f9096b5b210c73817667e4f2cd8681 Reviewed By: yns88 fbshipit-source-id: 946b36321553f8b23be89355df3f2d478ff1e2fd --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index a8a2c1cad1bfb..fc8e53d98d9fd 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 38c2e4e29707ab59de520b0686f65b4df5c78f91 +Subproject commit bb7273fa15f9096b5b210c73817667e4f2cd8681 From 3c7049d064f441620e64349fc31005b064f470b5 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sat, 11 Feb 2023 09:08:29 -0800 Subject: [PATCH 263/280] Add API to get dsf nodes Summary: As titled. Will be used soon in cli Differential Revision: D43211637 fbshipit-source-id: 47b8e36b3c5b9a6bd90211e6804f44698408ad1b --- fboss/agent/ThriftHandler.cpp | 4 ++++ fboss/agent/ThriftHandler.h | 1 + fboss/agent/if/ctrl.thrift | 3 +++ 3 files changed, 8 insertions(+) diff --git a/fboss/agent/ThriftHandler.cpp b/fboss/agent/ThriftHandler.cpp index 5cd2c240e01fd..b0a5b78abaeb5 100644 --- a/fboss/agent/ThriftHandler.cpp +++ b/fboss/agent/ThriftHandler.cpp @@ -2725,4 +2725,8 @@ void ThriftHandler::getFabricReachability( reachability.insert({portName, fabricEndpoint}); } } + +void ThriftHandler::getDsfNodes(std::map& dsfNodes) { + dsfNodes = sw_->getState()->getDsfNodes()->toThrift(); +} } // namespace facebook::fboss diff --git a/fboss/agent/ThriftHandler.h b/fboss/agent/ThriftHandler.h index f1f618a7260b2..e753f57335472 100644 --- a/fboss/agent/ThriftHandler.h +++ b/fboss/agent/ThriftHandler.h @@ -282,6 +282,7 @@ class ThriftHandler : virtual public FbossCtrlSvIf, void getTeFlowTableDetails(std::vector& flowTable) override; void getFabricReachability( std::map& reachability) override; + void getDsfNodes(std::map& dsfNodes) override; /* * Event handler for when a connection is destroyed. When there is an ongoing * duplex connection, there may be other threads that depend on the connection diff --git a/fboss/agent/if/ctrl.thrift b/fboss/agent/if/ctrl.thrift index 82a8124bd7072..9d97f848fddb4 100644 --- a/fboss/agent/if/ctrl.thrift +++ b/fboss/agent/if/ctrl.thrift @@ -1241,6 +1241,9 @@ service FbossCtrl extends phy.FbossCommonPhyCtrl { map getFabricReachability() throws ( 1: fboss.FbossBaseError error, ); + map getDsfNodes() throws ( + 1: fboss.FbossBaseError error, + ); } service NeighborListenerClient extends fb303.FacebookService { From 79d20b84677ac591a8e6241112bf115b8a1d8758 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sat, 11 Feb 2023 09:08:29 -0800 Subject: [PATCH 264/280] UT for getDsfNodes thrift api Summary: As titled Differential Revision: D43211742 fbshipit-source-id: 1ef9ca1ade97cb26a424e759e64a93dc717f6dfe --- fboss/agent/test/ThriftTest.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/fboss/agent/test/ThriftTest.cpp b/fboss/agent/test/ThriftTest.cpp index f3d82b66a8185..09bee4c534028 100644 --- a/fboss/agent/test/ThriftTest.cpp +++ b/fboss/agent/test/ThriftTest.cpp @@ -2261,3 +2261,22 @@ TEST_F(ThriftTeFlowTest, teFlowSyncUpdateHwProtection) { }, FbossTeUpdateError); } + +class ThriftVoqSwitchTest : public ::testing::Test { + public: + void SetUp() override { + auto config = testConfigA(cfg::SwitchType::VOQ); + handle_ = createTestHandle(&config); + sw_ = handle_->getSw(); + sw_->initialConfigApplied(std::chrono::steady_clock::now()); + } + SwSwitch* sw_; + std::unique_ptr handle_; +}; + +TEST_F(ThriftVoqSwitchTest, getDsfNodes) { + ThriftHandler handler(sw_); + std::map dsfNodes; + handler.getDsfNodes(dsfNodes); + EXPECT_EQ(dsfNodes.size(), 2); +} From 8e221d28976e120c3943b296f4b3758cc9a5f44c Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Sat, 11 Feb 2023 10:09:52 -0800 Subject: [PATCH 265/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/8cc15f71743feeedcdc72c77a6a935dc965ed57c Reviewed By: yns88 fbshipit-source-id: 2fb4d23e97d31fb4ce4d8bfc0a8797be4b6ea022 --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index c593cb30a69b2..12a5e82f76504 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 13e42616345daffe3f8a324b4db6dc799f249416 +Subproject commit 8cc15f71743feeedcdc72c77a6a935dc965ed57c From ed5e3513652c5bb6e61e94e53d55c15c2b63c713 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Sat, 11 Feb 2023 17:12:23 -0800 Subject: [PATCH 266/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/f98df5924a745b9498f54ed857fdb2eb1cbafc2c https://github.com/facebook/wangle/commit/dd6b14f3c1a8b86a2c7cb2fcbe65a675c7a02b48 https://github.com/facebookexperimental/edencommon/commit/1d98d75e0c889a4b05d00a13d2d97433a5804628 https://github.com/facebookincubator/fizz/commit/e80100d2ab584a59555ed15fd78fdebb241db560 https://github.com/facebookincubator/mvfst/commit/e86dc52c56dc7a6a823d1a9249f25ba84264de05 Reviewed By: yns88 fbshipit-source-id: 91564e3835803599ffe71aeac660af598f7cb6dc --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index fc8e53d98d9fd..3c6b4078b69c1 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit bb7273fa15f9096b5b210c73817667e4f2cd8681 +Subproject commit 9ca26e2d32b1b1e0ac7c06d1f071cc26f17aaf7d diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index 12a5e82f76504..992094dc4decb 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 8cc15f71743feeedcdc72c77a6a935dc965ed57c +Subproject commit 1c74accaed8e224a7867404822ab58acb70b5c8a diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 140b9919ad3d1..db2d6f706cff4 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit eee50e500776f42fb1175afff953dfc3b0094778 +Subproject commit dd6b14f3c1a8b86a2c7cb2fcbe65a675c7a02b48 From 00c55031016694cb7e0b61ded07aefdda32c5dea Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sun, 12 Feb 2023 11:08:39 -0800 Subject: [PATCH 267/280] Account for different acl match behavior for looped packets Summary: In some ASICs we get looped back packet bumping counter on acl hit before being dropped vs on other we see that counter is only incremented once. So assert that counter increment is >= 1 && <=2 Also green light TTL acl tests on Makalu since they now work Reviewed By: shri-khare Differential Revision: D43182351 fbshipit-source-id: c387f3c5be8e6d2b08fbe8302ef6f1a04ab84962 --- .../dataplane_tests/HwAclCounterTests.cpp | 29 ++++++++----------- .../centos-7-x86_64/run_scripts/run_test.py | 2 +- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/fboss/agent/hw/test/dataplane_tests/HwAclCounterTests.cpp b/fboss/agent/hw/test/dataplane_tests/HwAclCounterTests.cpp index f26259d70ca24..c9b6792ebb63f 100644 --- a/fboss/agent/hw/test/dataplane_tests/HwAclCounterTests.cpp +++ b/fboss/agent/hw/test/dataplane_tests/HwAclCounterTests.cpp @@ -74,24 +74,19 @@ class HwAclCounterTest : public HwLinkStateDependentTest { if (bumpOnHit) { EXPECT_EVENTUALLY_GT(pktsAfter, pktsBefore); - auto pktsHit = 1; - // For non SRC_PORT ACLS - // On VOQ switches, we see a counter bump by 1, for the time the - // packet is routed out. The looped packet which gets dropped does - // not seem to incur a counter bump. On non VOQ switches OTOH, - // we see a bump by 2 once on the way out and once when it loops back - // in. - if (aclType != AclType::SRC_PORT && - getAsic()->getSwitchType() == cfg::SwitchType::NPU) { - ++pktsHit; - } - EXPECT_EVENTUALLY_EQ(aclPktCountBefore + pktsHit, aclPktCountAfter); - - // TODO: Still need to debug. For some test cases, we are getting more - // bytes in aclCounter. Ex. 4 Bytes extra in Tomahawk4 tests. + // On some ASICs looped back pkt hits the ACL before being + // dropped in the ingress pipeline, hence GE + EXPECT_EVENTUALLY_GE(aclPktCountAfter, aclPktCountBefore + 1); + // At most we should get a pkt bump of 2 + EXPECT_EVENTUALLY_LE(aclPktCountAfter, aclPktCountBefore + 2); + EXPECT_EVENTUALLY_GE( + aclBytesCountAfter, aclBytesCountBefore + sizeOfPacketSent); + // On native BCM we see 4 extra bytes in the acl counter. This is + // likely due to ingress vlan getting imposed and getting counted + // when packet hits acl in ingress pipeline EXPECT_EVENTUALLY_LE( - aclBytesCountBefore + (pktsHit * sizeOfPacketSent), - aclBytesCountAfter); + aclBytesCountAfter, + aclBytesCountBefore + (2 * sizeOfPacketSent) + 4); } else { EXPECT_EVENTUALLY_EQ(aclPktCountBefore, aclPktCountAfter); EXPECT_EVENTUALLY_EQ(aclBytesCountBefore, aclBytesCountAfter); diff --git a/installer/centos-7-x86_64/run_scripts/run_test.py b/installer/centos-7-x86_64/run_scripts/run_test.py index 7729db2e813d3..c39aa4acaeedf 100755 --- a/installer/centos-7-x86_64/run_scripts/run_test.py +++ b/installer/centos-7-x86_64/run_scripts/run_test.py @@ -101,7 +101,7 @@ # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwRouteTest/1.*:-*Mpls*:*ClassId*:*ClassID* # ACLs # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwAclPriorityTest.*:-*AclsChanged* -# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwAclCounterTest.*:-*Ttl* +# ./run_test.py sai --config makalu.agent.materialized_JSON --filter=HwAclCounterTest.* # ./run_test.py sai --config makalu.agent.materialized_JSON --filter=SaiAclTableRecreateTests.* # ./run_test.py sai --config makalu.agent.materialized_JSON # --filter=HwAclStatTest.*:-*AclStatCreate:*AclStatCreateShared:*AclStatCreateMultiple:*AclStatMultipleActions:*AclStatDeleteShared*:*AclStatDeleteSharedPostWarmBoot:*AclStatRename*:*AclStatModify:*AclStatShuffle:*StatNumberOfCounters:*AclStatChangeCounterType From 6799795c522d2b6a062b026ef9772bfd4629ded0 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Sun, 12 Feb 2023 11:15:04 -0800 Subject: [PATCH 268/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/5d2a1aedfe847f532cb3a7f81a83518fc424f0c0 Reviewed By: yns88 fbshipit-source-id: 1866c5899a3a8381c55bfb521b10939885250ba3 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 3c6b4078b69c1..f87c3ce0d8e7b 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 9ca26e2d32b1b1e0ac7c06d1f071cc26f17aaf7d +Subproject commit 5d2a1aedfe847f532cb3a7f81a83518fc424f0c0 From e378767a02fc61f75d7eaadd0e79179751c650a5 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Sun, 12 Feb 2023 18:11:54 -0800 Subject: [PATCH 269/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fb303/commit/c6b6e35e0f9dfa89e66f62560702209038674a97 https://github.com/facebook/fbthrift/commit/399e2f7bdc7fb68cccaa45a4c94b50bc1d15f198 https://github.com/facebookexperimental/rust-shed/commit/501dc36185beae95146dd4a7c13ed4f33982d4e8 Reviewed By: yns88 fbshipit-source-id: 667e2a9588f9a7ab1620103d57964ac74fadf8c6 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index f87c3ce0d8e7b..eed4fc57118ff 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 5d2a1aedfe847f532cb3a7f81a83518fc424f0c0 +Subproject commit 399e2f7bdc7fb68cccaa45a4c94b50bc1d15f198 diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index db2d6f706cff4..74f32c9cb462a 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit dd6b14f3c1a8b86a2c7cb2fcbe65a675c7a02b48 +Subproject commit 16bd05495c407a1e07934f9cff60517e3047512d From dd43b7299e4ececda874726bbaf551f3a6effbef Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Sun, 12 Feb 2023 21:01:28 -0800 Subject: [PATCH 270/280] remove migrate to and from thrifty methods Summary: switch state is now in thrift format. it is no longer required to support these methods. also tests working on old JSON formats are removed. the old JSON format support is no longer needed Reviewed By: peygar Differential Revision: D43147544 fbshipit-source-id: c317eee81cfbf076a0192d57d8d445df387be25a --- fboss/agent/state/AclEntry.cpp | 36 -- fboss/agent/state/AclEntry.h | 2 - .../ForwardingInformationBaseContainer.cpp | 19 - .../ForwardingInformationBaseContainer.h | 2 - fboss/agent/state/LoadBalancer.cpp | 12 - fboss/agent/state/LoadBalancer.h | 2 - fboss/agent/state/MatchAction.cpp | 29 -- fboss/agent/state/MatchAction.h | 2 - fboss/agent/state/Mirror.cpp | 62 ---- fboss/agent/state/Mirror.h | 2 - fboss/agent/state/NeighborResponseTable.h | 13 - fboss/agent/state/QcmConfig.cpp | 32 -- fboss/agent/state/QcmConfig.h | 2 - fboss/agent/state/QosPolicy.cpp | 76 ---- fboss/agent/state/QosPolicy.h | 2 - fboss/agent/state/Route.cpp | 36 -- fboss/agent/state/Route.h | 3 - fboss/agent/state/RouteNextHopEntry.cpp | 45 --- fboss/agent/state/RouteNextHopEntry.h | 3 - fboss/agent/state/RouteNextHopsMulti.cpp | 25 -- fboss/agent/state/RouteNextHopsMulti.h | 2 - fboss/agent/state/RouteTypes.cpp | 26 -- fboss/agent/state/RouteTypes.h | 2 - fboss/agent/state/SflowCollector.cpp | 20 - fboss/agent/state/SflowCollector.h | 2 - fboss/agent/state/SwitchSettings.cpp | 73 ---- fboss/agent/state/SwitchSettings.h | 2 - fboss/agent/state/Thrifty.h | 80 +--- fboss/agent/state/Transceiver.cpp | 19 - fboss/agent/state/Vlan.cpp | 39 -- fboss/agent/state/Vlan.h | 2 - .../state/tests/LabelForwardingEntryTests.cpp | 347 ------------------ fboss/agent/state/tests/QcmConfigTests.cpp | 81 ---- .../agent/state/tests/SwitchSettingsTests.cpp | 28 -- 34 files changed, 6 insertions(+), 1122 deletions(-) diff --git a/fboss/agent/state/AclEntry.cpp b/fboss/agent/state/AclEntry.cpp index c196dfda30fd5..ac16cdf554b4b 100644 --- a/fboss/agent/state/AclEntry.cpp +++ b/fboss/agent/state/AclEntry.cpp @@ -191,42 +191,6 @@ AclEntryFields AclEntryFields::fromThrift(state::AclEntryFields const& entry) { return aclEntryFields; } -// TODO: remove all migration along with old ser/des after next disruptive push -folly::dynamic AclEntryFields::migrateToThrifty(const folly::dynamic& dyn) { - folly::dynamic newDyn = dyn; - - // rename IpType -> ipType just for thrift name convention - ThriftyUtils::renameField(newDyn, kIpType, "ipType"); - - ThriftyUtils::changeEnumToInt(newDyn, kIpFrag); - ThriftyUtils::changeEnumToInt(newDyn, kLookupClassL2); - ThriftyUtils::changeEnumToInt(newDyn, kLookupClass); - ThriftyUtils::changeEnumToInt( - newDyn, kLookupClassNeighbor); - ThriftyUtils::changeEnumToInt(newDyn, kLookupClassRoute); - ThriftyUtils::changeEnumToInt(newDyn, kActionType); - if (auto it = newDyn.find(kAclAction); it != newDyn.items().end()) { - it->second = MatchAction::migrateToThrifty(it->second); - } - - return newDyn; -} - -void AclEntryFields::migrateFromThrifty(folly::dynamic& dyn) { - ThriftyUtils::renameField(dyn, "ipType", kIpType); - - ThriftyUtils::changeEnumToString(dyn, kIpFrag); - ThriftyUtils::changeEnumToString(dyn, kLookupClassL2); - ThriftyUtils::changeEnumToString(dyn, kLookupClass); - ThriftyUtils::changeEnumToString( - dyn, kLookupClassNeighbor); - ThriftyUtils::changeEnumToString(dyn, kLookupClassRoute); - ThriftyUtils::changeEnumToString(dyn, kActionType); - if (auto it = dyn.find(kAclAction); it != dyn.items().end()) { - MatchAction::migrateFromThrifty(it->second); - } -} - folly::dynamic AclEntryFields::toFollyDynamicLegacy() const { folly::dynamic aclEntry = folly::dynamic::object; if (srcIp.first) { diff --git a/fboss/agent/state/AclEntry.h b/fboss/agent/state/AclEntry.h index a929ec44cf279..218861c40fffa 100644 --- a/fboss/agent/state/AclEntry.h +++ b/fboss/agent/state/AclEntry.h @@ -99,8 +99,6 @@ struct AclEntryFields state::AclEntryFields toThrift() const override; static AclEntryFields fromThrift(state::AclEntryFields const& ma); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); folly::dynamic toFollyDynamicLegacy() const; static AclEntryFields fromFollyDynamicLegacy(const folly::dynamic& json); diff --git a/fboss/agent/state/ForwardingInformationBaseContainer.cpp b/fboss/agent/state/ForwardingInformationBaseContainer.cpp index 2634e605da674..1c0c564e4d46f 100644 --- a/fboss/agent/state/ForwardingInformationBaseContainer.cpp +++ b/fboss/agent/state/ForwardingInformationBaseContainer.cpp @@ -70,25 +70,6 @@ ForwardingInformationBaseContainerFields::fromThrift( return fibContainer; } -folly::dynamic ForwardingInformationBaseContainerFields::migrateToThrifty( - folly::dynamic const& dyn) { - folly::dynamic newDyn = folly::dynamic::object; - newDyn[kVrf] = dyn[kVrf].asInt(); - newDyn[kFibV4] = - ForwardingInformationBaseV4::LegacyBaseBase::migrateToThrifty( - dyn[kFibV4]); - newDyn[kFibV6] = - ForwardingInformationBaseV6::LegacyBaseBase::migrateToThrifty( - dyn[kFibV6]); - return newDyn; -} - -void ForwardingInformationBaseContainerFields::migrateFromThrifty( - folly::dynamic& dyn) { - ForwardingInformationBaseV4::LegacyBaseBase::migrateFromThrifty(dyn[kFibV4]); - ForwardingInformationBaseV6::LegacyBaseBase::migrateFromThrifty(dyn[kFibV6]); -} - ForwardingInformationBaseContainer::ForwardingInformationBaseContainer( RouterID vrf) { set(vrf); diff --git a/fboss/agent/state/ForwardingInformationBaseContainer.h b/fboss/agent/state/ForwardingInformationBaseContainer.h index 7bbbd479efac2..ed36e02ed5f7b 100644 --- a/fboss/agent/state/ForwardingInformationBaseContainer.h +++ b/fboss/agent/state/ForwardingInformationBaseContainer.h @@ -38,8 +38,6 @@ struct ForwardingInformationBaseContainerFields state::FibContainerFields toThrift() const override; static ForwardingInformationBaseContainerFields fromThrift( state::FibContainerFields const& fields); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); bool operator==(const ForwardingInformationBaseContainerFields& other) const { ForwardingInformationBaseV4 emptyV4{}; diff --git a/fboss/agent/state/LoadBalancer.cpp b/fboss/agent/state/LoadBalancer.cpp index 23ac115282d01..c9e54f172be86 100644 --- a/fboss/agent/state/LoadBalancer.cpp +++ b/fboss/agent/state/LoadBalancer.cpp @@ -305,18 +305,6 @@ LoadBalancerFields LoadBalancerFields::fromThrift( return fields; } -folly::dynamic LoadBalancerFields::migrateToThrifty(folly::dynamic const& dyn) { - folly::dynamic obj = dyn; - auto seed = static_cast(obj["seed"].asInt()); - obj["seed"] = seed; - return obj; -} - -void LoadBalancerFields::migrateFromThrifty(folly::dynamic& dyn) { - auto seed = dyn["seed"].asInt(); - dyn["seed"] = static_cast(seed); -} - std::shared_ptr LoadBalancer::fromThrift( const state::LoadBalancerFields& fields) { return std::make_shared(fields); diff --git a/fboss/agent/state/LoadBalancer.h b/fboss/agent/state/LoadBalancer.h index 22c35406b87a7..4d3dbc19267de 100644 --- a/fboss/agent/state/LoadBalancer.h +++ b/fboss/agent/state/LoadBalancer.h @@ -41,8 +41,6 @@ struct LoadBalancerFields state::LoadBalancerFields toThrift() const override; static LoadBalancerFields fromThrift(state::LoadBalancerFields const& fields); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); LoadBalancerFields( LoadBalancerID id, diff --git a/fboss/agent/state/MatchAction.cpp b/fboss/agent/state/MatchAction.cpp index e4d5e2bd24f14..8aee2205469db 100644 --- a/fboss/agent/state/MatchAction.cpp +++ b/fboss/agent/state/MatchAction.cpp @@ -92,35 +92,6 @@ MatchAction MatchAction::fromThrift(state::MatchAction const& ma) { return matchAction; } -// TODO: remove all migration along with old ser/des after next disruptive push -folly::dynamic MatchAction::migrateToThrifty(const folly::dynamic& dyn) { - folly::dynamic newDyn = dyn; - - if (auto it = newDyn.find(kQueueMatchAction); it != newDyn.items().end()) { - const auto action = it->second; - newDyn[kThriftSendToQueue] = folly::dynamic::object; - newDyn[kThriftSendToQueue][kThriftSendToCPU] = action[kSendToCPU].asBool(); - newDyn[kThriftSendToQueue][kThriftAction] = action; - } - ThriftyUtils::renameField(newDyn, kCounter, kThriftTrafficCounter); - ThriftyUtils::renameField(newDyn, kSetDscpMatchAction, kThriftSetDscp); - ThriftyUtils::renameField(newDyn, kToCpuAction, kThriftToCpuAction); - - return newDyn; -} - -void MatchAction::migrateFromThrifty(folly::dynamic& dyn) { - if (auto it = dyn.find(kThriftSendToQueue); it != dyn.items().end()) { - const auto action = it->second[kThriftAction]; - const auto sendToCPU = it->second[kThriftSendToCPU]; - dyn[kQueueMatchAction] = action; - dyn[kQueueMatchAction][kSendToCPU] = sendToCPU; - } - ThriftyUtils::renameField(dyn, kThriftTrafficCounter, kCounter); - ThriftyUtils::renameField(dyn, kThriftSetDscp, kSetDscpMatchAction); - ThriftyUtils::renameField(dyn, kThriftToCpuAction, kToCpuAction); -} - folly::dynamic MatchAction::toFollyDynamic() const { folly::dynamic matchAction = folly::dynamic::object; if (sendToQueue_) { diff --git a/fboss/agent/state/MatchAction.h b/fboss/agent/state/MatchAction.h index 0dfc2dbd5c3fa..b1a3945b3250e 100644 --- a/fboss/agent/state/MatchAction.h +++ b/fboss/agent/state/MatchAction.h @@ -167,8 +167,6 @@ class MatchAction { state::MatchAction toThrift() const; static MatchAction fromThrift(state::MatchAction const& ma); - static folly::dynamic migrateToThrifty(const folly::dynamic& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); folly::dynamic toFollyDynamic() const; static MatchAction fromFollyDynamic(const folly::dynamic& actionJson); diff --git a/fboss/agent/state/Mirror.cpp b/fboss/agent/state/Mirror.cpp index 17d05f71b1e8e..4216dc2177b53 100644 --- a/fboss/agent/state/Mirror.cpp +++ b/fboss/agent/state/Mirror.cpp @@ -299,68 +299,6 @@ MirrorFields MirrorFields::fromThrift(state::MirrorFields const& fields) { return MirrorFields(fields); } -folly::dynamic MirrorFields::migrateToThrifty(folly::dynamic const& dyn) { - folly::dynamic newDyn = dyn; - if (newDyn.find(kSrcIp) != newDyn.items().end()) { - ThriftyUtils::translateTo(newDyn[kSrcIp]); - } - if (newDyn.find(kDestinationIp) != newDyn.items().end()) { - if (!newDyn[kDestinationIp].empty()) { - ThriftyUtils::translateTo( - newDyn[kDestinationIp]); - } else { - newDyn.erase(kDestinationIp); - } - } - if (dyn.find(kEgressPort) != dyn.items().end()) { - if (!dyn[kEgressPort].empty()) { - newDyn[kEgressPort] = dyn[kEgressPort].asInt(); - } else { - newDyn.erase(kEgressPort); - } - } - if (newDyn.find(kTunnel) != newDyn.items().end()) { - if (!newDyn[kTunnel].empty()) { - ThriftyUtils::translateTo( - newDyn[kTunnel][kSrcIp]); - ThriftyUtils::translateTo( - newDyn[kTunnel][kDstIp]); - } else { - newDyn.erase(kTunnel); - } - } - return newDyn; -} - -void MirrorFields::migrateFromThrifty(folly::dynamic& dyn) { - bool isResolved = true; // span - if (dyn.find(kSrcIp) != dyn.items().end()) { - ThriftyUtils::translateTo(dyn[kSrcIp]); - } - if (dyn.find(kDestinationIp) != dyn.items().end()) { - // erspan or sflow - isResolved = false; - ThriftyUtils::translateTo(dyn[kDestinationIp]); - } else { - dyn[kDestinationIp] = folly::dynamic::object; - } - if (dyn.find(kTunnel) != dyn.items().end()) { - ThriftyUtils::translateTo(dyn[kTunnel][kSrcIp]); - ThriftyUtils::translateTo(dyn[kTunnel][kDstIp]); - // erspan or sflow is resolved - isResolved = true; - } else { - dyn[kTunnel] = folly::dynamic::object; - } - if (dyn.find(kEgressPort) != dyn.items().end()) { - dyn[kEgressPort] = - folly::to(static_cast(dyn[kEgressPort].asInt())); - } else { - dyn[kEgressPort] = folly::dynamic::object; - } - dyn[kIsResolved] = isResolved; -} - template class ThriftStructNode; } // namespace facebook::fboss diff --git a/fboss/agent/state/Mirror.h b/fboss/agent/state/Mirror.h index 00070fe2942fb..d68adaf093fc8 100644 --- a/fboss/agent/state/Mirror.h +++ b/fboss/agent/state/Mirror.h @@ -235,8 +235,6 @@ struct MirrorFields : public ThriftyFields { static MirrorFields fromFollyDynamicLegacy(const folly::dynamic& dyn); state::MirrorFields toThrift() const override; static MirrorFields fromThrift(state::MirrorFields const& fields); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); }; USE_THRIFT_COW(Mirror); diff --git a/fboss/agent/state/NeighborResponseTable.h b/fboss/agent/state/NeighborResponseTable.h index 9c8cbf3fd9ba1..552a82c1e7f95 100644 --- a/fboss/agent/state/NeighborResponseTable.h +++ b/fboss/agent/state/NeighborResponseTable.h @@ -83,19 +83,6 @@ class NeighborResponseTable NeighborResponseTable() {} - static folly::dynamic migrateToThrifty(const folly::dynamic& dyn) { - folly::dynamic newItems = folly::dynamic::object; - for (auto item : dyn.items()) { - // inject key into node for ThriftyNodeMapT to find - item.second[NeighborResponseTableThriftTraits:: - getThriftKeyName()] = item.first; - newItems[item.first] = item.second; - } - return newItems; - } - - static void migrateFromThrifty(folly::dynamic& /* dyn */) {} - std::shared_ptr getEntry(AddressType ip) const { return this->getNodeIf(ip.str()); } diff --git a/fboss/agent/state/QcmConfig.cpp b/fboss/agent/state/QcmConfig.cpp index b6bffcaf3bb67..c9be11eafc6f6 100644 --- a/fboss/agent/state/QcmConfig.cpp +++ b/fboss/agent/state/QcmConfig.cpp @@ -155,38 +155,6 @@ QcmCfgFields QcmCfgFields::fromFollyDynamicLegacy(const folly::dynamic& json) { return qcmCfgFields; } -folly::dynamic QcmCfgFields::migrateToThrifty(folly::dynamic const& dyn) { - folly::dynamic newDyn = dyn; - auto toIpPrefix = [](const std::string& s) { - folly::CIDRNetwork cidr = folly::IPAddress::createNetwork(s, -1, false); - auto prefix = ThriftyUtils::toIpPrefix(cidr); - std::string jsonStr; - apache::thrift::SimpleJSONSerializer::serialize(prefix, &jsonStr); - return folly::parseJson(jsonStr); - }; - auto dstIp = dyn["collectorDstIp"].asString(); - auto srcIp = dyn["collectorSrcIp"].asString(); - newDyn["collectorDstIp"] = toIpPrefix(dstIp); - newDyn["collectorSrcIp"] = toIpPrefix(srcIp); - return newDyn; -} - -void QcmCfgFields::migrateFromThrifty(folly::dynamic& dyn) { - auto fromIpPrefix = [](folly::dynamic& prefix) { - auto jsonStr = folly::toJson(prefix); - auto inBuf = - folly::IOBuf::wrapBufferAsValue(jsonStr.data(), jsonStr.size()); - auto obj = apache::thrift::SimpleJSONSerializer::deserialize( - folly::io::Cursor{&inBuf}); - auto cidr = ThriftyUtils::toCIDRNetwork(obj); - return folly::IPAddress::networkToString(cidr); - }; - auto dstIp = dyn["collectorDstIp"]; - auto srcIp = dyn["collectorSrcIp"]; - dyn["collectorDstIp"] = fromIpPrefix(dstIp); - dyn["collectorSrcIp"] = fromIpPrefix(srcIp); -} - template class ThriftStructNode; } // namespace facebook::fboss diff --git a/fboss/agent/state/QcmConfig.h b/fboss/agent/state/QcmConfig.h index 7e54315de1e4b..bd283fdf88b13 100644 --- a/fboss/agent/state/QcmConfig.h +++ b/fboss/agent/state/QcmConfig.h @@ -161,8 +161,6 @@ struct QcmCfgFields : public ThriftyFields { bool operator!=(const QcmCfgFields& other) const { return !(data() == other.data()); } - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); }; USE_THRIFT_COW(QcmCfg); diff --git a/fboss/agent/state/QosPolicy.cpp b/fboss/agent/state/QosPolicy.cpp index 1f974b8eb4b52..2fcdc695cff52 100644 --- a/fboss/agent/state/QosPolicy.cpp +++ b/fboss/agent/state/QosPolicy.cpp @@ -31,51 +31,6 @@ constexpr auto kPgId = "pgId"; constexpr auto kPfcPriorityToPgId = "pfcPriorityToPgId"; constexpr auto kAttr = "attr"; -void follyAttributeMapToThrifty( - folly::dynamic& newDyn, - const std::string& map, - const std::string& qosAttr) { - if (newDyn.find(map) != newDyn.items().end()) { - auto& follyMap = newDyn[map]; - if (follyMap.find(kFrom) != newDyn.items().end()) { - auto& mapFrom = follyMap[kFrom]; - for (auto& entry : mapFrom) { - facebook::fboss::ThriftyUtils::stringToInt(entry, kTrafficClass); - facebook::fboss::ThriftyUtils::stringToInt(entry, qosAttr); - facebook::fboss::ThriftyUtils::renameField(entry, qosAttr, kAttr); - } - } - if (follyMap.find(kTo) != newDyn.items().end()) { - auto& mapTo = follyMap[kTo]; - for (auto& entry : mapTo) { - facebook::fboss::ThriftyUtils::stringToInt(entry, kTrafficClass); - facebook::fboss::ThriftyUtils::stringToInt(entry, qosAttr); - facebook::fboss::ThriftyUtils::renameField(entry, qosAttr, kAttr); - } - } - } -} - -void thriftyAttributeMapToFolly( - folly::dynamic& dyn, - const std::string& map, - const std::string& qosAttr) { - if (dyn.find(map) != dyn.items().end()) { - auto& thriftyMap = dyn[map]; - if (thriftyMap.find(kFrom) != dyn.items().end()) { - auto& mapFrom = thriftyMap[kFrom]; - for (auto& entry : mapFrom) { - facebook::fboss::ThriftyUtils::renameField(entry, kAttr, qosAttr); - } - } - if (thriftyMap.find(kTo) != dyn.items().end()) { - auto& mapTo = thriftyMap[kTo]; - for (auto& entry : mapTo) { - facebook::fboss::ThriftyUtils::renameField(entry, kAttr, qosAttr); - } - } - } -} } // namespace namespace facebook::fboss { @@ -143,37 +98,6 @@ QosPolicyFields QosPolicyFields::fromThrift( return fields; } -folly::dynamic QosPolicyFields::migrateToThrifty(folly::dynamic const& dyn) { - folly::dynamic newDyn = dyn; - - follyAttributeMapToThrifty(newDyn, kDscpMap, kDscp); - follyAttributeMapToThrifty(newDyn, kExpMap, kExp); - - ThriftyUtils::follyArraytoThriftyMap( - newDyn, kTrafficClassToQueueId, kTrafficClass, kQueueId); - ThriftyUtils::follyArraytoThriftyMap( - newDyn, kPfcPriorityToQueueId, kPfcPriority, kQueueId); - ThriftyUtils::follyArraytoThriftyMap( - newDyn, kTrafficClassToPgId, kTrafficClass, kPgId); - ThriftyUtils::follyArraytoThriftyMap( - newDyn, kPfcPriorityToPgId, kPfcPriority, kPgId); - return newDyn; -} - -void QosPolicyFields::migrateFromThrifty(folly::dynamic& dyn) { - thriftyAttributeMapToFolly(dyn, kDscpMap, kDscp); - thriftyAttributeMapToFolly(dyn, kExpMap, kExp); - - ThriftyUtils::thriftyMapToFollyArray( - dyn, kTrafficClassToQueueId, kTrafficClass, kQueueId); - ThriftyUtils::thriftyMapToFollyArray( - dyn, kPfcPriorityToQueueId, kPfcPriority, kQueueId); - ThriftyUtils::thriftyMapToFollyArray( - dyn, kTrafficClassToPgId, kTrafficClass, kPgId); - ThriftyUtils::thriftyMapToFollyArray( - dyn, kPfcPriorityToPgId, kPfcPriority, kPgId); -} - folly::dynamic QosPolicyFields::toFollyDynamicLegacy() const { folly::dynamic qosPolicy = folly::dynamic::object; qosPolicy[kName] = *data().name(); diff --git a/fboss/agent/state/QosPolicy.h b/fboss/agent/state/QosPolicy.h index 372d67ba1301c..79797867fb8fd 100644 --- a/fboss/agent/state/QosPolicy.h +++ b/fboss/agent/state/QosPolicy.h @@ -127,8 +127,6 @@ struct QosPolicyFields } static QosPolicyFields fromThrift( state::QosPolicyFields const& qosPolicyFields); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); folly::dynamic toFollyDynamicLegacy() const; static QosPolicyFields fromFollyDynamicLegacy( const folly::dynamic& qosPolicy); diff --git a/fboss/agent/state/Route.cpp b/fboss/agent/state/Route.cpp index 9e857e4cf95a3..3234973187e10 100644 --- a/fboss/agent/state/Route.cpp +++ b/fboss/agent/state/Route.cpp @@ -165,42 +165,6 @@ void RouteFields::delEntryForClient(ClientID clientId) { clientId, *(this->writableData().nexthopsmulti())); } -template -folly::dynamic RouteFields::migrateToThrifty(folly::dynamic const& dyn) { - folly::dynamic newDyn = folly::dynamic::object; - if constexpr (std::is_same_v) { - newDyn["label"] = - RouteFields::Prefix::migrateToThrifty(dyn[kPrefix]); - } else { - newDyn["prefix"] = - RouteFields::Prefix::migrateToThrifty(dyn[kPrefix]); - } - newDyn["nexthopsmulti"] = - LegacyRouteNextHopsMulti::migrateToThrifty(dyn[kNextHopsMulti]); - newDyn["fwd"] = RouteNextHopEntry::migrateToThrifty(dyn[kFwdInfo]); - newDyn["flags"] = dyn[kFlags].asInt(); - if (dyn.find(kClassID) != dyn.items().end()) { - newDyn["classID"] = dyn[kClassID].asInt(); - } - return newDyn; -} - -template -void RouteFields::migrateFromThrifty(folly::dynamic& dyn) { - if constexpr (std::is_same_v) { - ThriftyUtils::renameField(dyn, "label", std::string(kPrefix)); - } - RouteFields::Prefix::migrateFromThrifty(dyn[kPrefix]); - ThriftyUtils::renameField(dyn, "nexthopsmulti", std::string(kNextHopsMulti)); - ThriftyUtils::renameField(dyn, "fwd", std::string(kFwdInfo)); - LegacyRouteNextHopsMulti::migrateFromThrifty(dyn[kNextHopsMulti]); - RouteNextHopEntry::migrateFromThrifty(dyn[kFwdInfo]); - dyn[kFlags] = dyn["flags"].asInt(); - if (dyn.find("classID") != dyn.items().end()) { - dyn[kClassID] = dyn["classID"].asInt(); - } -} - template ThriftFieldsT RouteFields::getRouteFields( const PrefixT& prefix, diff --git a/fboss/agent/state/Route.h b/fboss/agent/state/Route.h index d1b6aaad80b48..2da2008002da4 100644 --- a/fboss/agent/state/Route.h +++ b/fboss/agent/state/Route.h @@ -163,9 +163,6 @@ struct RouteFields return RouteFields(fields); } - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); - void clearFlags() { this->writableData().flags() = 0; } diff --git a/fboss/agent/state/RouteNextHopEntry.cpp b/fboss/agent/state/RouteNextHopEntry.cpp index 4bc4d1582191f..9f86d67cc4446 100644 --- a/fboss/agent/state/RouteNextHopEntry.cpp +++ b/fboss/agent/state/RouteNextHopEntry.cpp @@ -709,51 +709,6 @@ void RouteNextHopEntry::normalizeNextHopWeightsToMaxPaths( } } -folly::dynamic RouteNextHopEntry::migrateToThrifty(folly::dynamic const& dyn) { - folly::dynamic newDyn = dyn; - auto action = dyn[kAction].asString(); - newDyn[kAction] = folly::to(str2ForwardAction(action)); - RouteNextHopSet nhops{}; - std::vector nexthops{}; - for (auto& nhop : dyn[kNexthops]) { - nexthops.emplace_back(util::nextHopFromFollyDynamic(nhop)); - } - nhops.insert(std::begin(nexthops), std::end(nexthops)); - folly::dynamic nhopsDynamic = folly::dynamic::array; - auto nhopsThrift = util::fromRouteNextHopSet(nhops); - for (auto& nhop : nhopsThrift) { - std::string jsonStr; - apache::thrift::SimpleJSONSerializer::serialize(nhop, &jsonStr); - nhopsDynamic.push_back(folly::parseJson(jsonStr)); - } - newDyn[kNexthops] = nhopsDynamic; - return newDyn; -} - -void RouteNextHopEntry::migrateFromThrifty(folly::dynamic& dyn) { - auto action = static_cast(dyn[kAction].asInt()); - dyn[kAction] = forwardActionStr(action); - folly::dynamic nhopsDynamic = folly::dynamic::array; - if (dyn.find(kNexthops) != dyn.items().end()) { - std::vector nhopsThrift{}; - - for (auto& nhop : dyn[kNexthops]) { - auto jsonStr = folly::toJson(nhop); - auto inBuf = - folly::IOBuf::wrapBufferAsValue(jsonStr.data(), jsonStr.size()); - auto nhopThrift = - apache::thrift::SimpleJSONSerializer::deserialize( - folly::io::Cursor{&inBuf}); - nhopsThrift.push_back(nhopThrift); - } - auto nhops = util::toRouteNextHopSet(nhopsThrift, true); - for (auto& nhop : nhops) { - nhopsDynamic.push_back(nhop.toFollyDynamic()); - } - } - dyn[kNexthops] = nhopsDynamic; -} - state::RouteNextHopEntry RouteNextHopEntry::getRouteNextHopEntryThrift( Action action, AdminDistance distance, diff --git a/fboss/agent/state/RouteNextHopEntry.h b/fboss/agent/state/RouteNextHopEntry.h index d6ed8bd7d4132..24e93a8b56050 100644 --- a/fboss/agent/state/RouteNextHopEntry.h +++ b/fboss/agent/state/RouteNextHopEntry.h @@ -192,9 +192,6 @@ class RouteNextHopEntry std::vector& nhWeights, uint64_t normalizedPathCount); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); - private: static state::RouteNextHopEntry getRouteNextHopEntryThrift( Action action, diff --git a/fboss/agent/state/RouteNextHopsMulti.cpp b/fboss/agent/state/RouteNextHopsMulti.cpp index a72940fe10af1..097f142ff5379 100644 --- a/fboss/agent/state/RouteNextHopsMulti.cpp +++ b/fboss/agent/state/RouteNextHopsMulti.cpp @@ -115,31 +115,6 @@ RouteNextHopsMulti::getBestEntry() const { return RouteNextHopsMulti::getBestEntry(toThrift()); } -folly::dynamic LegacyRouteNextHopsMulti::migrateToThrifty( - folly::dynamic const& dyn) { - folly::dynamic newDyn = folly::dynamic::dynamic::object; - folly::dynamic client2NextHopEntryDyn = folly::dynamic::object; - auto multi = fromFollyDynamicLegacy(dyn); - for (auto [key, value] : dyn.items()) { - client2NextHopEntryDyn[key] = RouteNextHopEntry::migrateToThrifty(value); - } - newDyn["client2NextHopEntry"] = client2NextHopEntryDyn; - newDyn["lowestAdminDistanceClientId"] = - static_cast(multi->lowestAdminDistanceClientId()); - return newDyn; -} - -void LegacyRouteNextHopsMulti::migrateFromThrifty(folly::dynamic& dyn) { - for (auto [key, value] : dyn["client2NextHopEntry"].items()) { - auto clientID = key.asString(); - auto multiDynamic = value; - RouteNextHopEntry::migrateFromThrifty(multiDynamic); - dyn[clientID] = multiDynamic; - } - dyn.erase("client2NextHopEntry"); - dyn.erase("lowestAdminDistanceClientId"); -} - std::pair> RouteNextHopsMulti::getBestEntry( const state::RouteNextHopsMulti& nexthopsmulti) { diff --git a/fboss/agent/state/RouteNextHopsMulti.h b/fboss/agent/state/RouteNextHopsMulti.h index f779a5681679b..6b365946845e2 100644 --- a/fboss/agent/state/RouteNextHopsMulti.h +++ b/fboss/agent/state/RouteNextHopsMulti.h @@ -67,8 +67,6 @@ struct LegacyRouteNextHopsMulti : public ThriftyFields< static std::shared_ptr fromFollyDynamicLegacy( folly::dynamic const& dyn); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); }; /** diff --git a/fboss/agent/state/RouteTypes.cpp b/fboss/agent/state/RouteTypes.cpp index 608e130bc15cc..3a680bc02a29f 100644 --- a/fboss/agent/state/RouteTypes.cpp +++ b/fboss/agent/state/RouteTypes.cpp @@ -131,32 +131,6 @@ RoutePrefix RoutePrefix::fromThrift( return RoutePrefix(thriftPrefix); } -template -folly::dynamic RoutePrefix::migrateToThrifty(folly::dynamic const& dyn) { - folly::dynamic newDyn = dyn; - auto addr = ThriftyUtils::toThriftBinaryAddress(dyn[kAddress]); - // byte is represented as signed char in thrift - signed char mask = static_cast(dyn[kMask].asInt()); - newDyn["prefix"] = ThriftyUtils::toFollyDynamic(addr); - if constexpr (std::is_same_v) { - newDyn["v6"] = network::toIPAddress(addr).isV6(); - } else { - newDyn["v6"] = std::is_same_v; - } - newDyn["mask"] = mask; - return newDyn; -} -template -void RoutePrefix::migrateFromThrifty(folly::dynamic& dyn) { - auto ip = ThriftyUtils::toFollyIPAddress(dyn["prefix"]); - dyn[kAddress] = ThriftyUtils::toFollyDynamic(ip); - // convert signed char / byte to unsigned int - uint8_t mask = static_cast(dyn[kMask].asInt()); - dyn[kMask] = mask; - dyn.erase("prefix"); - dyn.erase("v6"); -} - Label Label::fromFollyDynamicLegacy(const folly::dynamic& prefixJson) { return Label( getLabelThrift(static_cast(prefixJson[kLabel].asInt()))); diff --git a/fboss/agent/state/RouteTypes.h b/fboss/agent/state/RouteTypes.h index 1dd2800053f59..ebecb33c35603 100644 --- a/fboss/agent/state/RouteTypes.h +++ b/fboss/agent/state/RouteTypes.h @@ -68,8 +68,6 @@ struct RoutePrefix state::RoutePrefix toThrift() const override; static RoutePrefix fromThrift(const state::RoutePrefix& prefix); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); /* * Serialize to folly::dynamic diff --git a/fboss/agent/state/SflowCollector.cpp b/fboss/agent/state/SflowCollector.cpp index 1274957f71ba6..5eaeceec9334a 100644 --- a/fboss/agent/state/SflowCollector.cpp +++ b/fboss/agent/state/SflowCollector.cpp @@ -29,26 +29,6 @@ SflowCollectorFields SflowCollectorFields::fromThrift( *sflowCollectorThrift.address()->port()); } -folly::dynamic SflowCollectorFields::migrateToThrifty( - const folly::dynamic& dyn) { - folly::dynamic newDyn = folly::dynamic::object; - auto host = dyn[kIp].asString(); - auto port = dyn[kPort].asInt(); - newDyn[kId] = folly::to(host, ":", port); - - folly::dynamic socketAddress = folly::dynamic::object; - socketAddress[kHost] = host; - socketAddress[kPort] = port; - newDyn[kAddress] = socketAddress; - - return newDyn; -} - -void SflowCollectorFields::migrateFromThrifty(folly::dynamic& dyn) { - dyn[kIp] = dyn[kAddress][kHost]; - dyn[kPort] = dyn[kAddress][kPort]; -} - folly::dynamic SflowCollectorFields::toFollyDynamicLegacy() const { folly::dynamic collector = folly::dynamic::object; collector[kIp] = *data().address()->host(); diff --git a/fboss/agent/state/SflowCollector.h b/fboss/agent/state/SflowCollector.h index 301b664c0d4f6..c1fce483483b6 100644 --- a/fboss/agent/state/SflowCollector.h +++ b/fboss/agent/state/SflowCollector.h @@ -42,8 +42,6 @@ struct SflowCollectorFields } static SflowCollectorFields fromThrift( state::SflowCollectorFields const& sflowCollectorThrift); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); folly::dynamic toFollyDynamicLegacy() const; static SflowCollectorFields fromFollyDynamicLegacy( const folly::dynamic& sflowCollectorJson); diff --git a/fboss/agent/state/SwitchSettings.cpp b/fboss/agent/state/SwitchSettings.cpp index 951dfa6dc9814..a24db7cf23340 100644 --- a/fboss/agent/state/SwitchSettings.cpp +++ b/fboss/agent/state/SwitchSettings.cpp @@ -216,79 +216,6 @@ SwitchSettingsFields SwitchSettingsFields::fromThrift( return settings; } -folly::dynamic SwitchSettingsFields::migrateToThrifty( - folly::dynamic const& dynLegacy) { - folly::dynamic newDynamic = dynLegacy; - - folly::dynamic blockedNeighborsDynamic = folly::dynamic::array; - for (auto neighborDynLegacy : dynLegacy["blockNeighbors"]) { - auto addr = facebook::network::toBinaryAddress( - folly::IPAddress(neighborDynLegacy["blockNeighborIP"].asString())); - - std::string jsonStr; - apache::thrift::SimpleJSONSerializer::serialize(addr, &jsonStr); - folly::dynamic neighborDyn = folly::dynamic::object; - neighborDyn["blockNeighborIP"] = folly::parseJson(jsonStr); - neighborDyn["blockNeighborVlanID"] = - static_cast(neighborDynLegacy["blockNeighborVlanID"].asInt()); - - blockedNeighborsDynamic.push_back(neighborDyn); - } - newDynamic["blockNeighbors"] = blockedNeighborsDynamic; - - folly::dynamic macAddrsToBlockDynamic = folly::dynamic::array; - if (dynLegacy.find("macAddrsToBlock") != dynLegacy.items().end()) { - for (auto macDynLegacy : dynLegacy["macAddrsToBlock"]) { - folly::dynamic macDyn = folly::dynamic::object; - - macDyn["macAddrToBlockVlanID"] = - static_cast(macDynLegacy["macAddrToBlockVlanID"].asInt()); - macDyn["macAddrToBlockAddr"] = - macDynLegacy["macAddrToBlockAddr"].asString(); - macAddrsToBlockDynamic.push_back(macDyn); - } - } - - newDynamic["macAddrsToBlock"] = macAddrsToBlockDynamic; - return newDynamic; -} - -void SwitchSettingsFields::migrateFromThrifty(folly::dynamic& dyn) { - folly::dynamic& blockedNeighborsDynamic = dyn["blockNeighbors"]; - folly::dynamic& blockedMacAddrsDynamic = dyn["macAddrsToBlock"]; - - folly::dynamic blockedNeighborsLegacy = folly::dynamic::array; - for (auto& neighborDyn : blockedNeighborsDynamic) { - auto vlan = - static_cast(neighborDyn["blockNeighborVlanID"].asInt()); - auto jsonStr = folly::toJson(neighborDyn["blockNeighborIP"]); - auto inBuf = - folly::IOBuf::wrapBufferAsValue(jsonStr.data(), jsonStr.size()); - auto addr = facebook::network::toIPAddress( - apache::thrift::SimpleJSONSerializer::deserialize< - facebook::network::thrift::BinaryAddress>( - folly::io::Cursor{&inBuf})); - - folly::dynamic blockedNeighborLegacy = folly::dynamic::object; - neighborDyn["blockNeighborIP"] = addr.str(); - neighborDyn["blockNeighborVlanID"] = vlan; - } - - for (auto& macDyn : blockedMacAddrsDynamic) { - auto vlan = static_cast(macDyn["macAddrToBlockVlanID"].asInt()); - macDyn["macAddrToBlockVlanID"] = vlan; - } - - // Temporarily not dumping this field in folly dynamic. See - // https://fb.workplace.com/groups/1015730552263827/permalink/1452005081969703/ - // for more details. - // TODO(zecheng): remove this after the config is available in prod. - auto exactMatchSP = folly::StringPiece("exactMatchTableConfigs"); - if (dyn.find(exactMatchSP) != dyn.items().end()) { - dyn.erase(exactMatchSP); - } -} - template class ThriftStructNode; } // namespace facebook::fboss diff --git a/fboss/agent/state/SwitchSettings.h b/fboss/agent/state/SwitchSettings.h index 97adb47b8675d..d758ef0afd5e6 100644 --- a/fboss/agent/state/SwitchSettings.h +++ b/fboss/agent/state/SwitchSettings.h @@ -32,8 +32,6 @@ struct SwitchSettingsFields state::SwitchSettingsFields toThrift() const override; static SwitchSettingsFields fromThrift( state::SwitchSettingsFields const& fields); - static folly::dynamic migrateToThrifty(folly::dynamic const& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); bool operator==(const SwitchSettingsFields& other) const { return std::tie( diff --git a/fboss/agent/state/Thrifty.h b/fboss/agent/state/Thrifty.h index 55ef1712d4246..43ff4a4ba148f 100644 --- a/fboss/agent/state/Thrifty.h +++ b/fboss/agent/state/Thrifty.h @@ -149,7 +149,8 @@ class ThriftyUtils { static bool nodeNeedsMigration(const folly::dynamic& dyn) { return !dyn.isObject() || - !dyn.getDefault(kThriftySchemaUpToDate, false).asBool(); + !dyn.getDefault(kThriftySchemaUpToDate, true /* migrated to thrift */) + .asBool(); } // given folly dynamic of ip, return binary address @@ -258,25 +259,16 @@ template class ThriftyFields { public: using ThriftType = ThriftT; + using FieldsT = Derived; + ThriftyFields() {} explicit ThriftyFields(const ThriftT& data) : data_(data) {} virtual ~ThriftyFields() = default; - // migrateTo does not modify dyn so we don't have to change the call sites of - // fromFollyDynamic, migrateFrom does not have this limitation - static folly::dynamic migrateToThrifty(const folly::dynamic& dyn) { - return dyn; - } - static void migrateFromThrifty(folly::dynamic& dyn) { - dyn[ThriftyUtils::kThriftySchemaUpToDate] = true; - } - - using FieldsT = Derived; - static FieldsT fromFollyDynamic(folly::dynamic const& dyn) { if (ThriftyUtils::nodeNeedsMigration(dyn)) { - return fromJson(folly::toJson(FieldsT::migrateToThrifty(dyn))); + XLOG(FATAL) << "incomptaible schema detected"; } else { // Schema is up to date meaning there is no migration required return fromJson(folly::toJson(dyn)); @@ -285,7 +277,6 @@ class ThriftyFields { folly::dynamic toFollyDynamic() const { auto dyn = folly::parseJson(this->str()); - FieldsT::migrateFromThrifty(dyn); return dyn; } @@ -358,7 +349,7 @@ class ThriftyNodeMapT : public NodeMapT { static std::shared_ptr fromFollyDynamic(folly::dynamic const& dyn) { if (ThriftyUtils::nodeNeedsMigration(dyn)) { - return fromFollyDynamicImpl(NodeMap::migrateToThrifty(dyn)); + XLOG(FATAL) << "Incompatible schema detected"; } else { // Schema is up to date meaning there is not migration required return fromFollyDynamicImpl(dyn); @@ -400,68 +391,9 @@ class ThriftyNodeMapT : public NodeMapT { apache::thrift::SimpleJSONSerializer::serialize(val, &jsonStr); dyn[folly::to(key)] = folly::parseJson(jsonStr); } - NodeMap::migrateFromThrifty(dyn); return dyn; } - /* - * Old style NodeMapT serlization has the nodes in a list but with thrift we - * can probably just encode a map directly. So in thrift we'll use the name - * "items" instead of "entries and to migrate we'll duplicate the data as a - * list under "entries" and a map under "items" - */ - static folly::dynamic migrateToThrifty(const folly::dynamic& dyn) { - folly::dynamic newItems = folly::dynamic::object; - auto* entries = getEntries(dyn); - for (auto& item : *entries) { - if (ThriftyUtils::nodeNeedsMigration(item)) { - auto key = ThriftyTraitsT::template getKeyFromLegacyNode( - item, ThriftyTraitsT::getThriftKeyName()); - if constexpr (!kIsThriftCowNode) { - newItems[key] = TraitsT::Node::Fields::migrateToThrifty(item); - } else { - newItems[key] = TraitsT::Node::LegacyFields::migrateToThrifty(item); - } - } else { - newItems[item[ThriftyTraitsT::getThriftKeyName()].asString()] = item; - } - } - return newItems; - } - - static void migrateFromThrifty(folly::dynamic& dyn) { - auto schemaUpToDate = true; - folly::dynamic entries = folly::dynamic::array; - std::set keys{}; - - for (auto& item : dyn.items()) { - // dyn.items() is an uordered map and the order in which items are - // returned is underterministic. enforce the order, so entries are always - // in the same order. - keys.insert(item.first.asString()); - } - - for (auto key : keys) { - auto& item = dyn[key]; - if constexpr (!kIsThriftCowNode) { - TraitsT::Node::Fields::migrateFromThrifty(item); - } else { - TraitsT::Node::LegacyFields::migrateFromThrifty(item); - } - if (!item.getDefault(ThriftyUtils::kThriftySchemaUpToDate, false) - .asBool()) { - schemaUpToDate = false; - } - entries.push_back(item); - } - - dyn[kEntries] = entries; - // TODO: fill out extra fields as needed - dyn[kExtraFields] = folly::dynamic::object; - - dyn[ThriftyUtils::kThriftySchemaUpToDate] = schemaUpToDate; - } - // for testing purposes. These are mirrors of to/from FollyDynamic defined in // NodeMap, but calling the legacy conversions of the node as well folly::dynamic toFollyDynamicLegacy() const { diff --git a/fboss/agent/state/Transceiver.cpp b/fboss/agent/state/Transceiver.cpp index 21e776acb8d2f..fa5c5c25b6342 100644 --- a/fboss/agent/state/Transceiver.cpp +++ b/fboss/agent/state/Transceiver.cpp @@ -34,25 +34,6 @@ TransceiverSpecFields TransceiverSpecFields::fromThrift( return tcvrFields; } -folly::dynamic TransceiverSpecFields::migrateToThrifty( - const folly::dynamic& dyn) { - folly::dynamic newDyn = dyn; - - ThriftyUtils::changeEnumToInt(newDyn, kMediaInterface); - ThriftyUtils::changeEnumToInt( - newDyn, kManagementInterface); - - return newDyn; -} - -void TransceiverSpecFields::migrateFromThrifty(folly::dynamic& dyn) { - ThriftyUtils::changeEnumToString( - dyn, kMediaInterface); - ThriftyUtils::changeEnumToString< - facebook::fboss::TransceiverManagementInterface>( - dyn, kManagementInterface); -} - folly::dynamic TransceiverSpecFields::toFollyDynamicLegacy() const { folly::dynamic tcvr = folly::dynamic::object; auto thriftData = data(); diff --git a/fboss/agent/state/Vlan.cpp b/fboss/agent/state/Vlan.cpp index aaf122d4ef3ff..fabdef50f17ae 100644 --- a/fboss/agent/state/Vlan.cpp +++ b/fboss/agent/state/Vlan.cpp @@ -206,45 +206,6 @@ VlanFields VlanFields::fromFollyDynamicLegacy(const folly::dynamic& vlanJson) { return vlan; } -folly::dynamic VlanFields::migrateToThrifty(const folly::dynamic& dyn) { - folly::dynamic newDyn = dyn; - - // memberPorts used to be a map but changing this to - // map since the tagged field is the only thing in PortInfo. - // renaming to "port" so we can support both for backwards compatibility - folly::dynamic newPorts = folly::dynamic::object(); - for (const auto& [portId, info] : newDyn[kMemberPorts].items()) { - auto portInfo = PortInfo::fromFollyDynamic(info); - newPorts[portId] = portInfo.tagged; - } - newDyn["ports"] = newPorts; - newDyn[kArpTable] = - ArpTable::LegacyBaseT::migrateToThrifty(newDyn[kArpTable]); - newDyn[kNdpTable] = - NdpTable::LegacyBaseT::migrateToThrifty(newDyn[kNdpTable]); - newDyn[kArpResponseTable] = - ArpResponseTable::migrateToThrifty(newDyn[kArpResponseTable]); - newDyn[kNdpResponseTable] = - NdpResponseTable::migrateToThrifty(newDyn[kNdpResponseTable]); - newDyn[kMacTable] = - MacTable::LegacyBaseT::migrateToThrifty(newDyn[kMacTable]); - return newDyn; -} -void VlanFields::migrateFromThrifty(folly::dynamic& dyn) { - folly::dynamic legacyMemberPorts = folly::dynamic::object(); - for (const auto& [portId, tagged] : dyn["ports"].items()) { - auto portInfo = PortInfo(tagged.asBool()); - legacyMemberPorts[portId] = portInfo.toFollyDynamic(); - } - dyn[kMemberPorts] = legacyMemberPorts; - - ArpTable::LegacyBaseT::migrateFromThrifty(dyn[kArpTable]); - NdpTable::LegacyBaseT::migrateFromThrifty(dyn[kNdpTable]); - ArpResponseTable::migrateFromThrifty(dyn[kArpResponseTable]); - NdpResponseTable::migrateFromThrifty(dyn[kNdpResponseTable]); - MacTable::LegacyBaseT::migrateFromThrifty(dyn[kMacTable]); -} - bool VlanFields::operator==(const VlanFields& o) const { return std::tie( id, diff --git a/fboss/agent/state/Vlan.h b/fboss/agent/state/Vlan.h index 101e39bcf4d1e..2dc18d5a97706 100644 --- a/fboss/agent/state/Vlan.h +++ b/fboss/agent/state/Vlan.h @@ -74,8 +74,6 @@ struct VlanFields : public ThriftyFields { state::VlanFields toThrift() const override; static VlanFields fromThrift(const state::VlanFields& vlanTh); - static folly::dynamic migrateToThrifty(const folly::dynamic& dyn); - static void migrateFromThrifty(folly::dynamic& dyn); folly::dynamic toFollyDynamicLegacy() const; static VlanFields fromFollyDynamicLegacy(const folly::dynamic& vlanJson); diff --git a/fboss/agent/state/tests/LabelForwardingEntryTests.cpp b/fboss/agent/state/tests/LabelForwardingEntryTests.cpp index 69643b57e0ef2..a1ce956d7aa35 100644 --- a/fboss/agent/state/tests/LabelForwardingEntryTests.cpp +++ b/fboss/agent/state/tests/LabelForwardingEntryTests.cpp @@ -44,353 +44,6 @@ TEST(LabelForwardingEntryTests, ToFromDynamic) { } } -TEST(LabelForwardingEntryTests, fromJsonOldFormat) { - // Old format. client entries have interface id always - std::string jsonOldFormatEntryType = R"( - { - "labelNextHop": { - "action": "Nexthops", - "adminDistance": 10, - "nexthops": [ - { - "interface": 2002, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "fe80::d8c4:97ff:fed0:5b14", - "weight": "0" - }, - { - "interface": 2096, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "2401::d8c4:97ff:fed0:5b14", - "weight": "0" - } - ] - }, - "labelNextHopMulti": { - "786": { - "action": "Nexthops", - "adminDistance": 10, - "nexthops": [ - { - "interface": 2002, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "fe80::d8c4:97ff:fed0:5b14", - "weight": "0" - }, - { - "interface": 2096, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "2401::d8c4:97ff:fed0:5b14", - "weight": "0" - } - ] - } - }, - "topLabel": 1001 - })"; - - FLAGS_mpls_rib = false; - auto oldFormatNoRibEntry = - LabelForwardingInformationBase::labelEntryFromFollyDynamic( - folly::parseJson(jsonOldFormatEntryType)); - auto oldFormatJsonWritten = - LabelForwardingInformationBase::toFollyDynamicOldFormat( - oldFormatNoRibEntry); - EXPECT_EQ(folly::parseJson(jsonOldFormatEntryType), oldFormatJsonWritten); - // new format with no rib has interface id in client entries always - std::string jsonNewFormatNoRibEntryType = R"( - { - "flags": 2, - "forwardingInfo": { - "action": "Nexthops", - "adminDistance": 10, - "nexthops": [ - { - "interface": 2002, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "fe80::d8c4:97ff:fed0:5b14", - "weight": "0" - }, - { - "interface": 2096, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "2401::d8c4:97ff:fed0:5b14", - "weight": "0" - } - ] - }, - "fwd": { - "action": 2, - "adminDistance": 10, - "nexthops": [ - { - "address": { - "addr": "/oAAAAAAAADYxJf//tBbFA", - "ifName": "fboss2002" - }, - "mplsAction": { - "action": 2 - }, - "weight": 0 - }, - { - "address": { - "addr": "JAEAAAAAAADYxJf//tBbFA", - "ifName": "fboss2096" - }, - "mplsAction": { - "action": 2 - }, - "weight": 0 - } - ] - }, - "label": { - "value": 1001 - }, - "nexthopsmulti": { - "client2NextHopEntry": { - "786": { - "action": 2, - "adminDistance": 10, - "nexthops": [ - { - "address": { - "addr": "/oAAAAAAAADYxJf//tBbFA", - "ifName": "fboss2002" - }, - "mplsAction": { - "action": 2 - }, - "weight": 0 - }, - { - "address": { - "addr": "JAEAAAAAAADYxJf//tBbFA", - "ifName": "fboss2096" - }, - "mplsAction": { - "action": 2 - }, - "weight": 0 - } - ] - } - }, - "lowestAdminDistanceClientId": 786 - }, - "prefix": { - "label": 1001 - }, - "rib": { - "786": { - "action": "Nexthops", - "adminDistance": 10, - "nexthops": [ - { - "interface": 2002, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "fe80::d8c4:97ff:fed0:5b14", - "weight": "0" - }, - { - "interface": 2096, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "2401::d8c4:97ff:fed0:5b14", - "weight": "0" - } - ] - } - } -} - )"; - auto newFormatNoRibEntry = - LabelForwardingInformationBase::labelEntryFromFollyDynamic( - folly::parseJson(jsonNewFormatNoRibEntryType)); - // ensure that old and new format creates same entry with mpls rib disabled - EXPECT_TRUE(newFormatNoRibEntry->isSame(oldFormatNoRibEntry.get())); - - // ensure that encode/decode in new format creates same entry - EXPECT_EQ( - folly::parseJson(jsonNewFormatNoRibEntryType), - newFormatNoRibEntry->toFollyDynamic()); - - FLAGS_mpls_rib = true; - // Interface id present only in fwd and not in client entries - // for non link local entries - std::string jsonRibEnabledNewFormatEntryType = R"( - { - "flags": 2, - "forwardingInfo": { - "action": "Nexthops", - "adminDistance": 10, - "nexthops": [ - { - "interface": 2002, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "fe80::d8c4:97ff:fed0:5b14", - "weight": "0" - }, - { - "interface": 2096, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "2401::d8c4:97ff:fed0:5b14", - "weight": "0" - } - ] - }, - "fwd": { - "action": 2, - "adminDistance": 10, - "nexthops": [ - { - "address": { - "addr": "/oAAAAAAAADYxJf//tBbFA", - "ifName": "fboss2002" - }, - "mplsAction": { - "action": 2 - }, - "weight": 0 - }, - { - "address": { - "addr": "JAEAAAAAAADYxJf//tBbFA", - "ifName": "fboss2096" - }, - "mplsAction": { - "action": 2 - }, - "weight": 0 - } - ] - }, - "label": { - "value": 1001 - }, - "nexthopsmulti": { - "client2NextHopEntry": { - "786": { - "action": 2, - "adminDistance": 10, - "nexthops": [ - { - "address": { - "addr": "JAEAAAAAAADYxJf//tBbFA" - }, - "mplsAction": { - "action": 2 - }, - "weight": 0 - }, - { - "address": { - "addr": "/oAAAAAAAADYxJf//tBbFA", - "ifName": "fboss2002" - }, - "mplsAction": { - "action": 2 - }, - "weight": 0 - } - ] - } - }, - "lowestAdminDistanceClientId": 786 - }, - "prefix": { - "label": 1001 - }, - "rib": { - "786": { - "action": "Nexthops", - "adminDistance": 10, - "nexthops": [ - { - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "2401::d8c4:97ff:fed0:5b14", - "weight": "0" - }, - { - "interface": 2002, - "label_forwarding_action": { - "type": 2 - }, - "nexthop": "fe80::d8c4:97ff:fed0:5b14", - "weight": "0" - } - ] - } - } -} - )"; - - auto newRibEntry = LabelForwardingInformationBase::labelEntryFromFollyDynamic( - folly::parseJson(jsonRibEnabledNewFormatEntryType)); - // Reparse the old format entry with RIB enabled - auto oldFormatRibEntry = - LabelForwardingInformationBase::labelEntryFromFollyDynamic( - folly::parseJson(jsonOldFormatEntryType)); - - // ensure that old and new format creates same entry with mpls rib enabled - EXPECT_TRUE(newRibEntry->isSame(oldFormatRibEntry.get())); - - // parse the new format entry with RIB enabled - auto newFormatRibEntry = - LabelForwardingInformationBase::labelEntryFromFollyDynamic( - folly::parseJson(jsonRibEnabledNewFormatEntryType)); - // ensure that old and new format creates same entry with mpls rib enabled - EXPECT_TRUE(newFormatRibEntry->isSame(oldFormatRibEntry.get())); - - // ensure that encode and decode in new format with rib creates same entry - EXPECT_EQ( - folly::parseJson(jsonRibEnabledNewFormatEntryType), - newRibEntry->toFollyDynamic()); - - auto oldFormatRibJsonWritten = - LabelForwardingInformationBase::toFollyDynamicOldFormat(newRibEntry); - - auto newFormatRibJsonWritten = newRibEntry->toFollyDynamic(); - - // check for mpls rib disable case - FLAGS_mpls_rib = false; - auto noRibEntry = LabelForwardingInformationBase::labelEntryFromFollyDynamic( - oldFormatRibJsonWritten); - EXPECT_TRUE(noRibEntry->isSame(oldFormatRibEntry.get())); - oldFormatRibEntry = - LabelForwardingInformationBase::labelEntryFromFollyDynamic( - folly::parseJson(jsonOldFormatEntryType)); - // Entries won't be same due to difference in interface id in client entries - EXPECT_FALSE(noRibEntry->isSame(oldFormatRibEntry.get())); - - auto noRibEntryNewFormat = - LabelForwardingInformationBase::labelEntryFromFollyDynamic( - newFormatRibJsonWritten); - EXPECT_TRUE(noRibEntry->isSame(noRibEntryNewFormat.get())); -} - TEST(LabelForwardingEntryTests, getEntryForClient) { std::map> clientNextHopsEntry{ diff --git a/fboss/agent/state/tests/QcmConfigTests.cpp b/fboss/agent/state/tests/QcmConfigTests.cpp index f00e80ca5bc74..8d709163b1aca 100644 --- a/fboss/agent/state/tests/QcmConfigTests.cpp +++ b/fboss/agent/state/tests/QcmConfigTests.cpp @@ -121,87 +121,6 @@ TEST(QcmConfigTest, applyConfig) { EXPECT_FALSE(state3->getQcmCfg()); } -TEST(QcmConfigTest, ToFromJSON) { - std::string jsonStr = R"( - { - "agingIntervalInMsecs": 10, - "numFlowSamplesPerView": 10, - "flowLimit": 10, - "numFlowsClear": 10, - "scanIntervalInUsecs": 10, - "exportThreshold": 10, - "flowWeights": { - "0": 1, - "1": 2, - "2": 3 - }, - "collectorDstIp": "11::01/128", - "collectorSrcPort": 1000, - "collectorDscp": 20, - "ppsToQcm": 1000, - "collectorSrcIp" : "10::01/128", - "monitorQcmPortList": [ - 112, - 113, - 114 - ], - "port2QosQueueIds": { - "10": [ - 0, - 1, - 2, - 3 - ], - "11": [ - 4, - 5, - 6, - 7 - ] - }, - "monitorQcmCfgPortsOnly": true - } - )"; - auto fields = QcmCfgFields::fromFollyDynamic(folly::parseJson(jsonStr)); - auto qcmCfg = std::make_shared(fields.toThrift()); - EXPECT_EQ(10, qcmCfg->getAgingInterval()); - EXPECT_EQ(10, qcmCfg->getNumFlowSamplesPerView()); - EXPECT_EQ(10, qcmCfg->getFlowLimit()); - EXPECT_EQ(10, qcmCfg->getNumFlowsClear()); - EXPECT_EQ(10, qcmCfg->getScanIntervalInUsecs()); - EXPECT_EQ(10, qcmCfg->getExportThreshold()); - EXPECT_TRUE(qcmCfg->getMonitorQcmCfgPortsOnly()); - - int initPortId = 10; - int initQosQueueId = 0; - const auto& port2QosQueueIds = qcmCfg->getPort2QosQueueIdMap(); - auto port2QosQueueIdsThrift = port2QosQueueIds->toThrift(); - for (const auto& perPortQosQueueIds : port2QosQueueIdsThrift) { - EXPECT_EQ(perPortQosQueueIds.first, initPortId++); - for (const auto& qosQueueId : perPortQosQueueIds.second) { - EXPECT_EQ(qosQueueId, initQosQueueId++); - } - } - - int weightKeyValues = 0; - int weightDataValues = 1; - for (const auto weight : std::as_const(*qcmCfg->getFlowWeightMap())) { - EXPECT_EQ(weight.first, weightKeyValues++); - EXPECT_EQ(weight.second, weightDataValues++); - } - EXPECT_EQ( - folly::CIDRNetwork(folly::IPAddress("11::01"), 128), - qcmCfg->getCollectorDstIp()); - EXPECT_EQ(1000, qcmCfg->getCollectorSrcPort()); - EXPECT_EQ(20, qcmCfg->getCollectorDscp()); - EXPECT_EQ(1000, qcmCfg->getPpsToQcm()); - EXPECT_EQ( - folly::CIDRNetwork(folly::IPAddress("10::01"), 128), - qcmCfg->getCollectorSrcIp()); - auto portList = qcmCfg->getMonitorQcmPortList(); - EXPECT_EQ(portList->size(), 3); -} - // Intent of this test is to enable QCM, modify an // unrelated switch setting such as l2 learn mode and // ensure that QCM setings are preserved diff --git a/fboss/agent/state/tests/SwitchSettingsTests.cpp b/fboss/agent/state/tests/SwitchSettingsTests.cpp index 8dcd5c225f62e..400b337720c64 100644 --- a/fboss/agent/state/tests/SwitchSettingsTests.cpp +++ b/fboss/agent/state/tests/SwitchSettingsTests.cpp @@ -217,34 +217,6 @@ TEST(SwitchSettingsTest, applyMacAddrsToBlock) { macAddrToBlock.macAddress()); } -TEST(SwitchSettingsTest, ToFromJSON) { - std::string jsonStr = R"( - { - "l2LearningMode": 1, - "qcmEnable": true, - "ptpTcEnable": true, - "l2AgeTimerSeconds": 600, - "maxRouteCounterIDs": 10, - "blockNeighbors": [], - "macAddrsToBlock": [], - "switchType": 0 - } - )"; - - auto switchSettings = - SwitchSettings::fromFollyDynamic(folly::parseJson(jsonStr)); - EXPECT_EQ(cfg::L2LearningMode::SOFTWARE, switchSettings->getL2LearningMode()); - EXPECT_TRUE(switchSettings->isQcmEnable()); - EXPECT_TRUE(switchSettings->isPtpTcEnable()); - EXPECT_EQ(600, switchSettings->getL2AgeTimerSeconds()); - EXPECT_EQ(10, switchSettings->getMaxRouteCounterIDs()); - - auto dyn1 = switchSettings->toFollyDynamic(); - auto dyn2 = folly::parseJson(jsonStr); - - EXPECT_EQ(dyn1, dyn2); -} - TEST(SwitchSettingsTest, ThrifyMigration) { folly::IPAddress ip("1.1.1.1"); auto addr = facebook::network::toBinaryAddress(ip); From 43e179d3941975c5e22f3f11a0bcb32122f745de Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Sun, 12 Feb 2023 21:01:28 -0800 Subject: [PATCH 271/280] delete ThriftyNodeMapT class Summary: as titled. this is now obsolete and not required and not used. Reviewed By: peygar Differential Revision: D43147559 fbshipit-source-id: af0f1ddf71ea68a44502f3577b48edeeef9e1c68 --- fboss/agent/state/ForwardingInformationBase.h | 5 - .../state/LabelForwardingInformationBase.h | 4 - fboss/agent/state/MacTable.h | 2 - fboss/agent/state/NeighborResponseTable.h | 5 - fboss/agent/state/NeighborTable.h | 4 - fboss/agent/state/Thrifty.h | 145 ------------------ 6 files changed, 165 deletions(-) diff --git a/fboss/agent/state/ForwardingInformationBase.h b/fboss/agent/state/ForwardingInformationBase.h index 235aa6894315a..6c11f689633bd 100644 --- a/fboss/agent/state/ForwardingInformationBase.h +++ b/fboss/agent/state/ForwardingInformationBase.h @@ -68,11 +68,6 @@ class ForwardingInformationBase ForwardingInformationBase() {} virtual ~ForwardingInformationBase() override {} - using LegacyBaseBase = ThriftyNodeMapT< - ForwardingInformationBase, - LegacyForwardingInformationBaseTraits, - ForwardingInformationBaseThriftTraits>; - using Base = ThriftMapNode< ForwardingInformationBase, ForwardingInformationBaseTraits>; diff --git a/fboss/agent/state/LabelForwardingInformationBase.h b/fboss/agent/state/LabelForwardingInformationBase.h index c235e9ec097ef..1463eacf41119 100644 --- a/fboss/agent/state/LabelForwardingInformationBase.h +++ b/fboss/agent/state/LabelForwardingInformationBase.h @@ -51,10 +51,6 @@ class LabelForwardingInformationBase using Base = ThriftMapNode< LabelForwardingInformationBase, LabelForwardingInformationBaseTraits>; - using LegacyBase = ThriftyNodeMapT< - LabelForwardingInformationBase, - LabelForwardingRoute, - LabelForwardingInformationBaseThriftTraits>; public: LabelForwardingInformationBase(); diff --git a/fboss/agent/state/MacTable.h b/fboss/agent/state/MacTable.h index 5f57b71fd1335..0cbcf305c55d7 100644 --- a/fboss/agent/state/MacTable.h +++ b/fboss/agent/state/MacTable.h @@ -56,8 +56,6 @@ using MacTableTraits = ThriftMapNodeTraits< class MacTable : public ThriftMapNode { public: using Base = ThriftMapNode; - using LegacyBaseT = - ThriftyNodeMapT; MacTable(); ~MacTable() override; diff --git a/fboss/agent/state/NeighborResponseTable.h b/fboss/agent/state/NeighborResponseTable.h index 552a82c1e7f95..07a283a5b9405 100644 --- a/fboss/agent/state/NeighborResponseTable.h +++ b/fboss/agent/state/NeighborResponseTable.h @@ -74,11 +74,6 @@ template class NeighborResponseTable : public ThriftMapNode> { public: - using LegacyBaseT = ThriftyNodeMapT< - SUBCLASS, - NeighborResponseTableTraits, - NeighborResponseTableThriftTraits>; - typedef IPADDR AddressType; NeighborResponseTable() {} diff --git a/fboss/agent/state/NeighborTable.h b/fboss/agent/state/NeighborTable.h index 34740f3286121..91e0292d3b3d6 100644 --- a/fboss/agent/state/NeighborTable.h +++ b/fboss/agent/state/NeighborTable.h @@ -79,10 +79,6 @@ template class NeighborTable : public ThriftMapNode> { public: - using LegacyBaseT = ThriftyNodeMapT< - SUBCLASS, - NeighborTableTraits, - NeighborTableThriftTraits>; typedef IPADDR AddressType; typedef ENTRY Entry; diff --git a/fboss/agent/state/Thrifty.h b/fboss/agent/state/Thrifty.h index 43ff4a4ba148f..50bdb31f31723 100644 --- a/fboss/agent/state/Thrifty.h +++ b/fboss/agent/state/Thrifty.h @@ -309,151 +309,6 @@ class ThriftyFields { ThriftT data_; }; -// Base class to convert NodeMaps to thrift -template -class ThriftyNodeMapT : public NodeMapT { - public: - using NodeMapT::NodeMapT; - using NodeT = typename TraitsT::Node; - - using ThriftType = typename ThriftyTraitsT::NodeContainer; - using KeyType = typename TraitsT::KeyType; - - template < - typename T = NodeT, - std::enable_if_t, bool> = true> - static std::shared_ptr fromThrift( - const typename ThriftyTraitsT::NodeContainer& map) { - auto mapObj = std::make_shared(); - - for (auto& node : map) { - auto fieldsObj = TraitsT::Node::Fields::fromThrift(node.second); - mapObj->addNode(std::make_shared(fieldsObj)); - } - return mapObj; - } - - template < - typename T = NodeT, - std::enable_if_t, bool> = true> - static std::shared_ptr fromThrift( - const typename ThriftyTraitsT::NodeContainer& map) { - auto mapObj = std::make_shared(); - - for (auto& node : map) { - mapObj->addNode(std::make_shared(node.second)); - } - - return mapObj; - } - - static std::shared_ptr fromFollyDynamic(folly::dynamic const& dyn) { - if (ThriftyUtils::nodeNeedsMigration(dyn)) { - XLOG(FATAL) << "Incompatible schema detected"; - } else { - // Schema is up to date meaning there is not migration required - return fromFollyDynamicImpl(dyn); - } - } - - static std::shared_ptr fromFollyDynamicImpl( - folly::dynamic const& dyn) { - typename ThriftyTraitsT::NodeContainer mapTh; - for (auto& [key, val] : dyn.items()) { - if (key == kEntries || key == kExtraFields || - key == ThriftyUtils::kThriftySchemaUpToDate) { - continue; - } - auto jsonStr = folly::toJson(val); - auto inBuf = - folly::IOBuf::wrapBufferAsValue(jsonStr.data(), jsonStr.size()); - auto node = apache::thrift::SimpleJSONSerializer::deserialize< - typename ThriftyTraitsT::Node>(folly::io::Cursor{&inBuf}); - mapTh[ThriftyTraitsT::parseKey(key)] = node; - } - return fromThrift(mapTh); - } - - typename ThriftyTraitsT::NodeContainer toThrift() const { - typename ThriftyTraitsT::NodeContainer items; - for (auto& node : *this) { - items[getNodeThriftKey(node)] = node->getFields()->toThrift(); - } - - return items; - } - - folly::dynamic toFollyDynamic() const override final { - auto obj = this->toThrift(); - folly::dynamic dyn = folly::dynamic::object(); - for (auto& [key, val] : obj) { - std::string jsonStr; - apache::thrift::SimpleJSONSerializer::serialize(val, &jsonStr); - dyn[folly::to(key)] = folly::parseJson(jsonStr); - } - return dyn; - } - - // for testing purposes. These are mirrors of to/from FollyDynamic defined in - // NodeMap, but calling the legacy conversions of the node as well - folly::dynamic toFollyDynamicLegacy() const { - folly::dynamic nodesJson = folly::dynamic::array; - for (const auto& node : *this) { - nodesJson.push_back(node->toFollyDynamicLegacy()); - } - folly::dynamic json = folly::dynamic::object; - json[kEntries] = std::move(nodesJson); - // TODO: extra files if needed - json[kExtraFields] = folly::dynamic::object(); - return json; - } - - static std::shared_ptr fromFollyDynamicLegacy( - folly::dynamic const& dyn) { - auto nodeMap = std::make_shared(); - auto entries = dyn[kEntries]; - for (const auto& entry : entries) { - nodeMap->addNode(TraitsT::Node::fromFollyDynamicLegacy(entry)); - } - // TODO: extra files if needed - return nodeMap; - } - - // return node id in the node map as it would be represented in thrift - static typename ThriftyTraitsT::KeyType getNodeThriftKey( - const std::shared_ptr& node) { - return ThriftyTraitsT::convertKey(TraitsT::getKey(node)); - } - - bool operator==( - const ThriftyNodeMapT& rhs) const { - if (this->size() != rhs.size()) { - return false; - } - for (auto& node : *this) { - if (auto other = rhs.getNodeIf(TraitsT::getKey(node)); - !other || *node != *other) { - return false; - } - } - return true; - } - - bool operator!=( - const ThriftyNodeMapT& rhs) const { - return !(*this == rhs); - } - - private: - static const folly::dynamic* getEntries(const folly::dynamic& dyn) { - if (dyn.isArray()) { - return &dyn; - } - CHECK(dyn.isObject()); - return &dyn[kEntries]; - } -}; - template struct ThriftStructNode : public thrift_cow:: From 55352ea7c437c5baca061e60897fe347808f972d Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Sun, 12 Feb 2023 21:01:28 -0800 Subject: [PATCH 272/280] delete ThriftyNodeMapTraits Summary: not required anymore. deleting it. Reviewed By: peygar Differential Revision: D43147585 fbshipit-source-id: cdf2e495bd9c4ea4f8f2e506e51fee742dd3418b --- fboss/agent/state/AclMap.h | 12 ------ fboss/agent/state/BufferPoolConfigMap.h | 11 ----- fboss/agent/state/ForwardingInformationBase.h | 17 -------- .../state/ForwardingInformationBaseMap.h | 12 ------ fboss/agent/state/IpTunnelMap.h | 11 ----- .../state/LabelForwardingInformationBase.h | 16 ------- fboss/agent/state/MacTable.h | 16 ------- fboss/agent/state/NeighborResponseTable.h | 19 --------- fboss/agent/state/NeighborTable.h | 17 -------- fboss/agent/state/PortMap.h | 9 ---- fboss/agent/state/QosPolicyMap.h | 12 ------ fboss/agent/state/SflowCollectorMap.h | 20 --------- fboss/agent/state/TeFlowTable.h | 16 ------- fboss/agent/state/Thrifty.h | 42 ------------------- fboss/agent/state/VlanMap.h | 13 ------ 15 files changed, 243 deletions(-) diff --git a/fboss/agent/state/AclMap.h b/fboss/agent/state/AclMap.h index c6ed4c1d2ae1b..73d58bea03484 100644 --- a/fboss/agent/state/AclMap.h +++ b/fboss/agent/state/AclMap.h @@ -20,18 +20,6 @@ namespace facebook::fboss { using AclMapLegacyTraits = NodeMapTraits; -struct AclMapThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "name"; - return _key; - } - - static const KeyType parseKey(const folly::dynamic& key) { - return key.asString(); - } -}; - using AclMapTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/BufferPoolConfigMap.h b/fboss/agent/state/BufferPoolConfigMap.h index 8effc260a199b..d44ed5aed9138 100644 --- a/fboss/agent/state/BufferPoolConfigMap.h +++ b/fboss/agent/state/BufferPoolConfigMap.h @@ -17,17 +17,6 @@ namespace facebook::fboss { -struct BufferPoolCfgMapThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "id"; - return _key; - } - static const KeyType parseKey(const folly::dynamic& key) { - return key.asString(); - } -}; - using BufferPoolCfgMapTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/ForwardingInformationBase.h b/fboss/agent/state/ForwardingInformationBase.h index 6c11f689633bd..f3984de823d3f 100644 --- a/fboss/agent/state/ForwardingInformationBase.h +++ b/fboss/agent/state/ForwardingInformationBase.h @@ -27,23 +27,6 @@ using LegacyForwardingInformationBaseTraits = NodeMapTraits< NodeMapNoExtraFields, std::map, std::shared_ptr>>>; -template -struct ForwardingInformationBaseThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "prefix"; - return _key; - } - - static const std::string parseKey(const folly::dynamic& key) { - return key.asString(); - } - - static std::string convertKey(const RoutePrefix& prefix) { - return prefix.str(); - } -}; - using ForwardingInformationBaseClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/ForwardingInformationBaseMap.h b/fboss/agent/state/ForwardingInformationBaseMap.h index aa22968305cc5..235a0190418ff 100644 --- a/fboss/agent/state/ForwardingInformationBaseMap.h +++ b/fboss/agent/state/ForwardingInformationBaseMap.h @@ -24,18 +24,6 @@ class SwitchState; using LegacyForwardingInformationBaseMapTraits = NodeMapTraits; -struct ForwardingInformationBaseMapThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "vrf"; - return _key; - } - - static KeyType parseKey(const folly::dynamic& key) { - return key.asInt(); - } -}; - using ForwardingInformationBaseMapClass = apache::thrift::type_class::map< apache::thrift::type_class::integral, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/IpTunnelMap.h b/fboss/agent/state/IpTunnelMap.h index 71aeb2f0f2ecc..e9f389cb888a2 100644 --- a/fboss/agent/state/IpTunnelMap.h +++ b/fboss/agent/state/IpTunnelMap.h @@ -17,17 +17,6 @@ class SwitchState; using IpTunnelMapLegacyTraits = NodeMapTraits; -struct IpTunnelMapThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "ipTunnelId"; - return _key; - } - static const KeyType parseKey(const folly::dynamic& key) { - return key.asString(); - } -}; - using IpTunnelMapClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/LabelForwardingInformationBase.h b/fboss/agent/state/LabelForwardingInformationBase.h index 1463eacf41119..4e70913af6374 100644 --- a/fboss/agent/state/LabelForwardingInformationBase.h +++ b/fboss/agent/state/LabelForwardingInformationBase.h @@ -15,22 +15,6 @@ namespace facebook::fboss { using LabelForwardingRoute = NodeMapTraits; -struct LabelForwardingInformationBaseThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "prefix"; - return _key; - } - - static KeyType parseKey(const folly::dynamic& key) { - return key.asInt(); - } - - static int32_t convertKey(const Label& label) { - return label.value(); - } -}; - using LabelForwardingInformationBaseTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::integral, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/MacTable.h b/fboss/agent/state/MacTable.h index 0cbcf305c55d7..ee64861b93638 100644 --- a/fboss/agent/state/MacTable.h +++ b/fboss/agent/state/MacTable.h @@ -25,22 +25,6 @@ namespace facebook::fboss { using MacTableTraitsLegacy = NodeMapTraits; -struct MacTableThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "mac"; - return _key; - } - - static const KeyType convertKey(const folly::MacAddress& key) { - return key.toString(); - } - - static const KeyType parseKey(const folly::dynamic& key) { - return key.asString(); - } -}; - using MacTableTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/NeighborResponseTable.h b/fboss/agent/state/NeighborResponseTable.h index 07a283a5b9405..002a09113f328 100644 --- a/fboss/agent/state/NeighborResponseTable.h +++ b/fboss/agent/state/NeighborResponseTable.h @@ -31,25 +31,6 @@ struct NeighborResponseTableTraits { } }; -template -struct NeighborResponseTableThriftTraits - : public ThriftyNodeMapTraits< - std::string, - state::NeighborResponseEntryFields> { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "ipAddress"; - return _key; - } - - static const KeyType convertKey(const IPADDR& key) { - return key.str(); - } - - static const KeyType parseKey(const folly::dynamic& key) { - return key.asString(); - } -}; - using NbrResponseTableTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/NeighborTable.h b/fboss/agent/state/NeighborTable.h index 91e0292d3b3d6..76f757a22e9bd 100644 --- a/fboss/agent/state/NeighborTable.h +++ b/fboss/agent/state/NeighborTable.h @@ -36,23 +36,6 @@ struct NeighborTableTraits { } }; -template -struct NeighborTableThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "ipaddress"; - return _key; - } - - static const KeyType convertKey(const IPADDR& key) { - return key.str(); - } - - static const KeyType parseKey(const folly::dynamic& key) { - return key.asString(); - } -}; - using NbrTableTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/PortMap.h b/fboss/agent/state/PortMap.h index 6048f905e94e3..02330cc3e94fa 100644 --- a/fboss/agent/state/PortMap.h +++ b/fboss/agent/state/PortMap.h @@ -19,15 +19,6 @@ namespace facebook::fboss { class SwitchState; class Port; -using PortMapLegacyTraits = NodeMapTraits; - -struct PortMapThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "portId"; - return _key; - } -}; using PortMapTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::integral, diff --git a/fboss/agent/state/QosPolicyMap.h b/fboss/agent/state/QosPolicyMap.h index f2faa04ad2bcf..b2e7cc57fd53e 100644 --- a/fboss/agent/state/QosPolicyMap.h +++ b/fboss/agent/state/QosPolicyMap.h @@ -22,18 +22,6 @@ namespace facebook::fboss { using QosPolicyMapLegacyTraits = NodeMapTraits; -struct QosPolicyMapThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "name"; - return _key; - } - - static const KeyType parseKey(const folly::dynamic& key) { - return key.asString(); - } -}; - using QosPolicyMapTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/SflowCollectorMap.h b/fboss/agent/state/SflowCollectorMap.h index 3287ebba86af9..e83d175924b2d 100644 --- a/fboss/agent/state/SflowCollectorMap.h +++ b/fboss/agent/state/SflowCollectorMap.h @@ -18,26 +18,6 @@ namespace facebook::fboss { -struct SflowCollectorMapThriftTraits - : public ThriftyNodeMapTraits { - static const KeyType parseKey(const folly::dynamic& key) { - return key.asString(); - } - - // unfortunately the primary key "id" of this node was never explicitly - // written in the legacy serialization and instead just built from the other - // members. Need to override how we fetch this key - template - static inline const std::string getKeyFromLegacyNode( - const folly::dynamic& dyn, - const std::string& /* keyName */) { - // folly::to( - // address.getFullyQualified(), ':', address.getPort()); - return folly::to( - dyn["ip"].asString(), ":", dyn["port"].asString()); - } -}; - using SflowCollectorMapTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/TeFlowTable.h b/fboss/agent/state/TeFlowTable.h index 7f2c8cf0aa4f8..4715c03ee6c1b 100644 --- a/fboss/agent/state/TeFlowTable.h +++ b/fboss/agent/state/TeFlowTable.h @@ -19,22 +19,6 @@ class SwitchState; using TeFlowTableTraits = NodeMapTraits; -struct TeFlowTableThriftLegacyTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "flow"; - return _key; - } - static const KeyType parseKey(const folly::dynamic& key) { - return key.asString(); - } - static const KeyType convertKey(const TeFlow& key) { - std::string flowJson; - apache::thrift::SimpleJSONSerializer::serialize(key, &flowJson); - return flowJson; - } -}; - using TeFlowTableTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::string, apache::thrift::type_class::structure>; diff --git a/fboss/agent/state/Thrifty.h b/fboss/agent/state/Thrifty.h index 50bdb31f31723..8538212a9a66b 100644 --- a/fboss/agent/state/Thrifty.h +++ b/fboss/agent/state/Thrifty.h @@ -50,48 +50,6 @@ static constexpr bool kIsThriftCowNode = IsThriftCowNode::value; // All thrift state maps need to have an items field inline constexpr folly::StringPiece kItems{"items"}; -template -struct ThriftyNodeMapTraits : public NodeMapTraits< - ThriftKeyT, - NodeT, - NodeMapNoExtraFields, - std::map> { - static const std::string& getThriftKeyName() { - static const std::string _key = "id"; - return _key; - } - - template - static const std::string getKeyFromLegacyNode( - const folly::dynamic& dyn, - const std::string& keyName) { - auto& legacyKey = dyn[keyName]; - if (legacyKey.isNull() or legacyKey.isArray()) { - throw FbossError("key of map is null or array"); - } - std::string key{}; - if constexpr (!is_fboss_key_object_type::value) { - key = legacyKey.asString(); - } else { - // in cases where key is actually an object we need to convert this to - // proper string representation - key = NodeKeyT::fromFollyDynamicLegacy(legacyKey).str(); - } - return key; - } - - // convert key from cpp version to one thrift will like - template - static const ThriftKeyT convertKey(const NodeKey& key) { - return static_cast(key); - } - - // parse dynamic key into thrift acceptable type - static const ThriftKeyT parseKey(const folly::dynamic& key) { - return key.asInt(); - } -}; - class ThriftyUtils { public: static void renameField( diff --git a/fboss/agent/state/VlanMap.h b/fboss/agent/state/VlanMap.h index 0d816d4b2717e..3c6db5aaf37af 100644 --- a/fboss/agent/state/VlanMap.h +++ b/fboss/agent/state/VlanMap.h @@ -19,19 +19,6 @@ namespace facebook::fboss { class SwitchState; class Vlan; -using VlanMapLegacyTraits = NodeMapTraits< - VlanID, - Vlan, - NodeMapNoExtraFields, - std::map>>; - -struct VlanMapThriftTraits - : public ThriftyNodeMapTraits { - static inline const std::string& getThriftKeyName() { - static const std::string _key = "vlanId"; - return _key; - } -}; using VlanMapTypeClass = apache::thrift::type_class::map< apache::thrift::type_class::integral, From 1130f0bb223ead1717cb93c9e546deb0c74c1216 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Sun, 12 Feb 2023 21:01:28 -0800 Subject: [PATCH 273/280] eliminate storing warm boot state in json format Summary: saving warm boot state in json format is no longer needed. warm boot is now stored in thrift format Reviewed By: peygar Differential Revision: D43130266 fbshipit-source-id: c61c13cfabad69edc5875b16eb8be52d8b8715fb --- fboss/agent/Constants.h | 1 - fboss/agent/hw/bcm/BcmWarmBootCache.cpp | 3 +-- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 3 +-- fboss/agent/hw/test/HwSwitchStateReplayTest.cpp | 9 +-------- fboss/agent/state/SwitchState.cpp | 17 ----------------- fboss/agent/state/SwitchState.h | 17 ----------------- fboss/lib/phy/SaiPhyManager.cpp | 1 - 7 files changed, 3 insertions(+), 48 deletions(-) diff --git a/fboss/agent/Constants.h b/fboss/agent/Constants.h index 028caa7f05634..960c26d3369dd 100644 --- a/fboss/agent/Constants.h +++ b/fboss/agent/Constants.h @@ -50,7 +50,6 @@ inline constexpr folly::StringPiece kRibV6{"ribV6"}; inline constexpr folly::StringPiece kRibMpls{"ribMpls"}; inline constexpr folly::StringPiece kRouterId{"routerId"}; inline constexpr folly::StringPiece kStack{"stack"}; -inline constexpr folly::StringPiece kSwSwitch{"swSwitch"}; inline constexpr folly::StringPiece kTeFlowGroupId{"teFlowGroupId"}; inline constexpr folly::StringPiece kVlan{"vlan"}; inline constexpr folly::StringPiece kVrf{"vrf"}; diff --git a/fboss/agent/hw/bcm/BcmWarmBootCache.cpp b/fboss/agent/hw/bcm/BcmWarmBootCache.cpp index 6c9b4c1c2b518..32658f33e977b 100644 --- a/fboss/agent/hw/bcm/BcmWarmBootCache.cpp +++ b/fboss/agent/hw/bcm/BcmWarmBootCache.cpp @@ -517,8 +517,7 @@ void BcmWarmBootCache::populateFromWarmBootState( dumpedSwSwitchState_ = SwitchState::uniquePtrFromThrift(*thriftState->swSwitchState()); } else { - dumpedSwSwitchState_ = - SwitchState::uniquePtrFromFollyDynamic(warmBootState[kSwSwitch]); + XLOG(FATAL) << "Thrift switch state not found"; } dumpedSwSwitchState_->publish(); CHECK(dumpedSwSwitchState_) diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index 2df62b7dfff8a..e00fecb2cb01e 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -1778,8 +1778,7 @@ HwInitResult SaiSwitch::initLocked( ret.switchState = SwitchState::fromThrift(*switchStateThrift->swSwitchState()); } else { - ret.switchState = - SwitchState::fromFollyDynamic(switchStateJson[kSwSwitch]); + XLOG(FATAL) << "Thrift switch state not found"; } if (platform_->getAsic()->isSupported(HwAsic::Feature::OBJECT_KEY_CACHE)) { adapterKeysJson = std::make_unique( diff --git a/fboss/agent/hw/test/HwSwitchStateReplayTest.cpp b/fboss/agent/hw/test/HwSwitchStateReplayTest.cpp index 13717fd6e3cb6..3359d59a022c3 100644 --- a/fboss/agent/hw/test/HwSwitchStateReplayTest.cpp +++ b/fboss/agent/hw/test/HwSwitchStateReplayTest.cpp @@ -46,15 +46,8 @@ class HwSwitchStateReplayTest : public HwTest { thriftState.read(&reader); return SwitchState::fromThrift(*thriftState.swSwitchState()); } catch (const std::exception& e) { - XLOG(INFO) - << "Failed to parse replay switch state file to thrift. Falling back to json."; + XLOG(FATAL) << "Failed to parse replay switch state file to thrift."; } - - // Failed to parse thrift - fall back to JSON. - std::string warmBootJson( - reinterpret_cast(bytes.data()), bytes.size()); - return SwitchState::fromFollyDynamic( - folly::parseJson(warmBootJson)["swSwitch"]); } // No file was given as input. This would happen when this gets // invoked as part of bcm_test test suite. In which case, just diff --git a/fboss/agent/state/SwitchState.cpp b/fboss/agent/state/SwitchState.cpp index f97cc2bed1beb..f4c4dfde38ead 100644 --- a/fboss/agent/state/SwitchState.cpp +++ b/fboss/agent/state/SwitchState.cpp @@ -761,12 +761,6 @@ void SwitchState::revertNewTeFlowEntry( } } -std::shared_ptr SwitchState::fromFollyDynamic( - const folly::dynamic& json) { - const auto& fields = SwitchStateFields::fromFollyDynamic(json); - return SwitchState::fromThrift(fields.toThrift()); -} - std::unique_ptr SwitchState::uniquePtrFromThrift( const state::SwitchState& switchState) { auto state = std::make_unique(); @@ -790,17 +784,6 @@ std::unique_ptr SwitchState::uniquePtrFromThrift( return state; } -std::unique_ptr SwitchState::uniquePtrFromFollyDynamic( - const folly::dynamic& json) { - const auto& fields = SwitchStateFields::fromFollyDynamic(json); - return uniquePtrFromThrift(fields.toThrift()); -} - -folly::dynamic SwitchState::toFollyDynamic() const { - SwitchStateFields fields(toThrift()); - return fields.toFollyDynamic(); -} - VlanID SwitchState::getDefaultVlan() const { return VlanID(cref()->toThrift()); } diff --git a/fboss/agent/state/SwitchState.h b/fboss/agent/state/SwitchState.h index f9522c8c2a261..71c8bad8d81fa 100644 --- a/fboss/agent/state/SwitchState.h +++ b/fboss/agent/state/SwitchState.h @@ -275,26 +275,9 @@ class SwitchState : public ThriftStructNode { SwitchState(); ~SwitchState() override; - static std::shared_ptr fromFollyDynamic( - const folly::dynamic& json); - - static std::shared_ptr fromJson(const folly::fbstring& jsonStr) { - return fromFollyDynamic(folly::parseJson(jsonStr)); - } - static std::unique_ptr uniquePtrFromThrift( const state::SwitchState& switchState); - static std::unique_ptr uniquePtrFromFollyDynamic( - const folly::dynamic& json); - - static std::unique_ptr uniquePtrFromJson( - const folly::fbstring& jsonStr) { - return uniquePtrFromFollyDynamic(folly::parseJson(jsonStr)); - } - - folly::dynamic toFollyDynamic() const override; - static void modify(std::shared_ptr* state); // Helper function to clone a new SwitchState to modify the original diff --git a/fboss/lib/phy/SaiPhyManager.cpp b/fboss/lib/phy/SaiPhyManager.cpp index f449c5944b9d6..e2b6470fb8cfe 100644 --- a/fboss/lib/phy/SaiPhyManager.cpp +++ b/fboss/lib/phy/SaiPhyManager.cpp @@ -1109,7 +1109,6 @@ void SaiPhyManager::gracefulExit() { // Get the current SwitchState and ThriftState which will be used to call // SaiSwitch::gracefulExit function folly::dynamic follySwitchState = folly::dynamic::object; - follySwitchState[kSwSwitch] = switchState->toFollyDynamic(); state::WarmbootState thriftSwitchState; *thriftSwitchState.swSwitchState() = switchState->toThrift(); saiSwitch->gracefulExit(follySwitchState, thriftSwitchState); From 93567ec575a2d818a00fc69203fc6bdc1a7e4eef Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Mon, 13 Feb 2023 02:50:53 -0800 Subject: [PATCH 274/280] Move PHY SDK capabilities to a separate file Summary: The hw tests need to know if the SDKs support a certain PHY diagnostic or not so that it can then verify the actual support in software. Currently, we are functions in HwSwitch that tell whether these diagnostics are supported by SDK or not. However, these functions need not be in HwSwitch and can be in their standalone files. This diff adds PhyCapabilities.{h,cpp} and the next diff will remove the current functions in HwSwitch and make use of these capabilities Reviewed By: jasmeetbagga Differential Revision: D43222385 fbshipit-source-id: a07c47fbf9d18d2989964ff1ccf1a6bdc5c1d5f6 --- cmake/AgentHwBcmTests.cmake | 9 ++++++++ cmake/AgentHwSaiHwTest.cmake | 15 +++++++++++++ fboss/agent/hw/bcm/tests/PhyCapabilities.cpp | 18 +++++++++++++++ .../agent/hw/sai/hw_test/PhyCapabilities.cpp | 22 +++++++++++++++++++ fboss/agent/hw/test/PhyCapabilities.h | 8 +++++++ 5 files changed, 72 insertions(+) create mode 100644 fboss/agent/hw/bcm/tests/PhyCapabilities.cpp create mode 100644 fboss/agent/hw/sai/hw_test/PhyCapabilities.cpp create mode 100644 fboss/agent/hw/test/PhyCapabilities.h diff --git a/cmake/AgentHwBcmTests.cmake b/cmake/AgentHwBcmTests.cmake index 04fbc24d47b78..31b5fd2827e71 100644 --- a/cmake/AgentHwBcmTests.cmake +++ b/cmake/AgentHwBcmTests.cmake @@ -99,11 +99,20 @@ target_link_libraries(bcm_test sflow_cpp2 packettrace_cpp2 wedge_led_utils + bcm_phy_capabilities Folly::folly ${GTEST} ${LIBGMOCK_LIBRARIES} ) +add_library(bcm_phy_capabilities + fboss/agent/hw/bcm/tests/PhyCapabilities.cpp +) + +target_link_libraries(bcm_phy_capabilities + bcm +) + add_library(bcm_switch_ensemble fboss/agent/hw/bcm/tests/BcmSwitchEnsemble.cpp fboss/agent/hw/bcm/tests/HwSwitchEnsembleFactory.cpp diff --git a/cmake/AgentHwSaiHwTest.cmake b/cmake/AgentHwSaiHwTest.cmake index 4c6cf7d97a6e8..e8bda687fd5ba 100644 --- a/cmake/AgentHwSaiHwTest.cmake +++ b/cmake/AgentHwSaiHwTest.cmake @@ -35,12 +35,26 @@ target_link_libraries(sai_switch_ensemble sai_traced_api ) +add_library(sai_phy_capabilities + fboss/agent/hw/sai/hw_test/PhyCapabilities.cpp +) + +target_link_libraries(sai_phy_capabilities + sai_switch +) + set_target_properties(sai_switch_ensemble PROPERTIES COMPILE_FLAGS "-DSAI_VER_MAJOR=${SAI_VER_MAJOR} \ -DSAI_VER_MINOR=${SAI_VER_MINOR} \ -DSAI_VER_RELEASE=${SAI_VER_RELEASE}" ) +set_target_properties(sai_phy_capabilities PROPERTIES COMPILE_FLAGS + "-DSAI_VER_MAJOR=${SAI_VER_MAJOR} \ + -DSAI_VER_MINOR=${SAI_VER_MINOR} \ + -DSAI_VER_RELEASE=${SAI_VER_RELEASE}" +) + add_library(sai_ecmp_utils fboss/agent/hw/sai/hw_test/HwTestEcmpUtils.cpp ) @@ -165,6 +179,7 @@ function(BUILD_SAI_TEST SAI_IMPL_NAME SAI_IMPL_ARG) -Wl,--whole-archive ${SAI_IMPL_ARG} sai_switch_ensemble + sai_phy_capabilities hw_switch_test hw_test_main -Wl,--no-whole-archive diff --git a/fboss/agent/hw/bcm/tests/PhyCapabilities.cpp b/fboss/agent/hw/bcm/tests/PhyCapabilities.cpp new file mode 100644 index 0000000000000..9581cc912297e --- /dev/null +++ b/fboss/agent/hw/bcm/tests/PhyCapabilities.cpp @@ -0,0 +1,18 @@ +// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. + +#include "fboss/agent/hw/test/PhyCapabilities.h" + +namespace facebook::fboss { + +bool rxSignalDetectSupportedInSdk() { +#if defined(BCM_SDK_VERSION_GTE_6_5_26) + return true; +#endif + return false; +} + +bool rxLockStatusSupportedInSdk() { + return true; +} + +} // namespace facebook::fboss diff --git a/fboss/agent/hw/sai/hw_test/PhyCapabilities.cpp b/fboss/agent/hw/sai/hw_test/PhyCapabilities.cpp new file mode 100644 index 0000000000000..63cb7591fa5f0 --- /dev/null +++ b/fboss/agent/hw/sai/hw_test/PhyCapabilities.cpp @@ -0,0 +1,22 @@ +// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. + +#include "fboss/agent/hw/test/PhyCapabilities.h" +#include "fboss/agent/hw/sai/api/SaiVersion.h" + +namespace facebook::fboss { + +bool rxSignalDetectSupportedInSdk() { +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) + return true; +#endif + return false; +} + +bool rxLockStatusSupportedInSdk() { +#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) + return true; +#endif + return false; +} + +} // namespace facebook::fboss diff --git a/fboss/agent/hw/test/PhyCapabilities.h b/fboss/agent/hw/test/PhyCapabilities.h new file mode 100644 index 0000000000000..aff7f734fc8bb --- /dev/null +++ b/fboss/agent/hw/test/PhyCapabilities.h @@ -0,0 +1,8 @@ +// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. + +#pragma once + +namespace facebook::fboss { +bool rxSignalDetectSupportedInSdk(); +bool rxLockStatusSupportedInSdk(); +} // namespace facebook::fboss From bdf0f23db2773411cc3f6d7759dd0419efae2ea4 Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Mon, 13 Feb 2023 02:50:53 -0800 Subject: [PATCH 275/280] Remove phy capabilities functions in HwSwitch Summary: as titled. Removing the ones in HwSwitch and using the ones defined in PhyCapabilities.{h,cpp} (in previous diff) instead Reviewed By: jasmeetbagga Differential Revision: D43222384 Privacy Context Container: L1125642 fbshipit-source-id: 9cdf709309b06b7c53703f138788f7cdacdff8e6 --- fboss/agent/HwSwitch.h | 9 --------- fboss/agent/hw/bcm/BcmSwitch.cpp | 14 -------------- fboss/agent/hw/bcm/BcmSwitch.h | 2 -- fboss/agent/hw/sai/switch/SaiSwitch.cpp | 14 -------------- fboss/agent/hw/sai/switch/SaiSwitch.h | 3 --- fboss/agent/hw/test/HwPortProfileTests.cpp | 5 +++-- 6 files changed, 3 insertions(+), 44 deletions(-) diff --git a/fboss/agent/HwSwitch.h b/fboss/agent/HwSwitch.h index 702c2637e4554..28eaf4b447fc7 100644 --- a/fboss/agent/HwSwitch.h +++ b/fboss/agent/HwSwitch.h @@ -388,15 +388,6 @@ class HwSwitch { LoadBalancerID loadBalancerID, folly::MacAddress mac) const = 0; - // These functions return true when the SDK supports these diagnostics, not - // necessarily for a particular speed/ASIC - virtual bool rxSignalDetectSupportedInSdk() const { - return false; - } - virtual bool rxLockStatusSupportedInSdk() const { - return false; - } - private: virtual HwInitResult initImpl( Callback* callback, diff --git a/fboss/agent/hw/bcm/BcmSwitch.cpp b/fboss/agent/hw/bcm/BcmSwitch.cpp index 721226a5a4030..4cb800630001a 100644 --- a/fboss/agent/hw/bcm/BcmSwitch.cpp +++ b/fboss/agent/hw/bcm/BcmSwitch.cpp @@ -2737,20 +2737,6 @@ void BcmSwitch::updateGlobalStats() { } } -bool BcmSwitch::rxSignalDetectSupportedInSdk() const { -#if defined(BCM_SDK_VERSION_GTE_6_5_26) - return true; -#endif - return false; -} - -bool BcmSwitch::rxLockStatusSupportedInSdk() const { -#if defined(BCM_SDK_VERSION_GTE_6_5_24) - return true; -#endif - return false; -} - std::map BcmSwitch::updateAllPhyInfo() { return portTable_->updateIPhyInfo(); } diff --git a/fboss/agent/hw/bcm/BcmSwitch.h b/fboss/agent/hw/bcm/BcmSwitch.h index ac134d3053a17..0bc3d1554d210 100644 --- a/fboss/agent/hw/bcm/BcmSwitch.h +++ b/fboss/agent/hw/bcm/BcmSwitch.h @@ -614,8 +614,6 @@ class BcmSwitch : public BcmSwitchIf { std::map getFabricReachability() const override { return {}; } - virtual bool rxSignalDetectSupportedInSdk() const override; - virtual bool rxLockStatusSupportedInSdk() const override; private: enum Flags : uint32_t { diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.cpp b/fboss/agent/hw/sai/switch/SaiSwitch.cpp index e00fecb2cb01e..b17511ad2321a 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.cpp +++ b/fboss/agent/hw/sai/switch/SaiSwitch.cpp @@ -1442,20 +1442,6 @@ void SaiSwitch::updatePcsInfo( sideState.pcs() = pcsState; } -bool SaiSwitch::rxSignalDetectSupportedInSdk() const { -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) - return true; -#endif - return false; -} - -bool SaiSwitch::rxLockStatusSupportedInSdk() const { -#if SAI_API_VERSION >= SAI_VERSION(1, 10, 3) || defined(TAJO_SDK_VERSION_1_42_8) - return true; -#endif - return false; -} - void SaiSwitch::updateRsInfo( phy::PhySideInfo& sideInfo, phy::PhySideState& sideState, diff --git a/fboss/agent/hw/sai/switch/SaiSwitch.h b/fboss/agent/hw/sai/switch/SaiSwitch.h index 039293e193585..f9db0bcd61ab6 100644 --- a/fboss/agent/hw/sai/switch/SaiSwitch.h +++ b/fboss/agent/hw/sai/switch/SaiSwitch.h @@ -203,9 +203,6 @@ class SaiSwitch : public HwSwitch { phy::FecMode getPortFECMode(PortID port) const override; std::map getFabricReachability() const override; - virtual bool rxSignalDetectSupportedInSdk() const override; - virtual bool rxLockStatusSupportedInSdk() const override; - private: void gracefulExitImpl( folly::dynamic& switchState, diff --git a/fboss/agent/hw/test/HwPortProfileTests.cpp b/fboss/agent/hw/test/HwPortProfileTests.cpp index e2c56574cdcee..3d0fb842f0cd2 100644 --- a/fboss/agent/hw/test/HwPortProfileTests.cpp +++ b/fboss/agent/hw/test/HwPortProfileTests.cpp @@ -7,6 +7,7 @@ #include "fboss/lib/phy/PhyUtils.h" #include "fboss/agent/hw/test/ConfigFactory.h" +#include "fboss/agent/hw/test/PhyCapabilities.h" namespace facebook::fboss { template @@ -70,8 +71,8 @@ class HwPortProfileTest : public HwTest { // Start with the expectation that PMD diagnostics are available if // supported by SDK and then exclude certain cases below - bool expectPmdSignalDetect = getHwSwitch()->rxSignalDetectSupportedInSdk(); - bool expectPmdCdrLock = getHwSwitch()->rxLockStatusSupportedInSdk(); + bool expectPmdSignalDetect = rxSignalDetectSupportedInSdk(); + bool expectPmdCdrLock = rxLockStatusSupportedInSdk(); if (getPlatform()->getAsic()->getAsicType() == cfg::AsicType::ASIC_TYPE_TOMAHAWK) { // TH will never support these diagnostics with native or SAI SDKs From 3221169effddd967994f23a8725e7ed04d9cf97e Mon Sep 17 00:00:00 2001 From: Harshit Gulati Date: Mon, 13 Feb 2023 02:50:53 -0800 Subject: [PATCH 276/280] HW Test to verify PCS and FEC Lane diagnostics Summary: as titled. Reviewed By: jasmeetbagga Differential Revision: D43023764 Privacy Context Container: L1125642 fbshipit-source-id: 511b0ad23047950ef5dadfa3049db819dccc7c8e --- fboss/agent/hw/bcm/tests/PhyCapabilities.cpp | 8 +++++++ .../agent/hw/sai/hw_test/PhyCapabilities.cpp | 14 ++++++++++++ fboss/agent/hw/test/HwPortProfileTests.cpp | 22 +++++++++++++++++++ fboss/agent/hw/test/PhyCapabilities.h | 2 ++ 4 files changed, 46 insertions(+) diff --git a/fboss/agent/hw/bcm/tests/PhyCapabilities.cpp b/fboss/agent/hw/bcm/tests/PhyCapabilities.cpp index 9581cc912297e..786a259944134 100644 --- a/fboss/agent/hw/bcm/tests/PhyCapabilities.cpp +++ b/fboss/agent/hw/bcm/tests/PhyCapabilities.cpp @@ -15,4 +15,12 @@ bool rxLockStatusSupportedInSdk() { return true; } +bool pcsRxLinkStatusSupportedInSdk() { + return false; +} + +bool fecAlignmentLockSupportedInSdk() { + return false; +} + } // namespace facebook::fboss diff --git a/fboss/agent/hw/sai/hw_test/PhyCapabilities.cpp b/fboss/agent/hw/sai/hw_test/PhyCapabilities.cpp index 63cb7591fa5f0..ff9fa066c6dd8 100644 --- a/fboss/agent/hw/sai/hw_test/PhyCapabilities.cpp +++ b/fboss/agent/hw/sai/hw_test/PhyCapabilities.cpp @@ -19,4 +19,18 @@ bool rxLockStatusSupportedInSdk() { return false; } +bool pcsRxLinkStatusSupportedInSdk() { +#if defined(TAJO_SDK_VERSION_1_42_8) + return true; +#endif + return false; +} + +bool fecAlignmentLockSupportedInSdk() { +#if defined(TAJO_SDK_VERSION_1_42_8) + return true; +#endif + return false; +} + } // namespace facebook::fboss diff --git a/fboss/agent/hw/test/HwPortProfileTests.cpp b/fboss/agent/hw/test/HwPortProfileTests.cpp index 3d0fb842f0cd2..bb0013a2ca798 100644 --- a/fboss/agent/hw/test/HwPortProfileTests.cpp +++ b/fboss/agent/hw/test/HwPortProfileTests.cpp @@ -80,6 +80,9 @@ class HwPortProfileTest : public HwTest { expectPmdCdrLock = false; } + bool expectPcsRxLinkStatus = pcsRxLinkStatusSupportedInSdk(); + bool expectFecAMLock = fecAlignmentLockSupportedInSdk(); + auto serializedSnapshot = apache::thrift::SimpleJSONSerializer::serialize(phyInfo); XLOG(DBG3) << "Snapshot for port " << portID << " = " << serializedSnapshot; @@ -148,12 +151,31 @@ class HwPortProfileTest : public HwTest { } } + if (expectPcsRxLinkStatus) { + ASSERT_TRUE(lineState.pcs().has_value()); + ASSERT_TRUE(lineState.pcs()->pcsRxStatusLive().has_value()); + ASSERT_TRUE(lineState.pcs()->pcsRxStatusLatched().has_value()); + } + // Verify RsFEC counters if applicable auto isRsFec = utility::isReedSolomonFec(getHwSwitch()->getPortFECMode(portID)); if (isRsFec) { ASSERT_TRUE(lineStats.pcs().has_value()); ASSERT_TRUE(lineStats.pcs()->rsFec().has_value()); + + if (expectFecAMLock) { + ASSERT_TRUE(lineState.pcs().has_value()); + ASSERT_TRUE(lineState.pcs()->rsFecState().has_value()); + ASSERT_TRUE( + lineState.pcs()->rsFecState()->lanes()->size() == + utility::reedSolomonFecLanes(port->getSpeed())); + for (auto fecLane : + *lineState.pcs().ensure().rsFecState().ensure().lanes()) { + ASSERT_TRUE(fecLane.second.fecAlignmentLockLive().has_value()); + ASSERT_TRUE(fecLane.second.fecAlignmentLockChanged().has_value()); + } + } } } diff --git a/fboss/agent/hw/test/PhyCapabilities.h b/fboss/agent/hw/test/PhyCapabilities.h index aff7f734fc8bb..3a7f94524703d 100644 --- a/fboss/agent/hw/test/PhyCapabilities.h +++ b/fboss/agent/hw/test/PhyCapabilities.h @@ -5,4 +5,6 @@ namespace facebook::fboss { bool rxSignalDetectSupportedInSdk(); bool rxLockStatusSupportedInSdk(); +bool pcsRxLinkStatusSupportedInSdk(); +bool fecAlignmentLockSupportedInSdk(); } // namespace facebook::fboss From c211d4483ec20aa5fed4fe3f4fbe6849f96e79c7 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 13 Feb 2023 10:32:06 -0800 Subject: [PATCH 277/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/folly/commit/6ab600f394e71c6c0179f509472e0a77b8baaaa4 Reviewed By: jurajh-fb fbshipit-source-id: 3449fdadbc550749ba6fac318f4655da4f58ede7 --- build/deps/github_hashes/facebook/folly-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/folly-rev.txt b/build/deps/github_hashes/facebook/folly-rev.txt index 992094dc4decb..0d75088ff9875 100644 --- a/build/deps/github_hashes/facebook/folly-rev.txt +++ b/build/deps/github_hashes/facebook/folly-rev.txt @@ -1 +1 @@ -Subproject commit 1c74accaed8e224a7867404822ab58acb70b5c8a +Subproject commit 6ab600f394e71c6c0179f509472e0a77b8baaaa4 From ffb026ca435a97e3de77c7bd8c2a3931bdc9de22 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 13 Feb 2023 12:32:14 -0800 Subject: [PATCH 278/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/cachelib/commit/3938082b33870491299306215ab956bef696620f https://github.com/facebook/fbthrift/commit/30a348cd937c902c2a02050b7e73fcdc5b1f44db Reviewed By: jurajh-fb fbshipit-source-id: 19f09877df44ceb2ea19675ed73bdcf105d07cc0 --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- build/deps/github_hashes/facebook/wangle-rev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index eed4fc57118ff..6e6ae9c124be4 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 399e2f7bdc7fb68cccaa45a4c94b50bc1d15f198 +Subproject commit 30a348cd937c902c2a02050b7e73fcdc5b1f44db diff --git a/build/deps/github_hashes/facebook/wangle-rev.txt b/build/deps/github_hashes/facebook/wangle-rev.txt index 74f32c9cb462a..16d2dd9701c31 100644 --- a/build/deps/github_hashes/facebook/wangle-rev.txt +++ b/build/deps/github_hashes/facebook/wangle-rev.txt @@ -1 +1 @@ -Subproject commit 16bd05495c407a1e07934f9cff60517e3047512d +Subproject commit ae80140abe477d22b3f28211f33efaeec552e152 From b66298f88976c28592c1138d96a77972487c66b2 Mon Sep 17 00:00:00 2001 From: Parvez Shaikh Date: Mon, 13 Feb 2023 13:39:17 -0800 Subject: [PATCH 279/280] fixing broken rib resolution speed benchmark Summary: passing default chunk size, instead of chunk size of 1 i am not sure whats an accurate chunk size, so relying on what's default. this benchmark is currently broken Reviewed By: jasmeetbagga Differential Revision: D43226500 fbshipit-source-id: 7d1013ae1a931e0af8a365b99f43eb659912c3f2 --- fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp b/fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp index 874f4080972e8..715e682a9eb16 100644 --- a/fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp +++ b/fboss/agent/hw/benchmarks/HwRibResolutionBenchmark.cpp @@ -27,7 +27,7 @@ BENCHMARK(RibResolutionBenchmark) { auto config = utility::onePortPerInterfaceConfig( ensemble->getHwSwitch(), ensemble->masterLogicalPortIds()); ensemble->applyInitialConfig(config); - utility::THAlpmRouteScaleGenerator gen(ensemble->getProgrammedState(), true); + utility::THAlpmRouteScaleGenerator gen(ensemble->getProgrammedState()); const auto& routeChunks = gen.getThriftRoutes(); // Create a dummy rib since we don't want to go through // HwSwitchEnsemble and write to HW From ddd0deaf93172a422d43cb46bf2bb5cd705d4516 Mon Sep 17 00:00:00 2001 From: Open Source Bot Date: Mon, 13 Feb 2023 14:31:48 -0800 Subject: [PATCH 280/280] Updating submodules Summary: GitHub commits: https://github.com/facebook/fbthrift/commit/0d58d2e8515f4fd12a9ec222c44007de015a495f https://github.com/facebook/rocksdb/commit/c19672c187e59700c18f98da068fa0425cef9ded Reviewed By: jurajh-fb fbshipit-source-id: e9fc0be0e714f8b3474eb3f036bdc94c33b2e5ab --- build/deps/github_hashes/facebook/fbthrift-rev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/deps/github_hashes/facebook/fbthrift-rev.txt b/build/deps/github_hashes/facebook/fbthrift-rev.txt index 6e6ae9c124be4..28b84cace6b5d 100644 --- a/build/deps/github_hashes/facebook/fbthrift-rev.txt +++ b/build/deps/github_hashes/facebook/fbthrift-rev.txt @@ -1 +1 @@ -Subproject commit 30a348cd937c902c2a02050b7e73fcdc5b1f44db +Subproject commit 0d58d2e8515f4fd12a9ec222c44007de015a495f