Message ID | 20211123163955.154512-10-alexandr.lobakin@intel.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: introduce and use generic XDP stats | expand |
Hi Alexander,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Alexander-Lobakin/net-introduce-and-use-generic-XDP-stats/20211124-004501
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 2106efda785b55a8957efed9a52dfa28ee0d7280
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20211125/202111250224.jTNAiYeF-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/1595085302c56b82cbac2ac40ce6f263ac64fa1f
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexander-Lobakin/net-introduce-and-use-generic-XDP-stats/20211124-004501
git checkout 1595085302c56b82cbac2ac40ce6f263ac64fa1f
# save the config file to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c: In function 'mlx5i_grp_sw_update_stats':
>> drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c:136:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=]
136 | }
| ^
vim +136 drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
48935bbb7ae8bd drivers/net/ethernet/mellanox/mlx5/core/ipoib.c Saeed Mahameed 2017-04-13 110
fbb66ad5dcbebc drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Wei Yongjun 2018-09-05 111 static void mlx5i_grp_sw_update_stats(struct mlx5e_priv *priv)
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 112 {
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 113 struct mlx5e_sw_stats s = { 0 };
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 114 int i, j;
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 115
9d758d4a3a039b drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Tariq Toukan 2021-09-02 116 for (i = 0; i < priv->stats_nch; i++) {
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 117 struct mlx5e_channel_stats *channel_stats;
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 118 struct mlx5e_rq_stats *rq_stats;
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 119
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 120 channel_stats = &priv->channel_stats[i];
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 121 rq_stats = &channel_stats->rq;
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 122
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 123 s.rx_packets += rq_stats->packets;
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 124 s.rx_bytes += rq_stats->bytes;
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 125
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 126 for (j = 0; j < priv->max_opened_tc; j++) {
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 127 struct mlx5e_sq_stats *sq_stats = &channel_stats->sq[j];
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 128
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 129 s.tx_packets += sq_stats->packets;
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 130 s.tx_bytes += sq_stats->bytes;
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 131 s.tx_queue_dropped += sq_stats->dropped;
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 132 }
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 133 }
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 134
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 135 memcpy(&priv->stats.sw, &s, sizeof(s));
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 @136 }
c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 137
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
From: kernel test robot <lkp@intel.com> Date: Thu, 25 Nov 2021 02:15:55 +0800 > Hi Alexander, > > Thank you for the patch! Perhaps something to improve: > > [auto build test WARNING on net-next/master] > > url: https://github.com/0day-ci/linux/commits/Alexander-Lobakin/net-introduce-and-use-generic-XDP-stats/20211124-004501 > base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 2106efda785b55a8957efed9a52dfa28ee0d7280 > config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20211125/202111250224.jTNAiYeF-lkp@intel.com/config) > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 > reproduce (this is a W=1 build): > # https://github.com/0day-ci/linux/commit/1595085302c56b82cbac2ac40ce6f263ac64fa1f > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review Alexander-Lobakin/net-introduce-and-use-generic-XDP-stats/20211124-004501 > git checkout 1595085302c56b82cbac2ac40ce6f263ac64fa1f > # save the config file to linux build tree > make W=1 ARCH=i386 > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot <lkp@intel.com> > > All warnings (new ones prefixed by >>): > > drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c: In function 'mlx5i_grp_sw_update_stats': > >> drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c:136:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=] > 136 | } > | ^ > > > vim +136 drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c > > 48935bbb7ae8bd drivers/net/ethernet/mellanox/mlx5/core/ipoib.c Saeed Mahameed 2017-04-13 110 > fbb66ad5dcbebc drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Wei Yongjun 2018-09-05 111 static void mlx5i_grp_sw_update_stats(struct mlx5e_priv *priv) > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 112 { > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 113 struct mlx5e_sw_stats s = { 0 }; Can I allocate mlx5e_sw_stats dynamically here to avoid running out of the stack frame size? > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 114 int i, j; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 115 > 9d758d4a3a039b drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Tariq Toukan 2021-09-02 116 for (i = 0; i < priv->stats_nch; i++) { > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 117 struct mlx5e_channel_stats *channel_stats; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 118 struct mlx5e_rq_stats *rq_stats; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 119 > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 120 channel_stats = &priv->channel_stats[i]; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 121 rq_stats = &channel_stats->rq; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 122 > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 123 s.rx_packets += rq_stats->packets; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 124 s.rx_bytes += rq_stats->bytes; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 125 > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 126 for (j = 0; j < priv->max_opened_tc; j++) { > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 127 struct mlx5e_sq_stats *sq_stats = &channel_stats->sq[j]; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 128 > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 129 s.tx_packets += sq_stats->packets; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 130 s.tx_bytes += sq_stats->bytes; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 131 s.tx_queue_dropped += sq_stats->dropped; > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 132 } > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 133 } > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 134 > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 135 memcpy(&priv->stats.sw, &s, sizeof(s)); > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 @136 } > c57d2358ff0dfa drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c Feras Daoud 2018-09-02 137 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Thanks, Al
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c index 2f0df5cc1a2d..a9a8535c828b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c @@ -156,7 +156,8 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di, case XDP_ABORTED: xdp_abort: trace_xdp_exception(rq->netdev, prog, act); - fallthrough; + rq->stats->xdp_errors++; + return true; case XDP_DROP: rq->stats->xdp_drop++; return true; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index 3c91a11e27ad..3631dafb4ea2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -141,6 +141,7 @@ static const struct counter_desc sw_stats_desc[] = { { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_complete_tail) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_complete_tail_slow) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_csum_unnecessary_inner) }, + { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xdp_errors) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xdp_drop) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xdp_redirect) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xdp_tx_xmit) }, @@ -208,6 +209,7 @@ static const struct counter_desc sw_stats_desc[] = { { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xsk_csum_none) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xsk_ecn_mark) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xsk_removed_vlan_packets) }, + { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xsk_xdp_errors) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xsk_xdp_drop) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xsk_xdp_redirect) }, { MLX5E_DECLARE_STAT(struct mlx5e_sw_stats, rx_xsk_wqe_err) }, @@ -298,6 +300,7 @@ static void mlx5e_stats_grp_sw_update_stats_xskrq(struct mlx5e_sw_stats *s, s->rx_xsk_csum_none += xskrq_stats->csum_none; s->rx_xsk_ecn_mark += xskrq_stats->ecn_mark; s->rx_xsk_removed_vlan_packets += xskrq_stats->removed_vlan_packets; + s->rx_xsk_xdp_errors += xskrq_stats->xdp_errors; s->rx_xsk_xdp_drop += xskrq_stats->xdp_drop; s->rx_xsk_xdp_redirect += xskrq_stats->xdp_redirect; s->rx_xsk_wqe_err += xskrq_stats->wqe_err; @@ -331,6 +334,7 @@ static void mlx5e_stats_grp_sw_update_stats_rq_stats(struct mlx5e_sw_stats *s, s->rx_csum_complete_tail_slow += rq_stats->csum_complete_tail_slow; s->rx_csum_unnecessary += rq_stats->csum_unnecessary; s->rx_csum_unnecessary_inner += rq_stats->csum_unnecessary_inner; + s->rx_xdp_errors += rq_stats->xdp_errors; s->rx_xdp_drop += rq_stats->xdp_drop; s->rx_xdp_redirect += rq_stats->xdp_redirect; s->rx_wqe_err += rq_stats->wqe_err; @@ -1766,6 +1770,7 @@ static const struct counter_desc rq_stats_desc[] = { { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, csum_unnecessary) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, csum_unnecessary_inner) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, csum_none) }, + { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, xdp_errors) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, xdp_drop) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, xdp_redirect) }, { MLX5E_DECLARE_RX_STAT(struct mlx5e_rq_stats, lro_packets) }, @@ -1869,6 +1874,7 @@ static const struct counter_desc xskrq_stats_desc[] = { { MLX5E_DECLARE_XSKRQ_STAT(struct mlx5e_rq_stats, csum_none) }, { MLX5E_DECLARE_XSKRQ_STAT(struct mlx5e_rq_stats, ecn_mark) }, { MLX5E_DECLARE_XSKRQ_STAT(struct mlx5e_rq_stats, removed_vlan_packets) }, + { MLX5E_DECLARE_XSKRQ_STAT(struct mlx5e_rq_stats, xdp_errors) }, { MLX5E_DECLARE_XSKRQ_STAT(struct mlx5e_rq_stats, xdp_drop) }, { MLX5E_DECLARE_XSKRQ_STAT(struct mlx5e_rq_stats, xdp_redirect) }, { MLX5E_DECLARE_XSKRQ_STAT(struct mlx5e_rq_stats, wqe_err) }, @@ -1940,6 +1946,7 @@ static const struct counter_desc ptp_rq_stats_desc[] = { { MLX5E_DECLARE_PTP_RQ_STAT(struct mlx5e_rq_stats, csum_unnecessary) }, { MLX5E_DECLARE_PTP_RQ_STAT(struct mlx5e_rq_stats, csum_unnecessary_inner) }, { MLX5E_DECLARE_PTP_RQ_STAT(struct mlx5e_rq_stats, csum_none) }, + { MLX5E_DECLARE_PTP_RQ_STAT(struct mlx5e_rq_stats, xdp_errors) }, { MLX5E_DECLARE_PTP_RQ_STAT(struct mlx5e_rq_stats, xdp_drop) }, { MLX5E_DECLARE_PTP_RQ_STAT(struct mlx5e_rq_stats, xdp_redirect) }, { MLX5E_DECLARE_PTP_RQ_STAT(struct mlx5e_rq_stats, lro_packets) }, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h index 2c1ed5b81be6..dd33465af0ff 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h @@ -158,6 +158,7 @@ struct mlx5e_sw_stats { u64 rx_csum_complete_tail; u64 rx_csum_complete_tail_slow; u64 rx_csum_unnecessary_inner; + u64 rx_xdp_errors; u64 rx_xdp_drop; u64 rx_xdp_redirect; u64 rx_xdp_tx_xmit; @@ -237,6 +238,7 @@ struct mlx5e_sw_stats { u64 rx_xsk_csum_none; u64 rx_xsk_ecn_mark; u64 rx_xsk_removed_vlan_packets; + u64 rx_xsk_xdp_errors; u64 rx_xsk_xdp_drop; u64 rx_xsk_xdp_redirect; u64 rx_xsk_wqe_err; @@ -335,6 +337,7 @@ struct mlx5e_rq_stats { u64 mcast_packets; u64 ecn_mark; u64 removed_vlan_packets; + u64 xdp_errors; u64 xdp_drop; u64 xdp_redirect; u64 wqe_err;