Skip to content

library manager: initial implementation#5796

Merged
lgirdwood merged 5 commits intothesofproject:mainfrom
pjdobrowolski:library_manager
Aug 31, 2022
Merged

library manager: initial implementation#5796
lgirdwood merged 5 commits intothesofproject:mainfrom
pjdobrowolski:library_manager

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
@lgirdwood
Copy link
Member

@jxstelter fyi since @pjdobrowolski is out.

Copy link
Contributor

@ujfalusi ujfalusi left a comment

Choose a reason for hiding this comment

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

@pjdobrowolski, do you have any library I can try to load with my Linux side PR (thesofproject/linux#3826)?

@pjdobrowolski
Copy link
Contributor Author

@pjdobrowolski, do you have any library I can try to load with my Linux side PR (thesofproject/linux#3826)?

You can build one yourself using https://github.com/thesofproject/converged-sof-modules

FYI: I came back from 2 week long sick leave and you guys flooded me with changes which should be requested almost 2 months ago. @dbaluta @ujfalusi @lgirdwood @lyakh I understand that next few days I will spend on resolving that requests. And I thought that sinusitis was bad...

@dbaluta
Copy link
Collaborator

dbaluta commented Aug 29, 2022

FYI: I came back from 2 week long sick leave and you guys flooded me with changes which should be requested almost 2 months ago. @dbaluta @ujfalusi @lgirdwood @lyakh I understand that next few days I will spend on resolving that requests. And I thought that sinusitis was bad...

@pjdobrowolski don't worry you will get used with us ;). glad that you are better now.

In order to get your patches faster accepted open source community has some guidelines:

  • split your patches into simple logical units.
  • make your code clean. follow naming conventions. Run ./scripts/checkpatch.pl over your patch.
  • avoid having more then 3-4 level of indentation in the code.
  • when introducing new features in a series: please add the bugfixes first and the patches introducing new code later.

I will be on vacation until next week so you I'm off your back for a while :). But I'll be back.

@lgirdwood
Copy link
Member

rerun CI, license server

License checkout failed: Cannot connect to license server system.
 The license server manager (lmgrd) has not been started yet,
 the wrong port@host or license file is being used, or the
 port or hostname in the license file has been changed.
Feature:       XTENSA_XCC_TIE
Server name:   fmylic7005.fm.intel.com
License path:  84300@xtensa01p.elic.intel.com:/srv/home/jenkins/xcc/install/tools/RG-2017.8-linux/XtensaTools/Tools/lic/license.dat:
FLEXnet Licensing error:-15,570.  System Error: 115 "Operation now in progress"
For further information, refer to the FLEXnet Licensing documentation,
available at "www.macrovision.com".
make[3]: *** [CMakeFiles/sof.dir/build.make:1248: CMakeFiles/sof.dir/src/math/sqrt_int16.c.o] Error 2
make[3]: *** Waiting for unfinished jobs....
License checkout failed: No such feature exists.

@lgirdwood
Copy link
Member

SOFCI TEST

@pjdobrowolski
Copy link
Contributor Author

@dbaluta Are there any guidelines like that for reviewers or just "hit and run"?

@lgirdwood
Copy link
Member

@pjdobrowolski can you force push again, I've just merged the build fix for IPC4 and newer CC. Thanks

@lgirdwood
Copy link
Member

SOFCI TEST

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.

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

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.