qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Zhang, Chen" <chen.zhang@intel.com>
To: Derek Su <dereksu@qnap.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "jasowang@redhat.com" <jasowang@redhat.com>,
	"lizhijian@cn.fujitsu.com" <lizhijian@cn.fujitsu.com>
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	[thread overview]
Message-ID: <0bf192578764481e8757c6595094eb28@intel.com> (raw)
In-Reply-To: <817fd011098a4fc6a6790c17414a71a8@intel.com>



> -----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



  reply	other threads:[~2020-09-13 20:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 19:05 [PATCH v1 0/2] colo-compare bugfixes Derek Su
2020-09-11 19:05 ` [PATCH v1 1/2] colo-compare: Fix incorrect data type conversion Derek Su
2020-09-13 20:02   ` Zhang, Chen
2020-09-14  0:31     ` Derek Su
2020-09-11 19:05 ` [PATCH v1 2/2] colo-compare: Record packet creation time by QEMU_CLOCK_REALTIME Derek Su
2020-09-13 20:02   ` Zhang, Chen
2020-09-13 20:06     ` Zhang, Chen [this message]
2020-09-14  1:00       ` Derek Su
2020-09-14  7:42         ` Zhang, Chen
2020-09-14 16:23           ` Derek Su
2020-09-15  0:09             ` Zhang, Chen
2020-09-15  1:50               ` Derek Su

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0bf192578764481e8757c6595094eb28@intel.com \
    --to=chen.zhang@intel.com \
    --cc=dereksu@qnap.com \
    --cc=jasowang@redhat.com \
    --cc=lizhijian@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).