Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9932532ybi; Wed, 24 Jul 2019 12:34:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwD+yCYdm1zqcie9fNuDRYIyd9/7wW1CoKWH3TwORij/wUJvfF2O5Un4e7if1jyKnj+Odyg X-Received: by 2002:aa7:9118:: with SMTP id 24mr12370543pfh.56.1563996854777; Wed, 24 Jul 2019 12:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996854; cv=none; d=google.com; s=arc-20160816; b=MY0Tnxu3KfdGh5xktyESgGDc/KcY6WNqiW4R3bmZO35Nsw0zYWdVN/uDTQ2QioyUby 9M0JztSVDF6U0Dcwl6f+we5i10balGgFCJDWT4BvCUQNAk88xXEdafJ9BfwRSJv11LOY WsRapUFx5GrLBB0szHvBIdUMJ0UHYqEv4i1FeAeN+qDa1ye0qCWZPo7skGNgkzBuK0j8 /8+dde1P0taM4xsRkRasddDLfrxF0qoxme8yKp2QJr7pRRqyKDXJzrquUbd3O0QwovhE zdGETGzN/I3myFAE0U8iHTY1xNOw/soaG/6p6pKQ9h8OXuiVLFtIh9vsiEnAWdY3+BDn pAXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m2AXeFYF8I2QkjhTPwvTFX5toKSjvKvDTNZP5ZVJLt0=; b=zqmwbSmws3PWc/lrhv/sWIe+MQJ4imoV0HS5FBmU4lgFMDawEHPCI60+6jHJp0K9v3 Uatk9YoGL+g2Z6eF+b7IYOwuhA60gzHuZMNDowZlImutRv3iQ3UTKJCO9Dme5QRF4TVK K6OXuKlERhZaPbl5hBo3UDIkTEDpa8dT6CSh+BYgUUj55UF6gpousy/Q8GnFR5rJ9lCL W4kcSK7aHmXIj8HNIwV5lbEV4AMp4b14u+KuKIxki3iDIz4LgE/9FmEuZYyZkwSYPTQt db488LlgAuyB6NCTJFodr5glhUL/4kxWUYK09NoC3VBEs+djAt5DkIQEulZnyJ1eiC6W IKkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cpFajIzU; 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 200si14876741pfy.101.2019.07.24.12.34.00; Wed, 24 Jul 2019 12:34:14 -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=cpFajIzU; 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 S2388467AbfGXTdH (ORCPT + 99 others); Wed, 24 Jul 2019 15:33:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:54700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388019AbfGXTdF (ORCPT ); Wed, 24 Jul 2019 15:33:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 0E9A420659; Wed, 24 Jul 2019 19:33:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996784; bh=fGViM72xunB7ZwdcjFaAKYyenVrGpIvI/BwNCmWQzEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cpFajIzUa8AWJAya7xpwmNosQMNSeeE1QHwTEz9Qe5nZlHPB5aGywnAeVLlNttKJM vYkGagLBK+DdNaD4KOErEtWpHlUt+kIJCOatnKGLEe1uHvgXVk5dkORMuUPqEqDoRa XXQ0ViVOppQ632OEb+6HYDrJegeXkc6KkQNyRMHE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Chan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.2 208/413] bnxt_en: Cap the returned MSIX vectors to the RDMA driver. Date: Wed, 24 Jul 2019 21:18:19 +0200 Message-Id: <20190724191749.380049060@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 1dbc59fa4bbaa108b641cd65a54f662b75e4ed36 ] In an earlier commit to improve NQ reservations on 57500 chips, we set the resv_irqs on the 57500 VFs to the fixed value assigned by the PF regardless of how many are actually used. The current code assumes that resv_irqs minus the ones used by the network driver must be the ones for the RDMA driver. This is no longer true and we may return more MSIX vectors than requested, causing inconsistency. Fix it by capping the value. Fixes: 01989c6b69d9 ("bnxt_en: Improve NQ reservations.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c index bfa342a98d08..fc77caf0a076 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c @@ -157,8 +157,10 @@ static int bnxt_req_msix_vecs(struct bnxt_en_dev *edev, int ulp_id, if (BNXT_NEW_RM(bp)) { struct bnxt_hw_resc *hw_resc = &bp->hw_resc; + int resv_msix; - avail_msix = hw_resc->resv_irqs - bp->cp_nr_rings; + resv_msix = hw_resc->resv_irqs - bp->cp_nr_rings; + avail_msix = min_t(int, resv_msix, avail_msix); edev->ulp_tbl[ulp_id].msix_requested = avail_msix; } bnxt_fill_msix_vecs(bp, ent); -- 2.20.1