net/vmw_vsock/vmci_transport.h
Source file repositories/reference/linux-study-clean/net/vmw_vsock/vmci_transport.h
File Facts
- System
- Linux kernel
- Corpus path
net/vmw_vsock/vmci_transport.h- Extension
.h- Size
- 3672 bytes
- Lines
- 131
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/vmw_vmci_defs.hlinux/vmw_vmci_api.hnet/vsock_addr.hnet/af_vsock.h
Detected Declarations
struct vmci_transport_waiting_infostruct vmci_transport_packetstruct vmci_transport_notify_pktstruct vmci_transport_notify_pkt_q_statestruct vmci_transportenum vmci_transport_packet_type
Annotated Snippet
struct vmci_transport_waiting_info {
u64 generation;
u64 offset;
};
/* Control packet type for STREAM sockets. DGRAMs have no control packets nor
* special packet header for data packets, they are just raw VMCI DGRAM
* messages. For STREAMs, control packets are sent over the control channel
* while data is written and read directly from queue pairs with no packet
* format.
*/
struct vmci_transport_packet {
struct vmci_datagram dg;
u8 version;
u8 type;
u16 proto;
u32 src_port;
u32 dst_port;
u32 _reserved2;
union {
u64 size;
u64 mode;
struct vmci_handle handle;
struct vmci_transport_waiting_info wait;
} u;
};
struct vmci_transport_notify_pkt {
u64 write_notify_window;
u64 write_notify_min_window;
bool peer_waiting_read;
bool peer_waiting_write;
bool peer_waiting_write_detected;
bool sent_waiting_read;
bool sent_waiting_write;
struct vmci_transport_waiting_info peer_waiting_read_info;
struct vmci_transport_waiting_info peer_waiting_write_info;
u64 produce_q_generation;
u64 consume_q_generation;
};
struct vmci_transport_notify_pkt_q_state {
u64 write_notify_window;
u64 write_notify_min_window;
bool peer_waiting_write;
bool peer_waiting_write_detected;
};
union vmci_transport_notify {
struct vmci_transport_notify_pkt pkt;
struct vmci_transport_notify_pkt_q_state pkt_q_state;
};
/* Our transport-specific data. */
struct vmci_transport {
/* For DGRAMs. */
struct vmci_handle dg_handle;
/* For STREAMs. */
struct vmci_handle qp_handle;
struct vmci_qp *qpair;
u64 produce_size;
u64 consume_size;
u32 detach_sub_id;
union vmci_transport_notify notify;
const struct vmci_transport_notify_ops *notify_ops;
struct list_head elem;
struct sock *sk;
spinlock_t lock; /* protects sk. */
};
int vmci_transport_send_wrote_bh(struct sockaddr_vm *dst,
struct sockaddr_vm *src);
int vmci_transport_send_read_bh(struct sockaddr_vm *dst,
struct sockaddr_vm *src);
int vmci_transport_send_wrote(struct sock *sk);
int vmci_transport_send_read(struct sock *sk);
int vmci_transport_send_waiting_write(struct sock *sk,
struct vmci_transport_waiting_info *wait);
int vmci_transport_send_waiting_read(struct sock *sk,
struct vmci_transport_waiting_info *wait);
#endif
Annotation
- Immediate include surface: `linux/vmw_vmci_defs.h`, `linux/vmw_vmci_api.h`, `net/vsock_addr.h`, `net/af_vsock.h`.
- Detected declarations: `struct vmci_transport_waiting_info`, `struct vmci_transport_packet`, `struct vmci_transport_notify_pkt`, `struct vmci_transport_notify_pkt_q_state`, `struct vmci_transport`, `enum vmci_transport_packet_type`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.