]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/scripts/rpc/nvme.py
3 def send_nvme_cmd(client
, name
, cmd_type
, data_direction
, cmdbuf
,
4 data
=None, metadata
=None,
5 data_len
=None, metadata_len
=None,
7 """Send one NVMe command
10 name: Name of the operating NVMe controller
11 cmd_type: Type of nvme cmd. Valid values are: admin, io
12 data_direction: Direction of data transfer. Valid values are: c2h, h2c
13 cmdbuf: NVMe command encoded by base64 urlsafe
14 data: Data transferring to controller from host, encoded by base64 urlsafe
15 metadata: metadata transferring to controller from host, encoded by base64 urlsafe
16 data_length: Data length required to transfer from controller to host
17 metadata_length: Metadata length required to transfer from controller to host
18 timeout-ms: Command execution timeout value, in milliseconds, if 0, don't track timeout
21 NVMe completion queue entry, requested data and metadata, all are encoded by base64 urlsafe.
23 params
= {'name': name
,
25 'data_direction': data_direction
,
31 params
['metadata'] = metadata
33 params
['data_len'] = data_len
35 params
['metadata_len'] = metadata_len
37 params
['timeout_ms'] = timeout_ms
39 return client
.call('send_nvme_cmd', params
)
42 def get_nvme_controllers(client
, name
=None):
43 """Get information about NVMe controllers.
46 name: NVMe controller name to query (optional; if omitted, query all NVMe controllers)
49 List of NVMe controller information objects.
54 return client
.call('get_nvme_controllers', params
)