Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2931071iog; Mon, 20 Jun 2022 07:44:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tkY1hrCcFQbtVpTUHIagsTOnwoHj/10qxMZUSF7p896BRC0SjUfHnR0Z8rWc0E9mcHB4Re X-Received: by 2002:a17:902:d509:b0:167:6ed8:af9e with SMTP id b9-20020a170902d50900b001676ed8af9emr23960012plg.140.1655736250742; Mon, 20 Jun 2022 07:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736250; cv=none; d=google.com; s=arc-20160816; b=UolZgatuuijBHS9R7VOCyQeWBkeTN/8xEYzu8zgWpf6o1KC1Iihm/cqkDrBgPNLOU/ K9eY9iZ2YOMqrPAsVOrFKLoIJBL+ShszKwaVVHH+jJv6In3YXmIUaJZR//EtSBq88Bis ESmEcXq/oeAn5JdtWp4iyRGjSYIs/jVh6m0sGxzsdwQKnOINx/yIZkzso7UYNc0g88X7 RRGXxpx61TiqlWHaEfXRy8rPENG3IiG1TlCrif6HSGBf+W0VOw+l/NJLL05d1tE07BgY naBbG09GbdGai3Yr4ucCXVHfQ5Uv+GfPrV0Kt1gZgC/JQl7RxPDcOG/eAJCmTLXsCEwY 8M+g== 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=MWcVpH1GNu4uAG6hlHro79CcfeOf2E6h2q1rjnxveS4=; b=zA+aaYMYfxR1nsl+5BV517aDihIypjkeBsRnNHglsR6A46vKBZz1U9VTSDR9UwlfDo UPQ2hLpBEauXZCa23Xy+6PU49stNPjlq4Dlm1cO7uIF9y62b6NziAYvDaU/fKR059KgZ fgC76wBTq+tzobhFNgvFDeoHYGRnzBYmhbnk/Wy8qeCLO7UtkeilrteaU+pWJlIJ+MqZ UOWsnnYqBY+Vi/LnmgQlzmphkrR8n/OJ3zfXIyG/MuhIbQ4CBb1aFvZkcKY7Ozg04q1W kMzhgI8WhWgsPIf2sU28rzBWbnFL457ruMxCAwIYzRj8S1K3OcxRlR0QLa8y56AMN6/K 4qSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v1tu+yzN; 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 7-20020a631947000000b00403fbc91684si2931298pgz.101.2022.06.20.07.43.58; Mon, 20 Jun 2022 07:44:10 -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=v1tu+yzN; 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 S1350532AbiFTOGy (ORCPT + 99 others); Mon, 20 Jun 2022 10:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351755AbiFTNzR (ORCPT ); Mon, 20 Jun 2022 09:55:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9C5733E17; Mon, 20 Jun 2022 06:21:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id D9D26B81157; Mon, 20 Jun 2022 13:21:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30168C3411B; Mon, 20 Jun 2022 13:21:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655731283; bh=4YG/mLz04w7Z3iVgwRBUHl1vEuxLOBCOG6D0oHMrmAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v1tu+yzNvTBdAbmITEg/9ZGCCgrAf21CxM+l2VRIDnpWzY4Xkm45AfvO/u1lBIc4v NfWs4Be64S0EnDAVfgPCvPjroZham8zBcmatHAg1yV0XraV7OKnTA5Oil5LGtO0CqH QM0E3HzZblGCo30BG5XtgsDqoO19q0Jb8MJ7+LPs= 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.4 212/240] mlxsw: spectrum_cnt: Reorder counter pools Date: Mon, 20 Jun 2022 14:51:53 +0200 Message-Id: <20220620124745.119114358@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124737.799371052@linuxfoundation.org> References: <20220620124737.799371052@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 81465e267b10..b7eb3674e285 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h @@ -7,8 +7,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