Skip to content

Commit

Permalink
Change HOST_TX_READY_NOTIFY attr to be set only if CMIS mgmt feature …
Browse files Browse the repository at this point in the history
…is enabled
  • Loading branch information
noaOrMlnx committed Mar 10, 2024
1 parent 9c995f0 commit a9813f7
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 a9813f7

Please sign in to comment.