Skip to content

Commit

Permalink
Set HOST_TX_READY_NOTIFY attribute only after query capabilities(#3070)
Browse files Browse the repository at this point in the history
*Set HOST_TX_READY_NOTIFY attribute only after query capabilities
  • Loading branch information
noaOrMlnx authored Mar 11, 2024
1 parent 9c995f0 commit 600d5e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,6 @@ int main(int argc, char **argv)
attr.value.ptr = (void *)on_switch_shutdown_request;
attrs.push_back(attr);

attr.id = SAI_SWITCH_ATTR_PORT_HOST_TX_READY_NOTIFY;
attr.value.ptr = (void *)on_port_host_tx_ready;
attrs.push_back(attr);

if (gMySwitchType != "fabric" && gMacAddress)
{
attr.id = SAI_SWITCH_ATTR_SRC_MAC_ADDRESS;
Expand Down
12 changes: 12 additions & 0 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "vxlanorch.h"
#include "directory.h"
#include "subintf.h"
#include "notifications.h"

#include <inttypes.h>
#include <cassert>
Expand Down Expand Up @@ -581,6 +582,17 @@ PortsOrch::PortsOrch(DBConnector *db, DBConnector *stateDb, vector<table_name_wi
{
SWSS_LOG_DEBUG("m_cmisModuleAsicSyncSupported is true");
m_cmisModuleAsicSyncSupported = true;

// set HOST_TX_READY callback function attribute to SAI, only if the feature is enabled
sai_attribute_t attr;
attr.id = SAI_SWITCH_ATTR_PORT_HOST_TX_READY_NOTIFY;
attr.value.ptr = (void *)on_port_host_tx_ready;

if (sai_switch_api->set_switch_attribute(gSwitchId, &attr) != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("PortsOrch failed to set SAI_SWITCH_ATTR_PORT_HOST_TX_READY_NOTIFY attribute");
}

Orch::addExecutor(new Consumer(new SubscriberStateTable(stateDb, STATE_TRANSCEIVER_INFO_TABLE_NAME, TableConsumable::DEFAULT_POP_BATCH_SIZE, 0), this, STATE_TRANSCEIVER_INFO_TABLE_NAME));
}

Expand Down

0 comments on commit 600d5e8

Please sign in to comment.