Skip to content

Conversation

@cujomalainey
Copy link

Most uses of the IPC TX reply only care about the return code which can be returned without passing a stack allocated struct. Let's save those copy cycles.

Signed-off-by: Curtis Malainey cujomalainey@chromium.org

Copy link
Collaborator

@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.

I would be tempted to change the subject to "ASoC: SOF: ipc3: ..." as this change only affects IPC3 code path.

@cujomalainey
Copy link
Author

I would be tempted to change the subject to "ASoC: SOF: ipc3: ..." as this change only affects IPC3 code path.

That isn't quite correct, the majority are, but there are changes in the compress code as well as the flood test.

@cujomalainey
Copy link
Author

Found a couple more replies that could be removed and added them to the chain.

@cujomalainey cujomalainey force-pushed the reply branch 2 times, most recently from 64eca90 to 1cbdfac Compare October 14, 2022 20:39
@cujomalainey
Copy link
Author

Apologies for the rapid pushes, fixed a typo that then introduced a change-id

@plbossart
Copy link
Member

quite a few build issues @cujomalainey

@cujomalainey
Copy link
Author

quite a few build issues @cujomalainey

Yea saw that, sorry for the delay, was out sick Monday/Tuesday, trying to catch up

@cujomalainey
Copy link
Author

Ah forgot the inline keyword. Will push a fix

@cujomalainey cujomalainey force-pushed the reply branch 2 times, most recently from a5cd7d4 to e1e9446 Compare November 2, 2022 00:20
@cujomalainey
Copy link
Author

FYI I cannot open the checkpatch bot as I am getting SSL errors.

@cujomalainey
Copy link
Author

@plbossart can we do a review? The longer the delay the likelyhood of more uses slipping in that the patches won't catch, my fix and rebase already caught 2 more.

@plbossart
Copy link
Member

I'll be honest @cujomalainey, we have too many PRs in flight:
#3984
#3888
#3986
#3933
#3978
CI is undergoing a painful migration and a number of unfortunate regressions.
And we have a number of really important PRs
#3972
#3962
#3953

Your PR makes complete sense but we have to be realistic on the urgency/priority.
Thanks for your understanding.

@cujomalainey
Copy link
Author

@plbossart understood, thanks for the update. Let me know when things calm down, I'll rebase to make sure I get any new cases then re-review.

@cujomalainey
Copy link
Author

@plbossart just wanted to let you know I rebased these so if things have calmed down on your end they should be able to go in

Copy link

@iuliana-prodan iuliana-prodan left a comment

Choose a reason for hiding this comment

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

LGT, but can't we use only patches 2 and 3 - patch 1 is modified by 3?
Add no reply calls and use them where reply is "thrown away".

@cujomalainey
Copy link
Author

@iuliana-prodan It was more to keep the conceptually isolated since the first was produced on its own and is clean up, the other two are the prevention

95% of the calls inside SOF to TX an IPC don't care about a reply. Yet
the previous commit cleaned up a bunch of replies that were being
populated and then thrown away. This adds some functions so users who do
not need replies don't feel obligated to provide the space to the API.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Convert all existing calls that pass "NULL, 0" for reply data to the new
no_reply calls. Also convert any calls that pass in data but don't
actually parse the result.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
@plbossart
Copy link
Member

@ujfalusi @bardliao @ranj063 can you take a look at this PR please?


int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg,
void *reply_data, size_t reply_bytes);
static inline int sof_client_ipc_tx_message_no_reply(struct sof_client_dev *cdev, void *ipc_msg)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@cujomalainey the change itself is OK but i think the name with the no_reply suffix is a bit misleading which seems to indicate that there's no reply for this IPC TX. It's not that there's no reply but that there's no data expected with the reply right?

Copy link
Author

Choose a reason for hiding this comment

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

No the concept is that we don't care about the reply, only the return code. I.e don't fetch the reply data. Name was recommended by @plbossart

Copy link
Collaborator

Choose a reason for hiding this comment

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

@cujomalainey the return code that you mention here is part of the reply isnt it?

Copy link
Author

Choose a reason for hiding this comment

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

Technically yes, but you do not need to fetch the data to get the return code. See error code fetch here but the copy out check is down here and this is what we are skipping

Copy link
Author

Choose a reason for hiding this comment

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

Here is the ipc4 equivalent code

@cujomalainey cujomalainey merged commit 3210285 into thesofproject:topic/sof-dev Dec 5, 2022
@cujomalainey cujomalainey deleted the reply branch December 5, 2022 18:53
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.

6 participants