OpenAMP / open-amp

The main OpenAMP library implementing RPMSG, Virtio, and Remoteproc for RTOS etc
https://www.openampproject.org/
Other
706 stars 288 forks source link

rpmsg_virtio: add RPMSG_ASSERT to check the virtqueue add error #526

Closed CV-Bowen closed 10 months ago

CV-Bowen commented 11 months ago

Add RPMSG_ASSERT() to rpmsg_virtio_return_buffer() to check the possible virtqueue buffer add error.

arnopo commented 11 months ago

"When enable the VQUEUE_DEBUG and RPMSG_DEBUG, RPMSG_ASSERT can check the buffer add error." I can not see how VQUEUE_DEBUG impact RPMSG_ASSERT,trace. I missed something?

CV-Bowen commented 11 months ago

@arnopo I mean we can check the virtqueue_add_buffer() return error with RPMSG_ASSERT when enable VQUEUE_DEBUG. Because virtqueue_add_buffer() can return error only when VQUEUE_DEBUG is enabled.

arnopo commented 11 months ago

@arnopo I mean we can check the virtqueue_add_buffer() return error with RPMSG_ASSERT when enable VQUEUE_DEBUG. Because virtqueue_add_buffer() can return error only when VQUEUE_DEBUG is enabled.

Got it, thanks! Please remove the reference VQUEUE_DEBUG in the commit message , at RPMsg level we don't aware of virqueue configuration. we still test the the result ( even if always VQUEUE_SUCCESS)

arnopo commented 10 months ago

@arnopo I mean we can check the virtqueue_add_buffer() return error with RPMSG_ASSERT when enable VQUEUE_DEBUG. Because virtqueue_add_buffer() can return error only when VQUEUE_DEBUG is enabled.

Got it, thanks! Please remove the reference VQUEUE_DEBUG in the commit message , at RPMsg level we don't aware of virqueue configuration. we still test the the result ( even if always VQUEUE_SUCCESS)

@CV-Bowen, please update the commit message, then ready to merge

CV-Bowen commented 10 months ago

@arnopo Thanks, Done.