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: Ben 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: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
0fb1e1c524
commit
e6bbe23277
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user