Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions orchagent/orchdaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ AclOrch *gAclOrch;
CrmOrch *gCrmOrch;
BufferOrch *gBufferOrch;
SwitchOrch *gSwitchOrch;
QosOrch *gQosOrch;
Directory<Orch*> gDirectory;

OrchDaemon::OrchDaemon(DBConnector *applDb, DBConnector *configDb, DBConnector *stateDb) :
Expand Down Expand Up @@ -116,7 +117,7 @@ bool OrchDaemon::init()
CFG_PFC_PRIORITY_TO_PRIORITY_GROUP_MAP_TABLE_NAME,
CFG_PFC_PRIORITY_TO_QUEUE_MAP_TABLE_NAME
};
QosOrch *qos_orch = new QosOrch(m_configDb, qos_tables);
gQosOrch = new QosOrch(m_configDb, qos_tables);

vector<string> buffer_tables = {
CFG_BUFFER_POOL_TABLE_NAME,
Expand Down Expand Up @@ -158,7 +159,7 @@ bool OrchDaemon::init()
* when iterating ConsumerMap.
* That is ensured implicitly by the order of map key, "LAG_TABLE" is smaller than "VLAN_TABLE" in lexicographic order.
*/
m_orchList = { gSwitchOrch, gCrmOrch, gBufferOrch, gPortsOrch, gIntfsOrch, gNeighOrch, gRouteOrch, copp_orch, tunnel_decap_orch, qos_orch, wm_orch };
m_orchList = { gSwitchOrch, gCrmOrch, gBufferOrch, gPortsOrch, gIntfsOrch, gNeighOrch, gRouteOrch, copp_orch, tunnel_decap_orch, gQosOrch, wm_orch };


bool initialize_dtel = false;
Expand Down
9 changes: 8 additions & 1 deletion orchagent/pfcwdorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "select.h"
#include "notifier.h"
#include "redisclient.h"
#include "qosorch.h"

#define PFC_WD_GLOBAL "GLOBAL"
#define PFC_WD_ACTION "action"
Expand All @@ -28,6 +29,7 @@ extern sai_port_api_t *sai_port_api;
extern sai_queue_api_t *sai_queue_api;

extern PortsOrch *gPortsOrch;
extern QosOrch *gQosOrch;

template <typename DropHandler, typename ForwardHandler>
PfcWdOrch<DropHandler, ForwardHandler>::PfcWdOrch(DBConnector *db, vector<string> &tableNames):
Expand All @@ -50,7 +52,7 @@ void PfcWdOrch<DropHandler, ForwardHandler>::doTask(Consumer& consumer)
{
SWSS_LOG_ENTER();

if (!gPortsOrch->isPortReady())
if ((!gPortsOrch->isPortReady()) || (!gQosOrch->isQosMapsApplied()))
{
return;
}
Expand Down Expand Up @@ -469,6 +471,11 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::registerInWdDb(const Port& port,

losslessTc.insert(i);
}
if (losslessTc.empty())
{
SWSS_LOG_ERROR("No lossless TC found on port %s", port.m_alias.c_str());
return;
}

if (!c_portStatIds.empty())
{
Expand Down
1 change: 1 addition & 0 deletions orchagent/qosorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,7 @@ task_process_status QosOrch::handlePortQosMapTable(Consumer& consumer)
}
}

m_qosMapsApplied = true;
SWSS_LOG_NOTICE("Applied QoS maps to ports");
return task_process_status::task_success;
}
Expand Down
7 changes: 7 additions & 0 deletions orchagent/qosorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ class QosOrch : public Orch

static type_map& getTypeMap();
static type_map m_qos_maps;

bool isQosMapsApplied(void)
{
return m_qosMapsApplied;
}
private:
virtual void doTask(Consumer& consumer);

Expand Down Expand Up @@ -155,5 +160,7 @@ class QosOrch : public Orch
};

std::unordered_map<sai_object_id_t, SchedulerGroupPortInfo_t> m_scheduler_group_port_info;

bool m_qosMapsApplied = false;
};
#endif /* SWSS_QOSORCH_H */