Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1253060 > unrolled thread

[RFC Patch 11/12] IXGBEVF: Migrate VF statistic data

Started byLan Tianyu <tianyu.lan@intel.com>
First post2015-10-21 19:00 +0200
Last post2015-10-22 14:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC Patch 11/12] IXGBEVF: Migrate VF statistic data Lan Tianyu <tianyu.lan@intel.com> - 2015-10-21 19:00 +0200
    Re: [RFC Patch 11/12] IXGBEVF: Migrate VF statistic data "Michael S. Tsirkin" <mst@redhat.com> - 2015-10-22 14:40 +0200

#1253060 — [RFC Patch 11/12] IXGBEVF: Migrate VF statistic data

FromLan Tianyu <tianyu.lan@intel.com>
Date2015-10-21 19:00 +0200
Subject[RFC Patch 11/12] IXGBEVF: Migrate VF statistic data
Message-ID<qm4U2-zk-9@gated-at.bofh.it>
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 <tianyu.lan@intel.com>
---
 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;
-- 
1.8.4.rc0.1.g8f6a3e5.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1253767

From"Michael S. Tsirkin" <mst@redhat.com>
Date2015-10-22 14:40 +0200
Message-ID<qmnjY-2vq-17@gated-at.bofh.it>
In reply to#1253060
On Thu, Oct 22, 2015 at 12:37:43AM +0800, Lan Tianyu wrote:
> 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 <tianyu.lan@intel.com>
> ---
>  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; 
>  

So far, it seems that the only two things done when
starting migration are very small.

It doesn't seem worth it to let guests defer migration for things like
this.  Surely, cancelling a timer can be done later after VM is
migrated?



> @@ -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;
> -- 
> 1.8.4.rc0.1.g8f6a3e5.dirty
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web