Skip to content

Commit

Permalink
ensure non-hierarchical qos
Browse files Browse the repository at this point in the history
Summary: this is a patch from vendor to pass qos scheduler tests passing

Reviewed By: jasmeetbagga

Differential Revision: D66177089

fbshipit-source-id: 68ca3978c55df4c673ea0f70d19a136937832e08
  • Loading branch information
Parvez Shaikh authored and facebook-github-bot committed Nov 20, 2024
1 parent 35b0dfb commit 3eb5be6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 13 additions & 2 deletions fboss/agent/hw/sai/switch/SaiQueueManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ void SaiQueueManager::changeQueueBufferProfile(

void SaiQueueManager::changeQueueScheduler(
SaiQueueHandle* queueHandle,
const PortQueue& newPortQueue) {
const PortQueue& newPortQueue,
const Port* swPort) {
std::shared_ptr<SaiScheduler> newScheduler;
if (newPortQueue.getScheduling() != cfg::QueueScheduling::INTERNAL) {
newScheduler =
Expand All @@ -256,6 +257,16 @@ void SaiQueueManager::changeQueueScheduler(
queueHandle->queue->setOptionalAttribute(
SaiQueueTraits::Attributes::SchedulerProfileId(
newScheduler ? newScheduler->adapterKey() : SAI_NULL_OBJECT_ID));
if (platform_->getAsic()->getAsicType() ==
cfg::AsicType::ASIC_TYPE_CHENAB) {
// Signal to SAI to use non-hierarchial QoS by setting the parent
// scheduler node to the port.
auto portHandle =
managerTable_->portManager().getPortHandle(swPort->getID());
queueHandle->queue->setOptionalAttribute(
SaiQueueTraits::Attributes::ParentSchedulerNode(
portHandle->port->adapterKey()));
}
// Update scheduler reference after we have set the queue
// scheduler attribute, else if this is the last queue
// referring to this scheduler, we will try to delete it
Expand Down Expand Up @@ -309,7 +320,7 @@ void SaiQueueManager::changeQueue(
if ((queueType != SAI_QUEUE_TYPE_UNICAST_VOQ) &&
(queueType != SAI_QUEUE_TYPE_MULTICAST_VOQ)) {
if (platform_->getAsic()->isSupported(HwAsic::Feature::L3_QOS)) {
changeQueueScheduler(queueHandle, newPortQueue);
changeQueueScheduler(queueHandle, newPortQueue, swPort);
}
}
changeQueueEcnWred(queueHandle, newPortQueue);
Expand Down
3 changes: 2 additions & 1 deletion fboss/agent/hw/sai/switch/SaiQueueManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class SaiQueueManager {
const PortQueue& newPortQueue);
void changeQueueScheduler(
SaiQueueHandle* queueHandle,
const PortQueue& newPortQueue);
const PortQueue& newPortQueue,
const Port* swPort);
void changeQueueDeadlockEnable(
SaiQueueHandle* queueHandle,
const Port* swPort);
Expand Down

0 comments on commit 3eb5be6

Please sign in to comment.