From 7f03c5728b4688aa8c53a9f9544902549912036f Mon Sep 17 00:00:00 2001 From: Sabeel Ansari Date: Fri, 31 Jan 2025 10:32:10 -0800 Subject: [PATCH] Remove unused code Signed-off-by: Sabeel Ansari --- .../lib/tdi/es2k/es2k_virtual_port_manager.cc | 42 ------------------- .../lib/tdi/es2k/es2k_virtual_port_manager.h | 7 ---- 2 files changed, 49 deletions(-) diff --git a/stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.cc b/stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.cc index 791800e35..0465a4d05 100644 --- a/stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.cc +++ b/stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.cc @@ -44,32 +44,6 @@ namespace tdi { Es2kVirtualPortManager* Es2kVirtualPortManager::singleton_ = nullptr; -#if 0 -namespace { - -// A callback function executed in SDE port state change thread context. -ipu_status_t sde_port_status_callback(ipu_dev_id_t device, - ipu_dev_port_t dev_port, bool up, - void* cookie) { - absl::Time timestamp = absl::Now(); - Es2kVirtualPortManager* es2k_port_manager = - Es2kVirtualPortManager::GetSingleton(); - if (!es2k_port_manager) { - LOG(ERROR) - << "Es2kVirtualPortManager singleton instance is not initialized."; - return IPU_INTERNAL_ERROR; - } - // Forward the event. - auto status = - es2k_port_manager->OnPortStatusEvent(device, dev_port, up, timestamp); - - return status.ok() ? IPU_SUCCESS : IPU_INTERNAL_ERROR; -} - -} // namespace - -#endif - Es2kVirtualPortManager* Es2kVirtualPortManager::CreateSingleton() { absl::WriterMutexLock l(&init_lock_); if (!singleton_) { @@ -139,22 +113,6 @@ ::util::StatusOr Es2kVirtualPortManager::GetMacAddress( return swapped_mac; } -::util::Status Es2kVirtualPortManager::OnPortStatusEvent(int device, int port, - bool up, - absl::Time timestamp) { - // Create PortStatusEvent message. - PortState state = up ? PORT_STATE_UP : PORT_STATE_DOWN; - PortStatusEvent event = {device, port, state, timestamp}; - - { - absl::ReaderMutexLock l(&port_status_event_writer_lock_); - if (!port_status_event_writer_) { - return ::util::OkStatus(); - } - return port_status_event_writer_->Write(event, kWriteTimeout); - } -} - } // namespace tdi } // namespace hal } // namespace stratum diff --git a/stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.h b/stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.h index 6912eae53..6e74f4afb 100644 --- a/stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.h +++ b/stratum/hal/lib/tdi/es2k/es2k_virtual_port_manager.h @@ -46,13 +46,6 @@ class Es2kVirtualPortManager : public TdiVirtualPortManager { // Return the singleton instance to be used in the SDE callbacks. static Es2kVirtualPortManager* GetSingleton() LOCKS_EXCLUDED(init_lock_); - // Called whenever a port status event is received from SDK. It forwards the - // port status event to the module who registered a callback by calling - // RegisterPortStatusEventWriter(). - ::util::Status OnPortStatusEvent(int device, int dev_port, bool up, - absl::Time timestamp) - LOCKS_EXCLUDED(port_status_event_writer_lock_); - protected: // The singleton instance. static Es2kVirtualPortManager* singleton_ GUARDED_BY(init_lock_);