Skip to content

[QUESTION] About mem for rpmsg transport #450

Open

Description

@CC-AD

hi nxp
erpc is a great project for rpc. I use rpmsg as transport for imx8mp to make Core-A to Core-M and Core-M to Core-A.
but i can't understand in erpc_c/transports/erpc_rpmsg_lite_transport.cpp function RPMsgTransport::send

erpc_status_t RPMsgTransport::send(MessageBuffer *message)
{
    int32_t ret_val = rpmsg_lite_send_nocopy(s_rpmsg, m_rpmsg_ept, m_dst_addr, reinterpret_cast<char *>(message->get()),
                                             message->getUsed());
    message->set(NULL, 0);

    return (ret_val != RL_SUCCESS) ? kErpcStatus_SendFailed : kErpcStatus_Success;
}

if there make message buf to NULL and size to zero, how to free this message buf? I know this memory from virtio queue. Could it be that don't need free? I test this problem. add log to setup_mbf_rpmsg and log format is

printf("create: %p %d\n", buf, size);

printf("dispose: %p %d\n", tmp, buf->getLength());

and test result is

dispose: 0x80e65664 16
create: 0x55408010 4080
dispose: 0x80e65664 16
create: 0x55409010 4080
dispose: 0x80e65664 16
create: 0x5540a010  4080

memory address for 0x55408010 0x55409010 0x5540a010 don't free. look forward for your reply.

Activity

  1. github-actions commented on Feb 17, 2025

    @github-actions

    Hi eRPC user. Thank you for your interest and welcome. We hope you will enjoy this framework well.

  2. Hadatko commented on Feb 17, 2025

    @Hadatko
    Member

    Hi @ADragonKnight , are you aware of that message buffers created on one side are freed on other side? There are N/2 buffer amounts for every side. Each half is used for creating and writing on one side and reading and freeing on other side.

  3. CC-AD commented on Feb 17, 2025

    @CC-AD
    Author

    Wow,I know this from OpenAMP project. this framework very efficient。 thinks for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions