License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2016-07-28 14:36:32 +00:00
|
|
|
#ifndef _LINUX_VIRTIO_VSOCK_H
|
|
|
|
|
#define _LINUX_VIRTIO_VSOCK_H
|
|
|
|
|
|
|
|
|
|
#include <uapi/linux/virtio_vsock.h>
|
|
|
|
|
#include <linux/socket.h>
|
|
|
|
|
#include <net/sock.h>
|
|
|
|
|
#include <net/af_vsock.h>
|
|
|
|
|
|
2023-01-13 22:21:37 +00:00
|
|
|
#define VIRTIO_VSOCK_SKB_HEADROOM (sizeof(struct virtio_vsock_hdr))
|
|
|
|
|
|
|
|
|
|
struct virtio_vsock_skb_cb {
|
|
|
|
|
bool reply;
|
|
|
|
|
bool tap_delivered;
|
2023-09-16 13:09:15 +00:00
|
|
|
u32 offset;
|
2023-01-13 22:21:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#define VIRTIO_VSOCK_SKB_CB(skb) ((struct virtio_vsock_skb_cb *)((skb)->cb))
|
|
|
|
|
|
|
|
|
|
static inline struct virtio_vsock_hdr *virtio_vsock_hdr(struct sk_buff *skb)
|
|
|
|
|
{
|
|
|
|
|
return (struct virtio_vsock_hdr *)skb->head;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline bool virtio_vsock_skb_reply(struct sk_buff *skb)
|
|
|
|
|
{
|
|
|
|
|
return VIRTIO_VSOCK_SKB_CB(skb)->reply;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void virtio_vsock_skb_set_reply(struct sk_buff *skb)
|
|
|
|
|
{
|
|
|
|
|
VIRTIO_VSOCK_SKB_CB(skb)->reply = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline bool virtio_vsock_skb_tap_delivered(struct sk_buff *skb)
|
|
|
|
|
{
|
|
|
|
|
return VIRTIO_VSOCK_SKB_CB(skb)->tap_delivered;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void virtio_vsock_skb_set_tap_delivered(struct sk_buff *skb)
|
|
|
|
|
{
|
|
|
|
|
VIRTIO_VSOCK_SKB_CB(skb)->tap_delivered = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void virtio_vsock_skb_clear_tap_delivered(struct sk_buff *skb)
|
|
|
|
|
{
|
|
|
|
|
VIRTIO_VSOCK_SKB_CB(skb)->tap_delivered = false;
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-17 09:01:15 +00:00
|
|
|
static inline void virtio_vsock_skb_put(struct sk_buff *skb, u32 len)
|
2023-01-13 22:21:37 +00:00
|
|
|
{
|
2025-07-17 09:01:14 +00:00
|
|
|
DEBUG_NET_WARN_ON_ONCE(skb->len);
|
|
|
|
|
|
|
|
|
|
if (skb_is_nonlinear(skb))
|
|
|
|
|
skb->len = len;
|
|
|
|
|
else
|
|
|
|
|
skb_put(skb, len);
|
2023-01-13 22:21:37 +00:00
|
|
|
}
|
|
|
|
|
|
2025-07-17 09:01:12 +00:00
|
|
|
static inline struct sk_buff *
|
2025-07-17 09:01:14 +00:00
|
|
|
__virtio_vsock_alloc_skb_with_frags(unsigned int header_len,
|
|
|
|
|
unsigned int data_len,
|
|
|
|
|
gfp_t mask)
|
2023-01-13 22:21:37 +00:00
|
|
|
{
|
|
|
|
|
struct sk_buff *skb;
|
2025-07-17 09:01:14 +00:00
|
|
|
int err;
|
2023-01-13 22:21:37 +00:00
|
|
|
|
2025-07-17 09:01:14 +00:00
|
|
|
skb = alloc_skb_with_frags(header_len, data_len,
|
|
|
|
|
PAGE_ALLOC_COSTLY_ORDER, &err, mask);
|
2023-01-13 22:21:37 +00:00
|
|
|
if (!skb)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
skb_reserve(skb, VIRTIO_VSOCK_SKB_HEADROOM);
|
2025-07-17 09:01:14 +00:00
|
|
|
skb->data_len = data_len;
|
2023-01-13 22:21:37 +00:00
|
|
|
return skb;
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-17 09:01:14 +00:00
|
|
|
static inline struct sk_buff *
|
|
|
|
|
virtio_vsock_alloc_linear_skb(unsigned int size, gfp_t mask)
|
|
|
|
|
{
|
|
|
|
|
return __virtio_vsock_alloc_skb_with_frags(size, 0, mask);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline struct sk_buff *virtio_vsock_alloc_skb(unsigned int size, gfp_t mask)
|
|
|
|
|
{
|
|
|
|
|
if (size <= SKB_WITH_OVERHEAD(PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER))
|
|
|
|
|
return virtio_vsock_alloc_linear_skb(size, mask);
|
|
|
|
|
|
|
|
|
|
size -= VIRTIO_VSOCK_SKB_HEADROOM;
|
|
|
|
|
return __virtio_vsock_alloc_skb_with_frags(VIRTIO_VSOCK_SKB_HEADROOM,
|
|
|
|
|
size, mask);
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-13 22:21:37 +00:00
|
|
|
static inline void
|
|
|
|
|
virtio_vsock_skb_queue_head(struct sk_buff_head *list, struct sk_buff *skb)
|
|
|
|
|
{
|
|
|
|
|
spin_lock_bh(&list->lock);
|
|
|
|
|
__skb_queue_head(list, skb);
|
|
|
|
|
spin_unlock_bh(&list->lock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
virtio_vsock_skb_queue_tail(struct sk_buff_head *list, struct sk_buff *skb)
|
|
|
|
|
{
|
|
|
|
|
spin_lock_bh(&list->lock);
|
|
|
|
|
__skb_queue_tail(list, skb);
|
|
|
|
|
spin_unlock_bh(&list->lock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline struct sk_buff *virtio_vsock_skb_dequeue(struct sk_buff_head *list)
|
|
|
|
|
{
|
|
|
|
|
struct sk_buff *skb;
|
|
|
|
|
|
|
|
|
|
spin_lock_bh(&list->lock);
|
|
|
|
|
skb = __skb_dequeue(list);
|
|
|
|
|
spin_unlock_bh(&list->lock);
|
|
|
|
|
|
|
|
|
|
return skb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void virtio_vsock_skb_queue_purge(struct sk_buff_head *list)
|
|
|
|
|
{
|
|
|
|
|
spin_lock_bh(&list->lock);
|
|
|
|
|
__skb_queue_purge(list);
|
|
|
|
|
spin_unlock_bh(&list->lock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline size_t virtio_vsock_skb_len(struct sk_buff *skb)
|
|
|
|
|
{
|
|
|
|
|
return (size_t)(skb_end_pointer(skb) - skb->head);
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-17 09:01:11 +00:00
|
|
|
/* Dimension the RX SKB so that the entire thing fits exactly into
|
|
|
|
|
* a single 4KiB page. This avoids wasting memory due to alloc_skb()
|
|
|
|
|
* rounding up to the next page order and also means that we
|
|
|
|
|
* don't leave higher-order pages sitting around in the RX queue.
|
|
|
|
|
*/
|
|
|
|
|
#define VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE SKB_WITH_OVERHEAD(1024 * 4)
|
2016-07-28 14:36:32 +00:00
|
|
|
#define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL
|
|
|
|
|
#define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE (1024 * 64)
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
VSOCK_VQ_RX = 0, /* for host to guest data */
|
|
|
|
|
VSOCK_VQ_TX = 1, /* for guest to host data */
|
|
|
|
|
VSOCK_VQ_EVENT = 2,
|
|
|
|
|
VSOCK_VQ_MAX = 3,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Per-socket state (accessed via vsk->trans) */
|
|
|
|
|
struct virtio_vsock_sock {
|
|
|
|
|
struct vsock_sock *vsk;
|
|
|
|
|
|
|
|
|
|
spinlock_t tx_lock;
|
|
|
|
|
spinlock_t rx_lock;
|
|
|
|
|
|
|
|
|
|
/* Protected by tx_lock */
|
|
|
|
|
u32 tx_cnt;
|
|
|
|
|
u32 peer_fwd_cnt;
|
|
|
|
|
u32 peer_buf_alloc;
|
2024-07-30 19:43:07 +00:00
|
|
|
size_t bytes_unsent;
|
2016-07-28 14:36:32 +00:00
|
|
|
|
|
|
|
|
/* Protected by rx_lock */
|
|
|
|
|
u32 fwd_cnt;
|
2019-07-30 15:43:31 +00:00
|
|
|
u32 last_fwd_cnt;
|
2016-07-28 14:36:32 +00:00
|
|
|
u32 rx_bytes;
|
2019-07-30 15:43:32 +00:00
|
|
|
u32 buf_alloc;
|
vsock/virtio: fix `rx_bytes` accounting for stream sockets
In `struct virtio_vsock_sock`, we maintain two counters:
- `rx_bytes`: used internally to track how many bytes have been read.
This supports mechanisms like .stream_has_data() and sock_rcvlowat().
- `fwd_cnt`: used for the credit mechanism to inform available receive
buffer space to the remote peer.
These counters are updated via virtio_transport_inc_rx_pkt() and
virtio_transport_dec_rx_pkt().
Since the beginning with commit 06a8fc78367d ("VSOCK: Introduce
virtio_vsock_common.ko"), we call virtio_transport_dec_rx_pkt() in
virtio_transport_stream_do_dequeue() only when we consume the entire
packet, so partial reads, do not update `rx_bytes` and `fwd_cnt`.
This is fine for `fwd_cnt`, because we still have space used for the
entire packet, and we don't want to update the credit for the other
peer until we free the space of the entire packet. However, this
causes `rx_bytes` to be stale on partial reads.
Previously, this didn’t cause issues because `rx_bytes` was used only by
.stream_has_data(), and any unread portion of a packet implied data was
still available. However, since commit 93b808876682
("virtio/vsock: fix logic which reduces credit update messages"), we now
rely on `rx_bytes` to determine if a credit update should be sent when
the data in the RX queue drops below SO_RCVLOWAT value.
This patch fixes the accounting by updating `rx_bytes` with the number
of bytes actually read, even on partial reads, while leaving `fwd_cnt`
untouched until the packet is fully consumed. Also introduce a new
`buf_used` counter to check that the remote peer is honoring the given
credit; this was previously done via `rx_bytes`.
Fixes: 93b808876682 ("virtio/vsock: fix logic which reduces credit update messages")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20250521121705.196379-1-sgarzare@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-05-21 12:17:05 +00:00
|
|
|
u32 buf_used;
|
2023-01-13 22:21:37 +00:00
|
|
|
struct sk_buff_head rx_queue;
|
2021-06-11 11:12:38 +00:00
|
|
|
u32 msg_count;
|
2016-07-28 14:36:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct virtio_vsock_pkt_info {
|
|
|
|
|
u32 remote_cid, remote_port;
|
2017-03-15 01:32:14 +00:00
|
|
|
struct vsock_sock *vsk;
|
2016-07-28 14:36:32 +00:00
|
|
|
struct msghdr *msg;
|
|
|
|
|
u32 pkt_len;
|
|
|
|
|
u16 type;
|
|
|
|
|
u16 op;
|
|
|
|
|
u32 flags;
|
|
|
|
|
bool reply;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct virtio_transport {
|
|
|
|
|
/* This must be the first field */
|
|
|
|
|
struct vsock_transport transport;
|
|
|
|
|
|
|
|
|
|
/* Takes ownership of the packet */
|
2023-01-13 22:21:37 +00:00
|
|
|
int (*send_pkt)(struct sk_buff *skb);
|
2023-09-16 13:09:18 +00:00
|
|
|
|
|
|
|
|
/* Used in MSG_ZEROCOPY mode. Checks, that provided data
|
|
|
|
|
* (number of buffers) could be transmitted with zerocopy
|
|
|
|
|
* mode. If this callback is not implemented for the current
|
|
|
|
|
* transport - this means that this transport doesn't need
|
|
|
|
|
* extra checks and can perform zerocopy transmission by
|
|
|
|
|
* default.
|
|
|
|
|
*/
|
|
|
|
|
bool (*can_msgzerocopy)(int bufs_num);
|
2016-07-28 14:36:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ssize_t
|
|
|
|
|
virtio_transport_stream_dequeue(struct vsock_sock *vsk,
|
|
|
|
|
struct msghdr *msg,
|
|
|
|
|
size_t len,
|
|
|
|
|
int type);
|
|
|
|
|
int
|
|
|
|
|
virtio_transport_dgram_dequeue(struct vsock_sock *vsk,
|
|
|
|
|
struct msghdr *msg,
|
|
|
|
|
size_t len, int flags);
|
|
|
|
|
|
2021-06-11 11:13:06 +00:00
|
|
|
int
|
|
|
|
|
virtio_transport_seqpacket_enqueue(struct vsock_sock *vsk,
|
|
|
|
|
struct msghdr *msg,
|
|
|
|
|
size_t len);
|
2021-06-11 11:12:38 +00:00
|
|
|
ssize_t
|
|
|
|
|
virtio_transport_seqpacket_dequeue(struct vsock_sock *vsk,
|
|
|
|
|
struct msghdr *msg,
|
|
|
|
|
int flags);
|
2016-07-28 14:36:32 +00:00
|
|
|
s64 virtio_transport_stream_has_data(struct vsock_sock *vsk);
|
|
|
|
|
s64 virtio_transport_stream_has_space(struct vsock_sock *vsk);
|
2021-06-11 11:13:06 +00:00
|
|
|
u32 virtio_transport_seqpacket_has_data(struct vsock_sock *vsk);
|
2016-07-28 14:36:32 +00:00
|
|
|
|
2024-07-30 19:43:07 +00:00
|
|
|
ssize_t virtio_transport_unsent_bytes(struct vsock_sock *vsk);
|
|
|
|
|
|
|
|
|
|
void virtio_transport_consume_skb_sent(struct sk_buff *skb,
|
|
|
|
|
bool consume);
|
|
|
|
|
|
2016-07-28 14:36:32 +00:00
|
|
|
int virtio_transport_do_socket_init(struct vsock_sock *vsk,
|
|
|
|
|
struct vsock_sock *psk);
|
|
|
|
|
int
|
|
|
|
|
virtio_transport_notify_poll_in(struct vsock_sock *vsk,
|
|
|
|
|
size_t target,
|
|
|
|
|
bool *data_ready_now);
|
|
|
|
|
int
|
|
|
|
|
virtio_transport_notify_poll_out(struct vsock_sock *vsk,
|
|
|
|
|
size_t target,
|
|
|
|
|
bool *space_available_now);
|
|
|
|
|
|
|
|
|
|
int virtio_transport_notify_recv_init(struct vsock_sock *vsk,
|
|
|
|
|
size_t target, struct vsock_transport_recv_notify_data *data);
|
|
|
|
|
int virtio_transport_notify_recv_pre_block(struct vsock_sock *vsk,
|
|
|
|
|
size_t target, struct vsock_transport_recv_notify_data *data);
|
|
|
|
|
int virtio_transport_notify_recv_pre_dequeue(struct vsock_sock *vsk,
|
|
|
|
|
size_t target, struct vsock_transport_recv_notify_data *data);
|
|
|
|
|
int virtio_transport_notify_recv_post_dequeue(struct vsock_sock *vsk,
|
|
|
|
|
size_t target, ssize_t copied, bool data_read,
|
|
|
|
|
struct vsock_transport_recv_notify_data *data);
|
|
|
|
|
int virtio_transport_notify_send_init(struct vsock_sock *vsk,
|
|
|
|
|
struct vsock_transport_send_notify_data *data);
|
|
|
|
|
int virtio_transport_notify_send_pre_block(struct vsock_sock *vsk,
|
|
|
|
|
struct vsock_transport_send_notify_data *data);
|
|
|
|
|
int virtio_transport_notify_send_pre_enqueue(struct vsock_sock *vsk,
|
|
|
|
|
struct vsock_transport_send_notify_data *data);
|
|
|
|
|
int virtio_transport_notify_send_post_enqueue(struct vsock_sock *vsk,
|
|
|
|
|
ssize_t written, struct vsock_transport_send_notify_data *data);
|
2019-11-14 09:57:42 +00:00
|
|
|
void virtio_transport_notify_buffer_size(struct vsock_sock *vsk, u64 *val);
|
2016-07-28 14:36:32 +00:00
|
|
|
|
|
|
|
|
u64 virtio_transport_stream_rcvhiwat(struct vsock_sock *vsk);
|
|
|
|
|
bool virtio_transport_stream_is_active(struct vsock_sock *vsk);
|
|
|
|
|
bool virtio_transport_stream_allow(u32 cid, u32 port);
|
|
|
|
|
int virtio_transport_dgram_bind(struct vsock_sock *vsk,
|
|
|
|
|
struct sockaddr_vm *addr);
|
|
|
|
|
bool virtio_transport_dgram_allow(u32 cid, u32 port);
|
|
|
|
|
|
|
|
|
|
int virtio_transport_connect(struct vsock_sock *vsk);
|
|
|
|
|
|
|
|
|
|
int virtio_transport_shutdown(struct vsock_sock *vsk, int mode);
|
|
|
|
|
|
|
|
|
|
void virtio_transport_release(struct vsock_sock *vsk);
|
|
|
|
|
|
|
|
|
|
ssize_t
|
|
|
|
|
virtio_transport_stream_enqueue(struct vsock_sock *vsk,
|
|
|
|
|
struct msghdr *msg,
|
|
|
|
|
size_t len);
|
|
|
|
|
int
|
|
|
|
|
virtio_transport_dgram_enqueue(struct vsock_sock *vsk,
|
|
|
|
|
struct sockaddr_vm *remote_addr,
|
|
|
|
|
struct msghdr *msg,
|
|
|
|
|
size_t len);
|
|
|
|
|
|
|
|
|
|
void virtio_transport_destruct(struct vsock_sock *vsk);
|
|
|
|
|
|
2019-11-14 09:57:40 +00:00
|
|
|
void virtio_transport_recv_pkt(struct virtio_transport *t,
|
2023-01-13 22:21:37 +00:00
|
|
|
struct sk_buff *skb);
|
|
|
|
|
void virtio_transport_inc_tx_pkt(struct virtio_vsock_sock *vvs, struct sk_buff *skb);
|
2016-07-28 14:36:32 +00:00
|
|
|
u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 wanted);
|
|
|
|
|
void virtio_transport_put_credit(struct virtio_vsock_sock *vvs, u32 credit);
|
2023-01-13 22:21:37 +00:00
|
|
|
void virtio_transport_deliver_tap_pkt(struct sk_buff *skb);
|
|
|
|
|
int virtio_transport_purge_skbs(void *vsk, struct sk_buff_head *list);
|
2023-03-27 19:11:51 +00:00
|
|
|
int virtio_transport_read_skb(struct vsock_sock *vsk, skb_read_actor_t read_actor);
|
2023-12-14 12:52:29 +00:00
|
|
|
int virtio_transport_notify_set_rcvlowat(struct vsock_sock *vsk, int val);
|
2016-07-28 14:36:32 +00:00
|
|
|
#endif /* _LINUX_VIRTIO_VSOCK_H */
|