[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLO
From: |
Zhang, Chen |
Subject: |
RE: [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME |
Date: |
Sun, 13 Sep 2020 20:06:17 +0000 |
> -----Original Message-----
> From: Zhang, Chen
> Sent: Monday, September 14, 2020 4:02 AM
> To: 'Derek Su' <dereksu@qnap.com>; qemu-devel@nongnu.org
> Cc: lizhijian@cn.fujitsu.com; jasowang@redhat.com
> Subject: RE: [PATCH v1 2/2] colo-compare: Record packet creation time by
> QEMU_CLOCK_REALTIME
>
>
>
> > -----Original Message-----
> > From: Derek Su <dereksu@qnap.com>
> > Sent: Saturday, September 12, 2020 3:05 AM
> > To: qemu-devel@nongnu.org
> > Cc: Zhang, Chen <chen.zhang@intel.com>; lizhijian@cn.fujitsu.com;
> > jasowang@redhat.com; Derek Su <dereksu@qnap.com>
> > Subject: [PATCH v1 2/2] colo-compare: Record packet creation time by
> > QEMU_CLOCK_REALTIME
> >
> > Record packet creation time by QEMU_CLOCK_REALTIME instead of
> > QEMU_CLOCK_HOST. The time difference between `now` and packet
> > `creation_ms` has the possibility of an unexpected negative value and
> > results in wrong comparison after changing the host clock.
> >
>
> Hi Derek,
>
> I think this issue caused by other code in this file use the
> qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL);
> I will change all code to QEMU_CLOCK_HOST to fix it with the patch 1/2.
If you feel OK, or you can send the new version. :-)
>
> Thanks
> Zhang Chen
>
> > Signed-off-by: Derek Su <dereksu@qnap.com>
> > ---
> > net/colo-compare.c | 2 +-
> > net/colo.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/colo-compare.c b/net/colo-compare.c index
> > c4de86ef34..29d7f986e3 100644
> > --- a/net/colo-compare.c
> > +++ b/net/colo-compare.c
> > @@ -621,7 +621,7 @@ static int colo_packet_compare_other(Packet *spkt,
> > Packet *ppkt)
> >
> > static int colo_old_packet_check_one(Packet *pkt, void *user_data) {
> > - int64_t now = qemu_clock_get_ms(QEMU_CLOCK_HOST);
> > + int64_t now = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
> > uint32_t check_time = *(uint32_t *)user_data;
> >
> > if ((now - pkt->creation_ms) > check_time) { diff --git
> > a/net/colo.c b/net/colo.c index a6c66d829a..0441910169 100644
> > --- a/net/colo.c
> > +++ b/net/colo.c
> > @@ -164,7 +164,7 @@ Packet *packet_new(const void *data, int size, int
> > vnet_hdr_len)
> >
> > pkt->data = g_memdup(data, size);
> > pkt->size = size;
> > - pkt->creation_ms = qemu_clock_get_ms(QEMU_CLOCK_HOST);
> > + pkt->creation_ms = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
> > pkt->vnet_hdr_len = vnet_hdr_len;
> > pkt->tcp_seq = 0;
> > pkt->tcp_ack = 0;
> > --
> > 2.25.1
- [PATCH v1 0/2] colo-compare bugfixes, Derek Su, 2020/09/11
- [PATCH v1 1/2] colo-compare: Fix incorrect data type conversion, Derek Su, 2020/09/11
- [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME, Derek Su, 2020/09/11
- RE: [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME, Zhang, Chen, 2020/09/13
- RE: [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME,
Zhang, Chen <=
- Re: [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME, Derek Su, 2020/09/13
- RE: [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME, Zhang, Chen, 2020/09/14
- Re: [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME, Derek Su, 2020/09/14
- RE: [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME, Zhang, Chen, 2020/09/14
- Re: [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME, Derek Su, 2020/09/14