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

remoteproc_virtio: optimize the remoteproc virtio transport layer #489

Merged
merged 1 commit into from Feb 23, 2024

Conversation

CV-Bowen
Copy link
Contributor

@CV-Bowen CV-Bowen commented May 12, 2023

remoteproc_virtio: optimize the remoteproc virtio transport layer

  1. Implement the rproc_virtio_create_virtqueues() and rproc_virtio_delete_virtqueues()
  2. Becase item 1, modified the rpmsg_init_vdev_with_config() also

@CV-Bowen CV-Bowen force-pushed the virtio-spec branch 2 times, most recently from ea14a9d to a94e0c6 Compare May 12, 2023 05:11
@CV-Bowen CV-Bowen changed the title virtio: follow virtio 1.2 spec, add more virtio status and device virtio: decoupling the transport layer and virtio device layer May 12, 2023
@arnopo
Copy link
Collaborator

arnopo commented May 12, 2023

hello @CV-Bowen ,

Could you details what was the issue you are facing that needs to move the virtio_create_virtqueues to the transport layer?
that would help to understand your work

@CV-Bowen
Copy link
Contributor Author

@arnopo Hi, we want to support different transport layer (remoteproc, mmio) for virtio drivers. After this PR, we can implement the mmio tranport layer base on OpenAmp.
I think this patch is also helpful for virtio-mmio framework in openamp/virtio-exp branch to support remoteproc transport layer.

@arnopo
Copy link
Collaborator

arnopo commented May 15, 2023

@arnopo Hi, we want to support different transport layer (remoteproc, mmio) for virtio drivers. After this PR, we can implement the mmio tranport layer base on OpenAmp. I think this patch is also helpful for virtio-mmio framework in openamp/virtio-exp branch to support remoteproc transport layer.

I understand the objective., what is not clear to me as a first review is why you need to move virtio_create_virtqueues this should be independent from the transport layer, no?

lib/include/openamp/virtio.h Outdated Show resolved Hide resolved
lib/include/openamp/virtio.h Outdated Show resolved Hide resolved
lib/include/openamp/virtio.h Outdated Show resolved Hide resolved
lib/include/openamp/virtio.h Outdated Show resolved Hide resolved
lib/include/openamp/virtio.h Outdated Show resolved Hide resolved
lib/include/openamp/virtio.h Outdated Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Show resolved Hide resolved
@CV-Bowen
Copy link
Contributor Author

@arnopo Hi, we want to support different transport layer (remoteproc, mmio) for virtio drivers. After this PR, we can implement the mmio tranport layer base on OpenAmp. I think this patch is also helpful for virtio-mmio framework in openamp/virtio-exp branch to support remoteproc transport layer.

I understand the objective., what is not clear to me as a first review is why you need to move virtio_create_virtqueues this should be independent from the transport layer, no?

I found only rpmsg_virtio_create_virtqueues call virtio_create_virtqueues in OpenAmp, so I delete virtio_create_virtqueues after moving it's implementation to rproc_virtio_create_virtqueues. I do not consider that some other codes use it, I will restore this api and call it directly in rproc_virtio_create_virtqueues().

@CV-Bowen
Copy link
Contributor Author

CV-Bowen commented Jun 4, 2023

@arnopo @edmooring
Commit 1: virtio: follow virtio 1.2 spec, add more virtio status and device id
Seems commit 1 can be an independent PR. I will upload it later, and this PR will be only for Commit 2.

lib/include/openamp/rpmsg_virtio.h Outdated Show resolved Hide resolved
lib/include/openamp/virtio.h Outdated Show resolved Hide resolved
@arnopo
Copy link
Collaborator

arnopo commented Jun 13, 2023

@CV-Bowen
seems that you remove the Commit 2: virtio: decoupling the transport layer and virtio device layer

Please notice also #494, we should find a common solution...

@CV-Bowen CV-Bowen force-pushed the virtio-spec branch 2 times, most recently from b9e7b3a to cda0080 Compare June 13, 2023 08:11
@CV-Bowen
Copy link
Contributor Author

@arnopo Sorry, I has fixed this and I will look #494.

@xiaoxiang781216
Copy link
Collaborator

@CV-Bowen seems that you remove the Commit 2: virtio: decoupling the transport layer and virtio device layer

Please notice also #494, we should find a common solution...

@CV-Bowen 's change extract and generalize from #494, after this change get merged:

  1. The new mmio transport addition don't need modify rest code in OpenAMP
  2. All code manipulate virtio device can work with both transport(mmio v.s. remoteproc)

