1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * Copyright (C) 2012 VMware, Inc. All rights reserved.
8 #ifndef _VMCI_DATAGRAM_H_
9 #define _VMCI_DATAGRAM_H_
11 #include <linux/types.h>
12 #include <linux/list.h>
14 #include "vmci_context.h"
16 #define VMCI_MAX_DELAYED_DG_HOST_QUEUE_SIZE 256
19 * The struct vmci_datagram_queue_entry is a queue header for the in-kernel VMCI
20 * datagram queues. It is allocated in non-paged memory, as the
21 * content is accessed while holding a spinlock. The pending datagram
22 * itself may be allocated from paged memory. We shadow the size of
23 * the datagram in the non-paged queue entry as this size is used
24 * while holding the same spinlock as above.
26 struct vmci_datagram_queue_entry {
27 struct list_head list_item; /* For queuing. */
28 size_t dg_size; /* Size of datagram. */
29 struct vmci_datagram *dg; /* Pending datagram. */
32 /* VMCIDatagramSendRecvInfo */
33 struct vmci_datagram_snd_rcv_info {
39 /* Datagram API for non-public use. */
40 int vmci_datagram_dispatch(u32 context_id, struct vmci_datagram *dg,
42 int vmci_datagram_invoke_guest_handler(struct vmci_datagram *dg);
44 #endif /* _VMCI_DATAGRAM_H_ */