Commit e6bbe232 authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

util: Move definition of SPDK_SEC_TO_USEC to util.h



This was defined in two places, so consolidate
the definitions.

Change-Id: I0bbb262b97e90d1064bcc50ee201928f6ca9518a
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/423182


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 0fb1e1c5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -51,6 +51,8 @@ extern "C" {

#define SPDK_CONTAINEROF(ptr, type, member) ((type *)((uintptr_t)ptr - offsetof(type, member)))

#define SPDK_SEC_TO_USEC 1000000ULL

static inline uint32_t
spdk_u32log2(uint32_t x)
{
+2 −3
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ int __itt_init_ittlib(const char *, __itt_group_id);
#define NOMEM_THRESHOLD_COUNT			8
#define ZERO_BUFFER_SIZE			0x100000
#define SPDK_BDEV_QOS_TIMESLICE_IN_USEC		1000
#define SPDK_BDEV_SEC_TO_USEC			1000000ULL
#define SPDK_BDEV_QOS_MIN_IO_PER_TIMESLICE	1
#define SPDK_BDEV_QOS_MIN_BYTE_PER_TIMESLICE	512
#define SPDK_BDEV_QOS_MIN_IOS_PER_SEC		10000
@@ -1416,14 +1415,14 @@ spdk_bdev_qos_update_max_quota_per_timeslice(struct spdk_bdev_qos *qos)

	if (qos->iops_rate_limit > 0) {
		max_ios_per_timeslice = qos->iops_rate_limit * SPDK_BDEV_QOS_TIMESLICE_IN_USEC /
					SPDK_BDEV_SEC_TO_USEC;
					SPDK_SEC_TO_USEC;
		qos->max_ios_per_timeslice = spdk_max(max_ios_per_timeslice,
						      SPDK_BDEV_QOS_MIN_IO_PER_TIMESLICE);
	}

	if (qos->byte_rate_limit > 0) {
		max_byte_per_timeslice = qos->byte_rate_limit * SPDK_BDEV_QOS_TIMESLICE_IN_USEC /
					 SPDK_BDEV_SEC_TO_USEC;
					 SPDK_SEC_TO_USEC;
		qos->max_byte_per_timeslice = spdk_max(max_byte_per_timeslice,
						       SPDK_BDEV_QOS_MIN_BYTE_PER_TIMESLICE);
	}
+0 −1
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@

#define SPDK_REACTOR_SPIN_TIME_USEC	1000
#define SPDK_EVENT_BATCH_SIZE		8
#define SPDK_SEC_TO_USEC		1000000ULL

enum spdk_poller_state {
	/* The poller is registered with a reactor but not currently executing its fn. */