Skip to content

Conversation

@pjdobrowolski
Copy link
Contributor

Library manager is part of loading external libraries responsible of
handling data and placing it in proper order and places.

After receiving IPC4 load library command

  • reads manifest
  • after module_id choses module to load and verify it (WIP)
  • loads manifest
  • allocs propper memory size
  • transfer module from IMR to HPSRAM (WIP)

Signed-off-by: Stelter, Jaroslaw jaroslaw.stelter@intel.com
Signed-off-by: Dobrowolski, PawelX pawelx.dobrowolski@intel.com

@sofci
Copy link
Collaborator

sofci commented May 10, 2022

Can one of the admins verify this patch?

reply test this please to run this test once

@pjdobrowolski
Copy link
Contributor Author

test this please

@gkbldcig
Copy link
Collaborator

Can one of the admins verify this patch?

@marc-hb
Copy link
Collaborator

marc-hb commented May 10, 2022

test this please

@lgirdwood
Copy link
Member

@pjdobrowolski pls check your inbox, invite sent to autorun the CI.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Some questions

  1. How are we testing this today ? and how should we test in CI
  2. Does this version support the dynamic linking or just the dynamic loading today ?

@pjdobrowolski pjdobrowolski force-pushed the library_manager branch 2 times, most recently from ea4d814 to 8865e18 Compare May 11, 2022 14:30
@dbaluta
Copy link
Collaborator

dbaluta commented May 11, 2022

@pjdobrowolski @lgirdwood aside from having this quick merged what stops us from implementing this feature in zephyr?

@marc-hb
Copy link
Collaborator

marc-hb commented May 11, 2022

Most checkpatch warnings at https://sof-ci.01.org/sofpr/PR5796/build327/checkpatch/ seem valid (and easy to fix)

@jxstelter
Copy link
Contributor

jxstelter commented May 12, 2022

Some questions

  1. How are we testing this today ? and how should we test in CI

This PR is only small part responsible for loading library binary. More changes are required to have something testable.

  1. Does this version support the dynamic linking or just the dynamic loading today ?

We support now dynamic loading of library containing 3rd party module binary. Currently available libraries in IADK (Windows close source FW) are not supporting dynamic linking, however it could be supported in the future.

@jxstelter jxstelter closed this May 12, 2022
@pjdobrowolski pjdobrowolski reopened this May 12, 2022
Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

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

More changes are required to have something testable.

Maybe that's why it's still a draft?

@jxstelter jxstelter requested a review from mwasko May 13, 2022 10:25
@pjdobrowolski pjdobrowolski force-pushed the library_manager branch 5 times, most recently from ccec0d4 to e440d45 Compare May 17, 2022 13:05
@pjdobrowolski pjdobrowolski force-pushed the library_manager branch 7 times, most recently from 6ebba7e to f1d3cb9 Compare August 31, 2022 08:52
Copy link
Collaborator

Choose a reason for hiding this comment

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

your .lib_notif_pool is somewhat... unusual. Usually you'd just have a list head in the higher level object (in ext_lib in this case) to which you then link elements as you allocate them. Instead you have a pointer to lib_notif_pool there and once you allocate the first element and attach it there, you then link further allocated elements to the first one. That makes the list head instance in that object both - a list head and a list element. list_empty() now means not 0 elements, but 1... All that can be made to work of course but just is a bit unusual and one has to remember about this when working with this code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So what would you suggest. That might be refactored for sure but I think that main goal is to port that feature from legacy and integrate. Many mechanisms used here are borrowed from older firmware and for sure they can be improved. We can do that later if it isn't so wrong.

@pjdobrowolski
Copy link
Contributor Author

SOFCI TEST

@lgirdwood
Copy link
Member

@lrudyX @wszypelt can you check CI, not expecting this to fail where it did. Looks like a copy issue ? Thanks.

@wszypelt
Copy link

@lgirdwood yea...
TGL was disabled, I fixed it and ran the tests again.

@pjdobrowolski pjdobrowolski force-pushed the library_manager branch 2 times, most recently from 7d787e1 to a601214 Compare August 31, 2022 11:33
Library manager is part of loading external libraries responsible of
handling data and placing it in proper order and places.

This feature is using module adapter API for
loadable native and external libraries.

After receiving IPC4 load library command
 - reads manifest
 - after module_id choses module to load and verify it (WIP)
 - loads manifest
 - allocs proper memory size
 - transfer module from external MEMORY to HPSRAM (WIP)

Signed-off-by: Stelter, Jaroslaw <jaroslaw.stelter@intel.com>
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
Commit adds ipc which contains information need to load external
libraries from HOST and required actions to make it possible
using library manager functionality.

Signed-off-by: Stelter, Jaroslaw <jaroslaw.stelter@intel.com>
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
Adding function responsible for loading library action after IPC4 message.

Signed-off-by: Stelter, Jaroslaw <jaroslaw.stelter@intel.com>
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
Adding for ipc4_get_comp_drv check if module is loadable
and for active library manager functionality register it dynamically.

Signed-off-by: Stelter, Jaroslaw <jaroslaw.stelter@intel.com>
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
…red.

System service functionality used by 3rd party modules expects
that IPC data buffer will be filled with data during
notification preparation. To avoid additional data copy,
provide message buffer directly to module. This requires
that ipc_msg_send() function will not fail if source data pointer will be
equal to destination one.

Signed-off-by: Stelter, Jaroslaw <jaroslaw.stelter@intel.com>
Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
@pjdobrowolski
Copy link
Contributor Author

rebased, resolved, ready to merge?

@lgirdwood
Copy link
Member

rebased, resolved, ready to merge?

Good to merge as soon as CI finishes.

@wszypelt
Copy link

SOFCI TEST

@lgirdwood lgirdwood merged commit adaebb3 into thesofproject:main Aug 31, 2022
msg = ipc_msg_init(header, SRAM_OUTBOX_SIZE);
if (!msg)
rfree(msg_pool_elem);
return NULL;
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need braces here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So reopen PR and will fix it.

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.