forked from ZaidQureshi/bam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nvm_aq.h
82 lines (57 loc) · 2.04 KB
/
nvm_aq.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef __NVM_AQ_H__
#define __NVM_AQ_H__
// #ifndef __CUDACC__
// #define __device__
// #define __host__
// #endif
#include <nvm_types.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
/*
* Create admin queue pair
*
* Take exclusive ownership of an NVM controller. This function resets the
* controller and configures NVM admin queues.
*
* Returns a reference handle that can be used for admin RPC calls.
*/
int nvm_aq_create(nvm_aq_ref* ref,
const nvm_ctrl_t* ctrl,
const nvm_dma_t* dma_window);
/*
* Destroy admin queues and references.
*
* Send NVM abort command to controller and deallocate admin queues.
*
* After calling this function, all admin queue references are invalid.
* This also means that remote references will no longer be valid.
*
* This function will also work for unbinding remote references.
*/
void nvm_aq_destroy(nvm_aq_ref ref);
//int nvm_tcp_rpc_enable(nvm_aq_ref ref, uint16_t port, nvm_rpc_cb_t filter, void* data);
//int nvm_tcp_rpc_disable(nvm_aq_ref ref, uint16_t port);
#ifdef __DIS_CLUSTER__
/*
* Callback function invoked whenever a remote NVM admin command is received.
* Should indicate whether or not a remote admin command is accepted and can
* be enqueued by using the return value.
*
* The remote command can also be modified if necessary.
*/
typedef bool (*nvm_dis_rpc_cb_t)(nvm_cmd_t* cmd, uint32_t dis_adapter, uint32_t dis_node_id);
/*
* Enable remote admin commands.
* Allows remote processes to relay NVM admin commands to the local process.
*/
int nvm_dis_rpc_enable(nvm_aq_ref ref, // NVM admin queue-pair reference
uint32_t dis_adapter, // Local adapter to enable interrupt on
nvm_dis_rpc_cb_t filter); // Filter callback (can be NULL)
/*
* Disable remote admin commands.
* Stop processing admin commands from remote processes.
*/
void nvm_dis_rpc_disable(nvm_aq_ref ref, uint32_t dis_adapter);
#endif /* __DIS_CLUSTER__ */
#endif /* #ifdef __NVM_AQ_H__ */