Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2495725imm; Mon, 28 May 2018 09:09:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqhiObjspZZa/35L7uRv1rZcD1ty6U4ZJ+Hbve7n5pw8rP/v4Ksy5OJZpkq/ltf6fIkEIKs X-Received: by 2002:a63:9205:: with SMTP id o5-v6mr11103512pgd.233.1527523798750; Mon, 28 May 2018 09:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527523798; cv=none; d=google.com; s=arc-20160816; b=zlm+46p4K/5qS1H7VyWFEEsRwRM6Gek/EWcwpp3eUoYteoSEV1Sbth834rXIoas9nk frUvX1RtL0O3LTFPUv94htJcROu+XJL2i2XlilmBgHU+xWNUPVhIZWM8mN+Jmi7LW6A2 egcqF9eI1TjG35nvD3B4m1P1RrzSsbRW7U1DxbXIrGt2BHCLf6dutMhYvtjCpGvHcz67 X+Hj/Ie901UrCo0ImzCexQ5HLatuU+yipZgdu39L4hR+2nYXgDVrPxhGkwDGRifBvMiX XREoubJ4txrkwbEXDAwq08XO+LEikBR1Mh9KOYnCWvpCHb+99tbFKVWTYH3mISGNZE7Q hISw== 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=WBdGleJr48+Di9Ox7cqaKe9sFOped566xm/BzSS3zxc=; b=I0gwQBj32MYAfr1Vpz++RMtFOVWvQ9l1bWUw/TInaf+LDzhyBu/Lw4qqGMVfKHkebx iS05HtL2oZBD07QHQ6A2dbwSZZP0pOOwBAq4HFFrT//aiDN5Zg7/sDdRH6RQi4Yy7qKa Ebq5eT6oif5dbIYUT/0nXacg3jym6EZKee3fKbvFZ1Mm97uS7/mvL9gbScU5pfN/kKcM gfbYgcd3766tKDdpdmR8+grUmR7hysUvoWokLXo1ulEvSpsB6o/w59g/IWksaLLyecO0 vxtnYUKQgB2+Q/lc3/MO909sVU+Jo8agrRnpLA8Gqaljw7aV1xFVUFWqGmcrQygrNpV+ QCFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YIz4exjC; 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 t1-v6si3628848pge.439.2018.05.28.09.09.43; Mon, 28 May 2018 09:09:58 -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=YIz4exjC; 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 S965653AbeE1KOE (ORCPT + 99 others); Mon, 28 May 2018 06:14:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:33658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936793AbeE1KNt (ORCPT ); Mon, 28 May 2018 06:13:49 -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 4435E20843; Mon, 28 May 2018 10:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502428; bh=pB54YvqBMb4FqLQ5ndBF4ReYc6eNB7q3TnMBWAcdF/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YIz4exjCk+f21EmLx8CAmYoKGnfR2CQfJiRnCws2XPvLEKji7C/Ww//rVJ66dyDVU DPgcZSgx7NOLk9q8t+fP5K7z4BfCMazP7GF+p287XDaSfdZA6Cmhm6BBP7DrYHKfux WoUQfjqk4AUl5LEGuWnZlw2BPyLhpg8CFLOQc0/4= 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 3.18 183/185] scsi: lpfc: Fix frequency of Release WQE CQEs Date: Mon, 28 May 2018 12:03:44 +0200 Message-Id: <20180528100116.801039780@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@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 3.18-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 @@ -115,6 +115,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);