summaryrefslogtreecommitdiffstats
path: root/include/net/af_vsock.h
diff options
context:
space:
mode:
authorArseniy Krasnov <avkrasnov@salutedevices.com>2023-10-10 21:15:15 +0200
committerDavid S. Miller <davem@davemloft.net>2023-10-15 14:19:42 +0200
commit5fbfc7d243343917793ae95a6011f03b5aac4735 (patch)
treeba54ddf2e27bad796ecb5821c583398c1a32b763 /include/net/af_vsock.h
parentvsock: read from socket's error queue (diff)
downloadlinux-5fbfc7d243343917793ae95a6011f03b5aac4735.tar.xz
linux-5fbfc7d243343917793ae95a6011f03b5aac4735.zip
vsock: check for MSG_ZEROCOPY support on send
This feature totally depends on transport, so if transport doesn't support it, return error. Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/af_vsock.h')
-rw-r--r--include/net/af_vsock.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
index b01cf9ac2437..e302c0e804d0 100644
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -177,6 +177,9 @@ struct vsock_transport {
/* Read a single skb */
int (*read_skb)(struct vsock_sock *, skb_read_actor_t);
+
+ /* Zero-copy. */
+ bool (*msgzerocopy_allow)(void);
};
/**** CORE ****/
@@ -241,4 +244,8 @@ static inline void __init vsock_bpf_build_proto(void)
{}
#endif
+static inline bool vsock_msgzerocopy_allow(const struct vsock_transport *t)
+{
+ return t->msgzerocopy_allow && t->msgzerocopy_allow();
+}
#endif /* __AF_VSOCK_H__ */