-
Notifications
You must be signed in to change notification settings - Fork 81
/
Makefile.dpdk
191 lines (167 loc) · 5.03 KB
/
Makefile.dpdk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
#
# Copyright (c) 2016, Juniper Networks, Inc. All rights reserved.
#
#
# The contents of this file are subject to the terms of the BSD 3 clause
# License (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at
# https://github.com/Juniper/warp17/blob/master/LICENSE.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# File name:
# Makefile.dpdk
#
# Description:
# Makefile for DPDK WARP17 build.
#
# Author:
# Dumitru Ceara, Eelco Chaudron
#
# Initial Created:
# 01/07/2016
#
# Notes:
#
#
ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable")
endif
# Default target, can be overriden by command line or environment
RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
# binary name
APP = warp17
VERSION = \"$(shell cat $(SRCDIR)/VERSION)\"
BUILD_HASH = \"$(shell git rev-parse HEAD 2> /dev/null || echo "N/A")\"
# Include sec, and 3rd party source directory in build process
VPATH := $(SRCDIR)/src
VPATH += $(SRCDIR)/src/appl
VPATH += $(SRCDIR)/src/kni_if
VPATH += $(SRCDIR)/src/ring_if
VPATH += $(SRCDIR)/api/generated/c
VPATH += $(SRCDIR)/api/generated/xlate
VPATH += $(SRCDIR)/3rdparty
# all source are stored in SRCS-y
SRCS-y = tpg_arp.c
SRCS-y += tpg_cli.c
SRCS-y += tpg_config.c
SRCS-y += tpg_ethernet.c
SRCS-y += tpg_ipv4.c
SRCS-y += tpg_kni_if.c
SRCS-y += tpg_kni_pmd.c
SRCS-y += tpg_lookup.c
SRCS-y += tpg_main.c
SRCS-y += tpg_memory.c
SRCS-y += tpg_msg.c
SRCS-y += tpg_pktloop.c
SRCS-y += tpg_timestamp.c
SRCS-y += tpg_port.c
SRCS-y += tpg_rate.c
SRCS-y += tpg_ring_if.c
SRCS-y += tpg_route.c
SRCS-y += tpg_rpc.c
SRCS-y += tpg_tcp.c
SRCS-y += tpg_tcp_data.c
SRCS-y += tpg_tcp_lookup.c
SRCS-y += tpg_tcp_sm.c
SRCS-y += tpg_test_mgmt.c
SRCS-y += tpg_test_mgmt_api.c
SRCS-y += tpg_test_mgmt_cli.c
SRCS-y += tpg_test_app.c
SRCS-y += tpg_test_http_1_1_app.c
SRCS-y += tpg_test_raw_app.c
SRCS-y += tpg_test_imix_app.c
SRCS-y += tpg_test_stats.c
SRCS-y += tpg_tests.c
SRCS-y += tpg_tests_sm.c
SRCS-y += tpg_timer.c
SRCS-y += tpg_trace.c
SRCS-y += tpg_trace_cli.c
SRCS-y += tpg_trace_filter.c
SRCS-y += tpg_trace_msg.c
SRCS-y += tpg_udp.c
SRCS-y += tpg_udp_lookup.c
SRCS-y += toeplitz.c
# Add the API generated C file
SRCS-y += warp17-api.c
SRCS-y += warp17.xlate.c
CFLAGS += -O3
CFLAGS += -I$(SRCDIR)/inc
CFLAGS += -I$(SRCDIR)/inc/appl
CFLAGS += -I$(SRCDIR)/inc/kni_if
CFLAGS += -I$(SRCDIR)/inc/ring_if
CFLAGS += -I$(SRCDIR)/inc/sock
CFLAGS += -I$(SRCDIR)/api/generated/c
CFLAGS += -I$(SRCDIR)/api/generated/xlate
CFLAGS += -I$(SRCDIR)/3rdparty
CFLAGS += $(WERROR_FLAGS)
CFLAGS += -Wmaybe-uninitialized
# Always fail on warnings!
CFLAGS += -Werror
CFLAGS += -DTPG_HAVE_STATS
CFLAGS += -DTPG_NO_DEBUG_LOGS
#CFLAGS += -D_SPEEDY_PKT_PARSE_
CFLAGS += -DTPG_VERSION=$(VERSION)
CFLAGS += -DTPG_BUILD_HASH=$(BUILD_HASH)
ifeq ($(WARP17_RELEASE),)
CFLAGS += -ggdb3
endif
ifneq ($(WARP17_DEBUG_ALL),)
CFLAGS += -O0
CFLAGS += -DTPG_DEBUG
CFLAGS += -DTPG_L4_CB_DEBUG
endif
ifneq ($(WARP17_DEBUG_L4_CB),)
CFLAGS += -DTPG_L4_CB_DEBUG
endif
ifneq ($(WARP17_RING_IF),)
CFLAGS += -DTPG_RING_IF -DTPG_L4_CB_TX_HASH -DTPG_EXPLICIT_RX_HASH -DTPG_SW_CHECKSUMMING
endif
ifneq ($(WARP17_KNI_IF),)
CFLAGS += -DTPG_KNI_IF -DTPG_SW_CHECKSUMMING
endif
ifneq ($(WARP17_SW_CHECKSUMMING),)
CFLAGS += -DTPG_SW_CHECKSUMMING
endif
ifneq ($(WARP17_DEBUG_DROP_RATE),)
CFLAGS += -DTPG_DEBUG_DROP_RATE
endif
ifneq ($(WARP17_TRACE),)
CFLAGS += -DTPG_DBG_TRACE
endif
# For strcasestr and asprintf
CFLAGS += -D_GNU_SOURCE
LDFLAGS += -lncurses
LDFLAGS += -lprotobuf-c
LDFLAGS += -lprotobuf-c-rpc
include $(RTE_SDK)/mk/rte.extapp.mk