nvme/pcie: mark infrequent cases as unlikely in submission path
Currently infrequent cases in request completion path are marked as unlikely. This patch applies that to submission path. These cases are infrequent and marked using unlikely marco: a. The sq tail reaches the end of queue. b. The sq tail equals to sq head. (never happen if FW runs correctly) c. The qpair is admin queue. Change-Id: I8b873a18615788f2efbf7c683aad710c7007a082 Signed-off-by: lorneli <lorneli@163.com> Reviewed-on: https://review.gerrithub.io/c/443451 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
a4968634f1
commit
4b6621d08e
@ -1196,11 +1196,11 @@ nvme_pcie_qpair_submit_tracker(struct spdk_nvme_qpair *qpair, struct nvme_tracke
|
||||
/* Copy the command from the tracker to the submission queue. */
|
||||
nvme_pcie_copy_command(&pqpair->cmd[pqpair->sq_tail], &req->cmd);
|
||||
|
||||
if (++pqpair->sq_tail == pqpair->num_entries) {
|
||||
if (spdk_unlikely(++pqpair->sq_tail == pqpair->num_entries)) {
|
||||
pqpair->sq_tail = 0;
|
||||
}
|
||||
|
||||
if (pqpair->sq_tail == pqpair->sq_head) {
|
||||
if (spdk_unlikely(pqpair->sq_tail == pqpair->sq_head)) {
|
||||
SPDK_ERRLOG("sq_tail is passing sq_head!\n");
|
||||
}
|
||||
|
||||
@ -1940,7 +1940,7 @@ nvme_pcie_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_reques
|
||||
|
||||
nvme_pcie_qpair_check_enabled(qpair);
|
||||
|
||||
if (nvme_qpair_is_admin_queue(qpair)) {
|
||||
if (spdk_unlikely(nvme_qpair_is_admin_queue(qpair))) {
|
||||
nvme_robust_mutex_lock(&ctrlr->ctrlr_lock);
|
||||
}
|
||||
|
||||
@ -1999,7 +1999,7 @@ nvme_pcie_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_reques
|
||||
nvme_pcie_qpair_submit_tracker(qpair, tr);
|
||||
|
||||
exit:
|
||||
if (nvme_qpair_is_admin_queue(qpair)) {
|
||||
if (spdk_unlikely(nvme_qpair_is_admin_queue(qpair))) {
|
||||
nvme_robust_mutex_unlock(&ctrlr->ctrlr_lock);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user