Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 16:39:02 +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: r347782 - stable/12/sys/dev/mlx5/mlx5_en
Message-ID:  <201905161639.x4GGd2aE076867@repo.freebsd.org>

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

Log:
  MFC r347317:
  Remove non-functional MLX5E_MAX_RX_SEGS macro in mlx5en(4).
  
  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:38:19 2019	(r347781)
+++ stable/12/sys/dev/mlx5/mlx5_en/en.h	Thu May 16 16:39:02 2019	(r347782)
@@ -88,19 +88,13 @@
 
 #define	MLX5E_MAX_BUSDMA_RX_SEGS 15
 
-#define	MLX5E_MAX_RX_SEGS 7
-
 #ifndef MLX5E_MAX_RX_BYTES
 #define	MLX5E_MAX_RX_BYTES MCLBYTES
 #endif
 
-#if (MLX5E_MAX_RX_SEGS == 1)
-/* FreeBSD HW LRO is limited by 16KB - the size of max mbuf */
-#define	MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ                 MJUM16BYTES
-#else
 #define	MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ \
-    MIN(65535, MLX5E_MAX_RX_SEGS * MLX5E_MAX_RX_BYTES)
-#endif
+    MIN(65535, 7 * MLX5E_MAX_RX_BYTES)
+
 #define	MLX5E_DIM_DEFAULT_PROFILE 3
 #define	MLX5E_DIM_MAX_RX_CQ_MODERATION_PKTS_WITH_LRO	16
 #define	MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_USEC      0x10

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:38:19 2019	(r347781)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Thu May 16 16:39:02 2019	(r347782)
@@ -1253,11 +1253,7 @@ mlx5e_create_rq(struct mlx5e_channel *c,
 	rq->mbuf = malloc(wq_sz * sizeof(rq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO);
 	for (i = 0; i != wq_sz; i++) {
 		struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, i);
-#if (MLX5E_MAX_RX_SEGS == 1)
-		uint32_t byte_count = rq->wqe_sz - MLX5E_NET_IP_ALIGN;
-#else
 		int j;
-#endif
 
 		err = -bus_dmamap_create(rq->dma_tag, 0, &rq->mbuf[i].dma_map);
 		if (err != 0) {
@@ -1267,13 +1263,8 @@ mlx5e_create_rq(struct mlx5e_channel *c,
 		}
 
 		/* set value for constant fields */
-#if (MLX5E_MAX_RX_SEGS == 1)
-		wqe->data[0].lkey = c->mkey_be;
-		wqe->data[0].byte_count = cpu_to_be32(byte_count | MLX5_HW_START_PADDING);
-#else
 		for (j = 0; j < rq->nsegs; j++)
 			wqe->data[j].lkey = c->mkey_be;
-#endif
 	}
 
 	INIT_WORK(&rq->dim.work, mlx5e_dim_work);

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:38:19 2019	(r347781)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c	Thu May 16 16:39:02 2019	(r347782)
@@ -36,20 +36,12 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq,
 	struct mbuf *mb;
 	int nsegs;
 	int err;
-#if (MLX5E_MAX_RX_SEGS != 1)
 	struct mbuf *mb_head;
 	int i;
-#endif
+
 	if (rq->mbuf[ix].mbuf != NULL)
 		return (0);
 
-#if (MLX5E_MAX_RX_SEGS == 1)
-	mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, rq->wqe_sz);
-	if (unlikely(!mb))
-		return (-ENOMEM);
-
-	mb->m_pkthdr.len = mb->m_len = rq->wqe_sz;
-#else
 	mb_head = mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR,
 	    MLX5E_MAX_RX_BYTES);
 	if (unlikely(mb == NULL))
@@ -72,7 +64,7 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq,
 	}
 	/* rewind to first mbuf in chain */
 	mb = mb_head;
-#endif
+
 	/* get IP header aligned */
 	m_adj(mb, MLX5E_NET_IP_ALIGN);
 
@@ -85,10 +77,7 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq,
 		err = -ENOMEM;
 		goto err_free_mbuf;
 	}
-#if (MLX5E_MAX_RX_SEGS == 1)
 	wqe->data[0].addr = cpu_to_be64(segs[0].ds_addr);
-#else
-	wqe->data[0].addr = cpu_to_be64(segs[0].ds_addr);
 	wqe->data[0].byte_count = cpu_to_be32(segs[0].ds_len |
 	    MLX5_HW_START_PADDING);
 	for (i = 1; i != nsegs; i++) {
@@ -99,7 +88,6 @@ mlx5e_alloc_rx_wqe(struct mlx5e_rq *rq,
 		wqe->data[i].addr = 0;
 		wqe->data[i].byte_count = 0;
 	}
-#endif
 
 	rq->mbuf[ix].mbuf = mb;
 	rq->mbuf[ix].data = mb->m_data;
@@ -257,9 +245,7 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe,
 {
 	struct ifnet *ifp = rq->ifp;
 	struct mlx5e_channel *c;
-#if (MLX5E_MAX_RX_SEGS != 1)
 	struct mbuf *mb_head;
-#endif
 	int lro_num_seg;	/* HW LRO session aggregated packets counter */
 	uint64_t tstmp;
 
@@ -270,9 +256,6 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe,
 		rq->stats.lro_bytes += cqe_bcnt;
 	}
 
-#if (MLX5E_MAX_RX_SEGS == 1)
-	mb->m_pkthdr.len = mb->m_len = cqe_bcnt;
-#else
 	mb->m_pkthdr.len = cqe_bcnt;
 	for (mb_head = mb; mb != NULL; mb = mb->m_next) {
 		if (mb->m_len > cqe_bcnt)
@@ -289,7 +272,7 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *cqe,
 	}
 	/* rewind to first mbuf in chain */
 	mb = mb_head;
-#endif
+
 	/* check if a Toeplitz hash was computed */
 	if (cqe->rss_hash_type != 0) {
 		mb->m_pkthdr.flowid = be32_to_cpu(cqe->rss_hash_result);
@@ -472,10 +455,8 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, int budget)
 		}
 		if ((MHLEN - MLX5E_NET_IP_ALIGN) >= byte_cnt &&
 		    (mb = m_gethdr(M_NOWAIT, MT_DATA)) != NULL) {
-#if (MLX5E_MAX_RX_SEGS != 1)
 			/* set maximum mbuf length */
 			mb->m_len = MHLEN - MLX5E_NET_IP_ALIGN;
-#endif
 			/* get IP header aligned */
 			mb->m_data += MLX5E_NET_IP_ALIGN;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161639.x4GGd2aE076867>