@CV-Bowen CV-Bowen force-pushed the virtio-spec branch 3 times, most recently from 8617243 to 4161017 Compare June 17, 2023 09:01
Copy link
Collaborator

@arnopo arnopo left a comment

Choose a reason for hiding this comment

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

This PR probably breaks a lot of implementations.
I haven't done a test, but I'm fairly convinced that it breaks all Zephyr and ST projects, for example.

One reason is that you introduce a dependency between remoteproc and remoteproc_virtio, using struct remoteproc
Another is that some projects don't use the remoteproc virtio at all but static vrings.

Could you also split the commit in 3 ( as described in your commit message) ?
This would help for the review...

lib/include/openamp/virtio.h Outdated Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Outdated Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Outdated Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Outdated Show resolved Hide resolved
lib/rpmsg/rpmsg_virtio.c Show resolved Hide resolved
lib/include/openamp/rpmsg_virtio.h Outdated Show resolved Hide resolved
lib/include/openamp/rpmsg_virtio.h Outdated Show resolved Hide resolved
@CV-Bowen CV-Bowen changed the title virtio: decoupling the transport layer and virtio device layer remoteproc_virtio: optimize the remoteproc virtio transport layer Oct 16, 2023
@CV-Bowen CV-Bowen force-pushed the virtio-spec branch 2 times, most recently from 8177549 to f7e1a49 Compare October 16, 2023 14:45
@CV-Bowen
Copy link
Contributor Author

All the comments should have been addressed. Could you take a look again? @arnopo

Copy link
Collaborator

@arnopo arnopo left a comment

Choose a reason for hiding this comment

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

This PR seems Ok in its design but will require some tests to ensure that it does not introduce regression in legacy.
Please find some comments on code

lib/include/openamp/rpmsg_virtio.h Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Outdated Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Outdated Show resolved Hide resolved
lib/rpmsg/rpmsg_virtio.c Outdated Show resolved Hide resolved
lib/include/openamp/rpmsg_virtio.h Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Outdated Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Outdated Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Outdated Show resolved Hide resolved
lib/remoteproc/remoteproc_virtio.c Show resolved Hide resolved
@CV-Bowen CV-Bowen force-pushed the virtio-spec branch 2 times, most recently from a744b07 to 487fd33 Compare October 19, 2023 13:15
Copy link
Collaborator

@arnopo arnopo left a comment

Choose a reason for hiding this comment

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

LGTM, I approve it but will need few test before merging it

lib/remoteproc/remoteproc_virtio.c Show resolved Hide resolved
Copy link
Collaborator

@xiaoxiang781216 xiaoxiang781216 left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@edmooring edmooring left a comment

Choose a reason for hiding this comment

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

Looks good to go, but agree with @arnopo we need to test more. It would be nice if my comment about the comment was addressed, but it is not necessary.

lib/remoteproc/remoteproc_virtio.c Outdated Show resolved Hide resolved
@tnmysh
Copy link
Collaborator

tnmysh commented Nov 3, 2023

@arnopo, @edmooring If you are okay, we can merge the change.

@arnopo
Copy link
Collaborator

arnopo commented Nov 7, 2023

@CV-Bowen,
Please, could you rebase it to solve merge conflict, that i test it and merge it

@CV-Bowen
Copy link
Contributor Author

CV-Bowen commented Nov 8, 2023

@arnopo Rebased.

@arnopo
Copy link
Collaborator

arnopo commented Nov 10, 2023

tests Ok on my side
@edmooring , @tnmysh , could you make a short test on Xilinx platform for complementary test on remoteproc ?

Copy link

This pull request has been marked as a stale pull request because it has been open (more than) 45 days with no activity.

@github-actions github-actions bot added the Stale label Dec 26, 2023
1. Implement the rproc_virtio_create_virtqueues() and
   rproc_virtio_delete_virtqueues().
2. Because 1, also modified the rpmsg init.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
@CV-Bowen
Copy link
Contributor Author

@arnopo Rebase to the last to fix the conflict. Could we merge this PR? There isn’t much time until release in April.

@github-actions github-actions bot removed the Stale label Feb 19, 2024
@arnopo
Copy link
Collaborator

arnopo commented Feb 19, 2024

Sorry @CV-Bowen, it go out of my radar,

@edmooring , @tnmysh , as requested could you confirm that it does not create regression on your platforms

@arnopo arnopo merged commit 0c7e420 into OpenAMP:main Feb 23, 2024
3 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.

what's plan to support the service/driver at the virtio level?
5 participants