Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1239063pxu; Mon, 23 Nov 2020 15:38:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJw06gQ9TRUlDruoXcrDPVdqNof/Ohz4sap9LhM+Gg7XgXL6myVGIHOpPA9rNZVUFsPT8uDQ X-Received: by 2002:a17:906:a1cb:: with SMTP id bx11mr172135ejb.508.1606174684623; Mon, 23 Nov 2020 15:38:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174684; cv=none; d=google.com; s=arc-20160816; b=VZCt0s3SFsndyq7fzzxl9cpo8/CeXnmu1XihLjYy9ysQ0aC1byjW6SL2aAo+61vFnQ Ty1bBHoeuoyP97DQu5YHINkfTkA8BnYDGDu46yR/FQopZzikTv5unV7ILgmVf0loVo5L 0oIt8e12/N63dpm7dYYmwAp4b8xVZqqzzXKFPa9NGal5gKu6QQpRaVc2FpzFEVHFCWa6 GG6ipec/9w/KOX0nHo/97qUkUYg8ngEQcFgJwv4KgTBABI5maWHY9HEHRM5EMv2F9z4+ iXg0UMVxSItHbpLYBP5jxMzs0/V4vjsWKKmFK6b5v5x6BscvIsxVnMh+bDb0+E09C3pU CJ/A== 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=4+/lMJkYgNSasbcy8larELBRts/BN9awW3maA5NmUqU=; b=bUgXG2uOw7RD/cIbC7MytWu19VAUko+A/q3ukXRuqlEGCXgMVVHuAr4qBtx3nfVrur mNbdFzbBgwllUrr6G3RYx7TtsDduPifn3Cn6TKRErR4aLLOsTbszwvdTz89x+kYzR+tk J8KQHuM85FR044+YfhLNywfmhjkfu8ql2Ab3dqJXlJSkZPFB9dz9SwbChjebdzYj/5XG /N4Fi2ft0HFvCk2BFqQb52E+Y88UuhDW1Zbt0sENHqMjgzyrWVcp+IFf23MWFfnV55NH etDwgiqkduY8EAKOuy3lUM0Bu9iCtMgiLxgnPOCdJoiN45F7txT+CXOA895d5AAsOxTh waKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YSkuHZd8; 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 hq35si6651130ejc.633.2020.11.23.15.37.41; Mon, 23 Nov 2020 15:38:04 -0800 (PST) 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=YSkuHZd8; 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 S1732296AbgKWMjg (ORCPT + 99 others); Mon, 23 Nov 2020 07:39:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:51776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732189AbgKWMjI (ORCPT ); Mon, 23 Nov 2020 07:39:08 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 22D042065E; Mon, 23 Nov 2020 12:39:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135148; bh=PLnBiQZaP5+2vKe4PZ3YtGxZ5gwfrefsH5lvYP4jUlY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YSkuHZd8P9uTDycYaYtBRZSpyLCQagkn/p/FmzirKZwMCLG7zNJcRxp8PYrZbVsMR OOML2F6HZpBkujbz7pfPtf6fFnHjtz9oO98wve1v+fR0LqOg1JV9Ids2uKw/COANgY yKTd2IU++NAvMoKWtpBpnlAjXa/4lm6n9PKcJqGo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eli Cohen , Roi Dayan , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.4 092/158] net/mlx5: E-Switch, Fail mlx5_esw_modify_vport_rate if qos disabled Date: Mon, 23 Nov 2020 13:22:00 +0100 Message-Id: <20201123121824.369548870@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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: Eli Cohen [ Upstream commit 5b8631c7b21ca8bc039f0bc030048973b039e0d2 ] Avoid calling mlx5_esw_modify_vport_rate() if qos is not enabled and avoid unnecessary syndrome messages from firmware. Fixes: fcb64c0f5640 ("net/mlx5: E-Switch, add ingress rate support") Signed-off-by: Eli Cohen Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index d2d407ebe6872..009d383d83f4b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1592,6 +1592,10 @@ int mlx5_esw_modify_vport_rate(struct mlx5_eswitch *esw, u16 vport_num, struct mlx5_vport *vport; vport = mlx5_eswitch_get_vport(esw, vport_num); + + if (!vport->qos.enabled) + return -EOPNOTSUPP; + MLX5_SET(scheduling_context, ctx, max_average_bw, rate_mbps); return mlx5_modify_scheduling_element_cmd(esw->dev, -- 2.27.0