[dpdk-dev] [PATCH v3 04/11] examples/l2fwd-crypto: fix build with pkg-config

David Marchand david.marchand at redhat.com
Sat Nov 14 10:05:26 CET 2020


Two issues fixed here.

First add the experimental flag.
Then fix a link issue with the crypto scheduler driver:
/usr/bin/ld: /tmp/cchr7aHA.o: in function `main':
main.c:(.text.startup+0x1673): undefined reference to
`rte_cryptodev_scheduler_workers_get'
collect2: error: ld returned 1 exit status

Fixes: e3bcb99a5e13 ("examples/l2fwd-crypto: limit number of sessions")
Fixes: 261bbff75e34 ("examples: use separate crypto session mempools")

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
Changelog since v2:
- reworked config check,

---
 examples/l2fwd-crypto/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/examples/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile
index 4953ee2b95..7731eccd03 100644
--- a/examples/l2fwd-crypto/Makefile
+++ b/examples/l2fwd-crypto/Makefile
@@ -26,6 +26,12 @@ CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
 LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
 
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+CONFIG_DEFINES = $(shell $(CC) $(CFLAGS) -dM -E - < /dev/null)
+ifneq ($(findstring RTE_CRYPTO_SCHEDULER,$(CONFIG_DEFINES)),)
+LDFLAGS_SHARED += -lrte_crypto_scheduler
+endif
+
 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
 	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
 
-- 
2.23.0



More information about the dev mailing list