Bdev/QoS: return actual submitted IO count

SPDK poller function will return the different value for
the different status. Update the QoS poller for this change.

Change-Id: Ia384bf00a23713df663c317b1997ead441c5adcb
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/428573
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
GangCao 2018-10-10 13:04:50 -04:00 committed by Jim Harris
parent 535466d7cd
commit 91420344f4

View File

@ -1131,13 +1131,13 @@ _spdk_bdev_qos_update_per_io(struct spdk_bdev_qos *qos, uint64_t io_size_in_byte
}
}
static void
static int
_spdk_bdev_qos_io_submit(struct spdk_bdev_channel *ch, struct spdk_bdev_qos *qos)
{
struct spdk_bdev_io *bdev_io = NULL;
struct spdk_bdev *bdev = ch->bdev;
struct spdk_bdev_shared_resource *shared_resource = ch->shared_resource;
int i;
int i, submitted_ios = 0;
bool to_limit_io;
uint64_t io_size_in_byte;
@ -1145,7 +1145,7 @@ _spdk_bdev_qos_io_submit(struct spdk_bdev_channel *ch, struct spdk_bdev_qos *qos
for (i = 0; i < SPDK_BDEV_QOS_NUM_RATE_LIMIT_TYPES; i++) {
if (qos->rate_limits[i].max_per_timeslice > 0 &&
(qos->rate_limits[i].remaining_this_timeslice <= 0)) {
return;
return submitted_ios;
}
}
@ -1159,7 +1159,10 @@ _spdk_bdev_qos_io_submit(struct spdk_bdev_channel *ch, struct spdk_bdev_qos *qos
_spdk_bdev_qos_update_per_io(qos, io_size_in_byte);
}
bdev->fn_table->submit_request(ch->channel, bdev_io);
submitted_ios++;
}
return submitted_ios;
}
static void
@ -1580,9 +1583,7 @@ spdk_bdev_channel_poll_qos(void *arg)
}
}
_spdk_bdev_qos_io_submit(qos->ch, qos);
return -1;
return _spdk_bdev_qos_io_submit(qos->ch, qos);
}
static void