Commit 2eacf4b
vdpa/mlx5: implement .reset_map driver op
Since commit 6f5312f ("vdpa/mlx5: Add support for running with
virtio_vdpa"), mlx5_vdpa starts with preallocate 1:1 DMA MR at device
creation time. This 1:1 DMA MR will be implicitly destroyed while the
first .set_map call is invoked, in which case callers like vhost-vdpa
will start to set up custom mappings. When the .reset callback is
invoked, the custom mappings will be cleared and the 1:1 DMA MR will be
re-created.
In order to reduce excessive memory mapping cost in live migration, it
is desirable to decouple the vhost-vdpa IOTLB abstraction from the
virtio device life cycle, i.e. mappings can be kept around intact across
virtio device reset. Leverage the .reset_map callback, which is meant to
destroy the regular MR (including cvq mapping) on the given ASID and
recreate the initial DMA mapping. That way, the device .reset op runs
free from having to maintain and clean up memory mappings by itself.
Additionally, implement .compat_reset to cater for older userspace,
which may wish to see mapping to be cleared during reset.
Co-developed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
Message-Id: <1697880319-4937-7-git-send-email-si-wei.liu@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>1 parent bc91df5 commit 2eacf4b
3 files changed
Lines changed: 42 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2876 | 2876 | | |
2877 | 2877 | | |
2878 | 2878 | | |
2879 | | - | |
| 2879 | + | |
2880 | 2880 | | |
2881 | 2881 | | |
2882 | 2882 | | |
| |||
2888 | 2888 | | |
2889 | 2889 | | |
2890 | 2890 | | |
2891 | | - | |
| 2891 | + | |
| 2892 | + | |
2892 | 2893 | | |
2893 | 2894 | | |
2894 | 2895 | | |
| |||
2899 | 2900 | | |
2900 | 2901 | | |
2901 | 2902 | | |
2902 | | - | |
| 2903 | + | |
| 2904 | + | |
2903 | 2905 | | |
2904 | 2906 | | |
2905 | 2907 | | |
| |||
2908 | 2910 | | |
2909 | 2911 | | |
2910 | 2912 | | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
2911 | 2918 | | |
2912 | 2919 | | |
2913 | 2920 | | |
| |||
2987 | 2994 | | |
2988 | 2995 | | |
2989 | 2996 | | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
2990 | 3009 | | |
2991 | 3010 | | |
2992 | 3011 | | |
| |||
3250 | 3269 | | |
3251 | 3270 | | |
3252 | 3271 | | |
| 3272 | + | |
3253 | 3273 | | |
3254 | 3274 | | |
3255 | 3275 | | |
3256 | 3276 | | |
3257 | 3277 | | |
| 3278 | + | |
3258 | 3279 | | |
3259 | 3280 | | |
3260 | 3281 | | |
| |||
0 commit comments