Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6130668iog; Thu, 23 Jun 2022 12:00:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ujwtJnH1Tz2yiC+LX4cE8FCD2//EeaeAn6tjjpUj/ksbk3pA+q0/VfRCGeu8rtPTwKkpTg X-Received: by 2002:a17:906:4fd3:b0:726:2b29:9fb with SMTP id i19-20020a1709064fd300b007262b2909fbmr2401553ejw.370.1656010836025; Thu, 23 Jun 2022 12:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656010836; cv=none; d=google.com; s=arc-20160816; b=bfym2QB29vjYY8Tr4YjcPfiGLQGnk7DtmW3DxclvRURa2AZSDdRwMPhgpaDdPZuFd4 V1pQBOcDwQj4q0usin5y+SMr990DlfzNX4CrLQ8IpMNoYEjvjhkAOjytTgHJTuKXAmdJ JTJ7uW+ud1XL9s5DgY54gekjmhx3KRuPi3MzfGQ7SwGJLeNuwKfqzzWVuL8ZsM0xaRzw V3q6awNiI2yo3icD+jg7+COPVJ/t/iTP1Sjytuc/vhBCb9SpBo8c3Ko3K7ofgTFL61zD H0a7R21PYZFAba7LKltlBd1RR3wviAT7BjnHbX6PnSbOKcv0Y5DjCK9ibY9prMY+atON JPww== 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=XBvrMQIloy8LECQJuYQkwpfLFDcbpYXhfu2vMc4YsSUY4SLsV9zYG2mb7ANF7R3yk+ 4FMXayiJbwGJ/Dz14dGAVER35V1p7jL7ulSm9RU0EUi171hXdXWSeH5dm1/GG48sbfD9 jO6pIs4DtI9G5dw3/75xIPrxagX7GOjJycdLjl+SNeUekUQFW5wf7X5SSFWV3epu7tHy ahrYw/BufED/UErsT1CtQkigl7eDPIvXqFTqAvh7mwwGqQub3OYtowaoWDIZQR4rDOjr Xe9qL+jzaaoG5b8TlcdGs8VFoRHBF4MBCBi+I74Wkq6A3cKbGy7fnDT9Drx+Xp7iOVKj 0PJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PsGfQ0UN; 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 bf17-20020a0564021a5100b004357d1075d9si351466edb.395.2022.06.23.12.00.10; Thu, 23 Jun 2022 12:00:36 -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=PsGfQ0UN; 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 S236900AbiFWSRB (ORCPT + 99 others); Thu, 23 Jun 2022 14:17:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236506AbiFWSQO (ORCPT ); Thu, 23 Jun 2022 14:16:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A72E64F46F; Thu, 23 Jun 2022 10:22:39 -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 3A05B61E0D; Thu, 23 Jun 2022 17:22:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBEFFC3411B; Thu, 23 Jun 2022 17:22:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004958; bh=4YG/mLz04w7Z3iVgwRBUHl1vEuxLOBCOG6D0oHMrmAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PsGfQ0UNB3t/pBHXdLRZjJHLGgW1GaB+PcVIjuArgGcPL2vK3fK0zKAC2XHU9XSC/ ccnF6lEGsbobfgSch7BQdMsSVQe8hRYOyL5sTr3ruoKt8IijIy68E4efMYr37mS77N wbT9AvD9Agp/ubdu/XxIIJZ3MuKf4+Ed8HR+NbAg= 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 4.19 204/234] mlxsw: spectrum_cnt: Reorder counter pools Date: Thu, 23 Jun 2022 18:44:31 +0200 Message-Id: <20220623164348.824680175@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@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