Dynamic I/O queue management

- Queue allocation is now separated from starting cache.
- Queue can be created and destroyed in runtime.
- All queue ops accept queue handle instead of queue id.
- Cache stores queues as list instead of array.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Michal Mielewczyk
2019-02-15 08:12:00 -05:00
committed by Robert Baldyga
parent 1771228a46
commit e53944d472
38 changed files with 379 additions and 445 deletions

View File

@@ -9,11 +9,12 @@
#include "ocf_env.h"
struct ocf_queue {
struct ocf_cache *cache;
uint32_t id;
ocf_cache_t cache;
env_atomic io_no;
env_atomic ref_count;
struct list_head io_list;
env_spinlock io_list_lock;
@@ -23,15 +24,19 @@ struct ocf_queue {
/* Tracing stop request */
env_atomic trace_stop;
struct list_head list;
const struct ocf_queue_ops *ops;
void *priv;
};
int ocf_alloc_queues(struct ocf_cache *cache);
int ocf_start_queues(struct ocf_cache *cache);
void ocf_stop_queues(struct ocf_cache *cache);
void ocf_free_queues(struct ocf_cache *cache);
static inline void ocf_queue_kick(ocf_queue_t queue, bool allow_sync)
{
if (allow_sync && queue->ops->kick_sync)
queue->ops->kick_sync(queue);
else
queue->ops->kick(queue);
}
#endif