> -----Original Message-----
> From: Derek Su <dere...@qnap.com>
> Sent: Saturday, September 12, 2020 3:05 AM
> To: qemu-devel@nongnu.org
> Cc: Zhang, Chen <chen.zh...@intel.com>; lizhij...@cn.fujitsu.com;
> jasow...@redhat.com; Derek Su <dere...@qnap.com>
> Subject: [PATCH v1 1/2] colo-compare: Fix incorrect data type conversion
>
> Fix data type conversion of compare_timeout. The incorrect conversion
> results in a random compare_timeout value and unexpected stalls in packet
> comparison.
>
This bug already found on our internal test too. Just waiting to send.
Good catch! But this patch not fixed the root cause.
Change the compare_timeout from uint32_t to uint64_t is better.
I will send a patch for this and tag reported by you.
Thanks
Zhang Chen
> Signed-off-by: Derek Su <dere...@qnap.com>
> ---
> net/colo-compare.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/colo-compare.c b/net/colo-compare.c index
> 2c20de1537..c4de86ef34 100644
> --- a/net/colo-compare.c
> +++ b/net/colo-compare.c
> @@ -619,11 +619,12 @@ static int colo_packet_compare_other(Packet *spkt,
> Packet *ppkt)
> ppkt->size - offset); }
>
> -static int colo_old_packet_check_one(Packet *pkt, int64_t *check_time)
> +static int colo_old_packet_check_one(Packet *pkt, void *user_data)
> {
> int64_t now = qemu_clock_get_ms(QEMU_CLOCK_HOST);
> + uint32_t check_time = *(uint32_t *)user_data;
>
> - if ((now - pkt->creation_ms) > (*check_time)) {
> + if ((now - pkt->creation_ms) > check_time) {
> trace_colo_old_packet_check_found(pkt->creation_ms);
> return 0;
> } else {
> --
> 2.25.1