Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4370374imw; Tue, 19 Jul 2022 05:31:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u7L+j5vxPB2NcirrbLjolFgadI/45xXCr6MlczvjGwX3wI8NciG5CNRnMExp+JG2evbZlS X-Received: by 2002:a17:907:2855:b0:72b:67b7:2c28 with SMTP id el21-20020a170907285500b0072b67b72c28mr30286898ejc.331.1658233860231; Tue, 19 Jul 2022 05:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658233860; cv=none; d=google.com; s=arc-20160816; b=WNVTT7Y1T6jjUJdu6oLhnx8InHAHju/TlFyLvj1VDD5HWIlyVREWsVYPSzF7gmy19O NfUtcaC1ateQS/KdqWB8HDy88tvN0SN5mG3UQtypIaoScau8jSmLfJBqhPAKkQ2/Devi 2iwHqpfieGUuNYIGFmTZmLmIbhdRdSfgsQQh3FGWEJDl9WESrnltI+8qjWPLg0uiSK4e NoT7jpKEVcXH7S4k54oeeb5C6pOqUSaGqX8308pneXHoA2Y0nSZrjqhryKWFHBJiQhN8 0F/XmXKph8p5l3lKI4BA3lLArG79525eI4803Hx4CUTMm0BttzT4hBZU4tnoRbDZh+Y9 DODA== 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=YKJzzVH3I06T5iVW3CeQyCwKcA+vB9d8MigWoldGgj0=; b=h7IzAQGo7fTdy8vPIeQcy+Z9NBjGqWer7hOpXnOl0zBrw8lCs7Ie28V6RdA6Z5D6Ku 9YNBSFfVsiOK+mdnE6ib2CdtVheJBsdqENTSGS3zP4V0arsYY03gBMFNWYiUVWB9kpjR xx2PDSA/gS1o+J7P77wHi6yaCCMpVNOEV1YEoWXO23JwQUvPynaa4I1LGLYPqmxQIsoZ 5DP8SqHII4b0TNSBhbHGZnP16HFMuJOPot9YFkxrNPB2eC0QTx6bamze/OONPkfNZ3Iu msi0gnFHp1N+ZURFXzhA4+2qiZBELrs5DsYqJ8uR5Tfvr5oV5w+OnGdwEeYY5aSj0so5 blHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wzNq2/Iu"; 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 qk13-20020a1709077f8d00b0072af3bdf59esi14700523ejc.3.2022.07.19.05.30.34; Tue, 19 Jul 2022 05:31:00 -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="wzNq2/Iu"; 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 S239360AbiGSMR7 (ORCPT + 99 others); Tue, 19 Jul 2022 08:17:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239089AbiGSMP0 (ORCPT ); Tue, 19 Jul 2022 08:15:26 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9DD854C88; Tue, 19 Jul 2022 05:06:08 -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 sin.source.kernel.org (Postfix) with ESMTPS id 72449CE1BE6; Tue, 19 Jul 2022 12:06:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75B98C341C6; Tue, 19 Jul 2022 12:05:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232359; bh=Ei5OpdfzeLsXv6I8F7TTEkawWi+25j66vjp+az5qjh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wzNq2/IuPPwVudwJ/DN8hFRajKIwgP/OCmW1W8JfQsPwxjveK/fhPoD+dEOgWEwkD vVRSVEc9+d4gqpFgHL0CMVHHpJoP8m2L1FFTvhl16Vs7Yb2mhQIB1SNidRnu1P1N6I 6EhIzLM2g9mlIZJrlivfoAN3PUtmqXZuCYq6SfWg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gal Pressman , Tariq Toukan , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 031/112] net/mlx5e: Fix capability check for updating vnic env counters Date: Tue, 19 Jul 2022 13:53:24 +0200 Message-Id: <20220719114629.120968574@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@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.8 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 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: Gal Pressman [ Upstream commit 452133dd580811f184e76b1402983182ee425298 ] The existing capability check for vnic env counters only checks for receive steering discards, although we need the counters update for the exposed internal queue oob counter as well. This could result in the latter counter not being updated correctly when the receive steering discards counter is not supported. Fix that by checking whether any counter is supported instead of only the steering counter capability. Fixes: 0cfafd4b4ddf ("net/mlx5e: Add device out of buffer counter") Signed-off-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index 78f6a6f0a7e0..ff4f10d0f090 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -536,7 +536,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vnic_env) u32 in[MLX5_ST_SZ_DW(query_vnic_env_in)] = {}; struct mlx5_core_dev *mdev = priv->mdev; - if (!MLX5_CAP_GEN(priv->mdev, nic_receive_steering_discard)) + if (!mlx5e_stats_grp_vnic_env_num_stats(priv)) return; MLX5_SET(query_vnic_env_in, in, opcode, MLX5_CMD_OP_QUERY_VNIC_ENV); -- 2.35.1