summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3/cdnsp-debug.h
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2025-07-08 14:36:11 +0800
committerJakub Kicinski <kuba@kernel.org>2025-07-09 19:29:52 -0700
commitf0c5827d07cb34dfcf7d8751f1681151f547a268 (patch)
tree6a3869586db2ea40b8120de596b7ac5d8584d31b /drivers/usb/cdns3/cdnsp-debug.h
parent819802e25a091e9ef8d37fc01b47f013af50c416 (diff)
hv_sock: Return the readable bytes in hvs_stream_has_data()
When hv_sock was originally added, __vsock_stream_recvmsg() and vsock_stream_has_data() actually only needed to know whether there is any readable data or not, so hvs_stream_has_data() was written to return 1 or 0 for simplicity. However, now hvs_stream_has_data() should return the readable bytes because vsock_data_ready() -> vsock_stream_has_data() needs to know the actual bytes rather than a boolean value of 1 or 0. The SIOCINQ ioctl support also needs hvs_stream_has_data() to return the readable bytes. Let hvs_stream_has_data() return the readable bytes of the payload in the next host-to-guest VMBus hv_sock packet. Note: there may be multiple incoming hv_sock packets pending in the VMBus channel's ringbuffer, but so far there is not a VMBus API that allows us to know all the readable bytes in total without reading and caching the payload of the multiple packets, so let's just return the readable bytes of the next single packet. In the future, we'll either add a VMBus API that allows us to know the total readable bytes without touching the data in the ringbuffer, or the hv_sock driver needs to understand the VMBus packet format and parse the packets directly. Signed-off-by: Dexuan Cui <decui@microsoft.com> Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com> Acked-by: Stefano Garzarella <sgarzare@redhat.com> Acked-by: Wei Liu <wei.liu@kernel.org> Link: https://patch.msgid.link/20250708-siocinq-v6-1-3775f9a9e359@antgroup.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/usb/cdns3/cdnsp-debug.h')
0 files changed, 0 insertions, 0 deletions