Skip to content

Commit

Permalink
Add host_tx_ready enhancements (#2930)
Browse files Browse the repository at this point in the history
What I did
Add host_tx_ready enhancements to sonic-swss branch according to HLD

Why I did it
Module and Asic configurations must be synchronized in order to not configure an non-existing module.
  • Loading branch information
noaOrMlnx authored Jan 9, 2024
1 parent a0c20c3 commit 7702b8a
Show file tree
Hide file tree
Showing 8 changed files with 316 additions and 16 deletions.
4 changes: 4 additions & 0 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,10 @@ 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
6 changes: 6 additions & 0 deletions orchagent/notifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ void on_switch_shutdown_request(sai_object_id_t switch_id)

quick_exit(EXIT_FAILURE);
}

void on_port_host_tx_ready(sai_object_id_t switch_id, sai_object_id_t port_id, sai_port_host_tx_ready_status_t m_portHostTxReadyStatus)
{
// don't use this event handler, because it runs by libsairedis in a separate thread
// which causes concurrency access to the DB
}
1 change: 1 addition & 0 deletions orchagent/notifications.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ void on_bfd_session_state_change(uint32_t count, sai_bfd_session_state_notificat
// The function prototype information can be found here:
// https://github.com/sonic-net/sonic-sairedis/blob/master/meta/NotificationSwitchShutdownRequest.cpp#L49
void on_switch_shutdown_request(sai_object_id_t switch_id);
void on_port_host_tx_ready(sai_object_id_t switch_id, sai_object_id_t port_id, sai_port_host_tx_ready_status_t m_portHostTxReadyStatus);
Loading

0 comments on commit 7702b8a

Please sign in to comment.