NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_types.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
3  *
4  * This software product is a proprietary product of NVIDIA CORPORATION &
5  * AFFILIATES (the "Company") and all right, title, and interest in and to the
6  * software product, including all associated intellectual property rights, are
7  * and shall remain exclusively with the Company.
8  *
9  * This software product is governed by the End User License Agreement
10  * provided with the software product.
11  *
12  */
13 
24 #ifndef DOCA_TYPES_H_
25 #define DOCA_TYPES_H_
26 
27 #include <stdint.h>
28 
29 #ifdef __linux__
30 #include <linux/types.h>
31 #endif
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #ifdef __linux__
39 typedef int doca_event_handle_t;
40 #define doca_event_invalid_handle -1
41 #else /* Windows*/
42 typedef void *doca_event_handle_t;
43 #define doca_event_invalid_handle INVALID_HANDLE_VALUE
44 #endif
45 
49 #define DOCA_GID_BYTE_LENGTH 16
50 
56 union doca_data {
57  void *ptr;
58  uint64_t u64;
59 };
60 
65  void *addr;
66  uint64_t len;
68 };
69 
82  DOCA_ACCESS_FLAG_LOCAL_READ_ONLY = 0, /* Allows reading buffer by a local device but no write */
83  DOCA_ACCESS_FLAG_LOCAL_READ_WRITE = (1 << 0), /* Allows reading and writing to buffer by a local device */
84  DOCA_ACCESS_FLAG_RDMA_READ = (1 << 1), /* Allows reading buffer by a remote device using RDMA */
85  DOCA_ACCESS_FLAG_RDMA_WRITE = (1 << 2), /* Allows writing to buffer by a remote device using RDMA */
86  DOCA_ACCESS_FLAG_RDMA_ATOMIC = (1 << 3), /* Allows atomic operations by remote device using RDMA */
99 };
100 
106  DOCA_PCI_FUNC_TYPE_PF = 0, /* physical function */
107  DOCA_PCI_FUNC_TYPE_VF, /* virtual function */
108  DOCA_PCI_FUNC_TYPE_SF, /* sub function */
109 };
110 
115 #ifdef __linux__
116 typedef __be16 doca_be16_t;
117 typedef __be32 doca_be32_t;
118 typedef __be64 doca_be64_t;
119 #else /* Windows */
120 typedef uint16_t doca_be16_t;
121 typedef uint32_t doca_be32_t;
122 typedef uint64_t doca_be64_t;
123 #endif
124 
130  /* GPU memory not accessible from CPU. */
132  /* GPU memory with direct access from CPU. */
134  /* CPU memory with direct access from GPU. */
136 };
137 
143  /* Wait on time not supported. */
145  /* Wait on time supported by HW. */
147  /* Wait on time supported by SW. */
149 };
150 
160  DOCA_MTU_SIZE_RAW_ETHERNET = 0x5, /* Reserved */
161 };
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
169 #endif /* DOCA_TYPES_H_ */
uint32_t __be32
uint64_t __be64
uint16_t __be16
doca_event_handle_t doca_notification_handle_t
Definition: doca_types.h:51
uint32_t doca_be32_t
Definition: doca_types.h:121
doca_mtu_size
MTU size in bytes.
Definition: doca_types.h:154
doca_gpu_mem_type
Type of memory the GPUNetIO library can allocate.
Definition: doca_types.h:129
uint64_t doca_be64_t
Definition: doca_types.h:122
void * doca_event_handle_t
Definition: doca_types.h:42
doca_access_flag
Specifies the permission level for DOCA buffer.
Definition: doca_types.h:81
doca_eth_wait_on_time_type
Type of wait on time the network card can support.
Definition: doca_types.h:142
doca_pci_func_type
Specifies the PCI function type for DOCA representor device.
Definition: doca_types.h:105
uint16_t doca_be16_t
Declare DOCA endianity types.
Definition: doca_types.h:120
@ DOCA_MTU_SIZE_512_BYTES
Definition: doca_types.h:156
@ DOCA_MTU_SIZE_2K_BYTES
Definition: doca_types.h:158
@ DOCA_MTU_SIZE_4K_BYTES
Definition: doca_types.h:159
@ DOCA_MTU_SIZE_256_BYTES
Definition: doca_types.h:155
@ DOCA_MTU_SIZE_1K_BYTES
Definition: doca_types.h:157
@ DOCA_MTU_SIZE_RAW_ETHERNET
Definition: doca_types.h:160
@ DOCA_GPU_MEM_TYPE_CPU_GPU
Definition: doca_types.h:135
@ DOCA_GPU_MEM_TYPE_GPU_CPU
Definition: doca_types.h:133
@ DOCA_GPU_MEM_TYPE_GPU
Definition: doca_types.h:131
@ DOCA_ACCESS_FLAG_LOCAL_READ_WRITE
Definition: doca_types.h:83
@ DOCA_ACCESS_FLAG_RDMA_READ
Definition: doca_types.h:84
@ DOCA_ACCESS_FLAG_PCI_RELAXED_ORDERING
Definition: doca_types.h:95
@ DOCA_ACCESS_FLAG_LOCAL_READ_ONLY
Definition: doca_types.h:82
@ DOCA_ACCESS_FLAG_PCI_READ_WRITE
Definition: doca_types.h:91
@ DOCA_ACCESS_FLAG_PCI_READ_ONLY
Definition: doca_types.h:87
@ DOCA_ACCESS_FLAG_RDMA_ATOMIC
Definition: doca_types.h:86
@ DOCA_ACCESS_FLAG_RDMA_WRITE
Definition: doca_types.h:85
@ DOCA_ETH_WAIT_ON_TIME_TYPE_NATIVE
Definition: doca_types.h:146
@ DOCA_ETH_WAIT_ON_TIME_TYPE_DPDK
Definition: doca_types.h:148
@ DOCA_ETH_WAIT_ON_TIME_TYPE_NONE
Definition: doca_types.h:144
@ DOCA_PCI_FUNC_TYPE_PF
Definition: doca_types.h:106
@ DOCA_PCI_FUNC_TYPE_VF
Definition: doca_types.h:107
@ DOCA_PCI_FUNC_TYPE_SF
Definition: doca_types.h:108
Struct to represent a gather list.
Definition: doca_types.h:64
struct doca_gather_list * next
Definition: doca_types.h:67
uint64_t len
Definition: doca_types.h:66
Convenience type for representing opaque data.
Definition: doca_types.h:56
uint64_t u64
Definition: doca_types.h:58
void * ptr
Definition: doca_types.h:57