1
1
/*********************************************************
2
* Copyright (C) 2005-2011 VMware, Inc. All rights reserved.
2
* Copyright (C) 2005-2012 VMware, Inc. All rights reserved.
4
4
* This program is free software; you can redistribute it and/or modify it
5
5
* under the terms of the GNU General Public License as published by the
99
99
* Queues with pre-mapped data pages must be small, so that we don't pin
100
100
* too much kernel memory (especially on vmkernel). We limit a queuepair to
101
101
* 32 KB, or 16 KB per queue for symmetrical pairs.
103
* XXX, we are raising this limit to 4MB to support high-throughput workloads
104
* with vioi-filter. Once we switch to rings instead of queuepairs for the
105
* page channel, we will drop this limit again. See PR 852983.
103
#define VMCI_MAX_PINNED_QP_MEMORY (32 * 1024)
107
#define VMCI_MAX_PINNED_QP_MEMORY (4 * 1024 * 1024)
106
110
* We have a fixed set of resource IDs available in the VMX.
143
147
#define VMCI_RPC_PRIVILEGED 15
144
148
#define VMCI_RPC_UNPRIVILEGED 16
145
149
#define VMCI_RESOURCE_MAX 17
151
* The core VMCI device functionality only requires the resource IDs of
152
* VMCI_QUEUEPAIR_DETACH and below.
154
#define VMCI_CORE_DEVICE_RESOURCE_MAX VMCI_QUEUEPAIR_DETACH
157
* VMCI reserved host datagram resource IDs.
158
* vsock control channel has resource id 1.
160
#define VMCI_DVFILTER_DATA_PATH_DATAGRAM 2
148
163
typedef uint32 VMCIId;
165
typedef struct VMCIIdRange {
150
170
typedef struct VMCIHandle {
851
* Defines for the VMCI traffic filter:
852
* - VMCI_FP_<name> defines the filter protocol values
853
* - VMCI_FD_<name> defines the direction values (guest or host)
854
* - VMCI_FT_<name> are the type values (allow or deny)
857
#define VMCI_FP_INVALID -1
858
#define VMCI_FP_HYPERVISOR 0
859
#define VMCI_FP_QUEUEPAIR (VMCI_FP_HYPERVISOR + 1)
860
#define VMCI_FP_DOORBELL (VMCI_FP_QUEUEPAIR + 1)
861
#define VMCI_FP_DATAGRAM (VMCI_FP_DOORBELL + 1)
862
#define VMCI_FP_STREAMSOCK (VMCI_FP_DATAGRAM + 1)
863
#define VMCI_FP_SEQPACKET (VMCI_FP_STREAMSOCK + 1)
864
#define VMCI_FP_MAX (VMCI_FP_SEQPACKET + 1)
866
#define VMCI_FD_INVALID -1
867
#define VMCI_FD_GUEST 0
868
#define VMCI_FD_HOST (VMCI_FD_GUEST + 1)
869
#define VMCI_FD_MAX (VMCI_FD_HOST + 1)
871
#define VMCI_FT_INVALID -1
872
#define VMCI_FT_ALLOW 0
873
#define VMCI_FT_DENY (VMCI_FT_ALLOW + 1)
874
#define VMCI_FT_MAX (VMCI_FT_DENY + 1)
877
* The filter list tracks VMCI Id ranges for a given filter.
887
* The filter info is used to communicate the filter configuration
888
* from the VMX to the host kernel.
892
VA64 list; // List of VMCIIdRange
893
uint32 len; // Length of list
894
uint8 dir; // VMCI_FD_X
895
uint8 proto; // VMCI_FP_X
896
uint8 type; // VMCI_FT_X
900
* In the host kernel, the ingoing and outgoing filters are
901
* separated. The VMCIProtoFilters type captures all filters in one
902
* direction. The VMCIFilters type captures all filters.
905
typedef VMCIFilterList VMCIProtoFilters[VMCI_FP_MAX][VMCI_FT_MAX];
906
typedef VMCIProtoFilters VMCIFilters[VMCI_FD_MAX];