fc.c (2afc4866c44e85e3413b294c982e51061fba505b) fc.c (f4b9e6c90c572519041f4c5d9c4c3dd50aff42d4)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2016 Avago Technologies. All rights reserved.
4 */
5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
6#include <linux/module.h>
7#include <linux/parser.h>
8#include <uapi/scsi/fc/fc_fs.h>

--- 2114 unchanged lines hidden (view full) ---

2123 int res;
2124
2125 res = __nvme_fc_init_request(ctrl, queue, &op->op, rq, queue->rqcnt++);
2126 if (res)
2127 return res;
2128 op->op.fcp_req.first_sgl = op->sgl;
2129 op->op.fcp_req.private = &op->priv[0];
2130 nvme_req(rq)->ctrl = &ctrl->ctrl;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2016 Avago Technologies. All rights reserved.
4 */
5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
6#include <linux/module.h>
7#include <linux/parser.h>
8#include <uapi/scsi/fc/fc_fs.h>

--- 2114 unchanged lines hidden (view full) ---

2123 int res;
2124
2125 res = __nvme_fc_init_request(ctrl, queue, &op->op, rq, queue->rqcnt++);
2126 if (res)
2127 return res;
2128 op->op.fcp_req.first_sgl = op->sgl;
2129 op->op.fcp_req.private = &op->priv[0];
2130 nvme_req(rq)->ctrl = &ctrl->ctrl;
2131 nvme_req(rq)->cmd = &op->op.cmd_iu.sqe;
2131 return res;
2132}
2133
2134static int
2135nvme_fc_init_aen_ops(struct nvme_fc_ctrl *ctrl)
2136{
2137 struct nvme_fc_fcp_op *aen_op;
2138 struct nvme_fc_cmd_iu *cmdiu;

--- 615 unchanged lines hidden (view full) ---

2754nvme_fc_queue_rq(struct blk_mq_hw_ctx *hctx,
2755 const struct blk_mq_queue_data *bd)
2756{
2757 struct nvme_ns *ns = hctx->queue->queuedata;
2758 struct nvme_fc_queue *queue = hctx->driver_data;
2759 struct nvme_fc_ctrl *ctrl = queue->ctrl;
2760 struct request *rq = bd->rq;
2761 struct nvme_fc_fcp_op *op = blk_mq_rq_to_pdu(rq);
2132 return res;
2133}
2134
2135static int
2136nvme_fc_init_aen_ops(struct nvme_fc_ctrl *ctrl)
2137{
2138 struct nvme_fc_fcp_op *aen_op;
2139 struct nvme_fc_cmd_iu *cmdiu;

--- 615 unchanged lines hidden (view full) ---

2755nvme_fc_queue_rq(struct blk_mq_hw_ctx *hctx,
2756 const struct blk_mq_queue_data *bd)
2757{
2758 struct nvme_ns *ns = hctx->queue->queuedata;
2759 struct nvme_fc_queue *queue = hctx->driver_data;
2760 struct nvme_fc_ctrl *ctrl = queue->ctrl;
2761 struct request *rq = bd->rq;
2762 struct nvme_fc_fcp_op *op = blk_mq_rq_to_pdu(rq);
2762 struct nvme_fc_cmd_iu *cmdiu = &op->cmd_iu;
2763 struct nvme_command *sqe = &cmdiu->sqe;
2764 enum nvmefc_fcp_datadir io_dir;
2765 bool queue_ready = test_bit(NVME_FC_Q_LIVE, &queue->flags);
2766 u32 data_len;
2767 blk_status_t ret;
2768
2769 if (ctrl->rport->remoteport.port_state != FC_OBJSTATE_ONLINE ||
2770 !nvmf_check_ready(&queue->ctrl->ctrl, rq, queue_ready))
2771 return nvmf_fail_nonready_command(&queue->ctrl->ctrl, rq);
2772
2763 enum nvmefc_fcp_datadir io_dir;
2764 bool queue_ready = test_bit(NVME_FC_Q_LIVE, &queue->flags);
2765 u32 data_len;
2766 blk_status_t ret;
2767
2768 if (ctrl->rport->remoteport.port_state != FC_OBJSTATE_ONLINE ||
2769 !nvmf_check_ready(&queue->ctrl->ctrl, rq, queue_ready))
2770 return nvmf_fail_nonready_command(&queue->ctrl->ctrl, rq);
2771
2773 ret = nvme_setup_cmd(ns, rq, sqe);
2772 ret = nvme_setup_cmd(ns, rq);
2774 if (ret)
2775 return ret;
2776
2777 /*
2778 * nvme core doesn't quite treat the rq opaquely. Commands such
2779 * as WRITE ZEROES will return a non-zero rq payload_bytes yet
2780 * there is no actual payload to be transferred.
2781 * To get it right, key data transmission on there being 1 or

--- 1141 unchanged lines hidden ---
2773 if (ret)
2774 return ret;
2775
2776 /*
2777 * nvme core doesn't quite treat the rq opaquely. Commands such
2778 * as WRITE ZEROES will return a non-zero rq payload_bytes yet
2779 * there is no actual payload to be transferred.
2780 * To get it right, key data transmission on there being 1 or

--- 1141 unchanged lines hidden ---