FD.io VPP
v19.04.2-12-g66b1689
Vector Packet Processing
Main Page
Related Pages
Modules
Namespaces
Data Structures
Source
Files
Symbols
rdma.h
Go to the documentation of this file.
1
/*
2
*------------------------------------------------------------------
3
* Copyright (c) 2018 Cisco and/or its affiliates.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at:
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*------------------------------------------------------------------
16
*/
17
18
#ifndef _RDMA_H_
19
#define _RDMA_H_
20
21
#include <infiniband/verbs.h>
22
#include <
vlib/log.h
>
23
24
#define foreach_rdma_device_flags \
25
_(0, INITIALIZED, "initialized") \
26
_(1, ERROR, "error") \
27
_(2, ADMIN_UP, "admin-up") \
28
_(3, VA_DMA, "vaddr-dma") \
29
_(4, LINK_UP, "link-up") \
30
_(5, SHARED_TXQ_LOCK, "shared-txq-lock") \
31
_(6, ELOG, "elog") \
32
33
enum
34
{
35
#define _(a, b, c) RDMA_DEVICE_F_##b = (1 << a),
36
foreach_rdma_device_flags
37
#undef _
38
};
39
40
typedef
struct
41
{
42
CLIB_CACHE_LINE_ALIGN_MARK
(cacheline0);
43
u32
size
;
44
u32
n_enq
;
45
struct
ibv_cq *
cq
;
46
struct
ibv_wq *
wq
;
47
}
rdma_rxq_t
;
48
49
typedef
struct
50
{
51
CLIB_CACHE_LINE_ALIGN_MARK
(cacheline0);
52
u32
size
;
53
u32
n_enq
;
54
struct
ibv_cq *
cq
;
55
struct
ibv_qp *
qp
;
56
clib_spinlock_t
lock
;
57
}
rdma_txq_t
;
58
59
typedef
struct
60
{
61
CLIB_CACHE_LINE_ALIGN_MARK
(cacheline0);
62
u32
flags
;
63
u32
per_interface_next_index
;
64
65
u32
dev_instance
;
66
u32
sw_if_index
;
67
u32
hw_if_index
;
68
69
u32
async_event_clib_file_index
;
70
71
rdma_rxq_t
*
rxqs
;
72
rdma_txq_t
*
txqs
;
73
74
u8
*
name
;
75
mac_address_t
hwaddr
;
76
vlib_pci_addr_t
pci_addr
;
77
78
struct
ibv_context *
ctx
;
79
struct
ibv_pd *
pd
;
80
struct
ibv_mr *
mr
;
81
struct
ibv_qp *
rx_qp
;
82
struct
ibv_rwq_ind_table *
rx_rwq_ind_tbl
;
83
struct
ibv_flow *
flow_ucast
;
84
struct
ibv_flow *
flow_mcast
;
85
86
/* error */
87
clib_error_t
*
error
;
88
}
rdma_device_t
;
89
90
typedef
struct
91
{
92
rdma_device_t
*
devices
;
93
vlib_log_class_t
log_class
;
94
}
rdma_main_t
;
95
96
extern
rdma_main_t
rdma_main
;
97
98
typedef
struct
99
{
100
u8
*
ifname
;
101
u8
*
name
;
102
u32
rxq_size
;
103
u32
txq_size
;
104
u32
rxq_num
;
105
106
/* return */
107
int
rv
;
108
u32
sw_if_index
;
109
clib_error_t
*
error
;
110
}
rdma_create_if_args_t
;
111
112
void
rdma_create_if
(
vlib_main_t
*
vm
,
rdma_create_if_args_t
* args);
113
void
rdma_delete_if
(
vlib_main_t
*
vm
,
rdma_device_t
* rd);
114
115
extern
vlib_node_registration_t
rdma_input_node
;
116
extern
vnet_device_class_t
rdma_device_class
;
117
118
/* format.c */
119
format_function_t
format_rdma_device
;
120
format_function_t
format_rdma_device_name
;
121
format_function_t
format_rdma_input_trace
;
122
123
typedef
struct
124
{
125
u32
next_index
;
126
u32
hw_if_index
;
127
}
rdma_input_trace_t
;
128
129
#define foreach_rdma_tx_func_error \
130
_(NO_FREE_SLOTS, "no free tx slots")
131
132
typedef
enum
133
{
134
#define _(f,s) RDMA_TX_ERROR_##f,
135
foreach_rdma_tx_func_error
136
#undef _
137
RDMA_TX_N_ERROR
,
138
}
rdma_tx_func_error_t
;
139
140
#endif
/* AVF_H */
141
142
/*
143
* fd.io coding-style-patch-verification: ON
144
*
145
* Local Variables:
146
* eval: (c-set-style "gnu")
147
* End:
148
*/
rdma_device_t::mr
struct ibv_mr * mr
Definition:
rdma.h:80
CLIB_CACHE_LINE_ALIGN_MARK
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition:
cache.h:60
rdma_delete_if
void rdma_delete_if(vlib_main_t *vm, rdma_device_t *rd)
Definition:
device.c:603
format_rdma_device
format_function_t format_rdma_device
Definition:
rdma.h:119
rdma_create_if
void rdma_create_if(vlib_main_t *vm, rdma_create_if_args_t *args)
Definition:
device.c:481
rdma_rxq_t::size
u32 size
Definition:
rdma.h:43
rdma_device_t::dev_instance
u32 dev_instance
Definition:
rdma.h:65
rdma_rxq_t::wq
struct ibv_wq * wq
Definition:
rdma.h:46
rdma_txq_t::size
u32 size
Definition:
rdma.h:52
rdma_input_trace_t::hw_if_index
u32 hw_if_index
Definition:
rdma.h:126
rdma_device_t::per_interface_next_index
u32 per_interface_next_index
Definition:
rdma.h:63
format_rdma_input_trace
format_function_t format_rdma_input_trace
Definition:
rdma.h:121
rdma_create_if_args_t::sw_if_index
u32 sw_if_index
Definition:
rdma.h:108
format_function_t
u8 *( format_function_t)(u8 *s, va_list *args)
Definition:
format.h:48
rdma_main
rdma_main_t rdma_main
Definition:
device.c:46
rdma_device_t
Definition:
rdma.h:59
rdma_input_trace_t::next_index
u32 next_index
Definition:
rdma.h:125
vnet_device_class_t
struct _vnet_device_class vnet_device_class_t
rdma_device_t::hwaddr
mac_address_t hwaddr
Definition:
rdma.h:75
u8
unsigned char u8
Definition:
types.h:56
rdma_txq_t::lock
clib_spinlock_t lock
Definition:
rdma.h:56
rdma_device_t::pci_addr
vlib_pci_addr_t pci_addr
Definition:
rdma.h:76
rdma_main_t::log_class
vlib_log_class_t log_class
Definition:
rdma.h:93
rdma_create_if_args_t::rxq_num
u32 rxq_num
Definition:
rdma.h:104
vlib_log_class_t
u32 vlib_log_class_t
Definition:
vlib.h:50
rdma_device_t::pd
struct ibv_pd * pd
Definition:
rdma.h:79
rdma_main_t::devices
rdma_device_t * devices
Definition:
rdma.h:92
rdma_txq_t::cq
struct ibv_cq * cq
Definition:
rdma.h:54
RDMA_TX_N_ERROR
Definition:
rdma.h:137
rdma_create_if_args_t::rxq_size
u32 rxq_size
Definition:
rdma.h:102
u32
unsigned int u32
Definition:
types.h:88
rdma_device_t::flags
u32 flags
Definition:
rdma.h:62
rdma_create_if_args_t::txq_size
u32 txq_size
Definition:
rdma.h:103
rdma_txq_t::n_enq
u32 n_enq
Definition:
rdma.h:53
rdma_rxq_t::cq
struct ibv_cq * cq
Definition:
rdma.h:45
rdma_main_t
Definition:
rdma.h:90
rdma_txq_t::qp
struct ibv_qp * qp
Definition:
rdma.h:55
mac_address_t_
Definition:
mac_address.h:21
rdma_input_trace_t
Definition:
rdma.h:123
rdma_device_t::hw_if_index
u32 hw_if_index
Definition:
rdma.h:67
rdma_device_t::rx_rwq_ind_tbl
struct ibv_rwq_ind_table * rx_rwq_ind_tbl
Definition:
rdma.h:82
rdma_device_t::error
clib_error_t * error
Definition:
rdma.h:87
vm
vlib_main_t * vm
Definition:
buffer.c:312
rdma_create_if_args_t::error
clib_error_t * error
Definition:
rdma.h:109
rdma_create_if_args_t::ifname
u8 * ifname
Definition:
rdma.h:100
rdma_create_if_args_t
Definition:
rdma.h:98
clib_spinlock_t
Definition:
lock.h:45
rdma_input_node
vlib_node_registration_t rdma_input_node
(constructor) VLIB_REGISTER_NODE (rdma_input_node)
Definition:
input.c:358
rdma_device_t::sw_if_index
u32 sw_if_index
Definition:
rdma.h:66
format_rdma_device_name
format_function_t format_rdma_device_name
Definition:
rdma.h:120
rdma_txq_t
Definition:
rdma.h:49
rdma_device_t::name
u8 * name
Definition:
rdma.h:74
rdma_device_t::txqs
rdma_txq_t * txqs
Definition:
rdma.h:72
rdma_create_if_args_t::name
u8 * name
Definition:
rdma.h:101
rdma_device_t::rxqs
rdma_rxq_t * rxqs
Definition:
rdma.h:71
rdma_device_class
vnet_device_class_t rdma_device_class
rdma_tx_func_error_t
rdma_tx_func_error_t
Definition:
rdma.h:132
clib_error_t
Definition:
clib_error.h:21
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
rdma_rxq_t
Definition:
rdma.h:40
rdma_device_t::async_event_clib_file_index
u32 async_event_clib_file_index
Definition:
rdma.h:69
vlib_main_t
Definition:
main.h:68
rdma_create_if_args_t::rv
int rv
Definition:
rdma.h:107
foreach_rdma_tx_func_error
#define foreach_rdma_tx_func_error
Definition:
rdma.h:129
foreach_rdma_device_flags
#define foreach_rdma_device_flags
Definition:
rdma.h:24
rdma_device_t::flow_ucast
struct ibv_flow * flow_ucast
Definition:
rdma.h:83
log.h
rdma_device_t::flow_mcast
struct ibv_flow * flow_mcast
Definition:
rdma.h:84
rdma_device_t::ctx
struct ibv_context * ctx
Definition:
rdma.h:78
rdma_device_t::rx_qp
struct ibv_qp * rx_qp
Definition:
rdma.h:81
rdma_rxq_t::n_enq
u32 n_enq
Definition:
rdma.h:44
src
plugins
rdma
rdma.h
Generated on Wed Oct 16 2019 18:54:37 for FD.io VPP by
1.8.11