From owner-svn-src-stable@freebsd.org Mon Jan 11 17:33:52 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3D69A65DC0; Mon, 11 Jan 2016 17:33:52 +0000 (UTC) (envelope-from jimharris@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 mx1.freebsd.org (Postfix) with ESMTPS id 8BECE1E75; Mon, 11 Jan 2016 17:33:52 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0BHXpna032950; Mon, 11 Jan 2016 17:33:51 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0BHXpVn032949; Mon, 11 Jan 2016 17:33:51 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601111733.u0BHXpVn032949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Mon, 11 Jan 2016 17:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293673 - stable/10/sys/dev/nvme X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 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, 11 Jan 2016 17:33:52 -0000 Author: jimharris Date: Mon Jan 11 17:33:51 2016 New Revision: 293673 URL: https://svnweb.freebsd.org/changeset/base/293673 Log: MFC r293354: nvme: replace NVME_CEILING macro with howmany() Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c Modified: stable/10/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_ctrlr.c Mon Jan 11 17:32:56 2016 (r293672) +++ stable/10/sys/dev/nvme/nvme_ctrlr.c Mon Jan 11 17:33:51 2016 (r293673) @@ -42,12 +42,6 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" -/* - * Used for calculating number of CPUs to assign to each core and number of I/O - * queues to allocate per controller. - */ -#define NVME_CEILING(num, div) ((((num) - 1) / (div)) + 1) - static void nvme_ctrlr_construct_and_submit_aer(struct nvme_controller *ctrlr, struct nvme_async_event_request *aer); static void nvme_ctrlr_setup_interrupts(struct nvme_controller *ctrlr); @@ -152,7 +146,7 @@ nvme_ctrlr_construct_io_qpairs(struct nv * a controller could theoretically support fewer I/O queues than * MSI-X vectors. So calculate again here just to be safe. */ - ctrlr->num_cpus_per_ioq = NVME_CEILING(mp_ncpus, ctrlr->num_io_queues); + ctrlr->num_cpus_per_ioq = howmany(mp_ncpus, ctrlr->num_io_queues); ctrlr->ioq = malloc(ctrlr->num_io_queues * sizeof(struct nvme_qpair), M_NVME, M_ZERO | M_WAITOK); @@ -1030,9 +1024,9 @@ nvme_ctrlr_setup_interrupts(struct nvme_ * admin queue. */ ctrlr->num_cpus_per_ioq = max(min_cpus_per_ioq, - NVME_CEILING(mp_ncpus, num_vectors_available - 1)); + howmany(mp_ncpus, num_vectors_available - 1)); - ctrlr->num_io_queues = NVME_CEILING(mp_ncpus, ctrlr->num_cpus_per_ioq); + ctrlr->num_io_queues = howmany(mp_ncpus, ctrlr->num_cpus_per_ioq); num_vectors_requested = ctrlr->num_io_queues + 1; num_vectors_allocated = num_vectors_requested;