Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1940850imm; Thu, 24 May 2018 03:18:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq2mLT7wJT/e717zfrxyw3GbTdflAO8EYsCQq01Q0sBbpBzVS6vJbk6ZCRZ1Fz6uWji6O2p X-Received: by 2002:a62:dc8a:: with SMTP id c10-v6mr6647705pfl.183.1527157085797; Thu, 24 May 2018 03:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157085; cv=none; d=google.com; s=arc-20160816; b=UHJj5R1npo4efDt4WlzzZXkg+EYd2YjSAlzRam7eRNvmlAV+1RtSP3DMBAY5KKbcnR QYY0hvMcSdQRfLgDS5QJOUi24WvCidzmZQsKBVw7uFTWn2U1wAu9C2dr6NzCApHE1xaq DflPSWpff8FEvaYKFyd6JeWp5Bzsk+t2s8bg3soHTMWP8hcaqkXK3TmKgJqXF5lXPkF2 SEYiAV0azSm9dKw089DYpdDEYv2gtNMlFJvmoD6FltSoipuVqZe0gskdyyTtlshjgrgF a/DWHK7BUnRuF/tbo7dutLP8TjDIK35hPgFbXYYvS/FPG73v8Bp6qb9K3yHhupJnb13w UE4A== 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=TskIUPYwtRdriD8ODD4LNzq0VdRDeXxMS7hcvWBxkDo=; b=YygEGbNXGUpdSo56f6HCchC3+s6BZn2txwCxsgrFQ/mRvpnDTB5FLAPu3b3YsNl6I9 nBOhbyurvA42c1amZe2fpe4kyY70NYHvkFKNN+pkkcjE+dDtXa9GQwxD4yZUIw86vLdV qdkJOzirYuudvyl1VYJ+OBn57imZdYpybYIMNp0qdkEdfej+oLYewUW2mI/b4XBKz4S/ wXK0Kh+8LsOt4EnS6EHo6qK2ZSMcWI9y4QgPJuoc+1fucIsEbHSCa2VIX8Rp7LeckqFy vfLKNYk22NUGfLsbugmB8kUt+E+Wrara024+tCzKSf6VmJC90vxnxTM2GUi93h05oe7U 8R1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=D6hgJNIG; 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 a33-v6si20438858pli.275.2018.05.24.03.17.51; Thu, 24 May 2018 03:18:05 -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=D6hgJNIG; 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 S1031823AbeEXKRD (ORCPT + 99 others); Thu, 24 May 2018 06:17:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:53550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031048AbeEXKEF (ORCPT ); Thu, 24 May 2018 06:04:05 -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 548DA20896; Thu, 24 May 2018 10:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156244; bh=c+wBuNIg73CCJ0nrGMehCx4Q90fg4QPsaU3nbM21AZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D6hgJNIG0p1JVsnWrIFJwfCafY4OcAWddj6nMqBKKD5jm9IC5czlcu1VYge7LwO4m ReH3ap5xcTXiTvMIVcY1emNpLIe83aSD7JcwZRJ202Y631EtRhDZ5DvQ2d5l4asxGG T0iw1EnKoOjq60wRaqPZ0+eNC9/sCyzXduiw7ZiE= 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.16 116/161] scsi: lpfc: Fix frequency of Release WQE CQEs Date: Thu, 24 May 2018 11:39:01 +0200 Message-Id: <20180524093032.229085394@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@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.16-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);