Skip to content

Commit a9813f7

Browse files
committed
Change HOST_TX_READY_NOTIFY attr to be set only if CMIS mgmt feature is enabled
1 parent 9c995f0 commit a9813f7

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

orchagent/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,6 @@ int main(int argc, char **argv)
505505
attr.value.ptr = (void *)on_switch_shutdown_request;
506506
attrs.push_back(attr);
507507

508-
attr.id = SAI_SWITCH_ATTR_PORT_HOST_TX_READY_NOTIFY;
509-
attr.value.ptr = (void *)on_port_host_tx_ready;
510-
attrs.push_back(attr);
511-
512508
if (gMySwitchType != "fabric" && gMacAddress)
513509
{
514510
attr.id = SAI_SWITCH_ATTR_SRC_MAC_ADDRESS;

orchagent/portsorch.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "vxlanorch.h"
77
#include "directory.h"
88
#include "subintf.h"
9+
#include "notifications.h"
910

1011
#include <inttypes.h>
1112
#include <cassert>
@@ -581,6 +582,17 @@ PortsOrch::PortsOrch(DBConnector *db, DBConnector *stateDb, vector<table_name_wi
581582
{
582583
SWSS_LOG_DEBUG("m_cmisModuleAsicSyncSupported is true");
583584
m_cmisModuleAsicSyncSupported = true;
585+
586+
// set HOST_TX_READY callback function attribute to SAI, only if the feature is enabled
587+
sai_attribute_t attr;
588+
attr.id = SAI_SWITCH_ATTR_PORT_HOST_TX_READY_NOTIFY;
589+
attr.value.ptr = (void *)on_port_host_tx_ready;
590+
591+
if (sai_switch_api->set_switch_attribute(gSwitchId, &attr) != SAI_STATUS_SUCCESS)
592+
{
593+
SWSS_LOG_ERROR("PortsOrch failed to set SAI_SWITCH_ATTR_PORT_HOST_TX_READY_NOTIFY attribute");
594+
}
595+
584596
Orch::addExecutor(new Consumer(new SubscriberStateTable(stateDb, STATE_TRANSCEIVER_INFO_TABLE_NAME, TableConsumable::DEFAULT_POP_BATCH_SIZE, 0), this, STATE_TRANSCEIVER_INFO_TABLE_NAME));
585597
}
586598

0 commit comments

Comments
 (0)