1. 26 Jan, 2019 37 commits
  2. 25 Jan, 2019 3 commits
    • Saeed Mahameed's avatar
      net/mlx5e: Reuse fold sw stats in representors · b832d4fd
      Saeed Mahameed authored
      Representors software stats are basic, this patch is reusing the
      mlx5e_fold_sw_stats in representors, which sums up the basic stats64 for a
      mlx5e netdevice.
      
      Fixes: 8bfaf07f ("net/mlx5e: Present SW stats when state is not opened")
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      b832d4fd
    • Tariq Toukan's avatar
      net/mlx5e: Present the representors SW stats when state is not opened · 168af00a
      Tariq Toukan authored
      This behavior is already adopted for all other cases in the cited patch.
      The representor's functions were missed, here we modify the them to
      behave similarly.
      
      Fixes: 8bfaf07f ("net/mlx5e: Present SW stats when state is not opened")
      Signed-off-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      168af00a
    • Saeed Mahameed's avatar
      net/mlx5e: Separate between ethtool and netdev software stats folding · 9659e49a
      Saeed Mahameed authored
      mlx5e_grp_sw_update_stats can be called from two threads,
      1) ndo_get_stats64
      2) get_ethtool_stats
      
      For this reason and to minimize concurrency issue impact on 64bit machines
      mlx5e_grp_sw_update_stats folds the software stats into a temporary
      variable then copies it to the global driver stats, both ethtool and ndo
      statistics callbacks will use the global software stats variable to report
      whatever stats they need.
      
      Actually ndo_get_stats64 doesn't need to fold the whole software stats
      (mlx5e_grp_sw_update_stats), all it needs is five counters to fill the
      rtnl_link_stats64 relevant stats parameter.
      
      Hence this patch introduces a simpler helper function to fold software
      stats for ndo_get_stats64 which will work directly on rtnl_link_stats64
      stats parameter and not on the global or even temporary mlx5e_sw_stats
      variable.
      
      Since now mlx5e_grp_sw_update_stats is not called by ndo_get_stats64 we
      can make it static and remove the temp var.
      
      Unlike mlx5e_grp_sw_update_stats the new fold stats function doesn't
      need to zero out the output statistics parameter since it is already
      done by the stack @dev_get_stats().
      
      This patch is fixing stack usage of mlx5e_grp_sw_update_stats on
      x86 gcc-4.9 and higher, the concurrency issue between mlx5's
      ndo_get_stats64 and get_ethtool_stats is resolved as well.
      
      Fixes: 8bfaf07f ("net/mlx5e: Present SW stats when state is not opened")
      Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reported-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      9659e49a