vdpa/ifc: improve device stop logic for block device
PATCH 1/1 vdpa/ifc: improve device stop logic for block device
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.
--- drivers/vdpa/ifc/ifcvf_vdpa.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/vdpa/ifc/ifcvf_vdpa.c +1 -5
@@ -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); }
Signature · 1 line
1.8.3.1
Quoted 18 lines · Andy Pei
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 <[email protected]>--- drivers/vdpa/ifc/ifcvf_vdpa.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/vdpa/ifc/ifcvf_vdpa.c +0
-0@@ -367,11 +367,7 @@ struct rte_vdpa_dev_info { (u16)(ring_state &IFCVF_16_BIT_MASK ); hw->vring[i].last_used_idx =
drivers/vdpa/ifc/ifcvf_vdpa.c struct rte_vdpa_dev_info { · line 373
Quoted 10 lines
drivers/vdpa/ifc/ifcvf_vdpa.c +1
-5(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); }
Thanks,
Maxime
Maxime Coquelin
AppliedQuoted 11 lines · Andy Pei
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 <[email protected]>--- drivers/vdpa/ifc/ifcvf_vdpa.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
Applied to dpdk-next-virtio/main.
Thanks,
Maxime