Skip to contentSkip to conversation

mk: move libs that don't dependent PMD libs out of whole archive

PATCH Superseded Ferruh Yigit 2 participants 7 messages Jan 31, 2017 – Feb 9, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mk: move libs that don't dependent PMD libs out of whole archive

During app build with static library, some libraries wrapped with --whole-archive compiler flag.

Wrapped libraries are mainly PMD libraries, this is required because PMD APIs not directly called but run through callbacks registered via constructor functions.

Also some set of libraries, depends to the PMD libraries needs this, because of same reason.

But other libraries can be out of this flag, and this saves some size in final binary.

---
 mk/rte.app.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
mk/rte.app.mk +4 -4
index 0d0a970..aeadbc3 100644
@@ -81,13 +81,14 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL)            += --no-whole-archive
 _LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS)       += -lrte_jobstats
 _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER)          += -lrte_power
 
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
+_LDLIBS-$(CONFIG_RTE_LIBRTE_EFD)            += -lrte_efd
+_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
+
 _LDLIBS-y += --whole-archive
 
-_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
 _LDLIBS-$(CONFIG_RTE_LIBRTE_HASH)           += -lrte_hash
-_LDLIBS-$(CONFIG_RTE_LIBRTE_EFD)            += -lrte_efd
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
-
 _LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS)         += -lrte_kvargs
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF)           += -lrte_mbuf
 _LDLIBS-$(CONFIG_RTE_LIBRTE_NET)            += -lrte_net
@@ -97,7 +98,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL)        += -lrte_mempool
 _LDLIBS-$(CONFIG_RTE_LIBRTE_RING)           += -lrte_ring
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL)            += -lrte_eal
 _LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE)        += -lrte_cmdline
-_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 _LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER)        += -lrte_reorder
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND)       += -lrte_pmd_bond
Signature · 1 line
2.9.3
#1 lore raw

PATCH 2/2 mk: move crypto scheduler library

There is already a block for crypto libraries, move the PMD library to that block.

This prevents extra ifdef check for cryptodev.

---
 mk/rte.app.mk | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
mk/rte.app.mk +1 -4
index aeadbc3..a4a09d8 100644
@@ -103,10 +103,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER)        += -lrte_reorder
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND)       += -lrte_pmd_bond
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lrte_pmd_xenvirt -lxenstore
 
-ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler
-endif
-
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
 # plugins (link only if static libraries)
 
@@ -153,6 +149,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -lrte_pmd_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -lrte_pmd_armv8
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler
 endif # CONFIG_RTE_LIBRTE_CRYPTODEV
 
 endif # !CONFIG_RTE_BUILD_SHARED_LIBS
Signature · 1 line
2.9.3
Acked-by on v1 1/2
#4 lore raw
In reply to Ferruh Yigit

2017-01-31 11:59, Ferruh Yigit:

Quoted 9 lines

During app build with static library, some libraries wrapped with --whole-archive compiler flag.

Wrapped libraries are mainly PMD libraries, this is required because PMD APIs not directly called but run through callbacks registered via constructor functions.

Also some set of libraries, depends to the PMD libraries needs this, because of same reason.

All the libraries used by a plugin (any driver) must be in --whole-archive to ensure that every symbols will be available for the plugin. This should be explained in this patch (verbatim copy allowed).

Quoted 2 lines

But other libraries can be out of this flag, and this saves some size in final binary.

[...]

mk/rte.app.mk _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += --no-whole-archive · line 88

Quoted 5 lines
mk/rte.app.mk +4 -0
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
+_LDLIBS-$(CONFIG_RTE_LIBRTE_EFD)            += -lrte_efd
+_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
+
 _LDLIBS-y += --whole-archive

Yes we can move these libraries out of --whole-archive as they are not used by any driver.

#2 lore raw

Re: [PATCH 2/2] mk: move crypto scheduler library

In reply to Ferruh Yigit

2017-01-31 11:59, Ferruh Yigit:

Quoted 4 lines

There is already a block for crypto libraries, move the PMD library to that block.

This prevents extra ifdef check for cryptodev.

That's why I thought also when reading this patch:

	http://dpdk.org/commit/dbb336407

Then I've read its message:
"Different than other cryptodev PMDs, scheduler PMD is required to be built as shared libraries."

I guess the explanation is that it has an API (like bonding has):
drivers/crypto/scheduler/rte_cryptodev_scheduler.h

However, it is neither referenced in doc/api/doxy-api.conf nor doc/api/doxy-api-index.md.

