Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1087046pxk; Fri, 25 Sep 2020 06:02:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwItvaZdDjQufmLQDLKMVyG2rKr3nJaJ836Z+7gib35zO2m9opJd5U88+iMhiIsnMS2OS80 X-Received: by 2002:a50:9fa5:: with SMTP id c34mr1181674edf.2.1601038954239; Fri, 25 Sep 2020 06:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601038954; cv=none; d=google.com; s=arc-20160816; b=F9bvDgeeNpZTEYed17sgQPULRns/K9c+/0Gbj90AwgcpHjMSNakRfPUdSahR8OoeI+ De/x4G1b/lRwbbBnzz0bMBN53vNku78ayi/GCw3eDLho58CNSoo8/u5z0lLQ3x9RdVKm r/Lv2ESr+bij3WXE3P9By/Ix7QfT8GgKQW6f82lFjIDsEbREOe8uPTUf2mUrPNwlrdQB nsH2Wd1S1HiYXK0IzHMK3ehAxoGWMoBvT5bpmOVmezvqnSSFcmFYbHlQaFUpxA6s2lMc imGx3edpKeKGnj2h8ZARFEocmg/X5Wim3Zw7MmlnxA45f/Q3uaPjigRz10MXbr2axnDY XjYQ== 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=VgJ8VwPUhvHTaXGF8TjMWDwd1s9G4kNrpbnbPNAHoP4=; b=u10RbY9bTLz/bVY93hSzstkqmkOITG2FOd524iavL5MTsn7ywqLGj/5rDK9WUjw1aF uNxm8sktoeOGhBUorHqUL8PYzrlRO9vL4wBEJY033x/6IXT9DwkZax8iCtHD7vuWB64w iEx16UUUUekSP/lNtI0bLAxoxZ2c5jdU84uXoBxIHgKczX0psbZpLdUufnTTd5ZAsWfO 2WyWZt9TCkBZ52O7vD0lxS8ITVymbrCKXF+okG9MXBi0CHc5IVOjcsC/xo1CO3uEN+PE Ehd4oQaymYl7yVvgUj1S+uQWOY1nUm1p5i1mQH1wCQBlS4ucLf68WIyJ6bnRlFp9UhDK IrRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d3y26t7o; 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=fail (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 gf25si1672376ejb.428.2020.09.25.06.02.06; Fri, 25 Sep 2020 06:02:34 -0700 (PDT) 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=@kernel.org header.s=default header.b=d3y26t7o; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728923AbgIYMtn (ORCPT + 99 others); Fri, 25 Sep 2020 08:49:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:53314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728909AbgIYMtj (ORCPT ); Fri, 25 Sep 2020 08:49:39 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BB1F421741; Fri, 25 Sep 2020 12:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601038179; bh=pZyRP7uN2yaBC6uVXxQEhhvLSyA7oPj4hd9KWXNcxj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d3y26t7o/7gL78fh28zv3cejoszZN56OGYtQqvM0wcP7rtY0l0sYVrMlcaJLbRyWV sT54XZmCC5q+0U+YoxOM+57imiB09VeGNeXeG9+Gsla6n0eRMbrIvKo8N3xXiW5arQ UvSN1EnHuNxwwIF78kcPMVUjHB6mjO9oS0NReAOU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tariq Toukan , Moshe Shemesh , Saeed Mahameed Subject: [PATCH 5.8 31/56] net/mlx5e: TLS, Do not expose FPGA TLS counter if not supported Date: Fri, 25 Sep 2020 14:48:21 +0200 Message-Id: <20200925124732.521884090@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200925124727.878494124@linuxfoundation.org> References: <20200925124727.878494124@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: Tariq Toukan [ Upstream commit 8f0bcd19b1da3f264223abea985b9462e85a3718 ] The set of TLS TX global SW counters in mlx5e_tls_sw_stats_desc is updated from all rings by using atomic ops. This set of stats is used only in the FPGA TLS use case, not in the Connect-X TLS one, where regular per-ring counters are used. Do not expose them in the Connect-X use case, as this would cause counter duplication. For example, tx_tls_drop_no_sync_data would appear twice in the ethtool stats. Fixes: d2ead1f360e8 ("net/mlx5e: Add kTLS TX HW offload support") Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_stats.c | 12 +++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls_stats.c @@ -35,7 +35,6 @@ #include #include "en.h" -#include "accel/tls.h" #include "fpga/sdk.h" #include "en_accel/tls.h" @@ -51,9 +50,14 @@ static const struct counter_desc mlx5e_t #define NUM_TLS_SW_COUNTERS ARRAY_SIZE(mlx5e_tls_sw_stats_desc) +static bool is_tls_atomic_stats(struct mlx5e_priv *priv) +{ + return priv->tls && !mlx5_accel_is_ktls_device(priv->mdev); +} + int mlx5e_tls_get_count(struct mlx5e_priv *priv) { - if (!priv->tls) + if (!is_tls_atomic_stats(priv)) return 0; return NUM_TLS_SW_COUNTERS; @@ -63,7 +67,7 @@ int mlx5e_tls_get_strings(struct mlx5e_p { unsigned int i, idx = 0; - if (!priv->tls) + if (!is_tls_atomic_stats(priv)) return 0; for (i = 0; i < NUM_TLS_SW_COUNTERS; i++) @@ -77,7 +81,7 @@ int mlx5e_tls_get_stats(struct mlx5e_pri { int i, idx = 0; - if (!priv->tls) + if (!is_tls_atomic_stats(priv)) return 0; for (i = 0; i < NUM_TLS_SW_COUNTERS; i++)