Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1938979ima; Thu, 25 Oct 2018 07:18:08 -0700 (PDT) X-Google-Smtp-Source: AJdET5dCcnaDwcWSpoiNnISzbzGXhYwE79C1RHejL0FzM7LMUVWKluCLUPn0Bbd2kOmJPF0Pz0Ur X-Received: by 2002:a63:3dcb:: with SMTP id k194-v6mr1644831pga.191.1540477087944; Thu, 25 Oct 2018 07:18:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477087; cv=none; d=google.com; s=arc-20160816; b=Ua0/4ZfEacj+hcyBN28b6qAdUUrsA5n0o8gaCiRULvKOzMlEBn0QVveG+fJe2kPB6Q 76nmnzrI7OSJkDK3NBAnVKNNRZtw5jb6Kzm+j33FXhnfvowp0txCNdXKXtyTmMENdmqj zC6PC3YaY4nHAyTE+RE0U40nT64bZ0MaiNPnhNbmST2RhdTaxN/CSL6vrbBhIsapEgsJ 2+YkCo91NrWnpzmlLyB0j4UCb8vPPW8i3hW4joScbWW2/AmqJL322ZOy8CNK9cCKOgZd kFVqa0SHqdMnXRdXghUJNtMooWr6ZpoHzc788wusIPXfTF2qz+sc3tzlSDstfDUvDfyp Z6wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=9wrumm4+fRVm2dA0eHFPEfl79tQPsD5ccQ1z8S5GxLE=; b=K0SUjS/UL3IrVSc7fu7e8wSWpO9roEUwa8mgAeStFj0QkdZWndzLbuQ1xx/R3e8NZZ qAzQZvRp6RdGKk/wscObw58vVkqDo0KjoHuzPzY+yDQ9fO3uYVNe3hh2in8WjTu1E4Kw hqSuHK4/iuJT8YHMle61jOBia93Ui7HB5dgvPQkrvCnSqfrkIQOsgB2Qw0W6kLXRqX9D xlv0gYOLSzxBu/9BTCgJBCkBjgJCRWsgK5RsvfhdVMZlaQKKzfXjFCmI3D00sSOqGvZz 281pzS7RtWgu4oNImeG3qn5ZilS95gj/yWCR14ayj7DAd+62wIydtSkcdsRZ4j6zvIOo l0lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V9DGFrns; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba7-v6si7971694plb.8.2018.10.25.07.17.24; Thu, 25 Oct 2018 07:18:07 -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=V9DGFrns; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727656AbeJYWrB (ORCPT + 99 others); Thu, 25 Oct 2018 18:47:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:52848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728020AbeJYWoN (ORCPT ); Thu, 25 Oct 2018 18:44:13 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9DF7B2054F; Thu, 25 Oct 2018 14:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476677; bh=3qnM154ns53NrXPyFocqysseUqcJO2lWWxX6sYubi1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V9DGFrnsfDnYrgEEmeGgH9NCYeGevt/UNvEEVqEtFEDcnIPVRdgQVzwYVmZoelMGK ytZTZzIzrkPK15e/9EmtQty7iiYXFGlQcsqmuMxYd0AZ4QMRz1L6cggqSVaNHlFige xSeDPGIHVe7jdoLJUIzdsA2wIwUKWFqgst1RUi9g= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Shay Agroskin , Saeed Mahameed , Sasha Levin Subject: [PATCH AUTOSEL 4.14 16/46] net/mlx5e: Refine ets validation function Date: Thu, 25 Oct 2018 10:10:23 -0400 Message-Id: <20181025141053.213330-16-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141053.213330-1-sashal@kernel.org> References: <20181025141053.213330-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shay Agroskin [ Upstream commit e279d634f3d57452eb106a0c0e99a6add3fba1a6 ] Removed an error message received when configuring ETS total bandwidth to be zero. Our hardware doesn't support such configuration, so we shall reject it in the driver. Nevertheless, we removed the error message in order to eliminate error messages caused by old userspace tools who try to pass such configuration. Fixes: ff0891915cd7 ("net/mlx5e: Fix ETS BW check") Signed-off-by: Shay Agroskin Reviewed-by: Huy Nguyen Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- .../net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c index 9d64d0759ee9..a5dd99aaf321 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c @@ -257,7 +257,8 @@ int mlx5e_dcbnl_ieee_setets_core(struct mlx5e_priv *priv, struct ieee_ets *ets) } static int mlx5e_dbcnl_validate_ets(struct net_device *netdev, - struct ieee_ets *ets) + struct ieee_ets *ets, + bool zero_sum_allowed) { bool have_ets_tc = false; int bw_sum = 0; @@ -282,8 +283,9 @@ static int mlx5e_dbcnl_validate_ets(struct net_device *netdev, } if (have_ets_tc && bw_sum != 100) { - netdev_err(netdev, - "Failed to validate ETS: BW sum is illegal\n"); + if (bw_sum || (!bw_sum && !zero_sum_allowed)) + netdev_err(netdev, + "Failed to validate ETS: BW sum is illegal\n"); return -EINVAL; } return 0; @@ -298,7 +300,7 @@ static int mlx5e_dcbnl_ieee_setets(struct net_device *netdev, if (!MLX5_CAP_GEN(priv->mdev, ets)) return -EOPNOTSUPP; - err = mlx5e_dbcnl_validate_ets(netdev, ets); + err = mlx5e_dbcnl_validate_ets(netdev, ets, false); if (err) return err; @@ -477,12 +479,9 @@ static u8 mlx5e_dcbnl_setall(struct net_device *netdev) ets.prio_tc[i] = cee_cfg->prio_to_pg_map[i]; } - err = mlx5e_dbcnl_validate_ets(netdev, &ets); - if (err) { - netdev_err(netdev, - "%s, Failed to validate ETS: %d\n", __func__, err); + err = mlx5e_dbcnl_validate_ets(netdev, &ets, true); + if (err) goto out; - } err = mlx5e_dcbnl_ieee_setets_core(priv, &ets); if (err) { -- 2.17.1