From patchwork Tue Sep 22 09:55:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 11792019 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 04AEC92C for ; Tue, 22 Sep 2020 09:57:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 825D2238A1 for ; Tue, 22 Sep 2020 09:57:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 825D2238A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKf2s-0002re-Fx for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Sep 2020 05:57:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKf1e-0000d5-Aj for qemu-devel@nongnu.org; Tue, 22 Sep 2020 05:55:54 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:51556 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKf1a-0001kD-Qt for qemu-devel@nongnu.org; Tue, 22 Sep 2020 05:55:54 -0400 X-IronPort-AV: E=Sophos;i="5.77,290,1596470400"; d="scan'208";a="99500710" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Sep 2020 17:55:41 +0800 Received: from G08CNEXMBPEKD06.g08.fujitsu.local (unknown [10.167.33.206]) by cn.fujitsu.com (Postfix) with ESMTP id D49C448990F1; Tue, 22 Sep 2020 17:55:39 +0800 (CST) Received: from G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.203) by G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 17:55:37 +0800 Received: from FNSTPC.g08.fujitsu.local (10.167.226.45) by G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 22 Sep 2020 17:55:37 +0800 From: Li Zhijian To: , Subject: [PATCH 1/3] colo-compare: return -1 if no packet is queued Date: Tue, 22 Sep 2020 17:55:23 +0800 Message-ID: <20200922095525.4081603-2-lizhijian@cn.fujitsu.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200922095525.4081603-1-lizhijian@cn.fujitsu.com> References: <20200922095525.4081603-1-lizhijian@cn.fujitsu.com> MIME-Version: 1.0 X-yoursite-MailScanner-ID: D49C448990F1.ABB47 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lizhijian@cn.fujitsu.com Received-SPF: none client-ip=183.91.158.132; envelope-from=lizhijian@cn.fujitsu.com; helo=heian.cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:55:42 X-ACL-Warn: Detected OS = ??? 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_NONE=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: qemu-devel@nongnu.org, Li Zhijian Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Return 0 will trigger a packet comparison Signed-off-by: Li Zhijian --- net/colo-compare.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/colo-compare.c b/net/colo-compare.c index 3a45d64175..039b515611 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -289,6 +289,7 @@ static int packet_enqueue(CompareState *s, int mode, Connection **con) "queue size too big, drop packet"); packet_destroy(pkt, NULL); pkt = NULL; + return -1; } *con = conn; From patchwork Tue Sep 22 09:55:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 11792017 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0085592C for ; Tue, 22 Sep 2020 09:56:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F9512388B for ; Tue, 22 Sep 2020 09:56:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F9512388B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKf2F-0001rU-4e for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Sep 2020 05:56:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKf1d-0000at-64 for qemu-devel@nongnu.org; Tue, 22 Sep 2020 05:55:53 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:51551 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKf1Z-0001hD-U8 for qemu-devel@nongnu.org; Tue, 22 Sep 2020 05:55:52 -0400 X-IronPort-AV: E=Sophos;i="5.77,290,1596470400"; d="scan'208";a="99500709" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Sep 2020 17:55:41 +0800 Received: from G08CNEXMBPEKD05.g08.fujitsu.local (unknown [10.167.33.204]) by cn.fujitsu.com (Postfix) with ESMTP id 351FF48990F2; Tue, 22 Sep 2020 17:55:41 +0800 (CST) Received: from G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.203) by G08CNEXMBPEKD05.g08.fujitsu.local (10.167.33.204) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 17:55:40 +0800 Received: from FNSTPC.g08.fujitsu.local (10.167.226.45) by G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 22 Sep 2020 17:55:39 +0800 From: Li Zhijian To: , Subject: [PATCH 2/3] colo-compare: fix missing compare_seq initialization Date: Tue, 22 Sep 2020 17:55:24 +0800 Message-ID: <20200922095525.4081603-3-lizhijian@cn.fujitsu.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200922095525.4081603-1-lizhijian@cn.fujitsu.com> References: <20200922095525.4081603-1-lizhijian@cn.fujitsu.com> MIME-Version: 1.0 X-yoursite-MailScanner-ID: 351FF48990F2.AA95D X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lizhijian@cn.fujitsu.com Received-SPF: none client-ip=183.91.158.132; envelope-from=lizhijian@cn.fujitsu.com; helo=heian.cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:55:42 X-ACL-Warn: Detected OS = ??? 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_NONE=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: qemu-devel@nongnu.org, Li Zhijian Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Li Zhijian Reviewed-by: Zhang Chen --- net/colo.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/colo.c b/net/colo.c index a6c66d829a..ef00609848 100644 --- a/net/colo.c +++ b/net/colo.c @@ -133,14 +133,11 @@ void reverse_connection_key(ConnectionKey *key) Connection *connection_new(ConnectionKey *key) { - Connection *conn = g_slice_new(Connection); + Connection *conn = g_slice_new0(Connection); conn->ip_proto = key->ip_proto; conn->processing = false; - conn->offset = 0; conn->tcp_state = TCPS_CLOSED; - conn->pack = 0; - conn->sack = 0; g_queue_init(&conn->primary_list); g_queue_init(&conn->secondary_list); From patchwork Tue Sep 22 09:55:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 11792023 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44E2792C for ; Tue, 22 Sep 2020 09:58:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F7AA239CF for ; Tue, 22 Sep 2020 09:58:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F7AA239CF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:41750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKf48-0004vE-0T for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Sep 2020 05:58:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKf1f-0000g9-Oh for qemu-devel@nongnu.org; Tue, 22 Sep 2020 05:55:55 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:51551 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKf1d-0001hD-V6 for qemu-devel@nongnu.org; Tue, 22 Sep 2020 05:55:55 -0400 X-IronPort-AV: E=Sophos;i="5.77,290,1596470400"; d="scan'208";a="99500714" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Sep 2020 17:55:47 +0800 Received: from G08CNEXMBPEKD06.g08.fujitsu.local (unknown [10.167.33.206]) by cn.fujitsu.com (Postfix) with ESMTP id F1E7948990CB; Tue, 22 Sep 2020 17:55:42 +0800 (CST) Received: from G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.203) by G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 17:55:40 +0800 Received: from FNSTPC.g08.fujitsu.local (10.167.226.45) by G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 22 Sep 2020 17:55:41 +0800 From: Li Zhijian To: , Subject: [PATCH 3/3] colo-compare: check mark in mutual exclusion Date: Tue, 22 Sep 2020 17:55:25 +0800 Message-ID: <20200922095525.4081603-4-lizhijian@cn.fujitsu.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200922095525.4081603-1-lizhijian@cn.fujitsu.com> References: <20200922095525.4081603-1-lizhijian@cn.fujitsu.com> MIME-Version: 1.0 X-yoursite-MailScanner-ID: F1E7948990CB.AC3C0 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lizhijian@cn.fujitsu.com Received-SPF: none client-ip=183.91.158.132; envelope-from=lizhijian@cn.fujitsu.com; helo=heian.cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:55:42 X-ACL-Warn: Detected OS = ??? 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_NONE=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: qemu-devel@nongnu.org, Li Zhijian Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Li Zhijian Reviewed-by: Zhang Chen --- net/colo-compare.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 039b515611..19633fc684 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -481,13 +481,11 @@ sec: colo_release_primary_pkt(s, ppkt); g_queue_push_head(&conn->secondary_list, spkt); goto pri; - } - if (mark == COLO_COMPARE_FREE_SECONDARY) { + } else if (mark == COLO_COMPARE_FREE_SECONDARY) { conn->compare_seq = spkt->seq_end; packet_destroy(spkt, NULL); goto sec; - } - if (mark == (COLO_COMPARE_FREE_PRIMARY | COLO_COMPARE_FREE_SECONDARY)) { + } else if (mark == (COLO_COMPARE_FREE_PRIMARY | COLO_COMPARE_FREE_SECONDARY)) { conn->compare_seq = ppkt->seq_end; colo_release_primary_pkt(s, ppkt); packet_destroy(spkt, NULL);