mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2026-01-06 22:46:35 +00:00
mlx5: fix mlx5i_grp_sw_update_stats() stack usage
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. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
7a7dd5114f
commit
d2b8c7ba3c
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user