Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VT] Support vdpa device #3718

Merged
merged 4 commits into from
Sep 19, 2023

Conversation

nickzhq
Copy link
Contributor

@nickzhq nickzhq commented Jul 13, 2023

No description provided.

@nickzhq nickzhq marked this pull request as draft July 13, 2023 05:27
@nickzhq nickzhq marked this pull request as ready for review July 13, 2023 05:47
@nickzhq nickzhq force-pushed the support_vdpa_device branch 4 times, most recently from 1aa0bda to ae68ceb Compare July 19, 2023 05:42
@nickzhq nickzhq force-pushed the support_vdpa_device branch 3 times, most recently from 70213ef to 8a8ac3c Compare August 2, 2023 02:16
@nickzhq nickzhq force-pushed the support_vdpa_device branch 4 times, most recently from 85051c6 to 5e55e6c Compare August 3, 2023 01:17
@nickzhq nickzhq force-pushed the support_vdpa_device branch 3 times, most recently from ac91f0c to 127be9e Compare August 9, 2023 07:28
@nickzhq nickzhq force-pushed the support_vdpa_device branch 6 times, most recently from 7b6a81e to d96cf84 Compare August 21, 2023 10:42
virttest/vdpa.py Outdated Show resolved Hide resolved
virttest/vdpa.py Outdated Show resolved Hide resolved
virttest/vdpa.py Outdated Show resolved Hide resolved
virttest/qemu_storage.py Outdated Show resolved Hide resolved
virttest/env_process.py Outdated Show resolved Hide resolved
@nickzhq
Copy link
Contributor Author

nickzhq commented Sep 12, 2023

The params added in boot.cfg: images += " image2" image_snapshot_image2 = no storage_type_image2 = "vhost-vdpa" image_name_image2 = blk0 image_format_image2 = raw remove_image_image2 = no force_create_image_image2 = no create_image_image2 = no check_image_image2 = no image_aio_image2 = native

The Kar command line used: python3 /home/kar/ConfigTest.py --testcase=boot --guestname=RHEL.9.0.0 --clone=no --customsparams="vm_mem_limit = 12G\nimage_aio=threads"

The qemu command line in log: [stdlog] -blockdev '{"node-name": "virtio-blk-vhost-vdpa_image2", "driver": "virtio-blk-vhost-vdpa", "auto-read-only": true, "discard": "unmap", "path": "/dev/vhost-vdpa-0", "cache": {"direct": true, "no-flush": false}}' [stdlog] -blockdev '{"node-name": "drive_image2", "driver": "raw", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "virtio-blk-vhost-vdpa_image2"}' [stdlog] -device '{"driver": "scsi-hd", "id": "image2", "drive": "drive_image2", "write-cache": "on"}' \

cc @YongxueHong @zhencliu @qingwangrh @luckyh

Here's a kind reminder:
skip_image_processing = yes should be in the .cfg file. Otherwise, the case will be failed by "creating the qemu image" issue

CC @zhencliu , @YongxueHong @luckyh , @qingwangrh

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
Add a new class: QBlockdevProtocolVirtioBlkVhostVdpa

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
@zhencliu
Copy link
Contributor

zhencliu commented Sep 12, 2023

skip_image_processing

The params added in boot.cfg: images += " image2" image_snapshot_image2 = no storage_type_image2 = "vhost-vdpa" image_name_image2 = blk0 image_format_image2 = raw remove_image_image2 = no force_create_image_image2 = no create_image_image2 = no check_image_image2 = no image_aio_image2 = native
The Kar command line used: python3 /home/kar/ConfigTest.py --testcase=boot --guestname=RHEL.9.0.0 --clone=no --customsparams="vm_mem_limit = 12G\nimage_aio=threads"
The qemu command line in log: [stdlog] -blockdev '{"node-name": "virtio-blk-vhost-vdpa_image2", "driver": "virtio-blk-vhost-vdpa", "auto-read-only": true, "discard": "unmap", "path": "/dev/vhost-vdpa-0", "cache": {"direct": true, "no-flush": false}}' [stdlog] -blockdev '{"node-name": "drive_image2", "driver": "raw", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "virtio-blk-vhost-vdpa_image2"}' [stdlog] -device '{"driver": "scsi-hd", "id": "image2", "drive": "drive_image2", "write-cache": "on"}'
cc @YongxueHong @zhencliu @qingwangrh @luckyh

