Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2931295iog; Mon, 20 Jun 2022 07:44:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vBL8Pnx4kCCLwFVZ4A1nXvAgZMxHYLKm7eszE81+XMeyd+Thd/WI+BxJrOVH3p5xqSUbri X-Received: by 2002:a17:90b:33cc:b0:1ec:b279:69fa with SMTP id lk12-20020a17090b33cc00b001ecb27969famr3956550pjb.70.1655736266293; Mon, 20 Jun 2022 07:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736266; cv=none; d=google.com; s=arc-20160816; b=xUXy7WvBptftvzS/DcvUBW3YM5GH/HspbzG8ZbVe+sRfQyxN6hrAUtMk4OEfm3b8IJ IeesE2P/JKfGlcZJKIqe+PqSt/O+IjAEIO9c9kxjHB2qDWb//X2RK92RFrNh6r7HWzPe +IHuyD9SyYcurkRQqm2VKi8KFZBIqB3RGbwb8T86urVOk6Eaag+H1MTOuTj2X5BI4nUa RV133XzMaNZxvRKtYTkOOS8i9U3r9UUc8xEO43AWMN4RF210SBmGQ2U/A5TRtFXgnKtS MmqMV7GlGYE7ZHb4fruLC3SZcqvZDyoZCJJQ2JqOGG4kp+UytwnzXDD5vYfkWNdH+oNe eTrQ== 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=hddB3nw5cfczXYNKO4KEvEi6pnrKxf8PZqjekWztm3s=; b=z3+u0jSb1t/nmJXr9Q0I6MSsajBdTlGH6yOF8RfSbubIipRP0VAZ2u8kRd6e/8wQgi fdXyqkYs03LXgqMXVB6LDL/5pdR25K1wVnkTZ4YhisomGf+qaCJDKJAT7bieMcv7owN0 26GLQf952th/9wX5bk3ub2t8lkHLv4Kqy4emLRphCF/P5CcJEvgzEdaL7rPccmNlybK+ Ftj8GIDhea+UMi7CZNHSV8AvYLrKCjt2nOgC4MzFXPieFS9oDrXAPi2Q6kebqJNk2/k8 xM7LsoeC/aNMSGbFcLBb0zvxlfWG6kBkowEvyrRXI9AGuxXgpEPFGWlWDTDtFM7+TLCJ JeTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pDXUbGlm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p5-20020a170902e74500b001640aae96e8si17797000plf.317.2022.06.20.07.44.12; Mon, 20 Jun 2022 07:44:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pDXUbGlm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S242850AbiFTNCa (ORCPT + 99 others); Mon, 20 Jun 2022 09:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244928AbiFTNAF (ORCPT ); Mon, 20 Jun 2022 09:00:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E0941A06F; Mon, 20 Jun 2022 05:56:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EB88F614CA; Mon, 20 Jun 2022 12:56:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0D74C3411B; Mon, 20 Jun 2022 12:56:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655729817; bh=M/2gDY7ZzNb/oAKKkhfnwbKWyEObv/vJS66e1WXjz3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pDXUbGlm7deDfcERBx55dInoM51EKmoyR2mYRS84A7yLTPtjkj6o9dJ17KhfPP2OP WAiiE8cR8aRznDnBjTQteA8iALAPTZS5UOyYP8gX2emHu4uJQV4Ci1Tl2N/BtCTjCF VPz0Cdn24hgDkq9qZcmY51RXV+Ib7kXykzS3YtPs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maksym Yaremchuk , Petr Machata , Ido Schimmel , Paolo Abeni , Sasha Levin Subject: [PATCH 5.18 075/141] mlxsw: spectrum_cnt: Reorder counter pools Date: Mon, 20 Jun 2022 14:50:13 +0200 Message-Id: <20220620124731.755588962@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124729.509745706@linuxfoundation.org> References: <20220620124729.509745706@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Petr Machata [ Upstream commit 4b7a632ac4e7101ceefee8484d5c2ca505d347b3 ] Both RIF and ACL flow counters use a 24-bit SW-managed counter address to communicate which counter they want to bind. In a number of Spectrum FW releases, binding a RIF counter is broken and slices the counter index to 16 bits. As a result, on Spectrum-2 and above, no more than about 410 RIF counters can be effectively used. This translates to 205 netdevices for which L3 HW stats can be enabled. (This does not happen on Spectrum-1, because there are fewer counters available overall and the counter index never exceeds 16 bits.) Binding counters to ACLs does not have this issue. Therefore reorder the counter allocation scheme so that RIF counters come first and therefore get lower indices that are below the 16-bit barrier. Fixes: 98e60dce4da1 ("Merge branch 'mlxsw-Introduce-initial-Spectrum-2-support'") Reported-by: Maksym Yaremchuk Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Link: https://lore.kernel.org/r/20220613125017.2018162-1-idosch@nvidia.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h index a68d931090dd..15c8d4de8350 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h @@ -8,8 +8,8 @@ #include "spectrum.h" enum mlxsw_sp_counter_sub_pool_id { - MLXSW_SP_COUNTER_SUB_POOL_FLOW, MLXSW_SP_COUNTER_SUB_POOL_RIF, + MLXSW_SP_COUNTER_SUB_POOL_FLOW, }; int mlxsw_sp_counter_alloc(struct mlxsw_sp *mlxsw_sp, -- 2.35.1