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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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 *------------------------------------------------------------------
21 #include <infiniband/verbs.h>
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") \
35 #define _(a, b, c) RDMA_DEVICE_F_##b = (1 << a),
36 foreach_rdma_device_flags
42 CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
51 CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
61 CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
63 u32 per_interface_next_index;
69 u32 async_event_clib_file_index;
75 vlib_pci_addr_t pci_addr;
77 struct ibv_context *ctx;
80 struct ibv_flow *flow_ucast;
81 struct ibv_flow *flow_mcast;
89 rdma_device_t *devices;
90 vlib_log_class_t log_class;
93 extern rdma_main_t rdma_main;
103 } rdma_create_if_args_t;
105 void rdma_create_if (vlib_main_t * vm, rdma_create_if_args_t * args);
106 void rdma_delete_if (vlib_main_t * vm, rdma_device_t * rd);
108 extern vlib_node_registration_t rdma_input_node;
109 extern vnet_device_class_t rdma_device_class;
112 format_function_t format_rdma_device;
113 format_function_t format_rdma_device_name;
114 format_function_t format_rdma_input_trace;
120 } rdma_input_trace_t;
122 #define foreach_rdma_tx_func_error \
123 _(NO_FREE_SLOTS, "no free tx slots")
127 #define _(f,s) RDMA_TX_ERROR_##f,
128 foreach_rdma_tx_func_error
131 } rdma_tx_func_error_t;
136 * fd.io coding-style-patch-verification: ON
139 * eval: (c-set-style "gnu")