-
Notifications
You must be signed in to change notification settings - Fork 349
ipc: increase msg max size #2216
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
Conversation
|
@abonislawski I'd suggest to make more future proof solution by increasing max IPC size to 2 KB for example (depending on amount of space left unoccupied in a memory window in case of Intel HW), this way number of IPC operation for sending large payloads to DSP would be significantly reduced. A typical example is transport of a large parameter set for keyphrase detection algorithm. |
|
@dbaluta any objections on your end to 2kB ? |
|
@lgirdwood fine for us. We actually don't have any hard limitation for messages passed through dsp box / host box as in our side we use a shared DRAM area which can host up to 8MB so far. We trimmed the memory windows to match the ones on Intel. |
|
SOFCI TEST |
7064979 to
904fd7b
Compare
@lbetlej I tried 2000 and 2048 but both results in problem with FW load, not sure why |
|
@abonislawski one thing to watch out for when changing section sizes is that we are also growing/shrinking other sections correctly (and updating their metadata for linker and allocator etc). |
Increased ipc msg max size will allow to fit a bigger ipc, e.g. needed for mux channel map. Because of that it is also needed to increase HEAP_SYSTEM_M_SIZE to fit in memory bigger ipc msg size. Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
904fd7b to
65285e2
Compare
@lgirdwood I think there should be no problem with sections, after recent changes for most of them we only provide size of sections and linker will put them where he thinks. |
|
Ok, looks good to me, is there a corresponding kernel PR ? |
|
Please figure out if you want 768b or 2kb before merging this |
|
@abonislawski Please let us know what's your plan for this PR, you can mark it as WIP if you are working on some dependency |
|
@jajanusz @abonislawski are we just waiting for a corresponding kernel PR now ? |
|
@abonislawski please fix CI issues and take care of kernel patch, then we can merge this |
|
@lgirdwood @jajanusz kernel PR: |
but we don't have a mux-specific IPC, do we? It should be the component ID and then the component-specific data. The IPC is only the transport - I hope. |
Yeap, exactly and anyway in both cases this is not about this PR |
I think "component-specific-data" is what we are thinking about. Only this will change |
|
just for fun I looked up all the usages of this value in the kernel: It seems we are going to need to make this a variable that depends on the ABI level? |
Do you want to add this conditional macro first? You can assume that it has higher size since MINOR 13 |
I was thinking of a variable field in a structure, not sure if we need a complicated macro. But one question: we've used 'large IPCs' before, where information is sent for 'process' in multiple smaller IPCs. @juimonen worked on this. Doesn't this apply to the MUX case? Put differently, are we really going to need to update the IPC size everytime we've got a structure that doesn't fit in the current size? or should we break this in pieces and transport it in multiple passes? |
No, as discussed in the first comments: in the near future 'ipc msg size' will be changed to maximum available along with ipc msg allocation changes in fw.
I dont remember details but we decided to stay with the current approach. But anyway, ipc msg size is going to be increased to maximum available size to not waste resources and splitting mux configuration will not be needed |
|
If I recall correctly, mux config was then fitting the 1 payload. The config was then in topology as byte control data and If I recall correctly we had some issues of setting the default data. As I see we are only missing the firmware side support in demux for large data. You can see how it is done in the eq's. @singalsu can also comment as he was just hacking around the eq's. I you want to have large data blob or just large number of parameters as part of basic widget (not its related control), I think we don't support that atm. |
Yep, it works perfectly. Please see eq_fir.c code. |
|
and just my 2 cents to this:
|
|
We should keep logic as simple as possible. Multi-part IPCs require additional logic in components and should be used when there is no alternative. Increasing IPC msg size limit is good. |
|
|
||
| /** Maximum message size for mailbox Tx/Rx */ | ||
| #define SOF_IPC_MSG_MAX_SIZE 384 | ||
| #define SOF_IPC_MSG_MAX_SIZE 768 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abonislawski my understanding after recent discussions is that we are moving to 2kB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgirdwood To move to 2kB we have to rework how msgs are allocated. @abonislawski will work on that, but for now we would like to use as much as we can without these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgirdwood just like @jajanusz said, please merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lgirdwood To move to 2kB we have to rework how msgs are allocated. @abonislawski will work on that, but for now we would like to use as much as we can without these changes.
can we quantify the work needed to support 2KB IPC messages? If we can have ONE ABI change it's less work for me, and less confusion for everyone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart hardly to say but atm Im busy with other tasks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@plbossart It's not 5-minutes-task. Msg allocation and handling code would need to be reworked and we have more urgent tasks now. We want to increase it to 768 atm, cos without it we stall another feature. I know it's inconvenient for you, but we can't help much with that now. We would greatly appreciate your help with approving this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Humm, what happens if I don't? The mux would be stalled, but what is the impact? Put differently, who needs the mux support from the kernel level in the coming weeks?
|
@jajanusz @abonislawski yes thanks from my side no objection to increase the max size. |
lbetlej
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abonislawski we have a combined @mmaka1 @plbossart @lbetlej proposal to make change that is scalable for the future:
- Set IPC max size in FW to 4KB (cavs hw memory window size)
- Report IPC max max size via FW ready to a driver
- Driver uses value reported by FW
|
@plbossart @lbetlej @mmaka1 I will add reporting capability of IPC msg max size to extended manifest when #2427 merged |
|
@abonislawski I assume we will be changing to 4kB ? |
|
@lgirdwood not now but it will not require another kernel change |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we resubmit with the larger size and let CI do it's thing.
|
@abonislawski ping? what's the status of this? |
|
@kv2019i ipc size added to ext_manifest and merged in FW but still not used in kernel |
|
@abonislawski ping. Will move to v1.7 |
|
Closing this PR as the related 2212 (closed - cancelled) |
It will increase max size for ipc msg, needed for #2212
Signed-off-by: Adrian Bonislawski adrian.bonislawski@linux.intel.com