Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp631496pxb; Tue, 2 Feb 2021 13:47:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6yXBELf2IDqAxmWrOda76GYTeetn6RlehCewilEOpn5NNqVAamHAsHA4og4mp3DtEJhrn X-Received: by 2002:a05:6402:26c9:: with SMTP id x9mr89479edd.365.1612302437728; Tue, 02 Feb 2021 13:47:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612302437; cv=none; d=google.com; s=arc-20160816; b=wqJ3juIpfOX+EAMHpggof8L83hpXzyM444OOK1UaWhZ20P1inHI88gLh3o5bvDBrVn C1mM3iwjlRATdAaumQPZbpwUocCn/0qpCAmK5JXzFj4NkCBzj8BFlRuuAeCz32IezSud KIP4GpMRxkeg9Fd2X/nET9BvIC6dkXpau5EycH0p+9a6IHpMf1zXFH9VS8q5DLh/Mc3P MD8SzkNQKnxiwNJ3isrt8WN+BWO3HSKcoTP0SIkdkf6dJpv6oN1uJqjxoZO3ZTEM4ZnG vH92OWTGkqVARhEz8NS6OvgltlS042SfdnR9oqxpZ/zsyvmU/fjia+vmFXeM/c2sqPoj EORw== 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=oZjIY1xfcSMIIWEukXaDoA6qXh+Gk7Tv+7wgtSey6uo=; b=mJDgp++BzdUkCanK8WyTsBmrtgphAubx0guT4SLTJhz78+MlvjQ3pPcwHBJjfcxFap EPeZRZX+qEt67CF/CvOeAt91ioWha1N7B7OR7Bp7Wr+onjoX7uJTVbgzjOx/Ry9OQeCG ML8qH9ANOzbP8CqbepbJXsLv88/90w5HriMsLFFcemfF/VtvbQxuiD5OImyO+oWiL7h2 6DMsKL5Z0aaOmtvwW89l73jBpq3gfMAJ9AfjgvgHB0DbqGKWRg+ROxW+KknqqQTMuNQS Ttuj8BcMPnoxUjv3EcKT2Pk0/yRr7Z53+5zZ0SxXB+VRdJNNfvDIMZ+y5FrNWS/+fa1a eHEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ZkU/AHOS"; 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 oz19si67440ejb.179.2021.02.02.13.46.53; Tue, 02 Feb 2021 13:47:17 -0800 (PST) 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="ZkU/AHOS"; 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 S233270AbhBBNxX (ORCPT + 99 others); Tue, 2 Feb 2021 08:53:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:36460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232839AbhBBNrS (ORCPT ); Tue, 2 Feb 2021 08:47:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7CF7964F8B; Tue, 2 Feb 2021 13:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273304; bh=jP7fZIXhdK5COjES+69/BN7RqLDAwdvlJFvS6c+pagU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZkU/AHOSDRm+6qPzF6OqbKU8OKrALMJ+juLYPy5MoZIvfkDSC88e0WfMS5BJPnwIT n6dJXuMNLgNK8LJOpjHz2bCD44eGSitrFch27eDckxT3WjohuUJjQdogWfcIXH4oYp 03wGroB8Dv/rAdcAm4ihmoGeJdKm2SnRloIcyVIo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Mikityanskiy , Raed Salem , Tariq Toukan , Saeed Mahameed Subject: [PATCH 5.10 057/142] net/mlx5e: Fix IPSEC stats Date: Tue, 2 Feb 2021 14:37:00 +0100 Message-Id: <20210202133000.071154537@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@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: Maxim Mikityanskiy commit 45c9a30835d84009dfe711f5c8836720767c286e upstream. When IPSEC offload isn't active, the number of stats is not zero, but the strings are not filled, leading to exposing stats with empty names. Fix this by using the same condition for NUM_STATS and FILL_STRS. Fixes: 0aab3e1b04ae ("net/mlx5e: IPSec, Expose IPsec HW stat only for supporting HW") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Raed Salem Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c @@ -76,7 +76,7 @@ static const struct counter_desc mlx5e_i static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(ipsec_sw) { - return NUM_IPSEC_SW_COUNTERS; + return priv->ipsec ? NUM_IPSEC_SW_COUNTERS : 0; } static inline MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ipsec_sw) {} @@ -105,7 +105,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_S static MLX5E_DECLARE_STATS_GRP_OP_NUM_STATS(ipsec_hw) { - return (mlx5_fpga_ipsec_device_caps(priv->mdev)) ? NUM_IPSEC_HW_COUNTERS : 0; + return (priv->ipsec && mlx5_fpga_ipsec_device_caps(priv->mdev)) ? NUM_IPSEC_HW_COUNTERS : 0; } static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(ipsec_hw)