Date: Thu, 16 May 2019 18:22:46 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347872 - stable/11/sys/dev/mlx5/mlx5_en Message-ID: <201905161822.x4GIMki6040164@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu May 16 18:22:46 2019 New Revision: 347872 URL: https://svnweb.freebsd.org/changeset/base/347872 Log: MFC r347316: Fix for compilation warning in mlx5en(4). Function 'mlx5e_alloc_rx_wqe' can never be inlined because it uses alloca (override using the always_inline attribute) Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu May 16 18:22:02 2019 (r347871) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu May 16 18:22:46 2019 (r347872) @@ -85,6 +85,8 @@ #define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa #define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xe +#define MLX5E_MAX_BUSDMA_RX_SEGS 15 + #define MLX5E_MAX_RX_SEGS 7 #ifndef MLX5E_MAX_RX_BYTES Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu May 16 18:22:02 2019 (r347871) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu May 16 18:22:46 2019 (r347872) @@ -2134,6 +2134,9 @@ mlx5e_get_wqe_sz(struct mlx5e_priv *priv, u32 *wqe_sz, for (n = howmany(r, MLX5E_MAX_RX_BYTES); !powerof2(n + 1); n++) ; + if (n > MLX5E_MAX_BUSDMA_RX_SEGS) + return (-ENOMEM); + *wqe_sz = r; *nsegs = n; return (0); Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Thu May 16 18:22:02 2019 (r347871) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Thu May 16 18:22:46 2019 (r347872) @@ -32,7 +32,7 @@ static inline int mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq, struct mlx5e_rx_wqe *wqe, u16 ix) { - bus_dma_segment_t segs[rq->nsegs]; + bus_dma_segment_t segs[MLX5E_MAX_BUSDMA_RX_SEGS]; struct mbuf *mb; int nsegs; int err;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161822.x4GIMki6040164>