From owner-svn-src-stable@freebsd.org Mon Apr 15 15:01:34 2019 Return-Path: Delivered-To: svn-src-stable@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 7FEDD15762CC; Mon, 15 Apr 2019 15:01:34 +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 1EE8785244; Mon, 15 Apr 2019 15:01:34 +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 EF84C9A21; Mon, 15 Apr 2019 15:01:33 +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 x3FF1XRo090249; Mon, 15 Apr 2019 15:01:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3FF1XuD090246; Mon, 15 Apr 2019 15:01:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904151501.x3FF1XuD090246@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:01:33 +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: r346235 - 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: 346235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1EE8785244 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2019 15:01:34 -0000 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);