]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.44/scsi-lpfc-fix-frequency-of-release-wqe-cqes.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.44 / scsi-lpfc-fix-frequency-of-release-wqe-cqes.patch
1 From foo@baz Thu May 24 11:09:34 CEST 2018
2 From: James Smart <jsmart2021@gmail.com>
3 Date: Tue, 30 Jan 2018 15:58:45 -0800
4 Subject: scsi: lpfc: Fix frequency of Release WQE CQEs
5
6 From: James Smart <jsmart2021@gmail.com>
7
8 [ Upstream commit 04673e38f56b30cd39b1fa0f386137d818b17781 ]
9
10 The driver controls when the hardware sends completions that communicate
11 consumption of elements from the WQ. This is done by setting a WQEC bit
12 on a WQE.
13
14 The current driver sets it on every Nth WQE posting. However, the driver
15 isn't clearing the bit if the WQE is reused. Thus, if the queue depth
16 isn't evenly divisible by N, with enough time, it can be set on every
17 element, creating a lot of overhead and risking CQ full conditions.
18
19 Correct by clearing the bit when not setting it on an Nth element.
20
21 Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
22 Signed-off-by: James Smart <james.smart@broadcom.com>
23 Reviewed-by: Hannes Reinecke <hare@suse.com>
24 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
25 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 ---
28 drivers/scsi/lpfc/lpfc_sli.c | 2 ++
29 1 file changed, 2 insertions(+)
30
31 --- a/drivers/scsi/lpfc/lpfc_sli.c
32 +++ b/drivers/scsi/lpfc/lpfc_sli.c
33 @@ -129,6 +129,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, u
34 /* set consumption flag every once in a while */
35 if (!((q->host_index + 1) % q->entry_repost))
36 bf_set(wqe_wqec, &wqe->generic.wqe_com, 1);
37 + else
38 + bf_set(wqe_wqec, &wqe->generic.wqe_com, 0);
39 if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED)
40 bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id);
41 lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size);