From patchwork Mon Nov 8 11:10:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12608257 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACE39C433FE for ; Mon, 8 Nov 2021 11:10:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91F5C61381 for ; Mon, 8 Nov 2021 11:10:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238981AbhKHLNf (ORCPT ); Mon, 8 Nov 2021 06:13:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237718AbhKHLNa (ORCPT ); Mon, 8 Nov 2021 06:13:30 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 87BE261350; Mon, 8 Nov 2021 11:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636369846; bh=LyXHsYc9FL+e5Xxrs1C6hphzdBHA2fkjJPaRiDu3R90=; h=From:To:Cc:Subject:Date:From; b=asCpGfNBT+eZR9/V+44y/uFtmpw7+CpZBqlKIMJ/lvvrnrORqTPElwWejMDht5t8q H4bRQQfnJh0OduukSR8Zze50/zaFuxWkibENO09Z7xnNE6WULNspoSONUA5cs+yA4g VpAsu/vIolG3XJy7VrjtUSUYueoOJ3iEycss6FWvBrZMTsvxQ7I3LhOhL81p3ehA8O zu+R3GYdnZxXLfhWrYqwgvPYKl9kyOKqp51tMtBoTYY081QSamnvVoTZbG2nKzkAFO cIuyFEnZXd/UWvhDPXgS+InL+dJ9MT5Ya1+Ly4GQw6cK1NYdJ1cKXHgW1VRy1ly2Rq H6PWYthQh4gBw== From: Arnd Bergmann To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Jakub Kicinski Cc: Arnd Bergmann , Parav Pandit , Vu Pham , Tariq Toukan , Chris Mi , Vlad Buslov , Colin Ian King , caihuoqing , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mlx5: fix psample_sample_packet link error Date: Mon, 8 Nov 2021 12:10:32 +0100 Message-Id: <20211108111040.3748899-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Arnd Bergmann When PSAMPLE is a loadable module, built-in drivers cannot use it: aarch64-linux-ld: drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.o: in function `mlx5e_tc_sample_skb': sample.c:(.text+0xd68): undefined reference to `psample_sample_packet' Add the same dependency here that is used for MLXSW Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig index 92056452a9e3..4ba1a78c6515 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig +++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig @@ -115,6 +115,7 @@ config MLX5_TC_CT config MLX5_TC_SAMPLE bool "MLX5 TC sample offload support" depends on MLX5_CLS_ACT + depends on PSAMPLE=y || PSAMPLE=n || MLX5_CORE=m default y help Say Y here if you want to support offloading sample rules via tc From patchwork Mon Nov 8 11:10:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12608261 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1593EC433EF for ; Mon, 8 Nov 2021 11:11:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB5026137F for ; Mon, 8 Nov 2021 11:10:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237895AbhKHLNl (ORCPT ); Mon, 8 Nov 2021 06:13:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:49854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239005AbhKHLNi (ORCPT ); Mon, 8 Nov 2021 06:13:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EBB0C60ED7; Mon, 8 Nov 2021 11:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636369854; bh=k1zNPqLta1tMAF9o2DEKZ+o6/DRChMDQml6YqtYykf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pVDhBEdWR9Q4N4IrEqvMEzFkY0xugsPbuNWD3UwvJCQVnobw35LGcCPuQ0sJQVy/a D/wykxoqpeP2FQhqihqafx28sBRshpnY4E+fDeanpbE4LpVyJLt6NVJwPhVipkN+1q XE38e1jXAGbVvpQyUTpKHeIRLoteKfNyq8bXrRjJno6uyofA3gYKpTE0t96hPmzD0H sfykCTES1m6SGBf3Aa7BcZG/DGH5CBmZuk0tzFVoN8Glr6FmEFIfRSzXyIbHc5/woK mPLnUSCkthL0+RWk4A+mSiVnHA/pzZu/RMBRGCNSE/2lGJreNMpQfMWisR6fM7/Fdx tryDRGs4OQ4BQ== From: Arnd Bergmann To: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Jakub Kicinski , Khalid Manaa , Tariq Toukan Cc: Arnd Bergmann , Maxim Mikityanskiy , Roi Dayan , Aya Levin , Maor Gottlieb , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] mlx5: fix mlx5i_grp_sw_update_stats() stack usage Date: Mon, 8 Nov 2021 12:10:33 +0100 Message-Id: <20211108111040.3748899-2-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211108111040.3748899-1-arnd@kernel.org> References: <20211108111040.3748899-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Arnd Bergmann The mlx5e_sw_stats structure has grown to the point of triggering a warning when put on the stack of a function: mlx5/core/ipoib/ipoib.c: In function 'mlx5i_grp_sw_update_stats': mlx5/core/ipoib/ipoib.c:136:1: error: the frame size of 1028 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] In this case, only five of the structure members are actually set, so it's sufficient to have those as separate local variables. As en_rep.c uses 'struct rtnl_link_stats64' for this, just use the same one here for consistency. Fixes: def09e7bbc3d ("net/mlx5e: Add HW_GRO statistics") Signed-off-by: Arnd Bergmann --- .../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c index ea1efdecc88c..158958a49743 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c @@ -110,7 +110,7 @@ void mlx5i_cleanup(struct mlx5e_priv *priv) static void mlx5i_grp_sw_update_stats(struct mlx5e_priv *priv) { - struct mlx5e_sw_stats s = { 0 }; + struct rtnl_link_stats64 s = {}; int i, j; for (i = 0; i < priv->stats_nch; i++) { @@ -128,11 +128,17 @@ static void mlx5i_grp_sw_update_stats(struct mlx5e_priv *priv) s.tx_packets += sq_stats->packets; s.tx_bytes += sq_stats->bytes; - s.tx_queue_dropped += sq_stats->dropped; + s.tx_dropped += sq_stats->dropped; } } - memcpy(&priv->stats.sw, &s, sizeof(s)); + memset(&priv->stats.sw, 0, sizeof(s)); + + priv->stats.sw.rx_packets = s.rx_packets; + priv->stats.sw.rx_bytes = s.rx_bytes; + priv->stats.sw.tx_packets = s.tx_packets; + priv->stats.sw.tx_bytes = s.tx_bytes; + priv->stats.sw.tx_queue_dropped = s.tx_dropped; } void mlx5i_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)