Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Apr 2019 15:01:33 +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-12@freebsd.org
Subject:   svn commit: r346235 - stable/12/sys/dev/nvme
Message-ID:  <201904151501.x3FF1XuD090246@repo.freebsd.org>

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

Log:
  MFC r344640 (by imp):
  Remove #ifdef code to support FreeBSD versions that haven't been
  supported in years. A number of changes have been made to the driver
  that likely wouldn't work on those older versions that aren't properly
  ifdef'd and it's project policy to GC such code once it is stale.

Modified:
  stable/12/sys/dev/nvme/nvme_private.h
  stable/12/sys/dev/nvme/nvme_qpair.c
  stable/12/sys/dev/nvme/nvme_test.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/nvme/nvme_private.h
==============================================================================
--- stable/12/sys/dev/nvme/nvme_private.h	Mon Apr 15 15:00:13 2019	(r346234)
+++ stable/12/sys/dev/nvme/nvme_private.h	Mon Apr 15 15:01:32 2019	(r346235)
@@ -349,11 +349,6 @@ struct nvme_controller {
 		    (val & 0xFFFFFFFF00000000ULL) >> 32);		       \
 	} while (0);
 
-#if __FreeBSD_version < 800054
-#define wmb()	__asm volatile("sfence" ::: "memory")
-#define mb()	__asm volatile("mfence" ::: "memory")
-#endif
-
 #define nvme_printf(ctrlr, fmt, args...)	\
     device_printf(ctrlr->dev, fmt, ##args)
 

Modified: stable/12/sys/dev/nvme/nvme_qpair.c
==============================================================================
--- stable/12/sys/dev/nvme/nvme_qpair.c	Mon Apr 15 15:00:13 2019	(r346234)
+++ stable/12/sys/dev/nvme/nvme_qpair.c	Mon Apr 15 15:01:32 2019	(r346235)
@@ -823,13 +823,8 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st
 	ctrlr = qpair->ctrlr;
 
 	if (req->timeout)
-#if __FreeBSD_version >= 800030
 		callout_reset_curcpu(&tr->timer, ctrlr->timeout_period * hz,
 		    nvme_timeout, tr);
-#else
-		callout_reset(&tr->timer, ctrlr->timeout_period * hz,
-		    nvme_timeout, tr);
-#endif
 
 	/* Copy the command from the tracker to the submission queue. */
 	memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd));

Modified: stable/12/sys/dev/nvme/nvme_test.c
==============================================================================
--- stable/12/sys/dev/nvme/nvme_test.c	Mon Apr 15 15:00:13 2019	(r346234)
+++ stable/12/sys/dev/nvme/nvme_test.c	Mon Apr 15 15:01:32 2019	(r346235)
@@ -94,9 +94,7 @@ nvme_ns_bio_test(void *arg)
 	struct timeval			t;
 	uint64_t			io_completed = 0, offset;
 	uint32_t			idx;
-#if __FreeBSD_version >= 900017
 	int				ref;
-#endif
 
 	buf = malloc(io_test->size, M_NVME, M_WAITOK);
 	idx = atomic_fetchadd_int(&io_test->td_idx, 1);
@@ -118,11 +116,7 @@ nvme_ns_bio_test(void *arg)
 		bio->bio_bcount = io_test->size;
 
 		if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
-#if __FreeBSD_version >= 900017
 			csw = dev_refthread(dev, &ref);
-#else
-			csw = dev_refthread(dev);
-#endif
 		} else
 			csw = dev->si_devsw;
 
@@ -133,11 +127,7 @@ nvme_ns_bio_test(void *arg)
 		mtx_unlock(mtx);
 
 		if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
-#if __FreeBSD_version >= 900017
 			dev_relthread(dev, ref);
-#else
-			dev_relthread(dev);
-#endif
 		}
 
 		if ((bio->bio_flags & BIO_ERROR) || (bio->bio_resid > 0))
@@ -166,11 +156,7 @@ nvme_ns_bio_test(void *arg)
 	atomic_subtract_int(&io_test->td_active, 1);
 	mb();
 
-#if __FreeBSD_version >= 800000
 	kthread_exit();
-#else
-	kthread_exit(0);
-#endif
 }
 
 static void
@@ -246,11 +232,7 @@ nvme_ns_io_test(void *arg)
 	atomic_subtract_int(&io_test->td_active, 1);
 	mb();
 
-#if __FreeBSD_version >= 800004
 	kthread_exit();
-#else
-	kthread_exit(0);
-#endif
 }
 
 void
@@ -287,13 +269,8 @@ nvme_ns_test(struct nvme_namespace *ns, u_long cmd, ca
 	getmicrouptime(&io_test_internal->start);
 
 	for (i = 0; i < io_test->num_threads; i++)
-#if __FreeBSD_version >= 800004
 		kthread_add(fn, io_test_internal,
 		    NULL, NULL, 0, 0, "nvme_io_test[%d]", i);
-#else
-		kthread_create(fn, io_test_internal,
-		    NULL, 0, 0, "nvme_io_test[%d]", i);
-#endif
 
 	tsleep(io_test_internal, 0, "nvme_test", io_test->time * 2 * hz);
 



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