Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 May 2019 11:06:22 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r347316 - head/sys/dev/mlx5/mlx5_en
Message-ID:  <201905081106.x48B6MXK063672@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed May  8 11:06:22 2019
New Revision: 347316
URL: https://svnweb.freebsd.org/changeset/base/347316

Log:
  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)
  
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/en.h	Wed May  8 11:05:59 2019	(r347315)
+++ head/sys/dev/mlx5/mlx5_en/en.h	Wed May  8 11:06:22 2019	(r347316)
@@ -87,6 +87,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: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Wed May  8 11:05:59 2019	(r347315)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Wed May  8 11:06:22 2019	(r347316)
@@ -2243,6 +2243,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: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c	Wed May  8 11:05:59 2019	(r347315)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c	Wed May  8 11:06:22 2019	(r347316)
@@ -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?201905081106.x48B6MXK063672>