From 600d5e806a65046bdb3151a28ac09cad0d0abe99 Mon Sep 17 00:00:00 2001 From: noaOrMlnx <58519608+noaOrMlnx@users.noreply.github.com> Date: Mon, 11 Mar 2024 18:32:54 +0200 Subject: [PATCH] Set HOST_TX_READY_NOTIFY attribute only after query capabilities(#3070) *Set HOST_TX_READY_NOTIFY attribute only after query capabilities --- orchagent/main.cpp | 4 ---- orchagent/portsorch.cpp | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/orchagent/main.cpp b/orchagent/main.cpp index df702e7c3f..0add517a05 100644 --- a/orchagent/main.cpp +++ b/orchagent/main.cpp @@ -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; diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index 8823d6be23..ff333f1e83 100755 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -6,6 +6,7 @@ #include "vxlanorch.h" #include "directory.h" #include "subintf.h" +#include "notifications.h" #include #include @@ -581,6 +582,17 @@ PortsOrch::PortsOrch(DBConnector *db, DBConnector *stateDb, vectorset_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)); }