rdma.c (38dabe210fbab4e7e8a03670ab3ba42f247ea08f) rdma.c (ad22c355b707a8d8d48e282aadc01c0b0604b2e9)
1/*
2 * NVMe over Fabrics RDMA host code.
3 * Copyright (c) 2015-2016 HGST, a Western Digital Company.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *

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

1288{
1289 u32 queue_idx = nvme_rdma_queue_idx(queue);
1290
1291 if (queue_idx == 0)
1292 return queue->ctrl->admin_tag_set.tags[queue_idx];
1293 return queue->ctrl->tag_set.tags[queue_idx - 1];
1294}
1295
1/*
2 * NVMe over Fabrics RDMA host code.
3 * Copyright (c) 2015-2016 HGST, a Western Digital Company.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *

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

1288{
1289 u32 queue_idx = nvme_rdma_queue_idx(queue);
1290
1291 if (queue_idx == 0)
1292 return queue->ctrl->admin_tag_set.tags[queue_idx];
1293 return queue->ctrl->tag_set.tags[queue_idx - 1];
1294}
1295
1296static void nvme_rdma_submit_async_event(struct nvme_ctrl *arg, int aer_idx)
1296static void nvme_rdma_submit_async_event(struct nvme_ctrl *arg)
1297{
1298 struct nvme_rdma_ctrl *ctrl = to_rdma_ctrl(arg);
1299 struct nvme_rdma_queue *queue = &ctrl->queues[0];
1300 struct ib_device *dev = queue->device->dev;
1301 struct nvme_rdma_qe *sqe = &ctrl->async_event_sqe;
1302 struct nvme_command *cmd = sqe->data;
1303 struct ib_sge sge;
1304 int ret;
1305
1297{
1298 struct nvme_rdma_ctrl *ctrl = to_rdma_ctrl(arg);
1299 struct nvme_rdma_queue *queue = &ctrl->queues[0];
1300 struct ib_device *dev = queue->device->dev;
1301 struct nvme_rdma_qe *sqe = &ctrl->async_event_sqe;
1302 struct nvme_command *cmd = sqe->data;
1303 struct ib_sge sge;
1304 int ret;
1305
1306 if (WARN_ON_ONCE(aer_idx != 0))
1307 return;
1308
1309 ib_dma_sync_single_for_cpu(dev, sqe->dma, sizeof(*cmd), DMA_TO_DEVICE);
1310
1311 memset(cmd, 0, sizeof(*cmd));
1312 cmd->common.opcode = nvme_admin_async_event;
1313 cmd->common.command_id = NVME_AQ_BLK_MQ_DEPTH;
1314 cmd->common.flags |= NVME_CMD_SGL_METABUF;
1315 nvme_rdma_set_sg_null(cmd);
1316

--- 761 unchanged lines hidden ---
1306 ib_dma_sync_single_for_cpu(dev, sqe->dma, sizeof(*cmd), DMA_TO_DEVICE);
1307
1308 memset(cmd, 0, sizeof(*cmd));
1309 cmd->common.opcode = nvme_admin_async_event;
1310 cmd->common.command_id = NVME_AQ_BLK_MQ_DEPTH;
1311 cmd->common.flags |= NVME_CMD_SGL_METABUF;
1312 nvme_rdma_set_sg_null(cmd);
1313

--- 761 unchanged lines hidden ---