Deleted Added
full compact
nvme_qpair.c (240616) nvme_qpair.c (241434)
1/*-
2 * Copyright (C) 2012 Intel Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (C) 2012 Intel Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/nvme/nvme_qpair.c 240616 2012-09-17 19:23:01Z jimharris $");
28__FBSDID("$FreeBSD: head/sys/dev/nvme/nvme_qpair.c 241434 2012-10-10 23:35:16Z jimharris $");
29
30#include <sys/param.h>
31#include <sys/bus.h>
32
33#include "nvme_private.h"
34
35static boolean_t
36nvme_completion_check_retry(const struct nvme_completion *cpl)

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

120
121void
122nvme_qpair_process_completions(struct nvme_qpair *qpair)
123{
124 struct nvme_tracker *tr;
125 struct nvme_completion *cpl;
126 boolean_t retry, error;
127
29
30#include <sys/param.h>
31#include <sys/bus.h>
32
33#include "nvme_private.h"
34
35static boolean_t
36nvme_completion_check_retry(const struct nvme_completion *cpl)

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

120
121void
122nvme_qpair_process_completions(struct nvme_qpair *qpair)
123{
124 struct nvme_tracker *tr;
125 struct nvme_completion *cpl;
126 boolean_t retry, error;
127
128 qpair->num_intr_handler_calls++;
129
128 while (1) {
129 cpl = &qpair->cpl[qpair->cq_head];
130
131 if (cpl->p != qpair->phase)
132 break;
133
134 tr = qpair->act_tr[cpl->cid];
135 KASSERT(tr,

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

233
234 bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev),
235 sizeof(uint64_t), PAGE_SIZE, BUS_SPACE_MAXADDR,
236 BUS_SPACE_MAXADDR, NULL, NULL, qpair->max_xfer_size,
237 (qpair->max_xfer_size/PAGE_SIZE)+1, PAGE_SIZE, 0,
238 NULL, NULL, &qpair->dma_tag);
239
240 qpair->num_cmds = 0;
130 while (1) {
131 cpl = &qpair->cpl[qpair->cq_head];
132
133 if (cpl->p != qpair->phase)
134 break;
135
136 tr = qpair->act_tr[cpl->cid];
137 KASSERT(tr,

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

235
236 bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev),
237 sizeof(uint64_t), PAGE_SIZE, BUS_SPACE_MAXADDR,
238 BUS_SPACE_MAXADDR, NULL, NULL, qpair->max_xfer_size,
239 (qpair->max_xfer_size/PAGE_SIZE)+1, PAGE_SIZE, 0,
240 NULL, NULL, &qpair->dma_tag);
241
242 qpair->num_cmds = 0;
243 qpair->num_intr_handler_calls = 0;
241 qpair->num_tr = 0;
242 qpair->num_prp_list = 0;
243 qpair->sq_head = qpair->sq_tail = qpair->cq_head = 0;
244
245 /* TODO: error checking on contigmalloc, bus_dmamap_load calls */
246 qpair->cmd = contigmalloc(qpair->num_entries *
247 sizeof(struct nvme_command), M_NVME, M_ZERO | M_NOWAIT,
248 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0);

--- 174 unchanged lines hidden ---
244 qpair->num_tr = 0;
245 qpair->num_prp_list = 0;
246 qpair->sq_head = qpair->sq_tail = qpair->cq_head = 0;
247
248 /* TODO: error checking on contigmalloc, bus_dmamap_load calls */
249 qpair->cmd = contigmalloc(qpair->num_entries *
250 sizeof(struct nvme_command), M_NVME, M_ZERO | M_NOWAIT,
251 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0);

--- 174 unchanged lines hidden ---