From nobody Mon Feb 9 18:18:27 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1615527139; cv=none; d=zohomail.com; s=zohoarc; b=N2xEHHn2w8XJliL+h/MeT/VT0Qu/l+Arpn36je/h+RWi3kMJjee5U9TPwgAtgCh6KRLPoCI2BsYZBIJrKsIwzGniriqqB1k9rtsDu8SK/7LNalhWOhGqfnwbpR6woIDuz3BwMSrLBwWJOpjF4srGF9H/jOFY/r4Vr2TPY23lquw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615527139; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=CclZ5ZSYI+KNA0QRUUa3dlDDAELEn96ScEulfWtx4dA=; b=ZsA4sWGXRheRmp9MBDJo3156jGq9NF4FIViXwyqMhkqzUuH04+sWBkxQQ8PR0gqynvTic2G79FNZKxfisgZKMRB2ibjhgBOEoUU1EDkbAAX8sMQhcYC5VeyPERf9VyeTvM7fQfU/YgSMy0dKkJEKtAzaqzvwYQD7nF8aLz2OOf4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615527139861699.4082192896072; Thu, 11 Mar 2021 21:32:19 -0800 (PST) Received: from localhost ([::1]:51946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKaPK-0005Eo-JU for importer@patchew.org; Fri, 12 Mar 2021 00:32:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKaJK-0005r5-Ga for qemu-devel@nongnu.org; Fri, 12 Mar 2021 00:26:06 -0500 Received: from mga18.intel.com ([134.134.136.126]:29334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKaJH-0007Eb-HJ for qemu-devel@nongnu.org; Fri, 12 Mar 2021 00:26:06 -0500 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2021 21:25:51 -0800 Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.192.103]) by fmsmga006.fm.intel.com with ESMTP; 11 Mar 2021 21:25:47 -0800 IronPort-SDR: Br/Nm4o6IVlfFhoqRO8baOQHdX7dtVcVI5NYRUJomPwXfeNVD+vqwF7OL1aVkVoPkH9aNBQgnQ 7E2ew9e6tx9w== X-IronPort-AV: E=McAfee;i="6000,8403,9920"; a="176376604" X-IronPort-AV: E=Sophos;i="5.81,242,1610438400"; d="scan'208";a="176376604" IronPort-SDR: 2EJ2iB4TSH/50psFQHh+qodQzLwwfUY3ddhgYZDy33MU8yUehgq5GiCBVQbQjiJhdNMdm3mXdm BnICA5fc10Qg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,242,1610438400"; d="scan'208";a="600481995" From: leirao To: chen.zhang@intel.com, lizhijian@cn.fujitsu.com, jasowang@redhat.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, lukasstraub2@web.de Subject: [PATCH v2 10/10] Fixed calculation error of pkt->header_size in fill_pkt_tcp_info() Date: Fri, 12 Mar 2021 13:03:03 +0800 Message-Id: <1615525383-59071-11-git-send-email-lei.rao@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1615525383-59071-1-git-send-email-lei.rao@intel.com> References: <1615525383-59071-1-git-send-email-lei.rao@intel.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.126; envelope-from=lei.rao@intel.com; helo=mga18.intel.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Rao, Lei" , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Rao, Lei" The data pointer has skipped vnet_hdr_len in the function of parse_packet_early().So, we can not subtract vnet_hdr_len again when calculating pkt->header_size in fill_pkt_tcp_info(). Otherwise, it will cause network packet comparsion errors and greatly increase the frequency of checkpoints. Signed-off-by: Lei Rao Signed-off-by: Zhang Chen Reviewed-by: Li Zhijian --- net/colo-compare.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 06f2c28..af30490 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -211,7 +211,7 @@ static void fill_pkt_tcp_info(void *data, uint32_t *max= _ack) pkt->tcp_ack =3D ntohl(tcphd->th_ack); *max_ack =3D *max_ack > pkt->tcp_ack ? *max_ack : pkt->tcp_ack; pkt->header_size =3D pkt->transport_header - (uint8_t *)pkt->data - + (tcphd->th_off << 2) - pkt->vnet_hdr_len; + + (tcphd->th_off << 2); pkt->payload_size =3D pkt->size - pkt->header_size; pkt->seq_end =3D pkt->tcp_seq + pkt->payload_size; pkt->flags =3D tcphd->th_flags; --=20 1.8.3.1