Quoted 14 lines
mk/rte.app.mk +0 -4
@@ -103,10 +103,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER)        += -lrte_reorder
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND)       += -lrte_pmd_bond
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lrte_pmd_xenvirt -lxenstore
 
-ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler
-endif
-
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
 # plugins (link only if static libraries)
 

mk/rte.app.mk _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC) += -lrte_pmd_zuc · line 155

Quoted 7 lines
mk/rte.app.mk +1 -0
@@ -153,6 +149,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -lrte_pmd_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ZUC)         += -L$(LIBSSO_ZUC_PATH)/build -lsso_zuc
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -lrte_pmd_armv8
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO)    += -L$(ARMV8_CRYPTO_LIB_PATH) -larmv8_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER) += -lrte_pmd_crypto_scheduler
 endif # CONFIG_RTE_LIBRTE_CRYPTODEV
 
 endif # !CONFIG_RTE_BUILD_SHARED_LIBS

I must say the quick overview I had on this PMD is not very promising. Please Pablo and Fan, try to better explain things in the patches and get more review on framework integration.

#3 lore raw

Re: [PATCH 2/2] mk: move crypto scheduler library

Quoted 11 lines · Thomas Monjalon

2017-01-31 11:59, Ferruh Yigit:

Quoted 4 lines

There is already a block for crypto libraries, move the PMD library to that block.

This prevents extra ifdef check for cryptodev.

That's why I thought also when reading this patch:

	http://dpdk.org/commit/dbb336407

Then I've read its message:
"Different than other cryptodev PMDs, scheduler PMD is required to be built as shared libraries."

This patch requires following patch for shared library compilation:
http://dpdk.org/dev/patchwork/patch/20091/

I tried to separate patches, but it seems not able to completely.

Overall, for this patch and above referenced one, need to decide how to link PMDs with APIs (like bonding, xenvirt)

Quoted 8 lines

I guess the explanation is that it has an API (like bonding has):
drivers/crypto/scheduler/rte_cryptodev_scheduler.h

However, it is neither referenced in doc/api/doxy-api.conf nor doc/api/doxy-api-index.md.

<...>

#5 lore raw

PATCH v2 1/1 mk: move libs that don't dependent PMD libs out of whole archive

In reply to Ferruh Yigit

During app build with static library, some libraries wrapped with --whole-archive compiler flag.

Wrapped libraries are mainly PMD libraries, this is required because PMD APIs not called directly but run through callbacks registered via constructor functions.

Also some set of libraries, depends to the PMD libraries needs this, because of same reason.

All the libraries used by a plugin (any driver) must be in --whole-archive to ensure that every symbols will be available for the plugin.

But other libraries can be out of this flag, and this saves some bytes in final binary.

---
 mk/rte.app.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
mk/rte.app.mk +4 -4
index 0d0a970..aeadbc3 100644
@@ -81,13 +81,14 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL)            += --no-whole-archive
 _LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS)       += -lrte_jobstats
 _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER)          += -lrte_power
 
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
+_LDLIBS-$(CONFIG_RTE_LIBRTE_EFD)            += -lrte_efd
+_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
+
 _LDLIBS-y += --whole-archive
 
-_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER)          += -lrte_timer
 _LDLIBS-$(CONFIG_RTE_LIBRTE_HASH)           += -lrte_hash
-_LDLIBS-$(CONFIG_RTE_LIBRTE_EFD)            += -lrte_efd
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
-
 _LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS)         += -lrte_kvargs
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF)           += -lrte_mbuf
 _LDLIBS-$(CONFIG_RTE_LIBRTE_NET)            += -lrte_net
@@ -97,7 +98,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL)        += -lrte_mempool
 _LDLIBS-$(CONFIG_RTE_LIBRTE_RING)           += -lrte_ring
 _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL)            += -lrte_eal
 _LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE)        += -lrte_cmdline
-_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE)        += -lrte_cfgfile
 _LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER)        += -lrte_reorder
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND)       += -lrte_pmd_bond
Signature · 1 line
2.9.3
#6 lore raw

2017-01-31 15:01, Ferruh Yigit:

Quoted 14 lines

During app build with static library, some libraries wrapped with --whole-archive compiler flag.

Wrapped libraries are mainly PMD libraries, this is required because PMD APIs not called directly but run through callbacks registered via constructor functions.

Also some set of libraries, depends to the PMD libraries needs this, because of same reason.

All the libraries used by a plugin (any driver) must be in --whole-archive to ensure that every symbols will be available for the plugin.

Quoted 5 lines

But other libraries can be out of this flag, and this saves some bytes in final binary.

Applied, thanks