Here's a kind reminder: skip_image_processing = yes **should be in the .cfg file.

I am afraid we cannot set it for it is a 'global' param, if it's set, all images will be skipped @nickzhq

Otherwise, the case will be failed by "creating the qemu image" issue**

CC @zhencliu , @YongxueHong @luckyh , @qingwangrh

@qingwangrh
Copy link
Contributor

LGTM

@YongxueHong
Copy link
Contributor

The params added in boot.cfg: images += " image2" image_snapshot_image2 = no storage_type_image2 = "vhost-vdpa" image_name_image2 = blk0 image_format_image2 = raw remove_image_image2 = no force_create_image_image2 = no create_image_image2 = no check_image_image2 = no image_aio_image2 = native
The Kar command line used: python3 /home/kar/ConfigTest.py --testcase=boot --guestname=RHEL.9.0.0 --clone=no --customsparams="vm_mem_limit = 12G\nimage_aio=threads"
The qemu command line in log: [stdlog] -blockdev '{"node-name": "virtio-blk-vhost-vdpa_image2", "driver": "virtio-blk-vhost-vdpa", "auto-read-only": true, "discard": "unmap", "path": "/dev/vhost-vdpa-0", "cache": {"direct": true, "no-flush": false}}' [stdlog] -blockdev '{"node-name": "drive_image2", "driver": "raw", "read-only": false, "cache": {"direct": true, "no-flush": false}, "file": "virtio-blk-vhost-vdpa_image2"}' [stdlog] -device '{"driver": "scsi-hd", "id": "image2", "drive": "drive_image2", "write-cache": "on"}'
cc @YongxueHong @zhencliu @qingwangrh @luckyh

Here's a kind reminder: skip_image_processing = yes should be in the .cfg file. Otherwise, the case will be failed by "creating the qemu image" issue

We set the force_create_image_image2 = no, but why does it still create the image? Hi @nickzhq could you provide the related code of failed creating the qemu image? Thanks.
And I also have the same concern as @zhencliu mentioned. Could you run a test with multiple data images, both vdpa-blk and local file images? I guess that it will not process the local file images.
Thanks.

CC @zhencliu , @YongxueHong @luckyh , @qingwangrh

@nickzhq
Copy link
Contributor Author

nickzhq commented Sep 12, 2023

Hello @YongxueHong @zhencliu @qingwangrh @luckyh ,
Please take a view, here's a new change at env_process.py:
_call_check_image_func() and _call_image_func() both add a little codes.

After this updating, the param skip_image_processing is NOT needed.

@qingwangrh Could you run a testcase using the newest patch and put the result at the comment? My machine is NOT able to run.

Thanks!

@qingwangrh
Copy link
Contributor

Hello @YongxueHong @zhencliu @qingwangrh @luckyh , Please take a view, here's a new change at env_process.py: _call_check_image_func() and _call_image_func() both add a little codes.

After this updating, the param skip_image_processing is NOT needed.

@qingwangrh Could you run a testcase using the newest patch and put the result at the comment? My machine is NOT able to run.

Thanks!

failed test

virttest/env_process.py Outdated Show resolved Hide resolved
@nickzhq
Copy link
Contributor Author

nickzhq commented Sep 12, 2023

Hello @YongxueHong @zhencliu @qingwangrh @luckyh , Please take a view, here's a new change at env_process.py: _call_check_image_func() and _call_image_func() both add a little codes.

After this updating, the param skip_image_processing is NOT needed.

