From patchwork Wed Oct 21 16:37:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lan Tianyu X-Patchwork-Id: 534232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 14A60141317 for ; Thu, 22 Oct 2015 17:06:26 +1100 (AEDT) Received: from localhost ([::1]:56605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zp915-00020b-Qe for incoming@patchwork.ozlabs.org; Thu, 22 Oct 2015 02:06:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZowaT-0000eu-K6 for qemu-devel@nongnu.org; Wed, 21 Oct 2015 12:50:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZowaL-0002fU-0h for qemu-devel@nongnu.org; Wed, 21 Oct 2015 12:50:00 -0400 Received: from mga11.intel.com ([192.55.52.93]:44601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZowaK-0002fQ-R4 for qemu-devel@nongnu.org; Wed, 21 Oct 2015 12:49:56 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 21 Oct 2015 09:49:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,712,1437462000"; d="scan'208";a="816283127" Received: from lantianyu-ws.sh.intel.com (HELO localhost) ([10.239.159.159]) by fmsmga001.fm.intel.com with ESMTP; 21 Oct 2015 09:49:53 -0700 From: Lan Tianyu To: bhelgaas@google.com, carolyn.wyborny@intel.com, donald.c.skidmore@intel.com, eddie.dong@intel.com, nrupal.jani@intel.com, yang.z.zhang@intel.com, agraf@suse.de, kvm@vger.kernel.org, pbonzini@redhat.com, qemu-devel@nongnu.org, emil.s.tantilov@intel.com, intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com, jesse.brandeburg@intel.com, john.ronciak@intel.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, matthew.vick@intel.com, mitch.a.williams@intel.com, netdev@vger.kernel.org, shannon.nelson@intel.com Date: Thu, 22 Oct 2015 00:37:43 +0800 Message-Id: <1445445464-5056-12-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1445445464-5056-1-git-send-email-tianyu.lan@intel.com> References: <1445445464-5056-1-git-send-email-tianyu.lan@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Cc: Lan Tianyu Subject: [Qemu-devel] [RFC Patch 11/12] IXGBEVF: Migrate VF statistic data X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org VF statistic regs are read-only and can't be migrated via writing back directly. Currently, statistic data returned to user space by the driver is not equal to value of statistic regs. VF driver records value of statistic regs as base data when net interface is up or open, calculate increased count of regs during last period of online service and added it to saved_reset data. When user space collects statistic data, VF driver returns result of "current - base + saved_reset". "Current" is reg value at that point. Restoring net function after migration just likes net interface is up or open. Call existed function to update base and saved_reset data to keep statistic data continual during migration. Signed-off-by: Lan Tianyu --- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 04b6ce7..d22160f 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -3005,6 +3005,7 @@ int ixgbevf_live_mg(struct ixgbevf_adapter *adapter) return 0; del_timer_sync(&adapter->service_timer); + ixgbevf_update_stats(adapter); pr_info("migration start\n"); migration_status = MIGRATION_IN_PROGRESS; @@ -3017,6 +3018,8 @@ int ixgbevf_live_mg(struct ixgbevf_adapter *adapter) return 1; ixgbevf_restore_state(adapter); + ixgbevf_save_reset_stats(adapter); + ixgbevf_init_last_counter_stats(adapter); migration_status = MIGRATION_COMPLETED; pr_info("migration end\n"); return 0;