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 <[email protected]>
>>>> ---
>>>>
>>>> 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 via email to