mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Shah, Tanmay" <tanmays@amd.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>, <tanmay.shah@amd.com>
Cc: Arnaud POULIQUEN <arnaud.pouliquen@foss.st.com>,
	<andersson@kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-remoteproc@vger.kernel.org>, <divin.raj@arm.com>
Subject: Re: [PATCH v3 4/4] samples: rpmsg: add MTU size info
Date: Tue, 9 Jun 2026 11:33:30 -0500	[thread overview]
Message-ID: <f8541769-3525-4430-8d3d-76f05d7385b5@amd.com> (raw)
In-Reply-To: <aig7QKcSIL1aVihQ@p14s>



On 6/9/2026 11:11 AM, Mathieu Poirier wrote:
> On Thu, Jun 04, 2026 at 05:28:13PM -0500, Shah, Tanmay wrote:
>>
>>
>> On 6/2/2026 3:34 AM, Arnaud POULIQUEN wrote:
>>>
>>>
>>> On 5/29/26 18:43, Tanmay Shah wrote:
>>>> RPMsg MTU size can be variable now and no longer hardcoded to 512 bytes.
>>>> Add log to the sample driver that prints current MTU size of the rpmsg
>>>> buffer.
>>>>
>>>> Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
>>>> ---
>>>>
>>>> Changes in v3:
>>>>    - Check for error when retrieving MTU size
>>>>    - %s/mtu/MTU/
>>>>
>>>>   samples/rpmsg/rpmsg_client_sample.c | 9 +++++++++
>>>>   1 file changed, 9 insertions(+)
>>>>
>>>> diff --git a/samples/rpmsg/rpmsg_client_sample.c b/samples/rpmsg/
>>>> rpmsg_client_sample.c
>>>> index ae5081662283..55afa53189af 100644
>>>> --- a/samples/rpmsg/rpmsg_client_sample.c
>>>> +++ b/samples/rpmsg/rpmsg_client_sample.c
>>>> @@ -52,6 +52,7 @@ static int rpmsg_sample_probe(struct rpmsg_device
>>>> *rpdev)
>>>>   {
>>>>       int ret;
>>>>       struct instance_data *idata;
>>>> +    ssize_t mtu;
>>>>         dev_info(&rpdev->dev, "new channel: 0x%x -> 0x%x!\n",
>>>>                       rpdev->src, rpdev->dst);
>>>> @@ -62,6 +63,14 @@ static int rpmsg_sample_probe(struct rpmsg_device
>>>> *rpdev)
>>>>         dev_set_drvdata(&rpdev->dev, idata);
>>>>   +    mtu = rpmsg_get_mtu(rpdev->ept);
>>>> +    if (mtu < 0) {
>>>> +        dev_warn(&rpdev->dev, "invalid rpmsg MTU size = %ld\n", mtu);
>>>> +        return mtu;
>>>> +    }
>>>> +
>>>> +    dev_info(&rpdev->dev, "rpmsg MTU size = %ld\n", mtu);
>>>> +
>>>
>>> Do you really need this commit? rpmsg_send should return an error if the
>>> buffer size is insufficient [1].
>>>
>>> [1] https://elixir.bootlin.com/linux/v7.0.10/source/drivers/rpmsg/
>>> virtio_rpmsg_bus.c#L517
>>>
>>
>> Here, I just want to demonstrate rpmsg_get_mtu() API. Now we can have a
>> configurable size of the RPMsg buffer. So rpmsg_get_mtu() API can be
>> used to check correct buffer length before even using rpmsg_send() API.
>>
>> I think I should check msg length against mtu size as well.
> 
> Do you plan on sending a new revision of this set or should I move forward with
> this one?
> 

Hi,

I plan to send a new revision, but would like your input on the idea of
this patch. I would like to use rpmsg_get_mtu() size API in the sample
demo to print tx buffer size. This is because buffer size can change now
from one firmware to another firmware.

May be we can print it only once during the driver probe. Open to any
idea that show use of rpmsg_get_mtu().

Thanks,
Tanmay

>>
>>
>>> Regards,
>>> Arnaud
>>>
>>>>       /* send a message to our remote processor */
>>>>       ret = rpmsg_send(rpdev->ept, MSG, strlen(MSG));
>>>>       if (ret) {
>>>
>>


  reply	other threads:[~2026-06-09 16:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29 16:43 [PATCH v3 0/4] Enhance RPMsg buffer management Tanmay Shah
2026-05-29 16:43 ` [PATCH v3 1/4] rpmsg: virtio_rpmsg_bus: rename rbufs and sbufs Tanmay Shah
2026-05-29 16:43 ` [PATCH v3 2/4] rpmsg: virtio_rpmsg_bus: allow different size of tx and rx bufs Tanmay Shah
2026-05-29 16:43 ` [PATCH v3 3/4] rpmsg: virtio_rpmsg_bus: get buffer size from config space Tanmay Shah
2026-06-02  8:25   ` Arnaud POULIQUEN
2026-06-04 20:31     ` Shah, Tanmay
2026-06-05  8:25       ` Arnaud POULIQUEN
2026-06-09 17:33         ` Shah, Tanmay
2026-06-11 17:31           ` Mathieu Poirier
2026-06-11 18:32             ` Shah, Tanmay
2026-05-29 16:43 ` [PATCH v3 4/4] samples: rpmsg: add MTU size info Tanmay Shah
2026-06-02  8:34   ` Arnaud POULIQUEN
2026-06-04 22:28     ` Shah, Tanmay
2026-06-09 16:11       ` Mathieu Poirier
2026-06-09 16:33         ` Shah, Tanmay [this message]
2026-06-11 17:46       ` Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8541769-3525-4430-8d3d-76f05d7385b5@amd.com \
    --to=tanmays@amd.com \
    --cc=andersson@kernel.org \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=divin.raj@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=tanmay.shah@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®