Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3925009pxj; Mon, 21 Jun 2021 09:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTEufKAOr+jL+18qa8bvX5FDR8E4s4DtXhjz1hOsZYZ4EIdaGaLiFRgwXxGO4lzBDS/V81 X-Received: by 2002:a05:6402:90b:: with SMTP id g11mr11949909edz.336.1624292998536; Mon, 21 Jun 2021 09:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292998; cv=none; d=google.com; s=arc-20160816; b=b3NIXWQ5Fplk7UkSIap0Os4sApPGUMbnxyhK649RQMsYQhaKSJKb0o32dPR5CbR7rx t3p2Af5dwR+bw48YFG6Et5GX8UHWqp+Nnchov1kKEg31zzIxprGrtNatEmCDss0uf8Vn fTxuRCdqDhzGXNZ9Zb7fI9L8twWdZyfZACCfr741esjYQZ2jlvcv7+5xTFgnjk4pB7gN BD1brKty0iemwhFTm8l8vrbM+Kv5Q3R4JGDrbAJXGtU79yt241lQguv4y5ruPzjAmltX EeesPzVB6sTaok9itkaih2R1MpbY+jpQaI/iGG4Mrl26I2aemFZI2ObqFMYsgWhgyuJO lwiw== 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=Jgqt+M6cbAsxhvA8aYLsD2fApOZtZ3WIcARf/KQ0AU4=; b=EM6fCigAtQJanllaie8u5Tapngs1JUWIhF+ddGvu++VrSIJZ/sQ1E6l6ykVAtOU1zU Mv442yoByVtewOuJJ3IrRBJwwzG/Tw1SU3X8Lty/bj5Iqj6ZiXMRIIuYgfkLVvYFfQ0w uoI/66OG4nYYBxQI4UxWloI5lm19x7Ee2QIYSAvjgRt3p7409kBcsNCBl86W30Ir/vuC U7I1CHztTnxFg8tSjb+J9dlPw38NTb3bd3ftUkectEs9RWmFUjnV1owvlvMXLxknWUo6 6a+FomhlsrbRYKfmwwc+9GutGnK3ZtrXHQ8DOskEdAMlwvWt9CTBmZPpFS4cP31ABc97 Bitg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OCFYMULx; 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 eb14si1256079edb.48.2021.06.21.09.29.36; Mon, 21 Jun 2021 09:29:58 -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=OCFYMULx; 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 S231697AbhFUQ2x (ORCPT + 99 others); Mon, 21 Jun 2021 12:28:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:49586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231381AbhFUQ12 (ORCPT ); Mon, 21 Jun 2021 12:27:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BD784613AB; Mon, 21 Jun 2021 16:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292566; bh=ReH7V6sn+dbdvvl3U2qwbegUztcL5V/+JOTkaGLGWe4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OCFYMULxmu4+ttqcDBNpnkwG+HK/V0TSqmOKaRdkO/7fYnl808CyJSe0Rh2DRk56H jhSjbmL5q7UrzUMoWlJ6vPjm4/l4ihO88F/4iTzti5D5Xu7/KVVSJNO+gbMB7x44Dd rcmfQKaXCuaRAjhRxt0hQjWmEb4q9OqlATvNWMQw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maksym Yaremchuk , Petr Machata , Ido Schimmel , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 014/146] mlxsw: reg: Spectrum-3: Enforce lowest max-shaper burst size of 11 Date: Mon, 21 Jun 2021 18:14:04 +0200 Message-Id: <20210621154911.750201376@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@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: Petr Machata [ Upstream commit 306b9228c097b4101c150ccd262372ded8348644 ] A max-shaper is the HW component responsible for delaying egress traffic above a configured transmission rate. Burst size is the amount of traffic that is allowed to pass without accounting. The burst size value needs to be such that it can be expressed as 2^BS * 512 bits, where BS lies in a certain ASIC-dependent range. mlxsw enforces that this holds before attempting to configure the shaper. The assumption for Spectrum-3 was that the lower limit of BS would be 5, like for Spectrum-1. But as of now, the limit is still 11. Therefore fix the driver accordingly, so that incorrect values are rejected early with a proper message. Fixes: 23effa2479ba ("mlxsw: reg: Add max_shaper_bs to QoS ETS Element Configuration") Reported-by: Maksym Yaremchuk Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h index 3c3069afc0a3..c670bf3464c2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h @@ -3641,7 +3641,7 @@ MLXSW_ITEM32(reg, qeec, max_shaper_bs, 0x1C, 0, 6); #define MLXSW_REG_QEEC_HIGHEST_SHAPER_BS 25 #define MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP1 5 #define MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP2 11 -#define MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP3 5 +#define MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP3 11 static inline void mlxsw_reg_qeec_pack(char *payload, u8 local_port, enum mlxsw_reg_qeec_hr hr, u8 index, -- 2.30.2