Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp829715ybl; Wed, 11 Dec 2019 08:08:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzaTLfX0qpkBTGUygQRwcPCrwkwhwawmKFsOsbZ7D8yXx3XVFLnsSopOQf0gktkhZAPMIp+ X-Received: by 2002:a9d:7a88:: with SMTP id l8mr2927127otn.187.1576080503025; Wed, 11 Dec 2019 08:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576080503; cv=none; d=google.com; s=arc-20160816; b=Ktai6wb1QD9lr4UKEYmegwkZY3re5ps1eQyqyX/wHntaB97HgI99zZNxNolXNFwiFC 3RvlsFqsxHteJbQeeOswoiRul12CO6/wge7ZUxB36vCGd0wC7YhDf/9jkMxObm+AM3zc b35SQjT8kPSFhcMUQe50NafEtDwuGoO7F62guw7F4+ADiGlrTSa+B9eEVC1lMawx197w 5t9czROWR17TBmSg0oHLR5tYpOOveYFnrCZ/gV+Q6adPYpY1CuXXOYu/5vjuKh8Fk8g3 HIfXyaqCVxK8L2IIeReRMwPa5cdh7Nrl1gZG+kO+TTL2aSjKdGbK13kCO+GVNoY5+3EC 8mkw== 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=9NjYXXHHyw99QH7bmPmYgdwLs5aEjM7h7Q5MSPyfSlI=; b=vccl9j78b0lsUD9klPkz1xXfz6UNOeUL9/8My5bBmWRCZlhUdAYwyhToV8DmOPDwPS 1PBb0qIxxqXMrPce3iVM9hrYqYikutLwnjMgOP71hakCMPlR41eb0kTiywSXKG46fNGM drBCR+Uc3WXFHcHriXJ3La28Cc3kAbULkDKnTtkESMpQwaWGdXw5OO/OwP0jWLqiv25q JNKmyLGMIhNXgjfqG/cSM9TB9ZTXg46l47XKLW0lplxGM37S1golmKPZ+hueTvTAB+oq zOGVBVhTJDjgDqZN8pK9WbXv6nJjLL5RnW9DuvWEXvsdJ+j0N2JLOYMTV87O+e3YC5xW DTzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WodKHoJ2; 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 o25si1325926oic.63.2019.12.11.08.08.11; Wed, 11 Dec 2019 08:08:23 -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=WodKHoJ2; 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 S2388823AbfLKQFp (ORCPT + 99 others); Wed, 11 Dec 2019 11:05:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:35052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731210AbfLKPMq (ORCPT ); Wed, 11 Dec 2019 10:12:46 -0500 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 D36A22464B; Wed, 11 Dec 2019 15:12:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077166; bh=8VCYKCYLmWQwWUoJfqKJ05SIdKRPFsPGHNN+S7jyXK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WodKHoJ2tj1hh6PQRfLb5WPEmPg+ISHdZahJPjUmusZQgBTmh8PLN1TSVlc9YXaJa RYgDEPHh9ysSy6NUzuryuW3zOZL6sK4yGiIVxZkxv3zLcvFaasSOpEV1Od+MA5h8Vp xfcI7v2hA+H1b3j/tcMKw3CwAhS/f77n55JuKEb8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yonglong Liu , Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.3 040/105] net: hns3: fix ETS bandwidth validation bug Date: Wed, 11 Dec 2019 16:05:29 +0100 Message-Id: <20191211150237.197851307@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@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 From: Yonglong Liu [ Upstream commit c2d56897819338eb0ba8b93184f7d10329b36653 ] Some device only support 4 TCs, but the driver check the total bandwidth of 8 TCs, so may cause wrong configurations write to the hw. This patch uses hdev->tc_max to instead HNAE3_MAX_TC to fix it. Fixes: e432abfb99e5 ("net: hns3: add common validation in hclge_dcb") Signed-off-by: Yonglong Liu Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c index d9136a199d8db..f5c323e798343 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c @@ -124,7 +124,7 @@ static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets, if (ret) return ret; - for (i = 0; i < HNAE3_MAX_TC; i++) { + for (i = 0; i < hdev->tc_max; i++) { switch (ets->tc_tsa[i]) { case IEEE_8021QAZ_TSA_STRICT: if (hdev->tm_info.tc_info[i].tc_sch_mode != -- 2.20.1