vdpa/ifc: improve device stop logic for block device

Message ID 1670917055-229334-1-git-send-email-andy.pei@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series vdpa/ifc: improve device stop logic for block device |

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/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance fail Performance Testing issues
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Pei, Andy Dec. 13, 2022, 7:37 a.m. UTC
  For block device, we make sure no IO is inflight before we
stop device. We terminate the notify relay process and wait
for all inflight IOs to be completed. So in this period, we
wait for hardware to update used index, there is no need to
relay new kick.

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

Comments

Maxime Coquelin Jan. 19, 2023, 2:53 p.m. UTC | #1
On 12/13/22 08:37, Andy Pei wrote:
> For block device, we make sure no IO is inflight before we
> stop device. We terminate the notify relay process and wait
> for all inflight IOs to be completed. So in this period, we
> wait for hardware to update used index, there is no need to
> relay new kick.
> 
> Signed-off-by: Andy Pei <andy.pei@intel.com>
> ---
>   drivers/vdpa/ifc/ifcvf_vdpa.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
> index 49d68ad..0822f47 100644
> --- a/drivers/vdpa/ifc/ifcvf_vdpa.c
> +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
> @@ -367,11 +367,7 @@ struct rte_vdpa_dev_info {
>   					(u16)(ring_state & IFCVF_16_BIT_MASK);
>   				hw->vring[i].last_used_idx =
>   					(u16)(ring_state >> 16);
> -				if (hw->vring[i].last_avail_idx !=
> -					hw->vring[i].last_used_idx) {
> -					ifcvf_notify_queue(hw, i);
> -					usleep(10);
> -				}
> +				usleep(10);
>   			} while (hw->vring[i].last_avail_idx !=
>   				hw->vring[i].last_used_idx);
>   		}

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

Thanks,
Maxime
  
Maxime Coquelin Feb. 3, 2023, 2:55 p.m. UTC | #2
On 12/13/22 08:37, Andy Pei wrote:
> For block device, we make sure no IO is inflight before we
> stop device. We terminate the notify relay process and wait
> for all inflight IOs to be completed. So in this period, we
> wait for hardware to update used index, there is no need to
> relay new kick.
> 
> Signed-off-by: Andy Pei <andy.pei@intel.com>
> ---
>   drivers/vdpa/ifc/ifcvf_vdpa.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 

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..0822f47 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -367,11 +367,7 @@  struct rte_vdpa_dev_info {
 					(u16)(ring_state & IFCVF_16_BIT_MASK);
 				hw->vring[i].last_used_idx =
 					(u16)(ring_state >> 16);
-				if (hw->vring[i].last_avail_idx !=
-					hw->vring[i].last_used_idx) {
-					ifcvf_notify_queue(hw, i);
-					usleep(10);
-				}
+				usleep(10);
 			} while (hw->vring[i].last_avail_idx !=
 				hw->vring[i].last_used_idx);
 		}