Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[portsorch] query SAI_HOSTIF_ATTR_QUEUE switch capability once #3260

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
34 changes: 11 additions & 23 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,15 @@ PortsOrch::PortsOrch(DBConnector *db, DBConnector *stateDb, vector<table_name_wi
}
}

if (gSwitchOrch->querySwitchCapability(SAI_OBJECT_TYPE_HOSTIF, SAI_HOSTIF_ATTR_QUEUE))
{
m_supportsHostIfTxQueue = true;
}
else
{
SWSS_LOG_WARN("Hostif queue attribute not supported");
}

// Query whether SAI supports Host Tx Signal and Host Tx Notification

sai_attr_capability_t capability;
Expand Down Expand Up @@ -3278,17 +3287,7 @@ bool PortsOrch::createVlanHostIntf(Port& vl, string hostif_name)
attr.value.chardata[SAI_HOSTIF_NAME_SIZE - 1] = '\0';
attrs.push_back(attr);

bool set_hostif_tx_queue = false;
if (gSwitchOrch->querySwitchCapability(SAI_OBJECT_TYPE_HOSTIF, SAI_HOSTIF_ATTR_QUEUE))
{
set_hostif_tx_queue = true;
}
else
{
SWSS_LOG_WARN("Hostif queue attribute not supported");
}

if (set_hostif_tx_queue)
if (m_supportsHostIfTxQueue)
{
attr.id = SAI_HOSTIF_ATTR_QUEUE;
attr.value.u32 = DEFAULT_HOSTIF_TX_QUEUE;
Expand Down Expand Up @@ -5934,17 +5933,7 @@ bool PortsOrch::addHostIntfs(Port &port, string alias, sai_object_id_t &host_int
attr.value.chardata[SAI_HOSTIF_NAME_SIZE - 1] = '\0';
attrs.push_back(attr);

bool set_hostif_tx_queue = false;
if (gSwitchOrch->querySwitchCapability(SAI_OBJECT_TYPE_HOSTIF, SAI_HOSTIF_ATTR_QUEUE))
{
set_hostif_tx_queue = true;
}
else
{
SWSS_LOG_WARN("Hostif queue attribute not supported");
}

if (set_hostif_tx_queue)
if (m_supportsHostIfTxQueue)
{
attr.id = SAI_HOSTIF_ATTR_QUEUE;
attr.value.u32 = DEFAULT_HOSTIF_TX_QUEUE;
Expand Down Expand Up @@ -9891,4 +9880,3 @@ void PortsOrch::doTask(swss::SelectableTimer &timer)
m_port_state_poller->stop();
}
}

1 change: 1 addition & 0 deletions orchagent/portsorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ class PortsOrch : public Orch, public Subject
bool oper_fec_sup = false;
bool saiHwTxSignalSupported = false;
bool saiTxReadyNotifySupported = false;
bool m_supportsHostIfTxQueue = false;

swss::SelectableTimer *m_port_state_poller = nullptr;

Expand Down
Loading