net/mlx5: add representor recognition on Linux 5.x
[dpdk.git] / drivers / net / mlx5 / Makefile
1 #   SPDX-License-Identifier: BSD-3-Clause
2 #   Copyright 2015 6WIND S.A.
3 #   Copyright 2015 Mellanox Technologies, Ltd
4
5 include $(RTE_SDK)/mk/rte.vars.mk
6
7 # Library name.
8 LIB = librte_pmd_mlx5.a
9 LIB_GLUE = $(LIB_GLUE_BASE).$(LIB_GLUE_VERSION)
10 LIB_GLUE_BASE = librte_pmd_mlx5_glue.so
11 LIB_GLUE_VERSION = 19.02.0
12
13 # Sources.
14 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5.c
15 ifneq ($(CONFIG_RTE_IBVERBS_LINK_DLOPEN),y)
16 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_glue.c
17 endif
18 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_rxq.c
19 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_txq.c
20 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_rxtx.c
21 ifneq ($(filter y,$(CONFIG_RTE_ARCH_X86_64) \
22                   $(CONFIG_RTE_ARCH_ARM64)),)
23 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_rxtx_vec.c
24 endif
25 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_trigger.c
26 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_ethdev.c
27 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_mac.c
28 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_rxmode.c
29 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_vlan.c
30 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_stats.c
31 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_rss.c
32 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_mr.c
33 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_flow.c
34 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_flow_dv.c
35 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_flow_tcf.c
36 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_flow_verbs.c
37 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_socket.c
38 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_nl.c
39 SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5_devx_cmds.c
40
41 ifeq ($(CONFIG_RTE_IBVERBS_LINK_DLOPEN),y)
42 INSTALL-$(CONFIG_RTE_LIBRTE_MLX5_PMD)-lib += $(LIB_GLUE)
43 endif
44
45 # Basic CFLAGS.
46 CFLAGS += -O3
47 CFLAGS += -std=c11 -Wall -Wextra
48 CFLAGS += -g
49 CFLAGS += -I.
50 CFLAGS += -D_BSD_SOURCE
51 CFLAGS += -D_DEFAULT_SOURCE
52 CFLAGS += -D_XOPEN_SOURCE=600
53 CFLAGS += $(WERROR_FLAGS)
54 CFLAGS += -Wno-strict-prototypes
55 CFLAGS += $(shell command -v pkg-config > /dev/null 2>&1 && pkg-config --cflags libmnl)
56 ifeq ($(CONFIG_RTE_IBVERBS_LINK_DLOPEN),y)
57 CFLAGS += -DMLX5_GLUE='"$(LIB_GLUE)"'
58 CFLAGS += -DMLX5_GLUE_VERSION='"$(LIB_GLUE_VERSION)"'
59 CFLAGS_mlx5_glue.o += -fPIC
60 LDLIBS += -ldl
61 else ifeq ($(CONFIG_RTE_IBVERBS_LINK_STATIC),y)
62 LDLIBS += $(shell $(RTE_SDK)/buildtools/options-ibverbs-static.sh)
63 else
64 LDLIBS += -libverbs -lmlx5
65 endif
66 LDLIBS += $(shell command -v pkg-config > /dev/null 2>&1 && pkg-config --libs libmnl || echo "-lmnl")
67 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
68 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
69 LDLIBS += -lrte_bus_pci
70
71 # A few warnings cannot be avoided in external headers.
72 CFLAGS += -Wno-error=cast-qual
73
74 EXPORT_MAP := rte_pmd_mlx5_version.map
75 LIBABIVER := 1
76
77 # memseg walk is not part of stable API
78 CFLAGS += -DALLOW_EXPERIMENTAL_API
79
80 # DEBUG which is usually provided on the command-line may enable
81 # CONFIG_RTE_LIBRTE_MLX5_DEBUG.
82 ifeq ($(DEBUG),1)
83 CONFIG_RTE_LIBRTE_MLX5_DEBUG := y
84 endif
85
86 # User-defined CFLAGS.
87 ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DEBUG),y)
88 CFLAGS += -pedantic -UNDEBUG -DPEDANTIC
89 else
90 CFLAGS += -DNDEBUG -UPEDANTIC
91 endif
92
93 include $(RTE_SDK)/mk/rte.lib.mk
94
95 # Generate and clean-up mlx5_autoconf.h.
96
97 export CC CFLAGS CPPFLAGS EXTRA_CFLAGS EXTRA_CPPFLAGS
98 export AUTO_CONFIG_CFLAGS = -Wno-error
99
100 ifndef V
101 AUTOCONF_OUTPUT := >/dev/null
102 endif
103
104 mlx5_autoconf.h.new: FORCE
105
106 mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
107         $Q $(RM) -f -- '$@'
108         $Q sh -- '$<' '$@' \
109                 HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT \
110                 infiniband/mlx5dv.h \
111                 enum MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX \
112                 $(AUTOCONF_OUTPUT)
113         $Q sh -- '$<' '$@' \
114                 HAVE_IBV_DEVICE_TUNNEL_SUPPORT \
115                 infiniband/mlx5dv.h \
116                 enum MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS \
117                 $(AUTOCONF_OUTPUT)
118         $Q sh -- '$<' '$@' \
119                 HAVE_IBV_DEVICE_MPLS_SUPPORT \
120                 infiniband/verbs.h \
121                 enum IBV_FLOW_SPEC_MPLS \
122                 $(AUTOCONF_OUTPUT)
123         $Q sh -- '$<' '$@' \
124                 HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING \
125                 infiniband/verbs.h \
126                 enum IBV_WQ_FLAGS_PCI_WRITE_END_PADDING \
127                 $(AUTOCONF_OUTPUT)
128         $Q sh -- '$<' '$@' \
129                 HAVE_IBV_WQ_FLAG_RX_END_PADDING \
130                 infiniband/verbs.h \
131                 enum IBV_WQ_FLAG_RX_END_PADDING \
132                 $(AUTOCONF_OUTPUT)
133         $Q sh -- '$<' '$@' \
134                 HAVE_IBV_MLX5_MOD_SWP \
135                 infiniband/mlx5dv.h \
136                 type 'struct mlx5dv_sw_parsing_caps' \
137                 $(AUTOCONF_OUTPUT)
138         $Q sh -- '$<' '$@' \
139                 HAVE_IBV_MLX5_MOD_MPW \
140                 infiniband/mlx5dv.h \
141                 enum MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED \
142                 $(AUTOCONF_OUTPUT)
143         $Q sh -- '$<' '$@' \
144                 HAVE_IBV_MLX5_MOD_CQE_128B_COMP \
145                 infiniband/mlx5dv.h \
146                 enum MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP \
147                 $(AUTOCONF_OUTPUT)
148         $Q sh -- '$<' '$@' \
149                 HAVE_IBV_MLX5_MOD_CQE_128B_PAD \
150                 infiniband/mlx5dv.h \
151                 enum MLX5DV_CQ_INIT_ATTR_FLAGS_CQE_PAD \
152                 $(AUTOCONF_OUTPUT)
153         $Q sh -- '$<' '$@' \
154                 HAVE_IBV_FLOW_DV_SUPPORT \
155                 infiniband/mlx5dv.h \
156                 func mlx5dv_create_flow_action_packet_reformat \
157                 $(AUTOCONF_OUTPUT)
158         $Q sh -- '$<' '$@' \
159                 HAVE_IBV_DEVX_OBJ \
160                 infiniband/mlx5dv.h \
161                 func mlx5dv_devx_obj_create \
162                 $(AUTOCONF_OUTPUT)
163         $Q sh -- '$<' '$@' \
164                 HAVE_IBV_FLOW_DEVX_COUNTERS \
165                 infiniband/mlx5dv.h \
166                 enum MLX5DV_FLOW_ACTION_COUNTER_DEVX \
167                 $(AUTOCONF_OUTPUT)
168         $Q sh -- '$<' '$@' \
169                 HAVE_ETHTOOL_LINK_MODE_25G \
170                 /usr/include/linux/ethtool.h \
171                 enum ETHTOOL_LINK_MODE_25000baseCR_Full_BIT \
172                 $(AUTOCONF_OUTPUT)
173         $Q sh -- '$<' '$@' \
174                 HAVE_ETHTOOL_LINK_MODE_50G \
175                 /usr/include/linux/ethtool.h \
176                 enum ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT \
177                 $(AUTOCONF_OUTPUT)
178         $Q sh -- '$<' '$@' \
179                 HAVE_ETHTOOL_LINK_MODE_100G \
180                 /usr/include/linux/ethtool.h \
181                 enum ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT \
182                 $(AUTOCONF_OUTPUT)
183         $Q sh -- '$<' '$@' \
184                 HAVE_IBV_DEVICE_COUNTERS_SET_V42 \
185                 infiniband/verbs.h \
186                 type 'struct ibv_counter_set_init_attr' \
187                 $(AUTOCONF_OUTPUT)
188         $Q sh -- '$<' '$@' \
189                 HAVE_IBV_DEVICE_COUNTERS_SET_V45 \
190                 infiniband/verbs.h \
191                 type 'struct ibv_counters_init_attr' \
192                 $(AUTOCONF_OUTPUT)
193         $Q sh -- '$<' '$@' \
194                 HAVE_RDMA_NL_NLDEV \
195                 rdma/rdma_netlink.h \
196                 enum RDMA_NL_NLDEV \
197                 $(AUTOCONF_OUTPUT)
198         $Q sh -- '$<' '$@' \
199                 HAVE_RDMA_NLDEV_CMD_GET \
200                 rdma/rdma_netlink.h \
201                 enum RDMA_NLDEV_CMD_GET \
202                 $(AUTOCONF_OUTPUT)
203         $Q sh -- '$<' '$@' \
204                 HAVE_RDMA_NLDEV_CMD_PORT_GET \
205                 rdma/rdma_netlink.h \
206                 enum RDMA_NLDEV_CMD_PORT_GET \
207                 $(AUTOCONF_OUTPUT)
208         $Q sh -- '$<' '$@' \
209                 HAVE_RDMA_NLDEV_ATTR_DEV_INDEX \
210                 rdma/rdma_netlink.h \
211                 enum RDMA_NLDEV_ATTR_DEV_INDEX \
212                 $(AUTOCONF_OUTPUT)
213         $Q sh -- '$<' '$@' \
214                 HAVE_RDMA_NLDEV_ATTR_DEV_NAME \
215                 rdma/rdma_netlink.h \
216                 enum RDMA_NLDEV_ATTR_DEV_NAME \
217                 $(AUTOCONF_OUTPUT)
218         $Q sh -- '$<' '$@' \
219                 HAVE_RDMA_NLDEV_ATTR_PORT_INDEX \
220                 rdma/rdma_netlink.h \
221                 enum RDMA_NLDEV_ATTR_PORT_INDEX \
222                 $(AUTOCONF_OUTPUT)
223         $Q sh -- '$<' '$@' \
224                 HAVE_RDMA_NLDEV_ATTR_NDEV_INDEX \
225                 rdma/rdma_netlink.h \
226                 enum RDMA_NLDEV_ATTR_NDEV_INDEX \
227                 $(AUTOCONF_OUTPUT)
228         $Q sh -- '$<' '$@' \
229                 HAVE_IFLA_NUM_VF \
230                 linux/if_link.h \
231                 enum IFLA_NUM_VF \
232                 $(AUTOCONF_OUTPUT)
233         $Q sh -- '$<' '$@' \
234                 HAVE_IFLA_EXT_MASK \
235                 linux/if_link.h \
236                 enum IFLA_EXT_MASK \
237                 $(AUTOCONF_OUTPUT)
238         $Q sh -- '$<' '$@' \
239                 HAVE_IFLA_PHYS_SWITCH_ID \
240                 linux/if_link.h \
241                 enum IFLA_PHYS_SWITCH_ID \
242                 $(AUTOCONF_OUTPUT)
243         $Q sh -- '$<' '$@' \
244                 HAVE_IFLA_PHYS_PORT_NAME \
245                 linux/if_link.h \
246                 enum IFLA_PHYS_PORT_NAME \
247                 $(AUTOCONF_OUTPUT)
248         $Q sh -- '$<' '$@' \
249                 HAVE_IFLA_VXLAN_COLLECT_METADATA \
250                 linux/if_link.h \
251                 enum IFLA_VXLAN_COLLECT_METADATA \
252                 $(AUTOCONF_OUTPUT)
253         $Q sh -- '$<' '$@' \
254                 HAVE_TCA_CHAIN \
255                 linux/rtnetlink.h \
256                 enum TCA_CHAIN \
257                 $(AUTOCONF_OUTPUT)
258         $Q sh -- '$<' '$@' \
259                 HAVE_TCA_FLOWER_ACT \
260                 linux/pkt_cls.h \
261                 enum TCA_FLOWER_ACT \
262                 $(AUTOCONF_OUTPUT)
263         $Q sh -- '$<' '$@' \
264                 HAVE_TCA_FLOWER_FLAGS \
265                 linux/pkt_cls.h \
266                 enum TCA_FLOWER_FLAGS \
267                 $(AUTOCONF_OUTPUT)
268         $Q sh -- '$<' '$@' \
269                 HAVE_TCA_FLOWER_KEY_ETH_TYPE \
270                 linux/pkt_cls.h \
271                 enum TCA_FLOWER_KEY_ETH_TYPE \
272                 $(AUTOCONF_OUTPUT)
273         $Q sh -- '$<' '$@' \
274                 HAVE_TCA_FLOWER_KEY_ETH_DST \
275                 linux/pkt_cls.h \
276                 enum TCA_FLOWER_KEY_ETH_DST \
277                 $(AUTOCONF_OUTPUT)
278         $Q sh -- '$<' '$@' \
279                 HAVE_TCA_FLOWER_KEY_ETH_DST_MASK \
280                 linux/pkt_cls.h \
281                 enum TCA_FLOWER_KEY_ETH_DST_MASK \
282                 $(AUTOCONF_OUTPUT)
283         $Q sh -- '$<' '$@' \
284                 HAVE_TCA_FLOWER_KEY_ETH_SRC \
285                 linux/pkt_cls.h \
286                 enum TCA_FLOWER_KEY_ETH_SRC \
287                 $(AUTOCONF_OUTPUT)
288         $Q sh -- '$<' '$@' \
289                 HAVE_TCA_FLOWER_KEY_ETH_SRC_MASK \
290                 linux/pkt_cls.h \
291                 enum TCA_FLOWER_KEY_ETH_SRC_MASK \
292                 $(AUTOCONF_OUTPUT)
293         $Q sh -- '$<' '$@' \
294                 HAVE_TCA_FLOWER_KEY_IP_PROTO \
295                 linux/pkt_cls.h \
296                 enum TCA_FLOWER_KEY_IP_PROTO \
297                 $(AUTOCONF_OUTPUT)
298         $Q sh -- '$<' '$@' \
299                 HAVE_TCA_FLOWER_KEY_IPV4_SRC \
300                 linux/pkt_cls.h \
301                 enum TCA_FLOWER_KEY_IPV4_SRC \
302                 $(AUTOCONF_OUTPUT)
303         $Q sh -- '$<' '$@' \
304                 HAVE_TCA_FLOWER_KEY_IPV4_SRC_MASK \
305                 linux/pkt_cls.h \
306                 enum TCA_FLOWER_KEY_IPV4_SRC_MASK \
307                 $(AUTOCONF_OUTPUT)
308         $Q sh -- '$<' '$@' \
309                 HAVE_TCA_FLOWER_KEY_IPV4_DST \
310                 linux/pkt_cls.h \
311                 enum TCA_FLOWER_KEY_IPV4_DST \
312                 $(AUTOCONF_OUTPUT)
313         $Q sh -- '$<' '$@' \
314                 HAVE_TCA_FLOWER_KEY_IPV4_DST_MASK \
315                 linux/pkt_cls.h \
316                 enum TCA_FLOWER_KEY_IPV4_DST_MASK \
317                 $(AUTOCONF_OUTPUT)
318         $Q sh -- '$<' '$@' \
319                 HAVE_TCA_FLOWER_KEY_IPV6_SRC \
320                 linux/pkt_cls.h \
321                 enum TCA_FLOWER_KEY_IPV6_SRC \
322                 $(AUTOCONF_OUTPUT)
323         $Q sh -- '$<' '$@' \
324                 HAVE_TCA_FLOWER_KEY_IPV6_SRC_MASK \
325                 linux/pkt_cls.h \
326                 enum TCA_FLOWER_KEY_IPV6_SRC_MASK \
327                 $(AUTOCONF_OUTPUT)
328         $Q sh -- '$<' '$@' \
329                 HAVE_TCA_FLOWER_KEY_IPV6_DST \
330                 linux/pkt_cls.h \
331                 enum TCA_FLOWER_KEY_IPV6_DST \
332                 $(AUTOCONF_OUTPUT)
333         $Q sh -- '$<' '$@' \
334                 HAVE_TCA_FLOWER_KEY_IPV6_DST_MASK \
335                 linux/pkt_cls.h \
336                 enum TCA_FLOWER_KEY_IPV6_DST_MASK \
337                 $(AUTOCONF_OUTPUT)
338         $Q sh -- '$<' '$@' \
339                 HAVE_TCA_FLOWER_KEY_TCP_SRC \
340                 linux/pkt_cls.h \
341                 enum TCA_FLOWER_KEY_TCP_SRC \
342                 $(AUTOCONF_OUTPUT)
343         $Q sh -- '$<' '$@' \
344                 HAVE_TCA_FLOWER_KEY_TCP_SRC_MASK \
345                 linux/pkt_cls.h \
346                 enum TCA_FLOWER_KEY_TCP_SRC_MASK \
347                 $(AUTOCONF_OUTPUT)
348         $Q sh -- '$<' '$@' \
349                 HAVE_TCA_FLOWER_KEY_TCP_DST \
350                 linux/pkt_cls.h \
351                 enum TCA_FLOWER_KEY_TCP_DST \
352                 $(AUTOCONF_OUTPUT)
353         $Q sh -- '$<' '$@' \
354                 HAVE_TCA_FLOWER_KEY_TCP_DST_MASK \
355                 linux/pkt_cls.h \
356                 enum TCA_FLOWER_KEY_TCP_DST_MASK \
357                 $(AUTOCONF_OUTPUT)
358         $Q sh -- '$<' '$@' \
359                 HAVE_TCA_FLOWER_KEY_UDP_SRC \
360                 linux/pkt_cls.h \
361                 enum TCA_FLOWER_KEY_UDP_SRC \
362                 $(AUTOCONF_OUTPUT)
363         $Q sh -- '$<' '$@' \
364                 HAVE_TCA_FLOWER_KEY_UDP_SRC_MASK \
365                 linux/pkt_cls.h \
366                 enum TCA_FLOWER_KEY_UDP_SRC_MASK \
367                 $(AUTOCONF_OUTPUT)
368         $Q sh -- '$<' '$@' \
369                 HAVE_TCA_FLOWER_KEY_UDP_DST \
370                 linux/pkt_cls.h \
371                 enum TCA_FLOWER_KEY_UDP_DST \
372                 $(AUTOCONF_OUTPUT)
373         $Q sh -- '$<' '$@' \
374                 HAVE_TCA_FLOWER_KEY_UDP_DST_MASK \
375                 linux/pkt_cls.h \
376                 enum TCA_FLOWER_KEY_UDP_DST_MASK \
377                 $(AUTOCONF_OUTPUT)
378         $Q sh -- '$<' '$@' \
379                 HAVE_TCA_FLOWER_KEY_VLAN_ID \
380                 linux/pkt_cls.h \
381                 enum TCA_FLOWER_KEY_VLAN_ID \
382                 $(AUTOCONF_OUTPUT)
383         $Q sh -- '$<' '$@' \
384                 HAVE_TCA_FLOWER_KEY_VLAN_PRIO \
385                 linux/pkt_cls.h \
386                 enum TCA_FLOWER_KEY_VLAN_PRIO \
387                 $(AUTOCONF_OUTPUT)
388         $Q sh -- '$<' '$@' \
389                 HAVE_TCA_FLOWER_KEY_VLAN_ETH_TYPE \
390                 linux/pkt_cls.h \
391                 enum TCA_FLOWER_KEY_VLAN_ETH_TYPE \
392                 $(AUTOCONF_OUTPUT)
393         $Q sh -- '$<' '$@' \
394                 HAVE_TCA_FLOWER_KEY_TCP_FLAGS \
395                 linux/pkt_cls.h \
396                 enum TCA_FLOWER_KEY_TCP_FLAGS \
397                 $(AUTOCONF_OUTPUT)
398         $Q sh -- '$<' '$@' \
399                 HAVE_TCA_FLOWER_KEY_TCP_FLAGS_MASK \
400                 linux/pkt_cls.h \
401                 enum TCA_FLOWER_KEY_TCP_FLAGS_MASK \
402                 $(AUTOCONF_OUTPUT)
403         $Q sh -- '$<' '$@' \
404                 HAVE_TCA_FLOWER_KEY_IP_TOS \
405                 linux/pkt_cls.h \
406                 enum TCA_FLOWER_KEY_IP_TOS \
407                 $(AUTOCONF_OUTPUT)
408         $Q sh -- '$<' '$@' \
409                 HAVE_TCA_FLOWER_KEY_IP_TOS_MASK \
410                 linux/pkt_cls.h \
411                 enum TCA_FLOWER_KEY_IP_TOS_MASK \
412                 $(AUTOCONF_OUTPUT)
413         $Q sh -- '$<' '$@' \
414                 HAVE_TCA_FLOWER_KEY_IP_TTL \
415                 linux/pkt_cls.h \
416                 enum TCA_FLOWER_KEY_IP_TTL \
417                 $(AUTOCONF_OUTPUT)
418         $Q sh -- '$<' '$@' \
419                 HAVE_TCA_FLOWER_KEY_IP_TTL_MASK \
420                 linux/pkt_cls.h \
421                 enum TCA_FLOWER_KEY_IP_TTL_MASK \
422                 $(AUTOCONF_OUTPUT)
423         $Q sh -- '$<' '$@' \
424                 HAVE_TC_ACT_GOTO_CHAIN \
425                 linux/pkt_cls.h \
426                 define TC_ACT_GOTO_CHAIN \
427                 $(AUTOCONF_OUTPUT)
428         $Q sh -- '$<' '$@' \
429                 HAVE_TC_ACT_VLAN \
430                 linux/tc_act/tc_vlan.h \
431                 enum TCA_VLAN_PUSH_VLAN_PRIORITY \
432                 $(AUTOCONF_OUTPUT)
433         $Q sh -- '$<' '$@' \
434                 HAVE_TCA_FLOWER_KEY_ENC_KEY_ID \
435                 linux/pkt_cls.h \
436                 enum TCA_FLOWER_KEY_ENC_KEY_ID \
437                 $(AUTOCONF_OUTPUT)
438         $Q sh -- '$<' '$@' \
439                 HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC \
440                 linux/pkt_cls.h \
441                 enum TCA_FLOWER_KEY_ENC_IPV4_SRC \
442                 $(AUTOCONF_OUTPUT)
443         $Q sh -- '$<' '$@' \
444                 HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK \
445                 linux/pkt_cls.h \
446                 enum TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK \
447                 $(AUTOCONF_OUTPUT)
448         $Q sh -- '$<' '$@' \
449                 HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST \
450                 linux/pkt_cls.h \
451                 enum TCA_FLOWER_KEY_ENC_IPV4_DST \
452                 $(AUTOCONF_OUTPUT)
453         $Q sh -- '$<' '$@' \
454                 HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST_MASK \
455                 linux/pkt_cls.h \
456                 enum TCA_FLOWER_KEY_ENC_IPV4_DST_MASK \
457                 $(AUTOCONF_OUTPUT)
458         $Q sh -- '$<' '$@' \
459                 HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC \
460                 linux/pkt_cls.h \
461                 enum TCA_FLOWER_KEY_ENC_IPV6_SRC \
462                 $(AUTOCONF_OUTPUT)
463         $Q sh -- '$<' '$@' \
464                 HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK \
465                 linux/pkt_cls.h \
466                 enum TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK \
467                 $(AUTOCONF_OUTPUT)
468         $Q sh -- '$<' '$@' \
469                 HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST \
470                 linux/pkt_cls.h \
471                 enum TCA_FLOWER_KEY_ENC_IPV6_DST \
472                 $(AUTOCONF_OUTPUT)
473         $Q sh -- '$<' '$@' \
474                 HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST_MASK \
475                 linux/pkt_cls.h \
476                 enum TCA_FLOWER_KEY_ENC_IPV6_DST_MASK \
477                 $(AUTOCONF_OUTPUT)
478         $Q sh -- '$<' '$@' \
479                 HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT \
480                 linux/pkt_cls.h \
481                 enum TCA_FLOWER_KEY_ENC_UDP_SRC_PORT \
482                 $(AUTOCONF_OUTPUT)
483         $Q sh -- '$<' '$@' \
484                 HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK \
485                 linux/pkt_cls.h \
486                 enum TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK \
487                 $(AUTOCONF_OUTPUT)
488         $Q sh -- '$<' '$@' \
489                 HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT \
490                 linux/pkt_cls.h \
491                 enum TCA_FLOWER_KEY_ENC_UDP_DST_PORT \
492                 $(AUTOCONF_OUTPUT)
493         $Q sh -- '$<' '$@' \
494                 HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK \
495                 linux/pkt_cls.h \
496                 enum TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK \
497                 $(AUTOCONF_OUTPUT)
498         $Q sh -- '$<' '$@' \
499                 HAVE_TCA_FLOWER_KEY_ENC_IP_TOS \
500                 linux/pkt_cls.h \
501                 enum TCA_FLOWER_KEY_ENC_IP_TOS \
502                 $(AUTOCONF_OUTPUT)
503         $Q sh -- '$<' '$@' \
504                 HAVE_TCA_FLOWER_KEY_ENC_IP_TOS_MASK \
505                 linux/pkt_cls.h \
506                 enum TCA_FLOWER_KEY_ENC_IP_TOS_MASK \
507                 $(AUTOCONF_OUTPUT)
508         $Q sh -- '$<' '$@' \
509                 HAVE_TCA_FLOWER_KEY_ENC_IP_TTL \
510                 linux/pkt_cls.h \
511                 enum TCA_FLOWER_KEY_ENC_IP_TTL \
512                 $(AUTOCONF_OUTPUT)
513         $Q sh -- '$<' '$@' \
514                 HAVE_TCA_FLOWER_KEY_ENC_IP_TTL_MASK \
515                 linux/pkt_cls.h \
516                 enum TCA_FLOWER_KEY_ENC_IP_TTL_MASK \
517                 $(AUTOCONF_OUTPUT)
518         $Q sh -- '$<' '$@' \
519                 HAVE_TC_ACT_TUNNEL_KEY \
520                 linux/tc_act/tc_tunnel_key.h \
521                 define TCA_ACT_TUNNEL_KEY \
522                 $(AUTOCONF_OUTPUT)
523         $Q sh -- '$<' '$@' \
524                 HAVE_TCA_TUNNEL_KEY_ENC_DST_PORT \
525                 linux/tc_act/tc_tunnel_key.h \
526                 enum TCA_TUNNEL_KEY_ENC_DST_PORT \
527                 $(AUTOCONF_OUTPUT)
528         $Q sh -- '$<' '$@' \
529                 HAVE_TCA_TUNNEL_KEY_ENC_TOS \
530                 linux/tc_act/tc_tunnel_key.h \
531                 enum TCA_TUNNEL_KEY_ENC_TOS \
532                 $(AUTOCONF_OUTPUT)
533         $Q sh -- '$<' '$@' \
534                 HAVE_TCA_TUNNEL_KEY_ENC_TTL \
535                 linux/tc_act/tc_tunnel_key.h \
536                 enum TCA_TUNNEL_KEY_ENC_TTL \
537                 $(AUTOCONF_OUTPUT)
538         $Q sh -- '$<' '$@' \
539                 HAVE_TCA_TUNNEL_KEY_NO_CSUM \
540                 linux/tc_act/tc_tunnel_key.h \
541                 enum TCA_TUNNEL_KEY_NO_CSUM \
542                 $(AUTOCONF_OUTPUT)
543         $Q sh -- '$<' '$@' \
544                 HAVE_TC_ACT_PEDIT \
545                 linux/tc_act/tc_pedit.h \
546                 enum TCA_PEDIT_KEY_EX_HDR_TYPE_UDP \
547                 $(AUTOCONF_OUTPUT)
548         $Q sh -- '$<' '$@' \
549                 HAVE_SUPPORTED_40000baseKR4_Full \
550                 /usr/include/linux/ethtool.h \
551                 define SUPPORTED_40000baseKR4_Full \
552                 $(AUTOCONF_OUTPUT)
553         $Q sh -- '$<' '$@' \
554                 HAVE_SUPPORTED_40000baseCR4_Full \
555                 /usr/include/linux/ethtool.h \
556                 define SUPPORTED_40000baseCR4_Full \
557                 $(AUTOCONF_OUTPUT)
558         $Q sh -- '$<' '$@' \
559                 HAVE_SUPPORTED_40000baseSR4_Full \
560                 /usr/include/linux/ethtool.h \
561                 define SUPPORTED_40000baseSR4_Full \
562                 $(AUTOCONF_OUTPUT)
563         $Q sh -- '$<' '$@' \
564                 HAVE_SUPPORTED_40000baseLR4_Full \
565                 /usr/include/linux/ethtool.h \
566                 define SUPPORTED_40000baseLR4_Full \
567                 $(AUTOCONF_OUTPUT)
568         $Q sh -- '$<' '$@' \
569                 HAVE_SUPPORTED_56000baseKR4_Full \
570                 /usr/include/linux/ethtool.h \
571                 define SUPPORTED_56000baseKR4_Full \
572                 $(AUTOCONF_OUTPUT)
573         $Q sh -- '$<' '$@' \
574                 HAVE_SUPPORTED_56000baseCR4_Full \
575                 /usr/include/linux/ethtool.h \
576                 define SUPPORTED_56000baseCR4_Full \
577                 $(AUTOCONF_OUTPUT)
578         $Q sh -- '$<' '$@' \
579                 HAVE_SUPPORTED_56000baseSR4_Full \
580                 /usr/include/linux/ethtool.h \
581                 define SUPPORTED_56000baseSR4_Full \
582                 $(AUTOCONF_OUTPUT)
583         $Q sh -- '$<' '$@' \
584                 HAVE_SUPPORTED_56000baseLR4_Full \
585                 /usr/include/linux/ethtool.h \
586                 define SUPPORTED_56000baseLR4_Full \
587                 $(AUTOCONF_OUTPUT)
588         $Q sh -- '$<' '$@' \
589                 HAVE_STATIC_ASSERT \
590                 /usr/include/assert.h \
591                 define static_assert \
592                 $(AUTOCONF_OUTPUT)
593
594 # Create mlx5_autoconf.h or update it in case it differs from the new one.
595
596 mlx5_autoconf.h: mlx5_autoconf.h.new
597         $Q [ -f '$@' ] && \
598                 cmp '$<' '$@' $(AUTOCONF_OUTPUT) || \
599                 mv '$<' '$@'
600
601 $(SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD):.c=.o): mlx5_autoconf.h
602
603 # Generate dependency plug-in for rdma-core when the PMD must not be linked
604 # directly, so that applications do not inherit this dependency.
605
606 ifeq ($(CONFIG_RTE_IBVERBS_LINK_DLOPEN),y)
607
608 $(LIB): $(LIB_GLUE)
609
610 ifeq ($(LINK_USING_CC),1)
611 GLUE_LDFLAGS := $(call linkerprefix,$(LDFLAGS))
612 else
613 GLUE_LDFLAGS := $(LDFLAGS)
614 endif
615 $(LIB_GLUE): mlx5_glue.o
616         $Q $(LD) $(GLUE_LDFLAGS) $(EXTRA_LDFLAGS) \
617                 -Wl,-h,$(LIB_GLUE) \
618                 -shared -o $@ $< -libverbs -lmlx5
619
620 mlx5_glue.o: mlx5_autoconf.h
621
622 endif
623
624 clean_mlx5: FORCE
625         $Q rm -f -- mlx5_autoconf.h mlx5_autoconf.h.new
626         $Q rm -f -- mlx5_glue.o $(LIB_GLUE_BASE)*
627
628 clean: clean_mlx5