Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2530009imu; Thu, 29 Nov 2018 06:28:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xz16Y2csuyLLlXopFXdpCQYoSKfG3byNymr6w/xGtupJbc+Er/zttn4U6BnhQsPBUWlol8 X-Received: by 2002:a17:902:9047:: with SMTP id w7mr1704136plz.270.1543501704922; Thu, 29 Nov 2018 06:28:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501704; cv=none; d=google.com; s=arc-20160816; b=WYyfacwXcvzFdjMkCrLzRbTB15+xSUiAM07qUYUMRyVM3Ldt+T1HLiGmvO1HaOfegT Bz6/4BgVk9PxCrn+dIi2UXiZJ+0ZSwcCddjd8vgQ3xHxtzudpgZ88SV3aDPdTqJKeHI6 G+7WC47gOKjnvdZpvtEf+F8JZP7QcOA91flYVdUCPq2rW9YwfHNjN9hysYue/AB7xtzi Gril3fCnWmNw4CX7OwMs3j2QCDRjZ9qLW4GjgPc5GQre/JS5Xe9GRK4yZeKoujX69/KS 7Eim3h1SoNURDKFv19khv+o1BDQ814dXe/DUToNgEyUREQPlNNVYNZdIbAFIE8Du1mfA iIUg== 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=nEF1QFOYFDAeDsn+XzOka1Z0Wpp/jzSxzRNPbyWwY3o=; b=j9MwJNvTySABv4UhQ5tGfW3lBLCSvypvJuAPfRpPfoi904PsszS9xuJhjKOrXeC97N bo07hmZugd/ddtu6AZz34EFJM41C42V+oFQSWrVMAmESgelZCbe+ZFTao6n+KTUt8gnq zSMZgzwsHdeU4h+0qRh010gEW2yY6rT41Ztr3oLMNfjCiT7O4x4RQpeZiOfFRZ1/7lE7 Joh715Z4UG3s0hHavG1B7y8cw30+udszfj8cVbA9sUQsuMNfE6xv8rn55zgCYDDsBEs3 L8qfLRqXYhJkIOpFEEDnqgWIPA9jZmG86lqxkPtbS+7Tgvl4hIWr+rSB+lfdb0PeHfg9 GKKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zEoRwhAg; 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 l3si2274233pld.155.2018.11.29.06.28.09; Thu, 29 Nov 2018 06:28:24 -0800 (PST) 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=zEoRwhAg; 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 S2387713AbeK3BdA (ORCPT + 99 others); Thu, 29 Nov 2018 20:33:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:33354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731824AbeK3BdA (ORCPT ); Thu, 29 Nov 2018 20:33:00 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 0EB802145D; Thu, 29 Nov 2018 14:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501647; bh=92nkkWMo5qQHmGq97ishUOWystyY8x3PIMTUlFNrl8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zEoRwhAgDiZkpZbQhLMJKdzHSllo+ZLzorN7hVWnMuENVnlcfKqlyS/i97CA/RqFz 5uv+Ga3JJx9hpVwdJgmBgmrHgrg8HIRs2fLN7x9/2wln8wxjMLWf9KRsvnIpw/slYH /n76ZSqAZS9ExMcN1fYhW5uxex1zImAl8iKqH/wQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eran Ben Elisha , Jack Morgenstein , Tariq Toukan , "David S. Miller" , Sudip Mukherjee Subject: [PATCH 4.14 082/100] net/mlx4_core: Fix wrong calculation of free counters Date: Thu, 29 Nov 2018 15:12:52 +0100 Message-Id: <20181129140105.864772116@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eran Ben Elisha commit 0bb9fc4f5429ac970181c073aa32e521e20f7b73 upstream. The field res_free indicates the total number of counters which are available for allocation (reserved and unreserved). Fixed a bug where the reserved counters were subtracted from res_free before any allocation was performed. Before this fix, free counters which were not reserved could not be allocated. Fixes: 9de92c60beaa ("net/mlx4_core: Adjust counter grant policy in the resource tracker") Signed-off-by: Eran Ben Elisha Reviewed-by: Jack Morgenstein Signed-off-by: Tariq Toukan Signed-off-by: David S. Miller Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c @@ -611,7 +611,6 @@ int mlx4_init_resource_tracker(struct ml MLX4_MAX_PORTS; else res_alloc->guaranteed[t] = 0; - res_alloc->res_free -= res_alloc->guaranteed[t]; break; default: break;