@qingwangrh Could you run a testcase using the newest patch and put the result at the comment? My machine is NOT able to run.

Thanks!

(1/1) Host_RHEL.m9.u3.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hello_world.q35: STARTED
(1/1) Host_RHEL.m9.u3.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.9.3.0.x86_64.io-github-autotest-qemu.hello_world.q35: PASS (43.55 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

Hello @YongxueHong @zhencliu @qingwangrh @luckyh ,
Please take a view.
After this updating, the param skip_image_processing is NOT needed.

@qingwangrh Could you run a testcase using the newest patch and put the result at the comment? Please make a double check, please.

Thanks!

@zhencliu
Copy link
Contributor

LGTM

@qingwangrh
Copy link
Contributor

Pass test with skip_image_processing = no

LGTM

@nickzhq
Copy link
Contributor Author

nickzhq commented Sep 14, 2023

Pass test with skip_image_processing = no

LGTM

skip_image_processing = no is NOT necessary.

add vdpa device support to the related functions

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
@nickzhq
Copy link
Contributor Author

nickzhq commented Sep 14, 2023

Hello @YongxueHong @zhencliu @luckyh
Please take a view, thanks.

Hello @qingwangrh ,
can you do the hello_world test again? And add the following params into hello_world.cfg , thanks in advance:
images += " stg1 stg2"
image_snapshot_stg1 = no
image_snapshot_stg2 = no
storage_type_stg1 = "vhost-vdpa"
storage_type_stg2 = "vhost-vdpa"
image_name_stg1 = blk0
image_name_stg2 = blk1
image_format_stg1 = raw
remove_image_stg1 = no
force_create_image_stg1 = no
create_image_stg1 = no
check_image_stg1 = no
image_format_stg2 = raw
remove_image_stg2 = no
force_create_image_stg2 = no
create_image_stg2 = no
check_image_stg2 = no
img_check_failed_stg1 = no
img_check_failed_stg2 = no
backup_image_after_testing_passed_stg1 = no
backup_image_after_testing_passed_stg2 = no

@qingwangrh
Copy link
Contributor

Pass test with the following configuration or without.

Those configurations look a little redundant.
It is better and more transparent for the user.

img_check_failed_stg1 = no
img_check_failed_stg2 = no
backup_image_after_testing_passed_stg1 = no
backup_image_after_testing_passed_stg2 = no

Copy link
Contributor

@YongxueHong YongxueHong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nickzhq
Copy link
Contributor Author

nickzhq commented Sep 15, 2023

Pass test with the following configuration or without.

Those configurations look a little redundant. It is better and more transparent for the user.

img_check_failed_stg1 = no img_check_failed_stg2 = no backup_image_after_testing_passed_stg1 = no backup_image_after_testing_passed_stg2 = no

Thanks to @qingwangrh .
Based on the this patch, the following params is NOT necessary:
img_check_failed_stg1 = no
img_check_failed_stg2 = no
backup_image_after_testing_passed_stg1 = no
backup_image_after_testing_passed_stg2 = no

cc @YongxueHong @zhencliu @luckyh

In conclusion, the pretty params should be as following:
images += " stg1 stg2"
image_snapshot_stg1 = no
image_snapshot_stg2 = no
storage_type_stg1 = "vhost-vdpa"
storage_type_stg2 = "vhost-vdpa"
image_name_stg1 = blk0
image_name_stg2 = blk1
image_format_stg1 = raw
remove_image_stg1 = no
force_create_image_stg1 = no
create_image_stg1 = no
check_image_stg1 = no
image_format_stg2 = raw
remove_image_stg2 = no
force_create_image_stg2 = no
create_image_stg2 = no
check_image_stg2 = no

@YongxueHong
Copy link
Contributor

Thanks all @qingwangrh @nickzhq @zhencliu @luckyh
Let's merge it.

@YongxueHong YongxueHong merged commit 3f16a5c into avocado-framework:master Sep 19, 2023
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants