1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (C) 2018 Intel Corporation. All rights reserved. 3 * Copyright (c) 2020 Mellanox Technologies LTD. All rights reserved. 4 */ 5 6 #ifndef SPDK_INTERNAL_THREAD_H_ 7 #define SPDK_INTERNAL_THREAD_H_ 8 9 #include "spdk/stdinc.h" 10 #include "spdk/thread.h" 11 12 struct spdk_poller; 13 14 struct spdk_poller_stats { 15 uint64_t run_count; 16 uint64_t busy_count; 17 }; 18 19 struct io_device; 20 struct spdk_thread; 21 22 const char *spdk_poller_get_name(struct spdk_poller *poller); 23 uint64_t spdk_poller_get_id(struct spdk_poller *poller); 24 const char *spdk_poller_get_state_str(struct spdk_poller *poller); 25 uint64_t spdk_poller_get_period_ticks(struct spdk_poller *poller); 26 void spdk_poller_get_stats(struct spdk_poller *poller, struct spdk_poller_stats *stats); 27 28 const char *spdk_io_channel_get_io_device_name(struct spdk_io_channel *ch); 29 int spdk_io_channel_get_ref_count(struct spdk_io_channel *ch); 30 31 const char *spdk_io_device_get_name(struct io_device *dev); 32 33 struct spdk_poller *spdk_thread_get_first_active_poller(struct spdk_thread *thread); 34 struct spdk_poller *spdk_thread_get_next_active_poller(struct spdk_poller *prev); 35 struct spdk_poller *spdk_thread_get_first_timed_poller(struct spdk_thread *thread); 36 struct spdk_poller *spdk_thread_get_next_timed_poller(struct spdk_poller *prev); 37 struct spdk_poller *spdk_thread_get_first_paused_poller(struct spdk_thread *thread); 38 struct spdk_poller *spdk_thread_get_next_paused_poller(struct spdk_poller *prev); 39 40 struct spdk_io_channel *spdk_thread_get_first_io_channel(struct spdk_thread *thread); 41 struct spdk_io_channel *spdk_thread_get_next_io_channel(struct spdk_io_channel *prev); 42 43 #endif /* SPDK_INTERNAL_THREAD_H_ */ 44