~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to modules/linux/shared/vmci_defs.h

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-06-20 15:59:51 UTC
  • mfrom: (1.4.8)
  • Revision ID: package-import@ubuntu.com-20120620155951-6rupmpb0f70b52zr
Tags: 2012.05.21-724730-0ubuntu1
* Merging upstream version 2012.05.21-724730.
  - Fixes building against the current Quantal kernel. (LP: #1000344)
  - Fixes Quantal installation issues. (LP: #1019031)

* Sync with Debian
  - Updating to debhelper version 9.
  - Updating to standards version 3.9.3.
  - Updating copyright file machine-readable format version 1.0.
  - Building without multiarch paths for now

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*********************************************************
2
 
 * Copyright (C) 2005-2011 VMware, Inc. All rights reserved.
 
2
 * Copyright (C) 2005-2012 VMware, Inc. All rights reserved.
3
3
 *
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.
 
102
 *
 
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.
102
106
 */
103
 
#define VMCI_MAX_PINNED_QP_MEMORY (32 * 1024)
 
107
#define VMCI_MAX_PINNED_QP_MEMORY (4 * 1024 * 1024)
104
108
 
105
109
/*
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
 
150
/*
 
151
 * The core VMCI device functionality only requires the resource IDs of
 
152
 * VMCI_QUEUEPAIR_DETACH and below.
 
153
 */
 
154
#define VMCI_CORE_DEVICE_RESOURCE_MAX  VMCI_QUEUEPAIR_DETACH
 
155
 
 
156
/*
 
157
 * VMCI reserved host datagram resource IDs.
 
158
 * vsock control channel has resource id 1.
 
159
 */
 
160
#define VMCI_DVFILTER_DATA_PATH_DATAGRAM 2
146
161
 
147
162
/* VMCI Ids. */
148
163
typedef uint32 VMCIId;
149
164
 
 
165
typedef struct VMCIIdRange {
 
166
   VMCIId begin;
 
167
   VMCIId end;
 
168
} VMCIIdRange;
 
169
 
150
170
typedef struct VMCIHandle {
151
171
   VMCIId context;
152
172
   VMCIId resource;
827
847
}
828
848
 
829
849
 
 
850
/*
 
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)
 
855
 */
 
856
 
 
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)
 
865
 
 
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)
 
870
 
 
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)
 
875
 
 
876
/*
 
877
 * The filter list tracks VMCI Id ranges for a given filter.
 
878
 */
 
879
 
 
880
typedef struct {
 
881
   uint32 len;
 
882
   VMCIIdRange *list;
 
883
} VMCIFilterList;
 
884
 
 
885
 
 
886
/*
 
887
 * The filter info is used to communicate the filter configuration
 
888
 * from the VMX to the host kernel.
 
889
 */
 
890
 
 
891
typedef struct {
 
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
 
897
} VMCIFilterInfo;
 
898
 
 
899
/*
 
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.
 
903
 */
 
904
 
 
905
typedef VMCIFilterList VMCIProtoFilters[VMCI_FP_MAX][VMCI_FT_MAX];
 
906
typedef VMCIProtoFilters VMCIFilters[VMCI_FD_MAX];
 
907
 
830
908
#endif
831