Thread (11 messages) flat view 11 messages, 3 authors, 2017-10-13

Re: [PATCH v3] examples/l2fwd-cat: fix build according to API changes

From: Vladimir Kuramshin <hidden>
Date: 2017-09-19 09:23:59

On 19.09.2017 11:56, Bruce Richardson wrote:
On Tue, Sep 19, 2017 at 11:17:31AM +0300, Vladimir Kuramshin wrote:
quoted
Current version is compatible with PQOS version 1.3
but not compatible with higher versions. This change
makes l2fwd-cat example compatible with versions since 1.4

Signed-off-by: Vladimir Kuramshin <redacted>
---
  examples/l2fwd-cat/Makefile |  5 +--
  examples/l2fwd-cat/cat.c    | 85 +++++++++++++++++++++++++++++++++++++++------
  2 files changed, 76 insertions(+), 14 deletions(-)
diff --git a/examples/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile
index ae921ade6..a7fe6d68e 100644
--- a/examples/l2fwd-cat/Makefile
+++ b/examples/l2fwd-cat/Makefile
@@ -40,9 +40,6 @@ endif
  # Default target, can be overridden by command line or environment
  RTE_TARGET ?= x86_64-native-linuxapp-gcc
  
-# Location of PQoS library and includes,
-PQOS_LIBRARY_PATH = $(PQOS_INSTALL_PATH)/libpqos.a
-
  include $(RTE_SDK)/mk/rte.vars.mk
  
  # binary name
@@ -65,6 +62,6 @@ CFLAGS += -I$(PQOS_INSTALL_PATH)/../include
  CFLAGS_cat.o := -D_GNU_SOURCE
  
  LDLIBS += -L$(PQOS_INSTALL_PATH)
-LDLIBS += $(PQOS_LIBRARY_PATH)
+LDLIBS += -lpqos
  
  include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c
index 6133bf5bb..9330b2d26 100644
--- a/examples/l2fwd-cat/cat.c
+++ b/examples/l2fwd-cat/cat.c
@@ -53,7 +53,11 @@
  static const struct pqos_cap *m_cap;
  static const struct pqos_cpuinfo *m_cpu;
  static const struct pqos_capability *m_cap_l3ca;
+#if PQOS_VERSION <= 10300
  static unsigned m_sockets[PQOS_MAX_SOCKETS];
+#else
+static unsigned int *m_sockets;
+#endif
Does this check work right? The version number in git right now seems to
be just 10100, which would use the "old" path here, despite being latest
code? https://github.com/01org/intel-cmt-cat/blob/master/lib/pqos.h

I will try and follow up with the maintainers of the pqos files, and see
how the version numbers in pqos.h are meant to work.

Regards,
/Bruce
Sorry, added redundant zeros. The correct version number should be 103. 
But there is one pitfall in this commit 
6a6d9ef0cae67efe63a394f09fa587b6fc8b1046 but for other case 103 will work.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help