nvme_qpair.c (550d5d64fef2d661ad87df92e9042ed3e5562540) | nvme_qpair.c (ead7e10308947fc5b9c6b96411f09d486d92833d) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (C) 2012-2014 Intel Corporation 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 942 unchanged lines hidden (view full) --- 951 } 952} 953 954void 955nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr) 956{ 957 struct nvme_request *req; 958 struct nvme_controller *ctrlr; | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (C) 2012-2014 Intel Corporation 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 942 unchanged lines hidden (view full) --- 951 } 952} 953 954void 955nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr) 956{ 957 struct nvme_request *req; 958 struct nvme_controller *ctrlr; |
959 int timeout; |
|
959 960 mtx_assert(&qpair->lock, MA_OWNED); 961 962 req = tr->req; 963 req->cmd.cid = tr->cid; 964 qpair->act_tr[tr->cid] = tr; 965 ctrlr = qpair->ctrlr; 966 | 960 961 mtx_assert(&qpair->lock, MA_OWNED); 962 963 req = tr->req; 964 req->cmd.cid = tr->cid; 965 qpair->act_tr[tr->cid] = tr; 966 ctrlr = qpair->ctrlr; 967 |
967 if (req->timeout) 968 callout_reset_on(&tr->timer, ctrlr->timeout_period * hz, 969 nvme_timeout, tr, qpair->cpu); | 968 if (req->timeout) { 969 if (req->cb_fn == nvme_completion_poll_cb) 970 timeout = hz; 971 else 972 timeout = ctrlr->timeout_period * hz; 973 callout_reset_on(&tr->timer, timeout, nvme_timeout, tr, 974 qpair->cpu); 975 } |
970 971 /* Copy the command from the tracker to the submission queue. */ 972 memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd)); 973 974 if (++qpair->sq_tail == qpair->num_entries) 975 qpair->sq_tail = 0; 976 977 bus_dmamap_sync(qpair->dma_tag, qpair->queuemem_map, --- 319 unchanged lines hidden --- | 976 977 /* Copy the command from the tracker to the submission queue. */ 978 memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd)); 979 980 if (++qpair->sq_tail == qpair->num_entries) 981 qpair->sq_tail = 0; 982 983 bus_dmamap_sync(qpair->dma_tag, qpair->queuemem_map, --- 319 unchanged lines hidden --- |