Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Apr 2019 16:28:25 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r346244 - stable/11/sys/dev/nvme
Message-ID:  <201904151628.x3FGSPkq038816@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Apr 15 16:28:25 2019
New Revision: 346244
URL: https://svnweb.freebsd.org/changeset/base/346244

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/11/sys/dev/nvme/nvme_ctrlr.c
  stable/11/sys/dev/nvme/nvme_ns.c
  stable/11/sys/dev/nvme/nvme_private.h
  stable/11/sys/dev/nvme/nvme_qpair.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- stable/11/sys/dev/nvme/nvme_ctrlr.c	Mon Apr 15 16:27:53 2019	(r346243)
+++ stable/11/sys/dev/nvme/nvme_ctrlr.c	Mon Apr 15 16:28:25 2019	(r346244)
@@ -986,11 +986,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/11/sys/dev/nvme/nvme_ns.c
==============================================================================
--- stable/11/sys/dev/nvme/nvme_ns.c	Mon Apr 15 16:27:53 2019	(r346243)
+++ stable/11/sys/dev/nvme/nvme_ns.c	Mon Apr 15 16:28:25 2019	(r346244)
@@ -346,10 +346,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);
@@ -362,10 +360,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];
@@ -375,7 +371,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;
@@ -387,9 +382,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;
 		}
@@ -575,9 +568,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/11/sys/dev/nvme/nvme_private.h
==============================================================================
--- stable/11/sys/dev/nvme/nvme_private.h	Mon Apr 15 16:27:53 2019	(r346243)
+++ stable/11/sys/dev/nvme/nvme_private.h	Mon Apr 15 16:28:25 2019	(r346244)
@@ -110,16 +110,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;
 
@@ -132,9 +122,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 {
@@ -504,14 +492,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/11/sys/dev/nvme/nvme_qpair.c
==============================================================================
--- stable/11/sys/dev/nvme/nvme_qpair.c	Mon Apr 15 16:27:53 2019	(r346243)
+++ stable/11/sys/dev/nvme/nvme_qpair.c	Mon Apr 15 16:28:25 2019	(r346244)
@@ -872,7 +872,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",
@@ -884,7 +883,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,



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