vhost: recalculate coalescing settings on session creation
Instead of calculating those settings once and storing them in the device struct, we'll now recalculate them whenever a device session is created. This lets us remove 2 fields from the device struct. Change-Id: I2cb2bdbc570a41ae78c0666490fb1462a00d0b6f Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/c/439081 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
This commit is contained in:
parent
b17e0ae7db
commit
aab242559d
@ -348,8 +348,10 @@ spdk_vhost_session_set_coalescing(struct spdk_vhost_dev *vdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
vsession->coalescing_delay_time_base = vdev->coalescing_delay_time_base;
|
||||
vsession->coalescing_io_rate_threshold = vdev->coalescing_io_rate_threshold;
|
||||
vsession->coalescing_delay_time_base =
|
||||
vdev->coalescing_delay_us * spdk_get_ticks_hz() / 1000000ULL;
|
||||
vsession->coalescing_io_rate_threshold =
|
||||
vdev->coalescing_iops_threshold * SPDK_VHOST_STATS_CHECK_INTERVAL_MS / 1000U;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -369,9 +371,6 @@ spdk_vhost_set_coalescing(struct spdk_vhost_dev *vdev, uint32_t delay_base_us,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
vdev->coalescing_delay_time_base = delay_time_base;
|
||||
vdev->coalescing_io_rate_threshold = io_rate;
|
||||
|
||||
vdev->coalescing_delay_us = delay_base_us;
|
||||
vdev->coalescing_iops_threshold = iops_threshold;
|
||||
|
||||
|
@ -179,11 +179,6 @@ struct spdk_vhost_dev {
|
||||
uint32_t coalescing_delay_us;
|
||||
uint32_t coalescing_iops_threshold;
|
||||
|
||||
uint32_t coalescing_delay_time_base;
|
||||
|
||||
/* Threshold when event coalescing for virtqueue will be turned on. */
|
||||
uint32_t coalescing_io_rate_threshold;
|
||||
|
||||
/* Active connection to the device */
|
||||
struct spdk_vhost_session *session;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user