summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/fc.c
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2020-03-31 09:49:52 -0700
committerJens Axboe <axboe@kernel.dk>2020-05-09 16:18:33 -0600
commitfd5a5f2213048b012bc7e19e832e9ae0ec1a2c4a (patch)
tree831d521a2152c7360f5aa43ce88deee4bce959be /drivers/nvme/host/fc.c
parenteb4ee8f125157926cf36a3c275b04825f1bf8cfa (diff)
downloadlinux-fd5a5f2213048b012bc7e19e832e9ae0ec1a2c4a.tar.bz2
nvme-fc: Update header and host for common definitions for LS handling
Given that both host and target now generate and receive LS's create a single table definition for LS names. Each tranport half will have a local version of the table. As Create Association LS is issued by both sides, and received by both sides, create common routines to format the LS and to validate the LS. Convert the host side transport to use the new common Create Association LS formatting routine. Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvme/host/fc.c')
-rw-r--r--drivers/nvme/host/fc.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 0ac246603063..c069ab056202 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -1419,29 +1419,8 @@ nvme_fc_xmt_disconnect_assoc(struct nvme_fc_ctrl *ctrl)
else
lsreq->private = NULL;
- discon_rqst->w0.ls_cmd = FCNVME_LS_DISCONNECT_ASSOC;
- discon_rqst->desc_list_len = cpu_to_be32(
- sizeof(struct fcnvme_lsdesc_assoc_id) +
- sizeof(struct fcnvme_lsdesc_disconn_cmd));
-
- discon_rqst->associd.desc_tag = cpu_to_be32(FCNVME_LSDESC_ASSOC_ID);
- discon_rqst->associd.desc_len =
- fcnvme_lsdesc_len(
- sizeof(struct fcnvme_lsdesc_assoc_id));
-
- discon_rqst->associd.association_id = cpu_to_be64(ctrl->association_id);
-
- discon_rqst->discon_cmd.desc_tag = cpu_to_be32(
- FCNVME_LSDESC_DISCONN_CMD);
- discon_rqst->discon_cmd.desc_len =
- fcnvme_lsdesc_len(
- sizeof(struct fcnvme_lsdesc_disconn_cmd));
-
- lsreq->rqstaddr = discon_rqst;
- lsreq->rqstlen = sizeof(*discon_rqst);
- lsreq->rspaddr = discon_acc;
- lsreq->rsplen = sizeof(*discon_acc);
- lsreq->timeout = NVME_FC_LS_TIMEOUT_SEC;
+ nvmefc_fmt_lsreq_discon_assoc(lsreq, discon_rqst, discon_acc,
+ ctrl->association_id);
ret = nvme_fc_send_ls_req_async(ctrl->rport, lsop,
nvme_fc_disconnect_assoc_done);