Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2009134imm; Thu, 24 May 2018 04:27:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq9efUkN7ijDL7qUwDd80moLTL/VoStoelq+AfDTHYO9IugXqE4dP35SyGYbZLfaQiq9sWn X-Received: by 2002:a65:5784:: with SMTP id b4-v6mr5566611pgr.317.1527161243995; Thu, 24 May 2018 04:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527161243; cv=none; d=google.com; s=arc-20160816; b=DNoSlp/2uWYP/FxChfc8HbahTqmJ5sVvcI5YMl4ZZU8JDJNTeNuoIQ6XXQ0drmJTJF /96zGXdrdroksVAUVYj24iXxD6uDV15KaBrEh3nsLTa/cqX2OPBaeh2ig9mw42owP5X6 BMBtgyRC651raGw1ebYH7Big66aBzK12SEeKVxipjpihC4fxhHTbUMCB9SzlTzSSBdLg pVrniHBvgabbjRBwOP8xGX/TTOjKlV9aqSxlvSCjWXjLf4oRhjttpFl41KY45F0jWwvn pHGZqT7FVW0ZVQGEziGgLzL+Z9WrrI+xu9QDny6CaCBxqAbItCw3IBw2PLhMd+IcVA1S d2SQ== 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=mfn15vjQEjiPE2SmYHBwwYexrSV0sWQf3jOsRnf/W+4=; b=ofUcN4J1X6uRJH7j9isOPogEUIZ4k5pcTSzWFEtTM6sSywpgkpXpNAqyqCVvcyRjwq rm/RQmzrbSxDOhxT08hqYb71ErzM82MF3kmftcbXM+NZyKKfzS6guJfSQZPpR/dQxqjm nzyUyKEyCX4ASLtPeyG8hOPhQ96aoy+J8MBeu4WjBczJniYB/r8yxQAI8gWY94ybFaXB UckjuIixDgrUGjPDMLSMMZCToqFruaDaIts3lAJxIJM+G+MDNrqQwAx5KLEe9jGf1hgm nBAAvwRhyYAxX3MXA2c8WIetuG+6mZs7us+zaPfcz/s0z/kekeZ7v8oqzTUuBWA9fXTi IG/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XmFpLPdc; 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 b73-v6si21731796pli.305.2018.05.24.04.27.09; Thu, 24 May 2018 04:27:23 -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=XmFpLPdc; 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 S967730AbeEXJvf (ORCPT + 99 others); Thu, 24 May 2018 05:51:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:46422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967687AbeEXJvV (ORCPT ); Thu, 24 May 2018 05:51:21 -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 EA68B208A0; Thu, 24 May 2018 09:51:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155481; bh=r4AQjwPXfwTd3MNSM20FCpEj9AX5QCZDvzlLQzWqSZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XmFpLPdc+rwhzzhvQXM1jNZPphQbJHp7Kwi8iQONsEdCb03LYyYL/+dcKRtJXH1CN c42U+hY1bTylEI1d1qhVaSBYfXd6mKNaG5tLr/kLFAymCZRgBQSEQF+eF0FFzJhYJs tkIOy0EdG53dRc7X60FwaLCGt83tzxBd6+emhKW4= 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.9 66/96] scsi: lpfc: Fix frequency of Release WQE CQEs Date: Thu, 24 May 2018 11:38:49 +0200 Message-Id: <20180524093609.230100675@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@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.9-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 @@ -116,6 +116,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);