Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 16:38:20 +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-12@freebsd.org
Subject:   svn commit: r347781 - stable/12/sys/dev/mlx5/mlx5_en
Message-ID:  <201905161638.x4GGcKIu076777@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu May 16 16:38:19 2019
New Revision: 347781
URL: https://svnweb.freebsd.org/changeset/base/347781

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/12/sys/dev/mlx5/mlx5_en/en.h
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/mlx5_en/en.h
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/en.h	Thu May 16 16:37:36 2019	(r347780)
+++ stable/12/sys/dev/mlx5/mlx5_en/en.h	Thu May 16 16:38:19 2019	(r347781)
@@ -86,6 +86,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/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu May 16 16:37:36 2019	(r347780)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu May 16 16:38:19 2019	(r347781)
@@ -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: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c	Thu May 16 16:37:36 2019	(r347780)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c	Thu May 16 16:38:19 2019	(r347781)
@@ -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?201905161638.x4GGcKIu076777>