tcp: make syn-rcvd timeout configurable
[vpp.git] / src / plugins / rdma / CMakeLists.txt
1 # Copyright (c) 2018 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 vpp_find_path(IBVERBS_INCLUDE_DIR NAMES infiniband/verbs.h)
15
16 if (NOT IBVERBS_INCLUDE_DIR)
17   message(WARNING "-- rdma headers not found - rdma plugin disabled")
18   return()
19 endif()
20
21 vpp_plugin_find_library(rdma IBVERBS_LIB libibverbs.a)
22 vpp_plugin_find_library(rdma MLX5_LIB libmlx5.a)
23
24 if (NOT IBVERBS_LIB OR NOT MLX5_LIB)
25   message(WARNING "rdma plugin - ibverbs not found - rdma plugin disabled")
26   return()
27 endif()
28
29 string_append(RDMA_LINK_FLAGS "-Wl,--whole-archive,${MLX5_LIB},--no-whole-archive -Wl,--exclude-libs,ALL")
30
31 set(CMAKE_REQUIRED_FLAGS "-fPIC -shared -pthread -Wno-unused-command-line-argument ${RDMA_LINK_FLAGS} ${IBVERBS_LIB}")
32 set(CMAKE_REQUIRED_INCLUDES "${IBVERBS_INCLUDE_DIR}")
33 set(CMAKE_REQUIRED_LIBRARIES "c") # force linkage by including libc explicitely
34 CHECK_C_SOURCE_COMPILES("
35 #include <infiniband/verbs.h>
36 int main(void)
37 {
38     return 0 != ibv_get_device_list(0);
39 }" IBVERBS_COMPILES_CHECK)
40
41 if (NOT IBVERBS_COMPILES_CHECK)
42   message(WARNING "rdma plugins - no working ibverbs found - rdma plugin disabled")
43   return()
44 endif()
45
46 include_directories(${IBVERBS_INCLUDE_DIR})
47
48 add_vpp_plugin(rdma
49   SOURCES
50   api.c
51   cli.c
52   device.c
53   format.c
54   plugin.c
55   unformat.c
56   input.c
57   output.c
58
59   MULTIARCH_SOURCES
60   input.c
61   output.c
62
63   API_FILES
64   rdma.api
65
66   API_TEST_SOURCES
67   unformat.c
68   test_api.c
69
70   LINK_FLAGS
71   "${RDMA_LINK_FLAGS}"
72
73   LINK_LIBRARIES
74   ${IBVERBS_LIB}
75 )