Commit aab24255 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

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: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/439081


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
parent b17e0ae7
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -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;

+0 −5
Original line number Diff line number Diff line
@@ -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;