bdev/nvme: add fabrics timeout to attach_controller RPC
Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I42f6729475fd767087fb0a0c6e30d409672c3b99 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8597 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: <dongx.yi@intel.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
This commit is contained in:
parent
efd928e959
commit
d1e67b8b1b
@ -2865,21 +2865,22 @@ Array of names of newly created bdevs.
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Optional | Type | Description
|
||||
----------------------- | -------- | ----------- | -----------
|
||||
name | Required | string | Name of the NVMe controller, prefix for each bdev name
|
||||
trtype | Required | string | NVMe-oF target trtype: rdma or pcie
|
||||
traddr | Required | string | NVMe-oF target address: ip or BDF
|
||||
adrfam | Optional | string | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host
|
||||
trsvcid | Optional | string | NVMe-oF target trsvcid: port number
|
||||
subnqn | Optional | string | NVMe-oF target subnqn
|
||||
hostnqn | Optional | string | NVMe-oF target hostnqn
|
||||
hostaddr | Optional | string | NVMe-oF host address: ip address
|
||||
hostsvcid | Optional | string | NVMe-oF host trsvcid: port number
|
||||
prchk_reftag | Optional | bool | Enable checking of PI reference tag for I/O processing
|
||||
prchk_guard | Optional | bool | Enable checking of PI guard for I/O processing
|
||||
hdgst | Optional | bool | Enable TCP header digest
|
||||
ddgst | Optional | bool | Enable TCP data digest
|
||||
Name | Optional | Type | Description
|
||||
-------------------------- | -------- | ----------- | -----------
|
||||
name | Required | string | Name of the NVMe controller, prefix for each bdev name
|
||||
trtype | Required | string | NVMe-oF target trtype: rdma or pcie
|
||||
traddr | Required | string | NVMe-oF target address: ip or BDF
|
||||
adrfam | Optional | string | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host
|
||||
trsvcid | Optional | string | NVMe-oF target trsvcid: port number
|
||||
subnqn | Optional | string | NVMe-oF target subnqn
|
||||
hostnqn | Optional | string | NVMe-oF target hostnqn
|
||||
hostaddr | Optional | string | NVMe-oF host address: ip address
|
||||
hostsvcid | Optional | string | NVMe-oF host trsvcid: port number
|
||||
prchk_reftag | Optional | bool | Enable checking of PI reference tag for I/O processing
|
||||
prchk_guard | Optional | bool | Enable checking of PI guard for I/O processing
|
||||
hdgst | Optional | bool | Enable TCP header digest
|
||||
ddgst | Optional | bool | Enable TCP data digest
|
||||
fabrics_connect_timeout_us | Optional | bool | Timeout for fabrics connect (in microseconds)
|
||||
|
||||
### Example
|
||||
|
||||
|
@ -180,6 +180,7 @@ struct rpc_bdev_nvme_attach_controller {
|
||||
char *hostsvcid;
|
||||
bool prchk_reftag;
|
||||
bool prchk_guard;
|
||||
uint64_t fabrics_connect_timeout_us;
|
||||
struct spdk_nvme_ctrlr_opts opts;
|
||||
};
|
||||
|
||||
@ -214,7 +215,8 @@ static const struct spdk_json_object_decoder rpc_bdev_nvme_attach_controller_dec
|
||||
{"prchk_reftag", offsetof(struct rpc_bdev_nvme_attach_controller, prchk_reftag), spdk_json_decode_bool, true},
|
||||
{"prchk_guard", offsetof(struct rpc_bdev_nvme_attach_controller, prchk_guard), spdk_json_decode_bool, true},
|
||||
{"hdgst", offsetof(struct rpc_bdev_nvme_attach_controller, opts.header_digest), spdk_json_decode_bool, true},
|
||||
{"ddgst", offsetof(struct rpc_bdev_nvme_attach_controller, opts.data_digest), spdk_json_decode_bool, true}
|
||||
{"ddgst", offsetof(struct rpc_bdev_nvme_attach_controller, opts.data_digest), spdk_json_decode_bool, true},
|
||||
{"fabrics_connect_timeout_us", offsetof(struct rpc_bdev_nvme_attach_controller, opts.fabrics_connect_timeout_us), spdk_json_decode_uint64, true},
|
||||
};
|
||||
|
||||
#define NVME_MAX_BDEVS_PER_RPC 128
|
||||
|
@ -525,7 +525,8 @@ if __name__ == "__main__":
|
||||
prchk_reftag=args.prchk_reftag,
|
||||
prchk_guard=args.prchk_guard,
|
||||
hdgst=args.hdgst,
|
||||
ddgst=args.ddgst))
|
||||
ddgst=args.ddgst,
|
||||
fabrics_timeout=args.fabrics_timeout))
|
||||
|
||||
p = subparsers.add_parser('bdev_nvme_attach_controller', aliases=['construct_nvme_bdev'],
|
||||
help='Add bdevs with nvme backend')
|
||||
@ -554,6 +555,7 @@ if __name__ == "__main__":
|
||||
help='Enable TCP header digest.', action='store_true')
|
||||
p.add_argument('-d', '--ddgst',
|
||||
help='Enable TCP data digest.', action='store_true')
|
||||
p.add_argument('--fabrics-timeout', type=int, help='Fabrics connect timeout in microseconds')
|
||||
p.set_defaults(func=bdev_nvme_attach_controller)
|
||||
|
||||
def bdev_nvme_get_controllers(args):
|
||||
|
@ -511,7 +511,7 @@ def bdev_nvme_set_hotplug(client, enable, period_us=None):
|
||||
def bdev_nvme_attach_controller(client, name, trtype, traddr, adrfam=None, trsvcid=None,
|
||||
priority=None, subnqn=None, hostnqn=None, hostaddr=None,
|
||||
hostsvcid=None, prchk_reftag=None, prchk_guard=None,
|
||||
hdgst=None, ddgst=None):
|
||||
hdgst=None, ddgst=None, fabrics_timeout=None):
|
||||
"""Construct block device for each NVMe namespace in the attached controller.
|
||||
|
||||
Args:
|
||||
@ -529,6 +529,7 @@ def bdev_nvme_attach_controller(client, name, trtype, traddr, adrfam=None, trsvc
|
||||
prchk_guard: Enable checking of PI guard for I/O processing (optional)
|
||||
hdgst: Enable TCP header digest (optional)
|
||||
ddgst: Enable TCP data digest (optional)
|
||||
fabrics_timeout: Fabrics connect timeout in us (optional)
|
||||
|
||||
Returns:
|
||||
Names of created block devices.
|
||||
@ -570,6 +571,9 @@ def bdev_nvme_attach_controller(client, name, trtype, traddr, adrfam=None, trsvc
|
||||
if ddgst:
|
||||
params['ddgst'] = ddgst
|
||||
|
||||
if fabrics_timeout:
|
||||
params['fabrics_connect_timeout_us'] = fabrics_timeout
|
||||
|
||||
return client.call('bdev_nvme_attach_controller', params)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user