From owner-svn-src-all@freebsd.org Mon Apr 15 15:02:20 2019 Return-Path: Delivered-To: svn-src-all@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 1FD5B157646D; Mon, 15 Apr 2019 15:02:20 +0000 (UTC) (envelope-from mav@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 B90EF853FE; Mon, 15 Apr 2019 15:02:19 +0000 (UTC) (envelope-from mav@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 AE3869A62; Mon, 15 Apr 2019 15:02:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3FF2Jq3095095; Mon, 15 Apr 2019 15:02:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FF2IV7095089; Mon, 15 Apr 2019 15:02:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904151502.x3FF2IV7095089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 15 Apr 2019 15:02:18 +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: r346236 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 346236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B90EF853FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2019 15:02:20 -0000 Author: mav Date: Mon Apr 15 15:02:18 2019 New Revision: 346236 URL: https://svnweb.freebsd.org/changeset/base/346236 Log: MFC r344642 (by imp): Unconditionally support unmapped BIOs. This was another shim for supporting older kernels. However, all supported versions of FreeBSD have unmapped I/Os (as do several that have gone EOL), remove it. It's unlikely the driver would work on the older kernels anyway at this point. Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c stable/12/sys/dev/nvme/nvme_ns.c stable/12/sys/dev/nvme/nvme_private.h stable/12/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Mon Apr 15 15:01:32 2019 (r346235) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Mon Apr 15 15:02:18 2019 (r346236) @@ -1056,11 +1056,7 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr buf->b_data = pt->buf; buf->b_bufsize = pt->len; buf->b_iocmd = pt->is_read ? BIO_READ : BIO_WRITE; -#ifdef NVME_UNMAPPED_BIO_SUPPORT if (vmapbuf(buf, 1) < 0) { -#else - if (vmapbuf(buf) < 0) { -#endif ret = EFAULT; goto err; } Modified: stable/12/sys/dev/nvme/nvme_ns.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ns.c Mon Apr 15 15:01:32 2019 (r346235) +++ stable/12/sys/dev/nvme/nvme_ns.c Mon Apr 15 15:02:18 2019 (r346236) @@ -357,10 +357,8 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali caddr_t data; uint32_t rem_bcount; int i; -#ifdef NVME_UNMAPPED_BIO_SUPPORT struct vm_page **ma; uint32_t ma_offset; -#endif *num_bios = nvme_get_num_segments(bp->bio_offset, bp->bio_bcount, alignment); @@ -373,10 +371,8 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali cur_offset = bp->bio_offset; rem_bcount = bp->bio_bcount; data = bp->bio_data; -#ifdef NVME_UNMAPPED_BIO_SUPPORT ma_offset = bp->bio_ma_offset; ma = bp->bio_ma; -#endif for (i = 0; i < *num_bios; i++) { child = child_bios[i]; @@ -386,7 +382,6 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali child->bio_bcount = min(rem_bcount, alignment - (cur_offset & (alignment - 1))); child->bio_flags = bp->bio_flags; -#ifdef NVME_UNMAPPED_BIO_SUPPORT if (bp->bio_flags & BIO_UNMAPPED) { child->bio_ma_offset = ma_offset; child->bio_ma = ma; @@ -398,9 +393,7 @@ nvme_construct_child_bios(struct bio *bp, uint32_t ali ma += child->bio_ma_n; if (ma_offset != 0) ma -= 1; - } else -#endif - { + } else { child->bio_data = data; data += child->bio_bcount; } @@ -599,9 +592,7 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t if (res != 0) return (ENXIO); -#ifdef NVME_UNMAPPED_BIO_SUPPORT ns->cdev->si_flags |= SI_UNMAPPED; -#endif return (0); } Modified: stable/12/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/12/sys/dev/nvme/nvme_private.h Mon Apr 15 15:01:32 2019 (r346235) +++ stable/12/sys/dev/nvme/nvme_private.h Mon Apr 15 15:02:18 2019 (r346236) @@ -112,16 +112,6 @@ MALLOC_DECLARE(M_NVME); #define CACHE_LINE_SIZE (64) #endif -/* - * Use presence of the BIO_UNMAPPED flag to determine whether unmapped I/O - * support and the bus_dmamap_load_bio API are available on the target - * kernel. This will ease porting back to earlier stable branches at a - * later point. - */ -#ifdef BIO_UNMAPPED -#define NVME_UNMAPPED_BIO_SUPPORT -#endif - extern uma_zone_t nvme_request_zone; extern int32_t nvme_retry_count; @@ -134,9 +124,7 @@ struct nvme_completion_poll_status { #define NVME_REQUEST_VADDR 1 #define NVME_REQUEST_NULL 2 /* For requests with no payload. */ #define NVME_REQUEST_UIO 3 -#ifdef NVME_UNMAPPED_BIO_SUPPORT #define NVME_REQUEST_BIO 4 -#endif #define NVME_REQUEST_CCB 5 struct nvme_request { @@ -506,14 +494,8 @@ nvme_allocate_request_bio(struct bio *bio, nvme_cb_fn_ req = _nvme_allocate_request(cb_fn, cb_arg); if (req != NULL) { -#ifdef NVME_UNMAPPED_BIO_SUPPORT req->type = NVME_REQUEST_BIO; req->u.bio = bio; -#else - req->type = NVME_REQUEST_VADDR; - req->u.payload = bio->bio_data; - req->payload_size = bio->bio_bcount; -#endif } return (req); } Modified: stable/12/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_qpair.c Mon Apr 15 15:01:32 2019 (r346235) +++ stable/12/sys/dev/nvme/nvme_qpair.c Mon Apr 15 15:02:18 2019 (r346236) @@ -954,7 +954,6 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, s case NVME_REQUEST_NULL: nvme_qpair_submit_tracker(tr->qpair, tr); break; -#ifdef NVME_UNMAPPED_BIO_SUPPORT case NVME_REQUEST_BIO: KASSERT(req->u.bio->bio_bcount <= qpair->ctrlr->max_xfer_size, ("bio->bio_bcount (%jd) exceeds max_xfer_size (%d)\n", @@ -966,7 +965,6 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, s nvme_printf(qpair->ctrlr, "bus_dmamap_load_bio returned 0x%x!\n", err); break; -#endif case NVME_REQUEST_CCB: err = bus_dmamap_load_ccb(tr->qpair->dma_tag_payload, tr->payload_dma_map, req->u.payload,