From owner-svn-src-stable-12@freebsd.org Thu May 16 16:39:03 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A24C2159E2AE; Thu, 16 May 2019 16:39:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47A348B151; Thu, 16 May 2019 16:39:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23B7223722; Thu, 16 May 2019 16:39:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GGd36o076870; Thu, 16 May 2019 16:39:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GGd2aE076867; Thu, 16 May 2019 16:39:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905161639.x4GGd2aE076867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 May 2019 16:39:02 +0000 (UTC) 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 X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 347782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47A348B151 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 May 2019 16:39:03 -0000 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;