hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/include/linux/virtio_vsock.h
....@@ -7,9 +7,6 @@
77 #include <net/sock.h>
88 #include <net/af_vsock.h>
99
10
-#define VIRTIO_VSOCK_DEFAULT_MIN_BUF_SIZE 128
11
-#define VIRTIO_VSOCK_DEFAULT_BUF_SIZE (1024 * 256)
12
-#define VIRTIO_VSOCK_DEFAULT_MAX_BUF_SIZE (1024 * 256)
1310 #define VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE (1024 * 4)
1411 #define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL
1512 #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE virtio_transport_max_vsock_pkt_buf_size
....@@ -26,36 +23,33 @@
2623 struct virtio_vsock_sock {
2724 struct vsock_sock *vsk;
2825
29
- /* Protected by lock_sock(sk_vsock(trans->vsk)) */
30
- u32 buf_size;
31
- u32 buf_size_min;
32
- u32 buf_size_max;
33
-
3426 spinlock_t tx_lock;
3527 spinlock_t rx_lock;
3628
3729 /* Protected by tx_lock */
3830 u32 tx_cnt;
39
- u32 buf_alloc;
4031 u32 peer_fwd_cnt;
4132 u32 peer_buf_alloc;
4233
4334 /* Protected by rx_lock */
4435 u32 fwd_cnt;
36
+ u32 last_fwd_cnt;
4537 u32 rx_bytes;
38
+ u32 buf_alloc;
4639 struct list_head rx_queue;
4740 };
4841
4942 struct virtio_vsock_pkt {
5043 struct virtio_vsock_hdr hdr;
51
- struct work_struct work;
5244 struct list_head list;
5345 /* socket refcnt not held, only use for cancellation */
5446 struct vsock_sock *vsk;
5547 void *buf;
48
+ u32 buf_len;
5649 u32 len;
5750 u32 off;
5851 bool reply;
52
+ bool tap_delivered;
5953 };
6054
6155 struct virtio_vsock_pkt_info {
....@@ -92,12 +86,6 @@
9286
9387 int virtio_transport_do_socket_init(struct vsock_sock *vsk,
9488 struct vsock_sock *psk);
95
-u64 virtio_transport_get_buffer_size(struct vsock_sock *vsk);
96
-u64 virtio_transport_get_min_buffer_size(struct vsock_sock *vsk);
97
-u64 virtio_transport_get_max_buffer_size(struct vsock_sock *vsk);
98
-void virtio_transport_set_buffer_size(struct vsock_sock *vsk, u64 val);
99
-void virtio_transport_set_min_buffer_size(struct vsock_sock *vsk, u64 val);
100
-void virtio_transport_set_max_buffer_size(struct vsock_sock *vs, u64 val);
10189 int
10290 virtio_transport_notify_poll_in(struct vsock_sock *vsk,
10391 size_t target,
....@@ -124,6 +112,7 @@
124112 struct vsock_transport_send_notify_data *data);
125113 int virtio_transport_notify_send_post_enqueue(struct vsock_sock *vsk,
126114 ssize_t written, struct vsock_transport_send_notify_data *data);
115
+void virtio_transport_notify_buffer_size(struct vsock_sock *vsk, u64 *val);
127116
128117 u64 virtio_transport_stream_rcvhiwat(struct vsock_sock *vsk);
129118 bool virtio_transport_stream_is_active(struct vsock_sock *vsk);