Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2090375pxb; Mon, 12 Apr 2021 14:11:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyzFYwzWJ58ol5BGx25CRIMvsdBnXZFc09j95NkvislIhqWRt+wqiIXJlhXlAvcorF5759 X-Received: by 2002:a17:906:39c1:: with SMTP id i1mr4877656eje.59.1618261899771; Mon, 12 Apr 2021 14:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618261899; cv=none; d=google.com; s=arc-20160816; b=np1h9RVQpg6uUlLky4B8apM64yCP6A388BblJvWbR6hFsxgvQDmEERTBD8izjH6hHl fGdPk83/1cBthQkA3REvbMgkqznqvmzc2AHcfo5yf97M9V7NaYC5nQXn1YLVWCLF/0pA Ov+NCLs/4xfhITLyQRFegWaC1qJ1SaHR49115ffPN55a0NzxGUp01b39bIYkX94TjdDB OciGZ6ablJpe2PWU/yUFnnpBuq+im+bno3JccFGUftIPPIOev/rEFNauGqZ/4ygEW3Zj FrwQhS1Df1CVCgY05g8GAtac902v+MeVaQue/4a3JauPRJreWkvsVgtZzQq4WQEwK2z7 FCnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DJVxHIzoS2AM/VkhBhzIGpMXUo0PyVzBmskZBWo+los=; b=aLdLxAgELnAMka1Pjr+QuSAYrY2CqGJBljliSP3+67LNZRH+hecJYMSXIqso86O+b2 kNBVt4LTq/v2kB8zIcydhl37WaGXb7nH2vcOEdTv09P66HZf2AYi2g8qny4QBqvqKNGj DjQEyFYPMY9vhYA2ltE8l/Nz/x6B4LzB8au/piJetPiiauhB+oyTpVg6c5JHVIi0HGfV p3HH1ak19rm/0AWaO1COHcoC96tDy1zriLUWf8zhQgYzjZUE1MJPE2BOI4IvkvzVqP4h bk5IMySxzoCc7RPFPv3W6iStKOAUpseeUHWM6sWLoiC2fTFb9E9h+YNufEy+QLuMsh3G ogDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="fxuy/edS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb29si7735628ejc.299.2021.04.12.14.11.16; Mon, 12 Apr 2021 14:11:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="fxuy/edS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241007AbhDLJLX (ORCPT + 99 others); Mon, 12 Apr 2021 05:11:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:48564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238162AbhDLI4Q (ORCPT ); Mon, 12 Apr 2021 04:56:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1D64261247; Mon, 12 Apr 2021 08:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618217758; bh=y9BdYH5Ih/9IU/eOavv8X8ywaqOgYZNk2Ct53NI6eP4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fxuy/edS8XwzC234QiTCo7K34Iwn4qnqgEtL6VBdsjLpi8hMNBxpmhFZrjoKAHOWe A4pE8iZ+uqmrcztOVY5Il4DHPICsST4CyEnn0Vfb3MfbRZb76J8bFUwE0iJn4bsNeE LUTRFqXYFh5T/Q3IMg6GgXze/YE2McdoAzDj/YTU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Jurgens , Parav Pandit , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 133/188] net/mlx5: Dont request more than supported EQs Date: Mon, 12 Apr 2021 10:40:47 +0200 Message-Id: <20210412084018.060444740@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412084013.643370347@linuxfoundation.org> References: <20210412084013.643370347@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Jurgens [ Upstream commit a7b76002ae78cd230ee652ccdfedf21aa94fcecc ] Calculating the number of compeltion EQs based on the number of available IRQ vectors doesn't work now that all async EQs share one IRQ. Thus the max number of EQs can be exceeded on systems with more than approximately 256 CPUs. Take this into account when calculating the number of available completion EQs. Fixes: 81bfa206032a ("net/mlx5: Use a single IRQ for all async EQs") Signed-off-by: Daniel Jurgens Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 8ebfe782f95e..ccd53a7a2b80 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -926,13 +926,24 @@ void mlx5_core_eq_free_irqs(struct mlx5_core_dev *dev) mutex_unlock(&table->lock); } +#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING +#define MLX5_MAX_ASYNC_EQS 4 +#else +#define MLX5_MAX_ASYNC_EQS 3 +#endif + int mlx5_eq_table_create(struct mlx5_core_dev *dev) { struct mlx5_eq_table *eq_table = dev->priv.eq_table; + int num_eqs = MLX5_CAP_GEN(dev, max_num_eqs) ? + MLX5_CAP_GEN(dev, max_num_eqs) : + 1 << MLX5_CAP_GEN(dev, log_max_eq); int err; eq_table->num_comp_eqs = - mlx5_irq_get_num_comp(eq_table->irq_table); + min_t(int, + mlx5_irq_get_num_comp(eq_table->irq_table), + num_eqs - MLX5_MAX_ASYNC_EQS); err = create_async_eqs(dev); if (err) { -- 2.30.2