Date: Mon, 15 Apr 2019 16:27:53 +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: r346243 - stable/11/sys/dev/nvme Message-ID: <201904151627.x3FGRrLq038702@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Mon Apr 15 16:27:53 2019 New Revision: 346243 URL: https://svnweb.freebsd.org/changeset/base/346243 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/11/sys/dev/nvme/nvme_private.h stable/11/sys/dev/nvme/nvme_qpair.c stable/11/sys/dev/nvme/nvme_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/11/sys/dev/nvme/nvme_private.h Mon Apr 15 16:27:06 2019 (r346242) +++ stable/11/sys/dev/nvme/nvme_private.h Mon Apr 15 16:27:53 2019 (r346243) @@ -347,11 +347,6 @@ struct nvme_controller { (val & 0xFFFFFFFF00000000UL) >> 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/11/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/11/sys/dev/nvme/nvme_qpair.c Mon Apr 15 16:27:06 2019 (r346242) +++ stable/11/sys/dev/nvme/nvme_qpair.c Mon Apr 15 16:27:53 2019 (r346243) @@ -741,13 +741,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/11/sys/dev/nvme/nvme_test.c ============================================================================== --- stable/11/sys/dev/nvme/nvme_test.c Mon Apr 15 16:27:06 2019 (r346242) +++ stable/11/sys/dev/nvme/nvme_test.c Mon Apr 15 16:27:53 2019 (r346243) @@ -92,9 +92,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); @@ -116,11 +114,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; @@ -131,11 +125,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)) @@ -164,11 +154,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 @@ -244,11 +230,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 @@ -285,13 +267,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?201904151627.x3FGRrLq038702>