Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1921540imm; Thu, 24 May 2018 02:59:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqzXMVgt6Nd2er+NUjH1zLLgDjO6D8dBxeLCRrTmHFRZNSiR+nbp7FDY9+smzJCTf/bBuLR X-Received: by 2002:a62:c81d:: with SMTP id z29-v6mr6515821pff.81.1527155961400; Thu, 24 May 2018 02:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527155961; cv=none; d=google.com; s=arc-20160816; b=MCT1LyylkGeB+5+oClOjYaMglfLnn1D65KT31vMkGOoCTAYq9Hw9msvi0sOaKsF9cw l+llgwH+HstjnLvSHQscBMCuEF6zGQwPbNBnCZcit5l0sYPIWWl4jnfn8xY4S8lbuW3c /k38TOg7EwtXyIbJoiJZra9XI4KLY3o1ldU/IgYzUYJ/tEQYiX72O8bfmDBRiCO0OA6M PHw3zGRpUI0xdik8tLvXLUuXaicyI6/ZFkmoO/oRU2qfkZGnNGxYoiIKJOWEGxKyaUwt aZ6SBlOhlzklynv/xb4CSvFrX9R6blKNrKE6plDqUIAYSNUu8rqaRlhbrmDEmnApAc7l q+bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=k/LgmGRLyScnzi0ssst2w36G/+Cjdt6k35NGKATXOJc=; b=nRMsn3PsTbUi2V+keL9IZ8tguKTv7MKy5K/YgnA2ESuKcGKS2KG+5tqfkGO76H4V1J 52pvVht3yK+ihPBXKivU97PO78e+vW94kK4FkDsUGbI/xxPxJPvViNwp+cHY4DZArm9P 0MTjjrmjml4FuasClaYeINC3JBmQnuHC8ej0oS1cooEFLyqZbOt4dCyzL1u1E/6fjtwL kOSkxqsnMbpQyZ68qe3+SrZgPK+bn5Ndo+DmZvoDxVeMOvt2FIOLN1ML9lEC3sXcYwSX OFAQ+T+2yA+5rJyi9F6uXzL2nihSoaZXwlVuhEIrcF241FjOm/7leFjseeD/SPVtMhUI EL7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IfL9M1zS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 127-v6si20996243pfe.49.2018.05.24.02.59.06; Thu, 24 May 2018 02:59:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IfL9M1zS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030594AbeEXJ6T (ORCPT + 99 others); Thu, 24 May 2018 05:58:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:37972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030466AbeEXJ6K (ORCPT ); Thu, 24 May 2018 05:58:10 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D490D20870; Thu, 24 May 2018 09:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155890; bh=VB3oeEnllLhBjhyE5WCP+p1LczGbF6we3wGY2dPc0zE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IfL9M1zSUMqZSMd1le1f3gw7rpJr3wi3CkItw1I/xeAnEd9We0nnJvB8lmOl9R56F /0PytBWN3gXIP/MF7OBZQQCyQePa5RonPdiBNY4U8FKKuRU3Znd4gD1G5D6sxt7b9Q jxekkoyGKvZpleBjKVFdWiAw8IGP9YZI/o0vPYzs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , Hannes Reinecke , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 120/165] scsi: lpfc: Fix frequency of Release WQE CQEs Date: Thu, 24 May 2018 11:38:46 +0200 Message-Id: <20180524093626.861650361@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Smart [ Upstream commit 04673e38f56b30cd39b1fa0f386137d818b17781 ] The driver controls when the hardware sends completions that communicate consumption of elements from the WQ. This is done by setting a WQEC bit on a WQE. The current driver sets it on every Nth WQE posting. However, the driver isn't clearing the bit if the WQE is reused. Thus, if the queue depth isn't evenly divisible by N, with enough time, it can be set on every element, creating a lot of overhead and risking CQ full conditions. Correct by clearing the bit when not setting it on an Nth element. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/lpfc/lpfc_sli.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -129,6 +129,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, u /* set consumption flag every once in a while */ if (!((q->host_index + 1) % q->entry_repost)) bf_set(wqe_wqec, &wqe->generic.wqe_com, 1); + else + bf_set(wqe_wqec, &wqe->generic.wqe_com, 0); if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED) bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id); lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size);