vdpa/ifc: fix argument compatibility check

Message ID 1669879940-60846-1-git-send-email-andy.pei@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series vdpa/ifc: fix argument compatibility check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Pei, Andy Dec. 1, 2022, 7:32 a.m. UTC
  "sw_fallback_lm=0" means driver does not provide live migration assistance.
so hardware assistance is needed to support live migration.
However registers for live migration in BAR4 are not implemented.
In the case, we just return error after display some logs.

Fixes: 4c3f55cc23ea ("net/ifc: add LM mode parameter")
Cc: stable@dpdk.org

Signed-off-by: Andy Pei <andy.pei@intel.com>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Maxime Coquelin Jan. 19, 2023, 10:20 a.m. UTC | #1
On 12/1/22 08:32, Andy Pei wrote:
> "sw_fallback_lm=0" means driver does not provide live migration assistance.
> so hardware assistance is needed to support live migration.
> However registers for live migration in BAR4 are not implemented.
> In the case, we just return error after display some logs.
> 
> Fixes: 4c3f55cc23ea ("net/ifc: add LM mode parameter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andy Pei <andy.pei@intel.com>
> ---
>   drivers/vdpa/ifc/ifcvf_vdpa.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 49d68ad..9468f66 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -1746,6 +1746,11 @@ struct rte_vdpa_dev_info dev_info[] = {
>   			goto error;
>   	}
>   	internal->sw_lm = sw_fallback_lm;
> +	if (!internal->sw_lm && !internal->hw.lm_cfg) {
> +		DRV_LOG(ERR, "Device %s does not support HW assist live migration, please enable sw-live-migration!",
> +			pci_dev->name);
> +		goto error;
> +	}
>   
>   	pthread_mutex_lock(&internal_list_lock);
>   	TAILQ_INSERT_TAIL(&internal_list, list, next);

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Maxime Coquelin Feb. 3, 2023, 2:48 p.m. UTC | #2
On 12/1/22 08:32, Andy Pei wrote:
> "sw_fallback_lm=0" means driver does not provide live migration assistance.
> so hardware assistance is needed to support live migration.
> However registers for live migration in BAR4 are not implemented.
> In the case, we just return error after display some logs.
> 
> Fixes: 4c3f55cc23ea ("net/ifc: add LM mode parameter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andy Pei <andy.pei@intel.com>
> ---
>   drivers/vdpa/ifc/ifcvf_vdpa.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 49d68ad..9468f66 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -1746,6 +1746,11 @@ struct rte_vdpa_dev_info dev_info[] = {
>   			goto error;
>   	}
>   	internal->sw_lm = sw_fallback_lm;
> +	if (!internal->sw_lm && !internal->hw.lm_cfg) {
> +		DRV_LOG(ERR, "Device %s does not support HW assist live migration, please enable sw-live-migration!",
> +			pci_dev->name);
> +		goto error;
> +	}
>   
>   	pthread_mutex_lock(&internal_list_lock);
>   	TAILQ_INSERT_TAIL(&internal_list, list, next);


Applied to dpdk-next-virtio/main.

Thanks,
Maxime
  

Patch

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 49d68ad..9468f66 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -1746,6 +1746,11 @@  struct rte_vdpa_dev_info dev_info[] = {
 			goto error;
 	}
 	internal->sw_lm = sw_fallback_lm;
+	if (!internal->sw_lm && !internal->hw.lm_cfg) {
+		DRV_LOG(ERR, "Device %s does not support HW assist live migration, please enable sw-live-migration!",
+			pci_dev->name);
+		goto error;
+	}
 
 	pthread_mutex_lock(&internal_list_lock);
 	TAILQ_INSERT_TAIL(&internal_list, list, next);