* [dpdk-dev] [PULL REQUEST] fm10k: new polling mode driver for PF/VF.
@ 2015-02-16 10:18 4% Chen Jing D(Mark)
0 siblings, 0 replies; 200+ results
From: Chen Jing D(Mark) @ 2015-02-16 10:18 UTC (permalink / raw)
To: dev
These changes add poll mode driver for the host interface of Intel
Ethernet Switch FM10000 Series of silicons, which integrate NIC and
switch functionalities. The patch set include below features:
1. Basic RX/TX functions for PF/VF.
2. Interrupt handling mechanism for PF/VF.
3. per queue start/stop functions for PF/VF.
4. Mailbox handling between PF/VF and PF/Switch Manager.
5. Receive Side Scaling (RSS) for PF/VF.
6. Scatter receive function for PF/VF.
7. reta update/query for PF/VF.
8. VLAN filter set for PF.
9. Link status query for PF/VF.
The following changes since commit f2c5125a686ab64034925dabafea0877d1e5857e:
app/testpmd: use default Rx/Tx port configuration (2015-02-14 11:35:25 +0100)
are available in the git repository at:
jing@dpdk.org:dpdk-fm10k-next.git master
for you to fetch changes up to 1b073a75d5e809f10c0a71cbc755b02045bf8783:
fm10k: Add ABI version of librte_pmd_fm10k (2015-02-16 03:46:00 -0500)
----------------------------------------------------------------
Chen Jing D(Mark) (1):
maintainers: claim for fm10k review
Jeff Shaw (15):
fm10k: add base driver
eal: add fm10k device id
fm10k: register fm10k pmd PF driver
Change config files to add fm10k into compile
fm10k: add reta update/requery functions
fm10k: add rx_queue_setup/release function
fm10k: add tx_queue_setup/release function
fm10k: add RX/TX single queue start/stop function
fm10k: add dev start/stop functions
fm10k: add receive and tranmit function
fm10k: add PF RSS support
fm10k: Add scatter receive function
fm10k: add function to set vlan
fm10k: Add SRIOV-VF support
fm10k: add PF and VF interrupt handling function
Michael Qiu (1):
fm10k: Add ABI version of librte_pmd_fm10k
MAINTAINERS | 4 +
config/common_bsdapp | 11 +
config/common_linuxapp | 11 +
lib/Makefile | 1 +
lib/librte_eal/common/include/rte_pci_dev_ids.h | 22 +
lib/librte_pmd_fm10k/Makefile | 100 ++
lib/librte_pmd_fm10k/base/fm10k_api.c | 341 ++++
lib/librte_pmd_fm10k/base/fm10k_api.h | 61 +
lib/librte_pmd_fm10k/base/fm10k_common.c | 572 ++++++
lib/librte_pmd_fm10k/base/fm10k_common.h | 52 +
lib/librte_pmd_fm10k/base/fm10k_mbx.c | 2185 +++++++++++++++++++++++
lib/librte_pmd_fm10k/base/fm10k_mbx.h | 329 ++++
lib/librte_pmd_fm10k/base/fm10k_osdep.h | 148 ++
lib/librte_pmd_fm10k/base/fm10k_pf.c | 1992 +++++++++++++++++++++
lib/librte_pmd_fm10k/base/fm10k_pf.h | 155 ++
lib/librte_pmd_fm10k/base/fm10k_tlv.c | 914 ++++++++++
lib/librte_pmd_fm10k/base/fm10k_tlv.h | 199 +++
lib/librte_pmd_fm10k/base/fm10k_type.h | 937 ++++++++++
lib/librte_pmd_fm10k/base/fm10k_vf.c | 641 +++++++
lib/librte_pmd_fm10k/base/fm10k_vf.h | 91 +
lib/librte_pmd_fm10k/fm10k.h | 293 +++
lib/librte_pmd_fm10k/fm10k_ethdev.c | 1868 +++++++++++++++++++
lib/librte_pmd_fm10k/fm10k_logs.h | 78 +
lib/librte_pmd_fm10k/fm10k_rxtx.c | 459 +++++
lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map | 4 +
mk/rte.app.mk | 4 +
26 files changed, 11472 insertions(+)
create mode 100644 lib/librte_pmd_fm10k/Makefile
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_api.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_api.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_common.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_common.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_mbx.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_mbx.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_osdep.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_pf.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_pf.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_tlv.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_tlv.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_type.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_vf.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_vf.h
create mode 100644 lib/librte_pmd_fm10k/fm10k.h
create mode 100644 lib/librte_pmd_fm10k/fm10k_ethdev.c
create mode 100644 lib/librte_pmd_fm10k/fm10k_logs.h
create mode 100644 lib/librte_pmd_fm10k/fm10k_rxtx.c
create mode 100644 lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver
2015-02-13 8:19 4% ` [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver Chen Jing D(Mark)
2015-02-13 8:19 7% ` [dpdk-dev] [PATCH v5 17/17] fm10k: Add ABI version of librte_pmd_fm10k Chen Jing D(Mark)
2015-02-13 8:37 0% ` [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver Zhang, Helin
@ 2015-02-15 5:07 0% ` Qiu, Michael
2 siblings, 0 replies; 200+ results
From: Qiu, Michael @ 2015-02-15 5:07 UTC (permalink / raw)
To: Chen, Jing D, dev
On 2/13/2015 4:20 PM, Chen, Jing D wrote:
> From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>
>
> The patch set add poll mode driver for the host interface of Intel
> Ethernet Switch FM10000 Series of silicons, which integrate NIC and
> switch functionalities. The patch set include below features:
>
> 1. Basic RX/TX functions for PF/VF.
> 2. Interrupt handling mechanism for PF/VF.
> 3. per queue start/stop functions for PF/VF.
> 4. Mailbox handling between PF/VF and PF/Switch Manager.
> 5. Receive Side Scaling (RSS) for PF/VF.
> 6. Scatter receive function for PF/VF.
> 7. reta update/query for PF/VF.
> 8. VLAN filter set for PF.
> 9. Link status query for PF/VF.
>
> Change in v5:
> - Add sanity check for mbuf allocation.
> - Add a new patch to claim fm10k driver review
> - Change commit log.
> - Add unlikely in func rx_desc_to_ol_flags to gain performance
> - Add a new patch to add ABI version
>
> Change in v4:
> - Change commit log to remove improper words.
>
> Changes in v3:
> - Update base driver.
> - Define several macros to pass base driver compile.
>
> Changes in v2:
> - Merge 3 patches into 1 to configure fm10k compile environment.
> - Rework on log code to follow style in ixgbe.
> - Rework log message, remove redundant '\n'
> - Update Copyright year from "2014" to "2015"
> - Change base driver directory name from SHARED to base
> - Add more description in log for patch "add PF and VF interrupt"
> - Merge 2 patches into 1 to register fm10k driver
> - Define macro to replace numeric for lower 32-bit mask.
>
> Chen Jing D(Mark) (1):
> maintainers: claim for fm10k review
>
> Jeff Shaw (15):
> fm10k: add base driver
> eal: add fm10k device id
> fm10k: register fm10k pmd PF driver
> Change config files to add fm10k into compile
> fm10k: add reta update/requery functions
> fm10k: add rx_queue_setup/release function
> fm10k: add tx_queue_setup/release function
> fm10k: add RX/TX single queue start/stop function
> fm10k: add dev start/stop functions
> fm10k: add receive and tranmit function
> fm10k: add PF RSS support
> fm10k: Add scatter receive function
> fm10k: add function to set vlan
> fm10k: Add SRIOV-VF support
> fm10k: add PF and VF interrupt handling function
>
> Michael Qiu (1):
> fm10k: Add ABI version of librte_pmd_fm10k
>
> MAINTAINERS | 4 +
> config/common_bsdapp | 11 +
> config/common_linuxapp | 11 +
> lib/Makefile | 1 +
> lib/librte_eal/common/include/rte_pci_dev_ids.h | 22 +
> lib/librte_pmd_fm10k/Makefile | 100 +
> lib/librte_pmd_fm10k/base/fm10k_api.c | 341 ++++
> lib/librte_pmd_fm10k/base/fm10k_api.h | 61 +
> lib/librte_pmd_fm10k/base/fm10k_common.c | 572 ++++++
> lib/librte_pmd_fm10k/base/fm10k_common.h | 52 +
> lib/librte_pmd_fm10k/base/fm10k_mbx.c | 2185 +++++++++++++++++++++++
> lib/librte_pmd_fm10k/base/fm10k_mbx.h | 329 ++++
> lib/librte_pmd_fm10k/base/fm10k_osdep.h | 148 ++
> lib/librte_pmd_fm10k/base/fm10k_pf.c | 1992 +++++++++++++++++++++
> lib/librte_pmd_fm10k/base/fm10k_pf.h | 155 ++
> lib/librte_pmd_fm10k/base/fm10k_tlv.c | 914 ++++++++++
> lib/librte_pmd_fm10k/base/fm10k_tlv.h | 199 ++
> lib/librte_pmd_fm10k/base/fm10k_type.h | 937 ++++++++++
> lib/librte_pmd_fm10k/base/fm10k_vf.c | 641 +++++++
> lib/librte_pmd_fm10k/base/fm10k_vf.h | 91 +
> lib/librte_pmd_fm10k/fm10k.h | 293 +++
> lib/librte_pmd_fm10k/fm10k_ethdev.c | 1868 +++++++++++++++++++
> lib/librte_pmd_fm10k/fm10k_logs.h | 78 +
> lib/librte_pmd_fm10k/fm10k_rxtx.c | 459 +++++
> lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map | 4 +
> mk/rte.app.mk | 4 +
> 26 files changed, 11472 insertions(+), 0 deletions(-)
> create mode 100644 lib/librte_pmd_fm10k/Makefile
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_api.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_api.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_common.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_common.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_mbx.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_mbx.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_osdep.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_pf.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_pf.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_tlv.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_tlv.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_type.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_vf.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_vf.h
> create mode 100644 lib/librte_pmd_fm10k/fm10k.h
> create mode 100644 lib/librte_pmd_fm10k/fm10k_ethdev.c
> create mode 100644 lib/librte_pmd_fm10k/fm10k_logs.h
> create mode 100644 lib/librte_pmd_fm10k/fm10k_rxtx.c
> create mode 100644 lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map
>
Acked-by: Michael Qiu <michael.qiu@intel.com>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v2 4/4] abi: Added rxtx callback functions to ABI versioning
2015-02-13 15:39 5% ` [dpdk-dev] [PATCH v2 4/4] abi: Added rxtx callback functions to ABI versioning John McNamara
@ 2015-02-13 15:59 5% ` Thomas Monjalon
0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2015-02-13 15:59 UTC (permalink / raw)
To: John McNamara; +Cc: dev
2015-02-13 15:39, John McNamara:
> ---
There is no signed-off.
And there is no need of a separate patch for that.
> lib/librte_ether/rte_ether_version.map | 4 ++++
^ permalink raw reply [relevance 5%]
* [dpdk-dev] [PATCH] doc: Add requirements for x32 ABI
@ 2015-02-13 15:58 11% Daniel Mrzyglod
0 siblings, 0 replies; 200+ results
From: Daniel Mrzyglod @ 2015-02-13 15:58 UTC (permalink / raw)
To: dev
This patch add requirements about compiler and distribution support.
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
doc/guides/linux_gsg/sys_reqs.rst | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
index 8e2307b..ef4196e 100644
--- a/doc/guides/linux_gsg/sys_reqs.rst
+++ b/doc/guides/linux_gsg/sys_reqs.rst
@@ -62,7 +62,7 @@ Compilation of the DPDK
* coreutils: cmp, sed, grep, arch
* gcc: versions 4.5.x or later is recommended for i686/x86_64. versions 4.8.x or later is recommanded
- for ppc_64. On some distributions, some specific compiler flags and linker flags are enabled by
+ for ppc_64 and x86_x32 ABI. On some distributions, some specific compiler flags and linker flags are enabled by
default and affect performance (- fstack-protector, for example). Please refer to the documentation
of your distribution and to gcc -dumpspecs.
@@ -78,7 +78,14 @@ Compilation of the DPDK
glibc.ppc64, libgcc.ppc64, libstdc++.ppc64 and glibc-devel.ppc64 for IBM ppc_64;
-* Python, version 2.6 or 2.7, to use various helper scripts included in the DPDK package
+.. note::
+
+ x86_x32 ABI is currently supported with distribution packages only on Ubuntu
+ higher then 13.10 or recent debian distribution. The only supported compiler is gcc 4.8+.
+
+.. note::
+
+ Python, version 2.6 or 2.7, to use various helper scripts included in the DPDK package
**Optional Tools:**
--
2.1.0
^ permalink raw reply [relevance 11%]
* Re: [dpdk-dev] [PATCH v2 0/4] DPDK ethdev callback support
2015-02-13 15:39 4% ` [dpdk-dev] [PATCH v2 0/4] " John McNamara
2015-02-13 15:39 5% ` [dpdk-dev] [PATCH v2 4/4] abi: Added rxtx callback functions to ABI versioning John McNamara
@ 2015-02-13 15:48 0% ` Declan Doherty
1 sibling, 0 replies; 200+ results
From: Declan Doherty @ 2015-02-13 15:48 UTC (permalink / raw)
To: John McNamara, dev
On 13/02/15 15:39, John McNamara wrote:
> This patchset is for a small addition to the ethdev library, to
> add in support for callbacks at the RX and TX stages. This allows
> packet processing to be done on packets before they get returned
> to applications using rte_eth_rx_burst call.
>
> See the RFC cover letter for the use cases:
>
> http://dpdk.org/ml/archives/dev/2014-December/010491.html
>
> For the post-RFC version we spent some time investigating Stephen Hemminger's
> suggestion of using the userspace RCU (read-copy-update) library for
> SMP safety:
>
> http://urcu.so/
>
> The default liburcu (which defaulted to liburcu-mb) requires the least
> interaction from the end user but showed a 25% drop in packet throughput
> in the callback sample app.
>
> The liburcu-qsbr (quiescent state) variant showed a 1% drop in packet
> throughput in the callback sample app. However it requires registered
> RCU threads in the program to periodically announce quiescent states.
> This makes it more difficult to implement for end user applications.
>
> For this release we will document that adding and removing callbacks
> is not thread safe.
>
> Note: Sample application documentation to follow in a patch update.
>
> Version 2 changes:
> * Added ABI versioning.
> * Doxygen clarifications.
>
> Version 1 changes:
> * Added callback removal functions.
> * Minor fixes.
>
>
> John McNamara (1):
> abi: Added rxtx callback functions to ABI versioning
>
> Richardson, Bruce (3):
> ethdev: rename callbacks field to intr_cbs
> ethdev: Add in data rxtx callback support
> examples: example showing use of callbacks.
>
> app/test/virtual_pmd.c | 2 +-
> examples/rxtx_callbacks/Makefile | 57 ++++++++
> examples/rxtx_callbacks/basicfwd.c | 222 ++++++++++++++++++++++++++++++++
> examples/rxtx_callbacks/basicfwd.h | 46 +++++++
> lib/librte_ether/rte_ethdev.c | 175 ++++++++++++++++++++++++--
> lib/librte_ether/rte_ethdev.h | 191 +++++++++++++++++++++++++++-
> lib/librte_ether/rte_ether_version.map | 4 +
> lib/librte_pmd_bond/rte_eth_bond_api.c | 2 +-
> 8 files changed, 685 insertions(+), 14 deletions(-)
> create mode 100644 examples/rxtx_callbacks/Makefile
> create mode 100644 examples/rxtx_callbacks/basicfwd.c
> create mode 100644 examples/rxtx_callbacks/basicfwd.h
>
Series Acked-by: Declan Doherty <declan.doherty@intel.com>
^ permalink raw reply [relevance 0%]
* [dpdk-dev] [PATCH v2 4/4] abi: Added rxtx callback functions to ABI versioning
2015-02-13 15:39 4% ` [dpdk-dev] [PATCH v2 0/4] " John McNamara
@ 2015-02-13 15:39 5% ` John McNamara
2015-02-13 15:59 5% ` Thomas Monjalon
2015-02-13 15:48 0% ` [dpdk-dev] [PATCH v2 0/4] DPDK ethdev callback support Declan Doherty
1 sibling, 1 reply; 200+ results
From: John McNamara @ 2015-02-13 15:39 UTC (permalink / raw)
To: dev
---
lib/librte_ether/rte_ether_version.map | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index 7316530..3227cda 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -2,6 +2,8 @@ DPDK_2.0 {
global:
_rte_eth_dev_callback_process;
+ rte_eth_add_rx_callback;
+ rte_eth_add_tx_callback;
rte_eth_allmulticast_disable;
rte_eth_allmulticast_enable;
rte_eth_allmulticast_get;
@@ -96,6 +98,8 @@ DPDK_2.0 {
rte_eth_promiscuous_disable;
rte_eth_promiscuous_enable;
rte_eth_promiscuous_get;
+ rte_eth_remove_rx_callback;
+ rte_eth_remove_tx_callback;
rte_eth_rx_burst;
rte_eth_rx_descriptor_done;
rte_eth_rx_queue_count;
--
1.7.4.1
^ permalink raw reply [relevance 5%]
* [dpdk-dev] [PATCH v2 0/4] DPDK ethdev callback support
@ 2015-02-13 15:39 4% ` John McNamara
2015-02-13 15:39 5% ` [dpdk-dev] [PATCH v2 4/4] abi: Added rxtx callback functions to ABI versioning John McNamara
2015-02-13 15:48 0% ` [dpdk-dev] [PATCH v2 0/4] DPDK ethdev callback support Declan Doherty
1 sibling, 2 replies; 200+ results
From: John McNamara @ 2015-02-13 15:39 UTC (permalink / raw)
To: dev
This patchset is for a small addition to the ethdev library, to
add in support for callbacks at the RX and TX stages. This allows
packet processing to be done on packets before they get returned
to applications using rte_eth_rx_burst call.
See the RFC cover letter for the use cases:
http://dpdk.org/ml/archives/dev/2014-December/010491.html
For the post-RFC version we spent some time investigating Stephen Hemminger's
suggestion of using the userspace RCU (read-copy-update) library for
SMP safety:
http://urcu.so/
The default liburcu (which defaulted to liburcu-mb) requires the least
interaction from the end user but showed a 25% drop in packet throughput
in the callback sample app.
The liburcu-qsbr (quiescent state) variant showed a 1% drop in packet
throughput in the callback sample app. However it requires registered
RCU threads in the program to periodically announce quiescent states.
This makes it more difficult to implement for end user applications.
For this release we will document that adding and removing callbacks
is not thread safe.
Note: Sample application documentation to follow in a patch update.
Version 2 changes:
* Added ABI versioning.
* Doxygen clarifications.
Version 1 changes:
* Added callback removal functions.
* Minor fixes.
John McNamara (1):
abi: Added rxtx callback functions to ABI versioning
Richardson, Bruce (3):
ethdev: rename callbacks field to intr_cbs
ethdev: Add in data rxtx callback support
examples: example showing use of callbacks.
app/test/virtual_pmd.c | 2 +-
examples/rxtx_callbacks/Makefile | 57 ++++++++
examples/rxtx_callbacks/basicfwd.c | 222 ++++++++++++++++++++++++++++++++
examples/rxtx_callbacks/basicfwd.h | 46 +++++++
lib/librte_ether/rte_ethdev.c | 175 ++++++++++++++++++++++++--
lib/librte_ether/rte_ethdev.h | 191 +++++++++++++++++++++++++++-
lib/librte_ether/rte_ether_version.map | 4 +
lib/librte_pmd_bond/rte_eth_bond_api.c | 2 +-
8 files changed, 685 insertions(+), 14 deletions(-)
create mode 100644 examples/rxtx_callbacks/Makefile
create mode 100644 examples/rxtx_callbacks/basicfwd.c
create mode 100644 examples/rxtx_callbacks/basicfwd.h
--
1.7.4.1
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 0/3] DPDK ethdev callback support
@ 2015-02-13 14:54 3% ` Declan Doherty
1 sibling, 0 replies; 200+ results
From: Declan Doherty @ 2015-02-13 14:54 UTC (permalink / raw)
To: John McNamara, dev
On 12/02/15 19:57, John McNamara wrote:
> This patchset is for a small addition to the ethdev library, to
> add in support for callbacks at the RX and TX stages. This allows
> packet processing to be done on packets before they get returned
> to applications using rte_eth_rx_burst call.
>
> See the RFC cover letter for the use cases:
>
> http://dpdk.org/ml/archives/dev/2014-December/010491.html
>
> For this version we spent some time investigating Stephen Hemminger's
> suggestion of using the userspace RCU (read-copy-update) library for
> SMP safety:
>
> http://urcu.so/
>
> The default liburcu (which defaulted to liburcu-mb) requires the least
> interaction from the end user but showed a 25% drop in packet throughput
> in the callback sample app.
>
> The liburcu-qsbr (quiescent state) variant showed a 1% drop in packet
> throughput in the callback sample app. However it requires registered
> RCU threads in the program to periodically announce quiescent states.
> This makes it more difficult to implement for end user applications.
>
> For this release we will document that callbacks should be added/removed
> on stopped ports.
>
> Version 1 changes:
> * Added callback removal functions.
> * Minor fixes.
>
>
> Richardson, Bruce (3):
> ethdev: rename callbacks field to intr_cbs
> ethdev: Add in data rxtx callback support
> examples: example showing use of callbacks.
>
> app/test/virtual_pmd.c | 2 +-
> examples/rxtx_callbacks/Makefile | 57 ++++++++
> examples/rxtx_callbacks/basicfwd.c | 222 ++++++++++++++++++++++++++++++++
> examples/rxtx_callbacks/basicfwd.h | 46 +++++++
> lib/librte_ether/rte_ethdev.c | 177 ++++++++++++++++++++++++--
> lib/librte_ether/rte_ethdev.h | 175 +++++++++++++++++++++++++-
> lib/librte_pmd_bond/rte_eth_bond_api.c | 2 +-
> 7 files changed, 667 insertions(+), 14 deletions(-)
> create mode 100644 examples/rxtx_callbacks/Makefile
> create mode 100644 examples/rxtx_callbacks/basicfwd.c
> create mode 100644 examples/rxtx_callbacks/basicfwd.h
>
Looks good to me, I'll ack the next version which has addressed the ABI
issues Neil raised. Also, it should probably be noted in the doxygen
comments for the add/remove rxtx callbacks that as currently implemented
the addition/removal of callbacks isn't thread safe
Declan
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-02-13 11:08 0% ` Gonzalez Monroy, Sergio
@ 2015-02-13 12:51 0% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-02-13 12:51 UTC (permalink / raw)
To: Gonzalez Monroy, Sergio; +Cc: dev
On Fri, Feb 13, 2015 at 11:08:02AM +0000, Gonzalez Monroy, Sergio wrote:
> On 13/02/2015 10:14, Panu Matilainen wrote:
> >On 02/12/2015 05:52 PM, Neil Horman wrote:
> >>On Thu, Feb 12, 2015 at 04:07:50PM +0200, Panu Matilainen wrote:
> >>>On 02/12/2015 02:23 PM, Neil Horman wrote:
> >[...snip...]
> >>>>>>>>
> >>>>>>>So I just realized that I was not having into account a possible
> >>>>>>>scenario, where
> >>>>>>>we have an app built with static dpdk libs then loading a dso
> >>>>>>>with -d
> >>>>>>>option.
> >>>>>>>
> >>>>>>>In such case, because the pmd would have DT_NEEDED entries,
> >>>>>>>dlopen will
> >>>>>>>fail.
> >>>>>>>So to enable such scenario we would need to build PMDs without
> >>>>>>>DT_NEEDED
> >>>>>>>entries.
> >>>>>>
> >>>>>>Hmm, for that to be a problem you'd need to have the PMD built
> >>>>>>against
> >>>>>>shared dpdk libs and while the application is built against
> >>>>>>static dpdk
> >>>>>>libs. I dont think that's a supportable scenario in any case.
> >>>>>>
> >>>>>>Or is there some other scenario that I'm not seeing?
> >>>>>>
> >>>>>> - Panu -
> >>>>>>
> >>>>>I agree with you. I suppose it comes down to, do we want to
> >>>>>support such
> >>>>>scenario?
> >>>>>
> >>>>> From what I can see, it seems that we do currently support such
> >>>>>scenario by
> >>>>>building dpdk apps against all static dpdk libs using
> >>>>>--whole-archive (all
> >>>>>libs and not only PMDs).
> >>>>>http://dpdk.org/browse/dpdk/commit/?id=20afd76a504155e947c770783ef5023e87136ad8
> >>>>>
> >>>>>
> >>>>>Am I misunderstanding this?
> >>>>>
> >>>>Shoot, you're right, I missed the static build aspect to this. Yes,
> >>>>if we do the following:
> >>>>
> >>>>1) Build the DPDK as a static library
> >>>>2) Link an application against (1)
> >>>>3) Use the dlopen mechanism to load a PMD built as a DSO
> >>>>
> >>>>Then the DT_NEEDED entries in the DSO will go unsatisfied, because
> >>>>the shared
> >>>>objects on which it (the PMD) depends will not exist in the file
> >>>>system.
> >>>
> >>>I think its even more twisty:
> >>>
> >>>1) Build the DPDK as a static library
> >>>2) Link an application against (1)
> >>>3) Do another build of DPDK as a shared library
> >>>4) In app 2), use the dlopen mechanism to load a PMD built as a part
> >>>of or
> >>>against 3)
> >>>
> >>>Somehow I doubt this would work very well.
> >>>
> >>Ideally it should, presuming the ABI is preserved between (1) and (3),
> >>though I
> >>agree, up until recently, that was an assumption that was unreliable.
> >
> >Versioning is a big and important step towards reliability but there are
> >more issues to solve. This of course getting pretty far from the original
> >topic, but at least one such issue is that there are some cases where a
> >config value affects what are apparently public structs (rte_mbuf wrt
> >RTE_MBUF_REFCNT for example), which really is a no-go.
> >
> Agree, the RTE_MBUF_REFCNT is something that needs to be dealt with asap.
> I'll look into it.
>
> >>>>
> >>>>I think the problem is a little bit orthogonal to the libdpdk_core
> >>>>problem you
> >>>>were initially addressing. That is to say, this problem of
> >>>>dlopen-ed PMD's
> >>>>exists regardless of weather you build the DPDK as part of a static
> >>>>or dynamic
> >>>>library. The problems just happen to intersect in their
> >>>>manipulation of the
> >>>>DT_NEEDED entries.
> >>>>
> >>>>Ok, so, given the above, I would say your approach is likely
> >>>>correct, just
> >>>>prevent DT_NEEDED entries from getting added to PMD's. Doing so will
> >>>>sidestep
> >>>>loading issue for libraries that may not exist in the filesystem,
> >>>>but thats ok,
> >>>>because by all rights, the symbols codified in those needed
> >>>>libraries should
> >>>>already be present in the running application (either made available
> >>>>by the
> >>>>application having statically linked them, or having the linker load
> >>>>them from
> >>>>the proper libraries at run time).
> >>>
> >>>My 5c is that I'd much rather see the common case (all static or all
> >>>shared)
> >>>be simple and reliable, which in case of DSOs includes no lying
> >>>(whether by
> >>>omission or otherwise) about DT_NEEDED, ever. That way the issue is
> >>>dealt
> >>>once where it belongs. If somebody wants to go down the rabbit hole of
> >>>mixed
> >>>shared + static linkage, let them dig the hole by themselves :)
> >>>
> >>This is a fair point. Can DT_NEEDED sections be stripped via tools like
> >>objcopy
> >>after the build is complete? If so, end users can hack this corner case
> >>to work
> >>as needed.
> >
> >Patchelf (http://nixos.org/patchelf.html) appears to support that, but
> >given that source is available it'd be easier to just modify the makefiles
> >if that's really needed.
> >
> I think we agree on the issue.
>
> So I'll be sending a patch to add DT_NEEDED entries to all libraries and
> PMDs. The only exception would be librte_eal, which would not have proper
> NEEDED entries.
> Do we bother adding a linker script for librte_eal that would include
> dependent libraries?
>
I say yes to the linker script, but will happily bow to an alternate consensus
Neil
> Sergio
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-02-13 10:14 0% ` Panu Matilainen
@ 2015-02-13 11:08 0% ` Gonzalez Monroy, Sergio
2015-02-13 12:51 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Gonzalez Monroy, Sergio @ 2015-02-13 11:08 UTC (permalink / raw)
To: Panu Matilainen; +Cc: dev
On 13/02/2015 10:14, Panu Matilainen wrote:
> On 02/12/2015 05:52 PM, Neil Horman wrote:
>> On Thu, Feb 12, 2015 at 04:07:50PM +0200, Panu Matilainen wrote:
>>> On 02/12/2015 02:23 PM, Neil Horman wrote:
> [...snip...]
>>>>>>>>
>>>>>>> So I just realized that I was not having into account a possible
>>>>>>> scenario, where
>>>>>>> we have an app built with static dpdk libs then loading a dso
>>>>>>> with -d
>>>>>>> option.
>>>>>>>
>>>>>>> In such case, because the pmd would have DT_NEEDED entries,
>>>>>>> dlopen will
>>>>>>> fail.
>>>>>>> So to enable such scenario we would need to build PMDs without
>>>>>>> DT_NEEDED
>>>>>>> entries.
>>>>>>
>>>>>> Hmm, for that to be a problem you'd need to have the PMD built
>>>>>> against
>>>>>> shared dpdk libs and while the application is built against
>>>>>> static dpdk
>>>>>> libs. I dont think that's a supportable scenario in any case.
>>>>>>
>>>>>> Or is there some other scenario that I'm not seeing?
>>>>>>
>>>>>> - Panu -
>>>>>>
>>>>> I agree with you. I suppose it comes down to, do we want to
>>>>> support such
>>>>> scenario?
>>>>>
>>>>> From what I can see, it seems that we do currently support such
>>>>> scenario by
>>>>> building dpdk apps against all static dpdk libs using
>>>>> --whole-archive (all
>>>>> libs and not only PMDs).
>>>>> http://dpdk.org/browse/dpdk/commit/?id=20afd76a504155e947c770783ef5023e87136ad8
>>>>>
>>>>>
>>>>> Am I misunderstanding this?
>>>>>
>>>> Shoot, you're right, I missed the static build aspect to this.
>>>> Yes, if we do the following:
>>>>
>>>> 1) Build the DPDK as a static library
>>>> 2) Link an application against (1)
>>>> 3) Use the dlopen mechanism to load a PMD built as a DSO
>>>>
>>>> Then the DT_NEEDED entries in the DSO will go unsatisfied, because
>>>> the shared
>>>> objects on which it (the PMD) depends will not exist in the file
>>>> system.
>>>
>>> I think its even more twisty:
>>>
>>> 1) Build the DPDK as a static library
>>> 2) Link an application against (1)
>>> 3) Do another build of DPDK as a shared library
>>> 4) In app 2), use the dlopen mechanism to load a PMD built as a part
>>> of or
>>> against 3)
>>>
>>> Somehow I doubt this would work very well.
>>>
>> Ideally it should, presuming the ABI is preserved between (1) and
>> (3), though I
>> agree, up until recently, that was an assumption that was unreliable.
>
> Versioning is a big and important step towards reliability but there
> are more issues to solve. This of course getting pretty far from the
> original topic, but at least one such issue is that there are some
> cases where a config value affects what are apparently public structs
> (rte_mbuf wrt RTE_MBUF_REFCNT for example), which really is a no-go.
>
Agree, the RTE_MBUF_REFCNT is something that needs to be dealt with
asap. I'll look into it.
>>>>
>>>> I think the problem is a little bit orthogonal to the libdpdk_core
>>>> problem you
>>>> were initially addressing. That is to say, this problem of
>>>> dlopen-ed PMD's
>>>> exists regardless of weather you build the DPDK as part of a static
>>>> or dynamic
>>>> library. The problems just happen to intersect in their
>>>> manipulation of the
>>>> DT_NEEDED entries.
>>>>
>>>> Ok, so, given the above, I would say your approach is likely
>>>> correct, just
>>>> prevent DT_NEEDED entries from getting added to PMD's. Doing so
>>>> will sidestep
>>>> loading issue for libraries that may not exist in the filesystem,
>>>> but thats ok,
>>>> because by all rights, the symbols codified in those needed
>>>> libraries should
>>>> already be present in the running application (either made
>>>> available by the
>>>> application having statically linked them, or having the linker
>>>> load them from
>>>> the proper libraries at run time).
>>>
>>> My 5c is that I'd much rather see the common case (all static or all
>>> shared)
>>> be simple and reliable, which in case of DSOs includes no lying
>>> (whether by
>>> omission or otherwise) about DT_NEEDED, ever. That way the issue is
>>> dealt
>>> once where it belongs. If somebody wants to go down the rabbit hole
>>> of mixed
>>> shared + static linkage, let them dig the hole by themselves :)
>>>
>> This is a fair point. Can DT_NEEDED sections be stripped via tools
>> like objcopy
>> after the build is complete? If so, end users can hack this corner
>> case to work
>> as needed.
>
> Patchelf (http://nixos.org/patchelf.html) appears to support that, but
> given that source is available it'd be easier to just modify the
> makefiles if that's really needed.
>
I think we agree on the issue.
So I'll be sending a patch to add DT_NEEDED entries to all libraries and
PMDs. The only exception would be librte_eal, which would not have
proper NEEDED entries.
Do we bother adding a linker script for librte_eal that would include
dependent libraries?
Sergio
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-02-12 15:52 3% ` Neil Horman
@ 2015-02-13 10:14 0% ` Panu Matilainen
2015-02-13 11:08 0% ` Gonzalez Monroy, Sergio
0 siblings, 1 reply; 200+ results
From: Panu Matilainen @ 2015-02-13 10:14 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On 02/12/2015 05:52 PM, Neil Horman wrote:
> On Thu, Feb 12, 2015 at 04:07:50PM +0200, Panu Matilainen wrote:
>> On 02/12/2015 02:23 PM, Neil Horman wrote:
[...snip...]
>>>>>>>
>>>>>> So I just realized that I was not having into account a possible
>>>>>> scenario, where
>>>>>> we have an app built with static dpdk libs then loading a dso with -d
>>>>>> option.
>>>>>>
>>>>>> In such case, because the pmd would have DT_NEEDED entries, dlopen will
>>>>>> fail.
>>>>>> So to enable such scenario we would need to build PMDs without DT_NEEDED
>>>>>> entries.
>>>>>
>>>>> Hmm, for that to be a problem you'd need to have the PMD built against
>>>>> shared dpdk libs and while the application is built against static dpdk
>>>>> libs. I dont think that's a supportable scenario in any case.
>>>>>
>>>>> Or is there some other scenario that I'm not seeing?
>>>>>
>>>>> - Panu -
>>>>>
>>>> I agree with you. I suppose it comes down to, do we want to support such
>>>> scenario?
>>>>
>>>> From what I can see, it seems that we do currently support such scenario by
>>>> building dpdk apps against all static dpdk libs using --whole-archive (all
>>>> libs and not only PMDs).
>>>> http://dpdk.org/browse/dpdk/commit/?id=20afd76a504155e947c770783ef5023e87136ad8
>>>>
>>>> Am I misunderstanding this?
>>>>
>>> Shoot, you're right, I missed the static build aspect to this. Yes, if we do the following:
>>>
>>> 1) Build the DPDK as a static library
>>> 2) Link an application against (1)
>>> 3) Use the dlopen mechanism to load a PMD built as a DSO
>>>
>>> Then the DT_NEEDED entries in the DSO will go unsatisfied, because the shared
>>> objects on which it (the PMD) depends will not exist in the file system.
>>
>> I think its even more twisty:
>>
>> 1) Build the DPDK as a static library
>> 2) Link an application against (1)
>> 3) Do another build of DPDK as a shared library
>> 4) In app 2), use the dlopen mechanism to load a PMD built as a part of or
>> against 3)
>>
>> Somehow I doubt this would work very well.
>>
> Ideally it should, presuming the ABI is preserved between (1) and (3), though I
> agree, up until recently, that was an assumption that was unreliable.
Versioning is a big and important step towards reliability but there are
more issues to solve. This of course getting pretty far from the
original topic, but at least one such issue is that there are some cases
where a config value affects what are apparently public structs
(rte_mbuf wrt RTE_MBUF_REFCNT for example), which really is a no-go.
>>>
>>> I think the problem is a little bit orthogonal to the libdpdk_core problem you
>>> were initially addressing. That is to say, this problem of dlopen-ed PMD's
>>> exists regardless of weather you build the DPDK as part of a static or dynamic
>>> library. The problems just happen to intersect in their manipulation of the
>>> DT_NEEDED entries.
>>>
>>> Ok, so, given the above, I would say your approach is likely correct, just
>>> prevent DT_NEEDED entries from getting added to PMD's. Doing so will sidestep
>>> loading issue for libraries that may not exist in the filesystem, but thats ok,
>>> because by all rights, the symbols codified in those needed libraries should
>>> already be present in the running application (either made available by the
>>> application having statically linked them, or having the linker load them from
>>> the proper libraries at run time).
>>
>> My 5c is that I'd much rather see the common case (all static or all shared)
>> be simple and reliable, which in case of DSOs includes no lying (whether by
>> omission or otherwise) about DT_NEEDED, ever. That way the issue is dealt
>> once where it belongs. If somebody wants to go down the rabbit hole of mixed
>> shared + static linkage, let them dig the hole by themselves :)
>>
> This is a fair point. Can DT_NEEDED sections be stripped via tools like objcopy
> after the build is complete? If so, end users can hack this corner case to work
> as needed.
Patchelf (http://nixos.org/patchelf.html) appears to support that, but
given that source is available it'd be easier to just modify the
makefiles if that's really needed.
- Panu -
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver
2015-02-13 8:19 4% ` [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver Chen Jing D(Mark)
2015-02-13 8:19 7% ` [dpdk-dev] [PATCH v5 17/17] fm10k: Add ABI version of librte_pmd_fm10k Chen Jing D(Mark)
@ 2015-02-13 8:37 0% ` Zhang, Helin
2015-02-15 5:07 0% ` Qiu, Michael
2 siblings, 0 replies; 200+ results
From: Zhang, Helin @ 2015-02-13 8:37 UTC (permalink / raw)
To: Chen, Jing D, dev
> -----Original Message-----
> From: Chen, Jing D
> Sent: Friday, February 13, 2015 4:20 PM
> To: dev@dpdk.org
> Cc: Zhang, Helin; Qiu, Michael; nhorman@tuxdriver.com;
> thomas.monjalon@6wind.com; david.marchand@6wind.com; Chen, Jing D
> Subject: [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver
>
> From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>
>
> The patch set add poll mode driver for the host interface of Intel Ethernet
> Switch FM10000 Series of silicons, which integrate NIC and switch
> functionalities. The patch set include below features:
>
> 1. Basic RX/TX functions for PF/VF.
> 2. Interrupt handling mechanism for PF/VF.
> 3. per queue start/stop functions for PF/VF.
> 4. Mailbox handling between PF/VF and PF/Switch Manager.
> 5. Receive Side Scaling (RSS) for PF/VF.
> 6. Scatter receive function for PF/VF.
> 7. reta update/query for PF/VF.
> 8. VLAN filter set for PF.
> 9. Link status query for PF/VF.
>
> Change in v5:
> - Add sanity check for mbuf allocation.
> - Add a new patch to claim fm10k driver review
> - Change commit log.
> - Add unlikely in func rx_desc_to_ol_flags to gain performance
> - Add a new patch to add ABI version
>
> Change in v4:
> - Change commit log to remove improper words.
>
> Changes in v3:
> - Update base driver.
> - Define several macros to pass base driver compile.
>
> Changes in v2:
> - Merge 3 patches into 1 to configure fm10k compile environment.
> - Rework on log code to follow style in ixgbe.
> - Rework log message, remove redundant '\n'
> - Update Copyright year from "2014" to "2015"
> - Change base driver directory name from SHARED to base
> - Add more description in log for patch "add PF and VF interrupt"
> - Merge 2 patches into 1 to register fm10k driver
> - Define macro to replace numeric for lower 32-bit mask.
>
> Chen Jing D(Mark) (1):
> maintainers: claim for fm10k review
>
> Jeff Shaw (15):
> fm10k: add base driver
> eal: add fm10k device id
> fm10k: register fm10k pmd PF driver
> Change config files to add fm10k into compile
> fm10k: add reta update/requery functions
> fm10k: add rx_queue_setup/release function
> fm10k: add tx_queue_setup/release function
> fm10k: add RX/TX single queue start/stop function
> fm10k: add dev start/stop functions
> fm10k: add receive and tranmit function
> fm10k: add PF RSS support
> fm10k: Add scatter receive function
> fm10k: add function to set vlan
> fm10k: Add SRIOV-VF support
> fm10k: add PF and VF interrupt handling function
>
> Michael Qiu (1):
> fm10k: Add ABI version of librte_pmd_fm10k
>
> MAINTAINERS | 4 +
> config/common_bsdapp | 11 +
> config/common_linuxapp | 11 +
> lib/Makefile | 1 +
> lib/librte_eal/common/include/rte_pci_dev_ids.h | 22 +
> lib/librte_pmd_fm10k/Makefile | 100 +
> lib/librte_pmd_fm10k/base/fm10k_api.c | 341 ++++
> lib/librte_pmd_fm10k/base/fm10k_api.h | 61 +
> lib/librte_pmd_fm10k/base/fm10k_common.c | 572 ++++++
> lib/librte_pmd_fm10k/base/fm10k_common.h | 52 +
> lib/librte_pmd_fm10k/base/fm10k_mbx.c | 2185
> +++++++++++++++++++++++
> lib/librte_pmd_fm10k/base/fm10k_mbx.h | 329 ++++
> lib/librte_pmd_fm10k/base/fm10k_osdep.h | 148 ++
> lib/librte_pmd_fm10k/base/fm10k_pf.c | 1992
> +++++++++++++++++++++
> lib/librte_pmd_fm10k/base/fm10k_pf.h | 155 ++
> lib/librte_pmd_fm10k/base/fm10k_tlv.c | 914 ++++++++++
> lib/librte_pmd_fm10k/base/fm10k_tlv.h | 199 ++
> lib/librte_pmd_fm10k/base/fm10k_type.h | 937 ++++++++++
> lib/librte_pmd_fm10k/base/fm10k_vf.c | 641 +++++++
> lib/librte_pmd_fm10k/base/fm10k_vf.h | 91 +
> lib/librte_pmd_fm10k/fm10k.h | 293 +++
> lib/librte_pmd_fm10k/fm10k_ethdev.c | 1868
> +++++++++++++++++++
> lib/librte_pmd_fm10k/fm10k_logs.h | 78 +
> lib/librte_pmd_fm10k/fm10k_rxtx.c | 459 +++++
> lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map | 4 +
> mk/rte.app.mk | 4 +
> 26 files changed, 11472 insertions(+), 0 deletions(-) create mode 100644
> lib/librte_pmd_fm10k/Makefile create mode 100644
> lib/librte_pmd_fm10k/base/fm10k_api.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_api.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_common.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_common.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_mbx.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_mbx.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_osdep.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_pf.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_pf.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_tlv.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_tlv.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_type.h
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_vf.c
> create mode 100644 lib/librte_pmd_fm10k/base/fm10k_vf.h
> create mode 100644 lib/librte_pmd_fm10k/fm10k.h create mode 100644
> lib/librte_pmd_fm10k/fm10k_ethdev.c
> create mode 100644 lib/librte_pmd_fm10k/fm10k_logs.h create mode
> 100644 lib/librte_pmd_fm10k/fm10k_rxtx.c create mode 100644
> lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map
>
> --
> 1.7.7.6
Acked-by: Helin Zhang <helin.zhang@intel.com>
^ permalink raw reply [relevance 0%]
* [dpdk-dev] [PATCH v5 17/17] fm10k: Add ABI version of librte_pmd_fm10k
2015-02-13 8:19 4% ` [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver Chen Jing D(Mark)
@ 2015-02-13 8:19 7% ` Chen Jing D(Mark)
2015-02-13 8:37 0% ` [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver Zhang, Helin
2015-02-15 5:07 0% ` Qiu, Michael
2 siblings, 0 replies; 200+ results
From: Chen Jing D(Mark) @ 2015-02-13 8:19 UTC (permalink / raw)
To: dev
From: Michael Qiu <michael.qiu@intel.com>
ABI version must be specified, set to version 1 for DPDK 2.0
Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
---
lib/librte_pmd_fm10k/Makefile | 4 ++++
lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map | 4 ++++
2 files changed, 8 insertions(+), 0 deletions(-)
create mode 100644 lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map
diff --git a/lib/librte_pmd_fm10k/Makefile b/lib/librte_pmd_fm10k/Makefile
index 8ab788c..986f4ef 100644
--- a/lib/librte_pmd_fm10k/Makefile
+++ b/lib/librte_pmd_fm10k/Makefile
@@ -39,6 +39,10 @@ LIB = librte_pmd_fm10k.a
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+EXPORT_MAP := rte_pmd_fm10k_version.map
+
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map b/lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map
new file mode 100644
index 0000000..ef35398
--- /dev/null
+++ b/lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map
@@ -0,0 +1,4 @@
+DPDK_2.0 {
+
+ local: *;
+};
--
1.7.7.6
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver
@ 2015-02-13 8:19 4% ` Chen Jing D(Mark)
2015-02-13 8:19 7% ` [dpdk-dev] [PATCH v5 17/17] fm10k: Add ABI version of librte_pmd_fm10k Chen Jing D(Mark)
` (2 more replies)
0 siblings, 3 replies; 200+ results
From: Chen Jing D(Mark) @ 2015-02-13 8:19 UTC (permalink / raw)
To: dev
From: "Chen Jing D(Mark)" <jing.d.chen@intel.com>
The patch set add poll mode driver for the host interface of Intel
Ethernet Switch FM10000 Series of silicons, which integrate NIC and
switch functionalities. The patch set include below features:
1. Basic RX/TX functions for PF/VF.
2. Interrupt handling mechanism for PF/VF.
3. per queue start/stop functions for PF/VF.
4. Mailbox handling between PF/VF and PF/Switch Manager.
5. Receive Side Scaling (RSS) for PF/VF.
6. Scatter receive function for PF/VF.
7. reta update/query for PF/VF.
8. VLAN filter set for PF.
9. Link status query for PF/VF.
Change in v5:
- Add sanity check for mbuf allocation.
- Add a new patch to claim fm10k driver review
- Change commit log.
- Add unlikely in func rx_desc_to_ol_flags to gain performance
- Add a new patch to add ABI version
Change in v4:
- Change commit log to remove improper words.
Changes in v3:
- Update base driver.
- Define several macros to pass base driver compile.
Changes in v2:
- Merge 3 patches into 1 to configure fm10k compile environment.
- Rework on log code to follow style in ixgbe.
- Rework log message, remove redundant '\n'
- Update Copyright year from "2014" to "2015"
- Change base driver directory name from SHARED to base
- Add more description in log for patch "add PF and VF interrupt"
- Merge 2 patches into 1 to register fm10k driver
- Define macro to replace numeric for lower 32-bit mask.
Chen Jing D(Mark) (1):
maintainers: claim for fm10k review
Jeff Shaw (15):
fm10k: add base driver
eal: add fm10k device id
fm10k: register fm10k pmd PF driver
Change config files to add fm10k into compile
fm10k: add reta update/requery functions
fm10k: add rx_queue_setup/release function
fm10k: add tx_queue_setup/release function
fm10k: add RX/TX single queue start/stop function
fm10k: add dev start/stop functions
fm10k: add receive and tranmit function
fm10k: add PF RSS support
fm10k: Add scatter receive function
fm10k: add function to set vlan
fm10k: Add SRIOV-VF support
fm10k: add PF and VF interrupt handling function
Michael Qiu (1):
fm10k: Add ABI version of librte_pmd_fm10k
MAINTAINERS | 4 +
config/common_bsdapp | 11 +
config/common_linuxapp | 11 +
lib/Makefile | 1 +
lib/librte_eal/common/include/rte_pci_dev_ids.h | 22 +
lib/librte_pmd_fm10k/Makefile | 100 +
lib/librte_pmd_fm10k/base/fm10k_api.c | 341 ++++
lib/librte_pmd_fm10k/base/fm10k_api.h | 61 +
lib/librte_pmd_fm10k/base/fm10k_common.c | 572 ++++++
lib/librte_pmd_fm10k/base/fm10k_common.h | 52 +
lib/librte_pmd_fm10k/base/fm10k_mbx.c | 2185 +++++++++++++++++++++++
lib/librte_pmd_fm10k/base/fm10k_mbx.h | 329 ++++
lib/librte_pmd_fm10k/base/fm10k_osdep.h | 148 ++
lib/librte_pmd_fm10k/base/fm10k_pf.c | 1992 +++++++++++++++++++++
lib/librte_pmd_fm10k/base/fm10k_pf.h | 155 ++
lib/librte_pmd_fm10k/base/fm10k_tlv.c | 914 ++++++++++
lib/librte_pmd_fm10k/base/fm10k_tlv.h | 199 ++
lib/librte_pmd_fm10k/base/fm10k_type.h | 937 ++++++++++
lib/librte_pmd_fm10k/base/fm10k_vf.c | 641 +++++++
lib/librte_pmd_fm10k/base/fm10k_vf.h | 91 +
lib/librte_pmd_fm10k/fm10k.h | 293 +++
lib/librte_pmd_fm10k/fm10k_ethdev.c | 1868 +++++++++++++++++++
lib/librte_pmd_fm10k/fm10k_logs.h | 78 +
lib/librte_pmd_fm10k/fm10k_rxtx.c | 459 +++++
lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map | 4 +
mk/rte.app.mk | 4 +
26 files changed, 11472 insertions(+), 0 deletions(-)
create mode 100644 lib/librte_pmd_fm10k/Makefile
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_api.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_api.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_common.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_common.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_mbx.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_mbx.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_osdep.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_pf.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_pf.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_tlv.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_tlv.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_type.h
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_vf.c
create mode 100644 lib/librte_pmd_fm10k/base/fm10k_vf.h
create mode 100644 lib/librte_pmd_fm10k/fm10k.h
create mode 100644 lib/librte_pmd_fm10k/fm10k_ethdev.c
create mode 100644 lib/librte_pmd_fm10k/fm10k_logs.h
create mode 100644 lib/librte_pmd_fm10k/fm10k_rxtx.c
create mode 100644 lib/librte_pmd_fm10k/rte_pmd_fm10k_version.map
--
1.7.7.6
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 2/3] ethdev: Add in data rxtx callback support
@ 2015-02-12 21:12 3% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-02-12 21:12 UTC (permalink / raw)
To: John McNamara; +Cc: dev
On Thu, Feb 12, 2015 at 07:57:56PM +0000, John McNamara wrote:
> From: Richardson, Bruce <bruce.richardson@intel.com>
>
> Add in support for inline processing of packets inside the RX or
> TX call. For an RX callback, what happens is that we get a set of
> packets from the NIC and then pass them to a callback function, if
> configured, to allow additional processing to be done on them, e.g.
> filling in more mbuf fields, before passing back to the application.
> On TX, the packets are similarly post-processed before being handed
> to the NIC for transmission.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> lib/librte_ether/rte_ethdev.c | 165 +++++++++++++++++++++++++++++++++++++-
> lib/librte_ether/rte_ethdev.h | 175 ++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 334 insertions(+), 6 deletions(-)
>
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index e4b3315..944737e 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -337,6 +337,15 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)
> dev->data->nb_rx_queues = 0;
> return -(ENOMEM);
> }
> + dev->rx_cbs = rte_zmalloc("ethdev->rx_cbs",
> + sizeof(*dev->rx_cbs) * nb_queues,
> + RTE_CACHE_LINE_SIZE);
> + if (dev->rx_cbs == NULL) {
> + rte_free(dev->data->rx_queues);
> + dev->data->rx_queues = NULL;
> + dev->data->nb_rx_queues = 0;
> + return -(ENOMEM);
> + }
> } else { /* re-configure */
> FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_release, -ENOTSUP);
>
> @@ -348,10 +357,18 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)
> RTE_CACHE_LINE_SIZE);
> if (rxq == NULL)
> return -(ENOMEM);
> + dev->rx_cbs = rte_realloc(dev->rx_cbs, sizeof(*dev->rx_cbs) *
> + nb_queues, RTE_CACHE_LINE_SIZE);
> + if (dev->rx_cbs == NULL)
> + return -(ENOMEM);
>
> - if (nb_queues > old_nb_queues)
> + if (nb_queues > old_nb_queues) {
> + uint16_t new_qs = nb_queues - old_nb_queues;
> memset(rxq + old_nb_queues, 0,
> - sizeof(rxq[0]) * (nb_queues - old_nb_queues));
> + sizeof(rxq[0]) * new_qs);
> + memset(dev->rx_cbs + old_nb_queues, 0,
> + sizeof(dev->rx_cbs[0]) * new_qs);
> + }
>
> dev->data->rx_queues = rxq;
>
> @@ -479,6 +496,15 @@ rte_eth_dev_tx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)
> dev->data->nb_tx_queues = 0;
> return -(ENOMEM);
> }
> + dev->tx_cbs = rte_zmalloc("ethdev->tx_cbs",
> + sizeof(*dev->tx_cbs) * nb_queues,
> + RTE_CACHE_LINE_SIZE);
> + if (dev->tx_cbs == NULL) {
> + rte_free(dev->data->tx_queues);
> + dev->data->tx_queues = NULL;
> + dev->data->nb_tx_queues = 0;
> + return -(ENOMEM);
> + }
> } else { /* re-configure */
> FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_queue_release, -ENOTSUP);
>
> @@ -490,10 +516,19 @@ rte_eth_dev_tx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)
> RTE_CACHE_LINE_SIZE);
> if (txq == NULL)
> return -(ENOMEM);
> + dev->tx_cbs = rte_realloc(dev->tx_cbs, sizeof(*dev->tx_cbs) *
> + nb_queues, RTE_CACHE_LINE_SIZE);
> + if (dev->tx_cbs == NULL)
> + return -(ENOMEM);
> +
>
> - if (nb_queues > old_nb_queues)
> + if (nb_queues > old_nb_queues) {
> + uint16_t new_qs = nb_queues - old_nb_queues;
> memset(txq + old_nb_queues, 0,
> - sizeof(txq[0]) * (nb_queues - old_nb_queues));
> + sizeof(txq[0]) * new_qs);
> + memset(dev->tx_cbs + old_nb_queues, 0,
> + sizeof(dev->tx_cbs[0]) * new_qs);
> + }
>
> dev->data->tx_queues = txq;
>
> @@ -3253,3 +3288,125 @@ rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type,
> FUNC_PTR_OR_ERR_RET(*dev->dev_ops->filter_ctrl, -ENOTSUP);
> return (*dev->dev_ops->filter_ctrl)(dev, filter_type, filter_op, arg);
> }
> +
> +void *
> +rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id,
> + rte_rxtx_callback_fn fn, void *user_param)
> +{
These, and its companion manipulator functions need to be added to the ABI
versioning scripts. As it currently stands this won't be exposed in a shared
build, and so the examples won't build.
Neil
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
@ 2015-02-12 15:52 3% ` Neil Horman
2015-02-13 10:14 0% ` Panu Matilainen
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-02-12 15:52 UTC (permalink / raw)
To: Panu Matilainen; +Cc: dev
On Thu, Feb 12, 2015 at 04:07:50PM +0200, Panu Matilainen wrote:
> On 02/12/2015 02:23 PM, Neil Horman wrote:
> >On Thu, Feb 12, 2015 at 10:03:51AM +0000, Gonzalez Monroy, Sergio wrote:
> >>On 12/02/2015 09:22, Panu Matilainen wrote:
> >>>On 02/11/2015 01:11 PM, Gonzalez Monroy, Sergio wrote:
> >>>>>From: Neil Horman [mailto:nhorman@tuxdriver.com]
> >>>>>Sent: Friday, January 30, 2015 6:13 PM
> >>>>>To: Gonzalez Monroy, Sergio
> >>>>>Cc: Thomas Monjalon; dev@dpdk.org
> >>>>>Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> >>>>>
> >>>>>On Fri, Jan 30, 2015 at 05:38:49PM +0000, Gonzalez Monroy, Sergio
> >>>>>wrote:
> >>>>
> >>>>[snip]
> >>>>
> >>>>>>
> >>>>>>So would it be reasonable to add DT_NEEDED entries to all DPDK
> >>>>>>libraries
> >>>>>but EAL?
> >>>>>>If I understood what you were saying right, we could enforce the
> >>>>>>'dependency' in the linker script with something like this:
> >>>>>>$ cat librte_eal.so
> >>>>>>INPUT( librte_eal.so.1 -lrte_mempool -lrte_malloc) We could have such
> >>>>>>linker script for librte_eal.so instead of the soft link once
> >>>>>>versioning is in place.
> >>>>>>
> >>>>>Correct.
> >>>>>
> >>>>>>Things that would be missing versus the proposed patch:
> >>>>>> - As I have mention in previous post, ldd info for EAL library
> >>>>>>would not
> >>>>>reflect
> >>>>>> its dependency to other DPDK libs.
> >>>>>librte_eal.so would no show those dependencies, as far as I know
> >>>>>(though I
> >>>>>haven't explicitly checked). The subordunate libraries included in
> >>>>>the input
> >>>>>line, may or may not show dependencies among themselves, depending on
> >>>>>your build setup (and the use of --no-as-needed and -l when linking the
> >>>>>individual .so libraries.
> >>>>>
> >>>>>> - I was enforcing resolving all references when building the
> >>>>>>libraries (-z
> >>>>>defs), so
> >>>>>> we either remove it altogether or skip eal.
> >>>>>I think thats correct, yes.
> >>>>>
> >>>>>> - All apps would show DT_NEEDED entries for a set of DPDK
> >>>>>>libraries that
> >>>>>> in most cases are required (eal, mempool, malloc, mbuf, ring VS
> >>>>>>dpdk_core)
> >>>>>>
> >>>>>I think apps linked to libdpdk_core would have DT_NEEDED entries for
> >>>>>libdpdk_core, not the subordonate libraries (though check me on that
> >>>>>to be
> >>>>>sure).
> >>>>>
> >>>>Just checked on this and they do link against the subordinate libraries,
> >>>>although
> >>>>It does not really matter as we are dropping the 'core' library approach
> >>>>anyway.
> >>>>
> >>>>>>I think that the linker script approach is reasonable if we prefer to
> >>>>>>go that way instead of creating a core library.
> >>>>>>
> >>>>>I think it would make sense from a build environment point of view, in
> >>>>>that it
> >>>>>allows library specific flags to be incorporated properly. I think
> >>>>>the only
> >>>>>downside is that the individual libraries still need to be carried
> >>>>>around
> >>>>>(though they can be ignored from an application build/run standpoint).
> >>>>>You're question should probably be asked of people using COMBINED_LIBS
> >>>>>currently to make sure that meets their needs, though I think it will.
> >>>>>
> >>>>>Neil
> >>>>>
> >>>>So I just realized that I was not having into account a possible
> >>>>scenario, where
> >>>>we have an app built with static dpdk libs then loading a dso with -d
> >>>>option.
> >>>>
> >>>>In such case, because the pmd would have DT_NEEDED entries, dlopen will
> >>>>fail.
> >>>>So to enable such scenario we would need to build PMDs without DT_NEEDED
> >>>>entries.
> >>>
> >>>Hmm, for that to be a problem you'd need to have the PMD built against
> >>>shared dpdk libs and while the application is built against static dpdk
> >>>libs. I dont think that's a supportable scenario in any case.
> >>>
> >>>Or is there some other scenario that I'm not seeing?
> >>>
> >>> - Panu -
> >>>
> >>I agree with you. I suppose it comes down to, do we want to support such
> >>scenario?
> >>
> >> From what I can see, it seems that we do currently support such scenario by
> >>building dpdk apps against all static dpdk libs using --whole-archive (all
> >>libs and not only PMDs).
> >>http://dpdk.org/browse/dpdk/commit/?id=20afd76a504155e947c770783ef5023e87136ad8
> >>
> >>Am I misunderstanding this?
> >>
> >Shoot, you're right, I missed the static build aspect to this. Yes, if we do the following:
> >
> >1) Build the DPDK as a static library
> >2) Link an application against (1)
> >3) Use the dlopen mechanism to load a PMD built as a DSO
> >
> >Then the DT_NEEDED entries in the DSO will go unsatisfied, because the shared
> >objects on which it (the PMD) depends will not exist in the file system.
>
> I think its even more twisty:
>
> 1) Build the DPDK as a static library
> 2) Link an application against (1)
> 3) Do another build of DPDK as a shared library
> 4) In app 2), use the dlopen mechanism to load a PMD built as a part of or
> against 3)
>
> Somehow I doubt this would work very well.
>
Ideally it should, presuming the ABI is preserved between (1) and (3), though I
agree, up until recently, that was an assumption that was unreliable.
> >
> >I think the problem is a little bit orthogonal to the libdpdk_core problem you
> >were initially addressing. That is to say, this problem of dlopen-ed PMD's
> >exists regardless of weather you build the DPDK as part of a static or dynamic
> >library. The problems just happen to intersect in their manipulation of the
> >DT_NEEDED entries.
> >
> >Ok, so, given the above, I would say your approach is likely correct, just
> >prevent DT_NEEDED entries from getting added to PMD's. Doing so will sidestep
> >loading issue for libraries that may not exist in the filesystem, but thats ok,
> >because by all rights, the symbols codified in those needed libraries should
> >already be present in the running application (either made available by the
> >application having statically linked them, or having the linker load them from
> >the proper libraries at run time).
>
> My 5c is that I'd much rather see the common case (all static or all shared)
> be simple and reliable, which in case of DSOs includes no lying (whether by
> omission or otherwise) about DT_NEEDED, ever. That way the issue is dealt
> once where it belongs. If somebody wants to go down the rabbit hole of mixed
> shared + static linkage, let them dig the hole by themselves :)
>
This is a fair point. Can DT_NEEDED sections be stripped via tools like objcopy
after the build is complete? If so, end users can hack this corner case to work
as needed.
Neil
> - Panu -
>
> >Regards
> >Neil
> >
> >>Regards,
> >>Sergio
> >>
>
>
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH] x32 ABI support, first iteration
2015-02-09 10:22 4% ` [dpdk-dev] [PATCH] x32 ABI support, first iteration Ananyev, Konstantin
@ 2015-02-12 13:18 4% ` De Lara Guarch, Pablo
0 siblings, 0 replies; 200+ results
From: De Lara Guarch, Pablo @ 2015-02-12 13:18 UTC (permalink / raw)
To: Ananyev, Konstantin, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev,
> Konstantin
> Sent: Monday, February 09, 2015 10:23 AM
> To: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] x32 ABI support, first iteration
>
> > Subject: [PATCH] x32 ABI support, first iteration
> >
> > Signed-off-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
> > Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod at intel.com>
> > ---
> > config/defconfig_x86_x32-native-linuxapp-gcc | 46
> ++++++++++++++++++++
> > mk/arch/x86_x32/rte.vars.mk | 63
> ++++++++++++++++++++++++++++
> > 2 files changed, 109 insertions(+)
> > create mode 100644 config/defconfig_x86_x32-native-linuxapp-gcc
> > create mode 100644 mk/arch/x86_x32/rte.vars.mk
> >
> > --
>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Just add that documentation should be updated for this.
> > 1.9.1
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 0/3] update maintainers areas
2015-02-04 22:23 4% [dpdk-dev] [PATCH 0/3] update maintainers areas Thomas Monjalon
2015-02-04 22:23 14% ` [dpdk-dev] [PATCH 2/3] maintainers: add ABI versioning Thomas Monjalon
@ 2015-02-09 14:21 0% ` Thomas Monjalon
1 sibling, 0 replies; 200+ results
From: Thomas Monjalon @ 2015-02-09 14:21 UTC (permalink / raw)
To: dev
> More files should be referenced in MAINTAINERS files:
> - some (forgotten) docs can be co-maintained in doc and lib areas
> - new ABI files
> The script can now check for unknown files.
>
> Thomas Monjalon (3):
> maintainers: dispatch more doc
> maintainers: add ABI versioning
> scripts: check wrong patterns in maintainers file
Applied
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 2/3] maintainers: add ABI versioning
2015-02-05 1:39 4% ` Neil Horman
@ 2015-02-09 14:20 7% ` Thomas Monjalon
0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2015-02-09 14:20 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2015-02-04 20:39, Neil Horman:
> On Wed, Feb 04, 2015 at 11:23:23PM +0100, Thomas Monjalon wrote:
> > Reference the new framework and policy for ABI versioning,
> > in the MAINTAINERS file.
> >
> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> > ---
> > MAINTAINERS | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index f2b697e..7c0047b 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -54,6 +54,9 @@ F: doc/guides/prog_guide/build_app.rst
> > F: doc/guides/prog_guide/dev_kit_*
> > F: doc/guides/prog_guide/ext_app_lib_make_help.rst
> >
> > +ABI versioning
> > +F: lib/librte_compat/
> > +F: doc/guides/rel_notes/abi.rst
> >
> Feel free to add my name to this area of you feel its warranted.
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
OK Neil, your name is added as ABI versioning maintainer.
Thanks
--
Thomas
^ permalink raw reply [relevance 7%]
* Re: [dpdk-dev] [PATCH] x32 ABI support, first iteration
[not found] <2601191342CEEE43887BDE71AB977258213E4175@irsmsx105.ger.corp.intel.com>
@ 2015-02-09 10:22 4% ` Ananyev, Konstantin
2015-02-12 13:18 4% ` De Lara Guarch, Pablo
0 siblings, 1 reply; 200+ results
From: Ananyev, Konstantin @ 2015-02-09 10:22 UTC (permalink / raw)
To: dev
> Subject: [PATCH] x32 ABI support, first iteration
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod at intel.com>
> ---
> config/defconfig_x86_x32-native-linuxapp-gcc | 46 ++++++++++++++++++++
> mk/arch/x86_x32/rte.vars.mk | 63 ++++++++++++++++++++++++++++
> 2 files changed, 109 insertions(+)
> create mode 100644 config/defconfig_x86_x32-native-linuxapp-gcc
> create mode 100644 mk/arch/x86_x32/rte.vars.mk
>
> --
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 1.9.1
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH] x32 ABI support, first iteration
[not found] ` <86228AFD5BCD8E4EBFD2B90117B5E81E10D789EA@SHSMSX103.ccr.corp.intel.com>
@ 2015-02-09 5:29 4% ` Tang, HaifengX
0 siblings, 0 replies; 200+ results
From: Tang, HaifengX @ 2015-02-09 5:29 UTC (permalink / raw)
To: Mrzyglod, DanielX T, Ananyev, Konstantin, dev
Tested-by: Haifeng Tang <haifengx.tang@intel.com>
- Tested Commit: bfca21f8a0defa7173895ba00e30f685b3209b81
- OS&Kernel: Ubuntu 14.04 LTS 3.13.0-24-generic
- GCC: gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
- CPUIntel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
- NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection [8086:10fb]
- Default x86_x32-native-linuxapp-gcc configuration
- Regression test result Total 74 cases, 74 passed, 0 failed
pmd checksum_checking PASSED
packet_checking PASSED
ipfrag ipfrag_fragment PASSED
ipfrag_nofragment PASSED
ipfrag_normalfwd PASSED
cmdline cmdline_sample_commands PASSED
hello_world hello_world_all_cores PASSED
hello_world_single_core PASSED
timer timer_callbacks_verify PASSED
fdir fdir_filter_masks PASSED
fdir_flexbytes_filtering PASSED
fdir_matching PASSED
fdir_perfect_matching PASSED
fdir_signatures PASSED
fdir_space PASSED
fdir_vlanfiltering PASSED
dynamic_config dynamic_config_default_mode PASSED
dynamic_config_disable_promiscuous PASSED
dynamic_config_enable_promiscuous PASSED
jumboframes jumboframes_bigger_jumbo PASSED
jumboframes_jumbo_jumbo PASSED
jumboframes_jumbo_nojumbo PASSED
jumboframes_normal_jumbo PASSED
jumboframes_normal_nojumbo PASSED
scatter scatter_mbuf_1024 PASSED
ieee1588 ieee1588_disable PASSED
ieee1588_enable PASSED
l2fwd port_testing PASSED
checksum_offload checksum_offload_372664 PASSED
checksum_offload_372762 PASSED
checksum_offload_disable PASSED
checksum_offload_enable PASSED
link_flowctrl flowctrl_off_pause_fwd_off PASSED
flowctrl_off_pause_fwd_on PASSED
flowctrl_on_pause_fwd_off PASSED
flowctrl_on_pause_fwd_on PASSED
whitelist whitelist_add_remove_mac_address PASSED
whitelist_invalid_addresses PASSED
blacklist bl_allbutoneportblacklisted PASSED
bl_noblacklisted PASSED
bl_oneportblacklisted PASSED
shutdown_api change_linkspeed PASSED
change_numberrxdtxd PASSED
change_numberrxdtxdaftercycle PASSED
change_thresholds PASSED
enable_disablejumbo PASSED
enable_disablerss PASSED
link_stats PASSED
reconfigure_ports PASSED
reset_queues PASSED
set_promiscuousmode PASSED
stop_restart PASSED
stress_test PASSED
dual_vlan vlan_filter_config PASSED
vlan_filter_table PASSED
vlan_insert_config PASSED
vlan_random_test PASSED
vlan_strip_config PASSED
vlan_stripq_config PASSED
vlan_synthetic_test PASSED
vlan_tpid_config PASSED
l2fwd_fork floating PASSED
ports PASSED
respawn PASSED
stress_respawn PASSED
ipv4_reassembly only_maxflows_packets_are_forwarded PASSED
packets_are_forwarded_after_ttl_timeout PASSED
send_1K_frames_split_in_4_and_1K_maxflows PASSED
send_2K_frames_split_in_4_and_1K_maxflows PASSED
send_4K_frames_split_in_7_and_4K_maxflows PASSED
send_delayed_fragment_packet_is_forwarded PASSED
send_jumbo_frames PASSED
send_jumbo_frames_with_wrong_arguments PASSED
send_more_fragments_than_supported PASSED
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 3/7] hv: add basic vmbus support
2015-02-05 1:13 1% ` [dpdk-dev] [PATCH 3/7] hv: add basic vmbus support Stephen Hemminger
@ 2015-02-05 1:50 0% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-02-05 1:50 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, KY Srinivasan, Stephen Hemminger
On Wed, Feb 04, 2015 at 05:13:25PM -0800, Stephen Hemminger wrote:
> From: Stephen Hemminger <shemming@brocade.com>
>
> The hyper-v device driver forces the base EAL code to change
> to support multiple bus types. This is done changing the pci_device
> in ether driver to a generic union.
>
> As much as possible this is done in a backwards source compatiable
> way. It will break ABI for device drivers.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> lib/librte_eal/common/Makefile | 2 +-
> lib/librte_eal/common/eal_common_options.c | 5 +
> lib/librte_eal/common/eal_internal_cfg.h | 1 +
> lib/librte_eal/common/eal_options.h | 2 +
> lib/librte_eal/common/eal_private.h | 10 +
> lib/librte_eal/common/include/rte_pci.h | 2 +
> lib/librte_eal/common/include/rte_vmbus.h | 153 +++++++
> lib/librte_eal/linuxapp/eal/Makefile | 3 +
> lib/librte_eal/linuxapp/eal/eal.c | 5 +
> lib/librte_eal/linuxapp/eal/eal_vmbus.c | 658 +++++++++++++++++++++++++++++
> lib/librte_ether/rte_ethdev.c | 84 +++-
> lib/librte_ether/rte_ethdev.h | 15 +-
> 12 files changed, 932 insertions(+), 8 deletions(-)
> create mode 100644 lib/librte_eal/common/include/rte_vmbus.h
> create mode 100644 lib/librte_eal/linuxapp/eal/eal_vmbus.c
>
It seems like the vmbus functions need to be versioned here.
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 2/3] maintainers: add ABI versioning
2015-02-04 22:23 14% ` [dpdk-dev] [PATCH 2/3] maintainers: add ABI versioning Thomas Monjalon
@ 2015-02-05 1:39 4% ` Neil Horman
2015-02-09 14:20 7% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-02-05 1:39 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Wed, Feb 04, 2015 at 11:23:23PM +0100, Thomas Monjalon wrote:
> Reference the new framework and policy for ABI versioning,
> in the MAINTAINERS file.
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
> MAINTAINERS | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f2b697e..7c0047b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -54,6 +54,9 @@ F: doc/guides/prog_guide/build_app.rst
> F: doc/guides/prog_guide/dev_kit_*
> F: doc/guides/prog_guide/ext_app_lib_make_help.rst
>
> +ABI versioning
> +F: lib/librte_compat/
> +F: doc/guides/rel_notes/abi.rst
>
Feel free to add my name to this area of you feel its warranted.
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [relevance 4%]
* [dpdk-dev] [PATCH 3/7] hv: add basic vmbus support
@ 2015-02-05 1:13 1% ` Stephen Hemminger
2015-02-05 1:50 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2015-02-05 1:13 UTC (permalink / raw)
To: dev; +Cc: KY Srinivasan, Stephen Hemminger
From: Stephen Hemminger <shemming@brocade.com>
The hyper-v device driver forces the base EAL code to change
to support multiple bus types. This is done changing the pci_device
in ether driver to a generic union.
As much as possible this is done in a backwards source compatiable
way. It will break ABI for device drivers.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/Makefile | 2 +-
lib/librte_eal/common/eal_common_options.c | 5 +
lib/librte_eal/common/eal_internal_cfg.h | 1 +
lib/librte_eal/common/eal_options.h | 2 +
lib/librte_eal/common/eal_private.h | 10 +
lib/librte_eal/common/include/rte_pci.h | 2 +
lib/librte_eal/common/include/rte_vmbus.h | 153 +++++++
lib/librte_eal/linuxapp/eal/Makefile | 3 +
lib/librte_eal/linuxapp/eal/eal.c | 5 +
lib/librte_eal/linuxapp/eal/eal_vmbus.c | 658 +++++++++++++++++++++++++++++
lib/librte_ether/rte_ethdev.c | 84 +++-
lib/librte_ether/rte_ethdev.h | 15 +-
12 files changed, 932 insertions(+), 8 deletions(-)
create mode 100644 lib/librte_eal/common/include/rte_vmbus.h
create mode 100644 lib/librte_eal/linuxapp/eal/eal_vmbus.c
diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile
index 52c1a5f..f4326e9 100644
--- a/lib/librte_eal/common/Makefile
+++ b/lib/librte_eal/common/Makefile
@@ -33,7 +33,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
INC := rte_branch_prediction.h rte_common.h
INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
-INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h
+INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h rte_vmbus.h
INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
INC += rte_rwlock.h rte_tailq.h rte_interrupts.h rte_alarm.h
INC += rte_string_fns.h rte_version.h rte_tailq_elem.h
diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 67e02dc..b254b83 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -73,6 +73,7 @@ eal_long_options[] = {
{OPT_NO_HPET, 0, 0, OPT_NO_HPET_NUM},
{OPT_VMWARE_TSC_MAP, 0, 0, OPT_VMWARE_TSC_MAP_NUM},
{OPT_NO_PCI, 0, 0, OPT_NO_PCI_NUM},
+ {OPT_NO_VMBUS, 0, 0, OPT_NO_VMBUS_NUM},
{OPT_NO_HUGE, 0, 0, OPT_NO_HUGE_NUM},
{OPT_FILE_PREFIX, 1, 0, OPT_FILE_PREFIX_NUM},
{OPT_SOCKET_MEM, 1, 0, OPT_SOCKET_MEM_NUM},
@@ -441,6 +442,10 @@ eal_parse_common_option(int opt, const char *optarg,
conf->no_pci = 1;
break;
+ case OPT_NO_VMBUS_NUM:
+ conf->no_vmbus = 1;
+ break;
+
case OPT_NO_HPET_NUM:
conf->no_hpet = 1;
break;
diff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h
index e2ecb0d..0e7de34 100644
--- a/lib/librte_eal/common/eal_internal_cfg.h
+++ b/lib/librte_eal/common/eal_internal_cfg.h
@@ -66,6 +66,7 @@ struct internal_config {
volatile unsigned no_hugetlbfs; /**< true to disable hugetlbfs */
volatile unsigned xen_dom0_support; /**< support app running on Xen Dom0*/
volatile unsigned no_pci; /**< true to disable PCI */
+ volatile unsigned no_vmbus; /**< true to disable VMBUS */
volatile unsigned no_hpet; /**< true to disable HPET */
volatile unsigned vmware_tsc_map; /**< true to use VMware TSC mapping
* instead of native TSC */
diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h
index e476f8d..b6075b9 100644
--- a/lib/librte_eal/common/eal_options.h
+++ b/lib/librte_eal/common/eal_options.h
@@ -57,6 +57,8 @@ enum {
OPT_VMWARE_TSC_MAP_NUM,
#define OPT_NO_PCI "no-pci"
OPT_NO_PCI_NUM,
+#define OPT_NO_VMBUS "no-vmbus"
+ OPT_NO_VMBUS_NUM,
#define OPT_NO_HUGE "no-huge"
OPT_NO_HUGE_NUM,
#define OPT_FILE_PREFIX "file-prefix"
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 159cd66..af559a4 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -165,6 +165,16 @@ int rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr,
struct rte_pci_device *dev);
/**
+ * VMBUS related functions and structures
+ */
+int rte_eal_vmbus_init(void);
+
+struct rte_vmbus_driver;
+struct rte_vmbus_device;
+
+int rte_eal_vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
+ struct rte_vmbus_device *dev);
+/**
* Init tail queues for non-EAL library structures. This is to allow
* the rings, mempools, etc. lists to be shared among multiple processes
*
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index 66ed793..0ede642 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -199,6 +199,8 @@ struct rte_pci_driver {
#define RTE_PCI_DRV_FORCE_UNBIND 0x0004
/** Device driver supports link state interrupt */
#define RTE_PCI_DRV_INTR_LSC 0x0008
+/** Device driver needs VMBUS */
+#define RTE_PCI_DRV_NEED_HV_UIO 0x0010
/**< Internal use only - Macro used by pci addr parsing functions **/
#define GET_PCIADDR_FIELD(in, fd, lim, dlm) \
diff --git a/lib/librte_eal/common/include/rte_vmbus.h b/lib/librte_eal/common/include/rte_vmbus.h
new file mode 100644
index 0000000..2742cb1
--- /dev/null
+++ b/lib/librte_eal/common/include/rte_vmbus.h
@@ -0,0 +1,153 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
+ * Copyright(c) 2013-2015 Brocade Communications Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ *
+ */
+
+#ifndef _RTE_VMBUS_H_
+#define _RTE_VMBUS_H_
+
+/**
+ * @file
+ *
+ * RTE VMBUS Interface
+ */
+
+#include <sys/queue.h>
+
+/** Pathname of VMBUS devices directory. */
+#define SYSFS_VMBUS_DEVICES "/sys/bus/vmbus/devices"
+
+/** Formatting string for VMBUS device identifier: Ex: vmbus_0_9 */
+#define VMBUS_PRI_FMT "vmbus_0_%u"
+
+#define VMBUS_ID_ANY 0xFFFF
+
+#define VMBUS_NETWORK_DEVICE "{f8615163-df3e-46c5-913f-f2d2f965ed0e}"
+
+/** Maximum number of VMBUS resources. */
+#define VMBUS_MAX_RESOURCE 7
+
+/**
+ * A structure describing an ID for a VMBUS driver. Each driver provides a
+ * table of these IDs for each device that it supports.
+ */
+struct rte_vmbus_id {
+ uint16_t device_id; /**< VMBUS Device ID */
+ uint16_t sysfs_num; /**< vmbus_0_X */
+};
+
+/**
+ * A structure describing a VMBUS memory resource.
+ */
+struct rte_vmbus_resource {
+ uint64_t phys_addr; /**< Physical address, 0 if no resource. */
+ uint64_t len; /**< Length of the resource. */
+ void *addr; /**< Virtual address, NULL when not mapped. */
+};
+
+/**
+ * A structure describing a VMBUS device.
+ */
+struct rte_vmbus_device {
+ TAILQ_ENTRY(rte_vmbus_device) next; /**< Next probed VMBUS device. */
+ struct rte_vmbus_id id; /**< VMBUS ID. */
+ const struct rte_vmbus_driver *driver; /**< Associated driver */
+ int numa_node; /**< NUMA node connection */
+ unsigned int blacklisted:1; /**< Device is blacklisted */
+ struct rte_vmbus_resource mem_resource[VMBUS_MAX_RESOURCE]; /**< VMBUS Memory Resource */
+ uint32_t vmbus_monitor_id; /**< VMBus monitor ID for device */
+ int uio_fd; /** UIO device file descriptor */
+};
+
+/** Macro used to help building up tables of device IDs */
+#define RTE_VMBUS_DEVICE(dev) \
+ .device_id = (dev)
+
+struct rte_vmbus_driver;
+
+/**
+ * Initialisation function for the driver called during VMBUS probing.
+ */
+typedef int (vmbus_devinit_t)(struct rte_vmbus_driver *, struct rte_vmbus_device *);
+
+/**
+ * A structure describing a VMBUS driver.
+ */
+struct rte_vmbus_driver {
+ TAILQ_ENTRY(rte_vmbus_driver) next; /**< Next in list. */
+ const char *name; /**< Driver name. */
+ vmbus_devinit_t *devinit; /**< Device init. function. */
+ struct rte_vmbus_id *id_table; /**< ID table, NULL terminated. */
+ uint32_t drv_flags; /**< Flags contolling handling of device. */
+ const char *module_name; /**< Associated kernel module */
+};
+
+/**
+ * Probe the VMBUS device for registered drivers.
+ *
+ * Scan the content of the vmbus, and call the probe() function for
+ * all registered drivers that have a matching entry in its id_table
+ * for discovered devices.
+ *
+ * @return
+ * - 0 on success.
+ * - Negative on error.
+ */
+int rte_eal_vmbus_probe(void);
+
+/**
+ * Dump the content of the vmbus.
+ */
+void rte_eal_vmbus_dump(void);
+
+/**
+ * Register a VMBUS driver.
+ *
+ * @param driver
+ * A pointer to a rte_vmbus_driver structure describing the driver
+ * to be registered.
+ */
+void rte_eal_vmbus_register(struct rte_vmbus_driver *driver);
+
+/**
+ * Unregister a VMBUS driver.
+ *
+ * @param driver
+ * A pointer to a rte_vmbus_driver structure describing the driver
+ * to be unregistered.
+ */
+void rte_eal_vmbus_unregister(struct rte_vmbus_driver *driver);
+
+int vmbus_uio_map_resource(struct rte_vmbus_device *dev);
+
+#endif /* _RTE_VMBUS_H_ */
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index e117cec..e4727fb 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -74,6 +74,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_alarm.c
ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y)
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_ivshmem.c
endif
+ifeq ($(CONFIG_RTE_LIBRTE_HV_PMD),y)
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_vmbus.c
+endif
# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index f99e158..b750fd8 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -755,6 +755,11 @@ rte_eal_init(int argc, char **argv)
if (rte_eal_pci_init() < 0)
rte_panic("Cannot init PCI\n");
+#ifdef RTE_LIBRTE_HV_PMD
+ if (rte_eal_vmbus_init() < 0)
+ RTE_LOG(ERR, EAL, "Cannot init VMBUS\n");
+#endif
+
#ifdef RTE_LIBRTE_IVSHMEM
if (rte_eal_ivshmem_init() < 0)
rte_panic("Cannot init IVSHMEM\n");
diff --git a/lib/librte_eal/linuxapp/eal/eal_vmbus.c b/lib/librte_eal/linuxapp/eal/eal_vmbus.c
new file mode 100644
index 0000000..8f87679
--- /dev/null
+++ b/lib/librte_eal/linuxapp/eal/eal_vmbus.c
@@ -0,0 +1,658 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
+ * Copyright(c) 2013-2015 Brocade Communications Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ *
+ */
+
+#include <string.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/queue.h>
+
+#include <rte_log.h>
+#include <rte_vmbus.h>
+#include <rte_common.h>
+#include <rte_tailq.h>
+#include <rte_eal.h>
+#include <rte_malloc.h>
+
+#include "eal_filesystem.h"
+#include "eal_private.h"
+
+#define PROC_MODULES "/proc/modules"
+#define VMBUS_DRV_PATH "/sys/bus/vmbus/drivers/%s"
+
+TAILQ_HEAD(vmbus_device_list, rte_vmbus_device); /**< VMBUS devices in D-linked Q. */
+TAILQ_HEAD(vmbus_driver_list, rte_vmbus_driver); /**< VMBUS drivers in D-linked Q. */
+
+static struct vmbus_driver_list vmbus_driver_list =
+ TAILQ_HEAD_INITIALIZER(vmbus_driver_list);
+static struct vmbus_device_list vmbus_device_list =
+ TAILQ_HEAD_INITIALIZER(vmbus_device_list);
+
+struct uio_map {
+ void *addr;
+ uint64_t offset;
+ uint64_t size;
+ uint64_t phaddr;
+};
+
+/*
+ * For multi-process we need to reproduce all vmbus mappings in secondary
+ * processes, so save them in a tailq.
+ */
+struct uio_resource {
+ TAILQ_ENTRY(uio_resource) next;
+
+ struct rte_vmbus_id vmbus_addr;
+ char path[PATH_MAX];
+ size_t nb_maps;
+ struct uio_map maps[VMBUS_MAX_RESOURCE];
+};
+
+/*
+ * parse a sysfs file containing one integer value
+ * different to the eal version, as it needs to work with 64-bit values
+ */
+static int
+vmbus_parse_sysfs_value(const char *filename, uint64_t *val)
+{
+ FILE *f;
+ char buf[BUFSIZ];
+ char *end = NULL;
+
+ f = fopen(filename, "r");
+ if (f == NULL) {
+ RTE_LOG(ERR, EAL, "%s(): cannot open sysfs value %s\n",
+ __func__, filename);
+ return -1;
+ }
+
+ if (fgets(buf, sizeof(buf), f) == NULL) {
+ RTE_LOG(ERR, EAL, "%s(): cannot read sysfs value %s\n",
+ __func__, filename);
+ fclose(f);
+ return -1;
+ }
+ *val = strtoull(buf, &end, 0);
+ if ((buf[0] == '\0') || (end == NULL) || (*end != '\n')) {
+ RTE_LOG(ERR, EAL, "%s(): cannot parse sysfs value %s\n",
+ __func__, filename);
+ fclose(f);
+ return -1;
+ }
+ fclose(f);
+ return 0;
+}
+
+#define OFF_MAX ((uint64_t)(off_t)-1)
+static ssize_t
+vmbus_uio_get_mappings(const char *devname, struct uio_map maps[], size_t nb_maps)
+{
+ size_t i;
+ char dirname[PATH_MAX];
+ char filename[PATH_MAX];
+ uint64_t offset, size;
+
+ for (i = 0; i != nb_maps; i++) {
+
+ /* check if map directory exists */
+ snprintf(dirname, sizeof(dirname),
+ "%s/maps/map%zu", devname, i);
+
+ RTE_LOG(DEBUG, EAL, "Scanning maps in %s\n", (char *)dirname);
+
+ if (access(dirname, F_OK) != 0)
+ break;
+
+ /* get mapping offset */
+ snprintf(filename, sizeof(filename),
+ "%s/offset", dirname);
+ if (vmbus_parse_sysfs_value(filename, &offset) < 0) {
+ RTE_LOG(ERR, EAL,
+ "%s(): cannot parse offset of %s\n",
+ __func__, dirname);
+ return -1;
+ }
+
+ /* get mapping size */
+ snprintf(filename, sizeof(filename),
+ "%s/size", dirname);
+ if (vmbus_parse_sysfs_value(filename, &size) < 0) {
+ RTE_LOG(ERR, EAL,
+ "%s(): cannot parse size of %s\n",
+ __func__, dirname);
+ return -1;
+ }
+
+ /* get mapping physical address */
+ snprintf(filename, sizeof(filename),
+ "%s/addr", dirname);
+ if (vmbus_parse_sysfs_value(filename, &maps[i].phaddr) < 0) {
+ RTE_LOG(ERR, EAL,
+ "%s(): cannot parse addr of %s\n",
+ __func__, dirname);
+ return -1;
+ }
+
+ if ((offset > OFF_MAX) || (size > SIZE_MAX)) {
+ RTE_LOG(ERR, EAL,
+ "%s(): offset/size exceed system max value\n",
+ __func__);
+ return -1;
+ }
+
+ maps[i].offset = offset;
+ maps[i].size = size;
+ }
+ return i;
+}
+
+/* maximum time to wait that /dev/uioX appears */
+#define UIO_DEV_WAIT_TIMEOUT 3 /* seconds */
+
+/* map a particular resource from a file */
+static void *
+vmbus_map_resource(struct rte_vmbus_device *dev, void *requested_addr,
+ const char *devname, off_t offset, size_t size)
+{
+ int fd;
+ void *mapaddr;
+
+ if (dev->uio_fd <= 0) {
+#ifdef RTE_EAL_UNBIND_PORTS
+ /*
+ * open devname, and mmap it: it can take some time to
+ * appear, so we wait some time before returning an error
+ */
+ unsigned n;
+ fd = -1;
+ for (n = 0; n < UIO_DEV_WAIT_TIMEOUT*10 && fd < 0; n++) {
+ errno = 0;
+ fd = open(devname, O_RDWR);
+ if (fd < 0 && errno != ENOENT)
+ break;
+ usleep(100000);
+ }
+#else
+ /*
+ * open devname, to mmap it
+ */
+ fd = open(devname, O_RDWR);
+#endif
+ } else
+ fd = dev->uio_fd;
+
+ if (fd < 0) {
+ RTE_LOG(ERR, EAL, "Cannot open %s: %s\n",
+ devname, strerror(errno));
+ goto fail;
+ }
+
+ dev->uio_fd = fd;
+ /* Map the memory resource of device */
+ mapaddr = mmap(requested_addr, size, PROT_READ | PROT_WRITE,
+ MAP_SHARED, fd, offset);
+ if (mapaddr == MAP_FAILED ||
+ (requested_addr != NULL && mapaddr != requested_addr)) {
+ RTE_LOG(ERR, EAL, "%s(): cannot mmap(%s(%d), %p, 0x%lx, 0x%lx):"
+ " %s (%p)\n", __func__, devname, fd, requested_addr,
+ (unsigned long)size, (unsigned long)offset,
+ strerror(errno), mapaddr);
+ close(fd);
+ goto fail;
+ }
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ close(fd);
+
+ RTE_LOG(DEBUG, EAL, " VMBUS memory mapped at %p\n", mapaddr);
+
+ return mapaddr;
+
+fail:
+ return NULL;
+}
+
+/* map the resources of a vmbus device in virtual memory */
+int
+vmbus_uio_map_resource(struct rte_vmbus_device *dev)
+{
+ int i;
+ struct dirent *e;
+ DIR *dir;
+ char dirname[PATH_MAX];
+ char dirname2[PATH_MAX];
+ char devname[PATH_MAX]; /* contains the /dev/uioX */
+ void *mapaddr;
+ unsigned uio_num;
+ uint64_t phaddr;
+ uint64_t offset;
+ uint64_t pagesz;
+ ssize_t nb_maps;
+ struct rte_vmbus_id *loc = &dev->id;
+ struct uio_resource *uio_res;
+ struct uio_map *maps;
+
+ /* depending on kernel version, uio can be located in uio/uioX
+ * or uio:uioX */
+ snprintf(dirname, sizeof(dirname),
+ "/sys/bus/vmbus/devices/" VMBUS_PRI_FMT "/uio", loc->sysfs_num);
+
+ dir = opendir(dirname);
+ if (dir == NULL) {
+ /* retry with the parent directory */
+ snprintf(dirname, sizeof(dirname),
+ "/sys/bus/vmbus/devices/" VMBUS_PRI_FMT, loc->sysfs_num);
+ dir = opendir(dirname);
+
+ if (dir == NULL) {
+ RTE_LOG(ERR, EAL, "Cannot opendir %s\n", dirname);
+ return -1;
+ }
+ }
+
+ /* take the first file starting with "uio" */
+ while ((e = readdir(dir)) != NULL) {
+ /* format could be uio%d ...*/
+ int shortprefix_len = sizeof("uio") - 1;
+ /* ... or uio:uio%d */
+ int longprefix_len = sizeof("uio:uio") - 1;
+ char *endptr;
+
+ if (strncmp(e->d_name, "uio", 3) != 0)
+ continue;
+
+ /* first try uio%d */
+ errno = 0;
+ uio_num = strtoull(e->d_name + shortprefix_len, &endptr, 10);
+ if (errno == 0 && endptr != e->d_name) {
+ snprintf(dirname2, sizeof(dirname2),
+ "%s/uio%u", dirname, uio_num);
+ break;
+ }
+
+ /* then try uio:uio%d */
+ errno = 0;
+ uio_num = strtoull(e->d_name + longprefix_len, &endptr, 10);
+ if (errno == 0 && endptr != e->d_name) {
+ snprintf(dirname2, sizeof(dirname2),
+ "%s/uio:uio%u", dirname, uio_num);
+ break;
+ }
+ }
+ closedir(dir);
+
+ /* No uio resource found */
+ if (e == NULL) {
+ RTE_LOG(WARNING, EAL, " "VMBUS_PRI_FMT" not managed by UIO driver, "
+ "skipping\n", loc->sysfs_num);
+ return -1;
+ }
+
+ /* allocate the mapping details for secondary processes*/
+ uio_res = rte_zmalloc("UIO_RES", sizeof(*uio_res), 0);
+ if (uio_res == NULL) {
+ RTE_LOG(ERR, EAL,
+ "%s(): cannot store uio mmap details\n", __func__);
+ return -1;
+ }
+
+ snprintf(devname, sizeof(devname), "/dev/uio%u", uio_num);
+ snprintf(uio_res->path, sizeof(uio_res->path), "%s", devname);
+ memcpy(&uio_res->vmbus_addr, &dev->id, sizeof(uio_res->vmbus_addr));
+
+ /* collect info about device mappings */
+ nb_maps = vmbus_uio_get_mappings(dirname2, uio_res->maps,
+ sizeof(uio_res->maps) / sizeof(uio_res->maps[0]));
+ if (nb_maps < 0)
+ return nb_maps;
+
+ RTE_LOG(DEBUG, EAL, "Found %d memory maps for device "VMBUS_PRI_FMT"\n",
+ (int)nb_maps, loc->sysfs_num);
+
+ uio_res->nb_maps = nb_maps;
+
+ pagesz = sysconf(_SC_PAGESIZE);
+
+ maps = uio_res->maps;
+ for (i = 0; i != VMBUS_MAX_RESOURCE; i++) {
+ phaddr = maps[i].phaddr;
+ if (phaddr == 0)
+ continue;
+
+ RTE_LOG(DEBUG, EAL, " mem_map%d: addr=0x%lx len = %lu\n",
+ i,
+ maps[i].phaddr,
+ maps[i].size);
+
+ if (i != nb_maps) {
+ offset = i * pagesz;
+ mapaddr = vmbus_map_resource(dev, NULL, devname, (off_t)offset,
+ (size_t)maps[i].size);
+ if (mapaddr == NULL)
+ return -1;
+
+ /* Important: offset for mapping can be non-zero, pad the addr */
+ mapaddr = ((char *)mapaddr + maps[i].offset);
+ maps[i].addr = mapaddr;
+ maps[i].offset = offset;
+ dev->mem_resource[i].addr = mapaddr;
+ dev->mem_resource[i].phys_addr = phaddr;
+ dev->mem_resource[i].len = maps[i].size;
+ }
+ }
+
+ return 0;
+}
+
+/* Compare two VMBUS device addresses. */
+static int
+vmbus_compare(struct rte_vmbus_id *id, struct rte_vmbus_id *id2)
+{
+ return id->device_id > id2->device_id;
+}
+
+/* Scan one vmbus sysfs entry, and fill the devices list from it. */
+static int
+vmbus_scan_one(const char *name)
+{
+ char filename[PATH_MAX];
+ char buf[BUFSIZ];
+ char dirname[PATH_MAX];
+ unsigned long tmp;
+ struct rte_vmbus_device *dev;
+ FILE *f;
+
+ dev = rte_zmalloc("vmbus_device", sizeof(*dev), 0);
+ if (dev == NULL)
+ return -1;
+
+ snprintf(dirname, sizeof(dirname), "%s/%s",
+ SYSFS_VMBUS_DEVICES, name);
+
+ /* parse directory name in sysfs. this does not always reflect
+ * the device id read below.
+ */
+ unsigned int sysfs_num;
+ if (sscanf(name, VMBUS_PRI_FMT, &sysfs_num) != 1) {
+ RTE_LOG(ERR, EAL, "Unable to parse vmbus sysfs name\n");
+ rte_free(dev);
+ return -1;
+ }
+ dev->id.sysfs_num = sysfs_num;
+
+ /* get device id */
+ snprintf(filename, sizeof(filename), "%s/id", dirname);
+ if (eal_parse_sysfs_value(filename, &tmp) < 0) {
+ rte_free(dev);
+ return -1;
+ }
+ dev->id.device_id = (uint16_t)tmp;
+
+ /* get monitor id */
+ snprintf(filename, sizeof(filename), "%s/monitor_id", dirname);
+ if (eal_parse_sysfs_value(filename, &tmp) < 0) {
+ rte_free(dev);
+ return -1;
+ }
+ dev->vmbus_monitor_id = tmp;
+
+ /* compare class_id of device with {f8615163-df3e-46c5-913ff2d2f965ed0e} */
+ snprintf(filename, sizeof(filename), "%s/class_id", dirname);
+ f = fopen(filename, "r");
+ if (f == NULL) {
+ RTE_LOG(ERR, EAL, "%s(): cannot open sysfs value %s\n",
+ __func__, filename);
+ rte_free(dev);
+ return -1;
+ }
+ if (fgets(buf, sizeof(buf), f) == NULL) {
+ RTE_LOG(ERR, EAL, "%s(): cannot read sysfs value %s\n",
+ __func__, filename);
+ fclose(f);
+ rte_free(dev);
+ return -1;
+ }
+ fclose(f);
+
+ if (strncmp(buf, VMBUS_NETWORK_DEVICE, strlen(VMBUS_NETWORK_DEVICE))) {
+ RTE_LOG(DEBUG, EAL, "%s(): skip vmbus_0_%u with class_id = %s",
+ __func__, dev->id.sysfs_num, buf);
+ rte_free(dev);
+ return 0;
+ }
+
+ /* device is valid, add in list (sorted) */
+ RTE_LOG(DEBUG, EAL, "Adding vmbus device %d\n", dev->id.device_id);
+ if (!TAILQ_EMPTY(&vmbus_device_list)) {
+ struct rte_vmbus_device *dev2 = NULL;
+
+ TAILQ_FOREACH(dev2, &vmbus_device_list, next) {
+ if (vmbus_compare(&dev->id, &dev2->id))
+ continue;
+
+ TAILQ_INSERT_BEFORE(dev2, dev, next);
+ return 0;
+ }
+ }
+
+ TAILQ_INSERT_TAIL(&vmbus_device_list, dev, next);
+
+ return 0;
+}
+
+static int
+check_vmbus_device(const char *buf, int bufsize)
+{
+ char *n = strrchr(buf, '_');
+ /* the format is 'vmbus_0_%d' */
+ if (n == NULL)
+ return -1;
+ n++;
+ char *buf_copy = strndup(n, bufsize);
+ if (buf_copy == NULL) {
+ RTE_LOG(ERR, EAL, "%s(): failed to strndup: %s\n",
+ __func__, strerror(errno));
+ return -1;
+ }
+
+ int err = strtoul(buf_copy, NULL, 10);
+ free(buf_copy);
+
+ if (errno || err < 0) {
+ RTE_LOG(ERR, EAL, "%s(): can't parse devid: %s\n",
+ __func__, strerror(errno));
+ return -1;
+ }
+
+ return 0;
+}
+
+/*
+ * Scan the content of the vmbus, and the devices in the devices list
+ */
+static int
+vmbus_scan(void)
+{
+ struct dirent *e;
+ DIR *dir;
+
+ dir = opendir(SYSFS_VMBUS_DEVICES);
+ if (dir == NULL) {
+ if (errno == ENOENT)
+ return 0;
+ else {
+ RTE_LOG(ERR, EAL, "%s(): opendir failed: %s\n",
+ __func__, strerror(errno));
+ return -1;
+ }
+ }
+
+ while ((e = readdir(dir)) != NULL) {
+ if (e->d_name[0] == '.')
+ continue;
+
+ if (check_vmbus_device(e->d_name, sizeof(e->d_name)))
+ continue;
+
+ if (vmbus_scan_one(e->d_name) < 0)
+ goto error;
+ }
+ closedir(dir);
+ return 0;
+
+error:
+ closedir(dir);
+ return -1;
+}
+
+/* Init the VMBUS EAL subsystem */
+int rte_eal_vmbus_init(void)
+{
+ /* VMBUS can be disabled */
+ if (internal_config.no_vmbus)
+ return 0;
+
+ if (vmbus_scan() < 0) {
+ RTE_LOG(ERR, EAL, "%s(): Cannot scan vmbus\n", __func__);
+ return -1;
+ }
+ return 0;
+}
+
+/* Below is PROBE part of eal_vmbus library */
+
+/*
+ * If device ID match, call the devinit() function of the driver.
+ */
+int
+rte_eal_vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
+ struct rte_vmbus_device *dev)
+{
+ struct rte_vmbus_id *id_table;
+
+ for (id_table = dr->id_table; id_table->device_id != VMBUS_ID_ANY; id_table++) {
+
+ struct rte_vmbus_id *loc = &dev->id;
+
+ RTE_LOG(DEBUG, EAL, "VMBUS device "VMBUS_PRI_FMT"\n",
+ loc->sysfs_num);
+
+ RTE_LOG(DEBUG, EAL, " probe driver: %s\n", dr->name);
+
+ /* no initialization when blacklisted, return without error */
+ if (dev->blacklisted) {
+ RTE_LOG(DEBUG, EAL, " Device is blacklisted, not initializing\n");
+ return 0;
+ }
+
+ /* map the resources */
+ if (vmbus_uio_map_resource(dev) < 0)
+ return -1;
+
+ /* reference driver structure */
+ dev->driver = dr;
+
+ /* call the driver devinit() function */
+ return dr->devinit(dr, dev);
+ }
+
+ /* return positive value if driver is not found */
+ return 1;
+}
+
+/*
+ * call the devinit() function of all
+ * registered drivers for the vmbus device. Return -1 if no driver is
+ * found for this class of vmbus device.
+ * The present assumption is that we have drivers only for vmbus network
+ * devices. That's why we don't check driver's id_table now.
+ */
+static int
+vmbus_probe_all_drivers(struct rte_vmbus_device *dev)
+{
+ struct rte_vmbus_driver *dr = NULL;
+ int ret;
+
+ TAILQ_FOREACH(dr, &vmbus_driver_list, next) {
+ ret = rte_eal_vmbus_probe_one_driver(dr, dev);
+ if (ret < 0) {
+ /* negative value is an error */
+ RTE_LOG(ERR, EAL, "Failed to probe driver %s\n", dr->name);
+ break;
+ }
+ if (ret > 0) {
+ /* positive value means driver not found */
+ RTE_LOG(DEBUG, EAL, "Driver %s not found", dr->name);
+ continue;
+ }
+
+ RTE_LOG(DEBUG, EAL, "OK. Driver was found and probed.\n");
+ return 0;
+ }
+ return -1;
+}
+
+
+/*
+ * Scan the vmbus, and call the devinit() function for
+ * all registered drivers that have a matching entry in its id_table
+ * for discovered devices.
+ */
+int
+rte_eal_vmbus_probe(void)
+{
+ struct rte_vmbus_device *dev = NULL;
+
+ TAILQ_FOREACH(dev, &vmbus_device_list, next) {
+ RTE_LOG(DEBUG, EAL, "Probing driver for device %d ...\n",
+ dev->id.device_id);
+ vmbus_probe_all_drivers(dev);
+ }
+ return 0;
+}
+
+/* register vmbus driver */
+void
+rte_eal_vmbus_register(struct rte_vmbus_driver *driver)
+{
+ TAILQ_INSERT_TAIL(&vmbus_driver_list, driver, next);
+}
+
+/* unregister vmbus driver */
+void
+rte_eal_vmbus_unregister(struct rte_vmbus_driver *driver)
+{
+ TAILQ_REMOVE(&vmbus_driver_list, driver, next);
+}
+
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 4d803d0..f5a1d07 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -287,6 +287,57 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv,
return diag;
}
+#ifdef RTE_LIBRTE_HV_PMD
+static int
+rte_vmbus_dev_init(struct rte_vmbus_driver *vmbus_drv,
+ struct rte_vmbus_device *vmbus_dev)
+{
+ struct eth_driver *eth_drv = (struct eth_driver *)vmbus_drv;
+ struct rte_eth_dev *eth_dev;
+ char ethdev_name[RTE_ETH_NAME_MAX_LEN];
+ int diag;
+
+ snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN, "%u_%u",
+ vmbus_dev->id.device_id, vmbus_dev->id.sysfs_num);
+
+ eth_dev = rte_eth_dev_allocate(ethdev_name);
+ if (eth_dev == NULL)
+ return -ENOMEM;
+
+ if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+ eth_dev->data->dev_private = rte_zmalloc("ethdev private structure",
+ eth_drv->dev_private_size,
+ RTE_CACHE_LINE_SIZE);
+ if (eth_dev->data->dev_private == NULL)
+ rte_panic("Cannot allocate memzone for private port data\n");
+ }
+ eth_dev->vmbus_dev = vmbus_dev;
+ eth_dev->driver = eth_drv;
+ eth_dev->data->rx_mbuf_alloc_failed = 0;
+
+ /* init user callbacks */
+ TAILQ_INIT(&(eth_dev->callbacks));
+
+ /*
+ * Set the default maximum frame size.
+ */
+ eth_dev->data->mtu = ETHER_MTU;
+
+ /* Invoke PMD device initialization function */
+ diag = (*eth_drv->eth_dev_init)(eth_drv, eth_dev);
+ if (diag == 0)
+ return 0;
+
+ PMD_DEBUG_TRACE("driver %s: eth_dev_init(device_id=0x%x)"
+ " failed\n", vmbus_drv->name,
+ (unsigned) vmbus_dev->id.device_id);
+ if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+ rte_free(eth_dev->data->dev_private);
+ nb_ports--;
+ return diag;
+}
+#endif
+
/**
* Register an Ethernet [Poll Mode] driver.
*
@@ -304,8 +355,20 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv,
void
rte_eth_driver_register(struct eth_driver *eth_drv)
{
- eth_drv->pci_drv.devinit = rte_eth_dev_init;
- rte_eal_pci_register(ð_drv->pci_drv);
+ switch (eth_drv->bus_type) {
+ case RTE_BUS_PCI:
+ eth_drv->pci_drv.devinit = rte_eth_dev_init;
+ rte_eal_pci_register(ð_drv->pci_drv);
+ break;
+#ifdef RTE_LIBRTE_HV_PMD
+ case RTE_BUS_VMBUS:
+ eth_drv->vmbus_drv.devinit = rte_vmbus_dev_init;
+ rte_eal_vmbus_register(ð_drv->vmbus_drv);
+ break;
+#endif
+ default:
+ rte_panic("unknown bus type %u\n", eth_drv->bus_type);
+ }
}
int
@@ -1275,6 +1338,9 @@ rte_eth_has_link_state(uint8_t port_id)
}
dev = &rte_eth_devices[port_id];
+ if (dev->driver->bus_type != RTE_BUS_PCI)
+ return 0;
+
return (dev->pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) != 0;
}
@@ -1457,9 +1523,17 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)
FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
(*dev->dev_ops->dev_infos_get)(dev, dev_info);
- dev_info->pci_dev = dev->pci_dev;
- if (dev->driver)
- dev_info->driver_name = dev->driver->pci_drv.name;
+
+ if (dev->driver) {
+ switch (dev->driver->bus_type) {
+ case RTE_BUS_PCI:
+ dev_info->driver_name = dev->driver->pci_drv.name;
+ dev_info->pci_dev = dev->pci_dev;
+ break;
+ case RTE_BUS_VMBUS:
+ dev_info->driver_name = dev->driver->vmbus_drv.name;
+ }
+ }
}
void
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 9d43ca3..714f94d 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -175,6 +175,7 @@ extern "C" {
#include <rte_log.h>
#include <rte_interrupts.h>
#include <rte_pci.h>
+#include <rte_vmbus.h>
#include <rte_mbuf.h>
#include "rte_ether.h"
#include "rte_eth_ctrl.h"
@@ -1537,7 +1538,10 @@ struct rte_eth_dev {
struct rte_eth_dev_data *data; /**< Pointer to device data */
const struct eth_driver *driver;/**< Driver for this device */
struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
- struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing */
+ union {
+ struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing */
+ struct rte_vmbus_device *vmbus_dev; /**< VMBUS info. supplied by probing */
+ };
struct rte_eth_dev_cb_list callbacks; /**< User application callbacks */
};
@@ -1671,7 +1675,14 @@ typedef int (*eth_dev_init_t)(struct eth_driver *eth_drv,
* - The size of the private data to allocate for each matching device.
*/
struct eth_driver {
- struct rte_pci_driver pci_drv; /**< The PMD is also a PCI driver. */
+ union {
+ struct rte_pci_driver pci_drv; /**< The PMD is also a PCI driver. */
+ struct rte_vmbus_driver vmbus_drv;/**< The PMD is also a VMBUS drv. */
+ };
+ enum {
+ RTE_BUS_PCI=0,
+ RTE_BUS_VMBUS
+ } bus_type; /**< Device bus type. */
eth_dev_init_t eth_dev_init; /**< Device init function. */
unsigned int dev_private_size; /**< Size of device private data. */
};
--
2.1.4
^ permalink raw reply [relevance 1%]
* [dpdk-dev] [PATCH 2/3] maintainers: add ABI versioning
2015-02-04 22:23 4% [dpdk-dev] [PATCH 0/3] update maintainers areas Thomas Monjalon
@ 2015-02-04 22:23 14% ` Thomas Monjalon
2015-02-05 1:39 4% ` Neil Horman
2015-02-09 14:21 0% ` [dpdk-dev] [PATCH 0/3] update maintainers areas Thomas Monjalon
1 sibling, 1 reply; 200+ results
From: Thomas Monjalon @ 2015-02-04 22:23 UTC (permalink / raw)
To: dev
Reference the new framework and policy for ABI versioning,
in the MAINTAINERS file.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
MAINTAINERS | 3 +++
1 file changed, 3 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index f2b697e..7c0047b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -54,6 +54,9 @@ F: doc/guides/prog_guide/build_app.rst
F: doc/guides/prog_guide/dev_kit_*
F: doc/guides/prog_guide/ext_app_lib_make_help.rst
+ABI versioning
+F: lib/librte_compat/
+F: doc/guides/rel_notes/abi.rst
Environment Abstraction Layer
-----------------------------
--
2.2.2
^ permalink raw reply [relevance 14%]
* [dpdk-dev] [PATCH 0/3] update maintainers areas
@ 2015-02-04 22:23 4% Thomas Monjalon
2015-02-04 22:23 14% ` [dpdk-dev] [PATCH 2/3] maintainers: add ABI versioning Thomas Monjalon
2015-02-09 14:21 0% ` [dpdk-dev] [PATCH 0/3] update maintainers areas Thomas Monjalon
0 siblings, 2 replies; 200+ results
From: Thomas Monjalon @ 2015-02-04 22:23 UTC (permalink / raw)
To: dev
More files should be referenced in MAINTAINERS files:
- some (forgotten) docs can be co-maintained in doc and lib areas
- new ABI files
The script can now check for unknown files.
Thomas Monjalon (3):
maintainers: dispatch more doc
maintainers: add ABI versioning
scripts: check wrong patterns in maintainers file
MAINTAINERS | 9 +++++++++
scripts/check-maintainers.sh | 20 +++++++++++++++++++-
2 files changed, 28 insertions(+), 1 deletion(-)
--
2.2.2
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility
2015-02-03 16:01 0% ` [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Thomas Monjalon
@ 2015-02-03 20:20 0% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-02-03 20:20 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Tue, Feb 03, 2015 at 05:01:51PM +0100, Thomas Monjalon wrote:
> 2014-12-20 16:01, Neil Horman:
> > GI: [PATCH 1/4] compat: Add infrastructure to support symbol versioninBI
> > develops and changes quickly, which makes it difficult for
> > applications to keep up with the latest version of the library, especially when
> > it (the DPDK) is built as a set of shared objects, as applications may be built
> > against an older version of the library.
> >
> > To mitigate this, this patch series introduces support for library and symbol
> > versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
> >
> > 1) Adds initial support for library versioning. Each library now has a version
> > map that explicitly calls out what symbols are exported to using applications,
> > and assigns version(s) to them
> >
> > 2) Adds support macros so that when libraries create incompatible ABI's,
> > multiple versions may be supported so that applications linked against older
> > DPDK releases can continue to function
> >
> > 3) Adds library soname versioning suffixes so that when ABI's must be broken in
> > a fashion that requires a rebuild of older applications, they will break at load
> > time, rather than cause unexpected issues at run time.
> >
> > 4) Adds documentation for ABI policy, and provides space to document deprecated
> > ABI versions, so that applications might be warned of impending changes.
> >
> > With these elements in place the DPDK has some support to allow for the extended
> > maintenence of older API's while still allowing the freedom to develop new and
> > improved API's.
> >
> > Implementing this feature will require some additional effort on the part of
> > developers and reviewers. When reviewing patches, must be checked against
> > existing exports to ensure that the function prototypes are not changing. If
> > they are, the versioning macros must be used, and the library export map should
> > be updated to reflect the new version of the function.
> >
> > When data structures change, if those structures are application accessible,
> > apis that accept or return instances of those data structures should have new
> > versions created so that users of the old data structure version might co-exist
> > at the same time.
> >
> > Note it was requested that this series be delayed until DPDK 2.0, so this is a
> > repost, now that DPDK 1.8 has been tagged.
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > CC: "Robert Love" <robert.w.love@intel.com>
>
> After updating to version 2.0, and sorting symbol lists,
> Applied
>
> It's probably an important change which makes 2.0 number meaningful.
> Thanks
> --
> Thomas
>
Thank you Thomas! Just as a heads up, there may be some inconsistencies
resulting from patches that you merged between the time of my last repost and
the time of this merge. They'll be easy to fix as they will just amount to
symbol additions/removals from the various version map file. So please cc me on
any sucpicious build breaks in the next few days when building shared objects,
and I'll fix them up ASAP.
Neil
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (11 preceding siblings ...)
[not found] ` <1422898822-16422-1-git-send-email-nhorman@tuxdriver.com>
@ 2015-02-03 16:01 0% ` Thomas Monjalon
2015-02-03 20:20 0% ` Neil Horman
12 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2015-02-03 16:01 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2014-12-20 16:01, Neil Horman:
> GI: [PATCH 1/4] compat: Add infrastructure to support symbol versioninBI
> develops and changes quickly, which makes it difficult for
> applications to keep up with the latest version of the library, especially when
> it (the DPDK) is built as a set of shared objects, as applications may be built
> against an older version of the library.
>
> To mitigate this, this patch series introduces support for library and symbol
> versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
>
> 1) Adds initial support for library versioning. Each library now has a version
> map that explicitly calls out what symbols are exported to using applications,
> and assigns version(s) to them
>
> 2) Adds support macros so that when libraries create incompatible ABI's,
> multiple versions may be supported so that applications linked against older
> DPDK releases can continue to function
>
> 3) Adds library soname versioning suffixes so that when ABI's must be broken in
> a fashion that requires a rebuild of older applications, they will break at load
> time, rather than cause unexpected issues at run time.
>
> 4) Adds documentation for ABI policy, and provides space to document deprecated
> ABI versions, so that applications might be warned of impending changes.
>
> With these elements in place the DPDK has some support to allow for the extended
> maintenence of older API's while still allowing the freedom to develop new and
> improved API's.
>
> Implementing this feature will require some additional effort on the part of
> developers and reviewers. When reviewing patches, must be checked against
> existing exports to ensure that the function prototypes are not changing. If
> they are, the versioning macros must be used, and the library export map should
> be updated to reflect the new version of the function.
>
> When data structures change, if those structures are application accessible,
> apis that accept or return instances of those data structures should have new
> versions created so that users of the old data structure version might co-exist
> at the same time.
>
> Note it was requested that this series be delayed until DPDK 2.0, so this is a
> repost, now that DPDK 1.8 has been tagged.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> CC: "Robert Love" <robert.w.love@intel.com>
After updating to version 2.0, and sorting symbol lists,
Applied
It's probably an important change which makes 2.0 number meaningful.
Thanks
--
Thomas
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v9 4/4] docs: Add ABI documentation
[not found] ` <1422898822-16422-4-git-send-email-nhorman@tuxdriver.com>
@ 2015-02-03 15:24 8% ` Thomas Monjalon
0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2015-02-03 15:24 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
> Adding a document describing rudimentary ABI policy and adding notice space for
> any deprecation announcements
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Thanks Neil for writing the policy.
The version 2.0 will be the first to have a versioned ABI with LIBABIVER := 1.
Starting from there, we'll have to consider this ABI policy when preparing
next versions.
--
Thomas
^ permalink raw reply [relevance 8%]
* [dpdk-dev] [PATCH v2] ABI: Add abi checking utility
2015-01-30 21:16 17% [dpdk-dev] [PATCH] ABI: Add abi checking utility Neil Horman
@ 2015-02-02 18:18 17% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-02-02 18:18 UTC (permalink / raw)
To: dev
There was a request for an abi validation utiltyfor the ongoing ABI stability
work. As it turns out there is a abi compliance checker in development that
seems to be under active development and provides fairly detailed ABI compliance
reports. Its not yet intellegent enough to understand symbol versioning, but it
does provide the ability to identify symbols which have changed between
releases, along with details of the change, and offers develoeprs the
opportunity to identify which symbols then need versioning and validation for a
given update via manaul testing.
This script automates the use of the compliance checker between two arbitrarily
specified tags within the dpdk tree. To execute enter the $RTE_SDK directory
and run:
./scripts/validate_abi.sh $GIT_TAG1 $GIT_TAG2 $CONFIG
where $GIT_TAG1 and 2 are git tags and $CONFIG is a config specification
suitable for passing as the T= variable in the make config command.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Change Notes:
v2) Fixed some typos as requested by Thomas
---
scripts/validate_abi.sh | 241 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 241 insertions(+)
create mode 100755 scripts/validate_abi.sh
diff --git a/scripts/validate_abi.sh b/scripts/validate_abi.sh
new file mode 100755
index 0000000..31583df
--- /dev/null
+++ b/scripts/validate_abi.sh
@@ -0,0 +1,241 @@
+#!/bin/sh
+# BSD LICENSE
+#
+# Copyright(c) 2015 Neil Horman. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+#
+# 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
+# OWNER 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.
+
+TAG1=$1
+TAG2=$2
+TARGET=$3
+ABI_DIR=`mktemp -d -p /tmp ABI.XXXXXX`
+
+usage() {
+ echo "$0 <TAG1> <TAG2> <TARGET>"
+}
+
+log() {
+ local level=$1
+ shift
+ echo "$*"
+}
+
+validate_tags() {
+ git tag -l | grep -q "$TAG1"
+ if [ $? -ne 0 ]
+ then
+ echo "$TAG1 is invalid"
+ return
+ fi
+ git tag -l | grep -q "$TAG2"
+ if [ $? -ne 0 ]
+ then
+ echo "$TAG2 is invalid"
+ return
+ fi
+}
+
+validate_args() {
+ if [ -z "$TAG1" ]
+ then
+ echo "Must Specify TAG1"
+ return
+ fi
+ if [ -z "$TAG2" ]
+ then
+ echo "Must Specify TAG2"
+ return
+ fi
+ if [ -z "$TARGET" ]
+ then
+ echo "Must Specify a build target"
+ fi
+}
+
+
+cleanup_and_exit() {
+ rm -rf $ABI_DIR
+ exit $1
+}
+
+###########################################
+#START
+############################################
+
+#Save the current branch
+CURRENT_BRANCH=`git branch | grep \* | cut -d' ' -f2`
+
+if [ -n "$VERBOSE" ]
+then
+ export VERBOSE=/dev/stdout
+else
+ export VERBOSE=/dev/null
+fi
+
+# Validate that we have all the arguments we need
+res=$(validate_args)
+if [ -n "$res" ]
+then
+ echo $res
+ usage
+ cleanup_and_exit 1
+fi
+
+# Make sure our tags exist
+res=$(validate_tags)
+if [ -n "$res" ]
+then
+ echo $res
+ cleanup_and_exit 1
+fi
+
+ABICHECK=`which abi-compliance-checker 2>/dev/null`
+if [ $? -ne 0 ]
+then
+ log "INFO" "Cant find abi-compliance-checker utility"
+ cleanup_and_exit 1
+fi
+
+ABIDUMP=`which abi-dumper 2>/dev/null`
+if [ $? -ne 0 ]
+then
+ log "INFO" "Cant find abi-dumper utility"
+ cleanup_and_exit 1
+fi
+
+log "INFO" "We're going to check and make sure that applications built"
+log "INFO" "against DPDK DSOs from tag $TAG1 will still run when executed"
+log "INFO" "against DPDK DSOs built from tag $TAG2."
+log "INFO" ""
+
+# Check to make sure we have a clean tree
+git status | grep -q clean
+if [ $? -ne 0 ]
+then
+ log "WARN" "Working directory not clean, aborting"
+ cleanup_and_exit 1
+fi
+
+if [ ! -d ./.git ]
+then
+ log "WARN" "You must be in the root of the dpdk git tree"
+ log "WARN" "You are in $PWD"
+ cleanup_and_exit 1
+fi
+
+log "INFO" "Checking out version $TAG1 of the dpdk"
+# Move to the old version of the tree
+git checkout $TAG1
+
+# Make sure we configure SHARED libraries
+# Also turn off IGB and KNI as those require kernel headers to build
+sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
+sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
+sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
+
+export EXTRA_CFLAGS=-g
+export EXTRA_LDFLAGS=-g
+
+# Now configure the build
+log "INFO" "Configuring DPDK $TAG1"
+make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
+
+log "INFO" "Building DPDK $TAG1. This might take a moment"
+make O=$TARGET > $VERBOSE 2>&1
+
+if [ $? -ne 0 ]
+then
+ log "INFO" "THE BUILD FAILED. ABORTING"
+ cleanup_and_exit 1
+fi
+
+# Move to the lib directory
+cd $TARGET/lib
+log "INFO" "COLLECTING ABI INFORMATION FOR $TAG1"
+for i in `ls *.so`
+do
+ $ABIDUMP $i -o $ABI_DIR/$i-ABI-0.dump -lver $TAG1
+done
+cd ../..
+
+# Now clean the tree, checkout the second tag, and rebuild
+git clean -f -d
+git reset --hard
+# Move to the new version of the tree
+log "INFO" "Checking out version $TAG2 of the dpdk"
+git checkout $TAG2
+
+export EXTRA_CFLAGS=-g
+export EXTRA_LDFLAGS=-g
+
+# Make sure we configure SHARED libraries
+# Also turn off IGB and KNI as those require kernel headers to build
+sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
+sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
+sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
+
+# Now configure the build
+log "INFO" "Configuring DPDK $TAG2"
+make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
+
+log "INFO" "Building DPDK $TAG2. This might take a moment"
+make O=$TARGET > $VERBOSE 2>&1
+
+if [ $? -ne 0 ]
+then
+ log "INFO" "THE BUILD FAILED. ABORTING"
+ cleanup_and_exit 1
+fi
+
+cd $TARGET/lib
+log "INFO" "COLLECTING ABI INFORMATION FOR $TAG2"
+for i in `ls *.so`
+do
+ $ABIDUMP $i -o $ABI_DIR/$i-ABI-1.dump -lver $TAG2
+done
+cd ../..
+
+# Start comparison of ABI dumps
+for i in `ls $ABI_DIR/*-1.dump`
+do
+ NEWNAME=`basename $i`
+ OLDNAME=`basename $i | sed -e"s/1.dump/0.dump/"`
+ LIBNAME=`basename $i | sed -e"s/-ABI-1.dump//"`
+
+ if [ ! -f $ABI_DIR/$OLDNAME ]
+ then
+ log "INFO" "$OLDNAME DOES NOT EXIST IN $TAG1. SKIPPING..."
+ fi
+
+ #compare the abi dumps
+ $ABICHECK -l $LIBNAME -old $ABI_DIR/$OLDNAME -new $ABI_DIR/$NEWNAME
+done
+
+git reset --hard
+git checkout $CURRENT_BRANCH
+log "INFO" "ABI CHECK COMPLETE. REPORTS ARE IN compat_report directory"
+cleanup_and_exit 0
+
+
--
2.1.0
^ permalink raw reply [relevance 17%]
* [dpdk-dev] [PATCH] ABI: Add abi checking utility
@ 2015-01-30 21:16 17% Neil Horman
2015-02-02 18:18 17% ` [dpdk-dev] [PATCH v2] " Neil Horman
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-01-30 21:16 UTC (permalink / raw)
To: dev
There was a request for an abi validation utiltyfor the ongoing ABI stability
work. As it turns out there is a abi compliance checker in development that
seems to be under active development and provides fairly detailed ABI compliance
reports. Its not yet intellegent enough to understand symbol versioning, but it
does provide the ability to identify symbols which have changed between
releases, along with details of the change, and offers develoeprs the
opportunity to identify which symbols then need versioning and validation for a
given update via manaul testing.
This script automates the use of the compliance checker between two arbitrarily
specified tags within the dpdk tree. To execute enter the $RTE_SDK directory
and run:
./scripts/validate_abi.sh $GIT_TAG1 $GIT_TAG2 $CONFIG
where $GIT_TAG1 and 2 are git tags and $CONFIG is a config specification
suitable for passing as the T= variable in the make config command.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
---
scripts/validate_abi.sh | 244 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 244 insertions(+)
create mode 100755 scripts/validate_abi.sh
diff --git a/scripts/validate_abi.sh b/scripts/validate_abi.sh
new file mode 100755
index 0000000..9ba28da
--- /dev/null
+++ b/scripts/validate_abi.sh
@@ -0,0 +1,244 @@
+#!/bin/sh
+# BSD LICENSE
+#
+# Copyright(c) 2015 Neil Horman. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+TAG1=$1
+TAG2=$2
+TARGET=$3
+ABI_DIR=`mktemp -d -p /tmp ABI.XXXXXX`
+
+usage() {
+ echo "$0 <TAG1> <TAG2> <TARGET>"
+}
+
+log() {
+ local level=$1
+ shift
+ echo "$*"
+}
+
+validate_tags() {
+ git tag -l | grep -q "$TAG1"
+ if [ $? -ne 0 ]
+ then
+ echo "$TAG1 is invalid"
+ return
+ fi
+ git tag -l | grep -q "$TAG2"
+ if [ $? -ne 0 ]
+ then
+ echo "$TAG2 is invalid"
+ return
+ fi
+}
+
+validate_args() {
+ if [ -z "$TAG1" ]
+ then
+ echo "Must Specify TAG1"
+ return
+ fi
+ if [ -z "$TAG2" ]
+ then
+ echo "Must Specify TAG2"
+ return
+ fi
+ if [ -z "$TARGET" ]
+ then
+ echo "Must Specify a build target"
+ fi
+}
+
+
+cleanup_and_exit() {
+ rm -rf $ABI_DIR
+ exit $1
+}
+
+###########################################
+#START
+############################################
+
+#Save the current branch
+CURRENT_BRANCH=`git branch | grep \* | cut -d' ' -f2`
+
+if [ -n "$VERBOSE" ]
+then
+ export VERBOSE=/dev/stdout
+else
+ export VERBOSE=/dev/null
+fi
+
+# Validate that we have all the arguments we need
+res=$(validate_args)
+if [ -n "$res" ]
+then
+ echo $res
+ usage
+ cleanup_and_exit 1
+fi
+
+# Make sure our tags exist
+res=$(validate_tags)
+if [ -n "$res" ]
+then
+ echo $res
+ cleanup_and_exit 1
+fi
+
+ABICHECK=`which abi-compliance-checker 2>/dev/null`
+if [ $? -ne 0 ]
+then
+ log "INFO" "Cant find abi-compliance-checker utility"
+ cleanup_and_exit 1
+fi
+
+ABIDUMP=`which abi-dumper 2>/dev/null`
+if [ $? -ne 0 ]
+then
+ log "INFO" "Cant find abi-dumper utility"
+ cleanup_and_exit 1
+fi
+
+log "INFO" "We're going to check and make sure that applications built"
+log "INFO" "against DPDK DSOs from tag $TAG1 will still run when executed"
+log "INFO" "against DPDK DSOs built from tag $TAG2."
+log "INFO" ""
+
+# Check to make sure we have a clean tree
+git status | grep -q clean
+if [ $? -ne 0 ]
+then
+ log "WARN" "Working directory not clean, aborting"
+ cleanup_and_exit 1
+fi
+
+if [ ! -d ./.git ]
+then
+ log "WARN" "You must be in the root of the dpdk git tree"
+ log "WARN" "You are in $PWD"
+ cleanup_and_exit 1
+fi
+
+log "INFO" "Checking out version $TAG1 of the dpdk"
+# Move to the old version of the tree
+git checkout $TAG1
+
+# Make sure we configure SHARED libraries
+# Also turn off IGB and KNI as those require kernel headers to build
+sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
+sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
+sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
+
+export EXTRA_CFLAGS=-g
+export EXTRA_LDFLAGS=-g
+
+# Now configure the build
+log "INFO" "Configuring DPDK $TAG1"
+make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
+
+log "INFO" "Building DPDK $TAG1. This might take a moment"
+make O=$TARGET > $VERBOSE 2>&1
+
+if [ $? -ne 0 ]
+then
+ log "INFO" "THE BUILD FAILED. ABORTING"
+ cleanup_and_exit 1
+fi
+
+# Move to the lib directory
+cd $TARGET/lib
+log "INFO" "COlLECTING ABI INFORMATION FOR $TAG1"
+for i in `ls *.so`
+do
+ $ABIDUMP $i -o $ABI_DIR/$i-ABI-0.dump -lver $TAG1
+done
+cd ../..
+
+# Now clean the tree, checkout the second tag, and rebuild
+git clean -f -d
+git reset --hard
+# Move to the new version of the tree
+log "INFO" "Checking out version $TAG2 of the dpdk"
+git checkout $TAG2
+
+export EXTRA_CFLAGS=-g
+export EXTRA_LDFLAGS=-g
+
+# Make sure we configure SHARED libraries
+# Also turn off IGB and KNI as those require kernel headers to build
+sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
+sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
+sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
+
+# Now configure the build
+log "INFO" "Configuring DPDK $TAG2"
+make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
+
+log "INFO" "Building DPDK $TAG2. This might take a moment"
+make O=$TARGET > $VERBOSE 2>&1
+
+if [ $? -ne 0 ]
+then
+ log "INFO" "THE BUILD FAILED. ABORTING"
+ cleanup_and_exit 1
+fi
+
+cd $TARGET/lib
+log "INFO" "COlLECTING ABI INFORMATION FOR $TAG2"
+for i in `ls *.so`
+do
+ $ABIDUMP $i -o $ABI_DIR/$i-ABI-1.dump -lver $TAG2
+done
+cd ../..
+
+# Start comparison of ABI dumps
+for i in `ls $ABI_DIR/*-1.dump`
+do
+ NEWNAME=`basename $i`
+ OLDNAME=`basename $i | sed -e"s/1.dump/0.dump/"`
+ LIBNAME=`basename $i | sed -e"s/-ABI-1.dump//"`
+
+ if [ ! -f $ABI_DIR/$OLDNAME ]
+ then
+ log "INFO" "$OLDNAME DOES NOT EXIST IN $TAG1. SKIPPING..."
+ fi
+
+ #compare the abi dumps
+ $ABICHECK -l $LIBNAME -old $ABI_DIR/$OLDNAME -new $ABI_DIR/$NEWNAME
+done
+
+git reset --hard
+git checkout $CURRENT_BRANCH
+log "INFO" "ABI CHECK COMPLETE. REPORTS ARE IN compat_report directory"
+cleanup_and_exit 0
+
+
--
2.1.0
^ permalink raw reply [relevance 17%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-01-30 17:38 0% ` Gonzalez Monroy, Sergio
@ 2015-01-30 18:12 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-01-30 18:12 UTC (permalink / raw)
To: Gonzalez Monroy, Sergio; +Cc: dev
On Fri, Jan 30, 2015 at 05:38:49PM +0000, Gonzalez Monroy, Sergio wrote:
> > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Sent: Friday, January 30, 2015 2:05 PM
> > To: Gonzalez Monroy, Sergio
> > Cc: Thomas Monjalon; dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> >
> > On Fri, Jan 30, 2015 at 01:39:28PM +0000, Gonzalez Monroy, Sergio wrote:
> > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > Sent: Thursday, January 29, 2015 7:46 PM
> > > > To: Gonzalez Monroy, Sergio
> > > > Cc: dev@dpdk.org
> > > > Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> > > >
> > > > On Thu, Jan 29, 2015 at 05:04:20PM +0000, Gonzalez Monroy, Sergio
> > wrote:
> > > > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > > > Sent: Thursday, January 29, 2015 4:39 PM
> > > > > > To: Gonzalez Monroy, Sergio
> > > > > > Cc: dev@dpdk.org
> > > > > > Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> > > > > >
> > > > > > On Thu, Jan 29, 2015 at 03:20:03PM +0000, Sergio Gonzalez Monroy
> > > > wrote:
> > > > > > > This patch series improves the DPDK build system mostly for
> > > > > > > shared libraries (and a few nits for static libraries) with the following
> > goals:
> > > > > > > - Create a library containing core DPDK libraries (librte_eal,
> > > > > > > librte_malloc, librte_mempool, librte_mbuf and librte_ring).
> > > > > > > The idea of core libraries is to group those libraries that are
> > > > > > > always required (and have interdependencies) for any DPDK
> > > > application.
> > > > > > > - Remove config option to build a combined library.
> > > > > > > - For shared libraries, explicitly link against dependant
> > > > > > > libraries (adding entries to DT_NEEDED).
> > > > > > > - Update app linking flags for static/shared DPDK libs.
> > > > > > >
> > > > > > > Sergio Gonzalez Monroy (8):
> > > > > > > mk: remove combined library and related options
> > > > > > > core: create new librte_core
> > > > > > > mk: new corelib makefile
> > > > > > > lib: update DEPDIRS variable
> > > > > > > lib: set LDLIBS for each library
> > > > > > > mk: use LDLIBS when linking shared libraries
> > > > > > > mk: update LDLIBS for app building
> > > > > > > mk: add -lpthread to linuxapp EXECENV_LDLIBS
> > > > > > >
> > > > > > > config/common_bsdapp | 6 --
> > > > > > > config/common_linuxapp | 6 --
> > > > > > > config/defconfig_ppc_64-power8-linuxapp-gcc | 2 -
> > > > > > > lib/Makefile | 1 -
> > > > > > > lib/librte_acl/Makefile | 5 +-
> > > > > > > lib/librte_cfgfile/Makefile | 4 +-
> > > > > > > lib/librte_cmdline/Makefile | 6 +-
> > > > > > > lib/librte_core/Makefile | 45 +++++++++++++
> > > > > > > lib/librte_distributor/Makefile | 5 +-
> > > > > > > lib/librte_eal/bsdapp/eal/Makefile | 3 +-
> > > > > > > lib/librte_eal/linuxapp/eal/Makefile | 3 +-
> > > > > > > lib/librte_ether/Makefile | 4 +-
> > > > > > > lib/librte_hash/Makefile | 4 +-
> > > > > > > lib/librte_ip_frag/Makefile | 6 +-
> > > > > > > lib/librte_ivshmem/Makefile | 4 +-
> > > > > > > lib/librte_kni/Makefile | 6 +-
> > > > > > > lib/librte_kvargs/Makefile | 6 +-
> > > > > > > lib/librte_lpm/Makefile | 6 +-
> > > > > > > lib/librte_malloc/Makefile | 2 +-
> > > > > > > lib/librte_mbuf/Makefile | 2 +-
> > > > > > > lib/librte_mempool/Makefile | 2 +-
> > > > > > > lib/librte_meter/Makefile | 4 +-
> > > > > > > lib/librte_pipeline/Makefile | 3 +
> > > > > > > lib/librte_pmd_af_packet/Makefile | 5 +-
> > > > > > > lib/librte_pmd_bond/Makefile | 7 +-
> > > > > > > lib/librte_pmd_e1000/Makefile | 8 ++-
> > > > > > > lib/librte_pmd_enic/Makefile | 8 ++-
> > > > > > > lib/librte_pmd_i40e/Makefile | 8 ++-
> > > > > > > lib/librte_pmd_ixgbe/Makefile | 8 ++-
> > > > > > > lib/librte_pmd_pcap/Makefile | 5 +-
> > > > > > > lib/librte_pmd_ring/Makefile | 6 +-
> > > > > > > lib/librte_pmd_virtio/Makefile | 7 +-
> > > > > > > lib/librte_pmd_vmxnet3/Makefile | 8 ++-
> > > > > > > lib/librte_pmd_xenvirt/Makefile | 8 ++-
> > > > > > > lib/librte_port/Makefile | 8 +--
> > > > > > > lib/librte_power/Makefile | 4 +-
> > > > > > > lib/librte_ring/Makefile | 2 +-
> > > > > > > lib/librte_sched/Makefile | 7 +-
> > > > > > > lib/librte_table/Makefile | 8 +--
> > > > > > > lib/librte_timer/Makefile | 6 +-
> > > > > > > lib/librte_vhost/Makefile | 9 +--
> > > > > > > mk/exec-env/linuxapp/rte.vars.mk | 2 +
> > > > > > > mk/rte.app.mk | 53 ++++-----------
> > > > > > > mk/rte.corelib.mk | 84 +++++++++++++++++++++++
> > > > > > > mk/rte.lib.mk | 49 +++-----------
> > > > > > > mk/rte.sdkbuild.mk | 3 -
> > > > > > > mk/rte.sharelib.mk | 101 ----------------------------
> > > > > > > mk/rte.vars.mk | 9 ---
> > > > > > > 48 files changed, 276 insertions(+), 282 deletions(-) create
> > > > > > > mode
> > > > > > > 100644 lib/librte_core/Makefile create mode 100644
> > > > > > > mk/rte.corelib.mk delete mode 100644 mk/rte.sharelib.mk
> > > > > > >
> > > > > > > --
> > > > > > > 1.9.3
> > > > > > >
> > > > > > >
> > > > > > Something occured to me thinking about this patch set. I
> > > > > > noticed recently that different rules are used to build the
> > > > > > shared combined lib from the individual shared objects. The
> > > > > > implication here is that linker options specified in individual
> > > > > > make files (like the LIBABIVER and EXPORT_MAP options in my ABI
> > > > > > versioning script) get ignored, which is bad. Any other file
> > > > > > specific linker options (like <file>_LDFLAGS specified in
> > > > > > individual library makefiles are getting
> > > > dropped for the combined lib.
> > > > > >
> > > > > > It seems like it would be better if the combined libs were
> > > > > > manufactured as linker scripts themselves (textfiles that used
> > > > > > linker directives to include individual libraries under the
> > > > > > covers (see
> > > > /lib64/libc.so for an example).
> > > > > >
> > > > > > The disadvantage of such an approach are fairly minimal. With
> > > > > > such a combined library, you still need to install individual
> > > > > > libraries, but for applications that wish to link and run
> > > > > > against a single dpdk library will still work just as they
> > > > > > currently do, you can link to just a single
> > > > library.
> > > > > >
> > > > > > The advantage is clear however. By following a linker script
> > > > > > aproach, objects build as separate libraries are built exactly
> > > > > > the same way, using the same rules with the same options. It
> > > > > > reduces the dpdk build environment size and complexity, and
> > > > > > reduces the opportunity for bugs to creep in from forgetting to
> > > > > > add build options to multiple locations. It also provides a
> > > > > > more granular approach for grouping files. Creating a dpdk core
> > > > > > library becomes a matter of creating a one line linker script
> > > > > > named libdpdk_core.so, rather
> > > > than re- arraning sections of the build system.
> > > > > >
> > > > > > Thoughts?
> > > > > > Neil
> > > > > >
> > > > > Hi Neil,
> > > > >
> > > > > I think that is a very interesting approach.
> > > > > I have tried to do something similar in this patch by removing
> > > > > rte.sharelib.mk and just having rte.lib.mk to do the linking,
> > > > > leaving as you suggest a single file to modify anything related to building
> > libs.
> > > > >
> > > > > I do think however that your proposal is an improvement over the
> > > > > current
> > > > patch.
> > > > >
> > > > > So basically we want:
> > > > > - get rid of rte.corelib.mk
> > > > > - generate librte_core.so linker script grouping core libs
> > > > > - we do not modify DEPDIR variables
> > > > > - when setting LDLIBS to each lib, we do specify -lrte_core, right?
> > > > >
> > > > Exactly, and librte_core.so is really just a text file containing
> > > > the following line
> > > > :
> > > > INPUT(-lrte_malloc -lrte_mbuf -lrte_eal ....)
> > > >
> > > > Adding in whatever libraries you want librte_core to consist of.
> > > > Truthfully, you could almost get rid of the COMBINE_LIBS option
> > > > entirely, and just create this file statically if you wanted to (not
> > > > sure thats the best approach, but its definately do-able).
> > > >
> > > Hi Neil,
> > >
> > > Actually, the first patch series does get rid of COMBINE_LIBS entirely.
> > >
> > Sorry, I didn't mean to imply your patch wasn't, just re-iterating that the
> > option is not needed using the alternate method we're discussing, but I really
> > wasn't very clear on that.
> >
> > > So as I was looking into this, by using this approach we do not resolve the
> > interdependencies issue of the core libraries.
> > > We would effectively leave all core libraries (or at least EAL) without proper
> > DT_NEEDED entries.
> > >
> > > Thoughts?
> > >
> > You're correct, or at least what you assert is possible, depending on the
> > implementation. Adding DT_NEEDED entries is something of an orthogonal
> > problem (though your current implementation I think handles it well). You
> > could specify linker directives when building each library so that each DSO
> > contains the proper DT_NEEDED entries (using -l<lib> and --no-as-needed).
> > using a linker script approach doesn't preclude you from doing that, though
> > its not strictly speaking necessecary. When you write the linker script, you
> > implicitly specify the link dependencies by the order in whcih you list the
> > inferior libraries in the scripts INPUT line. It doesn't give you the DT_NEEDED
> > entries, but from an application build/run standpoint, it won't matter,
> > because the libraries will be linked/loaded in the order specified. You can still
> > do the --no-as-needed method though if you like for safety on the part of
> > those using libraries independently.
>
> So would it be reasonable to add DT_NEEDED entries to all DPDK libraries but EAL?
> If I understood what you were saying right, we could enforce the 'dependency' in the
> linker script with something like this:
> $ cat librte_eal.so
> INPUT( librte_eal.so.1 -lrte_mempool -lrte_malloc)
> We could have such linker script for librte_eal.so instead of the soft link once
> versioning is in place.
>
Correct.
> Things that would be missing versus the proposed patch:
> - As I have mention in previous post, ldd info for EAL library would not reflect
> its dependency to other DPDK libs.
librte_eal.so would no show those dependencies, as far as I know (though I
haven't explicitly checked). The subordunate libraries included in the input
line, may or may not show dependencies among themselves, depending on your build
setup (and the use of --no-as-needed and -l when linking the individual .so
libraries.
> - I was enforcing resolving all references when building the libraries (-z defs), so
> we either remove it altogether or skip eal.
I think thats correct, yes.
> - All apps would show DT_NEEDED entries for a set of DPDK libraries that
> in most cases are required (eal, mempool, malloc, mbuf, ring VS dpdk_core)
>
I think apps linked to libdpdk_core would have DT_NEEDED entries for
libdpdk_core, not the subordonate libraries (though check me on that to be
sure).
> I think that the linker script approach is reasonable if we prefer to go that way
> instead of creating a core library.
>
I think it would make sense from a build environment point of view, in that it
allows library specific flags to be incorporated properly. I think the only
downside is that the individual libraries still need to be carried around
(though they can be ignored from an application build/run standpoint). You're
question should probably be asked of people using COMBINED_LIBS currently to
make sure that meets their needs, though I think it will.
Neil
> Regards,
> Sergio
>
> > Neil
> >
> > > Regards,
> > > Sergio
> > >
> > > > Regards
> > > > Neil
> > > >
> > >
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-01-30 14:05 0% ` Neil Horman
@ 2015-01-30 17:38 0% ` Gonzalez Monroy, Sergio
2015-01-30 18:12 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Gonzalez Monroy, Sergio @ 2015-01-30 17:38 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Friday, January 30, 2015 2:05 PM
> To: Gonzalez Monroy, Sergio
> Cc: Thomas Monjalon; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
>
> On Fri, Jan 30, 2015 at 01:39:28PM +0000, Gonzalez Monroy, Sergio wrote:
> > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > Sent: Thursday, January 29, 2015 7:46 PM
> > > To: Gonzalez Monroy, Sergio
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> > >
> > > On Thu, Jan 29, 2015 at 05:04:20PM +0000, Gonzalez Monroy, Sergio
> wrote:
> > > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > > Sent: Thursday, January 29, 2015 4:39 PM
> > > > > To: Gonzalez Monroy, Sergio
> > > > > Cc: dev@dpdk.org
> > > > > Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> > > > >
> > > > > On Thu, Jan 29, 2015 at 03:20:03PM +0000, Sergio Gonzalez Monroy
> > > wrote:
> > > > > > This patch series improves the DPDK build system mostly for
> > > > > > shared libraries (and a few nits for static libraries) with the following
> goals:
> > > > > > - Create a library containing core DPDK libraries (librte_eal,
> > > > > > librte_malloc, librte_mempool, librte_mbuf and librte_ring).
> > > > > > The idea of core libraries is to group those libraries that are
> > > > > > always required (and have interdependencies) for any DPDK
> > > application.
> > > > > > - Remove config option to build a combined library.
> > > > > > - For shared libraries, explicitly link against dependant
> > > > > > libraries (adding entries to DT_NEEDED).
> > > > > > - Update app linking flags for static/shared DPDK libs.
> > > > > >
> > > > > > Sergio Gonzalez Monroy (8):
> > > > > > mk: remove combined library and related options
> > > > > > core: create new librte_core
> > > > > > mk: new corelib makefile
> > > > > > lib: update DEPDIRS variable
> > > > > > lib: set LDLIBS for each library
> > > > > > mk: use LDLIBS when linking shared libraries
> > > > > > mk: update LDLIBS for app building
> > > > > > mk: add -lpthread to linuxapp EXECENV_LDLIBS
> > > > > >
> > > > > > config/common_bsdapp | 6 --
> > > > > > config/common_linuxapp | 6 --
> > > > > > config/defconfig_ppc_64-power8-linuxapp-gcc | 2 -
> > > > > > lib/Makefile | 1 -
> > > > > > lib/librte_acl/Makefile | 5 +-
> > > > > > lib/librte_cfgfile/Makefile | 4 +-
> > > > > > lib/librte_cmdline/Makefile | 6 +-
> > > > > > lib/librte_core/Makefile | 45 +++++++++++++
> > > > > > lib/librte_distributor/Makefile | 5 +-
> > > > > > lib/librte_eal/bsdapp/eal/Makefile | 3 +-
> > > > > > lib/librte_eal/linuxapp/eal/Makefile | 3 +-
> > > > > > lib/librte_ether/Makefile | 4 +-
> > > > > > lib/librte_hash/Makefile | 4 +-
> > > > > > lib/librte_ip_frag/Makefile | 6 +-
> > > > > > lib/librte_ivshmem/Makefile | 4 +-
> > > > > > lib/librte_kni/Makefile | 6 +-
> > > > > > lib/librte_kvargs/Makefile | 6 +-
> > > > > > lib/librte_lpm/Makefile | 6 +-
> > > > > > lib/librte_malloc/Makefile | 2 +-
> > > > > > lib/librte_mbuf/Makefile | 2 +-
> > > > > > lib/librte_mempool/Makefile | 2 +-
> > > > > > lib/librte_meter/Makefile | 4 +-
> > > > > > lib/librte_pipeline/Makefile | 3 +
> > > > > > lib/librte_pmd_af_packet/Makefile | 5 +-
> > > > > > lib/librte_pmd_bond/Makefile | 7 +-
> > > > > > lib/librte_pmd_e1000/Makefile | 8 ++-
> > > > > > lib/librte_pmd_enic/Makefile | 8 ++-
> > > > > > lib/librte_pmd_i40e/Makefile | 8 ++-
> > > > > > lib/librte_pmd_ixgbe/Makefile | 8 ++-
> > > > > > lib/librte_pmd_pcap/Makefile | 5 +-
> > > > > > lib/librte_pmd_ring/Makefile | 6 +-
> > > > > > lib/librte_pmd_virtio/Makefile | 7 +-
> > > > > > lib/librte_pmd_vmxnet3/Makefile | 8 ++-
> > > > > > lib/librte_pmd_xenvirt/Makefile | 8 ++-
> > > > > > lib/librte_port/Makefile | 8 +--
> > > > > > lib/librte_power/Makefile | 4 +-
> > > > > > lib/librte_ring/Makefile | 2 +-
> > > > > > lib/librte_sched/Makefile | 7 +-
> > > > > > lib/librte_table/Makefile | 8 +--
> > > > > > lib/librte_timer/Makefile | 6 +-
> > > > > > lib/librte_vhost/Makefile | 9 +--
> > > > > > mk/exec-env/linuxapp/rte.vars.mk | 2 +
> > > > > > mk/rte.app.mk | 53 ++++-----------
> > > > > > mk/rte.corelib.mk | 84 +++++++++++++++++++++++
> > > > > > mk/rte.lib.mk | 49 +++-----------
> > > > > > mk/rte.sdkbuild.mk | 3 -
> > > > > > mk/rte.sharelib.mk | 101 ----------------------------
> > > > > > mk/rte.vars.mk | 9 ---
> > > > > > 48 files changed, 276 insertions(+), 282 deletions(-) create
> > > > > > mode
> > > > > > 100644 lib/librte_core/Makefile create mode 100644
> > > > > > mk/rte.corelib.mk delete mode 100644 mk/rte.sharelib.mk
> > > > > >
> > > > > > --
> > > > > > 1.9.3
> > > > > >
> > > > > >
> > > > > Something occured to me thinking about this patch set. I
> > > > > noticed recently that different rules are used to build the
> > > > > shared combined lib from the individual shared objects. The
> > > > > implication here is that linker options specified in individual
> > > > > make files (like the LIBABIVER and EXPORT_MAP options in my ABI
> > > > > versioning script) get ignored, which is bad. Any other file
> > > > > specific linker options (like <file>_LDFLAGS specified in
> > > > > individual library makefiles are getting
> > > dropped for the combined lib.
> > > > >
> > > > > It seems like it would be better if the combined libs were
> > > > > manufactured as linker scripts themselves (textfiles that used
> > > > > linker directives to include individual libraries under the
> > > > > covers (see
> > > /lib64/libc.so for an example).
> > > > >
> > > > > The disadvantage of such an approach are fairly minimal. With
> > > > > such a combined library, you still need to install individual
> > > > > libraries, but for applications that wish to link and run
> > > > > against a single dpdk library will still work just as they
> > > > > currently do, you can link to just a single
> > > library.
> > > > >
> > > > > The advantage is clear however. By following a linker script
> > > > > aproach, objects build as separate libraries are built exactly
> > > > > the same way, using the same rules with the same options. It
> > > > > reduces the dpdk build environment size and complexity, and
> > > > > reduces the opportunity for bugs to creep in from forgetting to
> > > > > add build options to multiple locations. It also provides a
> > > > > more granular approach for grouping files. Creating a dpdk core
> > > > > library becomes a matter of creating a one line linker script
> > > > > named libdpdk_core.so, rather
> > > than re- arraning sections of the build system.
> > > > >
> > > > > Thoughts?
> > > > > Neil
> > > > >
> > > > Hi Neil,
> > > >
> > > > I think that is a very interesting approach.
> > > > I have tried to do something similar in this patch by removing
> > > > rte.sharelib.mk and just having rte.lib.mk to do the linking,
> > > > leaving as you suggest a single file to modify anything related to building
> libs.
> > > >
> > > > I do think however that your proposal is an improvement over the
> > > > current
> > > patch.
> > > >
> > > > So basically we want:
> > > > - get rid of rte.corelib.mk
> > > > - generate librte_core.so linker script grouping core libs
> > > > - we do not modify DEPDIR variables
> > > > - when setting LDLIBS to each lib, we do specify -lrte_core, right?
> > > >
> > > Exactly, and librte_core.so is really just a text file containing
> > > the following line
> > > :
> > > INPUT(-lrte_malloc -lrte_mbuf -lrte_eal ....)
> > >
> > > Adding in whatever libraries you want librte_core to consist of.
> > > Truthfully, you could almost get rid of the COMBINE_LIBS option
> > > entirely, and just create this file statically if you wanted to (not
> > > sure thats the best approach, but its definately do-able).
> > >
> > Hi Neil,
> >
> > Actually, the first patch series does get rid of COMBINE_LIBS entirely.
> >
> Sorry, I didn't mean to imply your patch wasn't, just re-iterating that the
> option is not needed using the alternate method we're discussing, but I really
> wasn't very clear on that.
>
> > So as I was looking into this, by using this approach we do not resolve the
> interdependencies issue of the core libraries.
> > We would effectively leave all core libraries (or at least EAL) without proper
> DT_NEEDED entries.
> >
> > Thoughts?
> >
> You're correct, or at least what you assert is possible, depending on the
> implementation. Adding DT_NEEDED entries is something of an orthogonal
> problem (though your current implementation I think handles it well). You
> could specify linker directives when building each library so that each DSO
> contains the proper DT_NEEDED entries (using -l<lib> and --no-as-needed).
> using a linker script approach doesn't preclude you from doing that, though
> its not strictly speaking necessecary. When you write the linker script, you
> implicitly specify the link dependencies by the order in whcih you list the
> inferior libraries in the scripts INPUT line. It doesn't give you the DT_NEEDED
> entries, but from an application build/run standpoint, it won't matter,
> because the libraries will be linked/loaded in the order specified. You can still
> do the --no-as-needed method though if you like for safety on the part of
> those using libraries independently.
So would it be reasonable to add DT_NEEDED entries to all DPDK libraries but EAL?
If I understood what you were saying right, we could enforce the 'dependency' in the
linker script with something like this:
$ cat librte_eal.so
INPUT( librte_eal.so.1 -lrte_mempool -lrte_malloc)
We could have such linker script for librte_eal.so instead of the soft link once
versioning is in place.
Things that would be missing versus the proposed patch:
- As I have mention in previous post, ldd info for EAL library would not reflect
its dependency to other DPDK libs.
- I was enforcing resolving all references when building the libraries (-z defs), so
we either remove it altogether or skip eal.
- All apps would show DT_NEEDED entries for a set of DPDK libraries that
in most cases are required (eal, mempool, malloc, mbuf, ring VS dpdk_core)
I think that the linker script approach is reasonable if we prefer to go that way
instead of creating a core library.
Regards,
Sergio
> Neil
>
> > Regards,
> > Sergio
> >
> > > Regards
> > > Neil
> > >
> >
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning
2015-01-15 19:35 3% ` [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2015-01-15 19:35 7% ` [dpdk-dev] [PATCH v4 3/4] Add library version extenstion Neil Horman
2015-01-15 19:35 23% ` [dpdk-dev] [PATCH v4 4/4] docs: Add ABI documentation Neil Horman
@ 2015-01-30 17:13 3% ` Gray, Mark D
2 siblings, 0 replies; 200+ results
From: Gray, Mark D @ 2015-01-30 17:13 UTC (permalink / raw)
To: Neil Horman, dev
I agree in principle with this patchset. OVS links with DPDK and providing stability in the ABI/API (and the Policy to manage this) makes deployment easier for OVS when linking with shared dpdk libs. It should also be easy for us to track changes in the API through the deprecation notices making development easier!
Good job.
Acked-by: Mark D. Gray <mark.d.gray@intel.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Thursday, January 15, 2015 7:35 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support
> symbol versioning
>
> Add initial pass header files to support symbol versioning.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
>
> ---
> Change Notes:
> V2)
> Moved ifeq to _INSTALL target
>
> V3)
> Undo V2 changes and make librte_compat use the rte.install.mk file
> instead
>
> v4)
> changed --version-script to accept SRCDIR in this patch at per request
> documented versioning macros
> cleaned up macro parameter consistency
> converted SA macro to RTE_STR macro
> fixed copyright
> ---
> lib/Makefile | 1 +
> lib/librte_compat/Makefile | 38 +++++++++++++
> lib/librte_compat/rte_compat.h | 117
> +++++++++++++++++++++++++++++++++++++++++
> mk/rte.lib.mk | 4 ++
> 4 files changed, 160 insertions(+)
> create mode 100644 lib/librte_compat/Makefile create mode 100644
> lib/librte_compat/rte_compat.h
>
> diff --git a/lib/Makefile b/lib/Makefile index 0ffc982..d617d81 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -31,6 +31,7 @@
>
> include $(RTE_SDK)/mk/rte.vars.mk
>
> +DIRS-y += librte_compat
> DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring diff --git
> a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile new file mode
> 100644 index 0000000..0bab870
> --- /dev/null
> +++ b/lib/librte_compat/Makefile
> @@ -0,0 +1,38 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2013 Neil Horman <nhorman@tuxdriver.com>
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +# notice, this list of conditions and the following disclaimer.
> +# * 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.
> +# * Neither the name of Intel Corporation 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
> +# OWNER 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.
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +
> +# install includes
> +SYMLINK-y-include := rte_compat.h
> +
> +include $(RTE_SDK)/mk/rte.install.mk
> diff --git a/lib/librte_compat/rte_compat.h
> b/lib/librte_compat/rte_compat.h new file mode 100644 index
> 0000000..d7cc176
> --- /dev/null
> +++ b/lib/librte_compat/rte_compat.h
> @@ -0,0 +1,117 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010 Neil Horman <nhorman@tuxdriver.com>.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#ifndef _RTE_COMPAT_H_
> +#define _RTE_COMPAT_H_
> +#include <rte_common.h>
> +
> +#ifdef RTE_BUILD_SHARED_LIB
> +
> +/*
> + * Provides backwards compatibility when updating exported functions.
> + * When a symol is exported from a library to provide an API, it also
> +provides a
> + * calling convention (ABI) that is embodied in its name, return type,
> + * arguments, etc. On occasion that function may need to change to
> +accomodate
> + * new functionality, behavior, etc. When that occurs, it is
> +desireable to
> + * allow for backwards compatibility for a time with older binaries
> +that are
> + * dynamically linked to the dpdk. To support that, the __vsym and
> + * VERSION_SYMBOL macros are created. They, in conjunction with the
> + * <library>_version.map file for a given library allow for multiple
> +versions of
> + * a symbol to exist in a shared library so that older binaries need
> +not be
> + * immediately recompiled. Their use is outlined in the following example:
> + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> + *
> + * To accomplish this:
> + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1)
> +node, in which
> + * foo is exported as a global symbol.
> + *
> + * 2) rename the existing function int foo(char *string) to
> + * int __vsym foo_v18(char *string)
> + *
> + * 3) Add this macro immediately below the function
> + * VERSION_SYMBOL(foo, _v18, 1.8);
> + *
> + * 4) Implement a new version of foo.
> + * char foo(int value, int otherval) { ...}
> + *
> + * 5) Mark the newest version as the default version
> + * BIND_DEFAULT_SYMBOL(foo, 1.9);
> + *
> + */
> +
> +/*
> + * Macro Parameters:
> + * b - function base name
> + * e - function version extension, to be concatenated with base name
> + * n - function symbol version string to be applied */
> +
> +/*
> + * VERSION_SYMBOL
> + * Creates a symbol version table entry binding symbol <b>@DPDK_<n> to
> +the internal
> + * function name <b>_<e>
> + */
> +#define VERSION_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b)
> +RTE_STR(e) ", "RTE_STR(b)"@DPDK_"RTE_STR(n))
> +
> +/*
> + * BASE_SYMBOL
> + * Creates a symbol version table entry binding unversioned symbol <b>
> + * to the internal function <b>_<e>
> + */
> +#define BASE_SYMBOL(b, e) __asm__(".symver " RTE_STR(b) RTE_STR(e) ",
> +"RTE_STR(b)"@")
> +
> +/*
> + * BNID_DEFAULT_SYMBOL
> + * Creates a symbol version entry instructing the linker to bind
> +references to
> + * symbol <b> to the internal symbol <b>_<e> */ #define
> +BIND_DEFAULT_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b)
> RTE_STR(e)
> +", "RTE_STR(b)"@@DPDK_"RTE_STR(n)) #define __vsym
> __attribute__((used))
> +
> +#else
> +/*
> + * No symbol versioning in use
> + */
> +#define VERSION_SYMBOL(b, e, v)
> +#define __vsym
> +#define BASE_SYMBOL(b, n)
> +#define BIND_DEFAULT_SYMBOL(b, v)
> +
> +/*
> + * RTE_BUILD_SHARED_LIB=n
> + */
> +#endif
> +
> +
> +#endif /* _RTE_COMPAT_H_ */
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk index 81bf8e1..1d3b646 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
>
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> LIB := $(patsubst %.a,%.so,$(LIB))
> +
> +CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
> +
> endif
>
> +
> _BUILD = $(LIB)
> _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y)
> $(RTE_OUTPUT)/lib/$(LIB) _CLEAN = doclean
> --
> 2.1.0
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-01-30 13:39 0% ` Gonzalez Monroy, Sergio
@ 2015-01-30 14:05 0% ` Neil Horman
2015-01-30 17:38 0% ` Gonzalez Monroy, Sergio
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-01-30 14:05 UTC (permalink / raw)
To: Gonzalez Monroy, Sergio; +Cc: dev
On Fri, Jan 30, 2015 at 01:39:28PM +0000, Gonzalez Monroy, Sergio wrote:
> > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Sent: Thursday, January 29, 2015 7:46 PM
> > To: Gonzalez Monroy, Sergio
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> >
> > On Thu, Jan 29, 2015 at 05:04:20PM +0000, Gonzalez Monroy, Sergio wrote:
> > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > Sent: Thursday, January 29, 2015 4:39 PM
> > > > To: Gonzalez Monroy, Sergio
> > > > Cc: dev@dpdk.org
> > > > Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> > > >
> > > > On Thu, Jan 29, 2015 at 03:20:03PM +0000, Sergio Gonzalez Monroy
> > wrote:
> > > > > This patch series improves the DPDK build system mostly for shared
> > > > > libraries (and a few nits for static libraries) with the following goals:
> > > > > - Create a library containing core DPDK libraries (librte_eal,
> > > > > librte_malloc, librte_mempool, librte_mbuf and librte_ring).
> > > > > The idea of core libraries is to group those libraries that are
> > > > > always required (and have interdependencies) for any DPDK
> > application.
> > > > > - Remove config option to build a combined library.
> > > > > - For shared libraries, explicitly link against dependant
> > > > > libraries (adding entries to DT_NEEDED).
> > > > > - Update app linking flags for static/shared DPDK libs.
> > > > >
> > > > > Sergio Gonzalez Monroy (8):
> > > > > mk: remove combined library and related options
> > > > > core: create new librte_core
> > > > > mk: new corelib makefile
> > > > > lib: update DEPDIRS variable
> > > > > lib: set LDLIBS for each library
> > > > > mk: use LDLIBS when linking shared libraries
> > > > > mk: update LDLIBS for app building
> > > > > mk: add -lpthread to linuxapp EXECENV_LDLIBS
> > > > >
> > > > > config/common_bsdapp | 6 --
> > > > > config/common_linuxapp | 6 --
> > > > > config/defconfig_ppc_64-power8-linuxapp-gcc | 2 -
> > > > > lib/Makefile | 1 -
> > > > > lib/librte_acl/Makefile | 5 +-
> > > > > lib/librte_cfgfile/Makefile | 4 +-
> > > > > lib/librte_cmdline/Makefile | 6 +-
> > > > > lib/librte_core/Makefile | 45 +++++++++++++
> > > > > lib/librte_distributor/Makefile | 5 +-
> > > > > lib/librte_eal/bsdapp/eal/Makefile | 3 +-
> > > > > lib/librte_eal/linuxapp/eal/Makefile | 3 +-
> > > > > lib/librte_ether/Makefile | 4 +-
> > > > > lib/librte_hash/Makefile | 4 +-
> > > > > lib/librte_ip_frag/Makefile | 6 +-
> > > > > lib/librte_ivshmem/Makefile | 4 +-
> > > > > lib/librte_kni/Makefile | 6 +-
> > > > > lib/librte_kvargs/Makefile | 6 +-
> > > > > lib/librte_lpm/Makefile | 6 +-
> > > > > lib/librte_malloc/Makefile | 2 +-
> > > > > lib/librte_mbuf/Makefile | 2 +-
> > > > > lib/librte_mempool/Makefile | 2 +-
> > > > > lib/librte_meter/Makefile | 4 +-
> > > > > lib/librte_pipeline/Makefile | 3 +
> > > > > lib/librte_pmd_af_packet/Makefile | 5 +-
> > > > > lib/librte_pmd_bond/Makefile | 7 +-
> > > > > lib/librte_pmd_e1000/Makefile | 8 ++-
> > > > > lib/librte_pmd_enic/Makefile | 8 ++-
> > > > > lib/librte_pmd_i40e/Makefile | 8 ++-
> > > > > lib/librte_pmd_ixgbe/Makefile | 8 ++-
> > > > > lib/librte_pmd_pcap/Makefile | 5 +-
> > > > > lib/librte_pmd_ring/Makefile | 6 +-
> > > > > lib/librte_pmd_virtio/Makefile | 7 +-
> > > > > lib/librte_pmd_vmxnet3/Makefile | 8 ++-
> > > > > lib/librte_pmd_xenvirt/Makefile | 8 ++-
> > > > > lib/librte_port/Makefile | 8 +--
> > > > > lib/librte_power/Makefile | 4 +-
> > > > > lib/librte_ring/Makefile | 2 +-
> > > > > lib/librte_sched/Makefile | 7 +-
> > > > > lib/librte_table/Makefile | 8 +--
> > > > > lib/librte_timer/Makefile | 6 +-
> > > > > lib/librte_vhost/Makefile | 9 +--
> > > > > mk/exec-env/linuxapp/rte.vars.mk | 2 +
> > > > > mk/rte.app.mk | 53 ++++-----------
> > > > > mk/rte.corelib.mk | 84 +++++++++++++++++++++++
> > > > > mk/rte.lib.mk | 49 +++-----------
> > > > > mk/rte.sdkbuild.mk | 3 -
> > > > > mk/rte.sharelib.mk | 101 ----------------------------
> > > > > mk/rte.vars.mk | 9 ---
> > > > > 48 files changed, 276 insertions(+), 282 deletions(-) create
> > > > > mode
> > > > > 100644 lib/librte_core/Makefile create mode 100644
> > > > > mk/rte.corelib.mk delete mode 100644 mk/rte.sharelib.mk
> > > > >
> > > > > --
> > > > > 1.9.3
> > > > >
> > > > >
> > > > Something occured to me thinking about this patch set. I noticed
> > > > recently that different rules are used to build the shared combined
> > > > lib from the individual shared objects. The implication here is
> > > > that linker options specified in individual make files (like the
> > > > LIBABIVER and EXPORT_MAP options in my ABI versioning script) get
> > > > ignored, which is bad. Any other file specific linker options (like
> > > > <file>_LDFLAGS specified in individual library makefiles are getting
> > dropped for the combined lib.
> > > >
> > > > It seems like it would be better if the combined libs were
> > > > manufactured as linker scripts themselves (textfiles that used
> > > > linker directives to include individual libraries under the covers (see
> > /lib64/libc.so for an example).
> > > >
> > > > The disadvantage of such an approach are fairly minimal. With such
> > > > a combined library, you still need to install individual libraries,
> > > > but for applications that wish to link and run against a single dpdk
> > > > library will still work just as they currently do, you can link to just a single
> > library.
> > > >
> > > > The advantage is clear however. By following a linker script
> > > > aproach, objects build as separate libraries are built exactly the
> > > > same way, using the same rules with the same options. It reduces
> > > > the dpdk build environment size and complexity, and reduces the
> > > > opportunity for bugs to creep in from forgetting to add build
> > > > options to multiple locations. It also provides a more granular
> > > > approach for grouping files. Creating a dpdk core library becomes a
> > > > matter of creating a one line linker script named libdpdk_core.so, rather
> > than re- arraning sections of the build system.
> > > >
> > > > Thoughts?
> > > > Neil
> > > >
> > > Hi Neil,
> > >
> > > I think that is a very interesting approach.
> > > I have tried to do something similar in this patch by removing
> > > rte.sharelib.mk and just having rte.lib.mk to do the linking, leaving
> > > as you suggest a single file to modify anything related to building libs.
> > >
> > > I do think however that your proposal is an improvement over the current
> > patch.
> > >
> > > So basically we want:
> > > - get rid of rte.corelib.mk
> > > - generate librte_core.so linker script grouping core libs
> > > - we do not modify DEPDIR variables
> > > - when setting LDLIBS to each lib, we do specify -lrte_core, right?
> > >
> > Exactly, and librte_core.so is really just a text file containing the following line
> > :
> > INPUT(-lrte_malloc -lrte_mbuf -lrte_eal ....)
> >
> > Adding in whatever libraries you want librte_core to consist of. Truthfully,
> > you could almost get rid of the COMBINE_LIBS option entirely, and just
> > create this file statically if you wanted to (not sure thats the best approach,
> > but its definately do-able).
> >
> Hi Neil,
>
> Actually, the first patch series does get rid of COMBINE_LIBS entirely.
>
Sorry, I didn't mean to imply your patch wasn't, just re-iterating that the
option is not needed using the alternate method we're discussing, but I really
wasn't very clear on that.
> So as I was looking into this, by using this approach we do not resolve the interdependencies issue of the core libraries.
> We would effectively leave all core libraries (or at least EAL) without proper DT_NEEDED entries.
>
> Thoughts?
>
You're correct, or at least what you assert is possible, depending on the
implementation. Adding DT_NEEDED entries is something of an orthogonal problem
(though your current implementation I think handles it well). You could specify
linker directives when building each library so that each DSO contains the
proper DT_NEEDED entries (using -l<lib> and --no-as-needed). using a linker
script approach doesn't preclude you from doing that, though its not strictly
speaking necessecary. When you write the linker script, you implicitly specify
the link dependencies by the order in whcih you list the inferior libraries in
the scripts INPUT line. It doesn't give you the DT_NEEDED entries, but from an
application build/run standpoint, it won't matter, because the libraries will be
linked/loaded in the order specified. You can still do the --no-as-needed
method though if you like for safety on the part of those using libraries
independently.
Neil
> Regards,
> Sergio
>
> > Regards
> > Neil
> >
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-01-29 19:45 0% ` Neil Horman
@ 2015-01-30 13:39 0% ` Gonzalez Monroy, Sergio
2015-01-30 14:05 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Gonzalez Monroy, Sergio @ 2015-01-30 13:39 UTC (permalink / raw)
To: Neil Horman, Thomas Monjalon; +Cc: dev
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Thursday, January 29, 2015 7:46 PM
> To: Gonzalez Monroy, Sergio
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
>
> On Thu, Jan 29, 2015 at 05:04:20PM +0000, Gonzalez Monroy, Sergio wrote:
> > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > Sent: Thursday, January 29, 2015 4:39 PM
> > > To: Gonzalez Monroy, Sergio
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> > >
> > > On Thu, Jan 29, 2015 at 03:20:03PM +0000, Sergio Gonzalez Monroy
> wrote:
> > > > This patch series improves the DPDK build system mostly for shared
> > > > libraries (and a few nits for static libraries) with the following goals:
> > > > - Create a library containing core DPDK libraries (librte_eal,
> > > > librte_malloc, librte_mempool, librte_mbuf and librte_ring).
> > > > The idea of core libraries is to group those libraries that are
> > > > always required (and have interdependencies) for any DPDK
> application.
> > > > - Remove config option to build a combined library.
> > > > - For shared libraries, explicitly link against dependant
> > > > libraries (adding entries to DT_NEEDED).
> > > > - Update app linking flags for static/shared DPDK libs.
> > > >
> > > > Sergio Gonzalez Monroy (8):
> > > > mk: remove combined library and related options
> > > > core: create new librte_core
> > > > mk: new corelib makefile
> > > > lib: update DEPDIRS variable
> > > > lib: set LDLIBS for each library
> > > > mk: use LDLIBS when linking shared libraries
> > > > mk: update LDLIBS for app building
> > > > mk: add -lpthread to linuxapp EXECENV_LDLIBS
> > > >
> > > > config/common_bsdapp | 6 --
> > > > config/common_linuxapp | 6 --
> > > > config/defconfig_ppc_64-power8-linuxapp-gcc | 2 -
> > > > lib/Makefile | 1 -
> > > > lib/librte_acl/Makefile | 5 +-
> > > > lib/librte_cfgfile/Makefile | 4 +-
> > > > lib/librte_cmdline/Makefile | 6 +-
> > > > lib/librte_core/Makefile | 45 +++++++++++++
> > > > lib/librte_distributor/Makefile | 5 +-
> > > > lib/librte_eal/bsdapp/eal/Makefile | 3 +-
> > > > lib/librte_eal/linuxapp/eal/Makefile | 3 +-
> > > > lib/librte_ether/Makefile | 4 +-
> > > > lib/librte_hash/Makefile | 4 +-
> > > > lib/librte_ip_frag/Makefile | 6 +-
> > > > lib/librte_ivshmem/Makefile | 4 +-
> > > > lib/librte_kni/Makefile | 6 +-
> > > > lib/librte_kvargs/Makefile | 6 +-
> > > > lib/librte_lpm/Makefile | 6 +-
> > > > lib/librte_malloc/Makefile | 2 +-
> > > > lib/librte_mbuf/Makefile | 2 +-
> > > > lib/librte_mempool/Makefile | 2 +-
> > > > lib/librte_meter/Makefile | 4 +-
> > > > lib/librte_pipeline/Makefile | 3 +
> > > > lib/librte_pmd_af_packet/Makefile | 5 +-
> > > > lib/librte_pmd_bond/Makefile | 7 +-
> > > > lib/librte_pmd_e1000/Makefile | 8 ++-
> > > > lib/librte_pmd_enic/Makefile | 8 ++-
> > > > lib/librte_pmd_i40e/Makefile | 8 ++-
> > > > lib/librte_pmd_ixgbe/Makefile | 8 ++-
> > > > lib/librte_pmd_pcap/Makefile | 5 +-
> > > > lib/librte_pmd_ring/Makefile | 6 +-
> > > > lib/librte_pmd_virtio/Makefile | 7 +-
> > > > lib/librte_pmd_vmxnet3/Makefile | 8 ++-
> > > > lib/librte_pmd_xenvirt/Makefile | 8 ++-
> > > > lib/librte_port/Makefile | 8 +--
> > > > lib/librte_power/Makefile | 4 +-
> > > > lib/librte_ring/Makefile | 2 +-
> > > > lib/librte_sched/Makefile | 7 +-
> > > > lib/librte_table/Makefile | 8 +--
> > > > lib/librte_timer/Makefile | 6 +-
> > > > lib/librte_vhost/Makefile | 9 +--
> > > > mk/exec-env/linuxapp/rte.vars.mk | 2 +
> > > > mk/rte.app.mk | 53 ++++-----------
> > > > mk/rte.corelib.mk | 84 +++++++++++++++++++++++
> > > > mk/rte.lib.mk | 49 +++-----------
> > > > mk/rte.sdkbuild.mk | 3 -
> > > > mk/rte.sharelib.mk | 101 ----------------------------
> > > > mk/rte.vars.mk | 9 ---
> > > > 48 files changed, 276 insertions(+), 282 deletions(-) create
> > > > mode
> > > > 100644 lib/librte_core/Makefile create mode 100644
> > > > mk/rte.corelib.mk delete mode 100644 mk/rte.sharelib.mk
> > > >
> > > > --
> > > > 1.9.3
> > > >
> > > >
> > > Something occured to me thinking about this patch set. I noticed
> > > recently that different rules are used to build the shared combined
> > > lib from the individual shared objects. The implication here is
> > > that linker options specified in individual make files (like the
> > > LIBABIVER and EXPORT_MAP options in my ABI versioning script) get
> > > ignored, which is bad. Any other file specific linker options (like
> > > <file>_LDFLAGS specified in individual library makefiles are getting
> dropped for the combined lib.
> > >
> > > It seems like it would be better if the combined libs were
> > > manufactured as linker scripts themselves (textfiles that used
> > > linker directives to include individual libraries under the covers (see
> /lib64/libc.so for an example).
> > >
> > > The disadvantage of such an approach are fairly minimal. With such
> > > a combined library, you still need to install individual libraries,
> > > but for applications that wish to link and run against a single dpdk
> > > library will still work just as they currently do, you can link to just a single
> library.
> > >
> > > The advantage is clear however. By following a linker script
> > > aproach, objects build as separate libraries are built exactly the
> > > same way, using the same rules with the same options. It reduces
> > > the dpdk build environment size and complexity, and reduces the
> > > opportunity for bugs to creep in from forgetting to add build
> > > options to multiple locations. It also provides a more granular
> > > approach for grouping files. Creating a dpdk core library becomes a
> > > matter of creating a one line linker script named libdpdk_core.so, rather
> than re- arraning sections of the build system.
> > >
> > > Thoughts?
> > > Neil
> > >
> > Hi Neil,
> >
> > I think that is a very interesting approach.
> > I have tried to do something similar in this patch by removing
> > rte.sharelib.mk and just having rte.lib.mk to do the linking, leaving
> > as you suggest a single file to modify anything related to building libs.
> >
> > I do think however that your proposal is an improvement over the current
> patch.
> >
> > So basically we want:
> > - get rid of rte.corelib.mk
> > - generate librte_core.so linker script grouping core libs
> > - we do not modify DEPDIR variables
> > - when setting LDLIBS to each lib, we do specify -lrte_core, right?
> >
> Exactly, and librte_core.so is really just a text file containing the following line
> :
> INPUT(-lrte_malloc -lrte_mbuf -lrte_eal ....)
>
> Adding in whatever libraries you want librte_core to consist of. Truthfully,
> you could almost get rid of the COMBINE_LIBS option entirely, and just
> create this file statically if you wanted to (not sure thats the best approach,
> but its definately do-able).
>
Hi Neil,
Actually, the first patch series does get rid of COMBINE_LIBS entirely.
So as I was looking into this, by using this approach we do not resolve the interdependencies issue of the core libraries.
We would effectively leave all core libraries (or at least EAL) without proper DT_NEEDED entries.
Thoughts?
Regards,
Sergio
> Regards
> Neil
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-01-29 17:04 0% ` Gonzalez Monroy, Sergio
@ 2015-01-29 19:45 0% ` Neil Horman
2015-01-30 13:39 0% ` Gonzalez Monroy, Sergio
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-01-29 19:45 UTC (permalink / raw)
To: Gonzalez Monroy, Sergio; +Cc: dev
On Thu, Jan 29, 2015 at 05:04:20PM +0000, Gonzalez Monroy, Sergio wrote:
> > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Sent: Thursday, January 29, 2015 4:39 PM
> > To: Gonzalez Monroy, Sergio
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
> >
> > On Thu, Jan 29, 2015 at 03:20:03PM +0000, Sergio Gonzalez Monroy wrote:
> > > This patch series improves the DPDK build system mostly for shared
> > > libraries (and a few nits for static libraries) with the following goals:
> > > - Create a library containing core DPDK libraries (librte_eal,
> > > librte_malloc, librte_mempool, librte_mbuf and librte_ring).
> > > The idea of core libraries is to group those libraries that are
> > > always required (and have interdependencies) for any DPDK application.
> > > - Remove config option to build a combined library.
> > > - For shared libraries, explicitly link against dependant
> > > libraries (adding entries to DT_NEEDED).
> > > - Update app linking flags for static/shared DPDK libs.
> > >
> > > Sergio Gonzalez Monroy (8):
> > > mk: remove combined library and related options
> > > core: create new librte_core
> > > mk: new corelib makefile
> > > lib: update DEPDIRS variable
> > > lib: set LDLIBS for each library
> > > mk: use LDLIBS when linking shared libraries
> > > mk: update LDLIBS for app building
> > > mk: add -lpthread to linuxapp EXECENV_LDLIBS
> > >
> > > config/common_bsdapp | 6 --
> > > config/common_linuxapp | 6 --
> > > config/defconfig_ppc_64-power8-linuxapp-gcc | 2 -
> > > lib/Makefile | 1 -
> > > lib/librte_acl/Makefile | 5 +-
> > > lib/librte_cfgfile/Makefile | 4 +-
> > > lib/librte_cmdline/Makefile | 6 +-
> > > lib/librte_core/Makefile | 45 +++++++++++++
> > > lib/librte_distributor/Makefile | 5 +-
> > > lib/librte_eal/bsdapp/eal/Makefile | 3 +-
> > > lib/librte_eal/linuxapp/eal/Makefile | 3 +-
> > > lib/librte_ether/Makefile | 4 +-
> > > lib/librte_hash/Makefile | 4 +-
> > > lib/librte_ip_frag/Makefile | 6 +-
> > > lib/librte_ivshmem/Makefile | 4 +-
> > > lib/librte_kni/Makefile | 6 +-
> > > lib/librte_kvargs/Makefile | 6 +-
> > > lib/librte_lpm/Makefile | 6 +-
> > > lib/librte_malloc/Makefile | 2 +-
> > > lib/librte_mbuf/Makefile | 2 +-
> > > lib/librte_mempool/Makefile | 2 +-
> > > lib/librte_meter/Makefile | 4 +-
> > > lib/librte_pipeline/Makefile | 3 +
> > > lib/librte_pmd_af_packet/Makefile | 5 +-
> > > lib/librte_pmd_bond/Makefile | 7 +-
> > > lib/librte_pmd_e1000/Makefile | 8 ++-
> > > lib/librte_pmd_enic/Makefile | 8 ++-
> > > lib/librte_pmd_i40e/Makefile | 8 ++-
> > > lib/librte_pmd_ixgbe/Makefile | 8 ++-
> > > lib/librte_pmd_pcap/Makefile | 5 +-
> > > lib/librte_pmd_ring/Makefile | 6 +-
> > > lib/librte_pmd_virtio/Makefile | 7 +-
> > > lib/librte_pmd_vmxnet3/Makefile | 8 ++-
> > > lib/librte_pmd_xenvirt/Makefile | 8 ++-
> > > lib/librte_port/Makefile | 8 +--
> > > lib/librte_power/Makefile | 4 +-
> > > lib/librte_ring/Makefile | 2 +-
> > > lib/librte_sched/Makefile | 7 +-
> > > lib/librte_table/Makefile | 8 +--
> > > lib/librte_timer/Makefile | 6 +-
> > > lib/librte_vhost/Makefile | 9 +--
> > > mk/exec-env/linuxapp/rte.vars.mk | 2 +
> > > mk/rte.app.mk | 53 ++++-----------
> > > mk/rte.corelib.mk | 84 +++++++++++++++++++++++
> > > mk/rte.lib.mk | 49 +++-----------
> > > mk/rte.sdkbuild.mk | 3 -
> > > mk/rte.sharelib.mk | 101 ----------------------------
> > > mk/rte.vars.mk | 9 ---
> > > 48 files changed, 276 insertions(+), 282 deletions(-) create mode
> > > 100644 lib/librte_core/Makefile create mode 100644 mk/rte.corelib.mk
> > > delete mode 100644 mk/rte.sharelib.mk
> > >
> > > --
> > > 1.9.3
> > >
> > >
> > Something occured to me thinking about this patch set. I noticed recently
> > that different rules are used to build the shared combined lib from the
> > individual shared objects. The implication here is that linker options specified
> > in individual make files (like the LIBABIVER and EXPORT_MAP options in my
> > ABI versioning script) get ignored, which is bad. Any other file specific linker
> > options (like <file>_LDFLAGS specified in individual library makefiles are
> > getting dropped for the combined lib.
> >
> > It seems like it would be better if the combined libs were manufactured as
> > linker scripts themselves (textfiles that used linker directives to include
> > individual libraries under the covers (see /lib64/libc.so for an example).
> >
> > The disadvantage of such an approach are fairly minimal. With such a
> > combined library, you still need to install individual libraries, but for
> > applications that wish to link and run against a single dpdk library will still work
> > just as they currently do, you can link to just a single library.
> >
> > The advantage is clear however. By following a linker script aproach, objects
> > build as separate libraries are built exactly the same way, using the same
> > rules with the same options. It reduces the dpdk build environment size and
> > complexity, and reduces the opportunity for bugs to creep in from forgetting
> > to add build options to multiple locations. It also provides a more granular
> > approach for grouping files. Creating a dpdk core library becomes a matter of
> > creating a one line linker script named libdpdk_core.so, rather than re-
> > arraning sections of the build system.
> >
> > Thoughts?
> > Neil
> >
> Hi Neil,
>
> I think that is a very interesting approach.
> I have tried to do something similar in this patch by removing rte.sharelib.mk and
> just having rte.lib.mk to do the linking, leaving as you suggest a single file to
> modify anything related to building libs.
>
> I do think however that your proposal is an improvement over the current patch.
>
> So basically we want:
> - get rid of rte.corelib.mk
> - generate librte_core.so linker script grouping core libs
> - we do not modify DEPDIR variables
> - when setting LDLIBS to each lib, we do specify -lrte_core, right?
>
Exactly, and librte_core.so is really just a text file containing the following
line
:
INPUT(-lrte_malloc -lrte_mbuf -lrte_eal ....)
Adding in whatever libraries you want librte_core to consist of. Truthfully,
you could almost get rid of the COMBINE_LIBS option entirely, and just create
this file statically if you wanted to (not sure thats the best approach, but its
definately do-able).
Regards
Neil
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-01-29 16:38 3% ` Neil Horman
2015-01-29 17:02 0% ` Thomas Monjalon
@ 2015-01-29 17:04 0% ` Gonzalez Monroy, Sergio
2015-01-29 19:45 0% ` Neil Horman
1 sibling, 1 reply; 200+ results
From: Gonzalez Monroy, Sergio @ 2015-01-29 17:04 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Thursday, January 29, 2015 4:39 PM
> To: Gonzalez Monroy, Sergio
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 0/8] Improve build process
>
> On Thu, Jan 29, 2015 at 03:20:03PM +0000, Sergio Gonzalez Monroy wrote:
> > This patch series improves the DPDK build system mostly for shared
> > libraries (and a few nits for static libraries) with the following goals:
> > - Create a library containing core DPDK libraries (librte_eal,
> > librte_malloc, librte_mempool, librte_mbuf and librte_ring).
> > The idea of core libraries is to group those libraries that are
> > always required (and have interdependencies) for any DPDK application.
> > - Remove config option to build a combined library.
> > - For shared libraries, explicitly link against dependant
> > libraries (adding entries to DT_NEEDED).
> > - Update app linking flags for static/shared DPDK libs.
> >
> > Sergio Gonzalez Monroy (8):
> > mk: remove combined library and related options
> > core: create new librte_core
> > mk: new corelib makefile
> > lib: update DEPDIRS variable
> > lib: set LDLIBS for each library
> > mk: use LDLIBS when linking shared libraries
> > mk: update LDLIBS for app building
> > mk: add -lpthread to linuxapp EXECENV_LDLIBS
> >
> > config/common_bsdapp | 6 --
> > config/common_linuxapp | 6 --
> > config/defconfig_ppc_64-power8-linuxapp-gcc | 2 -
> > lib/Makefile | 1 -
> > lib/librte_acl/Makefile | 5 +-
> > lib/librte_cfgfile/Makefile | 4 +-
> > lib/librte_cmdline/Makefile | 6 +-
> > lib/librte_core/Makefile | 45 +++++++++++++
> > lib/librte_distributor/Makefile | 5 +-
> > lib/librte_eal/bsdapp/eal/Makefile | 3 +-
> > lib/librte_eal/linuxapp/eal/Makefile | 3 +-
> > lib/librte_ether/Makefile | 4 +-
> > lib/librte_hash/Makefile | 4 +-
> > lib/librte_ip_frag/Makefile | 6 +-
> > lib/librte_ivshmem/Makefile | 4 +-
> > lib/librte_kni/Makefile | 6 +-
> > lib/librte_kvargs/Makefile | 6 +-
> > lib/librte_lpm/Makefile | 6 +-
> > lib/librte_malloc/Makefile | 2 +-
> > lib/librte_mbuf/Makefile | 2 +-
> > lib/librte_mempool/Makefile | 2 +-
> > lib/librte_meter/Makefile | 4 +-
> > lib/librte_pipeline/Makefile | 3 +
> > lib/librte_pmd_af_packet/Makefile | 5 +-
> > lib/librte_pmd_bond/Makefile | 7 +-
> > lib/librte_pmd_e1000/Makefile | 8 ++-
> > lib/librte_pmd_enic/Makefile | 8 ++-
> > lib/librte_pmd_i40e/Makefile | 8 ++-
> > lib/librte_pmd_ixgbe/Makefile | 8 ++-
> > lib/librte_pmd_pcap/Makefile | 5 +-
> > lib/librte_pmd_ring/Makefile | 6 +-
> > lib/librte_pmd_virtio/Makefile | 7 +-
> > lib/librte_pmd_vmxnet3/Makefile | 8 ++-
> > lib/librte_pmd_xenvirt/Makefile | 8 ++-
> > lib/librte_port/Makefile | 8 +--
> > lib/librte_power/Makefile | 4 +-
> > lib/librte_ring/Makefile | 2 +-
> > lib/librte_sched/Makefile | 7 +-
> > lib/librte_table/Makefile | 8 +--
> > lib/librte_timer/Makefile | 6 +-
> > lib/librte_vhost/Makefile | 9 +--
> > mk/exec-env/linuxapp/rte.vars.mk | 2 +
> > mk/rte.app.mk | 53 ++++-----------
> > mk/rte.corelib.mk | 84 +++++++++++++++++++++++
> > mk/rte.lib.mk | 49 +++-----------
> > mk/rte.sdkbuild.mk | 3 -
> > mk/rte.sharelib.mk | 101 ----------------------------
> > mk/rte.vars.mk | 9 ---
> > 48 files changed, 276 insertions(+), 282 deletions(-) create mode
> > 100644 lib/librte_core/Makefile create mode 100644 mk/rte.corelib.mk
> > delete mode 100644 mk/rte.sharelib.mk
> >
> > --
> > 1.9.3
> >
> >
> Something occured to me thinking about this patch set. I noticed recently
> that different rules are used to build the shared combined lib from the
> individual shared objects. The implication here is that linker options specified
> in individual make files (like the LIBABIVER and EXPORT_MAP options in my
> ABI versioning script) get ignored, which is bad. Any other file specific linker
> options (like <file>_LDFLAGS specified in individual library makefiles are
> getting dropped for the combined lib.
>
> It seems like it would be better if the combined libs were manufactured as
> linker scripts themselves (textfiles that used linker directives to include
> individual libraries under the covers (see /lib64/libc.so for an example).
>
> The disadvantage of such an approach are fairly minimal. With such a
> combined library, you still need to install individual libraries, but for
> applications that wish to link and run against a single dpdk library will still work
> just as they currently do, you can link to just a single library.
>
> The advantage is clear however. By following a linker script aproach, objects
> build as separate libraries are built exactly the same way, using the same
> rules with the same options. It reduces the dpdk build environment size and
> complexity, and reduces the opportunity for bugs to creep in from forgetting
> to add build options to multiple locations. It also provides a more granular
> approach for grouping files. Creating a dpdk core library becomes a matter of
> creating a one line linker script named libdpdk_core.so, rather than re-
> arraning sections of the build system.
>
> Thoughts?
> Neil
>
Hi Neil,
I think that is a very interesting approach.
I have tried to do something similar in this patch by removing rte.sharelib.mk and
just having rte.lib.mk to do the linking, leaving as you suggest a single file to
modify anything related to building libs.
I do think however that your proposal is an improvement over the current patch.
So basically we want:
- get rid of rte.corelib.mk
- generate librte_core.so linker script grouping core libs
- we do not modify DEPDIR variables
- when setting LDLIBS to each lib, we do specify -lrte_core, right?
Regards,
Sergio
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
2015-01-29 16:38 3% ` Neil Horman
@ 2015-01-29 17:02 0% ` Thomas Monjalon
2015-01-29 17:04 0% ` Gonzalez Monroy, Sergio
1 sibling, 0 replies; 200+ results
From: Thomas Monjalon @ 2015-01-29 17:02 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2015-01-29 11:38, Neil Horman:
> On Thu, Jan 29, 2015 at 03:20:03PM +0000, Sergio Gonzalez Monroy wrote:
> > This patch series improves the DPDK build system mostly for shared
> > libraries (and a few nits for static libraries) with the following goals:
> > - Create a library containing core DPDK libraries (librte_eal,
> > librte_malloc, librte_mempool, librte_mbuf and librte_ring).
> > The idea of core libraries is to group those libraries that are
> > always required (and have interdependencies) for any DPDK application.
> > - Remove config option to build a combined library.
> > - For shared libraries, explicitly link against dependant
> > libraries (adding entries to DT_NEEDED).
> > - Update app linking flags for static/shared DPDK libs.
> >
> > Sergio Gonzalez Monroy (8):
> > mk: remove combined library and related options
> > core: create new librte_core
> > mk: new corelib makefile
> > lib: update DEPDIRS variable
> > lib: set LDLIBS for each library
> > mk: use LDLIBS when linking shared libraries
> > mk: update LDLIBS for app building
> > mk: add -lpthread to linuxapp EXECENV_LDLIBS
> >
> Something occured to me thinking about this patch set. I noticed recently that
> different rules are used to build the shared combined lib from the individual
> shared objects. The implication here is that linker options specified in
> individual make files (like the LIBABIVER and EXPORT_MAP options in my ABI
> versioning script) get ignored, which is bad. Any other file specific linker
> options (like <file>_LDFLAGS specified in individual library makefiles are
> getting dropped for the combined lib.
>
> It seems like it would be better if the combined libs were manufactured as
> linker scripts themselves (textfiles that used linker directives to include
> individual libraries under the covers (see /lib64/libc.so for an example).
>
> The disadvantage of such an approach are fairly minimal. With such a combined
> library, you still need to install individual libraries, but for applications
> that wish to link and run against a single dpdk library will still work just as
> they currently do, you can link to just a single library.
>
> The advantage is clear however. By following a linker script aproach, objects
> build as separate libraries are built exactly the same way, using the same rules
> with the same options. It reduces the dpdk build environment size and
> complexity, and reduces the opportunity for bugs to creep in from forgetting to
> add build options to multiple locations. It also provides a more granular
> approach for grouping files. Creating a dpdk core library becomes a matter of
> creating a one line linker script named libdpdk_core.so, rather than re-arraning
> sections of the build system.
>
> Thoughts?
Neil, it seems to be a good idea.
I like the idea of making things simpler ;)
--
Thomas
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/8] Improve build process
@ 2015-01-29 16:38 3% ` Neil Horman
2015-01-29 17:02 0% ` Thomas Monjalon
2015-01-29 17:04 0% ` Gonzalez Monroy, Sergio
0 siblings, 2 replies; 200+ results
From: Neil Horman @ 2015-01-29 16:38 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
On Thu, Jan 29, 2015 at 03:20:03PM +0000, Sergio Gonzalez Monroy wrote:
> This patch series improves the DPDK build system mostly for shared
> libraries (and a few nits for static libraries) with the following goals:
> - Create a library containing core DPDK libraries (librte_eal,
> librte_malloc, librte_mempool, librte_mbuf and librte_ring).
> The idea of core libraries is to group those libraries that are
> always required (and have interdependencies) for any DPDK application.
> - Remove config option to build a combined library.
> - For shared libraries, explicitly link against dependant
> libraries (adding entries to DT_NEEDED).
> - Update app linking flags for static/shared DPDK libs.
>
> Sergio Gonzalez Monroy (8):
> mk: remove combined library and related options
> core: create new librte_core
> mk: new corelib makefile
> lib: update DEPDIRS variable
> lib: set LDLIBS for each library
> mk: use LDLIBS when linking shared libraries
> mk: update LDLIBS for app building
> mk: add -lpthread to linuxapp EXECENV_LDLIBS
>
> config/common_bsdapp | 6 --
> config/common_linuxapp | 6 --
> config/defconfig_ppc_64-power8-linuxapp-gcc | 2 -
> lib/Makefile | 1 -
> lib/librte_acl/Makefile | 5 +-
> lib/librte_cfgfile/Makefile | 4 +-
> lib/librte_cmdline/Makefile | 6 +-
> lib/librte_core/Makefile | 45 +++++++++++++
> lib/librte_distributor/Makefile | 5 +-
> lib/librte_eal/bsdapp/eal/Makefile | 3 +-
> lib/librte_eal/linuxapp/eal/Makefile | 3 +-
> lib/librte_ether/Makefile | 4 +-
> lib/librte_hash/Makefile | 4 +-
> lib/librte_ip_frag/Makefile | 6 +-
> lib/librte_ivshmem/Makefile | 4 +-
> lib/librte_kni/Makefile | 6 +-
> lib/librte_kvargs/Makefile | 6 +-
> lib/librte_lpm/Makefile | 6 +-
> lib/librte_malloc/Makefile | 2 +-
> lib/librte_mbuf/Makefile | 2 +-
> lib/librte_mempool/Makefile | 2 +-
> lib/librte_meter/Makefile | 4 +-
> lib/librte_pipeline/Makefile | 3 +
> lib/librte_pmd_af_packet/Makefile | 5 +-
> lib/librte_pmd_bond/Makefile | 7 +-
> lib/librte_pmd_e1000/Makefile | 8 ++-
> lib/librte_pmd_enic/Makefile | 8 ++-
> lib/librte_pmd_i40e/Makefile | 8 ++-
> lib/librte_pmd_ixgbe/Makefile | 8 ++-
> lib/librte_pmd_pcap/Makefile | 5 +-
> lib/librte_pmd_ring/Makefile | 6 +-
> lib/librte_pmd_virtio/Makefile | 7 +-
> lib/librte_pmd_vmxnet3/Makefile | 8 ++-
> lib/librte_pmd_xenvirt/Makefile | 8 ++-
> lib/librte_port/Makefile | 8 +--
> lib/librte_power/Makefile | 4 +-
> lib/librte_ring/Makefile | 2 +-
> lib/librte_sched/Makefile | 7 +-
> lib/librte_table/Makefile | 8 +--
> lib/librte_timer/Makefile | 6 +-
> lib/librte_vhost/Makefile | 9 +--
> mk/exec-env/linuxapp/rte.vars.mk | 2 +
> mk/rte.app.mk | 53 ++++-----------
> mk/rte.corelib.mk | 84 +++++++++++++++++++++++
> mk/rte.lib.mk | 49 +++-----------
> mk/rte.sdkbuild.mk | 3 -
> mk/rte.sharelib.mk | 101 ----------------------------
> mk/rte.vars.mk | 9 ---
> 48 files changed, 276 insertions(+), 282 deletions(-)
> create mode 100644 lib/librte_core/Makefile
> create mode 100644 mk/rte.corelib.mk
> delete mode 100644 mk/rte.sharelib.mk
>
> --
> 1.9.3
>
>
Something occured to me thinking about this patch set. I noticed recently that
different rules are used to build the shared combined lib from the individual
shared objects. The implication here is that linker options specified in
individual make files (like the LIBABIVER and EXPORT_MAP options in my ABI
versioning script) get ignored, which is bad. Any other file specific linker
options (like <file>_LDFLAGS specified in individual library makefiles are
getting dropped for the combined lib.
It seems like it would be better if the combined libs were manufactured as
linker scripts themselves (textfiles that used linker directives to include
individual libraries under the covers (see /lib64/libc.so for an example).
The disadvantage of such an approach are fairly minimal. With such a combined
library, you still need to install individual libraries, but for applications
that wish to link and run against a single dpdk library will still work just as
they currently do, you can link to just a single library.
The advantage is clear however. By following a linker script aproach, objects
build as separate libraries are built exactly the same way, using the same rules
with the same options. It reduces the dpdk build environment size and
complexity, and reduces the opportunity for bugs to creep in from forgetting to
add build options to multiple locations. It also provides a more granular
approach for grouping files. Creating a dpdk core library becomes a matter of
creating a one line linker script named libdpdk_core.so, rather than re-arraning
sections of the build system.
Thoughts?
Neil
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation
2015-01-21 22:24 9% ` Thomas Monjalon
@ 2015-01-22 19:21 4% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-01-22 19:21 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Wed, Jan 21, 2015 at 11:24:12PM +0100, Thomas Monjalon wrote:
> 2015-01-21 14:43, Neil Horman:
> > On Wed, Jan 21, 2015 at 05:05:51PM +0100, Thomas Monjalon wrote:
> > > 2015-01-21 09:59, Neil Horman:
> > > > Considered and answered already. I'm in favor of listing macros and structure
> > > > changes in the abi document, but I think an exhaustive list isn't needed. If it
> > > > is, we could spend pages diving into minute. Better to point out the need for
> > > > abi noticies as patches get posted.
> > >
> > > I'm afraid you don't understand what I'm saying. Copy/paste:
> > > "No, I was suggesting to explain in this doc that macro removal must be
> > > announced with a deprecation notice,
> > > and that in case structure must be reworked, the name must change if we
> > > want to preserve ABI compatibility with old structure."
> > > Rewording: if you agree with this policy, please add it in this document.
> > >
> > Yes, we're on the same page regarding what your asking, I just don't agree that
> > it needs to be explicitly called out. I thought I was clear on that.
> > Appaerntly not however, so if it will settle the point, I'll just add it.
>
> OK maybe I didn't explain enough my proposal.
> You can disagree but I want to be sure we think about the same thing.
>
> 1) Macros are not part of the ABI but can be part of the API.
> Such macro removal must be announced in the previous release.
> 2) Structures are part of the ABI but cannot be versionned as the functions.
> So an ABI breaking change should be done by cloning the structure in a new one.
> And the API functions where this structure appears should be cloned and versionned
> to support new structure while keeping old version.
>
> Maybe that these precisions are confuse and useless.
> Now I think I understand what you were saying by "an exhaustive list isn't needed".
> You mean listing all types of ABI/API breakage like I did with these 2 cases, right?
> I thought it was related to list of real/effective deprecations.
>
> > > > > Neil, we expect that you consider comments done previously and that you test your patch.
> > > > > Otherwise, we are losing time in useless reviews.
> > > > >
> > > > Thomas, I have considered your comments, I simply don't agree with all of them,
> > > > and I made that clear.
> > > >
> > > > As for losing time, you let the first attempt at this
> > > > patch rot on the list in 1.7 and have done the same thing for the 1.8 cycle
> > > > until I yelled for reviews.
> > >
> > > Now, I'm really upset of your wrong assumptions.
> > > You sent your first proposal on september, during 1.8 cycle, not 1.7 !
> > > And during this cycle, the decision was to postpone it for 2.0 release.
> > >
> > you're missing the point. I apologize for not getting the release numbers right,
> > it should be 1.8 to 2.0 not 1.7 to 1.8 as you note, but that doesn't really
> > matter. The point was 6 months. 6 months this has been sitting around.
>
> No, 5 months. Yes, it's long.
>
> > In that time up to this point I've gotten one review from another devloper on the
> > set, and you indicating that its not ready yet. Then, the day 1.8 released, I
> > reposed the patch series as we agreed, and its taken almost 5 weeks before I've
> > gotten any feedback on it, and then its feedback that could have been given 6
> > months ago (you'll note this patch was initially identical to the version I
> > posted back in september). I think you can understand how I find that
> > frustrating.
>
> You must understand that I'd prefer more people feel involved by this change.
> It would be saner to have this policy reviewed and acked by many developpers.
> As it was announced on the roadmap for 2.0, this first month of the cycle was
> ideal to have more discussions on how this policy can be precisely applied.
> You only received my comments (which may be useless) and it's now time to
> apply this important patchset.
>
> > > I don't understand what's wrong with you.
> > The above is whats wrong with me. The fact that I can try and try and try to
> > add value to this project so that I can expand its user base, and the best I've
> > thus far been able to receive is indifference. At worst, the indifference is
> > followed by being told that the indifference is tantamount to rejection.
> >
> >
> > > You don't make any effort to understand what we are saying and
> > > you make no effort to understand what is this doc directory.
> > > You prefer crying that your patch is not applied.
> > No effort? How many emails have I written contesting your opinions, presenting
> > supporting evidence, only to be met with assertions? I don't think I'm the one
> > not making an effort here.
>
> At the end, I accept your point of view and will apply the patchset.
>
> > > And I still don't understand if you are willing to work on a test tool for ABI?
> > >
> > From this email
> > http://dpdk.org/ml/archives/dev/2015-January/011306.html
> >
> > =======================================================
> > > Yes, it should be another patchset.
> > > Do you plan to work on it? It would be very convenient for developpers and
> > > maintainers to test ABI compatibility.
> > >
> > Gladly, if we can get this in. I think its an important tool.
> > =========================================================
> >
> > I'm not sure how thats unclear, but in the event that it wasn't, yes, I will
> > gladly work on such a tool.
>
> OK thanks, it would be helpful to have it in release 2.0.
>
Its not going to make 2.0, its a big undertaking. If you wanted it in 2.0 that
would have been something to bring up 5 months ago.
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v8 4/4] docs: Add ABI documentation
2015-01-22 15:49 23% ` [dpdk-dev] [PATCH v8 4/4] docs: Add ABI documentation Neil Horman
@ 2015-01-22 16:46 4% ` Butler, Siobhan A
0 siblings, 0 replies; 200+ results
From: Butler, Siobhan A @ 2015-01-22 16:46 UTC (permalink / raw)
To: Neil Horman, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Thursday, January 22, 2015 3:49 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v8 4/4] docs: Add ABI documentation
>
> Adding a document describing rudimentary ABI policy and adding notice
> space for any deprecation announcements
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
>
> ---
> Change notes:
>
> v5) Updated documentation to add notes from Thomas M.
>
> v6) Moved abi.txt to guides/rel_notes/abi.rst
>
> v7) Updated abi.rst to integrate with index file
> Updated abi.rst to conform to rst formatting
> Updated abi.rst to include example deprecation notices. Its not exactly the
> language that Thomas indicated, but I think it makes the idea clear.
>
> v8) Add missing file index.rst which was left out of the prior commit
> ---
> doc/guides/rel_notes/abi.rst | 40
> ++++++++++++++++++++++++++++++++++++++++
> doc/guides/rel_notes/index.rst | 1 +
> 2 files changed, 41 insertions(+)
> create mode 100644 doc/guides/rel_notes/abi.rst
>
> diff --git a/doc/guides/rel_notes/abi.rst b/doc/guides/rel_notes/abi.rst new
> file mode 100644 index 0000000..73d88ca
> --- /dev/null
> +++ b/doc/guides/rel_notes/abi.rst
> @@ -0,0 +1,40 @@
> +ABI policy
> +==========
> +ABI versions are set at the time of major release labeling, and ABI may
> +change multiple times between the last labeling and the HEAD label of
> +the git tree without warning.
> +
> +ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle,
> +after it has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and
> +then the decision to remove it is made during the development of DPDK
> +1.9. The decision will be recorded here, shipped with the DPDK 1.9
> +release, and actually removed when DPDK
> +1.10 ships.
> +
> +ABI versions may be deprecated in whole, or in part as needed by a given
> update.
> +
> +Some ABI changes may be too significant to reasonably maintain multiple
> +versions of. In those events ABI's may be updated without backward
> +compatibility provided. The requirements for doing so are:
> +
> +#. At least 3 acknoweldgements of the need on the dpdk.org #. A full
> +deprecation cycle must be made to offer downstream consumers sufficient
> +warning of the change. E.g. if dpdk 2.0 is under development when the
> +change is proposed, a deprecation notice must be added to this file,
> +and released with dpdk 2.0. Then the change may be incorporated for
> +dpdk 2.1 #. The LIBABIVER variable in the makefilei(s) where the ABI
> +changes are incorporated must be incremented in parallel with the ABI
> +changes themselves
> +
> +Note that the above process for ABI deprecation should not be
> +undertaken lightly. ABI stability is extreemely important for
> +downstream consumers of the DPDK, especially when distributed in shared
> +object form. Every effort should be made to preserve ABI whenever
> +possible. For instance, reorganizing public structure field for
> +astetic or readability purposes should be avoided as it will cause ABI
> +breakage. Only significant (e.g. performance) reasons should be seen as
> cause to alter ABI.
> +
> +Examples of Deprecation notices
> +-------------------------------
> +* The Macro #RTE_FOO is deprecated and will be removed with version
> +2.0, to be replaced with the inline function rte_bar()
> +* The function rte_mbuf_grok has been updated to include new parameter
> +in version 2.0. Backwards compatibility will be maintained for this
> +function until the release of version 2.1
> +* The members struct foo have been reorganized in release 2.0. Existing
> binary applications will have backwards compatibility in release 2.0, while
> newly built binaries will need to reference new structure variant struct foo2.
> Compatibility will be removed in release 2.2, and all applications will require
> updating a rebuilding to the new structure at that time, which will be
> renamed to the origional struct foo.
> +* Significant ABI changes are planned for the librte_dostuff library. The
> upcomming release 2.0 will not contain these changes, but release 2.1 will,
> and no backwards compatibility is planned due to the invasive nature of
> these changes. Binaries using this library built prior to version 2.1 will require
> updating and recompilation.
> +
> +Deprecation Notices
> +-------------------
> diff --git a/doc/guides/rel_notes/index.rst b/doc/guides/rel_notes/index.rst
> index 2724149..cf712b2 100644
> --- a/doc/guides/rel_notes/index.rst
> +++ b/doc/guides/rel_notes/index.rst
> @@ -48,4 +48,5 @@ Contents
> updating_apps
> known_issues
> resolved_issues
> + abi
> faq
> --
> 2.1.0
Acked-by: Siobhan Butler <siobhan.a.butler@intel.com>
^ permalink raw reply [relevance 4%]
* [dpdk-dev] [PATCH v8 4/4] docs: Add ABI documentation
2015-01-22 15:49 3% ` [dpdk-dev] [PATCH v8 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2015-01-22 15:49 7% ` [dpdk-dev] [PATCH v8 3/4] Add library version extenstion Neil Horman
@ 2015-01-22 15:49 23% ` Neil Horman
2015-01-22 16:46 4% ` Butler, Siobhan A
1 sibling, 1 reply; 200+ results
From: Neil Horman @ 2015-01-22 15:49 UTC (permalink / raw)
To: dev
Adding a document describing rudimentary ABI policy and adding notice space for
any deprecation announcements
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
Change notes:
v5) Updated documentation to add notes from Thomas M.
v6) Moved abi.txt to guides/rel_notes/abi.rst
v7) Updated abi.rst to integrate with index file
Updated abi.rst to conform to rst formatting
Updated abi.rst to include example deprecation notices. Its not exactly the
language that Thomas indicated, but I think it makes the idea clear.
v8) Add missing file index.rst which was left out of the prior commit
---
doc/guides/rel_notes/abi.rst | 40 ++++++++++++++++++++++++++++++++++++++++
doc/guides/rel_notes/index.rst | 1 +
2 files changed, 41 insertions(+)
create mode 100644 doc/guides/rel_notes/abi.rst
diff --git a/doc/guides/rel_notes/abi.rst b/doc/guides/rel_notes/abi.rst
new file mode 100644
index 0000000..73d88ca
--- /dev/null
+++ b/doc/guides/rel_notes/abi.rst
@@ -0,0 +1,40 @@
+ABI policy
+==========
+ABI versions are set at the time of major release labeling, and ABI may change
+multiple times between the last labeling and the HEAD label of the git tree
+without warning.
+
+ABI versions, once released are available until such time as their
+deprecation has been noted here for at least one major release cycle, after it
+has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
+remove it is made during the development of DPDK 1.9. The decision will be
+recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
+1.10 ships.
+
+ABI versions may be deprecated in whole, or in part as needed by a given update.
+
+Some ABI changes may be too significant to reasonably maintain multiple
+versions of. In those events ABI's may be updated without backward
+compatibility provided. The requirements for doing so are:
+
+#. At least 3 acknoweldgements of the need on the dpdk.org
+#. A full deprecation cycle must be made to offer downstream consumers sufficient warning of the change. E.g. if dpdk 2.0 is under development when the change is proposed, a deprecation notice must be added to this file, and released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
+#. The LIBABIVER variable in the makefilei(s) where the ABI changes are incorporated must be incremented in parallel with the ABI changes themselves
+
+Note that the above process for ABI deprecation should not be undertaken
+lightly. ABI stability is extreemely important for downstream consumers of the
+DPDK, especially when distributed in shared object form. Every effort should be
+made to preserve ABI whenever possible. For instance, reorganizing public
+structure field for astetic or readability purposes should be avoided as it will
+cause ABI breakage. Only significant (e.g. performance) reasons should be seen
+as cause to alter ABI.
+
+Examples of Deprecation notices
+-------------------------------
+* The Macro #RTE_FOO is deprecated and will be removed with version 2.0, to be replaced with the inline function rte_bar()
+* The function rte_mbuf_grok has been updated to include new parameter in version 2.0. Backwards compatibility will be maintained for this function until the release of version 2.1
+* The members struct foo have been reorganized in release 2.0. Existing binary applications will have backwards compatibility in release 2.0, while newly built binaries will need to reference new structure variant struct foo2. Compatibility will be removed in release 2.2, and all applications will require updating a rebuilding to the new structure at that time, which will be renamed to the origional struct foo.
+* Significant ABI changes are planned for the librte_dostuff library. The upcomming release 2.0 will not contain these changes, but release 2.1 will, and no backwards compatibility is planned due to the invasive nature of these changes. Binaries using this library built prior to version 2.1 will require updating and recompilation.
+
+Deprecation Notices
+-------------------
diff --git a/doc/guides/rel_notes/index.rst b/doc/guides/rel_notes/index.rst
index 2724149..cf712b2 100644
--- a/doc/guides/rel_notes/index.rst
+++ b/doc/guides/rel_notes/index.rst
@@ -48,4 +48,5 @@ Contents
updating_apps
known_issues
resolved_issues
+ abi
faq
--
2.1.0
^ permalink raw reply [relevance 23%]
* [dpdk-dev] [PATCH v8 3/4] Add library version extenstion
2015-01-22 15:49 3% ` [dpdk-dev] [PATCH v8 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2015-01-22 15:49 7% ` Neil Horman
2015-01-22 15:49 23% ` [dpdk-dev] [PATCH v8 4/4] docs: Add ABI documentation Neil Horman
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2015-01-22 15:49 UTC (permalink / raw)
To: dev
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken. This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
Change Notes:
v3)
Made symlinking of libraries conditional on a DSO build
v4) Removed erroneous newline
changed @exit 1 to @false
changed ./$(LIB) to $<
---
lib/librte_acl/Makefile | 2 ++
lib/librte_cfgfile/Makefile | 2 ++
lib/librte_cmdline/Makefile | 2 ++
lib/librte_compat/Makefile | 2 ++
lib/librte_distributor/Makefile | 2 ++
lib/librte_eal/bsdapp/eal/Makefile | 2 ++
lib/librte_eal/linuxapp/eal/Makefile | 2 ++
lib/librte_ether/Makefile | 2 ++
lib/librte_hash/Makefile | 2 ++
lib/librte_ip_frag/Makefile | 2 ++
lib/librte_ivshmem/Makefile | 2 ++
lib/librte_kni/Makefile | 2 ++
lib/librte_kvargs/Makefile | 2 ++
lib/librte_lpm/Makefile | 2 ++
lib/librte_malloc/Makefile | 2 ++
lib/librte_mbuf/Makefile | 2 ++
lib/librte_mempool/Makefile | 2 ++
lib/librte_meter/Makefile | 2 ++
lib/librte_pipeline/Makefile | 2 ++
lib/librte_pmd_af_packet/Makefile | 2 ++
lib/librte_pmd_bond/Makefile | 2 ++
lib/librte_pmd_e1000/Makefile | 2 ++
lib/librte_pmd_enic/Makefile | 2 ++
lib/librte_pmd_i40e/Makefile | 2 ++
lib/librte_pmd_ixgbe/Makefile | 2 ++
lib/librte_pmd_pcap/Makefile | 2 ++
lib/librte_pmd_ring/Makefile | 2 ++
lib/librte_pmd_virtio/Makefile | 2 ++
lib/librte_pmd_vmxnet3/Makefile | 2 ++
lib/librte_pmd_xenvirt/Makefile | 2 ++
lib/librte_port/Makefile | 2 ++
lib/librte_power/Makefile | 2 ++
lib/librte_ring/Makefile | 2 ++
lib/librte_sched/Makefile | 2 ++
lib/librte_table/Makefile | 2 ++
lib/librte_timer/Makefile | 2 ++
lib/librte_vhost/Makefile | 2 ++
mk/rte.lib.mk | 12 ++++++++++--
38 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 45cbf80..765deb1 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_acl_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index a4f73de..032c240 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_cfgfile_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 3c71831..719dff6 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_cmdline_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
index 0bab870..0c57533 100644
--- a/lib/librte_compat/Makefile
+++ b/lib/librte_compat/Makefile
@@ -32,6 +32,8 @@
include $(RTE_SDK)/mk/rte.vars.mk
+LIBABIVER := 1
+
# install includes
SYMLINK-y-include := rte_compat.h
diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
index 3674a2c..4c9af17 100644
--- a/lib/librte_distributor/Makefile
+++ b/lib/librte_distributor/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_distributor_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index 0b5f9d9..ae214a4 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -48,6 +48,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
# specific to linuxapp exec-env
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index bae8af1..e117cec 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -35,6 +35,8 @@ LIB = librte_eal.a
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
VPATH += $(RTE_SDK)/lib/librte_eal/common
CFLAGS += -I$(SRCDIR)/include
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 80ad78d..c0e5768 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_ether_version.map
+LIBABIVER := 1
+
SRCS-y += rte_ethdev.c
#
diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
index bec61ab..3696cb1 100644
--- a/lib/librte_hash/Makefile
+++ b/lib/librte_hash/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_hash_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index aa88578..fe926f7 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_ipfrag_version.map
+LIBABIVER := 1
+
#source files
ifeq ($(CONFIG_RTE_MBUF_REFCNT),y)
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
index 068ee10..16defdb 100644
--- a/lib/librte_ivshmem/Makefile
+++ b/lib/librte_ivshmem/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ivshmem_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index 93a516d..7107832 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_kni_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
index b1c34f3..87b09f2 100644
--- a/lib/librte_kvargs/Makefile
+++ b/lib/librte_kvargs/Makefile
@@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_kvargs_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
index 8214630..35e6389 100644
--- a/lib/librte_lpm/Makefile
+++ b/lib/librte_lpm/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_lpm_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
index 15b7eed..947e41c 100644
--- a/lib/librte_malloc/Makefile
+++ b/lib/librte_malloc/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_malloc.a
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_malloc_version.map
diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
index 03becae..080f3cf 100644
--- a/lib/librte_mbuf/Makefile
+++ b/lib/librte_mbuf/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mbuf_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
index 31d1a71..940d1f7 100644
--- a/lib/librte_mempool/Makefile
+++ b/lib/librte_mempool/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mempool_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index c4a7a32..8765881 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_meter_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 15b58df..15e406b 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pipeline_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_af_packet/Makefile b/lib/librte_pmd_af_packet/Makefile
index 85a7860..f0bf537 100644
--- a/lib/librte_pmd_af_packet/Makefile
+++ b/lib/librte_pmd_af_packet/Makefile
@@ -40,6 +40,8 @@ LIB = librte_pmd_af_packet.a
EXPORT_MAP := rte_pmd_af_packet_version.map
+LIBABIVER := 1
+
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 074110a..d6c81a8 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_bond_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
index cd14444..8c8fed8 100644
--- a/lib/librte_pmd_e1000/Makefile
+++ b/lib/librte_pmd_e1000/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_e1000_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile
index 697231c..251a898 100644
--- a/lib/librte_pmd_enic/Makefile
+++ b/lib/librte_pmd_enic/Makefile
@@ -39,6 +39,8 @@ LIB = librte_pmd_enic.a
EXPORT_MAP := rte_pmd_enic_version.map
+LIBABIVER := 1
+
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/
CFLAGS += -O3
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index 73de373..9a0eec8 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_i40e_version.map
+LIBABIVER := 1
+
#
# Add extra flags for base driver files (also known as shared code)
# to disable warnings
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index e0a17f6..d580f62 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_ixgbe_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
index cb6678e..0775dbc 100644
--- a/lib/librte_pmd_pcap/Makefile
+++ b/lib/librte_pmd_pcap/Makefile
@@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_pcap_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
index aa1b461..e442d0b 100644
--- a/lib/librte_pmd_ring/Makefile
+++ b/lib/librte_pmd_ring/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_ring_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
index d979c59..793067f 100644
--- a/lib/librte_pmd_virtio/Makefile
+++ b/lib/librte_pmd_virtio/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_virtio_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index f3ab178..93e5580 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
EXPORT_MAP := rte_pmd_vmxnet3_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
index 4510603..f0c796c 100644
--- a/lib/librte_pmd_xenvirt/Makefile
+++ b/lib/librte_pmd_xenvirt/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_xenvirt_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 266ed39..0e38452 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_port_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index 0547dcd..cee95cd 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_power_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c rte_power_acpi_cpufreq.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c
diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
index b437dc5..84ad3d3 100644
--- a/lib/librte_ring/Makefile
+++ b/lib/librte_ring/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ring_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 48f280a..b1cb285 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
EXPORT_MAP := rte_sched_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
index 4e1a54a..0d8394c 100644
--- a/lib/librte_table/Makefile
+++ b/lib/librte_table/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_table_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
index 9fb6079..2aabef8 100644
--- a/lib/librte_timer/Makefile
+++ b/lib/librte_timer/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_timer_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 96a7dd0..369c25a 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -36,6 +36,8 @@ LIB = librte_vhost.a
EXPORT_MAP := rte_vhost_version.map
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse
LDFLAGS += -lfuse
# all source are stored in SRCS-y
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 1d3b646..865a307 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -37,10 +37,9 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
-
ifeq ($(RTE_BUILD_SHARED_LIB),y)
-LIB := $(patsubst %.a,%.so,$(LIB))
+LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
endif
@@ -113,6 +112,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
#
ifeq ($(RTE_BUILD_SHARED_LIB),y)
$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
+ifeq ($(LIBABIVER),)
+ @echo "Must Specify a $(LIB) ABI version"
+ @false
+endif
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(if $(D),\
@echo -n "$< -> $@ " ; \
@@ -126,6 +129,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
$(depfile_missing),\
$(depfile_newer)),\
$(O_TO_S_DO))
+
ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
$(if $(or \
$(file_missing),\
@@ -163,9 +167,13 @@ endif
# install lib in $(RTE_OUTPUT)/lib
#
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
+ $(eval LIBSONAME := $(basename $(LIB)))
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+ifeq ($(RTE_BUILD_SHARED_LIB),y)
+ $(Q)ln -s -f $< $(RTE_OUTPUT)/lib/$(LIBSONAME)
+endif
#
# Clean all generated files
--
2.1.0
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH v8 1/4] compat: Add infrastructure to support symbol versioning
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (9 preceding siblings ...)
2015-01-21 20:59 3% ` [dpdk-dev] [PATCH v7 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2015-01-22 15:49 3% ` Neil Horman
2015-01-22 15:49 7% ` [dpdk-dev] [PATCH v8 3/4] Add library version extenstion Neil Horman
2015-01-22 15:49 23% ` [dpdk-dev] [PATCH v8 4/4] docs: Add ABI documentation Neil Horman
[not found] ` <1422898822-16422-1-git-send-email-nhorman@tuxdriver.com>
2015-02-03 16:01 0% ` [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Thomas Monjalon
12 siblings, 2 replies; 200+ results
From: Neil Horman @ 2015-01-22 15:49 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
---
Change Notes:
V2)
Moved ifeq to _INSTALL target
V3)
Undo V2 changes and make librte_compat use the rte.install.mk file
instead
v4)
changed --version-script to accept SRCDIR in this patch at per request
documented versioning macros
cleaned up macro parameter consistency
converted SA macro to RTE_STR macro
fixed copyright
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++
lib/librte_compat/rte_compat.h | 117 +++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 4 ++
4 files changed, 160 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 0ffc982..d617d81 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,6 +31,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..0bab870
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2013 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.install.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..d7cc176
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,117 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+#include <rte_common.h>
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. To support that, the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ * char foo(int value, int otherval) { ...}
+ *
+ * 5) Mark the newest version as the default version
+ * BIND_DEFAULT_SYMBOL(foo, 1.9);
+ *
+ */
+
+/*
+ * Macro Parameters:
+ * b - function base name
+ * e - function version extension, to be concatenated with base name
+ * n - function symbol version string to be applied
+ */
+
+/*
+ * VERSION_SYMBOL
+ * Creates a symbol version table entry binding symbol <b>@DPDK_<n> to the internal
+ * function name <b>_<e>
+ */
+#define VERSION_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@DPDK_"RTE_STR(n))
+
+/*
+ * BASE_SYMBOL
+ * Creates a symbol version table entry binding unversioned symbol <b>
+ * to the internal function <b>_<e>
+ */
+#define BASE_SYMBOL(b, e) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@")
+
+/*
+ * BNID_DEFAULT_SYMBOL
+ * Creates a symbol version entry instructing the linker to bind references to
+ * symbol <b> to the internal symbol <b>_<e>
+ */
+#define BIND_DEFAULT_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@@DPDK_"RTE_STR(n))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+#define BASE_SYMBOL(b, n)
+#define BIND_DEFAULT_SYMBOL(b, v)
+
+/*
+ * RTE_BUILD_SHARED_LIB=n
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 81bf8e1..1d3b646 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
--
2.1.0
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH v7 4/4] docs: Add ABI documentation
2015-01-22 10:56 8% ` Iremonger, Bernard
@ 2015-01-22 15:37 7% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-01-22 15:37 UTC (permalink / raw)
To: Iremonger, Bernard; +Cc: dev
On Thu, Jan 22, 2015 at 10:56:08AM +0000, Iremonger, Bernard wrote:
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> > Sent: Wednesday, January 21, 2015 9:00 PM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH v7 4/4] docs: Add ABI documentation
> >
> > Adding a document describing rudimentary ABI policy and adding notice space for any deprecation
> > announcements
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
>
> Hi Neil,
>
> Tried to apply the patch and build it, the following warnings occurred.
>
> Applying: docs: Add ABI documentation
> /nfs/sie/disks/git_workspace/bairemon/dpdk-doc-next/.git/rebase-apply/patch:55: trailing whitespace.
> -------------------------------
> /nfs/sie/disks/git_workspace/bairemon/dpdk-doc-next/.git/rebase-apply/patch:22: new blank line at EOF.
> +
> warning: 2 lines add whitespace errors.
>
Those errors don't make much sense. Theres no whitespace on line 55 of the
patch after the last character and line 22 isn't the end of a file that I can
see.
> sivswdev01> make doc-guides-html
> sphinx for guides...
> /nfs/sie/disks/git_workspace/bairemon/dpdk-doc-next/doc/guides/rel_notes/abi.rst:: WARNING: document isn't included in any toctree
>
> Change to doc/guides/rel_notes/index.rst is missing from the patch.
>
> Suggest applying and building the patch and then checking the generated HTML in Firefox to see that it is as you expect.
> file:///home/nhorman/dpdk-doc-next/build/doc/html/guides/rel_notes/index.html
>
No, the generated html works fine. I have the abi line added to index.rst but
somehow it didn't get comitted, so my testing worked, but the patch isn't right.
I'll resend it, and try to figure out whats wrong with those lines, though they
really seem screwy to me.
Neil
> Regards,
>
> Bernard.
>
>
> >
> > ---
> > Change notes:
> >
> > v5) Updated documentation to add notes from Thomas M.
> >
> > v6) Moved abi.txt to guides/rel_notes/abi.rst
> >
> > v7) Updated abi.rst to integrate with index file
> > Updated abi.rst to conform to rst formatting
> > Updated abi.rst to include example deprecation notices. Its not exactly the language that Thomas
> > indicated, but I think it makes the idea clear.
> > ---
> > doc/guides/rel_notes/abi.rst | 41 +++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 41 insertions(+)
> > create mode 100644 doc/guides/rel_notes/abi.rst
> >
> > diff --git a/doc/guides/rel_notes/abi.rst b/doc/guides/rel_notes/abi.rst new file mode 100644 index
> > 0000000..9b72719
> > --- /dev/null
> > +++ b/doc/guides/rel_notes/abi.rst
> > @@ -0,0 +1,41 @@
> > +ABI policy
> > +==========
> > +ABI versions are set at the time of major release labeling, and ABI may
> > +change multiple times between the last labeling and the HEAD label of
> > +the git tree without warning.
> > +
> > +ABI versions, once released are available until such time as their
> > +deprecation has been noted here for at least one major release cycle,
> > +after it has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and
> > +then the decision to remove it is made during the development of DPDK
> > +1.9. The decision will be recorded here, shipped with the DPDK 1.9
> > +release, and actually removed when DPDK
> > +1.10 ships.
> > +
> > +ABI versions may be deprecated in whole, or in part as needed by a given update.
> > +
> > +Some ABI changes may be too significant to reasonably maintain multiple
> > +versions of. In those events ABI's may be updated without backward
> > +compatibility provided. The requirements for doing so are:
> > +
> > +#. At least 3 acknoweldgements of the need on the dpdk.org #. A full
> > +deprecation cycle must be made to offer downstream consumers sufficient
> > +warning of the change. E.g. if dpdk 2.0 is under development when the
> > +change is proposed, a deprecation notice must be added to this file,
> > +and released with dpdk 2.0. Then the change may be incorporated for
> > +dpdk 2.1 #. The LIBABIVER variable in the makefilei(s) where the ABI
> > +changes are incorporated must be incremented in parallel with the ABI
> > +changes themselves
> > +
> > +Note that the above process for ABI deprecation should not be
> > +undertaken lightly. ABI stability is extreemely important for
> > +downstream consumers of the DPDK, especially when distributed in shared
> > +object form. Every effort should be made to preserve ABI whenever
> > +possible. For instance, reorganizing public structure field for
> > +astetic or readability purposes should be avoided as it will cause ABI
> > +breakage. Only significant (e.g. performance) reasons should be seen as cause to alter ABI.
> > +
> > +Examples of Deprecation notices
> > +-------------------------------
> > +* The Macro #RTE_FOO is deprecated and will be removed with version
> > +2.0, to be replaced with the inline function rte_bar()
> > +* The function rte_mbuf_grok has been updated to include new parameter
> > +in version 2.0. Backwards compatibility will be maintained for this
> > +function until the release of version 2.1
> > +* The members struct foo have been reorganized in release 2.0. Existing binary applications will have
> > backwards compatibility in release 2.0, while newly built binaries will need to reference new structure
> > variant struct foo2. Compatibility will be removed in release 2.2, and all applications will require
> > updating a rebuilding to the new structure at that time, which will be renamed to the origional struct
> > foo.
> > +* Significant ABI changes are planned for the librte_dostuff library. The upcomming release 2.0 will
> > not contain these changes, but release 2.1 will, and no backwards compatibility is planned due to the
> > invasive nature of these changes. Binaries using this library built prior to version 2.1 will require
> > updating and recompilation.
> > +
> > +Deprecation Notices
> > +-------------------
> > +
> > --
> > 2.1.0
>
>
^ permalink raw reply [relevance 7%]
* Re: [dpdk-dev] [PATCH v7 4/4] docs: Add ABI documentation
2015-01-21 20:59 23% ` [dpdk-dev] [PATCH v7 4/4] docs: Add ABI documentation Neil Horman
@ 2015-01-22 10:56 8% ` Iremonger, Bernard
2015-01-22 15:37 7% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Iremonger, Bernard @ 2015-01-22 10:56 UTC (permalink / raw)
To: Neil Horman, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Wednesday, January 21, 2015 9:00 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v7 4/4] docs: Add ABI documentation
>
> Adding a document describing rudimentary ABI policy and adding notice space for any deprecation
> announcements
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
Hi Neil,
Tried to apply the patch and build it, the following warnings occurred.
Applying: docs: Add ABI documentation
/nfs/sie/disks/git_workspace/bairemon/dpdk-doc-next/.git/rebase-apply/patch:55: trailing whitespace.
-------------------------------
/nfs/sie/disks/git_workspace/bairemon/dpdk-doc-next/.git/rebase-apply/patch:22: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
sivswdev01> make doc-guides-html
sphinx for guides...
/nfs/sie/disks/git_workspace/bairemon/dpdk-doc-next/doc/guides/rel_notes/abi.rst:: WARNING: document isn't included in any toctree
Change to doc/guides/rel_notes/index.rst is missing from the patch.
Suggest applying and building the patch and then checking the generated HTML in Firefox to see that it is as you expect.
file:///home/nhorman/dpdk-doc-next/build/doc/html/guides/rel_notes/index.html
Regards,
Bernard.
>
> ---
> Change notes:
>
> v5) Updated documentation to add notes from Thomas M.
>
> v6) Moved abi.txt to guides/rel_notes/abi.rst
>
> v7) Updated abi.rst to integrate with index file
> Updated abi.rst to conform to rst formatting
> Updated abi.rst to include example deprecation notices. Its not exactly the language that Thomas
> indicated, but I think it makes the idea clear.
> ---
> doc/guides/rel_notes/abi.rst | 41 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
> create mode 100644 doc/guides/rel_notes/abi.rst
>
> diff --git a/doc/guides/rel_notes/abi.rst b/doc/guides/rel_notes/abi.rst new file mode 100644 index
> 0000000..9b72719
> --- /dev/null
> +++ b/doc/guides/rel_notes/abi.rst
> @@ -0,0 +1,41 @@
> +ABI policy
> +==========
> +ABI versions are set at the time of major release labeling, and ABI may
> +change multiple times between the last labeling and the HEAD label of
> +the git tree without warning.
> +
> +ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle,
> +after it has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and
> +then the decision to remove it is made during the development of DPDK
> +1.9. The decision will be recorded here, shipped with the DPDK 1.9
> +release, and actually removed when DPDK
> +1.10 ships.
> +
> +ABI versions may be deprecated in whole, or in part as needed by a given update.
> +
> +Some ABI changes may be too significant to reasonably maintain multiple
> +versions of. In those events ABI's may be updated without backward
> +compatibility provided. The requirements for doing so are:
> +
> +#. At least 3 acknoweldgements of the need on the dpdk.org #. A full
> +deprecation cycle must be made to offer downstream consumers sufficient
> +warning of the change. E.g. if dpdk 2.0 is under development when the
> +change is proposed, a deprecation notice must be added to this file,
> +and released with dpdk 2.0. Then the change may be incorporated for
> +dpdk 2.1 #. The LIBABIVER variable in the makefilei(s) where the ABI
> +changes are incorporated must be incremented in parallel with the ABI
> +changes themselves
> +
> +Note that the above process for ABI deprecation should not be
> +undertaken lightly. ABI stability is extreemely important for
> +downstream consumers of the DPDK, especially when distributed in shared
> +object form. Every effort should be made to preserve ABI whenever
> +possible. For instance, reorganizing public structure field for
> +astetic or readability purposes should be avoided as it will cause ABI
> +breakage. Only significant (e.g. performance) reasons should be seen as cause to alter ABI.
> +
> +Examples of Deprecation notices
> +-------------------------------
> +* The Macro #RTE_FOO is deprecated and will be removed with version
> +2.0, to be replaced with the inline function rte_bar()
> +* The function rte_mbuf_grok has been updated to include new parameter
> +in version 2.0. Backwards compatibility will be maintained for this
> +function until the release of version 2.1
> +* The members struct foo have been reorganized in release 2.0. Existing binary applications will have
> backwards compatibility in release 2.0, while newly built binaries will need to reference new structure
> variant struct foo2. Compatibility will be removed in release 2.2, and all applications will require
> updating a rebuilding to the new structure at that time, which will be renamed to the origional struct
> foo.
> +* Significant ABI changes are planned for the librte_dostuff library. The upcomming release 2.0 will
> not contain these changes, but release 2.1 will, and no backwards compatibility is planned due to the
> invasive nature of these changes. Binaries using this library built prior to version 2.1 will require
> updating and recompilation.
> +
> +Deprecation Notices
> +-------------------
> +
> --
> 2.1.0
^ permalink raw reply [relevance 8%]
* Re: [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation
2015-01-21 19:43 4% ` Neil Horman
@ 2015-01-21 22:24 9% ` Thomas Monjalon
2015-01-22 19:21 4% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2015-01-21 22:24 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2015-01-21 14:43, Neil Horman:
> On Wed, Jan 21, 2015 at 05:05:51PM +0100, Thomas Monjalon wrote:
> > 2015-01-21 09:59, Neil Horman:
> > > Considered and answered already. I'm in favor of listing macros and structure
> > > changes in the abi document, but I think an exhaustive list isn't needed. If it
> > > is, we could spend pages diving into minute. Better to point out the need for
> > > abi noticies as patches get posted.
> >
> > I'm afraid you don't understand what I'm saying. Copy/paste:
> > "No, I was suggesting to explain in this doc that macro removal must be
> > announced with a deprecation notice,
> > and that in case structure must be reworked, the name must change if we
> > want to preserve ABI compatibility with old structure."
> > Rewording: if you agree with this policy, please add it in this document.
> >
> Yes, we're on the same page regarding what your asking, I just don't agree that
> it needs to be explicitly called out. I thought I was clear on that.
> Appaerntly not however, so if it will settle the point, I'll just add it.
OK maybe I didn't explain enough my proposal.
You can disagree but I want to be sure we think about the same thing.
1) Macros are not part of the ABI but can be part of the API.
Such macro removal must be announced in the previous release.
2) Structures are part of the ABI but cannot be versionned as the functions.
So an ABI breaking change should be done by cloning the structure in a new one.
And the API functions where this structure appears should be cloned and versionned
to support new structure while keeping old version.
Maybe that these precisions are confuse and useless.
Now I think I understand what you were saying by "an exhaustive list isn't needed".
You mean listing all types of ABI/API breakage like I did with these 2 cases, right?
I thought it was related to list of real/effective deprecations.
> > > > Neil, we expect that you consider comments done previously and that you test your patch.
> > > > Otherwise, we are losing time in useless reviews.
> > > >
> > > Thomas, I have considered your comments, I simply don't agree with all of them,
> > > and I made that clear.
> > >
> > > As for losing time, you let the first attempt at this
> > > patch rot on the list in 1.7 and have done the same thing for the 1.8 cycle
> > > until I yelled for reviews.
> >
> > Now, I'm really upset of your wrong assumptions.
> > You sent your first proposal on september, during 1.8 cycle, not 1.7 !
> > And during this cycle, the decision was to postpone it for 2.0 release.
> >
> you're missing the point. I apologize for not getting the release numbers right,
> it should be 1.8 to 2.0 not 1.7 to 1.8 as you note, but that doesn't really
> matter. The point was 6 months. 6 months this has been sitting around.
No, 5 months. Yes, it's long.
> In that time up to this point I've gotten one review from another devloper on the
> set, and you indicating that its not ready yet. Then, the day 1.8 released, I
> reposed the patch series as we agreed, and its taken almost 5 weeks before I've
> gotten any feedback on it, and then its feedback that could have been given 6
> months ago (you'll note this patch was initially identical to the version I
> posted back in september). I think you can understand how I find that
> frustrating.
You must understand that I'd prefer more people feel involved by this change.
It would be saner to have this policy reviewed and acked by many developpers.
As it was announced on the roadmap for 2.0, this first month of the cycle was
ideal to have more discussions on how this policy can be precisely applied.
You only received my comments (which may be useless) and it's now time to
apply this important patchset.
> > I don't understand what's wrong with you.
> The above is whats wrong with me. The fact that I can try and try and try to
> add value to this project so that I can expand its user base, and the best I've
> thus far been able to receive is indifference. At worst, the indifference is
> followed by being told that the indifference is tantamount to rejection.
>
>
> > You don't make any effort to understand what we are saying and
> > you make no effort to understand what is this doc directory.
> > You prefer crying that your patch is not applied.
> No effort? How many emails have I written contesting your opinions, presenting
> supporting evidence, only to be met with assertions? I don't think I'm the one
> not making an effort here.
At the end, I accept your point of view and will apply the patchset.
> > And I still don't understand if you are willing to work on a test tool for ABI?
> >
> From this email
> http://dpdk.org/ml/archives/dev/2015-January/011306.html
>
> =======================================================
> > Yes, it should be another patchset.
> > Do you plan to work on it? It would be very convenient for developpers and
> > maintainers to test ABI compatibility.
> >
> Gladly, if we can get this in. I think its an important tool.
> =========================================================
>
> I'm not sure how thats unclear, but in the event that it wasn't, yes, I will
> gladly work on such a tool.
OK thanks, it would be helpful to have it in release 2.0.
> > > No doubt when all is said and done here you'll
> > > complain because this series likely won't work when you apply it for all the
> > > patches you take between the time I posted it and now. So lets be careful about
> > > complaining over wasted time.
> >
> > Note that I'm sure we can do some good work together. And I'd prefer more
> > pleasant discussions. Life is too short to have this kind of conflict.
> >
> I agree, and we've done so in the past. I'm sorry if I've upset you, it wasn't
> my intention. That said, can you see how I might be frustrated by this patch
> set taking 6 months to get reviewed, only to have commentary made on it that I
> could have handled back at the beginning of this whole mess?
Yes, I was hoping more people would participate in this discussion.
> Participation. Thats really whats needed here. Not just from you, not just
> from me, everyone, and not just on the items that we consider important to
> ourselves. Indifference leads to exclusion and frustration.
You're totally right. Participation is the key.
Sometimes, we have to *carefully* review patches whose we have no interest.
And maybe someone else will do the same thing for a patch we care.
This is a message ;)
--
Thomas
^ permalink raw reply [relevance 9%]
* [dpdk-dev] [PATCH v7 4/4] docs: Add ABI documentation
2015-01-21 20:59 3% ` [dpdk-dev] [PATCH v7 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2015-01-21 20:59 7% ` [dpdk-dev] [PATCH v7 3/4] Add library version extenstion Neil Horman
@ 2015-01-21 20:59 23% ` Neil Horman
2015-01-22 10:56 8% ` Iremonger, Bernard
1 sibling, 1 reply; 200+ results
From: Neil Horman @ 2015-01-21 20:59 UTC (permalink / raw)
To: dev
Adding a document describing rudimentary ABI policy and adding notice space for
any deprecation announcements
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
Change notes:
v5) Updated documentation to add notes from Thomas M.
v6) Moved abi.txt to guides/rel_notes/abi.rst
v7) Updated abi.rst to integrate with index file
Updated abi.rst to conform to rst formatting
Updated abi.rst to include example deprecation notices. Its not exactly the
language that Thomas indicated, but I think it makes the idea clear.
---
doc/guides/rel_notes/abi.rst | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 doc/guides/rel_notes/abi.rst
diff --git a/doc/guides/rel_notes/abi.rst b/doc/guides/rel_notes/abi.rst
new file mode 100644
index 0000000..9b72719
--- /dev/null
+++ b/doc/guides/rel_notes/abi.rst
@@ -0,0 +1,41 @@
+ABI policy
+==========
+ABI versions are set at the time of major release labeling, and ABI may change
+multiple times between the last labeling and the HEAD label of the git tree
+without warning.
+
+ABI versions, once released are available until such time as their
+deprecation has been noted here for at least one major release cycle, after it
+has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
+remove it is made during the development of DPDK 1.9. The decision will be
+recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
+1.10 ships.
+
+ABI versions may be deprecated in whole, or in part as needed by a given update.
+
+Some ABI changes may be too significant to reasonably maintain multiple
+versions of. In those events ABI's may be updated without backward
+compatibility provided. The requirements for doing so are:
+
+#. At least 3 acknoweldgements of the need on the dpdk.org
+#. A full deprecation cycle must be made to offer downstream consumers sufficient warning of the change. E.g. if dpdk 2.0 is under development when the change is proposed, a deprecation notice must be added to this file, and released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
+#. The LIBABIVER variable in the makefilei(s) where the ABI changes are incorporated must be incremented in parallel with the ABI changes themselves
+
+Note that the above process for ABI deprecation should not be undertaken
+lightly. ABI stability is extreemely important for downstream consumers of the
+DPDK, especially when distributed in shared object form. Every effort should be
+made to preserve ABI whenever possible. For instance, reorganizing public
+structure field for astetic or readability purposes should be avoided as it will
+cause ABI breakage. Only significant (e.g. performance) reasons should be seen
+as cause to alter ABI.
+
+Examples of Deprecation notices
+-------------------------------
+* The Macro #RTE_FOO is deprecated and will be removed with version 2.0, to be replaced with the inline function rte_bar()
+* The function rte_mbuf_grok has been updated to include new parameter in version 2.0. Backwards compatibility will be maintained for this function until the release of version 2.1
+* The members struct foo have been reorganized in release 2.0. Existing binary applications will have backwards compatibility in release 2.0, while newly built binaries will need to reference new structure variant struct foo2. Compatibility will be removed in release 2.2, and all applications will require updating a rebuilding to the new structure at that time, which will be renamed to the origional struct foo.
+* Significant ABI changes are planned for the librte_dostuff library. The upcomming release 2.0 will not contain these changes, but release 2.1 will, and no backwards compatibility is planned due to the invasive nature of these changes. Binaries using this library built prior to version 2.1 will require updating and recompilation.
+
+Deprecation Notices
+-------------------
+
--
2.1.0
^ permalink raw reply [relevance 23%]
* [dpdk-dev] [PATCH v7 3/4] Add library version extenstion
2015-01-21 20:59 3% ` [dpdk-dev] [PATCH v7 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2015-01-21 20:59 7% ` Neil Horman
2015-01-21 20:59 23% ` [dpdk-dev] [PATCH v7 4/4] docs: Add ABI documentation Neil Horman
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2015-01-21 20:59 UTC (permalink / raw)
To: dev
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken. This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
Change Notes:
v3)
Made symlinking of libraries conditional on a DSO build
v4) Removed erroneous newline
changed @exit 1 to @false
changed ./$(LIB) to $<
---
lib/librte_acl/Makefile | 2 ++
lib/librte_cfgfile/Makefile | 2 ++
lib/librte_cmdline/Makefile | 2 ++
lib/librte_compat/Makefile | 2 ++
lib/librte_distributor/Makefile | 2 ++
lib/librte_eal/bsdapp/eal/Makefile | 2 ++
lib/librte_eal/linuxapp/eal/Makefile | 2 ++
lib/librte_ether/Makefile | 2 ++
lib/librte_hash/Makefile | 2 ++
lib/librte_ip_frag/Makefile | 2 ++
lib/librte_ivshmem/Makefile | 2 ++
lib/librte_kni/Makefile | 2 ++
lib/librte_kvargs/Makefile | 2 ++
lib/librte_lpm/Makefile | 2 ++
lib/librte_malloc/Makefile | 2 ++
lib/librte_mbuf/Makefile | 2 ++
lib/librte_mempool/Makefile | 2 ++
lib/librte_meter/Makefile | 2 ++
lib/librte_pipeline/Makefile | 2 ++
lib/librte_pmd_af_packet/Makefile | 2 ++
lib/librte_pmd_bond/Makefile | 2 ++
lib/librte_pmd_e1000/Makefile | 2 ++
lib/librte_pmd_enic/Makefile | 2 ++
lib/librte_pmd_i40e/Makefile | 2 ++
lib/librte_pmd_ixgbe/Makefile | 2 ++
lib/librte_pmd_pcap/Makefile | 2 ++
lib/librte_pmd_ring/Makefile | 2 ++
lib/librte_pmd_virtio/Makefile | 2 ++
lib/librte_pmd_vmxnet3/Makefile | 2 ++
lib/librte_pmd_xenvirt/Makefile | 2 ++
lib/librte_port/Makefile | 2 ++
lib/librte_power/Makefile | 2 ++
lib/librte_ring/Makefile | 2 ++
lib/librte_sched/Makefile | 2 ++
lib/librte_table/Makefile | 2 ++
lib/librte_timer/Makefile | 2 ++
lib/librte_vhost/Makefile | 2 ++
mk/rte.lib.mk | 12 ++++++++++--
38 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 45cbf80..765deb1 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_acl_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index a4f73de..032c240 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_cfgfile_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 3c71831..719dff6 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_cmdline_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
index 0bab870..0c57533 100644
--- a/lib/librte_compat/Makefile
+++ b/lib/librte_compat/Makefile
@@ -32,6 +32,8 @@
include $(RTE_SDK)/mk/rte.vars.mk
+LIBABIVER := 1
+
# install includes
SYMLINK-y-include := rte_compat.h
diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
index 3674a2c..4c9af17 100644
--- a/lib/librte_distributor/Makefile
+++ b/lib/librte_distributor/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_distributor_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index 0b5f9d9..ae214a4 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -48,6 +48,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
# specific to linuxapp exec-env
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index bae8af1..e117cec 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -35,6 +35,8 @@ LIB = librte_eal.a
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
VPATH += $(RTE_SDK)/lib/librte_eal/common
CFLAGS += -I$(SRCDIR)/include
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 80ad78d..c0e5768 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_ether_version.map
+LIBABIVER := 1
+
SRCS-y += rte_ethdev.c
#
diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
index bec61ab..3696cb1 100644
--- a/lib/librte_hash/Makefile
+++ b/lib/librte_hash/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_hash_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index aa88578..fe926f7 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_ipfrag_version.map
+LIBABIVER := 1
+
#source files
ifeq ($(CONFIG_RTE_MBUF_REFCNT),y)
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
index 068ee10..16defdb 100644
--- a/lib/librte_ivshmem/Makefile
+++ b/lib/librte_ivshmem/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ivshmem_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index 93a516d..7107832 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_kni_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
index b1c34f3..87b09f2 100644
--- a/lib/librte_kvargs/Makefile
+++ b/lib/librte_kvargs/Makefile
@@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_kvargs_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
index 8214630..35e6389 100644
--- a/lib/librte_lpm/Makefile
+++ b/lib/librte_lpm/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_lpm_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
index 15b7eed..947e41c 100644
--- a/lib/librte_malloc/Makefile
+++ b/lib/librte_malloc/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_malloc.a
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_malloc_version.map
diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
index 03becae..080f3cf 100644
--- a/lib/librte_mbuf/Makefile
+++ b/lib/librte_mbuf/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mbuf_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
index 31d1a71..940d1f7 100644
--- a/lib/librte_mempool/Makefile
+++ b/lib/librte_mempool/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mempool_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index c4a7a32..8765881 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_meter_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 15b58df..15e406b 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pipeline_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_af_packet/Makefile b/lib/librte_pmd_af_packet/Makefile
index 85a7860..f0bf537 100644
--- a/lib/librte_pmd_af_packet/Makefile
+++ b/lib/librte_pmd_af_packet/Makefile
@@ -40,6 +40,8 @@ LIB = librte_pmd_af_packet.a
EXPORT_MAP := rte_pmd_af_packet_version.map
+LIBABIVER := 1
+
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 074110a..d6c81a8 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_bond_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
index cd14444..8c8fed8 100644
--- a/lib/librte_pmd_e1000/Makefile
+++ b/lib/librte_pmd_e1000/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_e1000_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile
index 697231c..251a898 100644
--- a/lib/librte_pmd_enic/Makefile
+++ b/lib/librte_pmd_enic/Makefile
@@ -39,6 +39,8 @@ LIB = librte_pmd_enic.a
EXPORT_MAP := rte_pmd_enic_version.map
+LIBABIVER := 1
+
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/
CFLAGS += -O3
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index 73de373..9a0eec8 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_i40e_version.map
+LIBABIVER := 1
+
#
# Add extra flags for base driver files (also known as shared code)
# to disable warnings
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index e0a17f6..d580f62 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_ixgbe_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
index cb6678e..0775dbc 100644
--- a/lib/librte_pmd_pcap/Makefile
+++ b/lib/librte_pmd_pcap/Makefile
@@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_pcap_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
index aa1b461..e442d0b 100644
--- a/lib/librte_pmd_ring/Makefile
+++ b/lib/librte_pmd_ring/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_ring_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
index d979c59..793067f 100644
--- a/lib/librte_pmd_virtio/Makefile
+++ b/lib/librte_pmd_virtio/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_virtio_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index f3ab178..93e5580 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
EXPORT_MAP := rte_pmd_vmxnet3_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
index 4510603..f0c796c 100644
--- a/lib/librte_pmd_xenvirt/Makefile
+++ b/lib/librte_pmd_xenvirt/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_xenvirt_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 266ed39..0e38452 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_port_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index 0547dcd..cee95cd 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_power_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c rte_power_acpi_cpufreq.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c
diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
index b437dc5..84ad3d3 100644
--- a/lib/librte_ring/Makefile
+++ b/lib/librte_ring/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ring_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 48f280a..b1cb285 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
EXPORT_MAP := rte_sched_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
index 4e1a54a..0d8394c 100644
--- a/lib/librte_table/Makefile
+++ b/lib/librte_table/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_table_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
index 9fb6079..2aabef8 100644
--- a/lib/librte_timer/Makefile
+++ b/lib/librte_timer/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_timer_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 96a7dd0..369c25a 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -36,6 +36,8 @@ LIB = librte_vhost.a
EXPORT_MAP := rte_vhost_version.map
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse
LDFLAGS += -lfuse
# all source are stored in SRCS-y
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 1d3b646..865a307 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -37,10 +37,9 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
-
ifeq ($(RTE_BUILD_SHARED_LIB),y)
-LIB := $(patsubst %.a,%.so,$(LIB))
+LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
endif
@@ -113,6 +112,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
#
ifeq ($(RTE_BUILD_SHARED_LIB),y)
$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
+ifeq ($(LIBABIVER),)
+ @echo "Must Specify a $(LIB) ABI version"
+ @false
+endif
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(if $(D),\
@echo -n "$< -> $@ " ; \
@@ -126,6 +129,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
$(depfile_missing),\
$(depfile_newer)),\
$(O_TO_S_DO))
+
ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
$(if $(or \
$(file_missing),\
@@ -163,9 +167,13 @@ endif
# install lib in $(RTE_OUTPUT)/lib
#
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
+ $(eval LIBSONAME := $(basename $(LIB)))
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+ifeq ($(RTE_BUILD_SHARED_LIB),y)
+ $(Q)ln -s -f $< $(RTE_OUTPUT)/lib/$(LIBSONAME)
+endif
#
# Clean all generated files
--
2.1.0
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH v7 1/4] compat: Add infrastructure to support symbol versioning
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (8 preceding siblings ...)
2015-01-20 21:17 3% ` [dpdk-dev] [PATCH v6 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2015-01-21 20:59 3% ` Neil Horman
2015-01-21 20:59 7% ` [dpdk-dev] [PATCH v7 3/4] Add library version extenstion Neil Horman
2015-01-21 20:59 23% ` [dpdk-dev] [PATCH v7 4/4] docs: Add ABI documentation Neil Horman
2015-01-22 15:49 3% ` [dpdk-dev] [PATCH v8 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
` (2 subsequent siblings)
12 siblings, 2 replies; 200+ results
From: Neil Horman @ 2015-01-21 20:59 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
---
Change Notes:
V2)
Moved ifeq to _INSTALL target
V3)
Undo V2 changes and make librte_compat use the rte.install.mk file
instead
v4)
changed --version-script to accept SRCDIR in this patch at per request
documented versioning macros
cleaned up macro parameter consistency
converted SA macro to RTE_STR macro
fixed copyright
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++
lib/librte_compat/rte_compat.h | 117 +++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 4 ++
4 files changed, 160 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 0ffc982..d617d81 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,6 +31,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..0bab870
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2013 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.install.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..d7cc176
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,117 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+#include <rte_common.h>
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. To support that, the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ * char foo(int value, int otherval) { ...}
+ *
+ * 5) Mark the newest version as the default version
+ * BIND_DEFAULT_SYMBOL(foo, 1.9);
+ *
+ */
+
+/*
+ * Macro Parameters:
+ * b - function base name
+ * e - function version extension, to be concatenated with base name
+ * n - function symbol version string to be applied
+ */
+
+/*
+ * VERSION_SYMBOL
+ * Creates a symbol version table entry binding symbol <b>@DPDK_<n> to the internal
+ * function name <b>_<e>
+ */
+#define VERSION_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@DPDK_"RTE_STR(n))
+
+/*
+ * BASE_SYMBOL
+ * Creates a symbol version table entry binding unversioned symbol <b>
+ * to the internal function <b>_<e>
+ */
+#define BASE_SYMBOL(b, e) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@")
+
+/*
+ * BNID_DEFAULT_SYMBOL
+ * Creates a symbol version entry instructing the linker to bind references to
+ * symbol <b> to the internal symbol <b>_<e>
+ */
+#define BIND_DEFAULT_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@@DPDK_"RTE_STR(n))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+#define BASE_SYMBOL(b, n)
+#define BIND_DEFAULT_SYMBOL(b, v)
+
+/*
+ * RTE_BUILD_SHARED_LIB=n
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 81bf8e1..1d3b646 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
--
2.1.0
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation
2015-01-21 16:05 8% ` Thomas Monjalon
@ 2015-01-21 19:43 4% ` Neil Horman
2015-01-21 22:24 9% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-01-21 19:43 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Wed, Jan 21, 2015 at 05:05:51PM +0100, Thomas Monjalon wrote:
> 2015-01-21 09:59, Neil Horman:
> > On Wed, Jan 21, 2015 at 11:25:48AM +0100, Thomas Monjalon wrote:
> > > 2015-01-20 16:17, Neil Horman:
> > > > Adding a document describing rudimentary ABI policy and adding notice space for
> > > > any deprecation announcements
> > > >
> > > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > >
> > > > ---
> > > > Change notes:
> > > >
> > > > v5) Updated documentation to add notes from Thomas M.
> > > >
> > > > v6) Moved abi.txt to guides/rel_notes/abi.rst
> > >
> > > You didn't integrate this file in the index.
> > >
> > Shiobahn indicated that its just a plain text file, so I left it as a plain text
> > file. I guess we have different definitions of plain text files.
> >
> > > [...]
> > >
> > > > --- /dev/null
> > > > +++ b/doc/guides/rel_notes/abi.rst
> > > > @@ -0,0 +1,38 @@
> > > > +ABI policy
> > > > +==========
> > > > + ABI versions are set at the time of major release labeling, and ABI may
> > > > +change multiple times between the last labeling and the HEAD label of the git
> > > > +tree without warning
> > > > +
> > > > + ABI versions, once released are available until such time as their
> > > > +deprecation has been noted here for at least one major release cycle, after it
> > > > +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> > > > +remove it is made during the development of DPDK 1.9. The decision will be
> > > > +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> > > > +1.10 ships.
> > >
> > > As previously said, speaking about 2.0/2.1 would be more coherent.
> > >
> > As previously mentioned, I really don't see this as relevant, as it will be out
> > of date within a release, and I think we can agree, no one is going to update
> > this paragraph every release.
> >
> > > > +
> > > > + ABI versions may be deprecated in whole, or in part as needed by a given
> > > > +update.
> > > > +
> > > > + Some ABI changes may be too significant to reasonably maintain multiple
> > > > +versions of. In those events ABI's may be updated without backward
> > > > +compatibility provided. The requirements for doing so are:
> > > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > > + 2) A full deprecation cycle must be made to offer downstream consumers
> > > > +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> > > > +the change is proposed, a deprecation notice must be added to this file, and
> > > > +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> > > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> > > > +incorporated must be incremented in parallel with the ABI changes themselves
> > > > +
> > > > + Note that the above process for ABI deprecation should not be undertaken
> > > > +lightly. ABI stability is extreemely important for downstream consumers of the
> > > > +DPDK, especially when distributed in shared object form. Every effort should be
> > > > +made to preserve ABI whenever possible. For instance, reorganizing public
> > > > +structure field for astetic or readability purposes should be avoided as it will
> > > > +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> > > > +as cause to alter ABI.
> > >
> > > When applying the patch, there are these (minor) warnings:
> > >
> > > /home/thomas/projects/dpdk/dpdk/.git/rebase-apply/patch:52: trailing whitespace.
> > > /home/thomas/projects/dpdk/dpdk/.git/rebase-apply/patch:55: new blank line at EOF.
> > >
> > > When building the documentation, there are these errors:
> > > make doc-guides-html
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:4: WARNING: Block quote ends without a blank line; unexpected unindent.
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:8: WARNING: Block quote ends without a blank line; unexpected unindent.
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:15: WARNING: Block quote ends without a blank line; unexpected unindent.
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:18: WARNING: Block quote ends without a blank line; unexpected unindent.
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:20: ERROR: Unexpected indentation.
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:22: WARNING: Block quote ends without a blank line; unexpected unindent.
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:25: ERROR: Unexpected indentation.
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:26: WARNING: Block quote ends without a blank line; unexpected unindent.
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:29: WARNING: Block quote ends without a blank line; unexpected unindent.
> > > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:: WARNING: document isn't included in any toctree
> > >
> > > Please check it.
> > >
> > Again, I guess we have separate definitions of what a plain text file is, but
> > I'll look into it.
> >
> >
> > > Other comment, what about the additions I suggested about macros and structure renaming?
> > >
> > Considered and answered already. I'm in favor of listing macros and structure
> > changes in the abi document, but I think an exhaustive list isn't needed. If it
> > is, we could spend pages diving into minute. Better to point out the need for
> > abi noticies as patches get posted.
>
> I'm afraid you don't understand what I'm saying. Copy/paste:
> "No, I was suggesting to explain in this doc that macro removal must be
> announced with a deprecation notice,
> and that in case structure must be reworked, the name must change if we
> want to preserve ABI compatibility with old structure."
> Rewording: if you agree with this policy, please add it in this document.
>
Yes, we're on the same page regarding what your asking, I just don't agree that
it needs to be explicitly called out. I thought I was clear on that.
Appaerntly not however, so if it will settle the point, I'll just add it.
> > > Neil, we expect that you consider comments done previously and that you test your patch.
> > > Otherwise, we are losing time in useless reviews.
> > >
> > Thomas, I have considered your comments, I simply don't agree with all of them,
> > and I made that clear.
> >
> > As for losing time, you let the first attempt at this
> > patch rot on the list in 1.7 and have done the same thing for the 1.8 cycle
> > until I yelled for reviews.
>
> Now, I'm really upset of your wrong assumptions.
> You sent your first proposal on september, during 1.8 cycle, not 1.7 !
> And during this cycle, the decision was to postpone it for 2.0 release.
>
you're missing the point. I apologize for not getting the release numbers right,
it should be 1.8 to 2.0 not 1.7 to 1.8 as you note, but that doesn't really
matter. The point was 6 months. 6 months this has been sitting around. In
that time up to this point I've gotten one review from another devloper on the
set, and you indicating that its not ready yet. Then, the day 1.8 released, I
reposed the patch series as we agreed, and its taken almost 5 weeks before I've
gotten any feedback on it, and then its feedback that could have been given 6
months ago (you'll note this patch was initially identical to the version I
posted back in september). I think you can understand how I find that
frustrating.
> I don't understand what's wrong with you.
The above is whats wrong with me. The fact that I can try and try and try to
add value to this project so that I can expand its user base, and the best I've
thus far been able to receive is indifference. At worst, the indifference is
followed by being told that the indifference is tantamount to rejection.
> You don't make any effort to understand what we are saying and
> you make no effort to understand what is this doc directory.
> You prefer crying that your patch is not applied.
No effort? How many emails have I written contesting your opinions, presenting
supporting evidence, only to be met with assertions? I don't think I'm the one
not making an effort here.
> And I still don't understand if you are willing to work on a test tool for ABI?
>
>From this email
http://dpdk.org/ml/archives/dev/2015-January/011306.html
=======================================================
> Yes, it should be another patchset.
> Do you plan to work on it? It would be very convenient for developpers and
> maintainers to test ABI compatibility.
>
Gladly, if we can get this in. I think its an important tool.
=========================================================
I'm not sure how thats unclear, but in the event that it wasn't, yes, I will
gladly work on such a tool.
> > No doubt when all is said and done here you'll
> > complain because this series likely won't work when you apply it for all the
> > patches you take between the time I posted it and now. So lets be careful about
> > complaining over wasted time.
>
> Note that I'm sure we can do some good work together. And I'd prefer more
> pleasant discussions. Life is too short to have this kind of conflict.
>
I agree, and we've done so in the past. I'm sorry if I've upset you, it wasn't
my intention. That said, can you see how I might be frustrated by this patch
set taking 6 months to get reviewed, only to have commentary made on it that I
could have handled back at the beginning of this whole mess?
Participation. Thats really whats needed here. Not just from you, not just
from me, everyone, and not just on the items that we consider important to
ourselves. Indifference leads to exclusion and frustration.
I'll have another version of this ready soon.
Neil
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation
2015-01-21 14:59 8% ` Neil Horman
@ 2015-01-21 16:05 8% ` Thomas Monjalon
2015-01-21 19:43 4% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2015-01-21 16:05 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2015-01-21 09:59, Neil Horman:
> On Wed, Jan 21, 2015 at 11:25:48AM +0100, Thomas Monjalon wrote:
> > 2015-01-20 16:17, Neil Horman:
> > > Adding a document describing rudimentary ABI policy and adding notice space for
> > > any deprecation announcements
> > >
> > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > >
> > > ---
> > > Change notes:
> > >
> > > v5) Updated documentation to add notes from Thomas M.
> > >
> > > v6) Moved abi.txt to guides/rel_notes/abi.rst
> >
> > You didn't integrate this file in the index.
> >
> Shiobahn indicated that its just a plain text file, so I left it as a plain text
> file. I guess we have different definitions of plain text files.
>
> > [...]
> >
> > > --- /dev/null
> > > +++ b/doc/guides/rel_notes/abi.rst
> > > @@ -0,0 +1,38 @@
> > > +ABI policy
> > > +==========
> > > + ABI versions are set at the time of major release labeling, and ABI may
> > > +change multiple times between the last labeling and the HEAD label of the git
> > > +tree without warning
> > > +
> > > + ABI versions, once released are available until such time as their
> > > +deprecation has been noted here for at least one major release cycle, after it
> > > +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> > > +remove it is made during the development of DPDK 1.9. The decision will be
> > > +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> > > +1.10 ships.
> >
> > As previously said, speaking about 2.0/2.1 would be more coherent.
> >
> As previously mentioned, I really don't see this as relevant, as it will be out
> of date within a release, and I think we can agree, no one is going to update
> this paragraph every release.
>
> > > +
> > > + ABI versions may be deprecated in whole, or in part as needed by a given
> > > +update.
> > > +
> > > + Some ABI changes may be too significant to reasonably maintain multiple
> > > +versions of. In those events ABI's may be updated without backward
> > > +compatibility provided. The requirements for doing so are:
> > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > + 2) A full deprecation cycle must be made to offer downstream consumers
> > > +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> > > +the change is proposed, a deprecation notice must be added to this file, and
> > > +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> > > +incorporated must be incremented in parallel with the ABI changes themselves
> > > +
> > > + Note that the above process for ABI deprecation should not be undertaken
> > > +lightly. ABI stability is extreemely important for downstream consumers of the
> > > +DPDK, especially when distributed in shared object form. Every effort should be
> > > +made to preserve ABI whenever possible. For instance, reorganizing public
> > > +structure field for astetic or readability purposes should be avoided as it will
> > > +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> > > +as cause to alter ABI.
> >
> > When applying the patch, there are these (minor) warnings:
> >
> > /home/thomas/projects/dpdk/dpdk/.git/rebase-apply/patch:52: trailing whitespace.
> > /home/thomas/projects/dpdk/dpdk/.git/rebase-apply/patch:55: new blank line at EOF.
> >
> > When building the documentation, there are these errors:
> > make doc-guides-html
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:4: WARNING: Block quote ends without a blank line; unexpected unindent.
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:8: WARNING: Block quote ends without a blank line; unexpected unindent.
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:15: WARNING: Block quote ends without a blank line; unexpected unindent.
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:18: WARNING: Block quote ends without a blank line; unexpected unindent.
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:20: ERROR: Unexpected indentation.
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:22: WARNING: Block quote ends without a blank line; unexpected unindent.
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:25: ERROR: Unexpected indentation.
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:26: WARNING: Block quote ends without a blank line; unexpected unindent.
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:29: WARNING: Block quote ends without a blank line; unexpected unindent.
> > /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:: WARNING: document isn't included in any toctree
> >
> > Please check it.
> >
> Again, I guess we have separate definitions of what a plain text file is, but
> I'll look into it.
>
>
> > Other comment, what about the additions I suggested about macros and structure renaming?
> >
> Considered and answered already. I'm in favor of listing macros and structure
> changes in the abi document, but I think an exhaustive list isn't needed. If it
> is, we could spend pages diving into minute. Better to point out the need for
> abi noticies as patches get posted.
I'm afraid you don't understand what I'm saying. Copy/paste:
"No, I was suggesting to explain in this doc that macro removal must be
announced with a deprecation notice,
and that in case structure must be reworked, the name must change if we
want to preserve ABI compatibility with old structure."
Rewording: if you agree with this policy, please add it in this document.
> > Neil, we expect that you consider comments done previously and that you test your patch.
> > Otherwise, we are losing time in useless reviews.
> >
> Thomas, I have considered your comments, I simply don't agree with all of them,
> and I made that clear.
>
> As for losing time, you let the first attempt at this
> patch rot on the list in 1.7 and have done the same thing for the 1.8 cycle
> until I yelled for reviews.
Now, I'm really upset of your wrong assumptions.
You sent your first proposal on september, during 1.8 cycle, not 1.7 !
And during this cycle, the decision was to postpone it for 2.0 release.
I don't understand what's wrong with you.
You don't make any effort to understand what we are saying and
you make no effort to understand what is this doc directory.
You prefer crying that your patch is not applied.
And I still don't understand if you are willing to work on a test tool for ABI?
> No doubt when all is said and done here you'll
> complain because this series likely won't work when you apply it for all the
> patches you take between the time I posted it and now. So lets be careful about
> complaining over wasted time.
Note that I'm sure we can do some good work together. And I'd prefer more
pleasant discussions. Life is too short to have this kind of conflict.
--
Thomas
^ permalink raw reply [relevance 8%]
* Re: [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation
2015-01-21 10:25 10% ` Thomas Monjalon
@ 2015-01-21 14:59 8% ` Neil Horman
2015-01-21 16:05 8% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-01-21 14:59 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Wed, Jan 21, 2015 at 11:25:48AM +0100, Thomas Monjalon wrote:
> 2015-01-20 16:17, Neil Horman:
> > Adding a document describing rudimentary ABI policy and adding notice space for
> > any deprecation announcements
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> >
> > ---
> > Change notes:
> >
> > v5) Updated documentation to add notes from Thomas M.
> >
> > v6) Moved abi.txt to guides/rel_notes/abi.rst
>
> You didn't integrate this file in the index.
>
Shiobahn indicated that its just a plain text file, so I left it as a plain text
file. I guess we have different definitions of plain text files.
> [...]
>
> > --- /dev/null
> > +++ b/doc/guides/rel_notes/abi.rst
> > @@ -0,0 +1,38 @@
> > +ABI policy
> > +==========
> > + ABI versions are set at the time of major release labeling, and ABI may
> > +change multiple times between the last labeling and the HEAD label of the git
> > +tree without warning
> > +
> > + ABI versions, once released are available until such time as their
> > +deprecation has been noted here for at least one major release cycle, after it
> > +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> > +remove it is made during the development of DPDK 1.9. The decision will be
> > +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> > +1.10 ships.
>
> As previously said, speaking about 2.0/2.1 would be more coherent.
>
As previously mentioned, I really don't see this as relevant, as it will be out
of date within a release, and I think we can agree, no one is going to update
this paragraph every release.
> > +
> > + ABI versions may be deprecated in whole, or in part as needed by a given
> > +update.
> > +
> > + Some ABI changes may be too significant to reasonably maintain multiple
> > +versions of. In those events ABI's may be updated without backward
> > +compatibility provided. The requirements for doing so are:
> > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > + 2) A full deprecation cycle must be made to offer downstream consumers
> > +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> > +the change is proposed, a deprecation notice must be added to this file, and
> > +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> > +incorporated must be incremented in parallel with the ABI changes themselves
> > +
> > + Note that the above process for ABI deprecation should not be undertaken
> > +lightly. ABI stability is extreemely important for downstream consumers of the
> > +DPDK, especially when distributed in shared object form. Every effort should be
> > +made to preserve ABI whenever possible. For instance, reorganizing public
> > +structure field for astetic or readability purposes should be avoided as it will
> > +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> > +as cause to alter ABI.
>
> When applying the patch, there are these (minor) warnings:
>
> /home/thomas/projects/dpdk/dpdk/.git/rebase-apply/patch:52: trailing whitespace.
> /home/thomas/projects/dpdk/dpdk/.git/rebase-apply/patch:55: new blank line at EOF.
>
> When building the documentation, there are these errors:
> make doc-guides-html
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:4: WARNING: Block quote ends without a blank line; unexpected unindent.
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:8: WARNING: Block quote ends without a blank line; unexpected unindent.
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:15: WARNING: Block quote ends without a blank line; unexpected unindent.
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:18: WARNING: Block quote ends without a blank line; unexpected unindent.
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:20: ERROR: Unexpected indentation.
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:22: WARNING: Block quote ends without a blank line; unexpected unindent.
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:25: ERROR: Unexpected indentation.
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:26: WARNING: Block quote ends without a blank line; unexpected unindent.
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:29: WARNING: Block quote ends without a blank line; unexpected unindent.
> /home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:: WARNING: document isn't included in any toctree
>
> Please check it.
>
Again, I guess we have separate definitions of what a plain text file is, but
I'll look into it.
> Other comment, what about the additions I suggested about macros and structure renaming?
>
Considered and answered already. I'm in favor of listing macros and structure
changes in the abi document, but I think an exhaustive list isn't needed. If it
is, we could spend pages diving into minute. Better to point out the need for
abi noticies as patches get posted.
> Neil, we expect that you consider comments done previously and that you test your patch.
> Otherwise, we are losing time in useless reviews.
>
Thomas, I have considered your comments, I simply don't agree with all of them,
and I made that clear.
As for losing time, you let the first attempt at this
patch rot on the list in 1.7 and have done the same thing for the 1.8 cycle
until I yelled for reviews. No doubt when all is said and done here you'll
complain because this series likely won't work when you apply it for all the
patches you take between the time I posted it and now. So lets be careful about
complaining over wasted time.
Neil
> --
> Thomas
>
^ permalink raw reply [relevance 8%]
* Re: [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation
2015-01-20 21:17 24% ` [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation Neil Horman
2015-01-21 10:13 8% ` Iremonger, Bernard
@ 2015-01-21 10:25 10% ` Thomas Monjalon
2015-01-21 14:59 8% ` Neil Horman
1 sibling, 1 reply; 200+ results
From: Thomas Monjalon @ 2015-01-21 10:25 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2015-01-20 16:17, Neil Horman:
> Adding a document describing rudimentary ABI policy and adding notice space for
> any deprecation announcements
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
>
> ---
> Change notes:
>
> v5) Updated documentation to add notes from Thomas M.
>
> v6) Moved abi.txt to guides/rel_notes/abi.rst
You didn't integrate this file in the index.
[...]
> --- /dev/null
> +++ b/doc/guides/rel_notes/abi.rst
> @@ -0,0 +1,38 @@
> +ABI policy
> +==========
> + ABI versions are set at the time of major release labeling, and ABI may
> +change multiple times between the last labeling and the HEAD label of the git
> +tree without warning
> +
> + ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle, after it
> +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> +remove it is made during the development of DPDK 1.9. The decision will be
> +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> +1.10 ships.
As previously said, speaking about 2.0/2.1 would be more coherent.
> +
> + ABI versions may be deprecated in whole, or in part as needed by a given
> +update.
> +
> + Some ABI changes may be too significant to reasonably maintain multiple
> +versions of. In those events ABI's may be updated without backward
> +compatibility provided. The requirements for doing so are:
> + 1) At least 3 acknoweldgements of the need on the dpdk.org
> + 2) A full deprecation cycle must be made to offer downstream consumers
> +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> +the change is proposed, a deprecation notice must be added to this file, and
> +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> +incorporated must be incremented in parallel with the ABI changes themselves
> +
> + Note that the above process for ABI deprecation should not be undertaken
> +lightly. ABI stability is extreemely important for downstream consumers of the
> +DPDK, especially when distributed in shared object form. Every effort should be
> +made to preserve ABI whenever possible. For instance, reorganizing public
> +structure field for astetic or readability purposes should be avoided as it will
> +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> +as cause to alter ABI.
When applying the patch, there are these (minor) warnings:
/home/thomas/projects/dpdk/dpdk/.git/rebase-apply/patch:52: trailing whitespace.
/home/thomas/projects/dpdk/dpdk/.git/rebase-apply/patch:55: new blank line at EOF.
When building the documentation, there are these errors:
make doc-guides-html
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:4: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:8: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:15: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:18: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:20: ERROR: Unexpected indentation.
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:22: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:25: ERROR: Unexpected indentation.
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:26: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:29: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/thomas/projects/dpdk/dpdk/doc/guides/rel_notes/abi.rst:: WARNING: document isn't included in any toctree
Please check it.
Other comment, what about the additions I suggested about macros and structure renaming?
Neil, we expect that you consider comments done previously and that you test your patch.
Otherwise, we are losing time in useless reviews.
--
Thomas
^ permalink raw reply [relevance 10%]
* Re: [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation
2015-01-20 21:17 24% ` [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation Neil Horman
@ 2015-01-21 10:13 8% ` Iremonger, Bernard
2015-01-21 10:25 10% ` Thomas Monjalon
1 sibling, 0 replies; 200+ results
From: Iremonger, Bernard @ 2015-01-21 10:13 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Tuesday, January 20, 2015 9:18 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation
>
> Adding a document describing rudimentary ABI policy and adding notice space for any deprecation
> announcements
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
>
> ---
> Change notes:
>
> v5) Updated documentation to add notes from Thomas M.
>
> v6) Moved abi.txt to guides/rel_notes/abi.rst
> ---
> doc/guides/rel_notes/abi.rst | 38 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 38 insertions(+)
> create mode 100644 doc/guides/rel_notes/abi.rst
Hi Neil,
The file doc/guides/rel_notes/index.rst should be modified to include "abi" so that the abi.rst file is included in the release notes.
>
> diff --git a/doc/guides/rel_notes/abi.rst b/doc/guides/rel_notes/abi.rst new file mode 100644 index
> 0000000..98ac19d
> --- /dev/null
> +++ b/doc/guides/rel_notes/abi.rst
> @@ -0,0 +1,38 @@
> +ABI policy
> +==========
> + ABI versions are set at the time of major release labeling, and ABI
> +may change multiple times between the last labeling and the HEAD label
> +of the git tree without warning
> +
> + ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle,
> +after it has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and
> +then the decision to remove it is made during the development of DPDK
> +1.9. The decision will be recorded here, shipped with the DPDK 1.9
> +release, and actually removed when DPDK
> +1.10 ships.
> +
> + ABI versions may be deprecated in whole, or in part as needed by a
> +given update.
> +
> + Some ABI changes may be too significant to reasonably maintain
> +multiple versions of. In those events ABI's may be updated without
> +backward compatibility provided. The requirements for doing so are:
The #. Syntax could be used for numbered lists
> + 1) At least 3 acknoweldgements of the need on the dpdk.org
A blank line is needed otherwise the text will concatenate.
> + 2) A full deprecation cycle must be made to offer downstream consumers
> +sufficient warning of the change. E.g. if dpdk 2.0 is under
> +development when the change is proposed, a deprecation notice must be
> +added to this file, and released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
A blank line is needed otherwise the text will concatenate.
> + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes
> +are incorporated must be incremented in parallel with the ABI changes
> +themselves
A blank line is needed otherwise the text will concatenate.
> +
> + Note that the above process for ABI deprecation should not be
> +undertaken lightly. ABI stability is extreemely important for
> +downstream consumers of the DPDK, especially when distributed in shared
> +object form. Every effort should be made to preserve ABI whenever
> +possible. For instance, reorganizing public structure field for
> +astetic or readability purposes should be avoided as it will cause ABI
> +breakage. Only significant (e.g. performance) reasons should be seen as cause to alter ABI.
> +
> +Deprecation Notices
> +===================
> +
> --
> 2.1.0
Regards,
Bernard.
^ permalink raw reply [relevance 8%]
* [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation
2015-01-20 21:17 3% ` [dpdk-dev] [PATCH v6 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2015-01-20 21:17 7% ` [dpdk-dev] [PATCH v6 3/4] Add library version extenstion Neil Horman
@ 2015-01-20 21:17 24% ` Neil Horman
2015-01-21 10:13 8% ` Iremonger, Bernard
2015-01-21 10:25 10% ` Thomas Monjalon
1 sibling, 2 replies; 200+ results
From: Neil Horman @ 2015-01-20 21:17 UTC (permalink / raw)
To: dev
Adding a document describing rudimentary ABI policy and adding notice space for
any deprecation announcements
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
Change notes:
v5) Updated documentation to add notes from Thomas M.
v6) Moved abi.txt to guides/rel_notes/abi.rst
---
doc/guides/rel_notes/abi.rst | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 doc/guides/rel_notes/abi.rst
diff --git a/doc/guides/rel_notes/abi.rst b/doc/guides/rel_notes/abi.rst
new file mode 100644
index 0000000..98ac19d
--- /dev/null
+++ b/doc/guides/rel_notes/abi.rst
@@ -0,0 +1,38 @@
+ABI policy
+==========
+ ABI versions are set at the time of major release labeling, and ABI may
+change multiple times between the last labeling and the HEAD label of the git
+tree without warning
+
+ ABI versions, once released are available until such time as their
+deprecation has been noted here for at least one major release cycle, after it
+has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
+remove it is made during the development of DPDK 1.9. The decision will be
+recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
+1.10 ships.
+
+ ABI versions may be deprecated in whole, or in part as needed by a given
+update.
+
+ Some ABI changes may be too significant to reasonably maintain multiple
+versions of. In those events ABI's may be updated without backward
+compatibility provided. The requirements for doing so are:
+ 1) At least 3 acknoweldgements of the need on the dpdk.org
+ 2) A full deprecation cycle must be made to offer downstream consumers
+sufficient warning of the change. E.g. if dpdk 2.0 is under development when
+the change is proposed, a deprecation notice must be added to this file, and
+released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
+ 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
+incorporated must be incremented in parallel with the ABI changes themselves
+
+ Note that the above process for ABI deprecation should not be undertaken
+lightly. ABI stability is extreemely important for downstream consumers of the
+DPDK, especially when distributed in shared object form. Every effort should be
+made to preserve ABI whenever possible. For instance, reorganizing public
+structure field for astetic or readability purposes should be avoided as it will
+cause ABI breakage. Only significant (e.g. performance) reasons should be seen
+as cause to alter ABI.
+
+Deprecation Notices
+===================
+
--
2.1.0
^ permalink raw reply [relevance 24%]
* [dpdk-dev] [PATCH v6 3/4] Add library version extenstion
2015-01-20 21:17 3% ` [dpdk-dev] [PATCH v6 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2015-01-20 21:17 7% ` Neil Horman
2015-01-20 21:17 24% ` [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation Neil Horman
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2015-01-20 21:17 UTC (permalink / raw)
To: dev
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken. This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
Change Notes:
v3)
Made symlinking of libraries conditional on a DSO build
v4) Removed erroneous newline
changed @exit 1 to @false
changed ./$(LIB) to $<
---
lib/librte_acl/Makefile | 2 ++
lib/librte_cfgfile/Makefile | 2 ++
lib/librte_cmdline/Makefile | 2 ++
lib/librte_compat/Makefile | 2 ++
lib/librte_distributor/Makefile | 2 ++
lib/librte_eal/bsdapp/eal/Makefile | 2 ++
lib/librte_eal/linuxapp/eal/Makefile | 2 ++
lib/librte_ether/Makefile | 2 ++
lib/librte_hash/Makefile | 2 ++
lib/librte_ip_frag/Makefile | 2 ++
lib/librte_ivshmem/Makefile | 2 ++
lib/librte_kni/Makefile | 2 ++
lib/librte_kvargs/Makefile | 2 ++
lib/librte_lpm/Makefile | 2 ++
lib/librte_malloc/Makefile | 2 ++
lib/librte_mbuf/Makefile | 2 ++
lib/librte_mempool/Makefile | 2 ++
lib/librte_meter/Makefile | 2 ++
lib/librte_pipeline/Makefile | 2 ++
lib/librte_pmd_af_packet/Makefile | 2 ++
lib/librte_pmd_bond/Makefile | 2 ++
lib/librte_pmd_e1000/Makefile | 2 ++
lib/librte_pmd_enic/Makefile | 2 ++
lib/librte_pmd_i40e/Makefile | 2 ++
lib/librte_pmd_ixgbe/Makefile | 2 ++
lib/librte_pmd_pcap/Makefile | 2 ++
lib/librte_pmd_ring/Makefile | 2 ++
lib/librte_pmd_virtio/Makefile | 2 ++
lib/librte_pmd_vmxnet3/Makefile | 2 ++
lib/librte_pmd_xenvirt/Makefile | 2 ++
lib/librte_port/Makefile | 2 ++
lib/librte_power/Makefile | 2 ++
lib/librte_ring/Makefile | 2 ++
lib/librte_sched/Makefile | 2 ++
lib/librte_table/Makefile | 2 ++
lib/librte_timer/Makefile | 2 ++
lib/librte_vhost/Makefile | 2 ++
mk/rte.lib.mk | 12 ++++++++++--
38 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 45cbf80..765deb1 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_acl_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index a4f73de..032c240 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_cfgfile_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 3c71831..719dff6 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_cmdline_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
index 0bab870..0c57533 100644
--- a/lib/librte_compat/Makefile
+++ b/lib/librte_compat/Makefile
@@ -32,6 +32,8 @@
include $(RTE_SDK)/mk/rte.vars.mk
+LIBABIVER := 1
+
# install includes
SYMLINK-y-include := rte_compat.h
diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
index 3674a2c..4c9af17 100644
--- a/lib/librte_distributor/Makefile
+++ b/lib/librte_distributor/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_distributor_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index 0b5f9d9..ae214a4 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -48,6 +48,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
# specific to linuxapp exec-env
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index bae8af1..e117cec 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -35,6 +35,8 @@ LIB = librte_eal.a
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
VPATH += $(RTE_SDK)/lib/librte_eal/common
CFLAGS += -I$(SRCDIR)/include
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 80ad78d..c0e5768 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_ether_version.map
+LIBABIVER := 1
+
SRCS-y += rte_ethdev.c
#
diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
index bec61ab..3696cb1 100644
--- a/lib/librte_hash/Makefile
+++ b/lib/librte_hash/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_hash_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index aa88578..fe926f7 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_ipfrag_version.map
+LIBABIVER := 1
+
#source files
ifeq ($(CONFIG_RTE_MBUF_REFCNT),y)
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
index 068ee10..16defdb 100644
--- a/lib/librte_ivshmem/Makefile
+++ b/lib/librte_ivshmem/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ivshmem_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index 93a516d..7107832 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_kni_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
index b1c34f3..87b09f2 100644
--- a/lib/librte_kvargs/Makefile
+++ b/lib/librte_kvargs/Makefile
@@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_kvargs_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
index 8214630..35e6389 100644
--- a/lib/librte_lpm/Makefile
+++ b/lib/librte_lpm/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_lpm_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
index 15b7eed..947e41c 100644
--- a/lib/librte_malloc/Makefile
+++ b/lib/librte_malloc/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_malloc.a
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_malloc_version.map
diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
index 03becae..080f3cf 100644
--- a/lib/librte_mbuf/Makefile
+++ b/lib/librte_mbuf/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mbuf_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
index 31d1a71..940d1f7 100644
--- a/lib/librte_mempool/Makefile
+++ b/lib/librte_mempool/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mempool_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index c4a7a32..8765881 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_meter_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 15b58df..15e406b 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pipeline_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_af_packet/Makefile b/lib/librte_pmd_af_packet/Makefile
index 85a7860..f0bf537 100644
--- a/lib/librte_pmd_af_packet/Makefile
+++ b/lib/librte_pmd_af_packet/Makefile
@@ -40,6 +40,8 @@ LIB = librte_pmd_af_packet.a
EXPORT_MAP := rte_pmd_af_packet_version.map
+LIBABIVER := 1
+
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 074110a..d6c81a8 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_bond_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
index cd14444..8c8fed8 100644
--- a/lib/librte_pmd_e1000/Makefile
+++ b/lib/librte_pmd_e1000/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_e1000_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile
index 697231c..251a898 100644
--- a/lib/librte_pmd_enic/Makefile
+++ b/lib/librte_pmd_enic/Makefile
@@ -39,6 +39,8 @@ LIB = librte_pmd_enic.a
EXPORT_MAP := rte_pmd_enic_version.map
+LIBABIVER := 1
+
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/
CFLAGS += -O3
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index 73de373..9a0eec8 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_i40e_version.map
+LIBABIVER := 1
+
#
# Add extra flags for base driver files (also known as shared code)
# to disable warnings
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index e0a17f6..d580f62 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_ixgbe_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
index cb6678e..0775dbc 100644
--- a/lib/librte_pmd_pcap/Makefile
+++ b/lib/librte_pmd_pcap/Makefile
@@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_pcap_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
index aa1b461..e442d0b 100644
--- a/lib/librte_pmd_ring/Makefile
+++ b/lib/librte_pmd_ring/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_ring_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
index d979c59..793067f 100644
--- a/lib/librte_pmd_virtio/Makefile
+++ b/lib/librte_pmd_virtio/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_virtio_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index f3ab178..93e5580 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
EXPORT_MAP := rte_pmd_vmxnet3_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
index 4510603..f0c796c 100644
--- a/lib/librte_pmd_xenvirt/Makefile
+++ b/lib/librte_pmd_xenvirt/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_xenvirt_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 266ed39..0e38452 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_port_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index 0547dcd..cee95cd 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_power_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c rte_power_acpi_cpufreq.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c
diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
index b437dc5..84ad3d3 100644
--- a/lib/librte_ring/Makefile
+++ b/lib/librte_ring/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ring_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 48f280a..b1cb285 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
EXPORT_MAP := rte_sched_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
index 4e1a54a..0d8394c 100644
--- a/lib/librte_table/Makefile
+++ b/lib/librte_table/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_table_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
index 9fb6079..2aabef8 100644
--- a/lib/librte_timer/Makefile
+++ b/lib/librte_timer/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_timer_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 96a7dd0..369c25a 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -36,6 +36,8 @@ LIB = librte_vhost.a
EXPORT_MAP := rte_vhost_version.map
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse
LDFLAGS += -lfuse
# all source are stored in SRCS-y
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 1d3b646..865a307 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -37,10 +37,9 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
-
ifeq ($(RTE_BUILD_SHARED_LIB),y)
-LIB := $(patsubst %.a,%.so,$(LIB))
+LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
endif
@@ -113,6 +112,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
#
ifeq ($(RTE_BUILD_SHARED_LIB),y)
$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
+ifeq ($(LIBABIVER),)
+ @echo "Must Specify a $(LIB) ABI version"
+ @false
+endif
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(if $(D),\
@echo -n "$< -> $@ " ; \
@@ -126,6 +129,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
$(depfile_missing),\
$(depfile_newer)),\
$(O_TO_S_DO))
+
ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
$(if $(or \
$(file_missing),\
@@ -163,9 +167,13 @@ endif
# install lib in $(RTE_OUTPUT)/lib
#
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
+ $(eval LIBSONAME := $(basename $(LIB)))
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+ifeq ($(RTE_BUILD_SHARED_LIB),y)
+ $(Q)ln -s -f $< $(RTE_OUTPUT)/lib/$(LIBSONAME)
+endif
#
# Clean all generated files
--
2.1.0
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH v6 1/4] compat: Add infrastructure to support symbol versioning
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (7 preceding siblings ...)
2015-01-16 15:33 3% ` [dpdk-dev] [PATCH v5 " Neil Horman
@ 2015-01-20 21:17 3% ` Neil Horman
2015-01-20 21:17 7% ` [dpdk-dev] [PATCH v6 3/4] Add library version extenstion Neil Horman
2015-01-20 21:17 24% ` [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation Neil Horman
2015-01-21 20:59 3% ` [dpdk-dev] [PATCH v7 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
` (3 subsequent siblings)
12 siblings, 2 replies; 200+ results
From: Neil Horman @ 2015-01-20 21:17 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
---
Change Notes:
V2)
Moved ifeq to _INSTALL target
V3)
Undo V2 changes and make librte_compat use the rte.install.mk file
instead
v4)
changed --version-script to accept SRCDIR in this patch at per request
documented versioning macros
cleaned up macro parameter consistency
converted SA macro to RTE_STR macro
fixed copyright
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++
lib/librte_compat/rte_compat.h | 117 +++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 4 ++
4 files changed, 160 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 0ffc982..d617d81 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,6 +31,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..0bab870
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2013 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.install.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..d7cc176
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,117 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+#include <rte_common.h>
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. To support that, the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ * char foo(int value, int otherval) { ...}
+ *
+ * 5) Mark the newest version as the default version
+ * BIND_DEFAULT_SYMBOL(foo, 1.9);
+ *
+ */
+
+/*
+ * Macro Parameters:
+ * b - function base name
+ * e - function version extension, to be concatenated with base name
+ * n - function symbol version string to be applied
+ */
+
+/*
+ * VERSION_SYMBOL
+ * Creates a symbol version table entry binding symbol <b>@DPDK_<n> to the internal
+ * function name <b>_<e>
+ */
+#define VERSION_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@DPDK_"RTE_STR(n))
+
+/*
+ * BASE_SYMBOL
+ * Creates a symbol version table entry binding unversioned symbol <b>
+ * to the internal function <b>_<e>
+ */
+#define BASE_SYMBOL(b, e) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@")
+
+/*
+ * BNID_DEFAULT_SYMBOL
+ * Creates a symbol version entry instructing the linker to bind references to
+ * symbol <b> to the internal symbol <b>_<e>
+ */
+#define BIND_DEFAULT_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@@DPDK_"RTE_STR(n))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+#define BASE_SYMBOL(b, n)
+#define BIND_DEFAULT_SYMBOL(b, v)
+
+/*
+ * RTE_BUILD_SHARED_LIB=n
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 81bf8e1..1d3b646 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
--
2.1.0
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 15:06 9% ` Thomas Monjalon
@ 2015-01-20 15:35 4% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-01-20 15:35 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Tue, Jan 20, 2015 at 04:06:07PM +0100, Thomas Monjalon wrote:
> 2015-01-20 09:37, Neil Horman:
> > On Tue, Jan 20, 2015 at 03:00:01PM +0100, Thomas Monjalon wrote:
> > > 2015-01-16 10:33, Neil Horman:
> > > > --- /dev/null
> > > > +++ b/doc/abi.txt
> > > > @@ -0,0 +1,36 @@
> > > > +ABI policy:
> > > > + ABI versions are set at the time of major release labeling, and ABI may
> > > > +change multiple times between the last labeling and the HEAD label of the git
> > > > +tree without warning
> > > > +
> > > > + ABI versions, once released are available until such time as their
> > > > +deprecation has been noted here for at least one major release cycle, after it
> > > > +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> > > > +remove it is made during the development of DPDK 1.9. The decision will be
> > > > +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> > > > +1.10 ships.
> > > > +
> > > > + ABI versions may be deprecated in whole, or in part as needed by a given
> > > > +update.
> > > > +
> > > > + Some ABI changes may be too significant to reasonably maintain multiple
> > > > +versions of. In those events ABI's may be updated without backward
> > > > +compatibility provided. The requirements for doing so are:
> > > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > > + 2) A full deprecation cycle must be made to offer downstream consumers
> > > > +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> > > > +the change is proposed, a deprecation notice must be added to this file, and
> > > > +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> > > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> > > > +incorporated must be incremented in parallel with the ABI changes themselves
> > > > +
> > > > + Note that the above process for ABI deprecation should not be undertaken
> > > > +lightly. ABI stability is extreemely important for downstream consumers of the
> > > > +DPDK, especially when distributed in shared object form. Every effort should be
> > > > +made to preserve ABI whenever possible. For instance, reorganizing public
> > > > +structure field for astetic or readability purposes should be avoided as it will
> > >
> > > astetic? typo?
> > >
> > > > +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> > > > +as cause to alter ABI.
> > > > +
> > > > +Deprecation Notices:
> > >
> > > Neil, are you sure it's a good idea to put deprecations notices here instead
> > > of release notes?
> > >
> > Funny, I just made mention of that in my last note. I do think that the release
> > notes is the right place to "officially" announce deprecation warnings, but I
> > think we need a way for developers to communicate that efficiently (given that
> > the release notes aren't stored in the git tree).
>
> Yes, they are:
> http://dpdk.org/browse/dpdk/tree/doc/guides/rel_notes
> So I suggest to remove Deprecation Notices from abi.txt and create an entry
> in release notes.
>
> > I think this is the place for
> > developers to canonically list deprecations, and make reading this file part of
> > the release notes generation process. That way, updates can be made as part of
> > the commit process easily.
>
> Developpers can update the release notes themselves.
>
ok, I was unaware. If thats the case, then yes, putting these deprecations
directly in the release notes makes the most sense. I'll resubmit with that
changed.
> > > I'm also thinking that we need to add more things in this doc:
> > > - case of macros/constant deprecation (API only)
> > > - case of structure update: must be renamed to provide ABI compatibility?
> > >
> > I'm definately in favor of adding such notices here, but I hadn't planned for
> > any strict formatting of any given notice. That is to say, I considered you're
> > two issues above to be able to be included here. I have no issue with listing a
> > deprecation note that indicates macros are being removed or that sections of api
> > are being versioned to accomodate structure changes. of any sort
>
> No, I was suggesting to explain in this doc that macro removal must be
> announced with a deprecation notice,
> and that in case structure must be reworked, the name must change if we
> want to preserve ABI compatibility with old structure.
>
> > > Do you think we can have a tool to test the ABI compatibility by building
> > > examples/apps of previous version and checking them with built DSO of
> > > current version?
> > >
> > I do, though I'm not sure its within the scope of this update. The easiest way
> > to do it currently is to checkout the last released version of the dpdk, build
> > it as a DSO build, copy out one of the test/example apps, checkout the HEAD of
> > the tree, rebuild, and run the saved off test app from the first build using the
> > shared objects of the second build. That does some rudimentary validation,
> > but it only touches on the API aspects that the application you're using makes
> > use of. What would be better would be if we had a test application that made a
> > call to every exported API call that we have, so that we could be confident that
> > we were exhaustively testing the ABI surface. I think thats a large piece of
> > work, but it would be beneficial to have.
>
> Yes, it should be another patchset.
> Do you plan to work on it? It would be very convenient for developpers and
> maintainers to test ABI compatibility.
>
Gladly, if we can get this in. I think its an important tool.
> Thanks
> --
> Thomas
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 14:50 4% ` Butler, Siobhan A
@ 2015-01-20 15:30 4% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-01-20 15:30 UTC (permalink / raw)
To: Butler, Siobhan A; +Cc: dev
On Tue, Jan 20, 2015 at 02:50:43PM +0000, Butler, Siobhan A wrote:
>
>
> > -----Original Message-----
> > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Sent: Tuesday, January 20, 2015 2:42 PM
> > To: Butler, Siobhan A
> > Cc: Iremonger, Bernard; dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
> >
> > On Tue, Jan 20, 2015 at 02:29:54PM +0000, Butler, Siobhan A wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> > > > Sent: Tuesday, January 20, 2015 2:24 PM
> > > > To: Iremonger, Bernard
> > > > Cc: dev@dpdk.org
> > > > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
> > > >
> > > > On Tue, Jan 20, 2015 at 01:37:35PM +0000, Iremonger, Bernard wrote:
> > > > > > -----Original Message-----
> > > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas
> > > > Monjalon
> > > > > > Sent: Tuesday, January 20, 2015 7:15 AM
> > > > > > To: Neil Horman
> > > > > > Cc: dev@dpdk.org
> > > > > > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI
> > > > > > documentation
> > > > > >
> > > > > > Thank you Neil for writing this document.
> > > > > > This is a really important change in DPDK.
> > > > > > It would be very good to have comments or acknowledgement from
> > > > > > several developpers. This policy would be enforced by having
> > > > > > several
> > > > Acked-by lines.
> > > > > >
> > > > > >
> > > > > > 2015-01-16 10:33, Neil Horman:
> > > > > > > Adding a document describing rudimentary ABI policy and adding
> > > > > > > notice space for any deprecation announcements
> > > > > > >
> > > > > > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > > > > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > > > > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > > > > >
> > > > > > > ---
> > > > > > > Change notes:
> > > > > > >
> > > > > > > v5) Updated documentation to add notes from Thomas M.
> > > > > > > ---
> > > > > > > doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
> > > > > > > 1 file changed, 36 insertions(+) create mode 100644
> > > > > > > doc/abi.txt
> > > > > > >
> > > > > > > diff --git a/doc/abi.txt b/doc/abi.txt new file mode 100644
> > > > > > > index
> > > > > > > 0000000..14be464
> > > > > > > --- /dev/null
> > > > > > > +++ b/doc/abi.txt
> > > > > > > @@ -0,0 +1,36 @@
> > > > > > > +ABI policy:
> > > > > > > + ABI versions are set at the time of major release labeling,
> > > > > > > +and ABI may change multiple times between the last labeling
> > > > > > > +and the HEAD label of the git tree without warning
> > > > > > > +
> > > > > > > + ABI versions, once released are available until such time as
> > > > > > > +their deprecation has been noted here for at least one major
> > > > > > > +release cycle, after it has been tagged. E.g. the ABI for
> > > > > > > +DPDK
> > > > > > > +1.8 is shipped, and then the decision to remove it is made
> > > > > > > +during the development of DPDK 1.9. The decision will be
> > > > > > > +recorded here, shipped with the DPDK 1.9 release, and
> > > > > > > +actually removed when DPDK
> > > > > > > +1.10 ships.
> > > > > > > +
> > > > > > > + ABI versions may be deprecated in whole, or in part as
> > > > > > > +needed by a given update.
> > > > > > > +
> > > > > > > + Some ABI changes may be too significant to reasonably
> > > > > > > +maintain multiple versions of. In those events ABI's may be
> > > > > > > +updated without backward compatibility provided. The
> > > > > > > +requirements for doing
> > > > so are:
> > > > > > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > > > > > + 2) A full deprecation cycle must be made to offer
> > downstream
> > > > > > > +consumers sufficient warning of the change. E.g. if dpdk 2.0
> > > > > > > +is under development when the change is proposed, a
> > > > > > > +deprecation notice must be added to this file, and released with
> > dpdk 2.0.
> > > > > > > +Then the change may be incorporated for
> > > > > > dpdk 2.1
> > > > > > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI
> > > > > > > +changes are incorporated must be incremented in parallel with
> > > > > > > +the ABI changes themselves
> > > > > > > +
> > > > > > > + Note that the above process for ABI deprecation should not
> > > > > > > +be undertaken lightly. ABI stability is extreemely important
> > > > > > > +for downstream consumers of the DPDK, especially when
> > > > > > > +distributed in shared object form. Every effort should be
> > > > > > > +made to preserve ABI whenever possible. For instance,
> > > > > > > +reorganizing public structure field for astetic or
> > > > > > > +readability purposes should be avoided as it will cause ABI
> > > > > > > +breakage. Only significant (e.g. performance) reasons should
> > > > > > > +be seen as cause to alter
> > > > > > ABI.
> > > > >
> > > > > Hi Thomas,
> > > > >
> > > > > Should there be a reference to this document in the programmers
> > guide?
> > > > >
> > > > Thats a good question. I think, as Thomas notes, it probably should
> > > > be referenced in some way. The programmers guide might be good.
> > > > What might be better would be checking the deprecation notices and
> > > > adding them to the release notes for any given release.
> > > >
> > > > Thoughts?
> > > > Neil
> > > >
> > > > > Regards,
> > > > >
> > > > > Bernard.
> > > > >
> > > > >
> > >
> > > Sorry to be pedantic but would you also mind sending it as a .rst file
> > > instead of .txt if you're going to send as patches to Programmer's
> > > Guide anyway? :) Thanks,
> > Actually I'm not sure this is a good idea. The release notes get formatted and
> > review by a documentation team right? I'm not sure theres value in having a
> > developer write formatted text if its just going to get reviewed and
> > reformatted later, is there?
> > Neil
> Bernard and I are the documentation team :) we use .rst files (which are plain text files) and then sphinx to auto-generate the HTML version.
> It's no big issue anyway, just if you had to resend it I thought it would be handy.
Can I infer from this then, that if I need to resend it, it would be sufficient
to simply rename this file with an .rst extension? If so, I'm happy to do so.
> Thanks Neil - great to see more contributions to the docs coming in.
Thank you!
Neil
> S
> >
> > > Siobhan
> > >
>
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 14:37 7% ` Neil Horman
@ 2015-01-20 15:06 9% ` Thomas Monjalon
2015-01-20 15:35 4% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2015-01-20 15:06 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2015-01-20 09:37, Neil Horman:
> On Tue, Jan 20, 2015 at 03:00:01PM +0100, Thomas Monjalon wrote:
> > 2015-01-16 10:33, Neil Horman:
> > > --- /dev/null
> > > +++ b/doc/abi.txt
> > > @@ -0,0 +1,36 @@
> > > +ABI policy:
> > > + ABI versions are set at the time of major release labeling, and ABI may
> > > +change multiple times between the last labeling and the HEAD label of the git
> > > +tree without warning
> > > +
> > > + ABI versions, once released are available until such time as their
> > > +deprecation has been noted here for at least one major release cycle, after it
> > > +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> > > +remove it is made during the development of DPDK 1.9. The decision will be
> > > +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> > > +1.10 ships.
> > > +
> > > + ABI versions may be deprecated in whole, or in part as needed by a given
> > > +update.
> > > +
> > > + Some ABI changes may be too significant to reasonably maintain multiple
> > > +versions of. In those events ABI's may be updated without backward
> > > +compatibility provided. The requirements for doing so are:
> > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > + 2) A full deprecation cycle must be made to offer downstream consumers
> > > +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> > > +the change is proposed, a deprecation notice must be added to this file, and
> > > +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> > > +incorporated must be incremented in parallel with the ABI changes themselves
> > > +
> > > + Note that the above process for ABI deprecation should not be undertaken
> > > +lightly. ABI stability is extreemely important for downstream consumers of the
> > > +DPDK, especially when distributed in shared object form. Every effort should be
> > > +made to preserve ABI whenever possible. For instance, reorganizing public
> > > +structure field for astetic or readability purposes should be avoided as it will
> >
> > astetic? typo?
> >
> > > +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> > > +as cause to alter ABI.
> > > +
> > > +Deprecation Notices:
> >
> > Neil, are you sure it's a good idea to put deprecations notices here instead
> > of release notes?
> >
> Funny, I just made mention of that in my last note. I do think that the release
> notes is the right place to "officially" announce deprecation warnings, but I
> think we need a way for developers to communicate that efficiently (given that
> the release notes aren't stored in the git tree).
Yes, they are:
http://dpdk.org/browse/dpdk/tree/doc/guides/rel_notes
So I suggest to remove Deprecation Notices from abi.txt and create an entry
in release notes.
> I think this is the place for
> developers to canonically list deprecations, and make reading this file part of
> the release notes generation process. That way, updates can be made as part of
> the commit process easily.
Developpers can update the release notes themselves.
> > I'm also thinking that we need to add more things in this doc:
> > - case of macros/constant deprecation (API only)
> > - case of structure update: must be renamed to provide ABI compatibility?
> >
> I'm definately in favor of adding such notices here, but I hadn't planned for
> any strict formatting of any given notice. That is to say, I considered you're
> two issues above to be able to be included here. I have no issue with listing a
> deprecation note that indicates macros are being removed or that sections of api
> are being versioned to accomodate structure changes. of any sort
No, I was suggesting to explain in this doc that macro removal must be
announced with a deprecation notice,
and that in case structure must be reworked, the name must change if we
want to preserve ABI compatibility with old structure.
> > Do you think we can have a tool to test the ABI compatibility by building
> > examples/apps of previous version and checking them with built DSO of
> > current version?
> >
> I do, though I'm not sure its within the scope of this update. The easiest way
> to do it currently is to checkout the last released version of the dpdk, build
> it as a DSO build, copy out one of the test/example apps, checkout the HEAD of
> the tree, rebuild, and run the saved off test app from the first build using the
> shared objects of the second build. That does some rudimentary validation,
> but it only touches on the API aspects that the application you're using makes
> use of. What would be better would be if we had a test application that made a
> call to every exported API call that we have, so that we could be confident that
> we were exhaustively testing the ABI surface. I think thats a large piece of
> work, but it would be beneficial to have.
Yes, it should be another patchset.
Do you plan to work on it? It would be very convenient for developpers and
maintainers to test ABI compatibility.
Thanks
--
Thomas
^ permalink raw reply [relevance 9%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 14:41 4% ` Neil Horman
@ 2015-01-20 14:50 4% ` Butler, Siobhan A
2015-01-20 15:30 4% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Butler, Siobhan A @ 2015-01-20 14:50 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
> -----Original Message-----
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Tuesday, January 20, 2015 2:42 PM
> To: Butler, Siobhan A
> Cc: Iremonger, Bernard; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
>
> On Tue, Jan 20, 2015 at 02:29:54PM +0000, Butler, Siobhan A wrote:
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> > > Sent: Tuesday, January 20, 2015 2:24 PM
> > > To: Iremonger, Bernard
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
> > >
> > > On Tue, Jan 20, 2015 at 01:37:35PM +0000, Iremonger, Bernard wrote:
> > > > > -----Original Message-----
> > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas
> > > Monjalon
> > > > > Sent: Tuesday, January 20, 2015 7:15 AM
> > > > > To: Neil Horman
> > > > > Cc: dev@dpdk.org
> > > > > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI
> > > > > documentation
> > > > >
> > > > > Thank you Neil for writing this document.
> > > > > This is a really important change in DPDK.
> > > > > It would be very good to have comments or acknowledgement from
> > > > > several developpers. This policy would be enforced by having
> > > > > several
> > > Acked-by lines.
> > > > >
> > > > >
> > > > > 2015-01-16 10:33, Neil Horman:
> > > > > > Adding a document describing rudimentary ABI policy and adding
> > > > > > notice space for any deprecation announcements
> > > > > >
> > > > > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > > > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > > > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > > > >
> > > > > > ---
> > > > > > Change notes:
> > > > > >
> > > > > > v5) Updated documentation to add notes from Thomas M.
> > > > > > ---
> > > > > > doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
> > > > > > 1 file changed, 36 insertions(+) create mode 100644
> > > > > > doc/abi.txt
> > > > > >
> > > > > > diff --git a/doc/abi.txt b/doc/abi.txt new file mode 100644
> > > > > > index
> > > > > > 0000000..14be464
> > > > > > --- /dev/null
> > > > > > +++ b/doc/abi.txt
> > > > > > @@ -0,0 +1,36 @@
> > > > > > +ABI policy:
> > > > > > + ABI versions are set at the time of major release labeling,
> > > > > > +and ABI may change multiple times between the last labeling
> > > > > > +and the HEAD label of the git tree without warning
> > > > > > +
> > > > > > + ABI versions, once released are available until such time as
> > > > > > +their deprecation has been noted here for at least one major
> > > > > > +release cycle, after it has been tagged. E.g. the ABI for
> > > > > > +DPDK
> > > > > > +1.8 is shipped, and then the decision to remove it is made
> > > > > > +during the development of DPDK 1.9. The decision will be
> > > > > > +recorded here, shipped with the DPDK 1.9 release, and
> > > > > > +actually removed when DPDK
> > > > > > +1.10 ships.
> > > > > > +
> > > > > > + ABI versions may be deprecated in whole, or in part as
> > > > > > +needed by a given update.
> > > > > > +
> > > > > > + Some ABI changes may be too significant to reasonably
> > > > > > +maintain multiple versions of. In those events ABI's may be
> > > > > > +updated without backward compatibility provided. The
> > > > > > +requirements for doing
> > > so are:
> > > > > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > > > > + 2) A full deprecation cycle must be made to offer
> downstream
> > > > > > +consumers sufficient warning of the change. E.g. if dpdk 2.0
> > > > > > +is under development when the change is proposed, a
> > > > > > +deprecation notice must be added to this file, and released with
> dpdk 2.0.
> > > > > > +Then the change may be incorporated for
> > > > > dpdk 2.1
> > > > > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI
> > > > > > +changes are incorporated must be incremented in parallel with
> > > > > > +the ABI changes themselves
> > > > > > +
> > > > > > + Note that the above process for ABI deprecation should not
> > > > > > +be undertaken lightly. ABI stability is extreemely important
> > > > > > +for downstream consumers of the DPDK, especially when
> > > > > > +distributed in shared object form. Every effort should be
> > > > > > +made to preserve ABI whenever possible. For instance,
> > > > > > +reorganizing public structure field for astetic or
> > > > > > +readability purposes should be avoided as it will cause ABI
> > > > > > +breakage. Only significant (e.g. performance) reasons should
> > > > > > +be seen as cause to alter
> > > > > ABI.
> > > >
> > > > Hi Thomas,
> > > >
> > > > Should there be a reference to this document in the programmers
> guide?
> > > >
> > > Thats a good question. I think, as Thomas notes, it probably should
> > > be referenced in some way. The programmers guide might be good.
> > > What might be better would be checking the deprecation notices and
> > > adding them to the release notes for any given release.
> > >
> > > Thoughts?
> > > Neil
> > >
> > > > Regards,
> > > >
> > > > Bernard.
> > > >
> > > >
> >
> > Sorry to be pedantic but would you also mind sending it as a .rst file
> > instead of .txt if you're going to send as patches to Programmer's
> > Guide anyway? :) Thanks,
> Actually I'm not sure this is a good idea. The release notes get formatted and
> review by a documentation team right? I'm not sure theres value in having a
> developer write formatted text if its just going to get reviewed and
> reformatted later, is there?
> Neil
Bernard and I are the documentation team :) we use .rst files (which are plain text files) and then sphinx to auto-generate the HTML version.
It's no big issue anyway, just if you had to resend it I thought it would be handy.
Thanks Neil - great to see more contributions to the docs coming in.
S
>
> > Siobhan
> >
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 14:29 4% ` Butler, Siobhan A
@ 2015-01-20 14:41 4% ` Neil Horman
2015-01-20 14:50 4% ` Butler, Siobhan A
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-01-20 14:41 UTC (permalink / raw)
To: Butler, Siobhan A; +Cc: dev
On Tue, Jan 20, 2015 at 02:29:54PM +0000, Butler, Siobhan A wrote:
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> > Sent: Tuesday, January 20, 2015 2:24 PM
> > To: Iremonger, Bernard
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
> >
> > On Tue, Jan 20, 2015 at 01:37:35PM +0000, Iremonger, Bernard wrote:
> > > > -----Original Message-----
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas
> > Monjalon
> > > > Sent: Tuesday, January 20, 2015 7:15 AM
> > > > To: Neil Horman
> > > > Cc: dev@dpdk.org
> > > > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
> > > >
> > > > Thank you Neil for writing this document.
> > > > This is a really important change in DPDK.
> > > > It would be very good to have comments or acknowledgement from
> > > > several developpers. This policy would be enforced by having several
> > Acked-by lines.
> > > >
> > > >
> > > > 2015-01-16 10:33, Neil Horman:
> > > > > Adding a document describing rudimentary ABI policy and adding
> > > > > notice space for any deprecation announcements
> > > > >
> > > > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > > >
> > > > > ---
> > > > > Change notes:
> > > > >
> > > > > v5) Updated documentation to add notes from Thomas M.
> > > > > ---
> > > > > doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
> > > > > 1 file changed, 36 insertions(+)
> > > > > create mode 100644 doc/abi.txt
> > > > >
> > > > > diff --git a/doc/abi.txt b/doc/abi.txt new file mode 100644 index
> > > > > 0000000..14be464
> > > > > --- /dev/null
> > > > > +++ b/doc/abi.txt
> > > > > @@ -0,0 +1,36 @@
> > > > > +ABI policy:
> > > > > + ABI versions are set at the time of major release labeling, and
> > > > > +ABI may change multiple times between the last labeling and the
> > > > > +HEAD label of the git tree without warning
> > > > > +
> > > > > + ABI versions, once released are available until such time as
> > > > > +their deprecation has been noted here for at least one major
> > > > > +release cycle, after it has been tagged. E.g. the ABI for DPDK
> > > > > +1.8 is shipped, and then the decision to remove it is made during
> > > > > +the development of DPDK 1.9. The decision will be recorded here,
> > > > > +shipped with the DPDK 1.9 release, and actually removed when DPDK
> > > > > +1.10 ships.
> > > > > +
> > > > > + ABI versions may be deprecated in whole, or in part as needed by
> > > > > +a given update.
> > > > > +
> > > > > + Some ABI changes may be too significant to reasonably maintain
> > > > > +multiple versions of. In those events ABI's may be updated
> > > > > +without backward compatibility provided. The requirements for doing
> > so are:
> > > > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > > > + 2) A full deprecation cycle must be made to offer downstream
> > > > > +consumers sufficient warning of the change. E.g. if dpdk 2.0 is
> > > > > +under development when the change is proposed, a deprecation
> > > > > +notice must be added to this file, and released with dpdk 2.0.
> > > > > +Then the change may be incorporated for
> > > > dpdk 2.1
> > > > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI
> > > > > +changes are incorporated must be incremented in parallel with the
> > > > > +ABI changes themselves
> > > > > +
> > > > > + Note that the above process for ABI deprecation should not be
> > > > > +undertaken lightly. ABI stability is extreemely important for
> > > > > +downstream consumers of the DPDK, especially when distributed in
> > > > > +shared object form. Every effort should be made to preserve ABI
> > > > > +whenever possible. For instance, reorganizing public structure
> > > > > +field for astetic or readability purposes should be avoided as it
> > > > > +will cause ABI breakage. Only significant (e.g. performance)
> > > > > +reasons should be seen as cause to alter
> > > > ABI.
> > >
> > > Hi Thomas,
> > >
> > > Should there be a reference to this document in the programmers guide?
> > >
> > Thats a good question. I think, as Thomas notes, it probably should be
> > referenced in some way. The programmers guide might be good. What
> > might be better would be checking the deprecation notices and adding them
> > to the release notes for any given release.
> >
> > Thoughts?
> > Neil
> >
> > > Regards,
> > >
> > > Bernard.
> > >
> > >
>
> Sorry to be pedantic but would you also mind sending it as a .rst file instead of .txt if you're going to send as patches to Programmer's Guide anyway? :)
> Thanks,
Actually I'm not sure this is a good idea. The release notes get formatted and
review by a documentation team right? I'm not sure theres value in having a
developer write formatted text if its just going to get reviewed and reformatted
later, is there?
Neil
> Siobhan
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 14:00 8% ` Thomas Monjalon
@ 2015-01-20 14:37 7% ` Neil Horman
2015-01-20 15:06 9% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-01-20 14:37 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Tue, Jan 20, 2015 at 03:00:01PM +0100, Thomas Monjalon wrote:
> 2015-01-16 10:33, Neil Horman:
> > --- /dev/null
> > +++ b/doc/abi.txt
> > @@ -0,0 +1,36 @@
> > +ABI policy:
> > + ABI versions are set at the time of major release labeling, and ABI may
> > +change multiple times between the last labeling and the HEAD label of the git
> > +tree without warning
> > +
> > + ABI versions, once released are available until such time as their
> > +deprecation has been noted here for at least one major release cycle, after it
> > +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> > +remove it is made during the development of DPDK 1.9. The decision will be
> > +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> > +1.10 ships.
> > +
> > + ABI versions may be deprecated in whole, or in part as needed by a given
> > +update.
> > +
> > + Some ABI changes may be too significant to reasonably maintain multiple
> > +versions of. In those events ABI's may be updated without backward
> > +compatibility provided. The requirements for doing so are:
> > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > + 2) A full deprecation cycle must be made to offer downstream consumers
> > +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> > +the change is proposed, a deprecation notice must be added to this file, and
> > +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> > +incorporated must be incremented in parallel with the ABI changes themselves
> > +
> > + Note that the above process for ABI deprecation should not be undertaken
> > +lightly. ABI stability is extreemely important for downstream consumers of the
> > +DPDK, especially when distributed in shared object form. Every effort should be
> > +made to preserve ABI whenever possible. For instance, reorganizing public
> > +structure field for astetic or readability purposes should be avoided as it will
>
> astetic? typo?
>
> > +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> > +as cause to alter ABI.
> > +
> > +Deprecation Notices:
>
> Neil, are you sure it's a good idea to put deprecations notices here instead
> of release notes?
>
Funny, I just made mention of that in my last note. I do think that the release
notes is the right place to "officially" announce deprecation warnings, but I
think we need a way for developers to communicate that efficiently (given that
the release notes aren't stored in the git tree). I think this is the place for
developers to canonically list deprecations, and make reading this file part of
the release notes generation process. That way, updates can be made as part of
the commit process easily.
> I'm also thinking that we need to add more things in this doc:
> - case of macros/constant deprecation (API only)
> - case of structure update: must be renamed to provide ABI compatibility?
>
I'm definately in favor of adding such notices here, but I hadn't planned for
any strict formatting of any given notice. That is to say, I considered you're
two issues above to be able to be included here. I have no issue with listing a
deprecation note that indicates macros are being removed or that sections of api
are being versioned to accomodate structure changes. of any sort
> Do you think we can have a tool to test the ABI compatibility by building
> examples/apps of previous version and checking them with built DSO of
> current version?
>
I do, though I'm not sure its within the scope of this update. The easiest way
to do it currently is to checkout the last released version of the dpdk, build
it as a DSO build, copy out one of the test/example apps, checkout the HEAD of
the tree, rebuild, and run the saved off test app from the first build using the
shared objects of the second build. That does some rudimentary validation,
but it only touches on the API aspects that the application you're using makes
use of. What would be better would be if we had a test application that made a
call to every exported API call that we have, so that we could be confident that
we were exhaustively testing the ABI surface. I think thats a large piece of
work, but it would be beneficial to have.
Thanks
Neil
^ permalink raw reply [relevance 7%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 14:24 4% ` Neil Horman
2015-01-20 14:29 4% ` Butler, Siobhan A
@ 2015-01-20 14:32 4% ` O'driscoll, Tim
1 sibling, 0 replies; 200+ results
From: O'driscoll, Tim @ 2015-01-20 14:32 UTC (permalink / raw)
To: Neil Horman, Iremonger, Bernard; +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Tuesday, January 20, 2015 2:24 PM
> To: Iremonger, Bernard
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
>
> On Tue, Jan 20, 2015 at 01:37:35PM +0000, Iremonger, Bernard wrote:
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas
> Monjalon
> > > Sent: Tuesday, January 20, 2015 7:15 AM
> > > To: Neil Horman
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
> > >
> > > Thank you Neil for writing this document.
> > > This is a really important change in DPDK.
> > > It would be very good to have comments or acknowledgement from
> several developpers. This policy
> > > would be enforced by having several Acked-by lines.
> > >
> > >
> > > 2015-01-16 10:33, Neil Horman:
> > > > Adding a document describing rudimentary ABI policy and adding notice
> > > > space for any deprecation announcements
> > > >
> > > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > >
> > > > ---
> > > > Change notes:
> > > >
> > > > v5) Updated documentation to add notes from Thomas M.
> > > > ---
> > > > doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
> > > > 1 file changed, 36 insertions(+)
> > > > create mode 100644 doc/abi.txt
> > > >
> > > > diff --git a/doc/abi.txt b/doc/abi.txt new file mode 100644 index
> > > > 0000000..14be464
> > > > --- /dev/null
> > > > +++ b/doc/abi.txt
> > > > @@ -0,0 +1,36 @@
> > > > +ABI policy:
> > > > + ABI versions are set at the time of major release labeling, and ABI
> > > > +may change multiple times between the last labeling and the HEAD
> > > > +label of the git tree without warning
> > > > +
> > > > + ABI versions, once released are available until such time as their
> > > > +deprecation has been noted here for at least one major release cycle,
> > > > +after it has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and
> > > > +then the decision to remove it is made during the development of
> DPDK
> > > > +1.9. The decision will be recorded here, shipped with the DPDK 1.9
> > > > +release, and actually removed when DPDK
> > > > +1.10 ships.
> > > > +
> > > > + ABI versions may be deprecated in whole, or in part as needed by a
> > > > +given update.
> > > > +
> > > > + Some ABI changes may be too significant to reasonably maintain
> > > > +multiple versions of. In those events ABI's may be updated without
> > > > +backward compatibility provided. The requirements for doing so are:
> > > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > > + 2) A full deprecation cycle must be made to offer downstream
> > > > +consumers sufficient warning of the change. E.g. if dpdk 2.0 is
> > > > +under development when the change is proposed, a deprecation
> notice
> > > > +must be added to this file, and released with dpdk 2.0. Then the
> change may be incorporated for
> > > dpdk 2.1
> > > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes
> > > > +are incorporated must be incremented in parallel with the ABI changes
> > > > +themselves
> > > > +
> > > > + Note that the above process for ABI deprecation should not be
> > > > +undertaken lightly. ABI stability is extreemely important for
> > > > +downstream consumers of the DPDK, especially when distributed in
> > > > +shared object form. Every effort should be made to preserve ABI
> > > > +whenever possible. For instance, reorganizing public structure field
> > > > +for astetic or readability purposes should be avoided as it will
> > > > +cause ABI breakage. Only significant (e.g. performance) reasons
> should be seen as cause to alter
> > > ABI.
> >
> > Hi Thomas,
> >
> > Should there be a reference to this document in the programmers guide?
> >
> Thats a good question. I think, as Thomas notes, it probably should be
> referenced in some way. The programmers guide might be good. What
> might be
> better would be checking the deprecation notices and adding them to the
> release
> notes for any given release.
>
> Thoughts?
I'd suggest that the policy itself should go in, or at least be referenced from, the programmer's guide. I agree that the deprecation notices themselves should go in the release notes.
> Neil
>
> > Regards,
> >
> > Bernard.
> >
> >
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 14:24 4% ` Neil Horman
@ 2015-01-20 14:29 4% ` Butler, Siobhan A
2015-01-20 14:41 4% ` Neil Horman
2015-01-20 14:32 4% ` O'driscoll, Tim
1 sibling, 1 reply; 200+ results
From: Butler, Siobhan A @ 2015-01-20 14:29 UTC (permalink / raw)
To: Neil Horman, Iremonger, Bernard; +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Tuesday, January 20, 2015 2:24 PM
> To: Iremonger, Bernard
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
>
> On Tue, Jan 20, 2015 at 01:37:35PM +0000, Iremonger, Bernard wrote:
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas
> Monjalon
> > > Sent: Tuesday, January 20, 2015 7:15 AM
> > > To: Neil Horman
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
> > >
> > > Thank you Neil for writing this document.
> > > This is a really important change in DPDK.
> > > It would be very good to have comments or acknowledgement from
> > > several developpers. This policy would be enforced by having several
> Acked-by lines.
> > >
> > >
> > > 2015-01-16 10:33, Neil Horman:
> > > > Adding a document describing rudimentary ABI policy and adding
> > > > notice space for any deprecation announcements
> > > >
> > > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > >
> > > > ---
> > > > Change notes:
> > > >
> > > > v5) Updated documentation to add notes from Thomas M.
> > > > ---
> > > > doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
> > > > 1 file changed, 36 insertions(+)
> > > > create mode 100644 doc/abi.txt
> > > >
> > > > diff --git a/doc/abi.txt b/doc/abi.txt new file mode 100644 index
> > > > 0000000..14be464
> > > > --- /dev/null
> > > > +++ b/doc/abi.txt
> > > > @@ -0,0 +1,36 @@
> > > > +ABI policy:
> > > > + ABI versions are set at the time of major release labeling, and
> > > > +ABI may change multiple times between the last labeling and the
> > > > +HEAD label of the git tree without warning
> > > > +
> > > > + ABI versions, once released are available until such time as
> > > > +their deprecation has been noted here for at least one major
> > > > +release cycle, after it has been tagged. E.g. the ABI for DPDK
> > > > +1.8 is shipped, and then the decision to remove it is made during
> > > > +the development of DPDK 1.9. The decision will be recorded here,
> > > > +shipped with the DPDK 1.9 release, and actually removed when DPDK
> > > > +1.10 ships.
> > > > +
> > > > + ABI versions may be deprecated in whole, or in part as needed by
> > > > +a given update.
> > > > +
> > > > + Some ABI changes may be too significant to reasonably maintain
> > > > +multiple versions of. In those events ABI's may be updated
> > > > +without backward compatibility provided. The requirements for doing
> so are:
> > > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > > + 2) A full deprecation cycle must be made to offer downstream
> > > > +consumers sufficient warning of the change. E.g. if dpdk 2.0 is
> > > > +under development when the change is proposed, a deprecation
> > > > +notice must be added to this file, and released with dpdk 2.0.
> > > > +Then the change may be incorporated for
> > > dpdk 2.1
> > > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI
> > > > +changes are incorporated must be incremented in parallel with the
> > > > +ABI changes themselves
> > > > +
> > > > + Note that the above process for ABI deprecation should not be
> > > > +undertaken lightly. ABI stability is extreemely important for
> > > > +downstream consumers of the DPDK, especially when distributed in
> > > > +shared object form. Every effort should be made to preserve ABI
> > > > +whenever possible. For instance, reorganizing public structure
> > > > +field for astetic or readability purposes should be avoided as it
> > > > +will cause ABI breakage. Only significant (e.g. performance)
> > > > +reasons should be seen as cause to alter
> > > ABI.
> >
> > Hi Thomas,
> >
> > Should there be a reference to this document in the programmers guide?
> >
> Thats a good question. I think, as Thomas notes, it probably should be
> referenced in some way. The programmers guide might be good. What
> might be better would be checking the deprecation notices and adding them
> to the release notes for any given release.
>
> Thoughts?
> Neil
>
> > Regards,
> >
> > Bernard.
> >
> >
Sorry to be pedantic but would you also mind sending it as a .rst file instead of .txt if you're going to send as patches to Programmer's Guide anyway? :)
Thanks,
Siobhan
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 13:37 4% ` Iremonger, Bernard
2015-01-20 13:46 4% ` Thomas Monjalon
@ 2015-01-20 14:24 4% ` Neil Horman
2015-01-20 14:29 4% ` Butler, Siobhan A
2015-01-20 14:32 4% ` O'driscoll, Tim
1 sibling, 2 replies; 200+ results
From: Neil Horman @ 2015-01-20 14:24 UTC (permalink / raw)
To: Iremonger, Bernard; +Cc: dev
On Tue, Jan 20, 2015 at 01:37:35PM +0000, Iremonger, Bernard wrote:
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> > Sent: Tuesday, January 20, 2015 7:15 AM
> > To: Neil Horman
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
> >
> > Thank you Neil for writing this document.
> > This is a really important change in DPDK.
> > It would be very good to have comments or acknowledgement from several developpers. This policy
> > would be enforced by having several Acked-by lines.
> >
> >
> > 2015-01-16 10:33, Neil Horman:
> > > Adding a document describing rudimentary ABI policy and adding notice
> > > space for any deprecation announcements
> > >
> > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > >
> > > ---
> > > Change notes:
> > >
> > > v5) Updated documentation to add notes from Thomas M.
> > > ---
> > > doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
> > > 1 file changed, 36 insertions(+)
> > > create mode 100644 doc/abi.txt
> > >
> > > diff --git a/doc/abi.txt b/doc/abi.txt new file mode 100644 index
> > > 0000000..14be464
> > > --- /dev/null
> > > +++ b/doc/abi.txt
> > > @@ -0,0 +1,36 @@
> > > +ABI policy:
> > > + ABI versions are set at the time of major release labeling, and ABI
> > > +may change multiple times between the last labeling and the HEAD
> > > +label of the git tree without warning
> > > +
> > > + ABI versions, once released are available until such time as their
> > > +deprecation has been noted here for at least one major release cycle,
> > > +after it has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and
> > > +then the decision to remove it is made during the development of DPDK
> > > +1.9. The decision will be recorded here, shipped with the DPDK 1.9
> > > +release, and actually removed when DPDK
> > > +1.10 ships.
> > > +
> > > + ABI versions may be deprecated in whole, or in part as needed by a
> > > +given update.
> > > +
> > > + Some ABI changes may be too significant to reasonably maintain
> > > +multiple versions of. In those events ABI's may be updated without
> > > +backward compatibility provided. The requirements for doing so are:
> > > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > > + 2) A full deprecation cycle must be made to offer downstream
> > > +consumers sufficient warning of the change. E.g. if dpdk 2.0 is
> > > +under development when the change is proposed, a deprecation notice
> > > +must be added to this file, and released with dpdk 2.0. Then the change may be incorporated for
> > dpdk 2.1
> > > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes
> > > +are incorporated must be incremented in parallel with the ABI changes
> > > +themselves
> > > +
> > > + Note that the above process for ABI deprecation should not be
> > > +undertaken lightly. ABI stability is extreemely important for
> > > +downstream consumers of the DPDK, especially when distributed in
> > > +shared object form. Every effort should be made to preserve ABI
> > > +whenever possible. For instance, reorganizing public structure field
> > > +for astetic or readability purposes should be avoided as it will
> > > +cause ABI breakage. Only significant (e.g. performance) reasons should be seen as cause to alter
> > ABI.
>
> Hi Thomas,
>
> Should there be a reference to this document in the programmers guide?
>
Thats a good question. I think, as Thomas notes, it probably should be
referenced in some way. The programmers guide might be good. What might be
better would be checking the deprecation notices and adding them to the release
notes for any given release.
Thoughts?
Neil
> Regards,
>
> Bernard.
>
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-16 15:33 23% ` [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation Neil Horman
2015-01-20 7:14 4% ` Thomas Monjalon
@ 2015-01-20 14:00 8% ` Thomas Monjalon
2015-01-20 14:37 7% ` Neil Horman
1 sibling, 1 reply; 200+ results
From: Thomas Monjalon @ 2015-01-20 14:00 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2015-01-16 10:33, Neil Horman:
> --- /dev/null
> +++ b/doc/abi.txt
> @@ -0,0 +1,36 @@
> +ABI policy:
> + ABI versions are set at the time of major release labeling, and ABI may
> +change multiple times between the last labeling and the HEAD label of the git
> +tree without warning
> +
> + ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle, after it
> +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> +remove it is made during the development of DPDK 1.9. The decision will be
> +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> +1.10 ships.
> +
> + ABI versions may be deprecated in whole, or in part as needed by a given
> +update.
> +
> + Some ABI changes may be too significant to reasonably maintain multiple
> +versions of. In those events ABI's may be updated without backward
> +compatibility provided. The requirements for doing so are:
> + 1) At least 3 acknoweldgements of the need on the dpdk.org
> + 2) A full deprecation cycle must be made to offer downstream consumers
> +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> +the change is proposed, a deprecation notice must be added to this file, and
> +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> +incorporated must be incremented in parallel with the ABI changes themselves
> +
> + Note that the above process for ABI deprecation should not be undertaken
> +lightly. ABI stability is extreemely important for downstream consumers of the
> +DPDK, especially when distributed in shared object form. Every effort should be
> +made to preserve ABI whenever possible. For instance, reorganizing public
> +structure field for astetic or readability purposes should be avoided as it will
astetic? typo?
> +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> +as cause to alter ABI.
> +
> +Deprecation Notices:
Neil, are you sure it's a good idea to put deprecations notices here instead
of release notes?
I'm also thinking that we need to add more things in this doc:
- case of macros/constant deprecation (API only)
- case of structure update: must be renamed to provide ABI compatibility?
Do you think we can have a tool to test the ABI compatibility by building
examples/apps of previous version and checking them with built DSO of
current version?
Thanks
--
Thomas
^ permalink raw reply [relevance 8%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 13:37 4% ` Iremonger, Bernard
@ 2015-01-20 13:46 4% ` Thomas Monjalon
2015-01-20 14:24 4% ` Neil Horman
1 sibling, 0 replies; 200+ results
From: Thomas Monjalon @ 2015-01-20 13:46 UTC (permalink / raw)
To: Iremonger, Bernard; +Cc: dev
2015-01-20 13:37, Iremonger, Bernard:
> Should there be a reference to this document in the programmers guide?
Maybe. You mean that an application developper must be aware of the deprecation
policy? So probably yes.
And I'd add that the release notes should reference the deprecations.
--
Thomas
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 7:14 4% ` Thomas Monjalon
2015-01-20 10:47 4% ` Bruce Richardson
@ 2015-01-20 13:37 4% ` Iremonger, Bernard
2015-01-20 13:46 4% ` Thomas Monjalon
2015-01-20 14:24 4% ` Neil Horman
1 sibling, 2 replies; 200+ results
From: Iremonger, Bernard @ 2015-01-20 13:37 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Tuesday, January 20, 2015 7:15 AM
> To: Neil Horman
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
>
> Thank you Neil for writing this document.
> This is a really important change in DPDK.
> It would be very good to have comments or acknowledgement from several developpers. This policy
> would be enforced by having several Acked-by lines.
>
>
> 2015-01-16 10:33, Neil Horman:
> > Adding a document describing rudimentary ABI policy and adding notice
> > space for any deprecation announcements
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> >
> > ---
> > Change notes:
> >
> > v5) Updated documentation to add notes from Thomas M.
> > ---
> > doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 36 insertions(+)
> > create mode 100644 doc/abi.txt
> >
> > diff --git a/doc/abi.txt b/doc/abi.txt new file mode 100644 index
> > 0000000..14be464
> > --- /dev/null
> > +++ b/doc/abi.txt
> > @@ -0,0 +1,36 @@
> > +ABI policy:
> > + ABI versions are set at the time of major release labeling, and ABI
> > +may change multiple times between the last labeling and the HEAD
> > +label of the git tree without warning
> > +
> > + ABI versions, once released are available until such time as their
> > +deprecation has been noted here for at least one major release cycle,
> > +after it has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and
> > +then the decision to remove it is made during the development of DPDK
> > +1.9. The decision will be recorded here, shipped with the DPDK 1.9
> > +release, and actually removed when DPDK
> > +1.10 ships.
> > +
> > + ABI versions may be deprecated in whole, or in part as needed by a
> > +given update.
> > +
> > + Some ABI changes may be too significant to reasonably maintain
> > +multiple versions of. In those events ABI's may be updated without
> > +backward compatibility provided. The requirements for doing so are:
> > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > + 2) A full deprecation cycle must be made to offer downstream
> > +consumers sufficient warning of the change. E.g. if dpdk 2.0 is
> > +under development when the change is proposed, a deprecation notice
> > +must be added to this file, and released with dpdk 2.0. Then the change may be incorporated for
> dpdk 2.1
> > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes
> > +are incorporated must be incremented in parallel with the ABI changes
> > +themselves
> > +
> > + Note that the above process for ABI deprecation should not be
> > +undertaken lightly. ABI stability is extreemely important for
> > +downstream consumers of the DPDK, especially when distributed in
> > +shared object form. Every effort should be made to preserve ABI
> > +whenever possible. For instance, reorganizing public structure field
> > +for astetic or readability purposes should be avoided as it will
> > +cause ABI breakage. Only significant (e.g. performance) reasons should be seen as cause to alter
> ABI.
Hi Thomas,
Should there be a reference to this document in the programmers guide?
Regards,
Bernard.
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-20 7:14 4% ` Thomas Monjalon
@ 2015-01-20 10:47 4% ` Bruce Richardson
2015-01-20 13:37 4% ` Iremonger, Bernard
1 sibling, 0 replies; 200+ results
From: Bruce Richardson @ 2015-01-20 10:47 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Tue, Jan 20, 2015 at 08:14:50AM +0100, Thomas Monjalon wrote:
> Thank you Neil for writing this document.
> This is a really important change in DPDK.
> It would be very good to have comments or acknowledgement from several
> developpers. This policy would be enforced by having several Acked-by lines.
>
>
> 2015-01-16 10:33, Neil Horman:
> > Adding a document describing rudimentary ABI policy and adding notice space for
> > any deprecation announcements
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
This policy looks sensible to me.
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> >
> > ---
> > Change notes:
> >
> > v5) Updated documentation to add notes from Thomas M.
> > ---
> > doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 36 insertions(+)
> > create mode 100644 doc/abi.txt
> >
> > diff --git a/doc/abi.txt b/doc/abi.txt
> > new file mode 100644
> > index 0000000..14be464
> > --- /dev/null
> > +++ b/doc/abi.txt
> > @@ -0,0 +1,36 @@
> > +ABI policy:
> > + ABI versions are set at the time of major release labeling, and ABI may
> > +change multiple times between the last labeling and the HEAD label of the git
> > +tree without warning
> > +
> > + ABI versions, once released are available until such time as their
> > +deprecation has been noted here for at least one major release cycle, after it
> > +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> > +remove it is made during the development of DPDK 1.9. The decision will be
> > +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> > +1.10 ships.
> > +
> > + ABI versions may be deprecated in whole, or in part as needed by a given
> > +update.
> > +
> > + Some ABI changes may be too significant to reasonably maintain multiple
> > +versions of. In those events ABI's may be updated without backward
> > +compatibility provided. The requirements for doing so are:
> > + 1) At least 3 acknoweldgements of the need on the dpdk.org
> > + 2) A full deprecation cycle must be made to offer downstream consumers
> > +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> > +the change is proposed, a deprecation notice must be added to this file, and
> > +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> > + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> > +incorporated must be incremented in parallel with the ABI changes themselves
> > +
> > + Note that the above process for ABI deprecation should not be undertaken
> > +lightly. ABI stability is extreemely important for downstream consumers of the
> > +DPDK, especially when distributed in shared object form. Every effort should be
> > +made to preserve ABI whenever possible. For instance, reorganizing public
> > +structure field for astetic or readability purposes should be avoided as it will
> > +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> > +as cause to alter ABI.
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-16 15:33 23% ` [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation Neil Horman
@ 2015-01-20 7:14 4% ` Thomas Monjalon
2015-01-20 10:47 4% ` Bruce Richardson
2015-01-20 13:37 4% ` Iremonger, Bernard
2015-01-20 14:00 8% ` Thomas Monjalon
1 sibling, 2 replies; 200+ results
From: Thomas Monjalon @ 2015-01-20 7:14 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Thank you Neil for writing this document.
This is a really important change in DPDK.
It would be very good to have comments or acknowledgement from several
developpers. This policy would be enforced by having several Acked-by lines.
2015-01-16 10:33, Neil Horman:
> Adding a document describing rudimentary ABI policy and adding notice space for
> any deprecation announcements
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
>
> ---
> Change notes:
>
> v5) Updated documentation to add notes from Thomas M.
> ---
> doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
> create mode 100644 doc/abi.txt
>
> diff --git a/doc/abi.txt b/doc/abi.txt
> new file mode 100644
> index 0000000..14be464
> --- /dev/null
> +++ b/doc/abi.txt
> @@ -0,0 +1,36 @@
> +ABI policy:
> + ABI versions are set at the time of major release labeling, and ABI may
> +change multiple times between the last labeling and the HEAD label of the git
> +tree without warning
> +
> + ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle, after it
> +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> +remove it is made during the development of DPDK 1.9. The decision will be
> +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> +1.10 ships.
> +
> + ABI versions may be deprecated in whole, or in part as needed by a given
> +update.
> +
> + Some ABI changes may be too significant to reasonably maintain multiple
> +versions of. In those events ABI's may be updated without backward
> +compatibility provided. The requirements for doing so are:
> + 1) At least 3 acknoweldgements of the need on the dpdk.org
> + 2) A full deprecation cycle must be made to offer downstream consumers
> +sufficient warning of the change. E.g. if dpdk 2.0 is under development when
> +the change is proposed, a deprecation notice must be added to this file, and
> +released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
> + 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
> +incorporated must be incremented in parallel with the ABI changes themselves
> +
> + Note that the above process for ABI deprecation should not be undertaken
> +lightly. ABI stability is extreemely important for downstream consumers of the
> +DPDK, especially when distributed in shared object form. Every effort should be
> +made to preserve ABI whenever possible. For instance, reorganizing public
> +structure field for astetic or readability purposes should be avoided as it will
> +cause ABI breakage. Only significant (e.g. performance) reasons should be seen
> +as cause to alter ABI.
^ permalink raw reply [relevance 4%]
* [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation
2015-01-16 15:33 3% ` [dpdk-dev] [PATCH v5 " Neil Horman
2015-01-16 15:33 7% ` [dpdk-dev] [PATCH v5 3/4] Add library version extenstion Neil Horman
@ 2015-01-16 15:33 23% ` Neil Horman
2015-01-20 7:14 4% ` Thomas Monjalon
2015-01-20 14:00 8% ` Thomas Monjalon
1 sibling, 2 replies; 200+ results
From: Neil Horman @ 2015-01-16 15:33 UTC (permalink / raw)
To: dev
Adding a document describing rudimentary ABI policy and adding notice space for
any deprecation announcements
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
Change notes:
v5) Updated documentation to add notes from Thomas M.
---
doc/abi.txt | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 doc/abi.txt
diff --git a/doc/abi.txt b/doc/abi.txt
new file mode 100644
index 0000000..14be464
--- /dev/null
+++ b/doc/abi.txt
@@ -0,0 +1,36 @@
+ABI policy:
+ ABI versions are set at the time of major release labeling, and ABI may
+change multiple times between the last labeling and the HEAD label of the git
+tree without warning
+
+ ABI versions, once released are available until such time as their
+deprecation has been noted here for at least one major release cycle, after it
+has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
+remove it is made during the development of DPDK 1.9. The decision will be
+recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
+1.10 ships.
+
+ ABI versions may be deprecated in whole, or in part as needed by a given
+update.
+
+ Some ABI changes may be too significant to reasonably maintain multiple
+versions of. In those events ABI's may be updated without backward
+compatibility provided. The requirements for doing so are:
+ 1) At least 3 acknoweldgements of the need on the dpdk.org
+ 2) A full deprecation cycle must be made to offer downstream consumers
+sufficient warning of the change. E.g. if dpdk 2.0 is under development when
+the change is proposed, a deprecation notice must be added to this file, and
+released with dpdk 2.0. Then the change may be incorporated for dpdk 2.1
+ 3) The LIBABIVER variable in the makefilei(s) where the ABI changes are
+incorporated must be incremented in parallel with the ABI changes themselves
+
+ Note that the above process for ABI deprecation should not be undertaken
+lightly. ABI stability is extreemely important for downstream consumers of the
+DPDK, especially when distributed in shared object form. Every effort should be
+made to preserve ABI whenever possible. For instance, reorganizing public
+structure field for astetic or readability purposes should be avoided as it will
+cause ABI breakage. Only significant (e.g. performance) reasons should be seen
+as cause to alter ABI.
+
+Deprecation Notices:
+
--
2.1.0
^ permalink raw reply [relevance 23%]
* [dpdk-dev] [PATCH v5 3/4] Add library version extenstion
2015-01-16 15:33 3% ` [dpdk-dev] [PATCH v5 " Neil Horman
@ 2015-01-16 15:33 7% ` Neil Horman
2015-01-16 15:33 23% ` [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation Neil Horman
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2015-01-16 15:33 UTC (permalink / raw)
To: dev
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken. This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
Change Notes:
v3)
Made symlinking of libraries conditional on a DSO build
v4) Removed erroneous newline
changed @exit 1 to @false
changed ./$(LIB) to $<
---
lib/librte_acl/Makefile | 2 ++
lib/librte_cfgfile/Makefile | 2 ++
lib/librte_cmdline/Makefile | 2 ++
lib/librte_compat/Makefile | 2 ++
lib/librte_distributor/Makefile | 2 ++
lib/librte_eal/bsdapp/eal/Makefile | 2 ++
lib/librte_eal/linuxapp/eal/Makefile | 2 ++
lib/librte_ether/Makefile | 2 ++
lib/librte_hash/Makefile | 2 ++
lib/librte_ip_frag/Makefile | 2 ++
lib/librte_ivshmem/Makefile | 2 ++
lib/librte_kni/Makefile | 2 ++
lib/librte_kvargs/Makefile | 2 ++
lib/librte_lpm/Makefile | 2 ++
lib/librte_malloc/Makefile | 2 ++
lib/librte_mbuf/Makefile | 2 ++
lib/librte_mempool/Makefile | 2 ++
lib/librte_meter/Makefile | 2 ++
lib/librte_pipeline/Makefile | 2 ++
lib/librte_pmd_af_packet/Makefile | 2 ++
lib/librte_pmd_bond/Makefile | 2 ++
lib/librte_pmd_e1000/Makefile | 2 ++
lib/librte_pmd_enic/Makefile | 2 ++
lib/librte_pmd_i40e/Makefile | 2 ++
lib/librte_pmd_ixgbe/Makefile | 2 ++
lib/librte_pmd_pcap/Makefile | 2 ++
lib/librte_pmd_ring/Makefile | 2 ++
lib/librte_pmd_virtio/Makefile | 2 ++
lib/librte_pmd_vmxnet3/Makefile | 2 ++
lib/librte_pmd_xenvirt/Makefile | 2 ++
lib/librte_port/Makefile | 2 ++
lib/librte_power/Makefile | 2 ++
lib/librte_ring/Makefile | 2 ++
lib/librte_sched/Makefile | 2 ++
lib/librte_table/Makefile | 2 ++
lib/librte_timer/Makefile | 2 ++
lib/librte_vhost/Makefile | 2 ++
mk/rte.lib.mk | 12 ++++++++++--
38 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 45cbf80..765deb1 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_acl_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index a4f73de..032c240 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_cfgfile_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 3c71831..719dff6 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_cmdline_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
index 0bab870..0c57533 100644
--- a/lib/librte_compat/Makefile
+++ b/lib/librte_compat/Makefile
@@ -32,6 +32,8 @@
include $(RTE_SDK)/mk/rte.vars.mk
+LIBABIVER := 1
+
# install includes
SYMLINK-y-include := rte_compat.h
diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
index 3674a2c..4c9af17 100644
--- a/lib/librte_distributor/Makefile
+++ b/lib/librte_distributor/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_distributor_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index 0b5f9d9..ae214a4 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -48,6 +48,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
# specific to linuxapp exec-env
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index bae8af1..e117cec 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -35,6 +35,8 @@ LIB = librte_eal.a
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
VPATH += $(RTE_SDK)/lib/librte_eal/common
CFLAGS += -I$(SRCDIR)/include
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 80ad78d..c0e5768 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_ether_version.map
+LIBABIVER := 1
+
SRCS-y += rte_ethdev.c
#
diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
index bec61ab..3696cb1 100644
--- a/lib/librte_hash/Makefile
+++ b/lib/librte_hash/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_hash_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index aa88578..fe926f7 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_ipfrag_version.map
+LIBABIVER := 1
+
#source files
ifeq ($(CONFIG_RTE_MBUF_REFCNT),y)
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
index 068ee10..16defdb 100644
--- a/lib/librte_ivshmem/Makefile
+++ b/lib/librte_ivshmem/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ivshmem_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index 93a516d..7107832 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_kni_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
index b1c34f3..87b09f2 100644
--- a/lib/librte_kvargs/Makefile
+++ b/lib/librte_kvargs/Makefile
@@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_kvargs_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
index 8214630..35e6389 100644
--- a/lib/librte_lpm/Makefile
+++ b/lib/librte_lpm/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_lpm_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
index 15b7eed..947e41c 100644
--- a/lib/librte_malloc/Makefile
+++ b/lib/librte_malloc/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_malloc.a
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_malloc_version.map
diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
index 03becae..080f3cf 100644
--- a/lib/librte_mbuf/Makefile
+++ b/lib/librte_mbuf/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mbuf_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
index 31d1a71..940d1f7 100644
--- a/lib/librte_mempool/Makefile
+++ b/lib/librte_mempool/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mempool_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index c4a7a32..8765881 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_meter_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 15b58df..15e406b 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pipeline_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_af_packet/Makefile b/lib/librte_pmd_af_packet/Makefile
index 85a7860..f0bf537 100644
--- a/lib/librte_pmd_af_packet/Makefile
+++ b/lib/librte_pmd_af_packet/Makefile
@@ -40,6 +40,8 @@ LIB = librte_pmd_af_packet.a
EXPORT_MAP := rte_pmd_af_packet_version.map
+LIBABIVER := 1
+
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 074110a..d6c81a8 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_bond_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
index cd14444..8c8fed8 100644
--- a/lib/librte_pmd_e1000/Makefile
+++ b/lib/librte_pmd_e1000/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_e1000_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile
index 697231c..251a898 100644
--- a/lib/librte_pmd_enic/Makefile
+++ b/lib/librte_pmd_enic/Makefile
@@ -39,6 +39,8 @@ LIB = librte_pmd_enic.a
EXPORT_MAP := rte_pmd_enic_version.map
+LIBABIVER := 1
+
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/
CFLAGS += -O3
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index 73de373..9a0eec8 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_i40e_version.map
+LIBABIVER := 1
+
#
# Add extra flags for base driver files (also known as shared code)
# to disable warnings
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index e0a17f6..d580f62 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_ixgbe_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
index cb6678e..0775dbc 100644
--- a/lib/librte_pmd_pcap/Makefile
+++ b/lib/librte_pmd_pcap/Makefile
@@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_pcap_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
index aa1b461..e442d0b 100644
--- a/lib/librte_pmd_ring/Makefile
+++ b/lib/librte_pmd_ring/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_ring_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
index d979c59..793067f 100644
--- a/lib/librte_pmd_virtio/Makefile
+++ b/lib/librte_pmd_virtio/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_virtio_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index f3ab178..93e5580 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
EXPORT_MAP := rte_pmd_vmxnet3_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
index 4510603..f0c796c 100644
--- a/lib/librte_pmd_xenvirt/Makefile
+++ b/lib/librte_pmd_xenvirt/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_xenvirt_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 266ed39..0e38452 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_port_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index 0547dcd..cee95cd 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_power_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c rte_power_acpi_cpufreq.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c
diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
index b437dc5..84ad3d3 100644
--- a/lib/librte_ring/Makefile
+++ b/lib/librte_ring/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ring_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 48f280a..b1cb285 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
EXPORT_MAP := rte_sched_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
index 4e1a54a..0d8394c 100644
--- a/lib/librte_table/Makefile
+++ b/lib/librte_table/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_table_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
index 9fb6079..2aabef8 100644
--- a/lib/librte_timer/Makefile
+++ b/lib/librte_timer/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_timer_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 96a7dd0..369c25a 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -36,6 +36,8 @@ LIB = librte_vhost.a
EXPORT_MAP := rte_vhost_version.map
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse
LDFLAGS += -lfuse
# all source are stored in SRCS-y
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 1d3b646..865a307 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -37,10 +37,9 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
-
ifeq ($(RTE_BUILD_SHARED_LIB),y)
-LIB := $(patsubst %.a,%.so,$(LIB))
+LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
endif
@@ -113,6 +112,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
#
ifeq ($(RTE_BUILD_SHARED_LIB),y)
$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
+ifeq ($(LIBABIVER),)
+ @echo "Must Specify a $(LIB) ABI version"
+ @false
+endif
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(if $(D),\
@echo -n "$< -> $@ " ; \
@@ -126,6 +129,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
$(depfile_missing),\
$(depfile_newer)),\
$(O_TO_S_DO))
+
ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
$(if $(or \
$(file_missing),\
@@ -163,9 +167,13 @@ endif
# install lib in $(RTE_OUTPUT)/lib
#
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
+ $(eval LIBSONAME := $(basename $(LIB)))
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+ifeq ($(RTE_BUILD_SHARED_LIB),y)
+ $(Q)ln -s -f $< $(RTE_OUTPUT)/lib/$(LIBSONAME)
+endif
#
# Clean all generated files
--
2.1.0
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH v5 1/4] compat: Add infrastructure to support symbol versioning
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (6 preceding siblings ...)
2015-01-15 19:35 3% ` [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2015-01-16 15:33 3% ` Neil Horman
2015-01-16 15:33 7% ` [dpdk-dev] [PATCH v5 3/4] Add library version extenstion Neil Horman
2015-01-16 15:33 23% ` [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation Neil Horman
2015-01-20 21:17 3% ` [dpdk-dev] [PATCH v6 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
` (4 subsequent siblings)
12 siblings, 2 replies; 200+ results
From: Neil Horman @ 2015-01-16 15:33 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
---
Change Notes:
V2)
Moved ifeq to _INSTALL target
V3)
Undo V2 changes and make librte_compat use the rte.install.mk file
instead
v4)
changed --version-script to accept SRCDIR in this patch at per request
documented versioning macros
cleaned up macro parameter consistency
converted SA macro to RTE_STR macro
fixed copyright
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++
lib/librte_compat/rte_compat.h | 117 +++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 4 ++
4 files changed, 160 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 0ffc982..d617d81 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,6 +31,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..0bab870
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2013 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.install.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..d7cc176
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,117 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+#include <rte_common.h>
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. To support that, the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ * char foo(int value, int otherval) { ...}
+ *
+ * 5) Mark the newest version as the default version
+ * BIND_DEFAULT_SYMBOL(foo, 1.9);
+ *
+ */
+
+/*
+ * Macro Parameters:
+ * b - function base name
+ * e - function version extension, to be concatenated with base name
+ * n - function symbol version string to be applied
+ */
+
+/*
+ * VERSION_SYMBOL
+ * Creates a symbol version table entry binding symbol <b>@DPDK_<n> to the internal
+ * function name <b>_<e>
+ */
+#define VERSION_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@DPDK_"RTE_STR(n))
+
+/*
+ * BASE_SYMBOL
+ * Creates a symbol version table entry binding unversioned symbol <b>
+ * to the internal function <b>_<e>
+ */
+#define BASE_SYMBOL(b, e) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@")
+
+/*
+ * BNID_DEFAULT_SYMBOL
+ * Creates a symbol version entry instructing the linker to bind references to
+ * symbol <b> to the internal symbol <b>_<e>
+ */
+#define BIND_DEFAULT_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@@DPDK_"RTE_STR(n))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+#define BASE_SYMBOL(b, n)
+#define BIND_DEFAULT_SYMBOL(b, v)
+
+/*
+ * RTE_BUILD_SHARED_LIB=n
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 81bf8e1..1d3b646 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
--
2.1.0
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation
2015-01-14 20:07 7% ` Neil Horman
@ 2015-01-16 13:34 7% ` Thomas Monjalon
0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2015-01-16 13:34 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2015-01-14 15:07, Neil Horman:
> On Wed, Jan 14, 2015 at 04:59:51PM +0100, Thomas Monjalon wrote:
> > 2014-12-23 10:51, Neil Horman:
> > > Adding a document describing rudimentary ABI policy and adding notice space for
> > > any deprecation announcements
> >
> > We had a good discussion about the policy and its impact:
> > http://thread.gmane.org/gmane.comp.networking.dpdk.devel/8367/focus=8461
> > Sadly nobody else discussed it.
> > I think we should integrate some of the conclusions in this documentation.
> >
> I'm certainly open to that. However, I felt like that conversation centered
> more around the debate for the need for ABI versioning, not the mechanics
> thereof. Are there specific sections of that conversation that you are looking
> to incorporate, or specific topics?
Yes.
In the point number 2, you suggest to skip ABI compatibility (after a
deprecation schedule) for big changes.
In the point 3, you suggest to add new fields at the end of the structure,
even if it's asthetic, with exceptions if performance impact.
Thank you
--
Thomas
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH v4 4/4] docs: Add ABI documentation
2015-01-15 19:35 3% ` [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2015-01-15 19:35 7% ` [dpdk-dev] [PATCH v4 3/4] Add library version extenstion Neil Horman
@ 2015-01-15 19:35 23% ` Neil Horman
2015-01-30 17:13 3% ` [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning Gray, Mark D
2 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-01-15 19:35 UTC (permalink / raw)
To: dev
Adding a document describing rudimentary ABI policy and adding notice space for
any deprecation announcements
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
doc/abi.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 doc/abi.txt
diff --git a/doc/abi.txt b/doc/abi.txt
new file mode 100644
index 0000000..b6dcc7d
--- /dev/null
+++ b/doc/abi.txt
@@ -0,0 +1,17 @@
+ABI policy:
+ ABI versions are set at the time of major release labeling, and ABI may
+change multiple times between the last labeling and the HEAD label of the git
+tree without warning
+
+ ABI versions, once released are available until such time as their
+deprecation has been noted here for at least one major release cycle, after it
+has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
+remove it is made during the development of DPDK 1.9. The decision will be
+recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
+1.10 ships.
+
+ ABI versions may be deprecated in whole, or in part as needed by a given
+update.
+
+Deprecation Notices:
+
--
2.1.0
^ permalink raw reply [relevance 23%]
* [dpdk-dev] [PATCH v4 3/4] Add library version extenstion
2015-01-15 19:35 3% ` [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2015-01-15 19:35 7% ` Neil Horman
2015-01-15 19:35 23% ` [dpdk-dev] [PATCH v4 4/4] docs: Add ABI documentation Neil Horman
2015-01-30 17:13 3% ` [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning Gray, Mark D
2 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-01-15 19:35 UTC (permalink / raw)
To: dev
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken. This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
Change Notes:
v3)
Made symlinking of libraries conditional on a DSO build
v4) Removed erroneous newline
changed @exit 1 to @false
changed ./$(LIB) to $<
---
lib/librte_acl/Makefile | 2 ++
lib/librte_cfgfile/Makefile | 2 ++
lib/librte_cmdline/Makefile | 2 ++
lib/librte_compat/Makefile | 2 ++
lib/librte_distributor/Makefile | 2 ++
lib/librte_eal/bsdapp/eal/Makefile | 2 ++
lib/librte_eal/linuxapp/eal/Makefile | 2 ++
lib/librte_ether/Makefile | 2 ++
lib/librte_hash/Makefile | 2 ++
lib/librte_ip_frag/Makefile | 2 ++
lib/librte_ivshmem/Makefile | 2 ++
lib/librte_kni/Makefile | 2 ++
lib/librte_kvargs/Makefile | 2 ++
lib/librte_lpm/Makefile | 2 ++
lib/librte_malloc/Makefile | 2 ++
lib/librte_mbuf/Makefile | 2 ++
lib/librte_mempool/Makefile | 2 ++
lib/librte_meter/Makefile | 2 ++
lib/librte_pipeline/Makefile | 2 ++
lib/librte_pmd_af_packet/Makefile | 2 ++
lib/librte_pmd_bond/Makefile | 2 ++
lib/librte_pmd_e1000/Makefile | 2 ++
lib/librte_pmd_enic/Makefile | 2 ++
lib/librte_pmd_i40e/Makefile | 2 ++
lib/librte_pmd_ixgbe/Makefile | 2 ++
lib/librte_pmd_pcap/Makefile | 2 ++
lib/librte_pmd_ring/Makefile | 2 ++
lib/librte_pmd_virtio/Makefile | 2 ++
lib/librte_pmd_vmxnet3/Makefile | 2 ++
lib/librte_pmd_xenvirt/Makefile | 2 ++
lib/librte_port/Makefile | 2 ++
lib/librte_power/Makefile | 2 ++
lib/librte_ring/Makefile | 2 ++
lib/librte_sched/Makefile | 2 ++
lib/librte_table/Makefile | 2 ++
lib/librte_timer/Makefile | 2 ++
lib/librte_vhost/Makefile | 2 ++
mk/rte.lib.mk | 12 ++++++++++--
38 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 45cbf80..765deb1 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_acl_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index a4f73de..032c240 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_cfgfile_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 3c71831..719dff6 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_cmdline_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
index 0bab870..0c57533 100644
--- a/lib/librte_compat/Makefile
+++ b/lib/librte_compat/Makefile
@@ -32,6 +32,8 @@
include $(RTE_SDK)/mk/rte.vars.mk
+LIBABIVER := 1
+
# install includes
SYMLINK-y-include := rte_compat.h
diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
index 3674a2c..4c9af17 100644
--- a/lib/librte_distributor/Makefile
+++ b/lib/librte_distributor/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_distributor_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index 0b5f9d9..ae214a4 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -48,6 +48,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
# specific to linuxapp exec-env
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index bae8af1..e117cec 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -35,6 +35,8 @@ LIB = librte_eal.a
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
VPATH += $(RTE_SDK)/lib/librte_eal/common
CFLAGS += -I$(SRCDIR)/include
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 80ad78d..c0e5768 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_ether_version.map
+LIBABIVER := 1
+
SRCS-y += rte_ethdev.c
#
diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
index bec61ab..3696cb1 100644
--- a/lib/librte_hash/Makefile
+++ b/lib/librte_hash/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_hash_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index aa88578..fe926f7 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_ipfrag_version.map
+LIBABIVER := 1
+
#source files
ifeq ($(CONFIG_RTE_MBUF_REFCNT),y)
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
index 068ee10..16defdb 100644
--- a/lib/librte_ivshmem/Makefile
+++ b/lib/librte_ivshmem/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ivshmem_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index 93a516d..7107832 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_kni_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
index b1c34f3..87b09f2 100644
--- a/lib/librte_kvargs/Makefile
+++ b/lib/librte_kvargs/Makefile
@@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_kvargs_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
index 8214630..35e6389 100644
--- a/lib/librte_lpm/Makefile
+++ b/lib/librte_lpm/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_lpm_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
index 15b7eed..947e41c 100644
--- a/lib/librte_malloc/Makefile
+++ b/lib/librte_malloc/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_malloc.a
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_malloc_version.map
diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
index 03becae..080f3cf 100644
--- a/lib/librte_mbuf/Makefile
+++ b/lib/librte_mbuf/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mbuf_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
index 31d1a71..940d1f7 100644
--- a/lib/librte_mempool/Makefile
+++ b/lib/librte_mempool/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mempool_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index c4a7a32..8765881 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_meter_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 15b58df..15e406b 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pipeline_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_af_packet/Makefile b/lib/librte_pmd_af_packet/Makefile
index 85a7860..f0bf537 100644
--- a/lib/librte_pmd_af_packet/Makefile
+++ b/lib/librte_pmd_af_packet/Makefile
@@ -40,6 +40,8 @@ LIB = librte_pmd_af_packet.a
EXPORT_MAP := rte_pmd_af_packet_version.map
+LIBABIVER := 1
+
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 074110a..d6c81a8 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_bond_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
index cd14444..8c8fed8 100644
--- a/lib/librte_pmd_e1000/Makefile
+++ b/lib/librte_pmd_e1000/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_e1000_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile
index 697231c..251a898 100644
--- a/lib/librte_pmd_enic/Makefile
+++ b/lib/librte_pmd_enic/Makefile
@@ -39,6 +39,8 @@ LIB = librte_pmd_enic.a
EXPORT_MAP := rte_pmd_enic_version.map
+LIBABIVER := 1
+
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/
CFLAGS += -O3
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index 73de373..9a0eec8 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_i40e_version.map
+LIBABIVER := 1
+
#
# Add extra flags for base driver files (also known as shared code)
# to disable warnings
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index e0a17f6..d580f62 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_ixgbe_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
index cb6678e..0775dbc 100644
--- a/lib/librte_pmd_pcap/Makefile
+++ b/lib/librte_pmd_pcap/Makefile
@@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_pcap_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
index aa1b461..e442d0b 100644
--- a/lib/librte_pmd_ring/Makefile
+++ b/lib/librte_pmd_ring/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_ring_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
index d979c59..793067f 100644
--- a/lib/librte_pmd_virtio/Makefile
+++ b/lib/librte_pmd_virtio/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_virtio_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index f3ab178..93e5580 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
EXPORT_MAP := rte_pmd_vmxnet3_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
index 4510603..f0c796c 100644
--- a/lib/librte_pmd_xenvirt/Makefile
+++ b/lib/librte_pmd_xenvirt/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_xenvirt_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 266ed39..0e38452 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_port_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index 0547dcd..cee95cd 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_power_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c rte_power_acpi_cpufreq.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c
diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
index b437dc5..84ad3d3 100644
--- a/lib/librte_ring/Makefile
+++ b/lib/librte_ring/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ring_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 48f280a..b1cb285 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
EXPORT_MAP := rte_sched_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
index 4e1a54a..0d8394c 100644
--- a/lib/librte_table/Makefile
+++ b/lib/librte_table/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_table_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
index 9fb6079..2aabef8 100644
--- a/lib/librte_timer/Makefile
+++ b/lib/librte_timer/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_timer_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 96a7dd0..369c25a 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -36,6 +36,8 @@ LIB = librte_vhost.a
EXPORT_MAP := rte_vhost_version.map
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse
LDFLAGS += -lfuse
# all source are stored in SRCS-y
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 1d3b646..865a307 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -37,10 +37,9 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
-
ifeq ($(RTE_BUILD_SHARED_LIB),y)
-LIB := $(patsubst %.a,%.so,$(LIB))
+LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
endif
@@ -113,6 +112,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
#
ifeq ($(RTE_BUILD_SHARED_LIB),y)
$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
+ifeq ($(LIBABIVER),)
+ @echo "Must Specify a $(LIB) ABI version"
+ @false
+endif
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(if $(D),\
@echo -n "$< -> $@ " ; \
@@ -126,6 +129,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
$(depfile_missing),\
$(depfile_newer)),\
$(O_TO_S_DO))
+
ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
$(if $(or \
$(file_missing),\
@@ -163,9 +167,13 @@ endif
# install lib in $(RTE_OUTPUT)/lib
#
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
+ $(eval LIBSONAME := $(basename $(LIB)))
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+ifeq ($(RTE_BUILD_SHARED_LIB),y)
+ $(Q)ln -s -f $< $(RTE_OUTPUT)/lib/$(LIBSONAME)
+endif
#
# Clean all generated files
--
2.1.0
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (5 preceding siblings ...)
2015-01-09 12:35 0% ` [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
@ 2015-01-15 19:35 3% ` Neil Horman
2015-01-15 19:35 7% ` [dpdk-dev] [PATCH v4 3/4] Add library version extenstion Neil Horman
` (2 more replies)
2015-01-16 15:33 3% ` [dpdk-dev] [PATCH v5 " Neil Horman
` (5 subsequent siblings)
12 siblings, 3 replies; 200+ results
From: Neil Horman @ 2015-01-15 19:35 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
---
Change Notes:
V2)
Moved ifeq to _INSTALL target
V3)
Undo V2 changes and make librte_compat use the rte.install.mk file
instead
v4)
changed --version-script to accept SRCDIR in this patch at per request
documented versioning macros
cleaned up macro parameter consistency
converted SA macro to RTE_STR macro
fixed copyright
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++
lib/librte_compat/rte_compat.h | 117 +++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 4 ++
4 files changed, 160 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 0ffc982..d617d81 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,6 +31,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..0bab870
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2013 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.install.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..d7cc176
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,117 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+#include <rte_common.h>
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. To support that, the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ * char foo(int value, int otherval) { ...}
+ *
+ * 5) Mark the newest version as the default version
+ * BIND_DEFAULT_SYMBOL(foo, 1.9);
+ *
+ */
+
+/*
+ * Macro Parameters:
+ * b - function base name
+ * e - function version extension, to be concatenated with base name
+ * n - function symbol version string to be applied
+ */
+
+/*
+ * VERSION_SYMBOL
+ * Creates a symbol version table entry binding symbol <b>@DPDK_<n> to the internal
+ * function name <b>_<e>
+ */
+#define VERSION_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@DPDK_"RTE_STR(n))
+
+/*
+ * BASE_SYMBOL
+ * Creates a symbol version table entry binding unversioned symbol <b>
+ * to the internal function <b>_<e>
+ */
+#define BASE_SYMBOL(b, e) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@")
+
+/*
+ * BNID_DEFAULT_SYMBOL
+ * Creates a symbol version entry instructing the linker to bind references to
+ * symbol <b> to the internal symbol <b>_<e>
+ */
+#define BIND_DEFAULT_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", "RTE_STR(b)"@@DPDK_"RTE_STR(n))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+#define BASE_SYMBOL(b, n)
+#define BIND_DEFAULT_SYMBOL(b, v)
+
+/*
+ * RTE_BUILD_SHARED_LIB=n
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 81bf8e1..1d3b646 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
--
2.1.0
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning
2015-01-14 15:25 0% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Thomas Monjalon
@ 2015-01-14 20:29 0% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-01-14 20:29 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Wed, Jan 14, 2015 at 04:25:19PM +0100, Thomas Monjalon wrote:
> Hi Neil,
>
> 2014-12-23 10:51, Neil Horman:
> > Add initial pass header files to support symbol versioning.
>
> [...]
>
> > +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
>
> Why these dates?
>
Because I copied the Makefile from librte_acl, and modified the name but not the
dates.
> > +# All rights reserved.
>
> I think this line is not required anymore:
> http://en.wikipedia.org/wiki/All_rights_reserved
>
Hmm, apparently so. However, since it exists in every other copyright notice in
the tree, I'd just as soon keep this language consistent, and make a tree wide
change in a separate patch if the consensus is to do so.
> [...]
>
> > +#ifndef _RTE_COMPAT_H_
> > +#define _RTE_COMPAT_H_
>
> Why using underscores?
> I think it's reserved:
> http://en.wikipedia.org/wiki/Include_guard#Use_of_.23include_guards
>
Its reserved for the implementation, and must not be used by a user using the
header file. Its ok, and is common practice. See every other symlinked header
file in the DPDK.
> > +#define SA(x) #x
>
> It should be prefixed. But it's better to use RTE_STR.
>
very well
> > +#ifdef RTE_BUILD_SHARED_LIB
> > +
> > +/*
> > + * Provides backwards compatibility when updating exported functions.
> > + * When a symol is exported from a library to provide an API, it also provides a
> > + * calling convention (ABI) that is embodied in its name, return type,
> > + * arguments, etc. On occasion that function may need to change to accomodate
> > + * new functionality, behavior, etc. When that occurs, it is desireable to
> > + * allow for backwards compatibility for a time with older binaries that are
> > + * dynamically linked to the dpdk. to support that the __vsym and
>
> Should be "To support that," with uppercase and comma.
>
yup
> > + * VERSION_SYMBOL macros are created. They, in conjunction with the
> > + * <library>_version.map file for a given library allow for multiple versions of
> > + * a symbol to exist in a shared library so that older binaries need not be
> > + * immediately recompiled. Their use is outlined in the following example:
> > + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> > + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> > + *
> > + * To accomplish this:
> > + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> > + * foo is exported as a global symbol.
> > + *
> > + * 2) rename the existing function int foo(char *string) to
> > + * int __vsym foo_v18(char *string)
> > + *
> > + * 3) Add this macro immediately below the function
> > + * VERSION_SYMBOL(foo, _v18, 1.8);
> > + *
> > + * 4) Implement a new version of foo.
> > + * char foo(int value, int otherval) { ...}
> > + *
> > + * 5) Mark the newest version as the default version
> > + * BIND_DEFAULT_SYMBOL(foo, 1.9);
> > + *
> > + */
>
> Thanks for this good tutorial.
>
> > +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> > +#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
> > +#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
> > +#define __vsym __attribute__((used))
>
> OK. It would be simpler to read if b, e, v and n were formally defined in a comment.
>
> > +#else
> [...]
> > +/*
> > + * RTE_BUILD_SHARED_LIB
> > + */
>
> This type of comment is strange. It makes me think that we are in the case
> RTE_BUILD_SHARED_LIB=y
>
> > +#endif
>
> [...]
>
> > +
> > +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
>
> Why this variable name? VERSION_SCRIPT or VERSION_MAP seems more appropriate.
>
> > +
> > endif
> >
> > +
>
> Why this newline?
>
> > _BUILD = $(LIB)
>
> --
> Thomas
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation
2015-01-14 15:59 4% ` Thomas Monjalon
@ 2015-01-14 20:07 7% ` Neil Horman
2015-01-16 13:34 7% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2015-01-14 20:07 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Wed, Jan 14, 2015 at 04:59:51PM +0100, Thomas Monjalon wrote:
> 2014-12-23 10:51, Neil Horman:
> > Adding a document describing rudimentary ABI policy and adding notice space for
> > any deprecation announcements
>
> We had a good discussion about the policy and its impact:
> http://thread.gmane.org/gmane.comp.networking.dpdk.devel/8367/focus=8461
> Sadly nobody else discussed it.
> I think we should integrate some of the conclusions in this documentation.
>
I'm certainly open to that. However, I felt like that conversation centered
more around the debate for the need for ABI versioning, not the mechanics
thereof. Are there specific sections of that conversation that you are looking
to incorporate, or specific topics?
> > --- /dev/null
> > +++ b/doc/abi.txt
> > @@ -0,0 +1,17 @@
> > +ABI policy:
> > + ABI versions are set at the time of major release labeling, and ABI may
> > +change multiple times between the last labeling and the HEAD label of the git
> > +tree without warning
> > +
> > + ABI versions, once released are available until such time as their
> > +deprecation has been noted here for at least one major release cycle, after it
> > +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> > +remove it is made during the development of DPDK 1.9. The decision will be
> > +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> > +1.10 ships.
> > +
> > + ABI versions may be deprecated in whole, or in part as needed by a given
> > +update.
> > +
> > +Deprecation Notices:
> > +
>
> You could upgrade your example to 2.0/2.1.
>
Sure, though I think doing so is rather arbitrary, as its going to be
immediately dated as soon as version 2.1 releases. But I can do that if you
like when we square up the documentation question above
Neil
> Thanks
> --
> Thomas
>
^ permalink raw reply [relevance 7%]
* Re: [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation
2014-12-23 15:51 23% ` [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation Neil Horman
2014-12-29 16:24 4% ` Sergio Gonzalez Monroy
@ 2015-01-14 15:59 4% ` Thomas Monjalon
2015-01-14 20:07 7% ` Neil Horman
1 sibling, 1 reply; 200+ results
From: Thomas Monjalon @ 2015-01-14 15:59 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2014-12-23 10:51, Neil Horman:
> Adding a document describing rudimentary ABI policy and adding notice space for
> any deprecation announcements
We had a good discussion about the policy and its impact:
http://thread.gmane.org/gmane.comp.networking.dpdk.devel/8367/focus=8461
Sadly nobody else discussed it.
I think we should integrate some of the conclusions in this documentation.
> --- /dev/null
> +++ b/doc/abi.txt
> @@ -0,0 +1,17 @@
> +ABI policy:
> + ABI versions are set at the time of major release labeling, and ABI may
> +change multiple times between the last labeling and the HEAD label of the git
> +tree without warning
> +
> + ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle, after it
> +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> +remove it is made during the development of DPDK 1.9. The decision will be
> +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> +1.10 ships.
> +
> + ABI versions may be deprecated in whole, or in part as needed by a given
> +update.
> +
> +Deprecation Notices:
> +
You could upgrade your example to 2.0/2.1.
Thanks
--
Thomas
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v3 3/4] Add library version extenstion
2014-12-23 15:51 7% ` [dpdk-dev] [PATCH v3 3/4] Add library version extenstion Neil Horman
2014-12-29 16:23 0% ` Sergio Gonzalez Monroy
@ 2015-01-14 15:48 0% ` Thomas Monjalon
1 sibling, 0 replies; 200+ results
From: Thomas Monjalon @ 2015-01-14 15:48 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2014-12-23 10:51, Neil Horman:
> To differentiate libraries that break ABI, we add a library version number
> suffix to the library, which must be incremented when a given libraries ABI is
> broken. This patch enforces that addition, sets the initial abi soname
> extension to 1 for each library and creates a symlink to the base SONAME so that
> the test applications will link properly.
[...]
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -37,10 +37,9 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
>
> # VPATH contains at least SRCDIR
> VPATH += $(SRCDIR)
> -
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> -LIB := $(patsubst %.a,%.so,$(LIB))
>
> +LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
> CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
>
> endif
> @@ -63,6 +62,7 @@ build: _postbuild
>
> exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
>
> +
Newline changes seem weird.
> ifeq ($(LINK_USING_CC),1)
> # Override the definition of LD here, since we're linking with CC
> LD := $(CC) $(CPU_CFLAGS)
> @@ -113,6 +113,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
> #
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
> +ifeq ($(LIBABIVER),)
> + @echo "Must Specify a $(LIB) ABI version"
> + @exit 1
I think (not sure) that @false is better handled than @exit in case of parallel processing.
> +endif
> @[ -d $(dir $@) ] || mkdir -p $(dir $@)
> $(if $(D),\
> @echo -n "$< -> $@ " ; \
> @@ -126,6 +130,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
> $(depfile_missing),\
> $(depfile_newer)),\
> $(O_TO_S_DO))
> +
> ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
> $(if $(or \
> $(file_missing),\
> @@ -163,9 +168,13 @@ endif
> # install lib in $(RTE_OUTPUT)/lib
> #
> $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> + $(eval LIBSONAME := $(basename $(LIB)))
> @echo " INSTALL-LIB $(LIB)"
> @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> +ifeq ($(RTE_BUILD_SHARED_LIB),y)
> + $(Q)ln -s -f ./$(LIB) $(RTE_OUTPUT)/lib/$(LIBSONAME)
> +endif
Why using ./ ?
Why using the eval trick for $(LIBSONAME) instead of $(basename $(LIB)) ?
Even better, you could use $< instead of $(LIB), matter of taste.
--
Thomas
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning
2014-12-23 15:51 4% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-12-23 15:51 7% ` [dpdk-dev] [PATCH v3 3/4] Add library version extenstion Neil Horman
2014-12-23 15:51 23% ` [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation Neil Horman
@ 2015-01-14 15:25 0% ` Thomas Monjalon
2015-01-14 20:29 0% ` Neil Horman
2 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2015-01-14 15:25 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Hi Neil,
2014-12-23 10:51, Neil Horman:
> Add initial pass header files to support symbol versioning.
[...]
> +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
Why these dates?
> +# All rights reserved.
I think this line is not required anymore:
http://en.wikipedia.org/wiki/All_rights_reserved
[...]
> +#ifndef _RTE_COMPAT_H_
> +#define _RTE_COMPAT_H_
Why using underscores?
I think it's reserved:
http://en.wikipedia.org/wiki/Include_guard#Use_of_.23include_guards
> +#define SA(x) #x
It should be prefixed. But it's better to use RTE_STR.
> +#ifdef RTE_BUILD_SHARED_LIB
> +
> +/*
> + * Provides backwards compatibility when updating exported functions.
> + * When a symol is exported from a library to provide an API, it also provides a
> + * calling convention (ABI) that is embodied in its name, return type,
> + * arguments, etc. On occasion that function may need to change to accomodate
> + * new functionality, behavior, etc. When that occurs, it is desireable to
> + * allow for backwards compatibility for a time with older binaries that are
> + * dynamically linked to the dpdk. to support that the __vsym and
Should be "To support that," with uppercase and comma.
> + * VERSION_SYMBOL macros are created. They, in conjunction with the
> + * <library>_version.map file for a given library allow for multiple versions of
> + * a symbol to exist in a shared library so that older binaries need not be
> + * immediately recompiled. Their use is outlined in the following example:
> + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> + *
> + * To accomplish this:
> + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> + * foo is exported as a global symbol.
> + *
> + * 2) rename the existing function int foo(char *string) to
> + * int __vsym foo_v18(char *string)
> + *
> + * 3) Add this macro immediately below the function
> + * VERSION_SYMBOL(foo, _v18, 1.8);
> + *
> + * 4) Implement a new version of foo.
> + * char foo(int value, int otherval) { ...}
> + *
> + * 5) Mark the newest version as the default version
> + * BIND_DEFAULT_SYMBOL(foo, 1.9);
> + *
> + */
Thanks for this good tutorial.
> +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> +#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
> +#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
> +#define __vsym __attribute__((used))
OK. It would be simpler to read if b, e, v and n were formally defined in a comment.
> +#else
[...]
> +/*
> + * RTE_BUILD_SHARED_LIB
> + */
This type of comment is strange. It makes me think that we are in the case
RTE_BUILD_SHARED_LIB=y
> +#endif
[...]
> +
> +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
Why this variable name? VERSION_SCRIPT or VERSION_MAP seems more appropriate.
> +
> endif
>
> +
Why this newline?
> _BUILD = $(LIB)
--
Thomas
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (4 preceding siblings ...)
2014-12-23 15:51 4% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2015-01-09 12:35 0% ` Neil Horman
2015-01-15 19:35 3% ` [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
` (6 subsequent siblings)
12 siblings, 0 replies; 200+ results
From: Neil Horman @ 2015-01-09 12:35 UTC (permalink / raw)
To: dev
On Sat, Dec 20, 2014 at 04:01:35PM -0500, Neil Horman wrote:
> GI: [PATCH 1/4] compat: Add infrastructure to support symbol versioninBI
> develops and changes quickly, which makes it difficult for
> applications to keep up with the latest version of the library, especially when
> it (the DPDK) is built as a set of shared objects, as applications may be built
> against an older version of the library.
>
> To mitigate this, this patch series introduces support for library and symbol
> versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
>
> 1) Adds initial support for library versioning. Each library now has a version
> map that explicitly calls out what symbols are exported to using applications,
> and assigns version(s) to them
>
> 2) Adds support macros so that when libraries create incompatible ABI's,
> multiple versions may be supported so that applications linked against older
> DPDK releases can continue to function
>
> 3) Adds library soname versioning suffixes so that when ABI's must be broken in
> a fashion that requires a rebuild of older applications, they will break at load
> time, rather than cause unexpected issues at run time.
>
> 4) Adds documentation for ABI policy, and provides space to document deprecated
> ABI versions, so that applications might be warned of impending changes.
>
> With these elements in place the DPDK has some support to allow for the extended
> maintenence of older API's while still allowing the freedom to develop new and
> improved API's.
>
> Implementing this feature will require some additional effort on the part of
> developers and reviewers. When reviewing patches, must be checked against
> existing exports to ensure that the function prototypes are not changing. If
> they are, the versioning macros must be used, and the library export map should
> be updated to reflect the new version of the function.
>
> When data structures change, if those structures are application accessible,
> apis that accept or return instances of those data structures should have new
> versions created so that users of the old data structure version might co-exist
> at the same time.
>
> Note it was requested that this series be delayed until DPDK 2.0, so this is a
> repost, now that DPDK 1.8 has been tagged.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> CC: "Robert Love" <robert.w.love@intel.com>
>
>
Ping Thomas....
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation
2014-12-23 15:51 23% ` [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation Neil Horman
@ 2014-12-29 16:24 4% ` Sergio Gonzalez Monroy
2015-01-14 15:59 4% ` Thomas Monjalon
1 sibling, 0 replies; 200+ results
From: Sergio Gonzalez Monroy @ 2014-12-29 16:24 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Tue, Dec 23, 2014 at 10:51:53AM -0500, Neil Horman wrote:
> Adding a document describing rudimentary ABI policy and adding notice space for
> any deprecation announcements
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> ---
> doc/abi.txt | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
> create mode 100644 doc/abi.txt
>
> diff --git a/doc/abi.txt b/doc/abi.txt
> new file mode 100644
> index 0000000..b6dcc7d
> --- /dev/null
> +++ b/doc/abi.txt
> @@ -0,0 +1,17 @@
> +ABI policy:
> + ABI versions are set at the time of major release labeling, and ABI may
> +change multiple times between the last labeling and the HEAD label of the git
> +tree without warning
> +
> + ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle, after it
> +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> +remove it is made during the development of DPDK 1.9. The decision will be
> +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> +1.10 ships.
> +
> + ABI versions may be deprecated in whole, or in part as needed by a given
> +update.
> +
> +Deprecation Notices:
> +
> --
> 1.9.3
>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v3 3/4] Add library version extenstion
2014-12-23 15:51 7% ` [dpdk-dev] [PATCH v3 3/4] Add library version extenstion Neil Horman
@ 2014-12-29 16:23 0% ` Sergio Gonzalez Monroy
2015-01-14 15:48 0% ` Thomas Monjalon
1 sibling, 0 replies; 200+ results
From: Sergio Gonzalez Monroy @ 2014-12-29 16:23 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Tue, Dec 23, 2014 at 10:51:52AM -0500, Neil Horman wrote:
> To differentiate libraries that break ABI, we add a library version number
> suffix to the library, which must be incremented when a given libraries ABI is
> broken. This patch enforces that addition, sets the initial abi soname
> extension to 1 for each library and creates a symlink to the base SONAME so that
> the test applications will link properly.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
>
> Change Notes:
> v3)
> Made symlinking of libraries conditional on a DSO build
> ---
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
^ permalink raw reply [relevance 0%]
* [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation
2014-12-23 15:51 4% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-12-23 15:51 7% ` [dpdk-dev] [PATCH v3 3/4] Add library version extenstion Neil Horman
@ 2014-12-23 15:51 23% ` Neil Horman
2014-12-29 16:24 4% ` Sergio Gonzalez Monroy
2015-01-14 15:59 4% ` Thomas Monjalon
2015-01-14 15:25 0% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Thomas Monjalon
2 siblings, 2 replies; 200+ results
From: Neil Horman @ 2014-12-23 15:51 UTC (permalink / raw)
To: dev
Adding a document describing rudimentary ABI policy and adding notice space for
any deprecation announcements
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
doc/abi.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 doc/abi.txt
diff --git a/doc/abi.txt b/doc/abi.txt
new file mode 100644
index 0000000..b6dcc7d
--- /dev/null
+++ b/doc/abi.txt
@@ -0,0 +1,17 @@
+ABI policy:
+ ABI versions are set at the time of major release labeling, and ABI may
+change multiple times between the last labeling and the HEAD label of the git
+tree without warning
+
+ ABI versions, once released are available until such time as their
+deprecation has been noted here for at least one major release cycle, after it
+has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
+remove it is made during the development of DPDK 1.9. The decision will be
+recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
+1.10 ships.
+
+ ABI versions may be deprecated in whole, or in part as needed by a given
+update.
+
+Deprecation Notices:
+
--
1.9.3
^ permalink raw reply [relevance 23%]
* [dpdk-dev] [PATCH v3 3/4] Add library version extenstion
2014-12-23 15:51 4% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2014-12-23 15:51 7% ` Neil Horman
2014-12-29 16:23 0% ` Sergio Gonzalez Monroy
2015-01-14 15:48 0% ` Thomas Monjalon
2014-12-23 15:51 23% ` [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation Neil Horman
2015-01-14 15:25 0% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Thomas Monjalon
2 siblings, 2 replies; 200+ results
From: Neil Horman @ 2014-12-23 15:51 UTC (permalink / raw)
To: dev
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken. This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
Change Notes:
v3)
Made symlinking of libraries conditional on a DSO build
---
lib/librte_acl/Makefile | 2 ++
lib/librte_cfgfile/Makefile | 2 ++
lib/librte_cmdline/Makefile | 2 ++
lib/librte_compat/Makefile | 2 ++
lib/librte_distributor/Makefile | 2 ++
lib/librte_eal/bsdapp/eal/Makefile | 2 ++
lib/librte_eal/linuxapp/eal/Makefile | 2 ++
lib/librte_ether/Makefile | 2 ++
lib/librte_hash/Makefile | 2 ++
lib/librte_ip_frag/Makefile | 2 ++
lib/librte_ivshmem/Makefile | 2 ++
lib/librte_kni/Makefile | 2 ++
lib/librte_kvargs/Makefile | 2 ++
lib/librte_lpm/Makefile | 2 ++
lib/librte_malloc/Makefile | 2 ++
lib/librte_mbuf/Makefile | 2 ++
lib/librte_mempool/Makefile | 2 ++
lib/librte_meter/Makefile | 2 ++
lib/librte_pipeline/Makefile | 2 ++
lib/librte_pmd_af_packet/Makefile | 2 ++
lib/librte_pmd_bond/Makefile | 2 ++
lib/librte_pmd_e1000/Makefile | 2 ++
lib/librte_pmd_enic/Makefile | 2 ++
lib/librte_pmd_i40e/Makefile | 2 ++
lib/librte_pmd_ixgbe/Makefile | 2 ++
lib/librte_pmd_pcap/Makefile | 2 ++
lib/librte_pmd_ring/Makefile | 2 ++
lib/librte_pmd_virtio/Makefile | 2 ++
lib/librte_pmd_vmxnet3/Makefile | 2 ++
lib/librte_pmd_xenvirt/Makefile | 2 ++
lib/librte_port/Makefile | 2 ++
lib/librte_power/Makefile | 2 ++
lib/librte_ring/Makefile | 2 ++
lib/librte_sched/Makefile | 2 ++
lib/librte_table/Makefile | 2 ++
lib/librte_timer/Makefile | 2 ++
lib/librte_vhost/Makefile | 2 ++
mk/rte.lib.mk | 13 +++++++++++--
38 files changed, 85 insertions(+), 2 deletions(-)
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 45cbf80..765deb1 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_acl_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index a4f73de..032c240 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_cfgfile_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 3c71831..719dff6 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_cmdline_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
index 46d5905..c63d622 100644
--- a/lib/librte_compat/Makefile
+++ b/lib/librte_compat/Makefile
@@ -32,6 +32,8 @@
include $(RTE_SDK)/mk/rte.vars.mk
+LIBABIVER := 1
+
# install includes
SYMLINK-y-include := rte_compat.h
diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
index 3674a2c..4c9af17 100644
--- a/lib/librte_distributor/Makefile
+++ b/lib/librte_distributor/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_distributor_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index 0b5f9d9..ae214a4 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -48,6 +48,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
# specific to linuxapp exec-env
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index bae8af1..e117cec 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -35,6 +35,8 @@ LIB = librte_eal.a
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
VPATH += $(RTE_SDK)/lib/librte_eal/common
CFLAGS += -I$(SRCDIR)/include
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 80ad78d..c0e5768 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_ether_version.map
+LIBABIVER := 1
+
SRCS-y += rte_ethdev.c
#
diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
index bec61ab..3696cb1 100644
--- a/lib/librte_hash/Makefile
+++ b/lib/librte_hash/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_hash_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index aa88578..fe926f7 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_ipfrag_version.map
+LIBABIVER := 1
+
#source files
ifeq ($(CONFIG_RTE_MBUF_REFCNT),y)
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
index 068ee10..16defdb 100644
--- a/lib/librte_ivshmem/Makefile
+++ b/lib/librte_ivshmem/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ivshmem_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index 93a516d..7107832 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_kni_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
index b1c34f3..87b09f2 100644
--- a/lib/librte_kvargs/Makefile
+++ b/lib/librte_kvargs/Makefile
@@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_kvargs_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
index 8214630..35e6389 100644
--- a/lib/librte_lpm/Makefile
+++ b/lib/librte_lpm/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_lpm_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
index 15b7eed..947e41c 100644
--- a/lib/librte_malloc/Makefile
+++ b/lib/librte_malloc/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_malloc.a
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_malloc_version.map
diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
index 03becae..080f3cf 100644
--- a/lib/librte_mbuf/Makefile
+++ b/lib/librte_mbuf/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mbuf_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
index 31d1a71..940d1f7 100644
--- a/lib/librte_mempool/Makefile
+++ b/lib/librte_mempool/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mempool_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index c4a7a32..8765881 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_meter_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 15b58df..15e406b 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pipeline_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_af_packet/Makefile b/lib/librte_pmd_af_packet/Makefile
index 85a7860..f0bf537 100644
--- a/lib/librte_pmd_af_packet/Makefile
+++ b/lib/librte_pmd_af_packet/Makefile
@@ -40,6 +40,8 @@ LIB = librte_pmd_af_packet.a
EXPORT_MAP := rte_pmd_af_packet_version.map
+LIBABIVER := 1
+
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 074110a..d6c81a8 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_bond_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
index cd14444..8c8fed8 100644
--- a/lib/librte_pmd_e1000/Makefile
+++ b/lib/librte_pmd_e1000/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_e1000_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile
index 697231c..251a898 100644
--- a/lib/librte_pmd_enic/Makefile
+++ b/lib/librte_pmd_enic/Makefile
@@ -39,6 +39,8 @@ LIB = librte_pmd_enic.a
EXPORT_MAP := rte_pmd_enic_version.map
+LIBABIVER := 1
+
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/
CFLAGS += -O3
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index 73de373..9a0eec8 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_i40e_version.map
+LIBABIVER := 1
+
#
# Add extra flags for base driver files (also known as shared code)
# to disable warnings
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index e0a17f6..d580f62 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_ixgbe_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
index cb6678e..0775dbc 100644
--- a/lib/librte_pmd_pcap/Makefile
+++ b/lib/librte_pmd_pcap/Makefile
@@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_pcap_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
index aa1b461..e442d0b 100644
--- a/lib/librte_pmd_ring/Makefile
+++ b/lib/librte_pmd_ring/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_ring_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
index d979c59..793067f 100644
--- a/lib/librte_pmd_virtio/Makefile
+++ b/lib/librte_pmd_virtio/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_virtio_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index f3ab178..93e5580 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
EXPORT_MAP := rte_pmd_vmxnet3_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
index 4510603..f0c796c 100644
--- a/lib/librte_pmd_xenvirt/Makefile
+++ b/lib/librte_pmd_xenvirt/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_xenvirt_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 266ed39..0e38452 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_port_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index 0547dcd..cee95cd 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_power_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c rte_power_acpi_cpufreq.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c
diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
index b437dc5..84ad3d3 100644
--- a/lib/librte_ring/Makefile
+++ b/lib/librte_ring/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ring_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 48f280a..b1cb285 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
EXPORT_MAP := rte_sched_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
index 4e1a54a..0d8394c 100644
--- a/lib/librte_table/Makefile
+++ b/lib/librte_table/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_table_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
index 9fb6079..2aabef8 100644
--- a/lib/librte_timer/Makefile
+++ b/lib/librte_timer/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_timer_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 96a7dd0..369c25a 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -36,6 +36,8 @@ LIB = librte_vhost.a
EXPORT_MAP := rte_vhost_version.map
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse
LDFLAGS += -lfuse
# all source are stored in SRCS-y
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 1d3b646..7326b8e 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -37,10 +37,9 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
-
ifeq ($(RTE_BUILD_SHARED_LIB),y)
-LIB := $(patsubst %.a,%.so,$(LIB))
+LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
endif
@@ -63,6 +62,7 @@ build: _postbuild
exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
+
ifeq ($(LINK_USING_CC),1)
# Override the definition of LD here, since we're linking with CC
LD := $(CC) $(CPU_CFLAGS)
@@ -113,6 +113,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
#
ifeq ($(RTE_BUILD_SHARED_LIB),y)
$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
+ifeq ($(LIBABIVER),)
+ @echo "Must Specify a $(LIB) ABI version"
+ @exit 1
+endif
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(if $(D),\
@echo -n "$< -> $@ " ; \
@@ -126,6 +130,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
$(depfile_missing),\
$(depfile_newer)),\
$(O_TO_S_DO))
+
ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
$(if $(or \
$(file_missing),\
@@ -163,9 +168,13 @@ endif
# install lib in $(RTE_OUTPUT)/lib
#
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
+ $(eval LIBSONAME := $(basename $(LIB)))
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+ifeq ($(RTE_BUILD_SHARED_LIB),y)
+ $(Q)ln -s -f ./$(LIB) $(RTE_OUTPUT)/lib/$(LIBSONAME)
+endif
#
# Clean all generated files
--
1.9.3
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (3 preceding siblings ...)
2014-12-22 20:24 4% ` [dpdk-dev] [PATCH v2 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2014-12-23 15:51 4% ` Neil Horman
2014-12-23 15:51 7% ` [dpdk-dev] [PATCH v3 3/4] Add library version extenstion Neil Horman
` (2 more replies)
2015-01-09 12:35 0% ` [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (7 subsequent siblings)
12 siblings, 3 replies; 200+ results
From: Neil Horman @ 2014-12-23 15:51 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
Change Notes:
V2)
Moved ifeq to _INSTALL target
V3)
Undo V2 changes and make librte_compat use the rte.install.mk file
instead
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++++++
lib/librte_compat/rte_compat.h | 96 ++++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 4 ++
4 files changed, 139 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 0ffc982..d617d81 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,6 +31,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..46d5905
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.install.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..d99e362
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,96 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+
+/*
+ * This is just a stringification macro for use below.
+ */
+#define SA(x) #x
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. to support that the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ * char foo(int value, int otherval) { ...}
+ *
+ * 5) Mark the newest version as the default version
+ * BIND_DEFAULT_SYMBOL(foo, 1.9);
+ *
+ */
+#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
+#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
+#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+#define BASE_SYMBOL(b, n)
+#define BIND_DEFAULT_SYMBOL(b, v)
+
+/*
+ * RTE_BUILD_SHARED_LIB
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 81bf8e1..75e3652 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
--
1.9.3
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v2 4/4] docs: Add ABI documentation
2014-12-23 9:48 4% ` Iremonger, Bernard
@ 2014-12-23 13:01 4% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-12-23 13:01 UTC (permalink / raw)
To: Iremonger, Bernard; +Cc: dev
On Tue, Dec 23, 2014 at 09:48:43AM +0000, Iremonger, Bernard wrote:
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> > Sent: Monday, December 22, 2014 8:24 PM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH v2 4/4] docs: Add ABI documentation
> >
> > Adding a document describing rudimentary ABI policy and adding notice space for any deprecation
> > announcements
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > ---
> > doc/abi.txt | 17 +++++++++++++++++
> > 1 file changed, 17 insertions(+)
> > create mode 100644 doc/abi.txt
> >
> > diff --git a/doc/abi.txt b/doc/abi.txt
> > new file mode 100644
> > index 0000000..b6dcc7d
> > --- /dev/null
> > +++ b/doc/abi.txt
> > @@ -0,0 +1,17 @@
> > +ABI policy:
> > + ABI versions are set at the time of major release labeling, and ABI
> > +may change multiple times between the last labeling and the HEAD label
> > +of the git tree without warning
> > +
> > + ABI versions, once released are available until such time as their
> > +deprecation has been noted here for at least one major release cycle,
> > +after it has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and
> > +then the decision to remove it is made during the development of DPDK
> > +1.9. The decision will be recorded here, shipped with the DPDK 1.9
> > +release, and actually removed when DPDK
> > +1.10 ships.
> > +
> > + ABI versions may be deprecated in whole, or in part as needed by a
> > +given update.
> > +
> > +Deprecation Notices:
> > +
> > --
> > 1.9.3
>
> Should this document be added to the guides documentation (for example doc/guides/prog_guide)?
>
> Regards,
>
> Bernard.
>
>
I don't think so, since this document is meant to be used not only by end users,
but by other programmers while working on the dpdk.
Neil
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH v2 4/4] docs: Add ABI documentation
2014-12-22 20:24 23% ` [dpdk-dev] [PATCH v2 4/4] docs: Add ABI documentation Neil Horman
@ 2014-12-23 9:48 4% ` Iremonger, Bernard
2014-12-23 13:01 4% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Iremonger, Bernard @ 2014-12-23 9:48 UTC (permalink / raw)
To: Neil Horman, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Monday, December 22, 2014 8:24 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v2 4/4] docs: Add ABI documentation
>
> Adding a document describing rudimentary ABI policy and adding notice space for any deprecation
> announcements
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> ---
> doc/abi.txt | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
> create mode 100644 doc/abi.txt
>
> diff --git a/doc/abi.txt b/doc/abi.txt
> new file mode 100644
> index 0000000..b6dcc7d
> --- /dev/null
> +++ b/doc/abi.txt
> @@ -0,0 +1,17 @@
> +ABI policy:
> + ABI versions are set at the time of major release labeling, and ABI
> +may change multiple times between the last labeling and the HEAD label
> +of the git tree without warning
> +
> + ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle,
> +after it has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and
> +then the decision to remove it is made during the development of DPDK
> +1.9. The decision will be recorded here, shipped with the DPDK 1.9
> +release, and actually removed when DPDK
> +1.10 ships.
> +
> + ABI versions may be deprecated in whole, or in part as needed by a
> +given update.
> +
> +Deprecation Notices:
> +
> --
> 1.9.3
Should this document be added to the guides documentation (for example doc/guides/prog_guide)?
Regards,
Bernard.
^ permalink raw reply [relevance 4%]
* [dpdk-dev] [PATCH v2 4/4] docs: Add ABI documentation
2014-12-22 20:24 4% ` [dpdk-dev] [PATCH v2 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-12-22 20:24 7% ` [dpdk-dev] [PATCH v2 3/4] Add library version extenstion Neil Horman
@ 2014-12-22 20:24 23% ` Neil Horman
2014-12-23 9:48 4% ` Iremonger, Bernard
1 sibling, 1 reply; 200+ results
From: Neil Horman @ 2014-12-22 20:24 UTC (permalink / raw)
To: dev
Adding a document describing rudimentary ABI policy and adding notice space for
any deprecation announcements
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
doc/abi.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 doc/abi.txt
diff --git a/doc/abi.txt b/doc/abi.txt
new file mode 100644
index 0000000..b6dcc7d
--- /dev/null
+++ b/doc/abi.txt
@@ -0,0 +1,17 @@
+ABI policy:
+ ABI versions are set at the time of major release labeling, and ABI may
+change multiple times between the last labeling and the HEAD label of the git
+tree without warning
+
+ ABI versions, once released are available until such time as their
+deprecation has been noted here for at least one major release cycle, after it
+has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
+remove it is made during the development of DPDK 1.9. The decision will be
+recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
+1.10 ships.
+
+ ABI versions may be deprecated in whole, or in part as needed by a given
+update.
+
+Deprecation Notices:
+
--
1.9.3
^ permalink raw reply [relevance 23%]
* [dpdk-dev] [PATCH v2 3/4] Add library version extenstion
2014-12-22 20:24 4% ` [dpdk-dev] [PATCH v2 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2014-12-22 20:24 7% ` Neil Horman
2014-12-22 20:24 23% ` [dpdk-dev] [PATCH v2 4/4] docs: Add ABI documentation Neil Horman
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2014-12-22 20:24 UTC (permalink / raw)
To: dev
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken. This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
lib/librte_acl/Makefile | 2 ++
lib/librte_cfgfile/Makefile | 2 ++
lib/librte_cmdline/Makefile | 2 ++
lib/librte_compat/Makefile | 2 ++
lib/librte_distributor/Makefile | 2 ++
lib/librte_eal/bsdapp/eal/Makefile | 2 ++
lib/librte_eal/linuxapp/eal/Makefile | 2 ++
lib/librte_ether/Makefile | 2 ++
lib/librte_hash/Makefile | 2 ++
lib/librte_ip_frag/Makefile | 2 ++
lib/librte_ivshmem/Makefile | 2 ++
lib/librte_kni/Makefile | 2 ++
lib/librte_kvargs/Makefile | 2 ++
lib/librte_lpm/Makefile | 2 ++
lib/librte_malloc/Makefile | 2 ++
lib/librte_mbuf/Makefile | 2 ++
lib/librte_mempool/Makefile | 2 ++
lib/librte_meter/Makefile | 2 ++
lib/librte_pipeline/Makefile | 2 ++
lib/librte_pmd_af_packet/Makefile | 2 ++
lib/librte_pmd_bond/Makefile | 2 ++
lib/librte_pmd_e1000/Makefile | 2 ++
lib/librte_pmd_enic/Makefile | 2 ++
lib/librte_pmd_i40e/Makefile | 2 ++
lib/librte_pmd_ixgbe/Makefile | 2 ++
lib/librte_pmd_pcap/Makefile | 2 ++
lib/librte_pmd_ring/Makefile | 2 ++
lib/librte_pmd_virtio/Makefile | 2 ++
lib/librte_pmd_vmxnet3/Makefile | 2 ++
lib/librte_pmd_xenvirt/Makefile | 2 ++
lib/librte_port/Makefile | 2 ++
lib/librte_power/Makefile | 2 ++
lib/librte_ring/Makefile | 2 ++
lib/librte_sched/Makefile | 2 ++
lib/librte_table/Makefile | 2 ++
lib/librte_timer/Makefile | 2 ++
lib/librte_vhost/Makefile | 2 ++
mk/rte.lib.mk | 11 +++++++++--
38 files changed, 83 insertions(+), 2 deletions(-)
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 45cbf80..765deb1 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_acl_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index a4f73de..032c240 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_cfgfile_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 3c71831..719dff6 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_cmdline_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
index 3415c7b..a23d349 100644
--- a/lib/librte_compat/Makefile
+++ b/lib/librte_compat/Makefile
@@ -32,6 +32,8 @@
include $(RTE_SDK)/mk/rte.vars.mk
+LIBABIVER := 1
+
# install includes
SYMLINK-y-include := rte_compat.h
diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
index 3674a2c..4c9af17 100644
--- a/lib/librte_distributor/Makefile
+++ b/lib/librte_distributor/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_distributor_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index 0b5f9d9..ae214a4 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -48,6 +48,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
# specific to linuxapp exec-env
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index bae8af1..e117cec 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -35,6 +35,8 @@ LIB = librte_eal.a
EXPORT_MAP := rte_eal_version.map
+LIBABIVER := 1
+
VPATH += $(RTE_SDK)/lib/librte_eal/common
CFLAGS += -I$(SRCDIR)/include
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 80ad78d..c0e5768 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_ether_version.map
+LIBABIVER := 1
+
SRCS-y += rte_ethdev.c
#
diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
index bec61ab..3696cb1 100644
--- a/lib/librte_hash/Makefile
+++ b/lib/librte_hash/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_hash_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index aa88578..fe926f7 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_ipfrag_version.map
+LIBABIVER := 1
+
#source files
ifeq ($(CONFIG_RTE_MBUF_REFCNT),y)
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
index 068ee10..16defdb 100644
--- a/lib/librte_ivshmem/Makefile
+++ b/lib/librte_ivshmem/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ivshmem_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index 93a516d..7107832 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_kni_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
index b1c34f3..87b09f2 100644
--- a/lib/librte_kvargs/Makefile
+++ b/lib/librte_kvargs/Makefile
@@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_kvargs_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
index 8214630..35e6389 100644
--- a/lib/librte_lpm/Makefile
+++ b/lib/librte_lpm/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := rte_lpm_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
index 15b7eed..947e41c 100644
--- a/lib/librte_malloc/Makefile
+++ b/lib/librte_malloc/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_malloc.a
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_malloc_version.map
diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
index 03becae..080f3cf 100644
--- a/lib/librte_mbuf/Makefile
+++ b/lib/librte_mbuf/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mbuf_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
index 31d1a71..940d1f7 100644
--- a/lib/librte_mempool/Makefile
+++ b/lib/librte_mempool/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_mempool_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index c4a7a32..8765881 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_meter_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 15b58df..15e406b 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pipeline_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_af_packet/Makefile b/lib/librte_pmd_af_packet/Makefile
index 85a7860..f0bf537 100644
--- a/lib/librte_pmd_af_packet/Makefile
+++ b/lib/librte_pmd_af_packet/Makefile
@@ -40,6 +40,8 @@ LIB = librte_pmd_af_packet.a
EXPORT_MAP := rte_pmd_af_packet_version.map
+LIBABIVER := 1
+
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 074110a..d6c81a8 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_bond_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
index cd14444..8c8fed8 100644
--- a/lib/librte_pmd_e1000/Makefile
+++ b/lib/librte_pmd_e1000/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_e1000_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile
index 697231c..251a898 100644
--- a/lib/librte_pmd_enic/Makefile
+++ b/lib/librte_pmd_enic/Makefile
@@ -39,6 +39,8 @@ LIB = librte_pmd_enic.a
EXPORT_MAP := rte_pmd_enic_version.map
+LIBABIVER := 1
+
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/
CFLAGS += -O3
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index 73de373..9a0eec8 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_i40e_version.map
+LIBABIVER := 1
+
#
# Add extra flags for base driver files (also known as shared code)
# to disable warnings
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index e0a17f6..d580f62 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_ixgbe_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
index cb6678e..0775dbc 100644
--- a/lib/librte_pmd_pcap/Makefile
+++ b/lib/librte_pmd_pcap/Makefile
@@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_pcap_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
index aa1b461..e442d0b 100644
--- a/lib/librte_pmd_ring/Makefile
+++ b/lib/librte_pmd_ring/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_ring_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
index d979c59..793067f 100644
--- a/lib/librte_pmd_virtio/Makefile
+++ b/lib/librte_pmd_virtio/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_virtio_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index f3ab178..93e5580 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
EXPORT_MAP := rte_pmd_vmxnet3_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
index 4510603..f0c796c 100644
--- a/lib/librte_pmd_xenvirt/Makefile
+++ b/lib/librte_pmd_xenvirt/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_eth_xenvirt_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index 266ed39..0e38452 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_port_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index 0547dcd..cee95cd 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := rte_power_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c rte_power_acpi_cpufreq.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c
diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
index b437dc5..84ad3d3 100644
--- a/lib/librte_ring/Makefile
+++ b/lib/librte_ring/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_ring_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 48f280a..b1cb285 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
EXPORT_MAP := rte_sched_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
index 4e1a54a..0d8394c 100644
--- a/lib/librte_table/Makefile
+++ b/lib/librte_table/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_table_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
index 9fb6079..2aabef8 100644
--- a/lib/librte_timer/Makefile
+++ b/lib/librte_timer/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := rte_timer_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 96a7dd0..369c25a 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -36,6 +36,8 @@ LIB = librte_vhost.a
EXPORT_MAP := rte_vhost_version.map
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse
LDFLAGS += -lfuse
# all source are stored in SRCS-y
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 7949254..ad058b5 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -37,10 +37,9 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
-
ifeq ($(RTE_BUILD_SHARED_LIB),y)
-LIB := $(patsubst %.a,%.so,$(LIB))
+LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
CPU_LDFLAGS += --version-script=$(SRCDIR)/$(EXPORT_MAP)
endif
@@ -66,6 +65,7 @@ build: _postbuild
exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
+
ifeq ($(LINK_USING_CC),1)
# Override the definition of LD here, since we're linking with CC
LD := $(CC) $(CPU_CFLAGS)
@@ -116,6 +116,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
#
ifeq ($(RTE_BUILD_SHARED_LIB),y)
$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
+ifeq ($(LIBABIVER),)
+ @echo "Must Specify a $(LIB) ABI version"
+ @exit 1
+endif
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(if $(D),\
@echo -n "$< -> $@ " ; \
@@ -129,6 +133,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
$(depfile_missing),\
$(depfile_newer)),\
$(O_TO_S_DO))
+
ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
$(if $(or \
$(file_missing),\
@@ -166,9 +171,11 @@ endif
# install lib in $(RTE_OUTPUT)/lib
#
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
+ $(eval LIBSONAME := $(basename $(LIB)))
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+ $(Q)ln -s -f $(RTE_OUTPUT)/lib/$(LIB) $(RTE_OUTPUT)/lib/$(LIBSONAME)
#
# Clean all generated files
--
1.9.3
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH v2 1/4] compat: Add infrastructure to support symbol versioning
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
` (2 preceding siblings ...)
2014-12-20 21:01 23% ` [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation Neil Horman
@ 2014-12-22 20:24 4% ` Neil Horman
2014-12-22 20:24 7% ` [dpdk-dev] [PATCH v2 3/4] Add library version extenstion Neil Horman
2014-12-22 20:24 23% ` [dpdk-dev] [PATCH v2 4/4] docs: Add ABI documentation Neil Horman
2014-12-23 15:51 4% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
` (8 subsequent siblings)
12 siblings, 2 replies; 200+ results
From: Neil Horman @ 2014-12-22 20:24 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
Change Notes:
V2)
Moved ifeq to _INSTALL target
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++++++
lib/librte_compat/rte_compat.h | 96 ++++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 9 +++-
4 files changed, 143 insertions(+), 1 deletion(-)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 0ffc982..d617d81 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,6 +31,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..3415c7b
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..d99e362
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,96 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+
+/*
+ * This is just a stringification macro for use below.
+ */
+#define SA(x) #x
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. to support that the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ * char foo(int value, int otherval) { ...}
+ *
+ * 5) Mark the newest version as the default version
+ * BIND_DEFAULT_SYMBOL(foo, 1.9);
+ *
+ */
+#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
+#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
+#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+#define BASE_SYMBOL(b, n)
+#define BIND_DEFAULT_SYMBOL(b, v)
+
+/*
+ * RTE_BUILD_SHARED_LIB
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 81bf8e1..cbd439b 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,10 +40,17 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
-_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
+_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y)
+ifneq ($(LIB),)
+_INSTALL += $(RTE_OUTPUT)/lib/$(LIB)
+endif
_CLEAN = doclean
.PHONY: all
--
1.9.3
^ permalink raw reply [relevance 4%]
* [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
2014-12-20 21:01 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-12-20 21:01 7% ` [dpdk-dev] [PATCH 3/4] Add library version extenstion Neil Horman
@ 2014-12-20 21:01 23% ` Neil Horman
2014-12-22 20:24 4% ` [dpdk-dev] [PATCH v2 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
` (9 subsequent siblings)
12 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-12-20 21:01 UTC (permalink / raw)
To: dev
Adding a document describing rudimentary ABI policy and adding notice space for
any deprecation announcements
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
doc/abi.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 doc/abi.txt
diff --git a/doc/abi.txt b/doc/abi.txt
new file mode 100644
index 0000000..b6dcc7d
--- /dev/null
+++ b/doc/abi.txt
@@ -0,0 +1,17 @@
+ABI policy:
+ ABI versions are set at the time of major release labeling, and ABI may
+change multiple times between the last labeling and the HEAD label of the git
+tree without warning
+
+ ABI versions, once released are available until such time as their
+deprecation has been noted here for at least one major release cycle, after it
+has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
+remove it is made during the development of DPDK 1.9. The decision will be
+recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
+1.10 ships.
+
+ ABI versions may be deprecated in whole, or in part as needed by a given
+update.
+
+Deprecation Notices:
+
--
1.9.3
^ permalink raw reply [relevance 23%]
* [dpdk-dev] [PATCH 3/4] Add library version extenstion
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
2014-12-20 21:01 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2014-12-20 21:01 7% ` Neil Horman
2014-12-20 21:01 23% ` [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation Neil Horman
` (10 subsequent siblings)
12 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-12-20 21:01 UTC (permalink / raw)
To: dev
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken. This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
lib/librte_acl/Makefile | 2 ++
lib/librte_cfgfile/Makefile | 2 ++
lib/librte_cmdline/Makefile | 2 ++
lib/librte_compat/Makefile | 2 ++
lib/librte_distributor/Makefile | 2 ++
lib/librte_eal/bsdapp/eal/Makefile | 2 ++
lib/librte_eal/linuxapp/eal/Makefile | 2 ++
lib/librte_ether/Makefile | 2 ++
lib/librte_hash/Makefile | 2 ++
lib/librte_ip_frag/Makefile | 2 ++
lib/librte_ivshmem/Makefile | 2 ++
lib/librte_kni/Makefile | 2 ++
lib/librte_kvargs/Makefile | 2 ++
lib/librte_lpm/Makefile | 2 ++
lib/librte_malloc/Makefile | 2 ++
lib/librte_mbuf/Makefile | 2 ++
lib/librte_mempool/Makefile | 2 ++
lib/librte_meter/Makefile | 2 ++
lib/librte_pipeline/Makefile | 2 ++
lib/librte_pmd_af_packet/Makefile | 2 ++
lib/librte_pmd_bond/Makefile | 2 ++
lib/librte_pmd_e1000/Makefile | 2 ++
lib/librte_pmd_enic/Makefile | 2 ++
lib/librte_pmd_i40e/Makefile | 2 ++
lib/librte_pmd_ixgbe/Makefile | 2 ++
lib/librte_pmd_pcap/Makefile | 2 ++
lib/librte_pmd_ring/Makefile | 2 ++
lib/librte_pmd_virtio/Makefile | 2 ++
lib/librte_pmd_vmxnet3/Makefile | 2 ++
lib/librte_pmd_xenvirt/Makefile | 2 ++
lib/librte_port/Makefile | 2 ++
lib/librte_power/Makefile | 2 ++
lib/librte_ring/Makefile | 2 ++
lib/librte_sched/Makefile | 2 ++
lib/librte_table/Makefile | 2 ++
lib/librte_timer/Makefile | 2 ++
lib/librte_vhost/Makefile | 2 ++
mk/rte.lib.mk | 12 +++++++++---
38 files changed, 83 insertions(+), 3 deletions(-)
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 1f96645..4db403b 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_acl/rte_acl_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index e655098..1c81579 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_cfgfile/rte_cfgfile_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 1a47173..b0ab5b6 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_cmdline/rte_cmdline_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
index 3415c7b..a23d349 100644
--- a/lib/librte_compat/Makefile
+++ b/lib/librte_compat/Makefile
@@ -32,6 +32,8 @@
include $(RTE_SDK)/mk/rte.vars.mk
+LIBABIVER := 1
+
# install includes
SYMLINK-y-include := rte_compat.h
diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
index 97d8bbb..12d9df1 100644
--- a/lib/librte_distributor/Makefile
+++ b/lib/librte_distributor/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_distributor/rte_distributor_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index b28a8b7..664698a 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -48,6 +48,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_eal/bsdapp/eal/rte_eal_version.map
+LIBABIVER := 1
+
# specific to linuxapp exec-env
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index 4f1b11f..1eacf4a 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -35,6 +35,8 @@ LIB = librte_eal.a
EXPORT_MAP := $(RTE_SDK)/lib/librte_eal/linuxapp/eal/rte_eal_version.map
+LIBABIVER := 1
+
VPATH += $(RTE_SDK)/lib/librte_eal/common
CFLAGS += -I$(SRCDIR)/include
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index 6250f4d..8e6d253 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_ether/rte_ether_version.map
+LIBABIVER := 1
+
SRCS-y += rte_ethdev.c
#
diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
index a449ec2..17778ba 100644
--- a/lib/librte_hash/Makefile
+++ b/lib/librte_hash/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_hash/rte_hash_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index fba05d0..43313e4 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_ip_frag/rte_ipfrag_version.map
+LIBABIVER := 1
+
#source files
ifeq ($(CONFIG_RTE_MBUF_REFCNT),y)
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
index be6f21a..7c8dc17 100644
--- a/lib/librte_ivshmem/Makefile
+++ b/lib/librte_ivshmem/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAPS := $(RTE_SDK)/lib/librte_ivshmem/rte_ivshmem_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index c119fc1..59abd85 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := $(RTE_SDK)/lib/librte_kni/rte_kni_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
index 83a42b1..10713db 100644
--- a/lib/librte_kvargs/Makefile
+++ b/lib/librte_kvargs/Makefile
@@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_kvargs/rte_kvargs_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
index 05de8d9..c99bfbd 100644
--- a/lib/librte_lpm/Makefile
+++ b/lib/librte_lpm/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_lpm/rte_lpm_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
index 1a5c288..3bb7a99 100644
--- a/lib/librte_malloc/Makefile
+++ b/lib/librte_malloc/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_malloc.a
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_malloc/rte_malloc_version.map
diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
index 5cd4941..3cf94d1 100644
--- a/lib/librte_mbuf/Makefile
+++ b/lib/librte_mbuf/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_mbuf/rte_mbuf_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
index 07b5b4e..2c2a6e8 100644
--- a/lib/librte_mempool/Makefile
+++ b/lib/librte_mempool/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_mempool/rte_mempool_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index 0778690..f58822e 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_meter/rte_meter_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 5465d00..df44f51 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pipeline/rte_pipeline_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_af_packet/Makefile b/lib/librte_pmd_af_packet/Makefile
index 41bb2cd..bd7d091 100644
--- a/lib/librte_pmd_af_packet/Makefile
+++ b/lib/librte_pmd_af_packet/Makefile
@@ -38,6 +38,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_af_packet.a
+LIBABIVER := 1
+
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_af_packet/rte_pmd_af_packet_version.map
CFLAGS += -O3
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 7376018..974cb65 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_bond/rte_eth_bond_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
index e225bfe..a5e3b66 100644
--- a/lib/librte_pmd_e1000/Makefile
+++ b/lib/librte_pmd_e1000/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_e1000/rte_pmd_e1000_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_enic/Makefile b/lib/librte_pmd_enic/Makefile
index 6359ac0..3238d85 100644
--- a/lib/librte_pmd_enic/Makefile
+++ b/lib/librte_pmd_enic/Makefile
@@ -37,6 +37,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_enic.a
+LIBABIVER := 1
+
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_enic/rte_pmd_enic_version.map
CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_enic/vnic/
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index 9c26ab6..e4f17ec 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_i40e/rte_pmd_i40e_version.map
+LIBABIVER := 1
+
#
# Add extra flags for base driver files (also known as shared code)
# to disable warnings
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index c9e8665..a38685b 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_ixgbe/rte_pmd_ixgbe_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
index fff5572..8f05c2c 100644
--- a/lib/librte_pmd_pcap/Makefile
+++ b/lib/librte_pmd_pcap/Makefile
@@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_pcap/rte_pmd_pcap_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
index 25ad27f..24c57fc 100644
--- a/lib/librte_pmd_ring/Makefile
+++ b/lib/librte_pmd_ring/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_ring/rte_eth_ring_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
index bf51bd9..d0bec84 100644
--- a/lib/librte_pmd_virtio/Makefile
+++ b/lib/librte_pmd_virtio/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_virtio/rte_pmd_virtio_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index e5a1c6b..2b418f4 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_vmxnet3/rte_pmd_vmxnet3_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
index 0a08b1b..6132c1c 100644
--- a/lib/librte_pmd_xenvirt/Makefile
+++ b/lib/librte_pmd_xenvirt/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_xenvirt/rte_eth_xenvirt_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index f01a12c..98f9eec 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_port/rte_port_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index faf73a5..f96330a 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := $(RTE_SDK)/lib/librte_power/rte_power_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c rte_power_acpi_cpufreq.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_kvm_vm.c guest_channel.c
diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
index 0adaa00..fa697ea 100644
--- a/lib/librte_ring/Makefile
+++ b/lib/librte_ring/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_ring/rte_ring_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 205fb7a..1a54bf9 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
EXPORT_MAP := $(RTE_SDK)/lib/librte_sched/rte_sched_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
index 5b54acc..29b768c 100644
--- a/lib/librte_table/Makefile
+++ b/lib/librte_table/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_table/rte_table_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
index f703e5f..01772c7 100644
--- a/lib/librte_timer/Makefile
+++ b/lib/librte_timer/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_timer/rte_timer_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 7f8c5dc..2747070 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_vhost.a
+LIBABIVER := 1
+
EXPORT_MAP := $(RTE_SDK)/lib/librte_vhost/rte_vhost_version.map
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 -lfuse
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 2299cbe..e0a1863 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -37,10 +37,8 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
-
ifeq ($(RTE_BUILD_SHARED_LIB),y)
-LIB := $(patsubst %.a,%.so,$(LIB))
-
+LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
endif
@@ -63,6 +61,7 @@ build: _postbuild
exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
+
ifeq ($(LINK_USING_CC),1)
# Override the definition of LD here, since we're linking with CC
LD := $(CC) $(CPU_CFLAGS)
@@ -113,6 +112,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
#
ifeq ($(RTE_BUILD_SHARED_LIB),y)
$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
+ifeq ($(LIBABIVER),)
+ @echo "Must Specify a $(LIB) ABI version"
+ @exit 1
+endif
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(if $(D),\
@echo -n "$< -> $@ " ; \
@@ -126,6 +129,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
$(depfile_missing),\
$(depfile_newer)),\
$(O_TO_S_DO))
+
ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
$(if $(or \
$(file_missing),\
@@ -163,10 +167,12 @@ endif
# install lib in $(RTE_OUTPUT)/lib
#
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
+ $(eval LIBSONAME := $(basename $(LIB)))
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
ifneq ($(LIB),)
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+ $(Q)ln -s -f $(RTE_OUTPUT)/lib/$(LIB) $(RTE_OUTPUT)/lib/$(LIBSONAME)
endif
#
--
1.9.3
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
@ 2014-12-20 21:01 4% ` Neil Horman
2014-12-20 21:01 7% ` [dpdk-dev] [PATCH 3/4] Add library version extenstion Neil Horman
` (11 subsequent siblings)
12 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-12-20 21:01 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++++++
lib/librte_compat/rte_compat.h | 96 ++++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 6 +++
4 files changed, 141 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 0ffc982..d617d81 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -31,6 +31,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..3415c7b
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..d99e362
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,96 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+
+/*
+ * This is just a stringification macro for use below.
+ */
+#define SA(x) #x
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. to support that the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ * char foo(int value, int otherval) { ...}
+ *
+ * 5) Mark the newest version as the default version
+ * BIND_DEFAULT_SYMBOL(foo, 1.9);
+ *
+ */
+#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
+#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
+#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+#define BASE_SYMBOL(b, n)
+#define BIND_DEFAULT_SYMBOL(b, v)
+
+/*
+ * RTE_BUILD_SHARED_LIB
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 81bf8e1..2299cbe 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
@@ -161,7 +165,9 @@ endif
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
+ifneq ($(LIB),)
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+endif
#
# Clean all generated files
--
1.9.3
^ permalink raw reply [relevance 4%]
* [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility
@ 2014-12-20 21:01 4% Neil Horman
2014-12-20 21:01 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
` (12 more replies)
0 siblings, 13 replies; 200+ results
From: Neil Horman @ 2014-12-20 21:01 UTC (permalink / raw)
To: dev
GI: [PATCH 1/4] compat: Add infrastructure to support symbol versioninBI
develops and changes quickly, which makes it difficult for
applications to keep up with the latest version of the library, especially when
it (the DPDK) is built as a set of shared objects, as applications may be built
against an older version of the library.
To mitigate this, this patch series introduces support for library and symbol
versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
1) Adds initial support for library versioning. Each library now has a version
map that explicitly calls out what symbols are exported to using applications,
and assigns version(s) to them
2) Adds support macros so that when libraries create incompatible ABI's,
multiple versions may be supported so that applications linked against older
DPDK releases can continue to function
3) Adds library soname versioning suffixes so that when ABI's must be broken in
a fashion that requires a rebuild of older applications, they will break at load
time, rather than cause unexpected issues at run time.
4) Adds documentation for ABI policy, and provides space to document deprecated
ABI versions, so that applications might be warned of impending changes.
With these elements in place the DPDK has some support to allow for the extended
maintenence of older API's while still allowing the freedom to develop new and
improved API's.
Implementing this feature will require some additional effort on the part of
developers and reviewers. When reviewing patches, must be checked against
existing exports to ensure that the function prototypes are not changing. If
they are, the versioning macros must be used, and the library export map should
be updated to reflect the new version of the function.
When data structures change, if those structures are application accessible,
apis that accept or return instances of those data structures should have new
versions created so that users of the old data structure version might co-exist
at the same time.
Note it was requested that this series be delayed until DPDK 2.0, so this is a
repost, now that DPDK 1.8 has been tagged.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Robert Love" <robert.w.love@intel.com>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] versioning and maintenance
2014-11-21 13:23 4% ` Thomas Monjalon
@ 2014-11-21 20:17 4% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-11-21 20:17 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Fri, Nov 21, 2014 at 02:23:15PM +0100, Thomas Monjalon wrote:
> 2014-11-20 20:05, Neil Horman:
> > On Thu, Nov 20, 2014 at 10:08:25PM +0100, Thomas Monjalon wrote:
> > > 2014-11-20 13:25, Neil Horman:
> > > > On Thu, Nov 20, 2014 at 06:09:10PM +0100, Thomas Monjalon wrote:
> > > > > 2014-11-19 10:13, Neil Horman:
> > > > > > On Wed, Nov 19, 2014 at 11:35:08AM +0000, Bruce Richardson wrote:
> > > > > > > On Wed, Nov 19, 2014 at 12:22:14PM +0100, Thomas Monjalon wrote:
> > > > > > > > Following the discussion we had with Neil during the conference call,
> > > > > > > > I suggest this plan, starting with the next release (2.0):
> > > > > > > > - add version numbers to libraries
> > > > > > > > - add version numbers to functions inside .map files
> > > > > > > > - create a git tree dedicated to maintenance and API compatibility
> > > > > > > >
> > > > > > > > It means these version numbers must be incremented when breaking the API.
> > > > > > > > Though the old code paths will be maintained and tested separately by volunteers.
> > > > > > > > A mailing list for maintenance purpose could be created if needed.
> > > > > > > >
> > > > > > > Hi Thomas,
> > > > > > >
> > > > > > > I really think that the versionning is best handled inside the main repository
> > > > > > > itself. Given that the proposed deprecation policy is over two releases i.e. an
> > > > > > > API is marked deprecated in release X and then removed in X+1, I don't see the
> > > > > > > maintaining of old code paths to be particularly onerous.
> > > > > > >
> > > > > > > /Bruce
> > > > > >
> > > > > > I agree with Bruce, even if it is on occasion an added workload, its not the
> > > > > > sort of thing that can or should be placed on an alternate developer. Backwards
> > > > > > compatibility is the sort of thing that has to be on the mind of the developer
> > > > > > when modifying an API, and on the mind of the reviewer when reviewing code. To
> > > > > > shunt that responsibility elsewhere invites the opportunity for backwards
> > > > > > compatibilty to be a second class citizen who's goal will never be reached,
> > > > > > because developers instituting ABI changes will never care about the
> > > > > > consequences, and anyone worrying about backwards compatibility will always be
> > > > > > playing catch up, possibly allowing ABI breaks to slip through.
> > > > > >
> > > > > > Neil
> > > > >
> > > > > Before taking a decision, we should detail every concern.
> > > > >
> > > > > 1/
> > > > > Currently there are not a lot of API refactoring because DPDK is well tailored
> > > > > for x86 and Intel NICs. But we are seeing that new CPU and new NICs to support
> > > > > would require some adaptations.
> > > > >
> > > > Yes, you're absolutely right here. I had hoped that, during my presentation
> > > > that this would happen occasionaly, and that we would need to deal with it.
> > > > What I think you are implying here (correct me if I'm wrong), is that you would
> > > > advocate that we wait to introduce ABI versioning until after such refactoring
> > > > is, for lack of a better term "complete". The problem here is that, software
> > > > that is growing in user base is never "complete". What you are effectively
> > > > saying is that you want to wait until the API is in a state in which no (or
> > > > almost no) more changes are required, then fixate it. Thats quite simply never
> > > > going to happen. And if it does, it obviates the need for versioning at all.
> > >
> > > I agree Neil. This point is not about how long we should wait but how the
> > > overhead could be estimate for coming releases.
> > >
> > Well, I understand the desire, but I'm not sure how it can be accomplished. For
> > a given release, the overhead will be dependent on two factors:
> >
> > 1) The number off ABI changes in a given release
> >
> > 2) The extent of the ABI changes that were made.
> >
> > If we have a way to predict those, then we can estimate the overhead, but
> > without that information, you're kinda stuck. That said, if we all concur that
> > this is a necessecary effort to undertake, then the overhead is, not overly
> > important. Whats more important is providing enough time to alot enough time to
> > do the work for a given project. That is to say, when undertaking a large
> > refactoring, or other project that promises to make significant ABI changes,
> > that the developer needs to factor in time to design an implement backwards
> > compatibility. Put another way, if the developer does their job right, and
> > takes backwards compatibility seriously, the overhead to you as a maintainer is
> > nil. The onus to handle this extra effort needs to be on the developer.
> >
> > > > > 2/
> > > > > I'm curious to know how you would handle a big change like the recent mbuf rework.
> > > > > Should we duplicate the structure and all the functions using mbuf?
> > > >
> > > > Several ways, what you suggest above is one way, although thats what I would
> > > > consider to be a pessimal case. Ideally such large changes are extreemely rare
> > > > (a search of the git history I think confirms this). Much more common are
> > > > small, limited changes to various API's for which providing multiple versions of
> > > > a function is a much more reasonable approach.
> > > >
> > > > In the event that we do decide to do a refactor that is so far reaching that we
> > > > simply don't feel like multi-versioning is feasible, the recourse is then to
> > > > deprecate the old API, publish that information on the deprecation schedule,
> > > > wait for a release, then replace it wholesale. When the API is released, we
> > > > bump the DSO version number. Note the versioning policy never guarantees that
> > > > backwards compatibility will always be available, nor does it stipulate that a
> > > > newer version of the API is available prior to removing the old one. The goal
> > > > here is to give distributors and application vendors advanced notice of ABI
> > > > breaking changes so that they can adapt appropriately before they are caught off
> > > > guard. If the new ABI can't be packaged alongside the old, then so be it,
> > > > downstream vendors will have to use the upstream git head to test and validate,
> > > > rather than a newer distribution release
> > >
> > > Seems reasonable.
> > >
> > > > Ideally though, that shouldn't happen, because it causes downstream headaches,
> > > > and we would really like to avoid that. Thats why I feel its so important to
> > > > keep this work in the main tree. If we segregate it to a separate location it
> > > > will make it all to easy for developers to ignore these needs and just assume we
> > > > constantly drop old ABI versions without providing backwards compatibility.
> > > >
> > > > > 3/
> > > > > Should we add new fields at the end of its structure to avoid ABI breaking?
> > > > >
> > > > In the common case yes, this usually avoids ABI breakage, though it can't always
> > > > be relied upon (e.g. cases where structures are statically allocated by an
> > > > application). And then there are patches that attempt to reduce memory usage
> > > > and increase performance by re-arranging structures. In those cases we need to
> > > > do ABI versioning or announce/delay/release as noted above, though again, that
> > > > should really be avoided if possible.
> > >
> > > So there is no hope of having fields logically sorted.
> > > Not a major problem but we have to know it. And it should probably be
> > > documented if we choose this way.
> > >
> > Sure, though I'm not sure I agree with the statement above. Having fields
> > logically sorted seems like it should be a forgone conclusion in that the
> > developer should have laid those fields out in some semblance of order in the
> > first place. If a large data structure re-ordering is taking place such that
> > structure fields are getting rearranged, that in my mind is part of a large
> > refactoring for which the entire API that is affected by those data structures
> > must have a new version created to provide backward compatibility, or in the
> > extreeme case, we may need to preform a warn and deprecate/exchange operation as
> > noted previously, though again, that is a Nuclear option.
>
> Just to illustrate my thought:
> Let's imagine this struct {
> fish_name;
> fish_taste;
> vegetables_name;
> }
> When adding the new field "fish_cooking", we'll add it at the end to avoid ABI break.
> struct {
> fish_name;
> fish_taste;
> vegetables_name;
> fish_cooking;
> }
You're right, asthetically the above is displeasing, which is unfortunate. The
decision we have to make is twofold:
1) Are asthetics more important that backwards compatibility (theres also a
correlary here, which is "are the performance/space gains acheived by
reorganizing the above structure sufficent to warant an ABI breakage)
and
2) How can we mitigate the ABI impact if the answer to the above is "yes"
I think the answer to (1) is going to be situationally specific. Generally,
Asthetics aren't worth breaking ABI, but performance gains might be, if they're
large enough. We'll have to wait for an example case to see where exactly we
draw that line
Assuming the answer to (2) is yes, then we need to know how to mitigate it.
Ideally what we would do is create a secondary structure like so:
struct1 {
fish_name;
fish_taste;
veg_name;
};
struct2 {
fish_name;
fish_taste;
fish_cook;
veg_name;
};
and then we would version the API calls that use struct1 to instead accept
struct2. So if a function used struct1 we would have:
static void foo_v1(struct1 *a) {
struct2 b;
b.fish_name = a->name;
b.fish_taste = a->fish_taste;
b.veg_name = a->veg_name;
a-fish_cook = SOME_VALUE;
foo_v2(&b);
}
VERSION_SYMBOL(foo, v1, 1.8);
static void foo_v2(struct2 *a) {
...
if (a->fish_cook == SOME_VALUE)
/* we know this is from the old api version */
...
}
VERSION_SYMBOL(foo, v2, 1.9);
That would be repeated of course for every function that used struct1. Then we
can decide on a deprecation schedule, which might be the next release after this
change is published. Or it might be longer, if the decision is that this change
is easy enough to maintain.
> It's mostly an esthetic/readability consequence.
> Now I'm hungry ;)
>
I don't think I ever told you, my family and I were in Paris last summer, and
had lunch at this place just south of Notre Dame. My wife still occasionally
mentions that as the best fish she ever had. And my 7 year old daughter is
willing to forgo a trip to Disney World to go back :)
> > > > > 4/
> > > > > Developers contribute because they need some changes. So when breaking
> > > > > an API, their application is already ready for the new version.
> > > > > I mean the author of such patch is probably not really motivated to keep ABI
> > > > > compability and duplicate the code path.
> > > > >
> > > > What? That doesn't make any sense. Its our job to enforce this requirement on
> > > > developers during the review cycle. If you don't feel like we can enforce
> > > > coding requirements on the project, we've already lost. I agree that an
> > > > application developer submitting a patch for DPDK might not care about ABI
> > > > compatibility because they've already modified their application, but they (and
> > > > we) need to recognize that there are more than just a handful of users of the
> > > > DPDK, some of whom don't participate in this community (i.e. are simply end
> > > > users). We need to make sure all users needs are met. Thats the entire point
> > > > of this patch series, to make DPDK available to a wider range of users.
> > >
> > > Exact. To make it simple, you care about end users and I have to care about
> > > developers motivation. But I perfectly understand the end users needs.
> > > I don't say we cannot enforce coding requirements. I just think it will be
> > > less pleasant.
> > >
> > I disagree with the assertion that you will loose developers becausee they don't
> > care about compatibility. You're developer base may change. This is no
> > different than any other requirement that you place on a developer. You make
> > all sorts of mandates regarding development (they can't break other older
> > supported cpu architecture, their code has to compile on all configurations,
> > etc). This is no different.
> >
> > > > > 5/
> > > > > Intead of simply modifying an API function, it would appear as a whole new
> > > > > function with some differences compared to the old one. Such change is really
> > > > > not convenient to review.
> > > >
> > > > Um, yes, versioning is the process of creating an additional
> > > > function that closely resembles an older version of the same function, but with
> > > > different arguments and a newer version number. Thats what it is by defintion,
> > > > and yes, its additional work. All you're saying here is that, its extra work
> > > > and we shouldn't do it. I thought I made this clear on the call, its been done
> > > > in thousands of other libraries, but if you just don't want to do it, then you
> > > > should abandon distributions as a way to reach a larger community, but if you
> > > > want to see the DPDK reach a larger community, then this is something that has
> > > > to happen, hard or not.
> > >
> > > The goal of this discussion is to establish all the implications of this
> > > decision. We expose the facts. No conclusion.
> > >
> > You haven't exposed a fact, you've asserted an opinion. Theres is no notion of
> > something being convienient or inconvienient to review in any quantitative way.
> > If facts are your goal, you missed the mark here.
>
> Maybe you use a tool that I don't know.
> My main material for review is the patch. And I think it's simpler to check an
> one-line change than a duplicated code path. But instead of giving my opinion,
> I must expose what it looks like for a simple example:
>
> - void cook_fish()
> + void cook_fish(oil_bottle)
> {
> + use_oil(oil_bottle);
> start_fire();
> put_fish();
> wait();
> stop_fire();
> }
>
> vs
>
> - void cook_fish()
> + void __vsym cook_fish_v1()
> {
> start_fire();
> put_fish();
> wait();
> stop_fire();
> }
> + VERSION_SYMBOL(cook_fish, _v1, 1);
> + void cook_fish(oil_bottle)
> + {
> + use_oil(oil_bottle);
> + start_fire();
> + put_fish();
> + wait();
> + stop_fire();
> + }
> + BIND_DEFAULT_SYMBOL(cook_fish, 2);
>
You make a fair point in that, generally speaking less code is easier to review
than more code, but that said, you need to normalize the comparison. That is to
say, in the example above your first patch adds functionality (i.e. you add a
feature by which you use oil to cook a fish), in the second patch, you not only
add that feature, but allow older code that was already built to continue to
work. You've not just added complexity, you've added features as well. Its
like comparing a patch that adds features a and b, and indicating that you
would only accept feature a because you didn't want to review 2 features. I
think thats important to remember, we're not adding code for the sake of making
our lives more difficult. We're doing it to fullfill a need that a large group
of potential end users have.
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] versioning and maintenance
2014-11-21 1:05 4% ` Neil Horman
@ 2014-11-21 13:23 4% ` Thomas Monjalon
2014-11-21 20:17 4% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2014-11-21 13:23 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2014-11-20 20:05, Neil Horman:
> On Thu, Nov 20, 2014 at 10:08:25PM +0100, Thomas Monjalon wrote:
> > 2014-11-20 13:25, Neil Horman:
> > > On Thu, Nov 20, 2014 at 06:09:10PM +0100, Thomas Monjalon wrote:
> > > > 2014-11-19 10:13, Neil Horman:
> > > > > On Wed, Nov 19, 2014 at 11:35:08AM +0000, Bruce Richardson wrote:
> > > > > > On Wed, Nov 19, 2014 at 12:22:14PM +0100, Thomas Monjalon wrote:
> > > > > > > Following the discussion we had with Neil during the conference call,
> > > > > > > I suggest this plan, starting with the next release (2.0):
> > > > > > > - add version numbers to libraries
> > > > > > > - add version numbers to functions inside .map files
> > > > > > > - create a git tree dedicated to maintenance and API compatibility
> > > > > > >
> > > > > > > It means these version numbers must be incremented when breaking the API.
> > > > > > > Though the old code paths will be maintained and tested separately by volunteers.
> > > > > > > A mailing list for maintenance purpose could be created if needed.
> > > > > > >
> > > > > > Hi Thomas,
> > > > > >
> > > > > > I really think that the versionning is best handled inside the main repository
> > > > > > itself. Given that the proposed deprecation policy is over two releases i.e. an
> > > > > > API is marked deprecated in release X and then removed in X+1, I don't see the
> > > > > > maintaining of old code paths to be particularly onerous.
> > > > > >
> > > > > > /Bruce
> > > > >
> > > > > I agree with Bruce, even if it is on occasion an added workload, its not the
> > > > > sort of thing that can or should be placed on an alternate developer. Backwards
> > > > > compatibility is the sort of thing that has to be on the mind of the developer
> > > > > when modifying an API, and on the mind of the reviewer when reviewing code. To
> > > > > shunt that responsibility elsewhere invites the opportunity for backwards
> > > > > compatibilty to be a second class citizen who's goal will never be reached,
> > > > > because developers instituting ABI changes will never care about the
> > > > > consequences, and anyone worrying about backwards compatibility will always be
> > > > > playing catch up, possibly allowing ABI breaks to slip through.
> > > > >
> > > > > Neil
> > > >
> > > > Before taking a decision, we should detail every concern.
> > > >
> > > > 1/
> > > > Currently there are not a lot of API refactoring because DPDK is well tailored
> > > > for x86 and Intel NICs. But we are seeing that new CPU and new NICs to support
> > > > would require some adaptations.
> > > >
> > > Yes, you're absolutely right here. I had hoped that, during my presentation
> > > that this would happen occasionaly, and that we would need to deal with it.
> > > What I think you are implying here (correct me if I'm wrong), is that you would
> > > advocate that we wait to introduce ABI versioning until after such refactoring
> > > is, for lack of a better term "complete". The problem here is that, software
> > > that is growing in user base is never "complete". What you are effectively
> > > saying is that you want to wait until the API is in a state in which no (or
> > > almost no) more changes are required, then fixate it. Thats quite simply never
> > > going to happen. And if it does, it obviates the need for versioning at all.
> >
> > I agree Neil. This point is not about how long we should wait but how the
> > overhead could be estimate for coming releases.
> >
> Well, I understand the desire, but I'm not sure how it can be accomplished. For
> a given release, the overhead will be dependent on two factors:
>
> 1) The number off ABI changes in a given release
>
> 2) The extent of the ABI changes that were made.
>
> If we have a way to predict those, then we can estimate the overhead, but
> without that information, you're kinda stuck. That said, if we all concur that
> this is a necessecary effort to undertake, then the overhead is, not overly
> important. Whats more important is providing enough time to alot enough time to
> do the work for a given project. That is to say, when undertaking a large
> refactoring, or other project that promises to make significant ABI changes,
> that the developer needs to factor in time to design an implement backwards
> compatibility. Put another way, if the developer does their job right, and
> takes backwards compatibility seriously, the overhead to you as a maintainer is
> nil. The onus to handle this extra effort needs to be on the developer.
>
> > > > 2/
> > > > I'm curious to know how you would handle a big change like the recent mbuf rework.
> > > > Should we duplicate the structure and all the functions using mbuf?
> > >
> > > Several ways, what you suggest above is one way, although thats what I would
> > > consider to be a pessimal case. Ideally such large changes are extreemely rare
> > > (a search of the git history I think confirms this). Much more common are
> > > small, limited changes to various API's for which providing multiple versions of
> > > a function is a much more reasonable approach.
> > >
> > > In the event that we do decide to do a refactor that is so far reaching that we
> > > simply don't feel like multi-versioning is feasible, the recourse is then to
> > > deprecate the old API, publish that information on the deprecation schedule,
> > > wait for a release, then replace it wholesale. When the API is released, we
> > > bump the DSO version number. Note the versioning policy never guarantees that
> > > backwards compatibility will always be available, nor does it stipulate that a
> > > newer version of the API is available prior to removing the old one. The goal
> > > here is to give distributors and application vendors advanced notice of ABI
> > > breaking changes so that they can adapt appropriately before they are caught off
> > > guard. If the new ABI can't be packaged alongside the old, then so be it,
> > > downstream vendors will have to use the upstream git head to test and validate,
> > > rather than a newer distribution release
> >
> > Seems reasonable.
> >
> > > Ideally though, that shouldn't happen, because it causes downstream headaches,
> > > and we would really like to avoid that. Thats why I feel its so important to
> > > keep this work in the main tree. If we segregate it to a separate location it
> > > will make it all to easy for developers to ignore these needs and just assume we
> > > constantly drop old ABI versions without providing backwards compatibility.
> > >
> > > > 3/
> > > > Should we add new fields at the end of its structure to avoid ABI breaking?
> > > >
> > > In the common case yes, this usually avoids ABI breakage, though it can't always
> > > be relied upon (e.g. cases where structures are statically allocated by an
> > > application). And then there are patches that attempt to reduce memory usage
> > > and increase performance by re-arranging structures. In those cases we need to
> > > do ABI versioning or announce/delay/release as noted above, though again, that
> > > should really be avoided if possible.
> >
> > So there is no hope of having fields logically sorted.
> > Not a major problem but we have to know it. And it should probably be
> > documented if we choose this way.
> >
> Sure, though I'm not sure I agree with the statement above. Having fields
> logically sorted seems like it should be a forgone conclusion in that the
> developer should have laid those fields out in some semblance of order in the
> first place. If a large data structure re-ordering is taking place such that
> structure fields are getting rearranged, that in my mind is part of a large
> refactoring for which the entire API that is affected by those data structures
> must have a new version created to provide backward compatibility, or in the
> extreeme case, we may need to preform a warn and deprecate/exchange operation as
> noted previously, though again, that is a Nuclear option.
Just to illustrate my thought:
Let's imagine this struct {
fish_name;
fish_taste;
vegetables_name;
}
When adding the new field "fish_cooking", we'll add it at the end to avoid ABI break.
struct {
fish_name;
fish_taste;
vegetables_name;
fish_cooking;
}
So "fish_*" fields won't be grouped.
It's mostly an esthetic/readability consequence.
Now I'm hungry ;)
> > > > 4/
> > > > Developers contribute because they need some changes. So when breaking
> > > > an API, their application is already ready for the new version.
> > > > I mean the author of such patch is probably not really motivated to keep ABI
> > > > compability and duplicate the code path.
> > > >
> > > What? That doesn't make any sense. Its our job to enforce this requirement on
> > > developers during the review cycle. If you don't feel like we can enforce
> > > coding requirements on the project, we've already lost. I agree that an
> > > application developer submitting a patch for DPDK might not care about ABI
> > > compatibility because they've already modified their application, but they (and
> > > we) need to recognize that there are more than just a handful of users of the
> > > DPDK, some of whom don't participate in this community (i.e. are simply end
> > > users). We need to make sure all users needs are met. Thats the entire point
> > > of this patch series, to make DPDK available to a wider range of users.
> >
> > Exact. To make it simple, you care about end users and I have to care about
> > developers motivation. But I perfectly understand the end users needs.
> > I don't say we cannot enforce coding requirements. I just think it will be
> > less pleasant.
> >
> I disagree with the assertion that you will loose developers becausee they don't
> care about compatibility. You're developer base may change. This is no
> different than any other requirement that you place on a developer. You make
> all sorts of mandates regarding development (they can't break other older
> supported cpu architecture, their code has to compile on all configurations,
> etc). This is no different.
>
> > > > 5/
> > > > Intead of simply modifying an API function, it would appear as a whole new
> > > > function with some differences compared to the old one. Such change is really
> > > > not convenient to review.
> > >
> > > Um, yes, versioning is the process of creating an additional
> > > function that closely resembles an older version of the same function, but with
> > > different arguments and a newer version number. Thats what it is by defintion,
> > > and yes, its additional work. All you're saying here is that, its extra work
> > > and we shouldn't do it. I thought I made this clear on the call, its been done
> > > in thousands of other libraries, but if you just don't want to do it, then you
> > > should abandon distributions as a way to reach a larger community, but if you
> > > want to see the DPDK reach a larger community, then this is something that has
> > > to happen, hard or not.
> >
> > The goal of this discussion is to establish all the implications of this
> > decision. We expose the facts. No conclusion.
> >
> You haven't exposed a fact, you've asserted an opinion. Theres is no notion of
> something being convienient or inconvienient to review in any quantitative way.
> If facts are your goal, you missed the mark here.
Maybe you use a tool that I don't know.
My main material for review is the patch. And I think it's simpler to check an
one-line change than a duplicated code path. But instead of giving my opinion,
I must expose what it looks like for a simple example:
- void cook_fish()
+ void cook_fish(oil_bottle)
{
+ use_oil(oil_bottle);
start_fire();
put_fish();
wait();
stop_fire();
}
vs
- void cook_fish()
+ void __vsym cook_fish_v1()
{
start_fire();
put_fish();
wait();
stop_fire();
}
+ VERSION_SYMBOL(cook_fish, _v1, 1);
+ void cook_fish(oil_bottle)
+ {
+ use_oil(oil_bottle);
+ start_fire();
+ put_fish();
+ wait();
+ stop_fire();
+ }
+ BIND_DEFAULT_SYMBOL(cook_fish, 2);
> > > > 6/
> > > > Testing ABI compatibility could be tricky. We would need a tool to check it's
> > > > mostly OK. The good place for such a tool is in app/test. It was designed to be
> > > > the unit tests of the API.
> > >
> > > That seems like a reasonable idea, but I'm not sure what the concern is. Are
> > > you saying that you need to test every old version of the ABI? Thats fine. I
> > > really don't think it has to be as stringent as the latest version testing, but
> > > if you want to, it should be as easy as building the latest release of
> > > the DPDK libraries, and the previous version of the test application. That will
> > > force the previous version code paths to be used by the test app in the new
> > > library and, if the test fully exercize the api, then you should get pretty good
> > > coverage.
> >
> > Yes it will provide an unit test to developpers.
> >
> > > > 7/
> > > > This system would allow application developpers to upgrade DPDK to n+1 without
> > > > rebuilding. But when upgrading to n+2, they should have adapted their
> > > > application to comply with n+1 API (because n will be removed).
> > >
> > > Only assuming that the old ABI facet was deprecated at the same time the new ABI
> > > was introduced. Theres nothing that says we have to do that, but I digress.
> > >
> > > > So this solution offers a delay between the upgrade decision and the
> > > > app work. Note that they could prepare their application before upgrading.
> > > > Anyway, an upgrade should be tested before doing it effectively. The behaviour
> > > > of the application could change and require some adaptations.
> > > >
> > > Um, yes. Whats the concern here?
> >
> > I'm just trying to figure which workflows are eased by progressive ABI deprecation.
> >
> The workflow for end users, in that they are given an alert prior to a breaking
> change, and the time to fix it, in a way that distributions can manage without
> having to individually (as distributions) undertake that effort on their own, an
> in a way that might one day provide for multi version compatibility.
>
> > > Downstream application developers need 2
> > > things:
> > >
> > > A) The ability to note that ABI changes are comming so that they can adapt to
> > > the new version
> > >
> > > B) Time to do so
> > >
> > > The deprecation policy, if properly distributed by Distributions provide (A),
> > > and the ABI versioning provides (B). I.e. they can get all the latest bug fixes
> > > and enhancements while in parallel adapting to the comming new version. Note
> > > ideally this will happen rarely, as having to constantly rebuild/adapt does not
> > > sit will with application vendors who choose to go through distributions, but
> > > we'll do the best we can.
> >
> > It's an interesting point. In a long-term distribution model like RHEL, do you
> > plan to upgrade DPDK at each new release?
> >
> Given that you intermix hardware support with bug fixes and new features (which
> granted is not uncommon), yes, I don't see any way to avoid doing so. We could
> of course cherry pick bug fixes and non-ABI-breaking features, to preserve
> compatibility, but doing so diverges from upstream quickly to the point that it
> becomes extreemely difficult to maintain. As an example, the one project that
> Red Hat does this on routinely is the kernel, and to do so employs a staff of
> hundreds of engineers. No distribution wants to do that for every user space
> library that they support. They/we are willing to do minor fixes in a given
> release with the foreknoweldge that we can drop them when the next relase comes
> out, but beyond that, the logistics just don't scale.
>
> > > > 8/
> > > > How to handle a change in the implementation of a PMD which severely impact
> > > > the application? Example: an ol_flag was mis-used and the application has
> > > > a workaround to interpret this flag but it's now incompatible with the fix.
> > > >
> > > We run into this sometimes in Fedora and RHEL, and doesn't require versioning.
> > > The problem you describe is one in which something internal to the library that
> > > an application has come to rely on. Fixing the bug isn't typically considered
> > > within the purview of versioning, because you're not changing the ABI, you're
> > > just correcting a bug in the PMD's behavior. Customers who ask for the behavior
> > > to remain unchanged are asking for what's commonly referred to as "Bug for Bug
> > > compatibility" and in those cases the application vendor needs to release a
> > > corresponding fix. Developers can't be required to preserve buggy behavior.
> > >
> > > It should also be noted that in this case, ABI never changed. All the data
> > > types/sizes/locations/etc have remained unchanged. Its just a bug in
> > > interpretation of data passed accross the ABI. As such, theres nothing for ABI
> > > versioning to do here.
> >
> > OK, that's what I thought.
> >
> > > > 9/
> > > > When we don't want to adapt an application, it means the development is
> > > > finished and we don't care about the new features of the library.
> > > > So I wonder if it wouldn't be more appropriate to provide stable releases
> > > > with true maintenance to such users. I understood that is what Redhat provides
> > > > to their customers.
> > > >
> > > No, thats incorrect, we frequently update packages to the latest upstream
> > > version when at all possible. We are able to do this sepcifically because
> > > upstream library releases provide ABI versioning, so that we can update with
> > > confidence. If they don't do that, then yes, we are often restricted to
> > > selecting a release and maintaining it for the duration of a major RHEL release,
> > > which implies that security and feature updates are extreemely limited
> > >
> > > That said, if you wanted to do ongoing maintenence on each release, I suppsose
> > > you could, in fact its somewhat simmilar to the -stable series that the kernel
> > > uses, exept that the kernel enoys an extreemly stable user space ABI, and even
> > > then the kernel -stable series doesn't take internal ABI changing patches, so
> > > theres alot of divergence. You don't currently have that stable ABI interface,
> > > and so I think you'll find that that doing this is way more work than just
> > > supporting versioning.
> > >
> > > To illustrate, lets say you want to support maintenence releases the latest 3
> > > releases of the DPDK with patches. To do this, for every patch that is posted
> > > to the dpdk that is a bug fix, you will have to apply it four times, one for
> > > the git head, and again for each of the three releases that you are doing
> > > maintenence on. the patch will of course apply cleanly to the git head, as
> > > thats what the developer wrote it against, but the other three releases have
> > > every opportunity to conflict with code introduced in the git head but that
> > > couldn't be taken into the maintenece releases. Fixing those up is work that
> > > you will either have to do, or request that the patch author do. And for this
> > > work you will provide distibutions with about 2 years of ABI stability
> > > (presuming an ~8 month release cycle), after which they are back to just living
> > > with whatever they stabilized on until the next major relase (note a single RHEL
> > > major release has a 10+ year life cycle). I would personally rather avoid that
> > > work, and just do the ABI compatibility, as those patches are far fewer in
> > > number, and it buys for the effort.
> >
> > Interesting point of view.
> > Note that there is no plan to maintain stable version on dpdk.org.
> > But if some volunteers want absolutely to do it (even after reading your comment),
> > we cannot forbid it.
> >
> Certainly, and as I noted the kernel does that. But given the rate of change
> that the DPDK undergoes, and the current size of the community, I don't think
> anyone is going to step up to do that work. Thats really the underlying problem
> here, you can solve this problem lots of ways if you have enough manpower, but
> given the resources at hand, doing versioning in the master tree is really the
> only viable solution.
>
> > > > Hope this discussion will bring a clear idea of what should be done with
> > > > which implications.
> > > > Thanks
> > Thanks again
I think my concerns are now well explained.
It was important to expose clearly what a such ABI policy means.
If nobody disagree with your approach, it should be accepted.
Thanks
--
Thomas
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] versioning and maintenance
2014-11-20 21:08 3% ` Thomas Monjalon
@ 2014-11-21 1:05 4% ` Neil Horman
2014-11-21 13:23 4% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-11-21 1:05 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Thu, Nov 20, 2014 at 10:08:25PM +0100, Thomas Monjalon wrote:
> 2014-11-20 13:25, Neil Horman:
> > On Thu, Nov 20, 2014 at 06:09:10PM +0100, Thomas Monjalon wrote:
> > > 2014-11-19 10:13, Neil Horman:
> > > > On Wed, Nov 19, 2014 at 11:35:08AM +0000, Bruce Richardson wrote:
> > > > > On Wed, Nov 19, 2014 at 12:22:14PM +0100, Thomas Monjalon wrote:
> > > > > > Following the discussion we had with Neil during the conference call,
> > > > > > I suggest this plan, starting with the next release (2.0):
> > > > > > - add version numbers to libraries
> > > > > > - add version numbers to functions inside .map files
> > > > > > - create a git tree dedicated to maintenance and API compatibility
> > > > > >
> > > > > > It means these version numbers must be incremented when breaking the API.
> > > > > > Though the old code paths will be maintained and tested separately by volunteers.
> > > > > > A mailing list for maintenance purpose could be created if needed.
> > > > > >
> > > > > Hi Thomas,
> > > > >
> > > > > I really think that the versionning is best handled inside the main repository
> > > > > itself. Given that the proposed deprecation policy is over two releases i.e. an
> > > > > API is marked deprecated in release X and then removed in X+1, I don't see the
> > > > > maintaining of old code paths to be particularly onerous.
> > > > >
> > > > > /Bruce
> > > >
> > > > I agree with Bruce, even if it is on occasion an added workload, its not the
> > > > sort of thing that can or should be placed on an alternate developer. Backwards
> > > > compatibility is the sort of thing that has to be on the mind of the developer
> > > > when modifying an API, and on the mind of the reviewer when reviewing code. To
> > > > shunt that responsibility elsewhere invites the opportunity for backwards
> > > > compatibilty to be a second class citizen who's goal will never be reached,
> > > > because developers instituting ABI changes will never care about the
> > > > consequences, and anyone worrying about backwards compatibility will always be
> > > > playing catch up, possibly allowing ABI breaks to slip through.
> > > >
> > > > Neil
> > >
> > > Before taking a decision, we should detail every concern.
> > >
> > > 1/
> > > Currently there are not a lot of API refactoring because DPDK is well tailored
> > > for x86 and Intel NICs. But we are seeing that new CPU and new NICs to support
> > > would require some adaptations.
> > >
> > Yes, you're absolutely right here. I had hoped that, during my presentation
> > that this would happen occasionaly, and that we would need to deal with it.
> > What I think you are implying here (correct me if I'm wrong), is that you would
> > advocate that we wait to introduce ABI versioning until after such refactoring
> > is, for lack of a better term "complete". The problem here is that, software
> > that is growing in user base is never "complete". What you are effectively
> > saying is that you want to wait until the API is in a state in which no (or
> > almost no) more changes are required, then fixate it. Thats quite simply never
> > going to happen. And if it does, it obviates the need for versioning at all.
>
> I agree Neil. This point is not about how long we should wait but how the
> overhead could be estimate for coming releases.
>
Well, I understand the desire, but I'm not sure how it can be accomplished. For
a given release, the overhead will be dependent on two factors:
1) The number off ABI changes in a given release
2) The extent of the ABI changes that were made.
If we have a way to predict those, then we can estimate the overhead, but
without that information, you're kinda stuck. That said, if we all concur that
this is a necessecary effort to undertake, then the overhead is, not overly
important. Whats more important is providing enough time to alot enough time to
do the work for a given project. That is to say, when undertaking a large
refactoring, or other project that promises to make significant ABI changes,
that the developer needs to factor in time to design an implement backwards
compatibility. Put another way, if the developer does their job right, and
takes backwards compatibility seriously, the overhead to you as a maintainer is
nil. The onus to handle this extra effort needs to be on the developer.
> > > 2/
> > > I'm curious to know how you would handle a big change like the recent mbuf rework.
> > > Should we duplicate the structure and all the functions using mbuf?
> >
> > Several ways, what you suggest above is one way, although thats what I would
> > consider to be a pessimal case. Ideally such large changes are extreemely rare
> > (a search of the git history I think confirms this). Much more common are
> > small, limited changes to various API's for which providing multiple versions of
> > a function is a much more reasonable approach.
> >
> > In the event that we do decide to do a refactor that is so far reaching that we
> > simply don't feel like multi-versioning is feasible, the recourse is then to
> > deprecate the old API, publish that information on the deprecation schedule,
> > wait for a release, then replace it wholesale. When the API is released, we
> > bump the DSO version number. Note the versioning policy never guarantees that
> > backwards compatibility will always be available, nor does it stipulate that a
> > newer version of the API is available prior to removing the old one. The goal
> > here is to give distributors and application vendors advanced notice of ABI
> > breaking changes so that they can adapt appropriately before they are caught off
> > guard. If the new ABI can't be packaged alongside the old, then so be it,
> > downstream vendors will have to use the upstream git head to test and validate,
> > rather than a newer distribution release
>
> Seems reasonable.
>
> > Ideally though, that shouldn't happen, because it causes downstream headaches,
> > and we would really like to avoid that. Thats why I feel its so important to
> > keep this work in the main tree. If we segregate it to a separate location it
> > will make it all to easy for developers to ignore these needs and just assume we
> > constantly drop old ABI versions without providing backwards compatibility.
> >
> > > 3/
> > > Should we add new fields at the end of its structure to avoid ABI breaking?
> > >
> > In the common case yes, this usually avoids ABI breakage, though it can't always
> > be relied upon (e.g. cases where structures are statically allocated by an
> > application). And then there are patches that attempt to reduce memory usage
> > and increase performance by re-arranging structures. In those cases we need to
> > do ABI versioning or announce/delay/release as noted above, though again, that
> > should really be avoided if possible.
>
> So there is no hope of having fields logically sorted.
> Not a major problem but we have to know it. And it should probably be
> documented if we choose this way.
>
Sure, though I'm not sure I agree with the statement above. Having fields
logically sorted seems like it should be a forgone conclusion in that the
developer should have laid those fields out in some semblance of order in the
first place. If a large data structure re-ordering is taking place such that
structure fields are getting rearranged, that in my mind is part of a large
refactoring for which the entire API that is affected by those data structures
must have a new version created to provide backward compatibility, or in the
extreeme case, we may need to preform a warn and deprecate/exchange operation as
noted previously, though again, that is a Nuclear option.
> > > 4/
> > > Developers contribute because they need some changes. So when breaking
> > > an API, their application is already ready for the new version.
> > > I mean the author of such patch is probably not really motivated to keep ABI
> > > compability and duplicate the code path.
> > >
> > What? That doesn't make any sense. Its our job to enforce this requirement on
> > developers during the review cycle. If you don't feel like we can enforce
> > coding requirements on the project, we've already lost. I agree that an
> > application developer submitting a patch for DPDK might not care about ABI
> > compatibility because they've already modified their application, but they (and
> > we) need to recognize that there are more than just a handful of users of the
> > DPDK, some of whom don't participate in this community (i.e. are simply end
> > users). We need to make sure all users needs are met. Thats the entire point
> > of this patch series, to make DPDK available to a wider range of users.
>
> Exact. To make it simple, you care about end users and I have to care about
> developers motivation. But I perfectly understand the end users needs.
> I don't say we cannot enforce coding requirements. I just think it will be
> less pleasant.
>
I disagree with the assertion that you will loose developers becausee they don't
care about compatibility. You're developer base may change. This is no
different than any other requirement that you place on a developer. You make
all sorts of mandates regarding development (they can't break other older
supported cpu architecture, their code has to compile on all configurations,
etc). This is no different.
> > > 5/
> > > Intead of simply modifying an API function, it would appear as a whole new
> > > function with some differences compared to the old one. Such change is really
> > > not convenient to review.
> >
> > Um, yes, versioning is the process of creating an additional
> > function that closely resembles an older version of the same function, but with
> > different arguments and a newer version number. Thats what it is by defintion,
> > and yes, its additional work. All you're saying here is that, its extra work
> > and we shouldn't do it. I thought I made this clear on the call, its been done
> > in thousands of other libraries, but if you just don't want to do it, then you
> > should abandon distributions as a way to reach a larger community, but if you
> > want to see the DPDK reach a larger community, then this is something that has
> > to happen, hard or not.
>
> The goal of this discussion is to establish all the implications of this
> decision. We expose the facts. No conclusion.
>
You haven't exposed a fact, you've asserted an opinion. Theres is no notion of
something being convienient or inconvienient to review in any quantitative way.
If facts are your goal, you missed the mark here.
> > > 6/
> > > Testing ABI compatibility could be tricky. We would need a tool to check it's
> > > mostly OK. The good place for such a tool is in app/test. It was designed to be
> > > the unit tests of the API.
> >
> > That seems like a reasonable idea, but I'm not sure what the concern is. Are
> > you saying that you need to test every old version of the ABI? Thats fine. I
> > really don't think it has to be as stringent as the latest version testing, but
> > if you want to, it should be as easy as building the latest release of
> > the DPDK libraries, and the previous version of the test application. That will
> > force the previous version code paths to be used by the test app in the new
> > library and, if the test fully exercize the api, then you should get pretty good
> > coverage.
>
> Yes it will provide an unit test to developpers.
>
> > > 7/
> > > This system would allow application developpers to upgrade DPDK to n+1 without
> > > rebuilding. But when upgrading to n+2, they should have adapted their
> > > application to comply with n+1 API (because n will be removed).
> >
> > Only assuming that the old ABI facet was deprecated at the same time the new ABI
> > was introduced. Theres nothing that says we have to do that, but I digress.
> >
> > > So this solution offers a delay between the upgrade decision and the
> > > app work. Note that they could prepare their application before upgrading.
> > > Anyway, an upgrade should be tested before doing it effectively. The behaviour
> > > of the application could change and require some adaptations.
> > >
> > Um, yes. Whats the concern here?
>
> I'm just trying to figure which workflows are eased by progressive ABI deprecation.
>
The workflow for end users, in that they are given an alert prior to a breaking
change, and the time to fix it, in a way that distributions can manage without
having to individually (as distributions) undertake that effort on their own, an
in a way that might one day provide for multi version compatibility.
> > Downstream application developers need 2
> > things:
> >
> > A) The ability to note that ABI changes are comming so that they can adapt to
> > the new version
> >
> > B) Time to do so
> >
> > The deprecation policy, if properly distributed by Distributions provide (A),
> > and the ABI versioning provides (B). I.e. they can get all the latest bug fixes
> > and enhancements while in parallel adapting to the comming new version. Note
> > ideally this will happen rarely, as having to constantly rebuild/adapt does not
> > sit will with application vendors who choose to go through distributions, but
> > we'll do the best we can.
>
> It's an interesting point. In a long-term distribution model like RHEL, do you
> plan to upgrade DPDK at each new release?
>
Given that you intermix hardware support with bug fixes and new features (which
granted is not uncommon), yes, I don't see any way to avoid doing so. We could
of course cherry pick bug fixes and non-ABI-breaking features, to preserve
compatibility, but doing so diverges from upstream quickly to the point that it
becomes extreemely difficult to maintain. As an example, the one project that
Red Hat does this on routinely is the kernel, and to do so employs a staff of
hundreds of engineers. No distribution wants to do that for every user space
library that they support. They/we are willing to do minor fixes in a given
release with the foreknoweldge that we can drop them when the next relase comes
out, but beyond that, the logistics just don't scale.
> > > 8/
> > > How to handle a change in the implementation of a PMD which severely impact
> > > the application? Example: an ol_flag was mis-used and the application has
> > > a workaround to interpret this flag but it's now incompatible with the fix.
> > >
> > We run into this sometimes in Fedora and RHEL, and doesn't require versioning.
> > The problem you describe is one in which something internal to the library that
> > an application has come to rely on. Fixing the bug isn't typically considered
> > within the purview of versioning, because you're not changing the ABI, you're
> > just correcting a bug in the PMD's behavior. Customers who ask for the behavior
> > to remain unchanged are asking for what's commonly referred to as "Bug for Bug
> > compatibility" and in those cases the application vendor needs to release a
> > corresponding fix. Developers can't be required to preserve buggy behavior.
> >
> > It should also be noted that in this case, ABI never changed. All the data
> > types/sizes/locations/etc have remained unchanged. Its just a bug in
> > interpretation of data passed accross the ABI. As such, theres nothing for ABI
> > versioning to do here.
>
> OK, that's what I thought.
>
> > > 9/
> > > When we don't want to adapt an application, it means the development is
> > > finished and we don't care about the new features of the library.
> > > So I wonder if it wouldn't be more appropriate to provide stable releases
> > > with true maintenance to such users. I understood that is what Redhat provides
> > > to their customers.
> > >
> > No, thats incorrect, we frequently update packages to the latest upstream
> > version when at all possible. We are able to do this sepcifically because
> > upstream library releases provide ABI versioning, so that we can update with
> > confidence. If they don't do that, then yes, we are often restricted to
> > selecting a release and maintaining it for the duration of a major RHEL release,
> > which implies that security and feature updates are extreemely limited
> >
> > That said, if you wanted to do ongoing maintenence on each release, I suppsose
> > you could, in fact its somewhat simmilar to the -stable series that the kernel
> > uses, exept that the kernel enoys an extreemly stable user space ABI, and even
> > then the kernel -stable series doesn't take internal ABI changing patches, so
> > theres alot of divergence. You don't currently have that stable ABI interface,
> > and so I think you'll find that that doing this is way more work than just
> > supporting versioning.
> >
> > To illustrate, lets say you want to support maintenence releases the latest 3
> > releases of the DPDK with patches. To do this, for every patch that is posted
> > to the dpdk that is a bug fix, you will have to apply it four times, one for
> > the git head, and again for each of the three releases that you are doing
> > maintenence on. the patch will of course apply cleanly to the git head, as
> > thats what the developer wrote it against, but the other three releases have
> > every opportunity to conflict with code introduced in the git head but that
> > couldn't be taken into the maintenece releases. Fixing those up is work that
> > you will either have to do, or request that the patch author do. And for this
> > work you will provide distibutions with about 2 years of ABI stability
> > (presuming an ~8 month release cycle), after which they are back to just living
> > with whatever they stabilized on until the next major relase (note a single RHEL
> > major release has a 10+ year life cycle). I would personally rather avoid that
> > work, and just do the ABI compatibility, as those patches are far fewer in
> > number, and it buys for the effort.
>
> Interesting point of view.
> Note that there is no plan to maintain stable version on dpdk.org.
> But if some volunteers want absolutely to do it (even after reading your comment),
> we cannot forbid it.
>
Certainly, and as I noted the kernel does that. But given the rate of change
that the DPDK undergoes, and the current size of the community, I don't think
anyone is going to step up to do that work. Thats really the underlying problem
here, you can solve this problem lots of ways if you have enough manpower, but
given the resources at hand, doing versioning in the master tree is really the
only viable solution.
> > > Hope this discussion will bring a clear idea of what should be done with
> > > which implications.
> > > Thanks
> Thanks again
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] versioning and maintenance
2014-11-20 18:25 5% ` Neil Horman
@ 2014-11-20 21:08 3% ` Thomas Monjalon
2014-11-21 1:05 4% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2014-11-20 21:08 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
2014-11-20 13:25, Neil Horman:
> On Thu, Nov 20, 2014 at 06:09:10PM +0100, Thomas Monjalon wrote:
> > 2014-11-19 10:13, Neil Horman:
> > > On Wed, Nov 19, 2014 at 11:35:08AM +0000, Bruce Richardson wrote:
> > > > On Wed, Nov 19, 2014 at 12:22:14PM +0100, Thomas Monjalon wrote:
> > > > > Following the discussion we had with Neil during the conference call,
> > > > > I suggest this plan, starting with the next release (2.0):
> > > > > - add version numbers to libraries
> > > > > - add version numbers to functions inside .map files
> > > > > - create a git tree dedicated to maintenance and API compatibility
> > > > >
> > > > > It means these version numbers must be incremented when breaking the API.
> > > > > Though the old code paths will be maintained and tested separately by volunteers.
> > > > > A mailing list for maintenance purpose could be created if needed.
> > > > >
> > > > Hi Thomas,
> > > >
> > > > I really think that the versionning is best handled inside the main repository
> > > > itself. Given that the proposed deprecation policy is over two releases i.e. an
> > > > API is marked deprecated in release X and then removed in X+1, I don't see the
> > > > maintaining of old code paths to be particularly onerous.
> > > >
> > > > /Bruce
> > >
> > > I agree with Bruce, even if it is on occasion an added workload, its not the
> > > sort of thing that can or should be placed on an alternate developer. Backwards
> > > compatibility is the sort of thing that has to be on the mind of the developer
> > > when modifying an API, and on the mind of the reviewer when reviewing code. To
> > > shunt that responsibility elsewhere invites the opportunity for backwards
> > > compatibilty to be a second class citizen who's goal will never be reached,
> > > because developers instituting ABI changes will never care about the
> > > consequences, and anyone worrying about backwards compatibility will always be
> > > playing catch up, possibly allowing ABI breaks to slip through.
> > >
> > > Neil
> >
> > Before taking a decision, we should detail every concern.
> >
> > 1/
> > Currently there are not a lot of API refactoring because DPDK is well tailored
> > for x86 and Intel NICs. But we are seeing that new CPU and new NICs to support
> > would require some adaptations.
> >
> Yes, you're absolutely right here. I had hoped that, during my presentation
> that this would happen occasionaly, and that we would need to deal with it.
> What I think you are implying here (correct me if I'm wrong), is that you would
> advocate that we wait to introduce ABI versioning until after such refactoring
> is, for lack of a better term "complete". The problem here is that, software
> that is growing in user base is never "complete". What you are effectively
> saying is that you want to wait until the API is in a state in which no (or
> almost no) more changes are required, then fixate it. Thats quite simply never
> going to happen. And if it does, it obviates the need for versioning at all.
I agree Neil. This point is not about how long we should wait but how the
overhead could be estimate for coming releases.
> > 2/
> > I'm curious to know how you would handle a big change like the recent mbuf rework.
> > Should we duplicate the structure and all the functions using mbuf?
>
> Several ways, what you suggest above is one way, although thats what I would
> consider to be a pessimal case. Ideally such large changes are extreemely rare
> (a search of the git history I think confirms this). Much more common are
> small, limited changes to various API's for which providing multiple versions of
> a function is a much more reasonable approach.
>
> In the event that we do decide to do a refactor that is so far reaching that we
> simply don't feel like multi-versioning is feasible, the recourse is then to
> deprecate the old API, publish that information on the deprecation schedule,
> wait for a release, then replace it wholesale. When the API is released, we
> bump the DSO version number. Note the versioning policy never guarantees that
> backwards compatibility will always be available, nor does it stipulate that a
> newer version of the API is available prior to removing the old one. The goal
> here is to give distributors and application vendors advanced notice of ABI
> breaking changes so that they can adapt appropriately before they are caught off
> guard. If the new ABI can't be packaged alongside the old, then so be it,
> downstream vendors will have to use the upstream git head to test and validate,
> rather than a newer distribution release
Seems reasonable.
> Ideally though, that shouldn't happen, because it causes downstream headaches,
> and we would really like to avoid that. Thats why I feel its so important to
> keep this work in the main tree. If we segregate it to a separate location it
> will make it all to easy for developers to ignore these needs and just assume we
> constantly drop old ABI versions without providing backwards compatibility.
>
> > 3/
> > Should we add new fields at the end of its structure to avoid ABI breaking?
> >
> In the common case yes, this usually avoids ABI breakage, though it can't always
> be relied upon (e.g. cases where structures are statically allocated by an
> application). And then there are patches that attempt to reduce memory usage
> and increase performance by re-arranging structures. In those cases we need to
> do ABI versioning or announce/delay/release as noted above, though again, that
> should really be avoided if possible.
So there is no hope of having fields logically sorted.
Not a major problem but we have to know it. And it should probably be
documented if we choose this way.
> > 4/
> > Developers contribute because they need some changes. So when breaking
> > an API, their application is already ready for the new version.
> > I mean the author of such patch is probably not really motivated to keep ABI
> > compability and duplicate the code path.
> >
> What? That doesn't make any sense. Its our job to enforce this requirement on
> developers during the review cycle. If you don't feel like we can enforce
> coding requirements on the project, we've already lost. I agree that an
> application developer submitting a patch for DPDK might not care about ABI
> compatibility because they've already modified their application, but they (and
> we) need to recognize that there are more than just a handful of users of the
> DPDK, some of whom don't participate in this community (i.e. are simply end
> users). We need to make sure all users needs are met. Thats the entire point
> of this patch series, to make DPDK available to a wider range of users.
Exact. To make it simple, you care about end users and I have to care about
developers motivation. But I perfectly understand the end users needs.
I don't say we cannot enforce coding requirements. I just think it will be
less pleasant.
> > 5/
> > Intead of simply modifying an API function, it would appear as a whole new
> > function with some differences compared to the old one. Such change is really
> > not convenient to review.
>
> Um, yes, versioning is the process of creating an additional
> function that closely resembles an older version of the same function, but with
> different arguments and a newer version number. Thats what it is by defintion,
> and yes, its additional work. All you're saying here is that, its extra work
> and we shouldn't do it. I thought I made this clear on the call, its been done
> in thousands of other libraries, but if you just don't want to do it, then you
> should abandon distributions as a way to reach a larger community, but if you
> want to see the DPDK reach a larger community, then this is something that has
> to happen, hard or not.
The goal of this discussion is to establish all the implications of this
decision. We expose the facts. No conclusion.
> > 6/
> > Testing ABI compatibility could be tricky. We would need a tool to check it's
> > mostly OK. The good place for such a tool is in app/test. It was designed to be
> > the unit tests of the API.
>
> That seems like a reasonable idea, but I'm not sure what the concern is. Are
> you saying that you need to test every old version of the ABI? Thats fine. I
> really don't think it has to be as stringent as the latest version testing, but
> if you want to, it should be as easy as building the latest release of
> the DPDK libraries, and the previous version of the test application. That will
> force the previous version code paths to be used by the test app in the new
> library and, if the test fully exercize the api, then you should get pretty good
> coverage.
Yes it will provide an unit test to developpers.
> > 7/
> > This system would allow application developpers to upgrade DPDK to n+1 without
> > rebuilding. But when upgrading to n+2, they should have adapted their
> > application to comply with n+1 API (because n will be removed).
>
> Only assuming that the old ABI facet was deprecated at the same time the new ABI
> was introduced. Theres nothing that says we have to do that, but I digress.
>
> > So this solution offers a delay between the upgrade decision and the
> > app work. Note that they could prepare their application before upgrading.
> > Anyway, an upgrade should be tested before doing it effectively. The behaviour
> > of the application could change and require some adaptations.
> >
> Um, yes. Whats the concern here?
I'm just trying to figure which workflows are eased by progressive ABI deprecation.
> Downstream application developers need 2
> things:
>
> A) The ability to note that ABI changes are comming so that they can adapt to
> the new version
>
> B) Time to do so
>
> The deprecation policy, if properly distributed by Distributions provide (A),
> and the ABI versioning provides (B). I.e. they can get all the latest bug fixes
> and enhancements while in parallel adapting to the comming new version. Note
> ideally this will happen rarely, as having to constantly rebuild/adapt does not
> sit will with application vendors who choose to go through distributions, but
> we'll do the best we can.
It's an interesting point. In a long-term distribution model like RHEL, do you
plan to upgrade DPDK at each new release?
> > 8/
> > How to handle a change in the implementation of a PMD which severely impact
> > the application? Example: an ol_flag was mis-used and the application has
> > a workaround to interpret this flag but it's now incompatible with the fix.
> >
> We run into this sometimes in Fedora and RHEL, and doesn't require versioning.
> The problem you describe is one in which something internal to the library that
> an application has come to rely on. Fixing the bug isn't typically considered
> within the purview of versioning, because you're not changing the ABI, you're
> just correcting a bug in the PMD's behavior. Customers who ask for the behavior
> to remain unchanged are asking for what's commonly referred to as "Bug for Bug
> compatibility" and in those cases the application vendor needs to release a
> corresponding fix. Developers can't be required to preserve buggy behavior.
>
> It should also be noted that in this case, ABI never changed. All the data
> types/sizes/locations/etc have remained unchanged. Its just a bug in
> interpretation of data passed accross the ABI. As such, theres nothing for ABI
> versioning to do here.
OK, that's what I thought.
> > 9/
> > When we don't want to adapt an application, it means the development is
> > finished and we don't care about the new features of the library.
> > So I wonder if it wouldn't be more appropriate to provide stable releases
> > with true maintenance to such users. I understood that is what Redhat provides
> > to their customers.
> >
> No, thats incorrect, we frequently update packages to the latest upstream
> version when at all possible. We are able to do this sepcifically because
> upstream library releases provide ABI versioning, so that we can update with
> confidence. If they don't do that, then yes, we are often restricted to
> selecting a release and maintaining it for the duration of a major RHEL release,
> which implies that security and feature updates are extreemely limited
>
> That said, if you wanted to do ongoing maintenence on each release, I suppsose
> you could, in fact its somewhat simmilar to the -stable series that the kernel
> uses, exept that the kernel enoys an extreemly stable user space ABI, and even
> then the kernel -stable series doesn't take internal ABI changing patches, so
> theres alot of divergence. You don't currently have that stable ABI interface,
> and so I think you'll find that that doing this is way more work than just
> supporting versioning.
>
> To illustrate, lets say you want to support maintenence releases the latest 3
> releases of the DPDK with patches. To do this, for every patch that is posted
> to the dpdk that is a bug fix, you will have to apply it four times, one for
> the git head, and again for each of the three releases that you are doing
> maintenence on. the patch will of course apply cleanly to the git head, as
> thats what the developer wrote it against, but the other three releases have
> every opportunity to conflict with code introduced in the git head but that
> couldn't be taken into the maintenece releases. Fixing those up is work that
> you will either have to do, or request that the patch author do. And for this
> work you will provide distibutions with about 2 years of ABI stability
> (presuming an ~8 month release cycle), after which they are back to just living
> with whatever they stabilized on until the next major relase (note a single RHEL
> major release has a 10+ year life cycle). I would personally rather avoid that
> work, and just do the ABI compatibility, as those patches are far fewer in
> number, and it buys for the effort.
Interesting point of view.
Note that there is no plan to maintain stable version on dpdk.org.
But if some volunteers want absolutely to do it (even after reading your comment),
we cannot forbid it.
> > Hope this discussion will bring a clear idea of what should be done with
> > which implications.
> > Thanks
Thanks again
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] versioning and maintenance
2014-11-20 17:09 4% ` Thomas Monjalon
@ 2014-11-20 18:25 5% ` Neil Horman
2014-11-20 21:08 3% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-11-20 18:25 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Thu, Nov 20, 2014 at 06:09:10PM +0100, Thomas Monjalon wrote:
> Hi,
>
> 2014-11-19 10:13, Neil Horman:
> > On Wed, Nov 19, 2014 at 11:35:08AM +0000, Bruce Richardson wrote:
> > > On Wed, Nov 19, 2014 at 12:22:14PM +0100, Thomas Monjalon wrote:
> > > > Following the discussion we had with Neil during the conference call,
> > > > I suggest this plan, starting with the next release (2.0):
> > > > - add version numbers to libraries
> > > > - add version numbers to functions inside .map files
> > > > - create a git tree dedicated to maintenance and API compatibility
> > > >
> > > > It means these version numbers must be incremented when breaking the API.
> > > > Though the old code paths will be maintained and tested separately by volunteers.
> > > > A mailing list for maintenance purpose could be created if needed.
> > > >
> > > Hi Thomas,
> > >
> > > I really think that the versionning is best handled inside the main repository
> > > itself. Given that the proposed deprecation policy is over two releases i.e. an
> > > API is marked deprecated in release X and then removed in X+1, I don't see the
> > > maintaining of old code paths to be particularly onerous.
> > >
> > > /Bruce
> >
> > I agree with Bruce, even if it is on occasion an added workload, its not the
> > sort of thing that can or should be placed on an alternate developer. Backwards
> > compatibility is the sort of thing that has to be on the mind of the developer
> > when modifying an API, and on the mind of the reviewer when reviewing code. To
> > shunt that responsibility elsewhere invites the opportunity for backwards
> > compatibilty to be a second class citizen who's goal will never be reached,
> > because developers instituting ABI changes will never care about the
> > consequences, and anyone worrying about backwards compatibility will always be
> > playing catch up, possibly allowing ABI breaks to slip through.
> >
> > Neil
>
> Before taking a decision, we should detail every concern.
>
> 1/
> Currently there are not a lot of API refactoring because DPDK is well tailored
> for x86 and Intel NICs. But we are seeing that new CPU and new NICs to support
> would require some adaptations.
>
Yes, you're absolutely right here. I had hoped that, during my presentation
that this would happen occasionaly, and that we would need to deal with it.
What I think you are implying here (correct me if I'm wrong), is that you would
advocate that we wait to introduce ABI versioning until after such refactoring
is, for lack of a better term "complete". The problem here is that, software
that is growing in user base is never "complete". What you are effectively
saying is that you want to wait until the API is in a state in which no (or
almost no) more changes are required, then fixate it. Thats quite simply never
going to happen. And if it does, it obviates the need for versioning at all.
> 2/
> I'm curious to know how you would handle a big change like the recent mbuf rework.
> Should we duplicate the structure and all the functions using mbuf?
>
Several ways, what you suggest above is one way, although thats what I would
consider to be a pessimal case. Ideally such large changes are extreemely rare
(a search of the git history I think confirms this). Much more common are
small, limited changes to various API's for which providing multiple versions of
a function is a much more reasonable approach.
In the event that we do decide to do a refactor that is so far reaching that we
simply don't feel like multi-versioning is feasible, the recourse is then to
deprecate the old API, publish that information on the deprecation schedule,
wait for a release, then replace it wholesale. When the API is released, we
bump the DSO version number. Note the versioning policy never guarantees that
backwards compatibility will always be available, nor does it stipulate that a
newer version of the API is available prior to removing the old one. The goal
here is to give distributors and application vendors advanced notice of ABI
breaking changes so that they can adapt appropriately before they are caught off
guard. If the new ABI can't be packaged alongside the old, then so be it,
downstream vendors will have to use the upstream git head to test and validate,
rather than a newer distribution release
Ideally though, that shouldn't happen, because it causes downstream headaches,
and we would really like to avoid that. Thats why I feel its so important to
keep this work in the main tree. If we segregate it to a separate location it
will make it all to easy for developers to ignore these needs and just assume we
constantly drop old ABI versions without providing backwards compatibility.
> 3/
> Should we add new fields at the end of its structure to avoid ABI breaking?
>
In the common case yes, this usually avoids ABI breakage, though it can't always
be relied upon (e.g. cases where structures are statically allocated by an
application). And then there are patches that attempt to reduce memory usage
and increase performance by re-arranging structures. In those cases we need to
do ABI versioning or announce/delay/release as noted above, though again, that
should really be avoided if possible.
> 4/
> Developers contribute because they need some changes. So when breaking
> an API, their application is already ready for the new version.
> I mean the author of such patch is probably not really motivated to keep ABI
> compability and duplicate the code path.
>
What? That doesn't make any sense. Its our job to enforce this requirement on
developers during the review cycle. If you don't feel like we can enforce
coding requirements on the project, we've already lost. I agree that an
application developer submitting a patch for DPDK might not care about ABI
compatibility because they've already modified their application, but they (and
we) need to recognize that there are more than just a handful of users of the
DPDK, some of whom don't participate in this community (i.e. are simply end
users). We need to make sure all users needs are met. Thats the entire point
of this patch series, to make DPDK available to a wider range of users.
> 5/
> Intead of simply modifying an API function, it would appear as a whole new
> function with some differences compared to the old one. Such change is really
> not convenient to review.
>
Um, yes, versioning is the process of creating an additional
function that closely resembles an older version of the same function, but with
different arguments and a newer version number. Thats what it is by defintion,
and yes, its additional work. All you're saying here is that, its extra work
and we shouldn't do it. I thought I made this clear on the call, its been done
in thousands of other libraries, but if you just don't want to do it, then you
should abandon distributions as a way to reach a larger community, but if you
want to see the DPDK reach a larger community, then this is something that has
to happen, hard or not.
> 6/
> Testing ABI compatibility could be tricky. We would need a tool to check it's
> mostly OK. The good place for such a tool is in app/test. It was designed to be
> the unit tests of the API.
>
That seems like a reasonable idea, but I'm not sure what the concern is. Are
you saying that you need to test every old version of the ABI? Thats fine. I
really don't think it has to be as stringent as the latest version testing, but
if you want to, it should be as easy as building the latest release of
the DPDK libraries, and the previous version of the test application. That will
force the previous version code paths to be used by the test app in the new
library and, if the test fully exercize the api, then you should get pretty good
coverage.
> 7/
> This system would allow application developpers to upgrade DPDK to n+1 without
> rebuilding. But when upgrading to n+2, they should have adapted their
> application to comply with n+1 API (because n will be removed).
Only assuming that the old ABI facet was deprecated at the same time the new ABI
was introduced. Theres nothing that says we have to do that, but I digress.
> So this solution offers a delay between the upgrade decision and the
> app work. Note that they could prepare their application before upgrading.
> Anyway, an upgrade should be tested before doing it effectively. The behaviour
> of the application could change and require some adaptations.
>
Um, yes. Whats the concern here? Downstream application developers need 2
things:
A) The ability to note that ABI changes are comming so that they can adapt to
the new version
B) Time to do so
The deprecation policy, if properly distributed by Distributions provide (A),
and the ABI versioning provides (B). I.e. they can get all the latest bug fixes
and enhancements while in parallel adapting to the comming new version. Note
ideally this will happen rarely, as having to constantly rebuild/adapt does not
sit will with application vendors who choose to go through distributions, but
we'll do the best we can.
> 8/
> How to handle a change in the implementation of a PMD which severely impact
> the application? Example: an ol_flag was mis-used and the application has
> a workaround to interpret this flag but it's now incompatible with the fix.
>
We run into this sometimes in Fedora and RHEL, and doesn't require versioning.
The problem you describe is one in which something internal to the library that
an application has come to rely on. Fixing the bug isn't typically considered
within the purview of versioning, because you're not changing the ABI, you're
just correcting a bug in the PMD's behavior. Customers who ask for the behavior
to remain unchanged are asking for what's commonly referred to as "Bug for Bug
compatibility" and in those cases the application vendor needs to release a
corresponding fix. Developers can't be required to preserve buggy behavior.
It should also be noted that in this case, ABI never changed. All the data
types/sizes/locations/etc have remained unchanged. Its just a bug in
interpretation of data passed accross the ABI. As such, theres nothing for ABI
versioning to do here.
> 9/
> When we don't want to adapt an application, it means the development is
> finished and we don't care about the new features of the library.
> So I wonder if it wouldn't be more appropriate to provide stable releases
> with true maintenance to such users. I understood that is what Redhat provides
> to their customers.
>
No, thats incorrect, we frequently update packages to the latest upstream
version when at all possible. We are able to do this sepcifically because
upstream library releases provide ABI versioning, so that we can update with
confidence. If they don't do that, then yes, we are often restricted to
selecting a release and maintaining it for the duration of a major RHEL release,
which implies that security and feature updates are extreemely limited
That said, if you wanted to do ongoing maintenence on each release, I suppsose
you could, in fact its somewhat simmilar to the -stable series that the kernel
uses, exept that the kernel enoys an extreemly stable user space ABI, and even
then the kernel -stable series doesn't take internal ABI changing patches, so
theres alot of divergence. You don't currently have that stable ABI interface,
and so I think you'll find that that doing this is way more work than just
supporting versioning.
To illustrate, lets say you want to support maintenence releases the latest 3
releases of the DPDK with patches. To do this, for every patch that is posted
to the dpdk that is a bug fix, you will have to apply it four times, one for
the git head, and again for each of the three releases that you are doing
maintenence on. the patch will of course apply cleanly to the git head, as
thats what the developer wrote it against, but the other three releases have
every opportunity to conflict with code introduced in the git head but that
couldn't be taken into the maintenece releases. Fixing those up is work that
you will either have to do, or request that the patch author do. And for this
work you will provide distibutions with about 2 years of ABI stability
(presuming an ~8 month release cycle), after which they are back to just living
with whatever they stabilized on until the next major relase (note a single RHEL
major release has a 10+ year life cycle). I would personally rather avoid that
work, and just do the ABI compatibility, as those patches are far fewer in
number, and it buys for the effort.
> Hope this discussion will bring a clear idea of what should be done with
> which implications.
> Thanks
> --
> Thomas
>
^ permalink raw reply [relevance 5%]
* Re: [dpdk-dev] versioning and maintenance
2014-11-19 15:13 4% ` Neil Horman
@ 2014-11-20 17:09 4% ` Thomas Monjalon
2014-11-20 18:25 5% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2014-11-20 17:09 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Hi,
2014-11-19 10:13, Neil Horman:
> On Wed, Nov 19, 2014 at 11:35:08AM +0000, Bruce Richardson wrote:
> > On Wed, Nov 19, 2014 at 12:22:14PM +0100, Thomas Monjalon wrote:
> > > Following the discussion we had with Neil during the conference call,
> > > I suggest this plan, starting with the next release (2.0):
> > > - add version numbers to libraries
> > > - add version numbers to functions inside .map files
> > > - create a git tree dedicated to maintenance and API compatibility
> > >
> > > It means these version numbers must be incremented when breaking the API.
> > > Though the old code paths will be maintained and tested separately by volunteers.
> > > A mailing list for maintenance purpose could be created if needed.
> > >
> > Hi Thomas,
> >
> > I really think that the versionning is best handled inside the main repository
> > itself. Given that the proposed deprecation policy is over two releases i.e. an
> > API is marked deprecated in release X and then removed in X+1, I don't see the
> > maintaining of old code paths to be particularly onerous.
> >
> > /Bruce
>
> I agree with Bruce, even if it is on occasion an added workload, its not the
> sort of thing that can or should be placed on an alternate developer. Backwards
> compatibility is the sort of thing that has to be on the mind of the developer
> when modifying an API, and on the mind of the reviewer when reviewing code. To
> shunt that responsibility elsewhere invites the opportunity for backwards
> compatibilty to be a second class citizen who's goal will never be reached,
> because developers instituting ABI changes will never care about the
> consequences, and anyone worrying about backwards compatibility will always be
> playing catch up, possibly allowing ABI breaks to slip through.
>
> Neil
Before taking a decision, we should detail every concern.
1/
Currently there are not a lot of API refactoring because DPDK is well tailored
for x86 and Intel NICs. But we are seeing that new CPU and new NICs to support
would require some adaptations.
2/
I'm curious to know how you would handle a big change like the recent mbuf rework.
Should we duplicate the structure and all the functions using mbuf?
3/
Should we add new fields at the end of its structure to avoid ABI breaking?
4/
Developers contribute because they need some changes. So when breaking
an API, their application is already ready for the new version.
I mean the author of such patch is probably not really motivated to keep ABI
compability and duplicate the code path.
5/
Intead of simply modifying an API function, it would appear as a whole new
function with some differences compared to the old one. Such change is really
not convenient to review.
6/
Testing ABI compatibility could be tricky. We would need a tool to check it's
mostly OK. The good place for such a tool is in app/test. It was designed to be
the unit tests of the API.
7/
This system would allow application developpers to upgrade DPDK to n+1 without
rebuilding. But when upgrading to n+2, they should have adapted their
application to comply with n+1 API (because n will be removed).
So this solution offers a delay between the upgrade decision and the
app work. Note that they could prepare their application before upgrading.
Anyway, an upgrade should be tested before doing it effectively. The behaviour
of the application could change and require some adaptations.
8/
How to handle a change in the implementation of a PMD which severely impact
the application? Example: an ol_flag was mis-used and the application has
a workaround to interpret this flag but it's now incompatible with the fix.
9/
When we don't want to adapt an application, it means the development is
finished and we don't care about the new features of the library.
So I wonder if it wouldn't be more appropriate to provide stable releases
with true maintenance to such users. I understood that is what Redhat provides
to their customers.
Hope this discussion will bring a clear idea of what should be done with
which implications.
Thanks
--
Thomas
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] Community conference call - Tuesday 18th November
2014-11-19 12:33 3% ` O'driscoll, Tim
@ 2014-11-20 9:27 0% ` Walukiewicz, Miroslaw
0 siblings, 0 replies; 200+ results
From: Walukiewicz, Miroslaw @ 2014-11-20 9:27 UTC (permalink / raw)
To: O'driscoll, Tim, 'dev@dpdk.org'
Tim,
Is it a possibility to create some place on dpdk.org available to everyone where the slides and recording will be available?
Regards,
Mirek
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O'driscoll, Tim
> Sent: Wednesday, November 19, 2014 1:34 PM
> To: 'dev@dpdk.org'
> Subject: Re: [dpdk-dev] Community conference call - Tuesday 18th
> November
>
> Thanks again to those who attended the call yesterday. There was a good
> discussion, and it was more interactive than the previous call, which is what
> we were aiming for. We'll schedule a follow-up call for 2 weeks' time.
>
> Thanks again to those who presented on the following features:
> - ABI Versioning (Neil Horman <nhorman@tuxdriver.com>)
> - Uio_pci_generic (Danny.Zhou@intel.com)
> - Integrated Qemu Userspace vHost (Huawei.Xie@intel.com)
>
> I have a recording of the session, and will send a link to it soon for anybody
> who missed the call.
>
>
> Tim
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O'driscoll, Tim
> > Sent: Tuesday, November 18, 2014 12:56 PM
> > To: 'dev@dpdk.org'
> > Subject: Re: [dpdk-dev] Community conference call - Tuesday 18th
> > November
> >
> > This is just a reminder of our call later today, which is at 17:00 GMT. The
> time
> > in a variety of timezones is included below.
> >
> > We're going to use GoToMeeting this time. If you follow the meeting link
> > (https://global.gotomeeting.com/join/843960205), the GoToMeeting web
> > viewer will start. You then have two options for audio:
> >
> > 1. You can join using a phone via one of the numbers listed below. The
> > Access Code is 843-960-205. You'll also be asked for an Audio PIN, which is
> > accessible by clicking the phone icon in the GoToMeeting web viewer after
> > you've joined the meeting.
> >
> > 2. To use your computer's audio via a headset, you need to switch to the
> > desktop version of GoToMeeting. You can do this by clicking the
> > GoToMeeting icon on the top right hand side of the web viewer, and then
> > selecting "Switch to the desktop version". The desktop version will need to
> > download and install, so if you plan to use this you may want to get it set up
> > in advance. Once it starts, under the Audio section, you can select "Mic &
> > Speakers". The desktop version is only available for Windows and Mac, so if
> > you're using Linux then you need to use option 1 above.
> >
> > Info on downloading the desktop app is available at:
> >
> http://support.citrixonline.com/en_US/meeting/help_files/G2M010002?title
> > =Download%7D
> > Info on the web viewer is available at:
> >
> http://support.citrixonline.com/en_US/GoToMeeting/help_files/GTM13001
> > 9?title=Web+Viewer+FAQs
> >
> > I plan to record the session in GoToMeeting, and make that recording
> > available for anybody who can't attend today.
> >
> >
> > Tim
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O'driscoll, Tim
> > > Sent: Friday, November 14, 2014 10:53 AM
> > > To: 'dev@dpdk.org'
> > > Subject: Re: [dpdk-dev] Community conference call - Tuesday 18th
> > > November
> > >
> > > Firstly, due to some conflicts, we're going to move next Tuesday's
> > > meeting to
> > > 1 hour later. Apologies for the short notice on the change. Here's the
> > > new meeting time in a variety of timezones:
> > >
> > > Dublin (Ireland) Tuesday, November 18, 2014 at
> > 5:00:00 PM GMT UTC
> > > San Francisco (U.S.A. - California) Tuesday, November 18, 2014 at
> > 9:00:00 AM PST UTC-8 hours
> > > Phoenix (U.S.A. - Arizona) Tuesday, November 18, 2014 at
> > 10:00:00 AM MST UTC-7 hours
> > > New York (U.S.A. - New York) Tuesday, November 18, 2014
> > at 12:00:00 Noon EST UTC-5 hours
> > > Ottawa (Canada - Ontario) Tuesday, November 18, 2014 at
> > 12:00:00 Noon EST UTC-5 hours
> > > Paris (France) Tuesday, November 18, 2014
> at
> > 6:00:00 PM CET UTC+1 hour
> > > Tel Aviv (Israel) Tuesday, November 18, 2014 at
> > 7:00:00 PM IST UTC+2 hours
> > > Moscow (Russia) Tuesday, November 18, 2014 at
> > 8:00:00 PM MSK UTC+3 hours
> > > Beijing (China - Beijing Municipality) Wednesday, November 19,
> 2014 at
> > 1:00:00 AM CST UTC+8 hours
> > > Tokyo (Japan) Wednesday, November 19, 2014 at
> > 2:00:00 AM JST UTC+9 hours
> > > Corresponding UTC (GMT) Tuesday, November 18, 2014 at
> > 17:00:00
> > >
> > >
> > > Secondly, we're going to try using GoToMeeting this time. Here are the
> > > details:
> > > 1. Please join my meeting from your computer, tablet or smartphone on
> > > Tue, Nov 18, 5:00 PM GMT Standard Time
> > > https://global.gotomeeting.com/join/843960205
> > >
> > > 2. Use your microphone and speakers (VOIP) for audio. You'll sound
> > > best with a headset. You can also call in using your telephone.
> > > ◦ United Kingdom (Long distance): +44 (0) 20 7151 1818
> > > ◦ Australia (Long distance): +61 2 8355 1034
> > > ◦ Sweden (Long distance): +46 (0) 852 500 182
> > > ◦ Canada (Long distance): +1 (647) 497-9372
> > > ◦ Finland (Long distance): +358 (0) 942 45 0382
> > > ◦ Ireland (Long distance): +353 (0) 15 255 598
> > > ◦ Germany (Long distance): +49 (0) 692 5736 7206
> > > ◦ Italy (Long distance): +39 0 693 38 75 53
> > > ◦ Netherlands (Long distance): +31 (0) 208 080 212
> > > ◦ Austria (Long distance): +43 (0) 7 2088 3707
> > > ◦ Belgium (Long distance): +32 (0) 28 08 9460
> > > ◦ United States (Long distance): +1 (626) 521-0013
> > > ◦ Denmark (Long distance): +45 (0) 89 88 03 61
> > > ◦ Switzerland (Long distance): +41 (0) 435 0824 78
> > > ◦ France (Long distance): +33 (0) 170 950 588
> > > ◦ Norway (Long distance): +47 21 04 29 76
> > > ◦ New Zealand (Long distance): +64 (0) 9 887 3469
> > > ◦ Spain (Long distance): +34 932 20 0506
> > >
> > > Access Code: 843-960-205
> > > Audio PIN: Shown after joining the session
> > >
> > > Not at your computer? Click the link to join this meeting from your
> > > iPhone®, iPad®, Android® or Windows Phone® device via the
> GoToMeeting
> > app.
> > >
> > >
> > > Finally, what we'd like to discuss are the candidate features for the
> > > 2.0 release that we didn't cover last time. These include:
> > > ◦ ABI Versioning
> > > ◦ DPDK support for uio_pci_generic
> > > ◦ Integrated Qemu Userspace vHost
> > > ◦ PCI Hot Plug
> > > ◦ Single Virtio Driver
> > > ◦ X32 ABI
> > > ◦ AVX2 ACL
> > > ◦ Interrupt mode for PMD
> > > ◦ DPDK Headroom
> > >
> > >
> > > Thanks,
> > > Tim
> > >
> > > > -----Original Message-----
> > > > From: O'driscoll, Tim
> > > > Sent: Tuesday, November 11, 2014 10:16 AM
> > > > To: dev@dpdk.org
> > > > Subject: Community conference call - Tuesday 18th November
> > > >
> > > > We're going to hold our next community conference call a week from
> > > > today - Tuesday 18th November, at 4:00pm in Ireland/UK. Here's the
> > > > time in a variety of timezones:
> > > >
> > > > Dublin (Ireland) Tuesday, November 18, 2014
> > > > at 4:00:00 PM GMT UTC
> > > > San Francisco (U.S.A. - California) Tuesday, November 18, 2014 at
> > > > 8:00:00 AM PST UTC-8 hours
> > > > Phoenix (U.S.A. - Arizona) Tuesday, November 18, 2014
> at
> > > > 9:00:00 AM MST UTC-7 hours
> > > > New York (U.S.A. - New York) Tuesday, November 18, 2014
> > > at
> > > > 11:00:00 AM EST UTC-5 hours
> > > > Ottawa (Canada - Ontario) Tuesday, November 18, 2014
> at
> > > > 11:00:00 AM EST UTC-5 hours
> > > > Paris (France) Tuesday, November 18, 2014
> > at
> > > > 5:00:00 PM CET UTC+1 hour
> > > > Tel Aviv (Israel) Tuesday, November 18, 2014
> > > at
> > > > 6:00:00 PM IST UTC+2 hours
> > > > Moscow (Russia) Tuesday, November 18, 2014 at
> > > > 7:00:00 PM MSK UTC+3 hours
> > > > Corresponding UTC (GMT) Tuesday, November 18, 2014
> at
> > > > 16:00:00
> > > >
> > > > I'll provide conference bridge numbers later, but I wanted to
> > > > communicate the date and time now.
> > > >
> > > >
> > > > Tim
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] versioning and maintenance
@ 2014-11-19 15:13 4% ` Neil Horman
2014-11-20 17:09 4% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-11-19 15:13 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, Neil Horman
On Wed, Nov 19, 2014 at 11:35:08AM +0000, Bruce Richardson wrote:
> On Wed, Nov 19, 2014 at 12:22:14PM +0100, Thomas Monjalon wrote:
> > Following the discussion we had with Neil during the conference call,
> > I suggest this plan, starting with the next release (2.0):
> > - add version numbers to libraries
> > - add version numbers to functions inside .map files
> > - create a git tree dedicated to maintenance and API compatibility
> >
> > It means these version numbers must be incremented when breaking the API.
> > Though the old code paths will be maintained and tested separately by volunteers.
> > A mailing list for maintenance purpose could be created if needed.
> >
> Hi Thomas,
>
> I really think that the versionning is best handled inside the main repository
> itself. Given that the proposed deprecation policy is over two releases i.e. an
> API is marked deprecated in release X and then removed in X+1, I don't see the
> maintaining of old code paths to be particularly onerous.
>
> /Bruce
>
I agree with Bruce, even if it is on occasion an added workload, its not the
sort of thing that can or should be placed on an alternate developer. Backwards
compatibility is the sort of thing that has to be on the mind of the developer
when modifying an API, and on the mind of the reviewer when reviewing code. To
shunt that responsibility elsewhere invites the opportunity for backwards
compatibilty to be a second class citizen who's goal will never be reached,
because developers instituting ABI changes will never care about the
consequences, and anyone worrying about backwards compatibility will always be
playing catch up, possibly allowing ABI breaks to slip through.
Neil
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] Community conference call - Tuesday 18th November
2014-11-18 12:56 0% ` O'driscoll, Tim
@ 2014-11-19 12:33 3% ` O'driscoll, Tim
2014-11-20 9:27 0% ` Walukiewicz, Miroslaw
0 siblings, 1 reply; 200+ results
From: O'driscoll, Tim @ 2014-11-19 12:33 UTC (permalink / raw)
To: 'dev@dpdk.org'
Thanks again to those who attended the call yesterday. There was a good discussion, and it was more interactive than the previous call, which is what we were aiming for. We'll schedule a follow-up call for 2 weeks' time.
Thanks again to those who presented on the following features:
- ABI Versioning (Neil Horman <nhorman@tuxdriver.com>)
- Uio_pci_generic (Danny.Zhou@intel.com)
- Integrated Qemu Userspace vHost (Huawei.Xie@intel.com)
I have a recording of the session, and will send a link to it soon for anybody who missed the call.
Tim
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O'driscoll, Tim
> Sent: Tuesday, November 18, 2014 12:56 PM
> To: 'dev@dpdk.org'
> Subject: Re: [dpdk-dev] Community conference call - Tuesday 18th
> November
>
> This is just a reminder of our call later today, which is at 17:00 GMT. The time
> in a variety of timezones is included below.
>
> We're going to use GoToMeeting this time. If you follow the meeting link
> (https://global.gotomeeting.com/join/843960205), the GoToMeeting web
> viewer will start. You then have two options for audio:
>
> 1. You can join using a phone via one of the numbers listed below. The
> Access Code is 843-960-205. You'll also be asked for an Audio PIN, which is
> accessible by clicking the phone icon in the GoToMeeting web viewer after
> you've joined the meeting.
>
> 2. To use your computer's audio via a headset, you need to switch to the
> desktop version of GoToMeeting. You can do this by clicking the
> GoToMeeting icon on the top right hand side of the web viewer, and then
> selecting "Switch to the desktop version". The desktop version will need to
> download and install, so if you plan to use this you may want to get it set up
> in advance. Once it starts, under the Audio section, you can select "Mic &
> Speakers". The desktop version is only available for Windows and Mac, so if
> you're using Linux then you need to use option 1 above.
>
> Info on downloading the desktop app is available at:
> http://support.citrixonline.com/en_US/meeting/help_files/G2M010002?title
> =Download%7D
> Info on the web viewer is available at:
> http://support.citrixonline.com/en_US/GoToMeeting/help_files/GTM13001
> 9?title=Web+Viewer+FAQs
>
> I plan to record the session in GoToMeeting, and make that recording
> available for anybody who can't attend today.
>
>
> Tim
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O'driscoll, Tim
> > Sent: Friday, November 14, 2014 10:53 AM
> > To: 'dev@dpdk.org'
> > Subject: Re: [dpdk-dev] Community conference call - Tuesday 18th
> > November
> >
> > Firstly, due to some conflicts, we're going to move next Tuesday's
> > meeting to
> > 1 hour later. Apologies for the short notice on the change. Here's the
> > new meeting time in a variety of timezones:
> >
> > Dublin (Ireland) Tuesday, November 18, 2014 at
> 5:00:00 PM GMT UTC
> > San Francisco (U.S.A. - California) Tuesday, November 18, 2014 at
> 9:00:00 AM PST UTC-8 hours
> > Phoenix (U.S.A. - Arizona) Tuesday, November 18, 2014 at
> 10:00:00 AM MST UTC-7 hours
> > New York (U.S.A. - New York) Tuesday, November 18, 2014
> at 12:00:00 Noon EST UTC-5 hours
> > Ottawa (Canada - Ontario) Tuesday, November 18, 2014 at
> 12:00:00 Noon EST UTC-5 hours
> > Paris (France) Tuesday, November 18, 2014 at
> 6:00:00 PM CET UTC+1 hour
> > Tel Aviv (Israel) Tuesday, November 18, 2014 at
> 7:00:00 PM IST UTC+2 hours
> > Moscow (Russia) Tuesday, November 18, 2014 at
> 8:00:00 PM MSK UTC+3 hours
> > Beijing (China - Beijing Municipality) Wednesday, November 19, 2014 at
> 1:00:00 AM CST UTC+8 hours
> > Tokyo (Japan) Wednesday, November 19, 2014 at
> 2:00:00 AM JST UTC+9 hours
> > Corresponding UTC (GMT) Tuesday, November 18, 2014 at
> 17:00:00
> >
> >
> > Secondly, we're going to try using GoToMeeting this time. Here are the
> > details:
> > 1. Please join my meeting from your computer, tablet or smartphone on
> > Tue, Nov 18, 5:00 PM GMT Standard Time
> > https://global.gotomeeting.com/join/843960205
> >
> > 2. Use your microphone and speakers (VOIP) for audio. You'll sound
> > best with a headset. You can also call in using your telephone.
> > ◦ United Kingdom (Long distance): +44 (0) 20 7151 1818
> > ◦ Australia (Long distance): +61 2 8355 1034
> > ◦ Sweden (Long distance): +46 (0) 852 500 182
> > ◦ Canada (Long distance): +1 (647) 497-9372
> > ◦ Finland (Long distance): +358 (0) 942 45 0382
> > ◦ Ireland (Long distance): +353 (0) 15 255 598
> > ◦ Germany (Long distance): +49 (0) 692 5736 7206
> > ◦ Italy (Long distance): +39 0 693 38 75 53
> > ◦ Netherlands (Long distance): +31 (0) 208 080 212
> > ◦ Austria (Long distance): +43 (0) 7 2088 3707
> > ◦ Belgium (Long distance): +32 (0) 28 08 9460
> > ◦ United States (Long distance): +1 (626) 521-0013
> > ◦ Denmark (Long distance): +45 (0) 89 88 03 61
> > ◦ Switzerland (Long distance): +41 (0) 435 0824 78
> > ◦ France (Long distance): +33 (0) 170 950 588
> > ◦ Norway (Long distance): +47 21 04 29 76
> > ◦ New Zealand (Long distance): +64 (0) 9 887 3469
> > ◦ Spain (Long distance): +34 932 20 0506
> >
> > Access Code: 843-960-205
> > Audio PIN: Shown after joining the session
> >
> > Not at your computer? Click the link to join this meeting from your
> > iPhone®, iPad®, Android® or Windows Phone® device via the GoToMeeting
> app.
> >
> >
> > Finally, what we'd like to discuss are the candidate features for the
> > 2.0 release that we didn't cover last time. These include:
> > ◦ ABI Versioning
> > ◦ DPDK support for uio_pci_generic
> > ◦ Integrated Qemu Userspace vHost
> > ◦ PCI Hot Plug
> > ◦ Single Virtio Driver
> > ◦ X32 ABI
> > ◦ AVX2 ACL
> > ◦ Interrupt mode for PMD
> > ◦ DPDK Headroom
> >
> >
> > Thanks,
> > Tim
> >
> > > -----Original Message-----
> > > From: O'driscoll, Tim
> > > Sent: Tuesday, November 11, 2014 10:16 AM
> > > To: dev@dpdk.org
> > > Subject: Community conference call - Tuesday 18th November
> > >
> > > We're going to hold our next community conference call a week from
> > > today - Tuesday 18th November, at 4:00pm in Ireland/UK. Here's the
> > > time in a variety of timezones:
> > >
> > > Dublin (Ireland) Tuesday, November 18, 2014
> > > at 4:00:00 PM GMT UTC
> > > San Francisco (U.S.A. - California) Tuesday, November 18, 2014 at
> > > 8:00:00 AM PST UTC-8 hours
> > > Phoenix (U.S.A. - Arizona) Tuesday, November 18, 2014 at
> > > 9:00:00 AM MST UTC-7 hours
> > > New York (U.S.A. - New York) Tuesday, November 18, 2014
> > at
> > > 11:00:00 AM EST UTC-5 hours
> > > Ottawa (Canada - Ontario) Tuesday, November 18, 2014 at
> > > 11:00:00 AM EST UTC-5 hours
> > > Paris (France) Tuesday, November 18, 2014
> at
> > > 5:00:00 PM CET UTC+1 hour
> > > Tel Aviv (Israel) Tuesday, November 18, 2014
> > at
> > > 6:00:00 PM IST UTC+2 hours
> > > Moscow (Russia) Tuesday, November 18, 2014 at
> > > 7:00:00 PM MSK UTC+3 hours
> > > Corresponding UTC (GMT) Tuesday, November 18, 2014 at
> > > 16:00:00
> > >
> > > I'll provide conference bridge numbers later, but I wanted to
> > > communicate the date and time now.
> > >
> > >
> > > Tim
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] Community conference call - Tuesday 18th November
2014-11-14 10:52 4% ` O'driscoll, Tim
@ 2014-11-18 12:56 0% ` O'driscoll, Tim
2014-11-19 12:33 3% ` O'driscoll, Tim
0 siblings, 1 reply; 200+ results
From: O'driscoll, Tim @ 2014-11-18 12:56 UTC (permalink / raw)
To: 'dev@dpdk.org'
This is just a reminder of our call later today, which is at 17:00 GMT. The time in a variety of timezones is included below.
We're going to use GoToMeeting this time. If you follow the meeting link (https://global.gotomeeting.com/join/843960205), the GoToMeeting web viewer will start. You then have two options for audio:
1. You can join using a phone via one of the numbers listed below. The Access Code is 843-960-205. You'll also be asked for an Audio PIN, which is accessible by clicking the phone icon in the GoToMeeting web viewer after you've joined the meeting.
2. To use your computer's audio via a headset, you need to switch to the desktop version of GoToMeeting. You can do this by clicking the GoToMeeting icon on the top right hand side of the web viewer, and then selecting "Switch to the desktop version". The desktop version will need to download and install, so if you plan to use this you may want to get it set up in advance. Once it starts, under the Audio section, you can select "Mic & Speakers". The desktop version is only available for Windows and Mac, so if you're using Linux then you need to use option 1 above.
Info on downloading the desktop app is available at: http://support.citrixonline.com/en_US/meeting/help_files/G2M010002?title=Download%7D
Info on the web viewer is available at: http://support.citrixonline.com/en_US/GoToMeeting/help_files/GTM130019?title=Web+Viewer+FAQs
I plan to record the session in GoToMeeting, and make that recording available for anybody who can't attend today.
Tim
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O'driscoll, Tim
> Sent: Friday, November 14, 2014 10:53 AM
> To: 'dev@dpdk.org'
> Subject: Re: [dpdk-dev] Community conference call - Tuesday 18th
> November
>
> Firstly, due to some conflicts, we're going to move next Tuesday's meeting to
> 1 hour later. Apologies for the short notice on the change. Here's the new
> meeting time in a variety of timezones:
>
> Dublin (Ireland) Tuesday, November 18, 2014 at 5:00:00 PM GMT UTC
> San Francisco (U.S.A. - California) Tuesday, November 18, 2014 at 9:00:00 AM PST UTC-8 hours
> Phoenix (U.S.A. - Arizona) Tuesday, November 18, 2014 at 10:00:00 AM MST UTC-7 hours
> New York (U.S.A. - New York) Tuesday, November 18, 2014 at 12:00:00 Noon EST UTC-5 hours
> Ottawa (Canada - Ontario) Tuesday, November 18, 2014 at 12:00:00 Noon EST UTC-5 hours
> Paris (France) Tuesday, November 18, 2014 at 6:00:00 PM CET UTC+1 hour
> Tel Aviv (Israel) Tuesday, November 18, 2014 at 7:00:00 PM IST UTC+2 hours
> Moscow (Russia) Tuesday, November 18, 2014 at 8:00:00 PM MSK UTC+3 hours
> Beijing (China - Beijing Municipality) Wednesday, November 19, 2014 at 1:00:00 AM CST UTC+8 hours
> Tokyo (Japan) Wednesday, November 19, 2014 at 2:00:00 AM JST UTC+9 hours
> Corresponding UTC (GMT) Tuesday, November 18, 2014 at 17:00:00
>
>
> Secondly, we're going to try using GoToMeeting this time. Here are the
> details:
> 1. Please join my meeting from your computer, tablet or smartphone on Tue,
> Nov 18, 5:00 PM GMT Standard Time
> https://global.gotomeeting.com/join/843960205
>
> 2. Use your microphone and speakers (VOIP) for audio. You'll sound best
> with a headset. You can also call in using your telephone.
> ◦ United Kingdom (Long distance): +44 (0) 20 7151 1818
> ◦ Australia (Long distance): +61 2 8355 1034
> ◦ Sweden (Long distance): +46 (0) 852 500 182
> ◦ Canada (Long distance): +1 (647) 497-9372
> ◦ Finland (Long distance): +358 (0) 942 45 0382
> ◦ Ireland (Long distance): +353 (0) 15 255 598
> ◦ Germany (Long distance): +49 (0) 692 5736 7206
> ◦ Italy (Long distance): +39 0 693 38 75 53
> ◦ Netherlands (Long distance): +31 (0) 208 080 212
> ◦ Austria (Long distance): +43 (0) 7 2088 3707
> ◦ Belgium (Long distance): +32 (0) 28 08 9460
> ◦ United States (Long distance): +1 (626) 521-0013
> ◦ Denmark (Long distance): +45 (0) 89 88 03 61
> ◦ Switzerland (Long distance): +41 (0) 435 0824 78
> ◦ France (Long distance): +33 (0) 170 950 588
> ◦ Norway (Long distance): +47 21 04 29 76
> ◦ New Zealand (Long distance): +64 (0) 9 887 3469
> ◦ Spain (Long distance): +34 932 20 0506
>
> Access Code: 843-960-205
> Audio PIN: Shown after joining the session
>
> Not at your computer? Click the link to join this meeting from your iPhone®,
> iPad®, Android® or Windows Phone® device via the GoToMeeting app.
>
>
> Finally, what we'd like to discuss are the candidate features for the 2.0
> release that we didn't cover last time. These include:
> ◦ ABI Versioning
> ◦ DPDK support for uio_pci_generic
> ◦ Integrated Qemu Userspace vHost
> ◦ PCI Hot Plug
> ◦ Single Virtio Driver
> ◦ X32 ABI
> ◦ AVX2 ACL
> ◦ Interrupt mode for PMD
> ◦ DPDK Headroom
>
>
> Thanks,
> Tim
>
> > -----Original Message-----
> > From: O'driscoll, Tim
> > Sent: Tuesday, November 11, 2014 10:16 AM
> > To: dev@dpdk.org
> > Subject: Community conference call - Tuesday 18th November
> >
> > We're going to hold our next community conference call a week from
> > today - Tuesday 18th November, at 4:00pm in Ireland/UK. Here's the
> > time in a variety of timezones:
> >
> > Dublin (Ireland) Tuesday, November 18, 2014
> > at 4:00:00 PM GMT UTC
> > San Francisco (U.S.A. - California) Tuesday, November 18, 2014 at
> > 8:00:00 AM PST UTC-8 hours
> > Phoenix (U.S.A. - Arizona) Tuesday, November 18, 2014 at
> > 9:00:00 AM MST UTC-7 hours
> > New York (U.S.A. - New York) Tuesday, November 18, 2014
> at
> > 11:00:00 AM EST UTC-5 hours
> > Ottawa (Canada - Ontario) Tuesday, November 18, 2014 at
> > 11:00:00 AM EST UTC-5 hours
> > Paris (France) Tuesday, November 18, 2014 at
> > 5:00:00 PM CET UTC+1 hour
> > Tel Aviv (Israel) Tuesday, November 18, 2014
> at
> > 6:00:00 PM IST UTC+2 hours
> > Moscow (Russia) Tuesday, November 18, 2014 at
> > 7:00:00 PM MSK UTC+3 hours
> > Corresponding UTC (GMT) Tuesday, November 18, 2014 at
> > 16:00:00
> >
> > I'll provide conference bridge numbers later, but I wanted to
> > communicate the date and time now.
> >
> >
> > Tim
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] Community conference call - Tuesday 18th November
@ 2014-11-14 10:52 4% ` O'driscoll, Tim
2014-11-18 12:56 0% ` O'driscoll, Tim
0 siblings, 1 reply; 200+ results
From: O'driscoll, Tim @ 2014-11-14 10:52 UTC (permalink / raw)
To: 'dev@dpdk.org'
Firstly, due to some conflicts, we're going to move next Tuesday's meeting to 1 hour later. Apologies for the short notice on the change. Here's the new meeting time in a variety of timezones:
Dublin (Ireland) Tuesday, November 18, 2014 at 5:00:00 PM GMT UTC
San Francisco (U.S.A. - California) Tuesday, November 18, 2014 at 9:00:00 AM PST UTC-8 hours
Phoenix (U.S.A. - Arizona) Tuesday, November 18, 2014 at 10:00:00 AM MST UTC-7 hours
New York (U.S.A. - New York) Tuesday, November 18, 2014 at 12:00:00 Noon EST UTC-5 hours
Ottawa (Canada - Ontario) Tuesday, November 18, 2014 at 12:00:00 Noon EST UTC-5 hours
Paris (France) Tuesday, November 18, 2014 at 6:00:00 PM CET UTC+1 hour
Tel Aviv (Israel) Tuesday, November 18, 2014 at 7:00:00 PM IST UTC+2 hours
Moscow (Russia) Tuesday, November 18, 2014 at 8:00:00 PM MSK UTC+3 hours
Beijing (China - Beijing Municipality) Wednesday, November 19, 2014 at 1:00:00 AM CST UTC+8 hours
Tokyo (Japan) Wednesday, November 19, 2014 at 2:00:00 AM JST UTC+9 hours
Corresponding UTC (GMT) Tuesday, November 18, 2014 at 17:00:00
Secondly, we're going to try using GoToMeeting this time. Here are the details:
1. Please join my meeting from your computer, tablet or smartphone on Tue, Nov 18, 5:00 PM GMT Standard Time https://global.gotomeeting.com/join/843960205
2. Use your microphone and speakers (VOIP) for audio. You'll sound best with a headset. You can also call in using your telephone.
◦ United Kingdom (Long distance): +44 (0) 20 7151 1818
◦ Australia (Long distance): +61 2 8355 1034
◦ Sweden (Long distance): +46 (0) 852 500 182
◦ Canada (Long distance): +1 (647) 497-9372
◦ Finland (Long distance): +358 (0) 942 45 0382
◦ Ireland (Long distance): +353 (0) 15 255 598
◦ Germany (Long distance): +49 (0) 692 5736 7206
◦ Italy (Long distance): +39 0 693 38 75 53
◦ Netherlands (Long distance): +31 (0) 208 080 212
◦ Austria (Long distance): +43 (0) 7 2088 3707
◦ Belgium (Long distance): +32 (0) 28 08 9460
◦ United States (Long distance): +1 (626) 521-0013
◦ Denmark (Long distance): +45 (0) 89 88 03 61
◦ Switzerland (Long distance): +41 (0) 435 0824 78
◦ France (Long distance): +33 (0) 170 950 588
◦ Norway (Long distance): +47 21 04 29 76
◦ New Zealand (Long distance): +64 (0) 9 887 3469
◦ Spain (Long distance): +34 932 20 0506
Access Code: 843-960-205
Audio PIN: Shown after joining the session
Not at your computer? Click the link to join this meeting from your iPhone®, iPad®, Android® or Windows Phone® device via the GoToMeeting app.
Finally, what we'd like to discuss are the candidate features for the 2.0 release that we didn't cover last time. These include:
◦ ABI Versioning
◦ DPDK support for uio_pci_generic
◦ Integrated Qemu Userspace vHost
◦ PCI Hot Plug
◦ Single Virtio Driver
◦ X32 ABI
◦ AVX2 ACL
◦ Interrupt mode for PMD
◦ DPDK Headroom
Thanks,
Tim
> -----Original Message-----
> From: O'driscoll, Tim
> Sent: Tuesday, November 11, 2014 10:16 AM
> To: dev@dpdk.org
> Subject: Community conference call - Tuesday 18th November
>
> We're going to hold our next community conference call a week from today -
> Tuesday 18th November, at 4:00pm in Ireland/UK. Here's the time in a
> variety of timezones:
>
> Dublin (Ireland) Tuesday, November 18, 2014
> at 4:00:00 PM GMT UTC
> San Francisco (U.S.A. - California) Tuesday, November 18, 2014 at
> 8:00:00 AM PST UTC-8 hours
> Phoenix (U.S.A. - Arizona) Tuesday, November 18, 2014 at
> 9:00:00 AM MST UTC-7 hours
> New York (U.S.A. - New York) Tuesday, November 18, 2014 at
> 11:00:00 AM EST UTC-5 hours
> Ottawa (Canada - Ontario) Tuesday, November 18, 2014 at
> 11:00:00 AM EST UTC-5 hours
> Paris (France) Tuesday, November 18, 2014 at
> 5:00:00 PM CET UTC+1 hour
> Tel Aviv (Israel) Tuesday, November 18, 2014 at
> 6:00:00 PM IST UTC+2 hours
> Moscow (Russia) Tuesday, November 18, 2014 at
> 7:00:00 PM MSK UTC+3 hours
> Corresponding UTC (GMT) Tuesday, November 18, 2014 at
> 16:00:00
>
> I'll provide conference bridge numbers later, but I wanted to communicate
> the date and time now.
>
>
> Tim
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH] x32 ABI support, first iteration
2014-11-13 12:01 8% [dpdk-dev] [PATCH] x32 ABI support, first iteration Daniel Mrzyglod
2014-11-13 12:20 9% ` Mrzyglod, DanielX T
@ 2014-11-14 0:45 4% ` Neil Horman
[not found] ` <86228AFD5BCD8E4EBFD2B90117B5E81E10D789EA@SHSMSX103.ccr.corp.intel.com>
2 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-11-14 0:45 UTC (permalink / raw)
To: Daniel Mrzyglod; +Cc: dev
On Thu, Nov 13, 2014 at 12:01:31PM +0000, Daniel Mrzyglod wrote:
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> ---
> config/defconfig_x86_x32-native-linuxapp-gcc | 46 ++++++++++++++++++++
> mk/arch/x86_x32/rte.vars.mk | 63 ++++++++++++++++++++++++++++
> 2 files changed, 109 insertions(+)
> create mode 100644 config/defconfig_x86_x32-native-linuxapp-gcc
> create mode 100644 mk/arch/x86_x32/rte.vars.mk
>
> diff --git a/config/defconfig_x86_x32-native-linuxapp-gcc b/config/defconfig_x86_x32-native-linuxapp-gcc
> new file mode 100644
> index 0000000..fb0afc4
> --- /dev/null
> +++ b/config/defconfig_x86_x32-native-linuxapp-gcc
> @@ -0,0 +1,46 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +# notice, this list of conditions and the following disclaimer.
> +# * 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.
> +# * Neither the name of Intel Corporation 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
> +# OWNER 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.
> +#
> +
> +#include "common_linuxapp"
> +
> +CONFIG_RTE_MACHINE="native"
> +
> +CONFIG_RTE_ARCH="x86_x32"
> +CONFIG_RTE_ARCH_X86_X32=y
> +
> +CONFIG_RTE_TOOLCHAIN="gcc"
> +CONFIG_RTE_TOOLCHAIN_GCC=y
> +
> +#
> +# KNI is not supported on 32-bit
> +#
> +CONFIG_RTE_LIBRTE_KNI=n
> diff --git a/mk/arch/x86_x32/rte.vars.mk b/mk/arch/x86_x32/rte.vars.mk
> new file mode 100644
> index 0000000..9507af7
> --- /dev/null
> +++ b/mk/arch/x86_x32/rte.vars.mk
> @@ -0,0 +1,63 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +# notice, this list of conditions and the following disclaimer.
> +# * 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.
> +# * Neither the name of Intel Corporation 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
> +# OWNER 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.
> +
> +#
> +# arch:
> +#
> +# - define ARCH variable (overriden by cmdline or by previous
> +# optional define in machine .mk)
> +# - define CROSS variable (overriden by cmdline or previous define
> +# in machine .mk)
> +# - define CPU_CFLAGS variable (overriden by cmdline or previous
> +# define in machine .mk)
> +# - define CPU_LDFLAGS variable (overriden by cmdline or previous
> +# define in machine .mk)
> +# - define CPU_ASFLAGS variable (overriden by cmdline or previous
> +# define in machine .mk)
> +# - may override any previously defined variable
> +#
> +# examples for CONFIG_RTE_ARCH: i686, x86_64, x86_64_32
> +#
> +
> +ARCH ?= x86_64
> +ARCH_DIR := x86
> +CROSS ?=
> +
> +CPU_CFLAGS ?= -mx32
> +CPU_LDFLAGS ?= -melf32_x86_64
> +#CPU_ASFLAGS ?= -felf64
> +# x32 is supported by Linux distribution with gcc4.8 and newer in some
> +# cases there is backported support in gcc4.6
> +ifneq ($(shell echo | $(CC) $(CPU_CFLAGS) -E - 2>/dev/null 1>/dev/null && echo 0), 0)
> + $(error This version of GCC does not support x32 ABI)
> +endif
> +
> +export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS
> --
> 1.9.1
>
>
Seems reasonable. I presume that a build with all options enabled builds and
executes?
Neil
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH] x32 ABI support, first iteration
2014-11-13 12:01 8% [dpdk-dev] [PATCH] x32 ABI support, first iteration Daniel Mrzyglod
@ 2014-11-13 12:20 9% ` Mrzyglod, DanielX T
2014-11-14 0:45 4% ` Neil Horman
[not found] ` <86228AFD5BCD8E4EBFD2B90117B5E81E10D789EA@SHSMSX103.ccr.corp.intel.com>
2 siblings, 0 replies; 200+ results
From: Mrzyglod, DanielX T @ 2014-11-13 12:20 UTC (permalink / raw)
To: dev
This patch provides support for x32 ABI.
x32 ABI provides benefits of x86-64 while using 32-bit pointers and avoiding overhead of 64-bit pointers.
Daniel Mrzyglod (1):
Konstantin Ananyev(1):
x32 ABI support, first iteration
config/defconfig_x86_x32-native-linuxapp-gcc | 46 ++++++++++++++++++++
mk/arch/x86_x32/rte.vars.mk | 63 ++++++++++++++++++++++++++++
2 files changed, 109 insertions(+)
create mode 100644 config/defconfig_x86_x32-native-linuxapp-gcc
create mode 100644 mk/arch/x86_x32/rte.vars.mk
--
2.1.0
^ permalink raw reply [relevance 9%]
* [dpdk-dev] [PATCH] x32 ABI support, first iteration
@ 2014-11-13 12:01 8% Daniel Mrzyglod
2014-11-13 12:20 9% ` Mrzyglod, DanielX T
` (2 more replies)
0 siblings, 3 replies; 200+ results
From: Daniel Mrzyglod @ 2014-11-13 12:01 UTC (permalink / raw)
To: dev
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
config/defconfig_x86_x32-native-linuxapp-gcc | 46 ++++++++++++++++++++
mk/arch/x86_x32/rte.vars.mk | 63 ++++++++++++++++++++++++++++
2 files changed, 109 insertions(+)
create mode 100644 config/defconfig_x86_x32-native-linuxapp-gcc
create mode 100644 mk/arch/x86_x32/rte.vars.mk
diff --git a/config/defconfig_x86_x32-native-linuxapp-gcc b/config/defconfig_x86_x32-native-linuxapp-gcc
new file mode 100644
index 0000000..fb0afc4
--- /dev/null
+++ b/config/defconfig_x86_x32-native-linuxapp-gcc
@@ -0,0 +1,46 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+#
+
+#include "common_linuxapp"
+
+CONFIG_RTE_MACHINE="native"
+
+CONFIG_RTE_ARCH="x86_x32"
+CONFIG_RTE_ARCH_X86_X32=y
+
+CONFIG_RTE_TOOLCHAIN="gcc"
+CONFIG_RTE_TOOLCHAIN_GCC=y
+
+#
+# KNI is not supported on 32-bit
+#
+CONFIG_RTE_LIBRTE_KNI=n
diff --git a/mk/arch/x86_x32/rte.vars.mk b/mk/arch/x86_x32/rte.vars.mk
new file mode 100644
index 0000000..9507af7
--- /dev/null
+++ b/mk/arch/x86_x32/rte.vars.mk
@@ -0,0 +1,63 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+#
+# arch:
+#
+# - define ARCH variable (overriden by cmdline or by previous
+# optional define in machine .mk)
+# - define CROSS variable (overriden by cmdline or previous define
+# in machine .mk)
+# - define CPU_CFLAGS variable (overriden by cmdline or previous
+# define in machine .mk)
+# - define CPU_LDFLAGS variable (overriden by cmdline or previous
+# define in machine .mk)
+# - define CPU_ASFLAGS variable (overriden by cmdline or previous
+# define in machine .mk)
+# - may override any previously defined variable
+#
+# examples for CONFIG_RTE_ARCH: i686, x86_64, x86_64_32
+#
+
+ARCH ?= x86_64
+ARCH_DIR := x86
+CROSS ?=
+
+CPU_CFLAGS ?= -mx32
+CPU_LDFLAGS ?= -melf32_x86_64
+#CPU_ASFLAGS ?= -felf64
+# x32 is supported by Linux distribution with gcc4.8 and newer in some
+# cases there is backported support in gcc4.6
+ifneq ($(shell echo | $(CC) $(CPU_CFLAGS) -E - 2>/dev/null 1>/dev/null && echo 0), 0)
+ $(error This version of GCC does not support x32 ABI)
+endif
+
+export ARCH CROSS CPU_CFLAGS CPU_LDFLAGS CPU_ASFLAGS
--
1.9.1
^ permalink raw reply [relevance 8%]
* Re: [dpdk-dev] DPDK Community Conference Call - Friday 31st October
2014-11-01 12:59 3% ` Neil Horman
@ 2014-11-01 14:05 0% ` Vincent JARDIN
0 siblings, 0 replies; 200+ results
From: Vincent JARDIN @ 2014-11-01 14:05 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
+1 for hangout
Le 1 nov. 2014 13:59, "Neil Horman" <nhorman@tuxdriver.com> a écrit :
> On Fri, Oct 31, 2014 at 05:36:59PM +0000, O'driscoll, Tim wrote:
> > Thanks again to those who attended the call earlier. Hopefully people
> found it useful.
> >
> > We'll schedule a follow-up call for 2 weeks' time. One thing that we do
> want to look into is an easy way to allow screen sharing, so that we can
> use some slides to guide the discussion. Internally within Intel we use MS
> Lync. We can try that, but it's not always very user-friendly for external
> participants, and doesn't have a Linux client. Other options would include
> GoToMeeting or WebEx. If anybody has input on a good tool for this, let me
> know.
> >
> Don't use Lync, its a horrid tool. As you note, there is no linux client
> (nor a
> mac client that I'm aware of). Google hangouts offers screen sharing, and
> is
> free for anyone to use.
>
> > We covered the following features from our 2.0 list today, and will
> discuss the remainder on the next call. I've called out below who on our
> side was describing each of the features, and included their email
> addresses. If anybody has further questions on these, feel free to either
> ask openly on the mailing list, or else contact the relevant person
> directly.
> >
> > Bifurcated Driver (Danny.Zhou@intel.com)
> > Packet Reordering/Packet Distributor (Bruce.Richardson@intel.com)
> > New Hardware Support (Walter.E.Gilmore@intel.com)
> > Fortville features (Heqing.Zhu@intel.com)
> > Support Multiple Threads per Core (Venky.Venkatesan@intel.com)
> > Cuckoo Hash (Bruce.Richardson@intel.com, Venky.Venkatesan@intel.com)
> >
> > The Cuckoo Hash paper that was mentioned is available at:
> http://www.cs.cmu.edu/~dongz/papers/cuckooswitch.pdf.
> >
> > Finally, if anybody has suggestions for topics for future calls, please
> let me know.
> >
> ABI versioning, in support of packaging the DPDK for non-rebuilding users.
>
> Neil
>
> >
> > Thanks,
> > Tim
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O'driscoll, Tim
> > > Sent: Friday, October 31, 2014 3:35 PM
> > > To: 'dev@dpdk.org'
> > > Subject: Re: [dpdk-dev] DPDK Community Conference Call - Friday 31st
> > > October
> > >
> > > This is just a reminder for anybody who's interested that this will be
> on in 30
> > > minutes, and that we'll be discussing the feature list for the DPDK
> 2.0 release
> > > in March 2015.
> > >
> > > Audio bridge details are:
> > > France: +33 1588 77298
> > > Germany: +49 8999 143191
> > > Israel: +972 2589 6577
> > > Russia: +7 495 641 4663
> > > UK: +44 1793 402663
> > > USA/Canada: +1 916 356 2663 or +1-888-875-9370
> > >
> > > Bridge: 5
> > > Conference ID: 1264677285
> > >
> > >
> > > Tim
> > >
> > > > -----Original Message-----
> > > > From: O'driscoll, Tim
> > > > Sent: Friday, October 24, 2014 10:22 AM
> > > > To: dev@dpdk.org
> > > > Subject: DPDK Community Conference Call - Friday 31st October
> > > >
> > > > We're planning to hold our first community conference call on Friday
> > > > 31st October. It's impossible to find a time that suits everybody, so
> > > > we've chosen to do this in the afternoon/evening in Europe, which is
> > > > the morning in the USA. This does unfortunately limit participation
> > > > from PRC, Japan and other parts of the world. Here's the time and
> date in a
> > > variety of time zones:
> > > >
> > > > Dublin (Ireland) Friday, October 31, 2014 at
> > > > 4:00:00 PM GMT UTC
> > > > Paris (France) Friday, October 31, 2014
> at 5:00:00
> > > > PM CET UTC+1 hour
> > > > San Francisco (U.S.A. - California) Friday, October 31, 2014
> at 9:00:00
> > > > AM PDT UTC-7 hours
> > > > New York (U.S.A. - New York) Friday, October 31, 2014 at
> > > 12:00:00
> > > > Noon EDT UTC-4 hours
> > > > Tel Aviv (Israel) Friday, October 31, 2014 at
> > > 6:00:00
> > > > PM IST UTC+2 hours
> > > > Moscow (Russia) Friday, October 31, 2014 at 7:00:00
> > > > PM MSK UTC+3 hours
> > > >
> > > >
> > > > Audio bridge details are:
> > > > France: +33 1588 77298
> > > > Germany: +49 8999 143191
> > > > Israel: +972 2589 6577
> > > > Russia: +7 495 641 4663
> > > > UK: +44 1793 402663
> > > > USA: +1 916 356 2663
> > > >
> > > > Bridge: 5
> > > > Conference ID: 1264677285
> > > >
> > > > If anybody needs an access number for another country, let me know.
> > > >
> > > >
> > > > Agenda:
> > > > Discuss feature list for DPDK 2.0 (Q1 2015).
> > > > Suggestions for topics for future calls.
> > > >
> > > >
> > > > Thanks,
> > > > Tim
> >
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] DPDK Community Conference Call - Friday 31st October
@ 2014-11-01 12:59 3% ` Neil Horman
2014-11-01 14:05 0% ` Vincent JARDIN
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-11-01 12:59 UTC (permalink / raw)
To: O'driscoll, Tim; +Cc: 'dev@dpdk.org'
On Fri, Oct 31, 2014 at 05:36:59PM +0000, O'driscoll, Tim wrote:
> Thanks again to those who attended the call earlier. Hopefully people found it useful.
>
> We'll schedule a follow-up call for 2 weeks' time. One thing that we do want to look into is an easy way to allow screen sharing, so that we can use some slides to guide the discussion. Internally within Intel we use MS Lync. We can try that, but it's not always very user-friendly for external participants, and doesn't have a Linux client. Other options would include GoToMeeting or WebEx. If anybody has input on a good tool for this, let me know.
>
Don't use Lync, its a horrid tool. As you note, there is no linux client (nor a
mac client that I'm aware of). Google hangouts offers screen sharing, and is
free for anyone to use.
> We covered the following features from our 2.0 list today, and will discuss the remainder on the next call. I've called out below who on our side was describing each of the features, and included their email addresses. If anybody has further questions on these, feel free to either ask openly on the mailing list, or else contact the relevant person directly.
>
> Bifurcated Driver (Danny.Zhou@intel.com)
> Packet Reordering/Packet Distributor (Bruce.Richardson@intel.com)
> New Hardware Support (Walter.E.Gilmore@intel.com)
> Fortville features (Heqing.Zhu@intel.com)
> Support Multiple Threads per Core (Venky.Venkatesan@intel.com)
> Cuckoo Hash (Bruce.Richardson@intel.com, Venky.Venkatesan@intel.com)
>
> The Cuckoo Hash paper that was mentioned is available at: http://www.cs.cmu.edu/~dongz/papers/cuckooswitch.pdf.
>
> Finally, if anybody has suggestions for topics for future calls, please let me know.
>
ABI versioning, in support of packaging the DPDK for non-rebuilding users.
Neil
>
> Thanks,
> Tim
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of O'driscoll, Tim
> > Sent: Friday, October 31, 2014 3:35 PM
> > To: 'dev@dpdk.org'
> > Subject: Re: [dpdk-dev] DPDK Community Conference Call - Friday 31st
> > October
> >
> > This is just a reminder for anybody who's interested that this will be on in 30
> > minutes, and that we'll be discussing the feature list for the DPDK 2.0 release
> > in March 2015.
> >
> > Audio bridge details are:
> > France: +33 1588 77298
> > Germany: +49 8999 143191
> > Israel: +972 2589 6577
> > Russia: +7 495 641 4663
> > UK: +44 1793 402663
> > USA/Canada: +1 916 356 2663 or +1-888-875-9370
> >
> > Bridge: 5
> > Conference ID: 1264677285
> >
> >
> > Tim
> >
> > > -----Original Message-----
> > > From: O'driscoll, Tim
> > > Sent: Friday, October 24, 2014 10:22 AM
> > > To: dev@dpdk.org
> > > Subject: DPDK Community Conference Call - Friday 31st October
> > >
> > > We're planning to hold our first community conference call on Friday
> > > 31st October. It's impossible to find a time that suits everybody, so
> > > we've chosen to do this in the afternoon/evening in Europe, which is
> > > the morning in the USA. This does unfortunately limit participation
> > > from PRC, Japan and other parts of the world. Here's the time and date in a
> > variety of time zones:
> > >
> > > Dublin (Ireland) Friday, October 31, 2014 at
> > > 4:00:00 PM GMT UTC
> > > Paris (France) Friday, October 31, 2014 at 5:00:00
> > > PM CET UTC+1 hour
> > > San Francisco (U.S.A. - California) Friday, October 31, 2014 at 9:00:00
> > > AM PDT UTC-7 hours
> > > New York (U.S.A. - New York) Friday, October 31, 2014 at
> > 12:00:00
> > > Noon EDT UTC-4 hours
> > > Tel Aviv (Israel) Friday, October 31, 2014 at
> > 6:00:00
> > > PM IST UTC+2 hours
> > > Moscow (Russia) Friday, October 31, 2014 at 7:00:00
> > > PM MSK UTC+3 hours
> > >
> > >
> > > Audio bridge details are:
> > > France: +33 1588 77298
> > > Germany: +49 8999 143191
> > > Israel: +972 2589 6577
> > > Russia: +7 495 641 4663
> > > UK: +44 1793 402663
> > > USA: +1 916 356 2663
> > >
> > > Bridge: 5
> > > Conference ID: 1264677285
> > >
> > > If anybody needs an access number for another country, let me know.
> > >
> > >
> > > Agenda:
> > > Discuss feature list for DPDK 2.0 (Q1 2015).
> > > Suggestions for topics for future calls.
> > >
> > >
> > > Thanks,
> > > Tim
>
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [dpdk-announce] DPDK Features for Q1 2015
2014-10-22 13:48 2% [dpdk-dev] [dpdk-announce] DPDK Features for Q1 2015 O'driscoll, Tim
@ 2014-10-22 16:10 3% ` Luke Gorrie
0 siblings, 0 replies; 200+ results
From: Luke Gorrie @ 2014-10-22 16:10 UTC (permalink / raw)
To: O'driscoll, Tim; +Cc: dev
Hi Tim,
On 22 October 2014 15:48, O'driscoll, Tim <tim.o'driscoll@intel.com> wrote:
> 2.0 (Q1 2015) DPDK Features:
> Bifurcated Driver: With the Bifurcated Driver, the kernel will retain
> direct control of the NIC, and will assign specific queue pairs to DPDK.
> Configuration of the NIC is controlled by the kernel via ethtool.
>
That sounds awesome and potentially really useful for other people writing
userspace data planes too. If I understand correctly, this way the messy
details can be contained in one place (kernel) and the application (DPDK
PMD or otherwise) will access the NIC TX/RX queue via the ABI defined in
the hardware data sheet.
Single Virtio Driver: Merge existing Virtio drivers into a single
> implementation, incorporating the best features from each of the existing
> drivers.
>
Cool. Do you have a strategy in mind already for zero-copy optimisation
with VMDq? I have seen some patches floating around for this and it's an
area of active interest for myself and others. I see a lot of potential for
making this work more effectively with some modest extensions to Virtio and
guest behaviour, and would love to meet kindred spirits who are thinking
along these lines too.
^ permalink raw reply [relevance 3%]
* [dpdk-dev] [dpdk-announce] DPDK Features for Q1 2015
@ 2014-10-22 13:48 2% O'driscoll, Tim
2014-10-22 16:10 3% ` Luke Gorrie
0 siblings, 1 reply; 200+ results
From: O'driscoll, Tim @ 2014-10-22 13:48 UTC (permalink / raw)
To: announce
We're starting to plan our DPDK features for next year. We're planning to have a DPDK 2.0 release at the end of March, and we'd like to inform the community of the features that we hope to submit to that release. The current list of features, along with brief descriptions, is included below.
There will naturally be some changes to this list as work on these features progresses. Some will inevitably turn out to be bigger than anticipated and will need to be deferred to a later date, while other priorities will arise and need to be accommodated. So, this list will be subject to change, and should be taken as guidance on what we hope to submit, not a commitment.
Our aim in providing this information now is to solicit input from the community. We'd like to make sure we avoid duplication or conflicts with work that others are planning, so we'd be interested in hearing any plans that others in the community have for contributions to DPDK in this timeframe. This will allow us to build a complete picture and ensure we avoid duplication of effort.
I'm sure people will have questions, and will be looking for more information on these features. Further details will be provided by the individual developers over the next few months. We aim to make better use of the RFC process in this release, and provide early outlines of the features so that we can obtain community feedback as soon as possible.
We also said at the recent DPDK Summit that we would investigate holding regular community conference calls. We'll be scheduling the first of these calls soon, and will use this to discuss the 2.0 (Q1 2015) features in a bit more detail.
2.0 (Q1 2015) DPDK Features:
Bifurcated Driver: With the Bifurcated Driver, the kernel will retain direct control of the NIC, and will assign specific queue pairs to DPDK. Configuration of the NIC is controlled by the kernel via ethtool.
Support the new Intel SoC platform, along with the embedded 10GbE NIC.
Packet Reordering: Assign a sequence number to packets on Rx, and then provide the ability to reorder on Tx to preserve the original order.
Packet Distributor (phase 2): Implement the following enhancements to the Packet Distributor that was originally delivered in the DPDK 1.7 release: performance improvements; the ability for packets from a flow to be processed by multiple worker cores in parallel and then reordered on Tx using the Packet Reordering feature; the ability to have multiple Distributors which share Worker cores.
Support Multiple Threads per Core: Use Linux cgroups to allow multiple threads to run on a single core. This would be useful in situations where a DPDK thread does not require the full resources of a core.
Support the Fedora 21 OS.
Support the host interface for Intel's next generation Ethernet switch. This only covers basic support for the host interface. Support for additional features will be added later.
Cuckoo Hash: A new hash algorithm was implemented as part of the Cuckoo Switch project (see http://www.cs.cmu.edu/~dongz/papers/cuckooswitch.pdf), and shows some promising performance results. This needs to be modified to make it more generic, and then incorporated into DPDK.
Provide DPDK support for uio_pci_generic.
Integrated Qemu Userspace vHost: Modify Userspace vHost to use Qemu version 2.1, and remove the need for the kernel module (cuse.ko).
PCI Hot Plug: When you migrate a VM, you need hot plug support as the new VF on the new hardware you are running on post-migration needs to be initialized. With an emulated NIC migration is seamless as all configuration for the NIC is within the RAM of the VM and the hypervisor. With a VF you have actual hardware in the picture which needs to be set up properly.
Additional XL710/X710 40-Gigabit Ethernet Controller Features: Support for additional XL710/X710 40-Gigabit Ethernet Controller features, including bandwidth and QoS management, NVGRE and other network overlay support, TSO, IEEE1588, DCB support. SR-IOV switching and port mirroring.
Single Virtio Driver: Merge existing Virtio drivers into a single implementation, incorporating the best features from each of the existing drivers.
X32 ABI: This is an application binary interface project for the Linux kernel that allows programs to take advantage of the benefits of x86-64 (larger number of CPU registers, better floating-point performance, faster position-independent code shared libraries, function parameters passed via registers, faster syscall instruction) while using 32-bit pointers and thus avoiding the overhead of 64-bit pointers.
AVX2 ACL: Modify ACL library to use AVX2 instructions to improve performance.
Interrupt mode for PMD: Allow DPDK process to transition to interrupt mode when load is low so that other processes can run, or else power can be saved. This will increase latency/jitter.
DPDK Headroom: Provide a mechanism to indicate how much headroom (spare capacity) exists in a DPDK process.
Thanks,
Tim
^ permalink raw reply [relevance 2%]
* Re: [dpdk-dev] [PATCH v2 3/4] Update library build process
2014-10-08 22:36 0% ` Matthew Hall
@ 2014-10-09 9:44 0% ` Sergio Gonzalez Monroy
0 siblings, 0 replies; 200+ results
From: Sergio Gonzalez Monroy @ 2014-10-09 9:44 UTC (permalink / raw)
To: Matthew Hall; +Cc: dev
On Wed, Oct 08, 2014 at 03:36:55PM -0700, Matthew Hall wrote:
> On Tue, Oct 07, 2014 at 10:55:11AM +0100, Sergio Gonzalez Monroy wrote:
> > I don't see how this particular patch would force people to change their code,
> > though in all likelihood they will have to as a result of ABI changes in the
> > following release.
> >
> > The only difference now would be when they link their applications against a
> > single library instead of multiple separated libraries.
> >
> > Thanks,
> > Sergio
>
> Hi Sergio,
>
> Changing all of your Makefiles does sound like changing code to me.
>
Hi Matthew,
You are right, it is changing code.
What I was trying to say is that the impact of this patch is probrably going to
be one of the lowest as far as changing code for the next release.
Thanks,
Sergio
> Matthew.
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v2 3/4] Update library build process
2014-10-07 9:55 3% ` Sergio Gonzalez Monroy
@ 2014-10-08 22:36 0% ` Matthew Hall
2014-10-09 9:44 0% ` Sergio Gonzalez Monroy
0 siblings, 1 reply; 200+ results
From: Matthew Hall @ 2014-10-08 22:36 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
On Tue, Oct 07, 2014 at 10:55:11AM +0100, Sergio Gonzalez Monroy wrote:
> I don't see how this particular patch would force people to change their code,
> though in all likelihood they will have to as a result of ABI changes in the
> following release.
>
> The only difference now would be when they link their applications against a
> single library instead of multiple separated libraries.
>
> Thanks,
> Sergio
Hi Sergio,
Changing all of your Makefiles does sound like changing code to me.
Matthew.
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-10-08 15:57 0% ` Thomas Monjalon
2014-10-08 18:46 3% ` Butler, Siobhan A
@ 2014-10-08 19:09 4% ` Neil Horman
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2014-10-08 19:09 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Wed, Oct 08, 2014 at 05:57:29PM +0200, Thomas Monjalon wrote:
> Hi Neil,
>
> 2014-10-07 17:01, Neil Horman:
> > On Wed, Oct 01, 2014 at 02:59:40PM -0400, Neil Horman wrote:
> > > On Fri, Sep 26, 2014 at 10:45:49AM -0400, Neil Horman wrote:
> > > > On Fri, Sep 26, 2014 at 12:41:33PM +0200, Thomas Monjalon wrote:
> > > > > Hi Neil,
> > > > >
> > > > > 2014-09-24 14:19, Neil Horman:
> > > > > > Ping Thomas. I know you're busy, but I would like this to not fall off anyones
> > > > > > radar. You alluded to concerns regarding what, for lack of a better term,
> > > > > > ABI/API lockin. I had asked you to enuumerate/elaborate on specifics, but never
> > > > > > heard back. Are there further specifics you wish to discuss, or are you
> > > > > > satisfied with the above answers?
> > > > >
> > > > > Sorry for not being very reactive on this thread.
> > > > > All this discussion is very interesting but it's really not the proper
> > > > > time to apply it. As you said, it requires an extra effort. I'm not saying
> > > > > it will never be integrated. I'm just saying that we cannot change
> > > > > everything at the same time.
> > > > >
> > > > > Let me sum up the situation. This community project has been very active
> > > > > for few months now. First, we learnt how to make some releases together
> > > > > and we are improving the process to be able to deliver a new major release
> > > > > every 4 months while having some good quality process.
> > > > > But these releases are still not complete because documentation is not
> > > > > integrated yet. Then developers should have a role in documentation updates.
> > > > > We also need to integrate and learn how to use more tools to be more
> > > > > efficient and improve quality.
> > > > >
> > > > > So the question is "when should we care about API compatibility"?
> > > > > And the answer is: ASAP, but not now. I feel next year is a better target.
> > > > > Because the most important priority is to move together at a pace which
> > > > > allow most of us to stay in the race.
> > > >
> > > > I'm sorry Thomas, I don't accept this. I asked you for details as to your
> > > > concerns regarding this patch series, and you've provided more vague comments.
> > > > I need details to address
> > > >
> > > > You say it requires extra effort, you're right it does. Any feature that you
> > > > integreate requires some additional effort. How is this patch any different
> > > > from adding the acl library or any other new API? Everything requires
> > > > maintenence, thats how software works. What specfically about this patch series
> > > > makes the effort insurmountable to you?
> > > >
> > > > You say you're improving your process. Great, this patch aids in that process
> > > > by ensuring backwards compatibility for a period of time. Given that the API
> > > > and ABI can still evolve within this framework, as I've described, how is this
> > > > patch series not a significant step forward toward your goal of quality process.
> > > >
> > > > You say documentation isn't integrated. So, what does getting documentation
> > > > integrated have to do with this patch set, or any other? I don't see you
> > > > holding any other patches based on documentation. Again, nothing in this series
> > > > prevents evolution of the API or ABI. If you're hope is to wait until
> > > > everything is perfect, then apply some control to the public facing API, and get
> > > > it all documented, none of thosse things will ever happen, I promise you.
> > > >
> > > > You say you also need to learn to use more tools to be more efficient and
> > > > improve quality. Great! Thats exactly what this is. If we mandate even a short
> > > > term commitment to ABI stability (1 single relese worth of time), we will
> > > > quickly identify what API's change quickly and where we need to be cautious with
> > > > our API design. If you just assume that developers will get better of their own
> > > > volition, it will never happen.
> > > >
> > > > You say this should go in next year, but not now. When exactly? What event do
> > > > you forsee occuring in the next 12-18 months that will change everything such
> > > > that we can start supporing an ABI for more than just a few weeks at the head of
> > > > the tree?
> > > >
> > > > To this end, I just did a quick search through the git history for dpdk to look
> > > > at the histories of all the header files that are exposed via the makefile
> > > > SYMLINK command (given that that provides a list of header files that
> > > > applications can include, and embodies all the function symbols and data types
> > > > applications have access to.
> > > >
> > > > There are 179 total commits in that list
> > > > Of those, a bit of spot checking suggests that about 10-15% of them actually
> > > > change ABI, and many of those came from Bruce's rework of the mbuf structure.
> > > > That about 17-20 instances over the last 2 years where an ABI update would have
> > > > been needed. That seems pretty reasonable to me. Where exactly is your concern
> > > > here?
> > >
> > > Ping Thomas, I'd like to continue this debate to a conclusion. Could you please
> > > provide specific details and/or concerns that you have with this patch series?
> > >
> > Ping again Thomas, please lets debate this to a reasonable consensus. Ignoring
> > it won't help anything.
>
> I'm not ignoring the discussion, I was trying to focus on other topics.
>
for 2 weeks? In that time frame, it seems like this could have made 1.8, but I
suppose thats neither here nor there.
> You're right, we need a conclusion.
> This patch is an important change which needs time to be finely checked and
> tested.
Not sure I understand this. At the moment, all this patch introduces in
infrastructure, testing has been done on it, to ensure that it allows for
multiple versions of a function to exist (See Sergios comments). Beyond that,
this patch should do nothing, save for restrict the symbol export list to the
set of symbols you expose as an API. That last bit was why I was so eager to
get this in weeks ago, so people could do builds and make sure no symbols were
missed). But from a functional standpoint, this patch current does nothing (nor
should it). Its functionality (and need for testing) comes only when the next
ABI change arrives, and we need to ensure that both old and new versions of a
given function work.
> So I plan to integrate it in version 2.0 which will be the next one
> after 1.8 release.
What do you see as the advantage to waiting longer here? Already this patch
likely will need some fixups because of API changing patches integrated ahead of
the time I posted it. As noted above, this series just install infrastructure,
its doesn't actively "do" anything right now, nor should it. It will only allow
developers to do something after you integrate it and ABI needs to change (in
that order). By waiting longer, the only thing that happens is that the export
map file become more out of date.
> In the mean time you could test this patch with Fedora
> and see how it helps application packaging. Then we could be more confident
> that we are applying the right policy starting with 2.0.
>
Again, I could add this patch to fedora, but without a subsequent change that
introduces an ABI incompatibility that we need to provide backwards
compatibility for, this patch will be functionally invisible. I'm not sure what
the goal of doing something like that would be. If you have a specific goal in
mind, please let me know and I gladly consider it, I just don't see it at the
moment.
> Thanks Neil, I appreciate your involvement in DPDK
And I yours. I'm sorry for being so beligerent about this, but it seems to me
that, without raising my voice, this would go nowhere.
Neil
> --
> Thomas
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-10-08 15:57 0% ` Thomas Monjalon
@ 2014-10-08 18:46 3% ` Butler, Siobhan A
2014-10-08 19:09 4% ` Neil Horman
1 sibling, 0 replies; 200+ results
From: Butler, Siobhan A @ 2014-10-08 18:46 UTC (permalink / raw)
To: Thomas Monjalon, Neil Horman; +Cc: dev
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
Sent: Wednesday, October 8, 2014 4:57 PM
To: Neil Horman
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
Hi Neil,
2014-10-07 17:01, Neil Horman:
> On Wed, Oct 01, 2014 at 02:59:40PM -0400, Neil Horman wrote:
> > On Fri, Sep 26, 2014 at 10:45:49AM -0400, Neil Horman wrote:
> > > On Fri, Sep 26, 2014 at 12:41:33PM +0200, Thomas Monjalon wrote:
> > > > Hi Neil,
> > > >
> > > > 2014-09-24 14:19, Neil Horman:
> > > > > Ping Thomas. I know you're busy, but I would like this to not
> > > > > fall off anyones radar. You alluded to concerns regarding
> > > > > what, for lack of a better term, ABI/API lockin. I had asked
> > > > > you to enuumerate/elaborate on specifics, but never heard
> > > > > back. Are there further specifics you wish to discuss, or are you satisfied with the above answers?
> > > >
> > > > Sorry for not being very reactive on this thread.
> > > > All this discussion is very interesting but it's really not the
> > > > proper time to apply it. As you said, it requires an extra
> > > > effort. I'm not saying it will never be integrated. I'm just
> > > > saying that we cannot change everything at the same time.
> > > >
> > > > Let me sum up the situation. This community project has been
> > > > very active for few months now. First, we learnt how to make
> > > > some releases together and we are improving the process to be
> > > > able to deliver a new major release every 4 months while having some good quality process.
> > > > But these releases are still not complete because documentation
> > > > is not integrated yet. Then developers should have a role in documentation updates.
> > > > We also need to integrate and learn how to use more tools to be
> > > > more efficient and improve quality.
> > > >
> > > > So the question is "when should we care about API compatibility"?
> > > > And the answer is: ASAP, but not now. I feel next year is a better target.
> > > > Because the most important priority is to move together at a
> > > > pace which allow most of us to stay in the race.
> > >
> > > I'm sorry Thomas, I don't accept this. I asked you for details as
> > > to your concerns regarding this patch series, and you've provided more vague comments.
> > > I need details to address
> > >
> > > You say it requires extra effort, you're right it does. Any
> > > feature that you integreate requires some additional effort. How
> > > is this patch any different from adding the acl library or any
> > > other new API? Everything requires maintenence, thats how
> > > software works. What specfically about this patch series makes the effort insurmountable to you?
> > >
> > > You say you're improving your process. Great, this patch aids in
> > > that process by ensuring backwards compatibility for a period of
> > > time. Given that the API and ABI can still evolve within this
> > > framework, as I've described, how is this patch series not a significant step forward toward your goal of quality process.
> > >
> > > You say documentation isn't integrated. So, what does getting
> > > documentation integrated have to do with this patch set, or any
> > > other? I don't see you holding any other patches based on
> > > documentation. Again, nothing in this series prevents evolution
> > > of the API or ABI. If you're hope is to wait until everything is
> > > perfect, then apply some control to the public facing API, and get it all documented, none of thosse things will ever happen, I promise you.
> > >
> > > You say you also need to learn to use more tools to be more
> > > efficient and improve quality. Great! Thats exactly what this
> > > is. If we mandate even a short term commitment to ABI stability (1
> > > single relese worth of time), we will quickly identify what API's
> > > change quickly and where we need to be cautious with our API
> > > design. If you just assume that developers will get better of their own volition, it will never happen.
> > >
> > > You say this should go in next year, but not now. When exactly?
> > > What event do you forsee occuring in the next 12-18 months that
> > > will change everything such that we can start supporing an ABI for
> > > more than just a few weeks at the head of the tree?
> > >
> > > To this end, I just did a quick search through the git history for
> > > dpdk to look at the histories of all the header files that are
> > > exposed via the makefile SYMLINK command (given that that provides
> > > a list of header files that applications can include, and embodies
> > > all the function symbols and data types applications have access to.
> > >
> > > There are 179 total commits in that list Of those, a bit of spot
> > > checking suggests that about 10-15% of them actually change ABI,
> > > and many of those came from Bruce's rework of the mbuf structure.
> > > That about 17-20 instances over the last 2 years where an ABI
> > > update would have been needed. That seems pretty reasonable to
> > > me. Where exactly is your concern here?
> >
> > Ping Thomas, I'd like to continue this debate to a conclusion.
> > Could you please provide specific details and/or concerns that you have with this patch series?
> >
> Ping again Thomas, please lets debate this to a reasonable consensus.
> Ignoring it won't help anything.
>>>I'm not ignoring the discussion, I was trying to focus on other topics.
>>>You're right, we need a conclusion.
>>>This patch is an important change which needs time to be finely checked and tested. So I plan to integrate it in version 2.0 which will be the next one >>>after 1.8 release. In the mean time you could test this patch with Fedora and see how it helps application packaging. Then we could be more confident >>>that we are applying the right policy starting with 2.0.
>>>Thanks Neil, I appreciate your involvement in DPDK
>>>--
>>>Thomas
Neil, Thomas,
I think Neil is correct here - these API/ABI compatibility/stability changes are really important. We need a conclusion as you both mentioned. I see Thomas' points about caution and needing time, but it seems like there is no point in prolonging the inevitable and having consider all of this for some time I think it might be wise to just adjust and get on with it? If these changes cannot be ready in the near term, what will make them more ready further out?
Siobhan
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-10-07 21:01 0% ` Neil Horman
@ 2014-10-08 15:57 0% ` Thomas Monjalon
2014-10-08 18:46 3% ` Butler, Siobhan A
2014-10-08 19:09 4% ` Neil Horman
0 siblings, 2 replies; 200+ results
From: Thomas Monjalon @ 2014-10-08 15:57 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Hi Neil,
2014-10-07 17:01, Neil Horman:
> On Wed, Oct 01, 2014 at 02:59:40PM -0400, Neil Horman wrote:
> > On Fri, Sep 26, 2014 at 10:45:49AM -0400, Neil Horman wrote:
> > > On Fri, Sep 26, 2014 at 12:41:33PM +0200, Thomas Monjalon wrote:
> > > > Hi Neil,
> > > >
> > > > 2014-09-24 14:19, Neil Horman:
> > > > > Ping Thomas. I know you're busy, but I would like this to not fall off anyones
> > > > > radar. You alluded to concerns regarding what, for lack of a better term,
> > > > > ABI/API lockin. I had asked you to enuumerate/elaborate on specifics, but never
> > > > > heard back. Are there further specifics you wish to discuss, or are you
> > > > > satisfied with the above answers?
> > > >
> > > > Sorry for not being very reactive on this thread.
> > > > All this discussion is very interesting but it's really not the proper
> > > > time to apply it. As you said, it requires an extra effort. I'm not saying
> > > > it will never be integrated. I'm just saying that we cannot change
> > > > everything at the same time.
> > > >
> > > > Let me sum up the situation. This community project has been very active
> > > > for few months now. First, we learnt how to make some releases together
> > > > and we are improving the process to be able to deliver a new major release
> > > > every 4 months while having some good quality process.
> > > > But these releases are still not complete because documentation is not
> > > > integrated yet. Then developers should have a role in documentation updates.
> > > > We also need to integrate and learn how to use more tools to be more
> > > > efficient and improve quality.
> > > >
> > > > So the question is "when should we care about API compatibility"?
> > > > And the answer is: ASAP, but not now. I feel next year is a better target.
> > > > Because the most important priority is to move together at a pace which
> > > > allow most of us to stay in the race.
> > >
> > > I'm sorry Thomas, I don't accept this. I asked you for details as to your
> > > concerns regarding this patch series, and you've provided more vague comments.
> > > I need details to address
> > >
> > > You say it requires extra effort, you're right it does. Any feature that you
> > > integreate requires some additional effort. How is this patch any different
> > > from adding the acl library or any other new API? Everything requires
> > > maintenence, thats how software works. What specfically about this patch series
> > > makes the effort insurmountable to you?
> > >
> > > You say you're improving your process. Great, this patch aids in that process
> > > by ensuring backwards compatibility for a period of time. Given that the API
> > > and ABI can still evolve within this framework, as I've described, how is this
> > > patch series not a significant step forward toward your goal of quality process.
> > >
> > > You say documentation isn't integrated. So, what does getting documentation
> > > integrated have to do with this patch set, or any other? I don't see you
> > > holding any other patches based on documentation. Again, nothing in this series
> > > prevents evolution of the API or ABI. If you're hope is to wait until
> > > everything is perfect, then apply some control to the public facing API, and get
> > > it all documented, none of thosse things will ever happen, I promise you.
> > >
> > > You say you also need to learn to use more tools to be more efficient and
> > > improve quality. Great! Thats exactly what this is. If we mandate even a short
> > > term commitment to ABI stability (1 single relese worth of time), we will
> > > quickly identify what API's change quickly and where we need to be cautious with
> > > our API design. If you just assume that developers will get better of their own
> > > volition, it will never happen.
> > >
> > > You say this should go in next year, but not now. When exactly? What event do
> > > you forsee occuring in the next 12-18 months that will change everything such
> > > that we can start supporing an ABI for more than just a few weeks at the head of
> > > the tree?
> > >
> > > To this end, I just did a quick search through the git history for dpdk to look
> > > at the histories of all the header files that are exposed via the makefile
> > > SYMLINK command (given that that provides a list of header files that
> > > applications can include, and embodies all the function symbols and data types
> > > applications have access to.
> > >
> > > There are 179 total commits in that list
> > > Of those, a bit of spot checking suggests that about 10-15% of them actually
> > > change ABI, and many of those came from Bruce's rework of the mbuf structure.
> > > That about 17-20 instances over the last 2 years where an ABI update would have
> > > been needed. That seems pretty reasonable to me. Where exactly is your concern
> > > here?
> >
> > Ping Thomas, I'd like to continue this debate to a conclusion. Could you please
> > provide specific details and/or concerns that you have with this patch series?
> >
> Ping again Thomas, please lets debate this to a reasonable consensus. Ignoring
> it won't help anything.
I'm not ignoring the discussion, I was trying to focus on other topics.
You're right, we need a conclusion.
This patch is an important change which needs time to be finely checked and
tested. So I plan to integrate it in version 2.0 which will be the next one
after 1.8 release. In the mean time you could test this patch with Fedora
and see how it helps application packaging. Then we could be more confident
that we are applying the right policy starting with 2.0.
Thanks Neil, I appreciate your involvement in DPDK
--
Thomas
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-10-01 18:59 0% ` Neil Horman
@ 2014-10-07 21:01 0% ` Neil Horman
2014-10-08 15:57 0% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-10-07 21:01 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Wed, Oct 01, 2014 at 02:59:40PM -0400, Neil Horman wrote:
> On Fri, Sep 26, 2014 at 10:45:49AM -0400, Neil Horman wrote:
> > On Fri, Sep 26, 2014 at 12:41:33PM +0200, Thomas Monjalon wrote:
> > > Hi Neil,
> > >
> > > 2014-09-24 14:19, Neil Horman:
> > > > Ping Thomas. I know you're busy, but I would like this to not fall off anyones
> > > > radar. You alluded to concerns regarding what, for lack of a better term,
> > > > ABI/API lockin. I had asked you to enuumerate/elaborate on specifics, but never
> > > > heard back. Are there further specifics you wish to discuss, or are you
> > > > satisfied with the above answers?
> > >
> > > Sorry for not being very reactive on this thread.
> > > All this discussion is very interesting but it's really not the proper
> > > time to apply it. As you said, it requires an extra effort. I'm not saying
> > > it will never be integrated. I'm just saying that we cannot change
> > > everything at the same time.
> > >
> > > Let me sum up the situation. This community project has been very active
> > > for few months now. First, we learnt how to make some releases together
> > > and we are improving the process to be able to deliver a new major release
> > > every 4 months while having some good quality process.
> > > But these releases are still not complete because documentation is not
> > > integrated yet. Then developers should have a role in documentation updates.
> > > We also need to integrate and learn how to use more tools to be more
> > > efficient and improve quality.
> > >
> > > So the question is "when should we care about API compatibility"?
> > > And the answer is: ASAP, but not now. I feel next year is a better target.
> > > Because the most important priority is to move together at a pace which
> > > allow most of us to stay in the race.
> > >
> >
> >
> > I'm sorry Thomas, I don't accept this. I asked you for details as to your
> > concerns regarding this patch series, and you've provided more vague comments.
> > I need details to address
> >
> > You say it requires extra effort, you're right it does. Any feature that you
> > integreate requires some additional effort. How is this patch any different
> > from adding the acl library or any other new API? Everything requires
> > maintenence, thats how software works. What specfically about this patch series
> > makes the effort insurmountable to you?
> >
> > You say you're improving your process. Great, this patch aids in that process
> > by ensuring backwards compatibility for a period of time. Given that the API
> > and ABI can still evolve within this framework, as I've described, how is this
> > patch series not a significant step forward toward your goal of quality process.
> >
> > You say documentation isn't integrated. So, what does getting documentation
> > integrated have to do with this patch set, or any other? I don't see you
> > holding any other patches based on documentation. Again, nothing in this series
> > prevents evolution of the API or ABI. If you're hope is to wait until
> > everything is perfect, then apply some control to the public facing API, and get
> > it all documented, none of thosse things will ever happen, I promise you.
> >
> > You say you also need to learn to use more tools to be more efficient and
> > improve quality. Great! Thats exactly what this is. If we mandate even a short
> > term commitment to ABI stability (1 single relese worth of time), we will
> > quickly identify what API's change quickly and where we need to be cautious with
> > our API design. If you just assume that developers will get better of their own
> > volition, it will never happen.
> >
> > You say this should go in next year, but not now. When exactly? What event do
> > you forsee occuring in the next 12-18 months that will change everything such
> > that we can start supporing an ABI for more than just a few weeks at the head of
> > the tree?
> >
> > To this end, I just did a quick search through the git history for dpdk to look
> > at the histories of all the header files that are exposed via the makefile
> > SYMLINK command (given that that provides a list of header files that
> > applications can include, and embodies all the function symbols and data types
> > applications have access to.
> >
> > There are 179 total commits in that list
> > Of those, a bit of spot checking suggests that about 10-15% of them actually
> > change ABI, and many of those came from Bruce's rework of the mbuf structure.
> > That about 17-20 instances over the last 2 years where an ABI update would have
> > been needed. That seems pretty reasonable to me. Where exactly is your concern
> > here?
> >
> > Neil
> >
>
> Ping Thomas, I'd like to continue this debate to a conclusion. Could you please
> provide specific details and/or concerns that you have with this patch series?
>
> Thanks
> Neil
>
Ping again Thomas, please lets debate this to a reasonable consensus. Ignoring
it won't help anything.
Regards
Neil
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v2 3/4] Update library build process
@ 2014-10-07 9:55 3% ` Sergio Gonzalez Monroy
2014-10-08 22:36 0% ` Matthew Hall
0 siblings, 1 reply; 200+ results
From: Sergio Gonzalez Monroy @ 2014-10-07 9:55 UTC (permalink / raw)
To: Matthew Hall; +Cc: dev
On Mon, Oct 06, 2014 at 01:46:07PM -0700, Matthew Hall wrote:
> On Mon, Oct 06, 2014 at 11:52:34AM +0100, Sergio Gonzalez Monroy wrote:
> > Remove COMBINE_LIBS option and by default build:
> > - CONFIG_RTE_BUILD_SHARED_LIB=y : both individual and combined libraries
> > - CONFIG_RTE_BUILD_SHARED_LIB=n : single combined library
>
> As previously discussed.,It would be better for backward-compatibility of
> people linking against DPDK, if the static lib could come out as both a
> combined library and separate individual libraries by default.
>
> Otherwise everybody linking against DPDK has to change their code, and it
> won't be easy for them to move forward and backward against different DPDKs
> before and after this change.
>
> Thanks,
> Matthew.
Hi Matthew,
My understanding from previous conversations is that backward-compatibility
is not being provided for the next release, as such it is unlikely that
backward-compatibility for compile/linking will be provided.
I don't see how this particular patch would force people to change their code,
though in all likelihood they will have to as a result of ABI changes in the
following release.
The only difference now would be when they link their applications against a
single library instead of multiple separated libraries.
Thanks,
Sergio
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 0/4] Fix build issues with CONFIG_RTE_BUILD_COMBINE_LIBS=y
@ 2014-10-04 2:30 3% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-10-04 2:30 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
On Fri, Oct 03, 2014 at 04:52:40PM -0700, Stephen Hemminger wrote:
> On Fri, 3 Oct 2014 07:28:33 -0400
> Neil Horman <nhorman@tuxdriver.com> wrote:
>
> > I.e. you can ship your pmd's
> > pacakged separately from your core
>
> I was hoping only the application API would be "stable"
> As we know from Linux kernel, internal API's will never remain stable.
>
None of the API's are stable. My only hope with the ABI series I've posted is
to keep the interfaces stable for a release beyond the next time they change, so
that application developers aren't consistently caught off guard if they don't
synchronize with the DPDK release schedule.
I know the kernel API's are constantly changing, but this isn't the kernel,
its a user space library. Theres nothing that prevents a third party from
writing a pmd to interface to the ethdev library, which is no different from any
other user space library. If the DPDK wants to get packaged like other
libraries in distributions, it needs to provide stability assurances like other
libraries.
Neil
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH] Fix linking errors when CONFIG_RTE_BUILD_SHARED_LIB is enabled
2014-10-02 9:05 0% ` Tetsuya Mukawa
@ 2014-10-03 11:11 0% ` Sergio Gonzalez Monroy
0 siblings, 0 replies; 200+ results
From: Sergio Gonzalez Monroy @ 2014-10-03 11:11 UTC (permalink / raw)
To: Tetsuya Mukawa; +Cc: dev
On Thu, Oct 02, 2014 at 06:05:09PM +0900, Tetsuya Mukawa wrote:
> (2014/10/02 17:53), Sergio Gonzalez Monroy wrote:
> > On Thu, Oct 02, 2014 at 05:28:04PM +0900, Tetsuya Mukawa wrote:
> >> (2014/10/02 17:12), Sergio Gonzalez Monroy wrote:
> >>> On Thu, Oct 02, 2014 at 11:48:37AM +0900, Tetsuya Mukawa wrote:
> >>>
> >>>> $ gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
> >>>> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
> >>>> -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
> >>>> -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
> >>>> -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
> >>>> -DRTE_MACHINE_CPUFLAG_F16C
> >>>> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
> >>>> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
> >>>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h
> >>>> -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> >>>> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> >>>> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> >>>> -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
> >>>> -o testacl main.o -Wl,-export-dynamic
> >>>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> >>>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> >>>> -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
> >>>> -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
> >>>> -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
> >>>> -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
> >>>> -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
> >>>> -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
> >>>> -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt
> >>>> -Wl,-lm -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive
> >>>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> >>>> undefined reference to `rte_mempool_lookup'
> >>>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> >>>> undefined reference to `rte_mempool_create' collect2: error: ld
> >>>> returned 1 exit status
> >>> Hi Tetsuya,
> >>>
> >>> Would you mind posting the output of the last command adding the option '-v'?
> >> Sure, here is.
> >>
> >> $ gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
> >> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
> >> -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
> >> -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
> >> -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
> >> -DRTE_MACHINE_CPUFLAG_F16C
> >> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
> >> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
> >> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
> >> -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> >> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> >> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> >> -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
> >> -o testacl main.o -Wl,-export-dynamic
> >> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> >> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> >> -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
> >> -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
> >> -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
> >> -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
> >> -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
> >> -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
> >> -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm
> >> -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive -v
> >> Using built-in specs.
> >> COLLECT_GCC=gcc
> >> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
> >> Target: x86_64-linux-gnu
> >> Configured with: ../src/configure -v --with-pkgversion='Ubuntu
> >> 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
> >> --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
> >> --program-suffix=-4.8 --enable-shared --enable-linker-build-id
> >> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
> >> --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib
> >> --enable-nls --with-sysroot=/ --enable-clocale=gnu
> >> --enable-libstdcxx-debug --enable-libstdcxx-time=yes
> >> --enable-gnu-unique-object --disable-libmudflap --enable-plugin
> >> --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
> >> --enable-gtk-cairo
> >> --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
> >> --enable-java-home
> >> --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
> >> --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
> >> --with-arch-directory=amd64
> >> --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
> >> --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
> >> --with-multilib-list=m32,m64,mx32 --with-tune=generic
> >> --enable-checking=release --build=x86_64-linux-gnu
> >> --host=x86_64-linux-gnu --target=x86_64-linux-gnu
> >> Thread model: posix
> >> gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
> >> COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/
> >> LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../:/lib/:/usr/lib/
> >> COLLECT_GCC_OPTIONS='-m64' '-pthread' '-fPIC' '-march=native' '-D'
> >> 'RTE_MACHINE_CPUFLAG_SSE' '-D' 'RTE_MACHINE_CPUFLAG_SSE2' '-D'
> >> 'RTE_MACHINE_CPUFLAG_SSE3' '-D' 'RTE_MACHINE_CPUFLAG_SSSE3' '-D'
> >> 'RTE_MACHINE_CPUFLAG_SSE4_1' '-D' 'RTE_MACHINE_CPUFLAG_SSE4_2' '-D'
> >> 'RTE_MACHINE_CPUFLAG_AES' '-D' 'RTE_MACHINE_CPUFLAG_PCLMULQDQ' '-D'
> >> 'RTE_MACHINE_CPUFLAG_AVX' '-D' 'RTE_MACHINE_CPUFLAG_F16C' '-D'
> >> 'RTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C'
> >> '-I' '/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include'
> >> '-include'
> >> '/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h'
> >> '-Wextra' '-Wall' '-Werror' '-Wstrict-prototypes' '-Wmissing-prototypes'
> >> '-Wmissing-declarations' '-Wold-style-definition' '-Wpointer-arith'
> >> '-Wcast-align' '-Wnested-externs' '-Wcast-qual' '-Wformat-nonliteral'
> >> '-Wformat-security' '-Wundef' '-Wwrite-strings' '-o' 'testacl'
> >> '-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib'
> >> '-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib' '-v'
> > We have been looking at this issue over the last couple of days.
> > It seems to be an Ubuntu GCC related bug as it works on other distros.
> > GCC is passing incorrectly the option '--as-needed' to LD resulting in wrong linking.
> >
Just a quick follow up on this issue and to rectify myself.
This is not a bug but expected behavior:
https://wiki.debian.org/ToolChain/DSOLinking#Onlylinkwithneededlibraries
Sergio
> >> /usr/lib/gcc/x86_64-linux-gnu/4.8/collect2 --sysroot=/ --build-id
> >> --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed
> > The '--as-needed' just at the end of the above line is incorrect and not matching
> > a closing '--no-as-needed'.
> > You may get away with it by adding 'EXTRA_LDFLAGS=--no-as-needed'.
> > ie. $ make install T=x86_64-native-linuxapp-gcc EXTRA_LDFLAGS=--no-as-needed
>
> I can compile DPDK with above options.
> Thank you everyone for helping to solve this issue.
>
> Regards,
> Tetsuya
>
> >
> > Sergio
> >
> >> -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o testacl
> >> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o
> >> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o
> >> /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o
> >> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> >> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> >> -L/usr/lib/gcc/x86_64-linux-gnu/4.8
> >> -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu
> >> -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib
> >> -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu
> >> -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..
> >> -Map=testacl.map --cref main.o -export-dynamic --whole-archive
> >> -lrte_distributor -lrte_kni -lrte_pipeline -lrte_table -lrte_port
> >> -lrte_timer -lrte_hash -lrte_lpm -lrte_power -lrte_acl -lrte_meter
> >> -lrte_sched -lm -lrt --start-group -lrte_kvargs -lrte_mbuf -lrte_ip_frag
> >> -lethdev -lrte_malloc -lrte_mempool -lrte_ring -lrte_eal -lrte_cmdline
> >> -lrte_cfgfile -lrte_pmd_bond -lrt -lm -lgcc_s -ldl --end-group
> >> --no-whole-archive -lgcc --as-needed -lgcc_s --no-as-needed -lpthread
> >> -lc -lgcc --as-needed -lgcc_s --no-as-needed
> >> /usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o
> >> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
> >> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> >> undefined reference to `rte_mempool_lookup'
> >> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> >> undefined reference to `rte_mempool_create'
> >> collect2: error: ld returned 1 exit status
> >>
> >> Regards,
> >> Tetsuya
> >>
> >>> Sergio
> >>>
> >>>
> >>>> ----------------------------------------------------------------------
> >>>>
> >>>> I just enabled the following option, then compile DPDK.
> >>>> CONFIG_RTE_BUILD_SHARED_LIB
> >>>> Is this collect to compile PMDs as dynamic link libraries?
> >>>>
> >>>> With the option, all libraries include are compiled as dynamic link library.
> >>>> Does "--start-group/--end-group" options work with dynamic link libraries?
> >>>>
> >>>> Regards,
> >>>> Tetsuya
> >>>>
>
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH] Fix linking errors when CONFIG_RTE_BUILD_SHARED_LIB is enabled
2014-10-02 8:53 0% ` Sergio Gonzalez Monroy
@ 2014-10-02 9:05 0% ` Tetsuya Mukawa
2014-10-03 11:11 0% ` Sergio Gonzalez Monroy
0 siblings, 1 reply; 200+ results
From: Tetsuya Mukawa @ 2014-10-02 9:05 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
(2014/10/02 17:53), Sergio Gonzalez Monroy wrote:
> On Thu, Oct 02, 2014 at 05:28:04PM +0900, Tetsuya Mukawa wrote:
>> (2014/10/02 17:12), Sergio Gonzalez Monroy wrote:
>>> On Thu, Oct 02, 2014 at 11:48:37AM +0900, Tetsuya Mukawa wrote:
>>>
>>>> $ gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
>>>> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
>>>> -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
>>>> -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
>>>> -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
>>>> -DRTE_MACHINE_CPUFLAG_F16C
>>>> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
>>>> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
>>>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h
>>>> -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
>>>> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
>>>> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
>>>> -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
>>>> -o testacl main.o -Wl,-export-dynamic
>>>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
>>>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
>>>> -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
>>>> -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
>>>> -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
>>>> -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
>>>> -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
>>>> -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
>>>> -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt
>>>> -Wl,-lm -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive
>>>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
>>>> undefined reference to `rte_mempool_lookup'
>>>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
>>>> undefined reference to `rte_mempool_create' collect2: error: ld
>>>> returned 1 exit status
>>> Hi Tetsuya,
>>>
>>> Would you mind posting the output of the last command adding the option '-v'?
>> Sure, here is.
>>
>> $ gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
>> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
>> -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
>> -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
>> -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
>> -DRTE_MACHINE_CPUFLAG_F16C
>> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
>> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
>> -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
>> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
>> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
>> -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
>> -o testacl main.o -Wl,-export-dynamic
>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
>> -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
>> -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
>> -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
>> -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
>> -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
>> -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
>> -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm
>> -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive -v
>> Using built-in specs.
>> COLLECT_GCC=gcc
>> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
>> Target: x86_64-linux-gnu
>> Configured with: ../src/configure -v --with-pkgversion='Ubuntu
>> 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
>> --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
>> --program-suffix=-4.8 --enable-shared --enable-linker-build-id
>> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
>> --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib
>> --enable-nls --with-sysroot=/ --enable-clocale=gnu
>> --enable-libstdcxx-debug --enable-libstdcxx-time=yes
>> --enable-gnu-unique-object --disable-libmudflap --enable-plugin
>> --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
>> --enable-gtk-cairo
>> --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
>> --enable-java-home
>> --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
>> --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
>> --with-arch-directory=amd64
>> --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
>> --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
>> --with-multilib-list=m32,m64,mx32 --with-tune=generic
>> --enable-checking=release --build=x86_64-linux-gnu
>> --host=x86_64-linux-gnu --target=x86_64-linux-gnu
>> Thread model: posix
>> gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
>> COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/
>> LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../:/lib/:/usr/lib/
>> COLLECT_GCC_OPTIONS='-m64' '-pthread' '-fPIC' '-march=native' '-D'
>> 'RTE_MACHINE_CPUFLAG_SSE' '-D' 'RTE_MACHINE_CPUFLAG_SSE2' '-D'
>> 'RTE_MACHINE_CPUFLAG_SSE3' '-D' 'RTE_MACHINE_CPUFLAG_SSSE3' '-D'
>> 'RTE_MACHINE_CPUFLAG_SSE4_1' '-D' 'RTE_MACHINE_CPUFLAG_SSE4_2' '-D'
>> 'RTE_MACHINE_CPUFLAG_AES' '-D' 'RTE_MACHINE_CPUFLAG_PCLMULQDQ' '-D'
>> 'RTE_MACHINE_CPUFLAG_AVX' '-D' 'RTE_MACHINE_CPUFLAG_F16C' '-D'
>> 'RTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C'
>> '-I' '/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include'
>> '-include'
>> '/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h'
>> '-Wextra' '-Wall' '-Werror' '-Wstrict-prototypes' '-Wmissing-prototypes'
>> '-Wmissing-declarations' '-Wold-style-definition' '-Wpointer-arith'
>> '-Wcast-align' '-Wnested-externs' '-Wcast-qual' '-Wformat-nonliteral'
>> '-Wformat-security' '-Wundef' '-Wwrite-strings' '-o' 'testacl'
>> '-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib'
>> '-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib' '-v'
> We have been looking at this issue over the last couple of days.
> It seems to be an Ubuntu GCC related bug as it works on other distros.
> GCC is passing incorrectly the option '--as-needed' to LD resulting in wrong linking.
>
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/collect2 --sysroot=/ --build-id
>> --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed
> The '--as-needed' just at the end of the above line is incorrect and not matching
> a closing '--no-as-needed'.
> You may get away with it by adding 'EXTRA_LDFLAGS=--no-as-needed'.
> ie. $ make install T=x86_64-native-linuxapp-gcc EXTRA_LDFLAGS=--no-as-needed
I can compile DPDK with above options.
Thank you everyone for helping to solve this issue.
Regards,
Tetsuya
>
> Sergio
>
>> -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o testacl
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o
>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
>> -L/usr/lib/gcc/x86_64-linux-gnu/4.8
>> -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu
>> -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib
>> -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu
>> -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..
>> -Map=testacl.map --cref main.o -export-dynamic --whole-archive
>> -lrte_distributor -lrte_kni -lrte_pipeline -lrte_table -lrte_port
>> -lrte_timer -lrte_hash -lrte_lpm -lrte_power -lrte_acl -lrte_meter
>> -lrte_sched -lm -lrt --start-group -lrte_kvargs -lrte_mbuf -lrte_ip_frag
>> -lethdev -lrte_malloc -lrte_mempool -lrte_ring -lrte_eal -lrte_cmdline
>> -lrte_cfgfile -lrte_pmd_bond -lrt -lm -lgcc_s -ldl --end-group
>> --no-whole-archive -lgcc --as-needed -lgcc_s --no-as-needed -lpthread
>> -lc -lgcc --as-needed -lgcc_s --no-as-needed
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
>> undefined reference to `rte_mempool_lookup'
>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
>> undefined reference to `rte_mempool_create'
>> collect2: error: ld returned 1 exit status
>>
>> Regards,
>> Tetsuya
>>
>>> Sergio
>>>
>>>
>>>> ----------------------------------------------------------------------
>>>>
>>>> I just enabled the following option, then compile DPDK.
>>>> CONFIG_RTE_BUILD_SHARED_LIB
>>>> Is this collect to compile PMDs as dynamic link libraries?
>>>>
>>>> With the option, all libraries include are compiled as dynamic link library.
>>>> Does "--start-group/--end-group" options work with dynamic link libraries?
>>>>
>>>> Regards,
>>>> Tetsuya
>>>>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH] Fix linking errors when CONFIG_RTE_BUILD_SHARED_LIB is enabled
2014-10-02 8:28 2% ` Tetsuya Mukawa
@ 2014-10-02 8:53 0% ` Sergio Gonzalez Monroy
2014-10-02 9:05 0% ` Tetsuya Mukawa
0 siblings, 1 reply; 200+ results
From: Sergio Gonzalez Monroy @ 2014-10-02 8:53 UTC (permalink / raw)
To: Tetsuya Mukawa; +Cc: dev
On Thu, Oct 02, 2014 at 05:28:04PM +0900, Tetsuya Mukawa wrote:
> (2014/10/02 17:12), Sergio Gonzalez Monroy wrote:
> > On Thu, Oct 02, 2014 at 11:48:37AM +0900, Tetsuya Mukawa wrote:
> >
> >> $ gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
> >> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
> >> -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
> >> -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
> >> -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
> >> -DRTE_MACHINE_CPUFLAG_F16C
> >> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
> >> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
> >> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h
> >> -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> >> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> >> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> >> -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
> >> -o testacl main.o -Wl,-export-dynamic
> >> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> >> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> >> -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
> >> -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
> >> -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
> >> -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
> >> -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
> >> -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
> >> -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt
> >> -Wl,-lm -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive
> >> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> >> undefined reference to `rte_mempool_lookup'
> >> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> >> undefined reference to `rte_mempool_create' collect2: error: ld
> >> returned 1 exit status
> > Hi Tetsuya,
> >
> > Would you mind posting the output of the last command adding the option '-v'?
> Sure, here is.
>
> $ gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
> -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
> -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
> -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
> -DRTE_MACHINE_CPUFLAG_F16C
> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
> -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
> -o testacl main.o -Wl,-export-dynamic
> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
> -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
> -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
> -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
> -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
> -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
> -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm
> -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
> Target: x86_64-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Ubuntu
> 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
> --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
> --program-suffix=-4.8 --enable-shared --enable-linker-build-id
> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
> --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib
> --enable-nls --with-sysroot=/ --enable-clocale=gnu
> --enable-libstdcxx-debug --enable-libstdcxx-time=yes
> --enable-gnu-unique-object --disable-libmudflap --enable-plugin
> --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
> --enable-gtk-cairo
> --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
> --enable-java-home
> --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
> --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
> --with-arch-directory=amd64
> --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
> --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
> --with-multilib-list=m32,m64,mx32 --with-tune=generic
> --enable-checking=release --build=x86_64-linux-gnu
> --host=x86_64-linux-gnu --target=x86_64-linux-gnu
> Thread model: posix
> gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
> COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/
> LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../:/lib/:/usr/lib/
> COLLECT_GCC_OPTIONS='-m64' '-pthread' '-fPIC' '-march=native' '-D'
> 'RTE_MACHINE_CPUFLAG_SSE' '-D' 'RTE_MACHINE_CPUFLAG_SSE2' '-D'
> 'RTE_MACHINE_CPUFLAG_SSE3' '-D' 'RTE_MACHINE_CPUFLAG_SSSE3' '-D'
> 'RTE_MACHINE_CPUFLAG_SSE4_1' '-D' 'RTE_MACHINE_CPUFLAG_SSE4_2' '-D'
> 'RTE_MACHINE_CPUFLAG_AES' '-D' 'RTE_MACHINE_CPUFLAG_PCLMULQDQ' '-D'
> 'RTE_MACHINE_CPUFLAG_AVX' '-D' 'RTE_MACHINE_CPUFLAG_F16C' '-D'
> 'RTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C'
> '-I' '/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include'
> '-include'
> '/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h'
> '-Wextra' '-Wall' '-Werror' '-Wstrict-prototypes' '-Wmissing-prototypes'
> '-Wmissing-declarations' '-Wold-style-definition' '-Wpointer-arith'
> '-Wcast-align' '-Wnested-externs' '-Wcast-qual' '-Wformat-nonliteral'
> '-Wformat-security' '-Wundef' '-Wwrite-strings' '-o' 'testacl'
> '-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib'
> '-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib' '-v'
We have been looking at this issue over the last couple of days.
It seems to be an Ubuntu GCC related bug as it works on other distros.
GCC is passing incorrectly the option '--as-needed' to LD resulting in wrong linking.
> /usr/lib/gcc/x86_64-linux-gnu/4.8/collect2 --sysroot=/ --build-id
> --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed
The '--as-needed' just at the end of the above line is incorrect and not matching
a closing '--no-as-needed'.
You may get away with it by adding 'EXTRA_LDFLAGS=--no-as-needed'.
ie. $ make install T=x86_64-native-linuxapp-gcc EXTRA_LDFLAGS=--no-as-needed
Sergio
> -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o testacl
> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o
> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o
> /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o
> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> -L/usr/lib/gcc/x86_64-linux-gnu/4.8
> -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu
> -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib
> -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu
> -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..
> -Map=testacl.map --cref main.o -export-dynamic --whole-archive
> -lrte_distributor -lrte_kni -lrte_pipeline -lrte_table -lrte_port
> -lrte_timer -lrte_hash -lrte_lpm -lrte_power -lrte_acl -lrte_meter
> -lrte_sched -lm -lrt --start-group -lrte_kvargs -lrte_mbuf -lrte_ip_frag
> -lethdev -lrte_malloc -lrte_mempool -lrte_ring -lrte_eal -lrte_cmdline
> -lrte_cfgfile -lrte_pmd_bond -lrt -lm -lgcc_s -ldl --end-group
> --no-whole-archive -lgcc --as-needed -lgcc_s --no-as-needed -lpthread
> -lc -lgcc --as-needed -lgcc_s --no-as-needed
> /usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o
> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> undefined reference to `rte_mempool_lookup'
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> undefined reference to `rte_mempool_create'
> collect2: error: ld returned 1 exit status
>
> Regards,
> Tetsuya
>
> > Sergio
> >
> >
> >> ----------------------------------------------------------------------
> >>
> >> I just enabled the following option, then compile DPDK.
> >> CONFIG_RTE_BUILD_SHARED_LIB
> >> Is this collect to compile PMDs as dynamic link libraries?
> >>
> >> With the option, all libraries include are compiled as dynamic link library.
> >> Does "--start-group/--end-group" options work with dynamic link libraries?
> >>
> >> Regards,
> >> Tetsuya
> >>
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH] Fix linking errors when CONFIG_RTE_BUILD_SHARED_LIB is enabled
2014-10-02 8:12 0% ` Sergio Gonzalez Monroy
@ 2014-10-02 8:28 2% ` Tetsuya Mukawa
2014-10-02 8:53 0% ` Sergio Gonzalez Monroy
0 siblings, 1 reply; 200+ results
From: Tetsuya Mukawa @ 2014-10-02 8:28 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
(2014/10/02 17:12), Sergio Gonzalez Monroy wrote:
> On Thu, Oct 02, 2014 at 11:48:37AM +0900, Tetsuya Mukawa wrote:
>
>> $ gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
>> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
>> -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
>> -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
>> -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
>> -DRTE_MACHINE_CPUFLAG_F16C
>> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
>> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h
>> -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
>> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
>> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
>> -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
>> -o testacl main.o -Wl,-export-dynamic
>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
>> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
>> -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
>> -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
>> -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
>> -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
>> -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
>> -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
>> -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt
>> -Wl,-lm -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive
>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
>> undefined reference to `rte_mempool_lookup'
>> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
>> undefined reference to `rte_mempool_create' collect2: error: ld
>> returned 1 exit status
> Hi Tetsuya,
>
> Would you mind posting the output of the last command adding the option '-v'?
Sure, here is.
$ gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
-DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
-DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
-DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
-DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
-DRTE_MACHINE_CPUFLAG_F16C
-DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
-I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wold-style-definition -Wpointer-arith
-Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
-Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
-o testacl main.o -Wl,-export-dynamic
-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
-Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
-Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
-Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
-Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
-Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
-Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
-Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm
-Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.8 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib
--enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --disable-libmudflap --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
--enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
--with-arch-directory=amd64
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-m64' '-pthread' '-fPIC' '-march=native' '-D'
'RTE_MACHINE_CPUFLAG_SSE' '-D' 'RTE_MACHINE_CPUFLAG_SSE2' '-D'
'RTE_MACHINE_CPUFLAG_SSE3' '-D' 'RTE_MACHINE_CPUFLAG_SSSE3' '-D'
'RTE_MACHINE_CPUFLAG_SSE4_1' '-D' 'RTE_MACHINE_CPUFLAG_SSE4_2' '-D'
'RTE_MACHINE_CPUFLAG_AES' '-D' 'RTE_MACHINE_CPUFLAG_PCLMULQDQ' '-D'
'RTE_MACHINE_CPUFLAG_AVX' '-D' 'RTE_MACHINE_CPUFLAG_F16C' '-D'
'RTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C'
'-I' '/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include'
'-include'
'/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h'
'-Wextra' '-Wall' '-Werror' '-Wstrict-prototypes' '-Wmissing-prototypes'
'-Wmissing-declarations' '-Wold-style-definition' '-Wpointer-arith'
'-Wcast-align' '-Wnested-externs' '-Wcast-qual' '-Wformat-nonliteral'
'-Wformat-security' '-Wundef' '-Wwrite-strings' '-o' 'testacl'
'-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib'
'-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib' '-v'
/usr/lib/gcc/x86_64-linux-gnu/4.8/collect2 --sysroot=/ --build-id
--eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed
-dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o testacl
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o
-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
-L/usr/lib/gcc/x86_64-linux-gnu/4.8
-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib
-L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../..
-Map=testacl.map --cref main.o -export-dynamic --whole-archive
-lrte_distributor -lrte_kni -lrte_pipeline -lrte_table -lrte_port
-lrte_timer -lrte_hash -lrte_lpm -lrte_power -lrte_acl -lrte_meter
-lrte_sched -lm -lrt --start-group -lrte_kvargs -lrte_mbuf -lrte_ip_frag
-lethdev -lrte_malloc -lrte_mempool -lrte_ring -lrte_eal -lrte_cmdline
-lrte_cfgfile -lrte_pmd_bond -lrt -lm -lgcc_s -ldl --end-group
--no-whole-archive -lgcc --as-needed -lgcc_s --no-as-needed -lpthread
-lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
undefined reference to `rte_mempool_lookup'
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
undefined reference to `rte_mempool_create'
collect2: error: ld returned 1 exit status
Regards,
Tetsuya
> Sergio
>
>
>> ----------------------------------------------------------------------
>>
>> I just enabled the following option, then compile DPDK.
>> CONFIG_RTE_BUILD_SHARED_LIB
>> Is this collect to compile PMDs as dynamic link libraries?
>>
>> With the option, all libraries include are compiled as dynamic link library.
>> Does "--start-group/--end-group" options work with dynamic link libraries?
>>
>> Regards,
>> Tetsuya
>>
^ permalink raw reply [relevance 2%]
* Re: [dpdk-dev] [PATCH] Fix linking errors when CONFIG_RTE_BUILD_SHARED_LIB is enabled
2014-10-02 2:48 2% ` Tetsuya Mukawa
@ 2014-10-02 8:12 0% ` Sergio Gonzalez Monroy
2014-10-02 8:28 2% ` Tetsuya Mukawa
0 siblings, 1 reply; 200+ results
From: Sergio Gonzalez Monroy @ 2014-10-02 8:12 UTC (permalink / raw)
To: Tetsuya Mukawa; +Cc: dev
On Thu, Oct 02, 2014 at 11:48:37AM +0900, Tetsuya Mukawa wrote:
> (2014/10/01 20:56), Thomas Monjalon wrote:
> > 2014-10-01 06:50, Neil Horman:
> >> On Wed, Oct 01, 2014 at 01:27:03PM +0900, mukawa@igel.co.jp wrote:
> >>> When CONFIG_RTE_BUILD_SHARED_LIB is enabled, linking errors occured
> >>> while compiling. It seems those errors are caused by wrong link order
> >>> of some libraries. The patch fixes it like following.
> >>>
> >>> 1. librte_eal
> >>> 2. librte_malloc
> >>> 3. librte_mempool
> >>> 4. librte_ring
> >>> 5. librte_pmd_bond
> >>> 6. librte_kvargs
> >>>
> >> I'm not sure why thats necesecary. We add a --start-group/--end-group pair
> >> halfway through this makefile. If we just encompassed the entire set of
> >> libraries in that group, order would be irrelevant.
> > I don't see any error.
> > Please Tetsuya, could you describe how you test and what is the error message?
> >
> > Thanks
> Thank you for testing.
> I have confirmed '--start-group/--end-groups' is specified while
> compiling, but I am still seeing the error.
>
> Here is what I actually did.
>
> ----------------------------------------------------------------------
>
> << Show my environment >>
> $ uname -a
> Linux eris 3.13.0-29-generic #53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014
> x86_64 x86_64 x86_64 GNU/Linux
> $ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description: Ubuntu 14.04.1 LTS
> Release: 14.04
> Codename: trusty
> $ gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
> Target: x86_64-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Ubuntu
> 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
> --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
> --program-suffix=-4.8 --enable-shared --enable-linker-build-id
> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
> --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib
> --enable-nls --with-sysroot=/ --enable-clocale=gnu
> --enable-libstdcxx-debug --enable-libstdcxx-time=yes
> --enable-gnu-unique-object --disable-libmudflap --enable-plugin
> --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
> --enable-gtk-cairo
> --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
> --enable-java-home
> --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
> --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
> --with-arch-directory=amd64
> --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
> --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
> --with-multilib-list=m32,m64,mx32 --with-tune=generic
> --enable-checking=release --build=x86_64-linux-gnu
> --host=x86_64-linux-gnu --target=x86_64-linux-gnu
> Thread model: posix
> gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
>
> << Compile DPDK >>
> $ git clone git://dpdk.org/dpdk
> $ cd dpdk
> $ vi config/common_linuxapp
> CONFIG_RTE_BUILD_SHARED_LIB=y
> $ T=x86_64-native-linuxapp-gcc make install V=1
>
> .......
>
> == Build app/test-acl
> gcc -Wp,-MD,./.main.o.d.tmp -m64 -pthread -fPIC -march=native
> -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
> -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
> -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
> -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ
> -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_F16C
> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
> -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> -Wformat-security -Wundef -Wwrite-strings -o main.o -c
> /home/mukawa/tmp/dpdk/app/test-acl/main.c
> gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
> -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
> -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
> -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
> -DRTE_MACHINE_CPUFLAG_F16C
> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
> -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
> -o testacl main.o -Wl,-export-dynamic
> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
> -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
> -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
> -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
> -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
> -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
> -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm
> -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> undefined reference to `rte_mempool_lookup'
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> undefined reference to `rte_mempool_create'
>
> << Reproduce the issue with same options >>
> $ cd x86_64-native-linuxapp-gcc/build/app/test-acl/
> $ gcc -Wp,-MD,./.main.o.d.tmp -m64 -pthread -fPIC -march=native
> -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
> -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
> -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
> -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ
> -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_F16C
> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
> -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> -Wformat-security -Wundef -Wwrite-strings -o main.o -c
> /home/mukawa/tmp/dpdk/app/test-acl/main.c
> mukawa@eris:~/tmp/dpdk/x86_64-native-linuxapp-gcc/build/app/test-acl$
> gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
> -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
> -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
> -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
> -DRTE_MACHINE_CPUFLAG_F16C
> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
> -I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
> -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> -Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
> -o testacl main.o -Wl,-export-dynamic
> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> -L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
> -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
> -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
> -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
> -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
> -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
> -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
> -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm
> -Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> undefined reference to `rte_mempool_lookup'
> /home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
> undefined reference to `rte_mempool_create'
> collect2: error: ld returned 1 exit status
>
Hi Tetsuya,
Would you mind posting the output of the last command adding the option '-v'?
Sergio
> ----------------------------------------------------------------------
>
> I just enabled the following option, then compile DPDK.
> CONFIG_RTE_BUILD_SHARED_LIB
> Is this collect to compile PMDs as dynamic link libraries?
>
> With the option, all libraries include are compiled as dynamic link library.
> Does "--start-group/--end-group" options work with dynamic link libraries?
>
> Regards,
> Tetsuya
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH] Fix linking errors when CONFIG_RTE_BUILD_SHARED_LIB is enabled
@ 2014-10-02 2:48 2% ` Tetsuya Mukawa
2014-10-02 8:12 0% ` Sergio Gonzalez Monroy
0 siblings, 1 reply; 200+ results
From: Tetsuya Mukawa @ 2014-10-02 2:48 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
(2014/10/01 20:56), Thomas Monjalon wrote:
> 2014-10-01 06:50, Neil Horman:
>> On Wed, Oct 01, 2014 at 01:27:03PM +0900, mukawa@igel.co.jp wrote:
>>> When CONFIG_RTE_BUILD_SHARED_LIB is enabled, linking errors occured
>>> while compiling. It seems those errors are caused by wrong link order
>>> of some libraries. The patch fixes it like following.
>>>
>>> 1. librte_eal
>>> 2. librte_malloc
>>> 3. librte_mempool
>>> 4. librte_ring
>>> 5. librte_pmd_bond
>>> 6. librte_kvargs
>>>
>> I'm not sure why thats necesecary. We add a --start-group/--end-group pair
>> halfway through this makefile. If we just encompassed the entire set of
>> libraries in that group, order would be irrelevant.
> I don't see any error.
> Please Tetsuya, could you describe how you test and what is the error message?
>
> Thanks
Thank you for testing.
I have confirmed '--start-group/--end-groups' is specified while
compiling, but I am still seeing the error.
Here is what I actually did.
----------------------------------------------------------------------
<< Show my environment >>
$ uname -a
Linux eris 3.13.0-29-generic #53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014
x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.8 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib
--enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --disable-libmudflap --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
--enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
--with-arch-directory=amd64
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
<< Compile DPDK >>
$ git clone git://dpdk.org/dpdk
$ cd dpdk
$ vi config/common_linuxapp
CONFIG_RTE_BUILD_SHARED_LIB=y
$ T=x86_64-native-linuxapp-gcc make install V=1
.......
== Build app/test-acl
gcc -Wp,-MD,./.main.o.d.tmp -m64 -pthread -fPIC -march=native
-DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
-DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
-DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
-DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ
-DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_F16C
-DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
-I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wold-style-definition -Wpointer-arith
-Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
-Wformat-security -Wundef -Wwrite-strings -o main.o -c
/home/mukawa/tmp/dpdk/app/test-acl/main.c
gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
-DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
-DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
-DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
-DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
-DRTE_MACHINE_CPUFLAG_F16C
-DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
-I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wold-style-definition -Wpointer-arith
-Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
-Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
-o testacl main.o -Wl,-export-dynamic
-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
-Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
-Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
-Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
-Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
-Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
-Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
-Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm
-Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
undefined reference to `rte_mempool_lookup'
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
undefined reference to `rte_mempool_create'
<< Reproduce the issue with same options >>
$ cd x86_64-native-linuxapp-gcc/build/app/test-acl/
$ gcc -Wp,-MD,./.main.o.d.tmp -m64 -pthread -fPIC -march=native
-DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
-DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
-DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
-DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ
-DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_F16C
-DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
-I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wold-style-definition -Wpointer-arith
-Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
-Wformat-security -Wundef -Wwrite-strings -o main.o -c
/home/mukawa/tmp/dpdk/app/test-acl/main.c
mukawa@eris:~/tmp/dpdk/x86_64-native-linuxapp-gcc/build/app/test-acl$
gcc -m64 -pthread -fPIC -march=native -DRTE_MACHINE_CPUFLAG_SSE
-DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3
-DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1
-DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES
-DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX
-DRTE_MACHINE_CPUFLAG_F16C
-DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_F16C
-I/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include -include
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/include/rte_config.h -W
-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wold-style-definition -Wpointer-arith
-Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
-Wformat-security -Wundef -Wwrite-strings -Wl,-Map=testacl.map,--cref
-o testacl main.o -Wl,-export-dynamic
-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
-L/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib
-Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni
-Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer
-Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl
-Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group
-Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lethdev
-Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrte_ring -Wl,-lrte_eal
-Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrt -Wl,-lm
-Wl,-lgcc_s -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
undefined reference to `rte_mempool_lookup'
/home/mukawa/tmp/dpdk/x86_64-native-linuxapp-gcc/lib/librte_eal.so:
undefined reference to `rte_mempool_create'
collect2: error: ld returned 1 exit status
----------------------------------------------------------------------
I just enabled the following option, then compile DPDK.
CONFIG_RTE_BUILD_SHARED_LIB
Is this collect to compile PMDs as dynamic link libraries?
With the option, all libraries include are compiled as dynamic link library.
Does "--start-group/--end-group" options work with dynamic link libraries?
Regards,
Tetsuya
^ permalink raw reply [relevance 2%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-26 14:45 5% ` Neil Horman
2014-09-26 22:02 4% ` Stephen Hemminger
@ 2014-10-01 18:59 0% ` Neil Horman
2014-10-07 21:01 0% ` Neil Horman
1 sibling, 1 reply; 200+ results
From: Neil Horman @ 2014-10-01 18:59 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Fri, Sep 26, 2014 at 10:45:49AM -0400, Neil Horman wrote:
> On Fri, Sep 26, 2014 at 12:41:33PM +0200, Thomas Monjalon wrote:
> > Hi Neil,
> >
> > 2014-09-24 14:19, Neil Horman:
> > > Ping Thomas. I know you're busy, but I would like this to not fall off anyones
> > > radar. You alluded to concerns regarding what, for lack of a better term,
> > > ABI/API lockin. I had asked you to enuumerate/elaborate on specifics, but never
> > > heard back. Are there further specifics you wish to discuss, or are you
> > > satisfied with the above answers?
> >
> > Sorry for not being very reactive on this thread.
> > All this discussion is very interesting but it's really not the proper
> > time to apply it. As you said, it requires an extra effort. I'm not saying
> > it will never be integrated. I'm just saying that we cannot change
> > everything at the same time.
> >
> > Let me sum up the situation. This community project has been very active
> > for few months now. First, we learnt how to make some releases together
> > and we are improving the process to be able to deliver a new major release
> > every 4 months while having some good quality process.
> > But these releases are still not complete because documentation is not
> > integrated yet. Then developers should have a role in documentation updates.
> > We also need to integrate and learn how to use more tools to be more
> > efficient and improve quality.
> >
> > So the question is "when should we care about API compatibility"?
> > And the answer is: ASAP, but not now. I feel next year is a better target.
> > Because the most important priority is to move together at a pace which
> > allow most of us to stay in the race.
> >
>
>
> I'm sorry Thomas, I don't accept this. I asked you for details as to your
> concerns regarding this patch series, and you've provided more vague comments.
> I need details to address
>
> You say it requires extra effort, you're right it does. Any feature that you
> integreate requires some additional effort. How is this patch any different
> from adding the acl library or any other new API? Everything requires
> maintenence, thats how software works. What specfically about this patch series
> makes the effort insurmountable to you?
>
> You say you're improving your process. Great, this patch aids in that process
> by ensuring backwards compatibility for a period of time. Given that the API
> and ABI can still evolve within this framework, as I've described, how is this
> patch series not a significant step forward toward your goal of quality process.
>
> You say documentation isn't integrated. So, what does getting documentation
> integrated have to do with this patch set, or any other? I don't see you
> holding any other patches based on documentation. Again, nothing in this series
> prevents evolution of the API or ABI. If you're hope is to wait until
> everything is perfect, then apply some control to the public facing API, and get
> it all documented, none of thosse things will ever happen, I promise you.
>
> You say you also need to learn to use more tools to be more efficient and
> improve quality. Great! Thats exactly what this is. If we mandate even a short
> term commitment to ABI stability (1 single relese worth of time), we will
> quickly identify what API's change quickly and where we need to be cautious with
> our API design. If you just assume that developers will get better of their own
> volition, it will never happen.
>
> You say this should go in next year, but not now. When exactly? What event do
> you forsee occuring in the next 12-18 months that will change everything such
> that we can start supporing an ABI for more than just a few weeks at the head of
> the tree?
>
> To this end, I just did a quick search through the git history for dpdk to look
> at the histories of all the header files that are exposed via the makefile
> SYMLINK command (given that that provides a list of header files that
> applications can include, and embodies all the function symbols and data types
> applications have access to.
>
> There are 179 total commits in that list
> Of those, a bit of spot checking suggests that about 10-15% of them actually
> change ABI, and many of those came from Bruce's rework of the mbuf structure.
> That about 17-20 instances over the last 2 years where an ABI update would have
> been needed. That seems pretty reasonable to me. Where exactly is your concern
> here?
>
> Neil
>
Ping Thomas, I'd like to continue this debate to a conclusion. Could you please
provide specific details and/or concerns that you have with this patch series?
Thanks
Neil
> > --
> > Thomas
> >
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation
2014-09-15 19:23 23% ` [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation Neil Horman
@ 2014-10-01 16:06 4% ` Sergio Gonzalez Monroy
0 siblings, 0 replies; 200+ results
From: Sergio Gonzalez Monroy @ 2014-10-01 16:06 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
On Mon, Sep 15, 2014 at 03:23:51PM -0400, Neil Horman wrote:
> Adding a document describing rudimentary ABI policy and adding notice space for
> any deprecation announcements
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> ---
> doc/abi.txt | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
> create mode 100644 doc/abi.txt
>
> diff --git a/doc/abi.txt b/doc/abi.txt
> new file mode 100644
> index 0000000..b6dcc7d
> --- /dev/null
> +++ b/doc/abi.txt
> @@ -0,0 +1,17 @@
> +ABI policy:
> + ABI versions are set at the time of major release labeling, and ABI may
> +change multiple times between the last labeling and the HEAD label of the git
> +tree without warning
> +
> + ABI versions, once released are available until such time as their
> +deprecation has been noted here for at least one major release cycle, after it
> +has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
> +remove it is made during the development of DPDK 1.9. The decision will be
> +recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
> +1.10 ships.
> +
> + ABI versions may be deprecated in whole, or in part as needed by a given
> +update.
> +
> +Deprecation Notices:
> +
> --
> 1.9.3
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 1/4 v4] compat: Add infrastructure to support symbol versioning
2014-09-30 15:18 3% ` [dpdk-dev] [PATCH 1/4 v4] " Neil Horman
2014-10-01 10:15 0% ` Sergio Gonzalez Monroy
@ 2014-10-01 11:28 0% ` Sergio Gonzalez Monroy
1 sibling, 0 replies; 200+ results
From: Sergio Gonzalez Monroy @ 2014-10-01 11:28 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
On Tue, Sep 30, 2014 at 11:18:00AM -0400, Neil Horman wrote:
> Add initial pass header files to support symbol versioning.
>
> ---
> Change notes
> v2)
> * Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
> non-existant RTE_SYMBOL_VERSIONING
>
> * Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
> properly
>
> * Improved/Clarified documentation
>
> v3)
> * Added missing macros to fully export the symver directive specification
>
> v4)
> * Added macro definitions for !SHARED_LIB case
> * Improved documentation
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
> ---
> lib/Makefile | 1 +
> lib/librte_compat/Makefile | 38 +++++++++++++++++
> lib/librte_compat/rte_compat.h | 96 ++++++++++++++++++++++++++++++++++++++++++
> mk/rte.lib.mk | 6 +++
> 4 files changed, 141 insertions(+)
> create mode 100644 lib/librte_compat/Makefile
> create mode 100644 lib/librte_compat/rte_compat.h
>
> diff --git a/lib/Makefile b/lib/Makefile
> index 10c5bb3..a85b55b 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -32,6 +32,7 @@
> include $(RTE_SDK)/mk/rte.vars.mk
>
> DIRS-$(CONFIG_RTE_LIBC) += libc
> +DIRS-y += librte_compat
> DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> new file mode 100644
> index 0000000..3415c7b
> --- /dev/null
> +++ b/lib/librte_compat/Makefile
> @@ -0,0 +1,38 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +# notice, this list of conditions and the following disclaimer.
> +# * 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.
> +# * Neither the name of Intel Corporation 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
> +# OWNER 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.
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +
> +# install includes
> +SYMLINK-y-include := rte_compat.h
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> new file mode 100644
> index 0000000..d99e362
> --- /dev/null
> +++ b/lib/librte_compat/rte_compat.h
> @@ -0,0 +1,96 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#ifndef _RTE_COMPAT_H_
> +#define _RTE_COMPAT_H_
> +
> +/*
> + * This is just a stringification macro for use below.
> + */
> +#define SA(x) #x
> +
> +#ifdef RTE_BUILD_SHARED_LIB
> +
> +/*
> + * Provides backwards compatibility when updating exported functions.
> + * When a symol is exported from a library to provide an API, it also provides a
> + * calling convention (ABI) that is embodied in its name, return type,
> + * arguments, etc. On occasion that function may need to change to accomodate
> + * new functionality, behavior, etc. When that occurs, it is desireable to
> + * allow for backwards compatibility for a time with older binaries that are
> + * dynamically linked to the dpdk. to support that the __vsym and
> + * VERSION_SYMBOL macros are created. They, in conjunction with the
> + * <library>_version.map file for a given library allow for multiple versions of
> + * a symbol to exist in a shared library so that older binaries need not be
> + * immediately recompiled. Their use is outlined in the following example:
> + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> + *
> + * To accomplish this:
> + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> + * foo is exported as a global symbol.
> + *
> + * 2) rename the existing function int foo(char *string) to
> + * int __vsym foo_v18(char *string)
> + *
> + * 3) Add this macro immediately below the function
> + * VERSION_SYMBOL(foo, _v18, 1.8);
> + *
> + * 4) Implement a new version of foo.
> + * char foo(int value, int otherval) { ...}
> + *
> + * 5) Mark the newest version as the default version
> + * BIND_DEFAULT_SYMBOL(foo, 1.9);
> + *
> + */
> +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> +#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
> +#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
> +#define __vsym __attribute__((used))
> +
> +#else
> +/*
> + * No symbol versioning in use
> + */
> +#define VERSION_SYMBOL(b, e, v)
> +#define __vsym
> +#define BASE_SYMBOL(b, n)
> +#define BIND_DEFAULT_SYMBOL(b, v)
> +
> +/*
> + * RTE_BUILD_SHARED_LIB
> + */
> +#endif
> +
> +
> +#endif /* _RTE_COMPAT_H_ */
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> index f458258..82ac309 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
>
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> LIB := $(patsubst %.a,%.so,$(LIB))
> +
> +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> +
> endif
>
> +
> _BUILD = $(LIB)
> _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> _CLEAN = doclean
> @@ -160,7 +164,9 @@ endif
> $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> @echo " INSTALL-LIB $(LIB)"
> @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> +ifneq ($(LIB),)
> $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> +endif
>
> #
> # Clean all generated files
> --
> 1.9.3
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 3/4] Add library version extenstion
2014-09-15 19:23 7% ` [dpdk-dev] [PATCH 3/4] Add library version extenstion Neil Horman
@ 2014-10-01 11:27 0% ` Sergio Gonzalez Monroy
0 siblings, 0 replies; 200+ results
From: Sergio Gonzalez Monroy @ 2014-10-01 11:27 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
On Mon, Sep 15, 2014 at 03:23:50PM -0400, Neil Horman wrote:
> To differentiate libraries that break ABI, we add a library version number
> suffix to the library, which must be incremented when a given libraries ABI is
> broken. This patch enforces that addition, sets the initial abi soname
> extension to 1 for each library and creates a symlink to the base SONAME so that
> the test applications will link properly.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> ---
> lib/librte_acl/Makefile | 2 ++
> lib/librte_cfgfile/Makefile | 2 ++
> lib/librte_cmdline/Makefile | 2 ++
> lib/librte_compat/Makefile | 2 ++
> lib/librte_distributor/Makefile | 2 ++
> lib/librte_eal/bsdapp/eal/Makefile | 2 ++
> lib/librte_eal/linuxapp/eal/Makefile | 2 ++
> lib/librte_ether/Makefile | 2 ++
> lib/librte_hash/Makefile | 2 ++
> lib/librte_ip_frag/Makefile | 2 ++
> lib/librte_ivshmem/Makefile | 2 ++
> lib/librte_kni/Makefile | 2 ++
> lib/librte_kvargs/Makefile | 2 ++
> lib/librte_lpm/Makefile | 2 ++
> lib/librte_malloc/Makefile | 2 ++
> lib/librte_mbuf/Makefile | 2 ++
> lib/librte_mempool/Makefile | 2 ++
> lib/librte_meter/Makefile | 2 ++
> lib/librte_pipeline/Makefile | 2 ++
> lib/librte_pmd_bond/Makefile | 2 ++
> lib/librte_pmd_e1000/Makefile | 2 ++
> lib/librte_pmd_i40e/Makefile | 2 ++
> lib/librte_pmd_ixgbe/Makefile | 2 ++
> lib/librte_pmd_pcap/Makefile | 2 ++
> lib/librte_pmd_ring/Makefile | 2 ++
> lib/librte_pmd_virtio/Makefile | 2 ++
> lib/librte_pmd_vmxnet3/Makefile | 2 ++
> lib/librte_pmd_xenvirt/Makefile | 2 ++
> lib/librte_port/Makefile | 2 ++
> lib/librte_power/Makefile | 2 ++
> lib/librte_ring/Makefile | 2 ++
> lib/librte_sched/Makefile | 2 ++
> lib/librte_table/Makefile | 2 ++
> lib/librte_timer/Makefile | 2 ++
> mk/rte.lib.mk | 12 +++++++++---
> 35 files changed, 77 insertions(+), 3 deletions(-)
>
> diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
> index 1f96645..4db403b 100644
> --- a/lib/librte_acl/Makefile
> +++ b/lib/librte_acl/Makefile
> @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_acl/rte_acl_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
>
> diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
> index e655098..1c81579 100644
> --- a/lib/librte_cfgfile/Makefile
> +++ b/lib/librte_cfgfile/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_cfgfile/rte_cfgfile_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
> index 1a47173..b0ab5b6 100644
> --- a/lib/librte_cmdline/Makefile
> +++ b/lib/librte_cmdline/Makefile
> @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_cmdline/rte_cmdline_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
> SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
> diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> index a61511a..5f369e5 100644
> --- a/lib/librte_compat/Makefile
> +++ b/lib/librte_compat/Makefile
> @@ -32,6 +32,8 @@
> include $(RTE_SDK)/mk/rte.vars.mk
>
>
> +LIBABIVER := 1
> +
> # install includes
> SYMLINK-y-include := rte_compat.h
>
> diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
> index 97d8bbb..12d9df1 100644
> --- a/lib/librte_distributor/Makefile
> +++ b/lib/librte_distributor/Makefile
> @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_distributor/rte_distributor_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
>
> diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
> index 2caaf00..2edd880 100644
> --- a/lib/librte_eal/bsdapp/eal/Makefile
> +++ b/lib/librte_eal/bsdapp/eal/Makefile
> @@ -47,6 +47,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_eal/bsdapp/eal/rte_eal_version.map
>
> +LIBABIVER := 1
> +
> # specific to linuxapp exec-env
> SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
> SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
> diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
> index 254d59c..267f2c7 100644
> --- a/lib/librte_eal/linuxapp/eal/Makefile
> +++ b/lib/librte_eal/linuxapp/eal/Makefile
> @@ -35,6 +35,8 @@ LIB = librte_eal.a
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_eal/linuxapp/eal/rte_eal_version.map
>
> +LIBABIVER := 1
> +
> VPATH += $(RTE_SDK)/lib/librte_eal/common
>
> CFLAGS += -I$(SRCDIR)/include
> diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
> index f40b5cc..62bcf0c 100644
> --- a/lib/librte_ether/Makefile
> +++ b/lib/librte_ether/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_ether/rte_ether_version.map
>
> +LIBABIVER := 1
> +
> SRCS-y += rte_ethdev.c
>
> #
> diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
> index a449ec2..17778ba 100644
> --- a/lib/librte_hash/Makefile
> +++ b/lib/librte_hash/Makefile
> @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_hash/rte_hash_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
> SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
> diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
> index ede5a89..6b496dc 100644
> --- a/lib/librte_ip_frag/Makefile
> +++ b/lib/librte_ip_frag/Makefile
> @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_ip_frag/rte_ipfrag_version.map
>
> +LIBABIVER := 1
> +
> #source files
> SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
> SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_reassembly.c
> diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
> index be6f21a..7c8dc17 100644
> --- a/lib/librte_ivshmem/Makefile
> +++ b/lib/librte_ivshmem/Makefile
> @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
>
> EXPORT_MAPS := $(RTE_SDK)/lib/librte_ivshmem/rte_ivshmem_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
>
> diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
> index c119fc1..59abd85 100644
> --- a/lib/librte_kni/Makefile
> +++ b/lib/librte_kni/Makefile
> @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_kni/rte_kni_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
>
> diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
> index 83a42b1..10713db 100644
> --- a/lib/librte_kvargs/Makefile
> +++ b/lib/librte_kvargs/Makefile
> @@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_kvargs/rte_kvargs_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
>
> diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
> index 05de8d9..c99bfbd 100644
> --- a/lib/librte_lpm/Makefile
> +++ b/lib/librte_lpm/Makefile
> @@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_lpm/rte_lpm_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
>
> diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
> index 1a5c288..3bb7a99 100644
> --- a/lib/librte_malloc/Makefile
> +++ b/lib/librte_malloc/Makefile
> @@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
> # library name
> LIB = librte_malloc.a
>
> +LIBABIVER := 1
> +
> CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_malloc/rte_malloc_version.map
> diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
> index 5cd4941..3cf94d1 100644
> --- a/lib/librte_mbuf/Makefile
> +++ b/lib/librte_mbuf/Makefile
> @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_mbuf/rte_mbuf_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
>
> diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
> index 07b5b4e..2c2a6e8 100644
> --- a/lib/librte_mempool/Makefile
> +++ b/lib/librte_mempool/Makefile
> @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_mempool/rte_mempool_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
> ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
> diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
> index 0778690..f58822e 100644
> --- a/lib/librte_meter/Makefile
> +++ b/lib/librte_meter/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_meter/rte_meter_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
> index 5465d00..df44f51 100644
> --- a/lib/librte_pipeline/Makefile
> +++ b/lib/librte_pipeline/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pipeline/rte_pipeline_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
> index 5b14ce2..2f1e83b 100644
> --- a/lib/librte_pmd_bond/Makefile
> +++ b/lib/librte_pmd_bond/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_bond/rte_eth_bond_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
> index e225bfe..a5e3b66 100644
> --- a/lib/librte_pmd_e1000/Makefile
> +++ b/lib/librte_pmd_e1000/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_e1000/rte_pmd_e1000_version.map
>
> +LIBABIVER := 1
> +
> ifeq ($(CC), icc)
> #
> # CFLAGS for icc
> diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
> index cfbe816..d59967a 100644
> --- a/lib/librte_pmd_i40e/Makefile
> +++ b/lib/librte_pmd_i40e/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_i40e/rte_pmd_i40e_version.map
>
> +LIBABIVER := 1
> +
> #
> # Add extra flags for base driver files (also known as shared code)
> # to disable warnings
> diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
> index 1dd14a6..fd17c09 100644
> --- a/lib/librte_pmd_ixgbe/Makefile
> +++ b/lib/librte_pmd_ixgbe/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_ixgbe/rte_pmd_ixgbe_version.map
>
> +LIBABIVER := 1
> +
> ifeq ($(CC), icc)
> #
> # CFLAGS for icc
> diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
> index fff5572..8f05c2c 100644
> --- a/lib/librte_pmd_pcap/Makefile
> +++ b/lib/librte_pmd_pcap/Makefile
> @@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_pcap/rte_pmd_pcap_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
> index 25ad27f..24c57fc 100644
> --- a/lib/librte_pmd_ring/Makefile
> +++ b/lib/librte_pmd_ring/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_ring/rte_eth_ring_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
> index bf51bd9..d0bec84 100644
> --- a/lib/librte_pmd_virtio/Makefile
> +++ b/lib/librte_pmd_virtio/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_virtio/rte_pmd_virtio_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
> index e5a1c6b..2b418f4 100644
> --- a/lib/librte_pmd_vmxnet3/Makefile
> +++ b/lib/librte_pmd_vmxnet3/Makefile
> @@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_vmxnet3/rte_pmd_vmxnet3_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
> index 0a08b1b..6132c1c 100644
> --- a/lib/librte_pmd_xenvirt/Makefile
> +++ b/lib/librte_pmd_xenvirt/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_xenvirt/rte_eth_xenvirt_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
> index e812bda..828692f 100644
> --- a/lib/librte_port/Makefile
> +++ b/lib/librte_port/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_port/rte_port_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
> index 26ee542..3261176 100644
> --- a/lib/librte_power/Makefile
> +++ b/lib/librte_power/Makefile
> @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_power/rte_power_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c
>
> diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
> index 0adaa00..fa697ea 100644
> --- a/lib/librte_ring/Makefile
> +++ b/lib/librte_ring/Makefile
> @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_ring/rte_ring_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
>
> diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
> index 205fb7a..1a54bf9 100644
> --- a/lib/librte_sched/Makefile
> +++ b/lib/librte_sched/Makefile
> @@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_sched/rte_sched_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
> index 5b54acc..29b768c 100644
> --- a/lib/librte_table/Makefile
> +++ b/lib/librte_table/Makefile
> @@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_table/rte_table_version.map
>
> +LIBABIVER := 1
> +
> #
> # all source are stored in SRCS-y
> #
> diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
> index f703e5f..01772c7 100644
> --- a/lib/librte_timer/Makefile
> +++ b/lib/librte_timer/Makefile
> @@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
>
> EXPORT_MAP := $(RTE_SDK)/lib/librte_timer/rte_timer_version.map
>
> +LIBABIVER := 1
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
>
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> index 82ac309..4d55cc9 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -37,10 +37,8 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
>
> # VPATH contains at least SRCDIR
> VPATH += $(SRCDIR)
> -
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> -LIB := $(patsubst %.a,%.so,$(LIB))
> -
> +LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
> CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
>
> endif
> @@ -63,6 +61,7 @@ build: _postbuild
>
> exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
>
> +
> ifeq ($(LINK_USING_CC),1)
> # Override the definition of LD here, since we're linking with CC
> LD := $(CC)
> @@ -112,6 +111,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
> #
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
> +ifeq ($(LIBABIVER),)
> + @echo "Must Specify a $(LIB) ABI version"
> + @exit 1
> +endif
> @[ -d $(dir $@) ] || mkdir -p $(dir $@)
> $(if $(D),\
> @echo -n "$< -> $@ " ; \
> @@ -125,6 +128,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
> $(depfile_missing),\
> $(depfile_newer)),\
> $(O_TO_S_DO))
> +
> ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
> $(if $(or \
> $(file_missing),\
> @@ -162,10 +166,12 @@ endif
> # install lib in $(RTE_OUTPUT)/lib
> #
> $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> + $(eval LIBSONAME := $(basename $(LIB)))
> @echo " INSTALL-LIB $(LIB)"
> @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> ifneq ($(LIB),)
> $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> + $(Q)ln -s -f $(RTE_OUTPUT)/lib/$(LIB) $(RTE_OUTPUT)/lib/$(LIBSONAME)
> endif
>
> #
> --
> 1.9.3
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH RFC] mbuf: Adjust TX flags to start at bit 32
2014-10-01 8:47 0% ` Bruce Richardson
@ 2014-10-01 11:14 0% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-10-01 11:14 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev
On Wed, Oct 01, 2014 at 09:47:21AM +0100, Bruce Richardson wrote:
> On Tue, Sep 30, 2014 at 01:06:32PM -0400, Neil Horman wrote:
> > On Tue, Sep 30, 2014 at 04:26:02PM +0100, Bruce Richardson wrote:
> > > This patch takes the existing TX flags defined for the mbuf and shifts
> > > each uniquely defined one left so that additional RX flags can be
> > > defined without having RX and TX flags mixed together.
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > ---
> > > lib/librte_mbuf/rte_mbuf.h | 26 +++++++++++++-------------
> > > 1 file changed, 13 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> > > index 1c6e115..c9fc4ec 100644
> > > --- a/lib/librte_mbuf/rte_mbuf.h
> > > +++ b/lib/librte_mbuf/rte_mbuf.h
> > > @@ -86,26 +86,26 @@ extern "C" {
> > > #define PKT_RX_IEEE1588_PTP 0x0200 /**< RX IEEE1588 L2 Ethernet PT Packet. */
> > > #define PKT_RX_IEEE1588_TMST 0x0400 /**< RX IEEE1588 L2/L4 timestamped packet.*/
> > >
> > > -#define PKT_TX_VLAN_PKT 0x0800 /**< TX packet is a 802.1q VLAN packet. */
> > > -#define PKT_TX_IP_CKSUM 0x1000 /**< IP cksum of TX pkt. computed by NIC. */
> > > -#define PKT_TX_IPV4_CSUM 0x1000 /**< Alias of PKT_TX_IP_CKSUM. */
> > > -#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> > > -#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
> > > +#define PKT_TX_VLAN_PKT (0x0001 << 32) /**< TX packet is a 802.1q VLAN packet. */
> > > +#define PKT_TX_IP_CKSUM (0x0002 << 32) /**< IP cksum of TX pkt. computed by NIC. */
> > > +#define PKT_TX_IPV4_CSUM PKT_TX_IP_CKSUM /**< Alias of PKT_TX_IP_CKSUM. */
> > > +#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> > > +#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
> > >
> > > /*
> > > - * Bit 14~13 used for L4 packet type with checksum enabled.
> > > + * Bit 35~34 used for L4 packet type with checksum enabled.
> > > * 00: Reserved
> > > * 01: TCP checksum
> > > * 10: SCTP checksum
> > > * 11: UDP checksum
> > > */
> > > -#define PKT_TX_L4_MASK 0x6000 /**< Mask bits for L4 checksum offload request. */
> > > -#define PKT_TX_L4_NO_CKSUM 0x0000 /**< Disable L4 cksum of TX pkt. */
> > > -#define PKT_TX_TCP_CKSUM 0x2000 /**< TCP cksum of TX pkt. computed by NIC. */
> > > -#define PKT_TX_SCTP_CKSUM 0x4000 /**< SCTP cksum of TX pkt. computed by NIC. */
> > > -#define PKT_TX_UDP_CKSUM 0x6000 /**< UDP cksum of TX pkt. computed by NIC. */
> > > -/* Bit 15 */
> > > -#define PKT_TX_IEEE1588_TMST 0x8000 /**< TX IEEE1588 packet to timestamp. */
> > > +#define PKT_TX_L4_NO_CKSUM (0x0000 << 32) /**< Disable L4 cksum of TX pkt. */
> > > +#define PKT_TX_TCP_CKSUM (0x0004 << 32) /**< TCP cksum of TX pkt. computed by NIC. */
> > > +#define PKT_TX_SCTP_CKSUM (0x0008 << 32) /**< SCTP cksum of TX pkt. computed by NIC. */
> > > +#define PKT_TX_UDP_CKSUM (0x000C << 32) /**< UDP cksum of TX pkt. computed by NIC. */
> > > +#define PKT_TX_L4_MASK (0x000C << 32) /**< Mask for L4 cksum offload request. */
> > > +/* Bit 36 */
> > > +#define PKT_TX_IEEE1588_TMST (0x0010 << 32) /**< TX IEEE1588 packet to timestamp. */
> > >
> > > /* Use final bit of flags to indicate a control mbuf */
> > > #define CTRL_MBUF_FLAG (1ULL << 63)
> > > --
> > > 1.9.3
> > >
> > >
> >
> > I'm not opposed to the patch at all, but I would like to point out that this is
> > the sort of change that breaks ABI very easily (which is fine right now given
> > the mbuf changes already staged for the release, but still something to be aware
> > of). As such, are there advantages to this patch (other than the niceness of
> > human readability)?
> >
> > If we're going to reshuffle these flags now, it might be nice to start tx flags
> > at the most significant bit and count back, and start rx flags at the least
> > significant bit and count up. That would ensure that we don't reserve flags for
> > a direction without need.
> >
> > Best
> > Neil
> >
> Good idea, though currently the most significant bit is being used as a flag
> to indicate a control mbuf. My thinking is that we may potentially need
> other flags that are not just for RX or TX, and to have those at the end.
> However, given that that is likely to be the exception case, perhaps we
> could reserve the last byte for non-RX/TX flags and then implement the
> scheme you suggest. What do you think?
>
Sure, seems reasonable
Neil
> /Bruce
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 1/4 v4] compat: Add infrastructure to support symbol versioning
2014-10-01 10:15 0% ` Sergio Gonzalez Monroy
@ 2014-10-01 10:38 0% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-10-01 10:38 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
On Wed, Oct 01, 2014 at 11:15:31AM +0100, Sergio Gonzalez Monroy wrote:
> On Tue, Sep 30, 2014 at 11:18:00AM -0400, Neil Horman wrote:
> > Add initial pass header files to support symbol versioning.
> >
> > ---
> > Change notes
> > v2)
> > * Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
> > non-existant RTE_SYMBOL_VERSIONING
> >
> > * Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
> > properly
> >
> > * Improved/Clarified documentation
> >
> > v3)
> > * Added missing macros to fully export the symver directive specification
> >
> > v4)
> > * Added macro definitions for !SHARED_LIB case
> > * Improved documentation
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
> > ---
> > lib/Makefile | 1 +
> > lib/librte_compat/Makefile | 38 +++++++++++++++++
> > lib/librte_compat/rte_compat.h | 96 ++++++++++++++++++++++++++++++++++++++++++
> > mk/rte.lib.mk | 6 +++
> > 4 files changed, 141 insertions(+)
> > create mode 100644 lib/librte_compat/Makefile
> > create mode 100644 lib/librte_compat/rte_compat.h
> >
> > diff --git a/lib/Makefile b/lib/Makefile
> > index 10c5bb3..a85b55b 100644
> > --- a/lib/Makefile
> > +++ b/lib/Makefile
> > @@ -32,6 +32,7 @@
> > include $(RTE_SDK)/mk/rte.vars.mk
> >
> > DIRS-$(CONFIG_RTE_LIBC) += libc
> > +DIRS-y += librte_compat
> > DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> > DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> > DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> > diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> > new file mode 100644
> > index 0000000..3415c7b
> > --- /dev/null
> > +++ b/lib/librte_compat/Makefile
> > @@ -0,0 +1,38 @@
> > +# BSD LICENSE
> > +#
> > +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
> > +# All rights reserved.
> > +#
> > +# Redistribution and use in source and binary forms, with or without
> > +# modification, are permitted provided that the following conditions
> > +# are met:
> > +#
> > +# * Redistributions of source code must retain the above copyright
> > +# notice, this list of conditions and the following disclaimer.
> > +# * 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.
> > +# * Neither the name of Intel Corporation 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
> > +# OWNER 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.
> > +
> > +include $(RTE_SDK)/mk/rte.vars.mk
> > +
> > +
> > +# install includes
> > +SYMLINK-y-include := rte_compat.h
> > +
> > +include $(RTE_SDK)/mk/rte.lib.mk
> > diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> > new file mode 100644
> > index 0000000..d99e362
> > --- /dev/null
> > +++ b/lib/librte_compat/rte_compat.h
> > @@ -0,0 +1,96 @@
> > +/*-
> > + * BSD LICENSE
> > + *
> > + * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
> > + * All rights reserved.
> > + *
> > + * Redistribution and use in source and binary forms, with or without
> > + * modification, are permitted provided that the following conditions
> > + * are met:
> > + *
> > + * * Redistributions of source code must retain the above copyright
> > + * notice, this list of conditions and the following disclaimer.
> > + * * 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.
> > + * * Neither the name of Intel Corporation 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
> > + * OWNER 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.
> > + */
> > +
> > +#ifndef _RTE_COMPAT_H_
> > +#define _RTE_COMPAT_H_
> > +
> > +/*
> > + * This is just a stringification macro for use below.
> > + */
> > +#define SA(x) #x
> > +
> > +#ifdef RTE_BUILD_SHARED_LIB
> > +
> > +/*
> > + * Provides backwards compatibility when updating exported functions.
> > + * When a symol is exported from a library to provide an API, it also provides a
> > + * calling convention (ABI) that is embodied in its name, return type,
> > + * arguments, etc. On occasion that function may need to change to accomodate
> > + * new functionality, behavior, etc. When that occurs, it is desireable to
> > + * allow for backwards compatibility for a time with older binaries that are
> > + * dynamically linked to the dpdk. to support that the __vsym and
> > + * VERSION_SYMBOL macros are created. They, in conjunction with the
> > + * <library>_version.map file for a given library allow for multiple versions of
> > + * a symbol to exist in a shared library so that older binaries need not be
> > + * immediately recompiled. Their use is outlined in the following example:
> > + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> > + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> > + *
> > + * To accomplish this:
> > + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> > + * foo is exported as a global symbol.
> > + *
> > + * 2) rename the existing function int foo(char *string) to
> > + * int __vsym foo_v18(char *string)
> > + *
> > + * 3) Add this macro immediately below the function
> > + * VERSION_SYMBOL(foo, _v18, 1.8);
> > + *
> > + * 4) Implement a new version of foo.
> > + * char foo(int value, int otherval) { ...}
> > + *
> > + * 5) Mark the newest version as the default version
> > + * BIND_DEFAULT_SYMBOL(foo, 1.9);
> > + *
> > + */
> > +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> > +#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
>
> Hi Neil,
>
> I was wondering about the use of BASE_SYMBOL macro (as you left it out of the example/doc).
>
> From what I understood (according to ld documentation on versioning), that macro would
> bound the symbol to the unspecified base version of the symbol.
> You would want that to provide backward compatibility to apps linked against DSOs pre-versioning.
> I was under the impression that there would not be support for such apps (therefore no need
> for BASE_SYMBOL macro).
>
You are correct, there really is no need for it in our immediate purpose. I
only provided it for completeness of the versioning specification language
(hence the lack of example). We can remove it if you like, but I figured it was
potentially useful to include.
Neil
> Sergio
>
>
> > +#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
> > +#define __vsym __attribute__((used))
> > +
> > +#else
> > +/*
> > + * No symbol versioning in use
> > + */
> > +#define VERSION_SYMBOL(b, e, v)
> > +#define __vsym
> > +#define BASE_SYMBOL(b, n)
> > +#define BIND_DEFAULT_SYMBOL(b, v)
> > +
> > +/*
> > + * RTE_BUILD_SHARED_LIB
> > + */
> > +#endif
> > +
> > +
> > +#endif /* _RTE_COMPAT_H_ */
> > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> > index f458258..82ac309 100644
> > --- a/mk/rte.lib.mk
> > +++ b/mk/rte.lib.mk
> > @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
> >
> > ifeq ($(RTE_BUILD_SHARED_LIB),y)
> > LIB := $(patsubst %.a,%.so,$(LIB))
> > +
> > +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> > +
> > endif
> >
> > +
> > _BUILD = $(LIB)
> > _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> > _CLEAN = doclean
> > @@ -160,7 +164,9 @@ endif
> > $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> > @echo " INSTALL-LIB $(LIB)"
> > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> > +ifneq ($(LIB),)
> > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> > +endif
> >
> > #
> > # Clean all generated files
> > --
> > 1.9.3
> >
> Looks good.
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 1/4 v4] compat: Add infrastructure to support symbol versioning
2014-09-30 15:18 3% ` [dpdk-dev] [PATCH 1/4 v4] " Neil Horman
@ 2014-10-01 10:15 0% ` Sergio Gonzalez Monroy
2014-10-01 10:38 0% ` Neil Horman
2014-10-01 11:28 0% ` Sergio Gonzalez Monroy
1 sibling, 1 reply; 200+ results
From: Sergio Gonzalez Monroy @ 2014-10-01 10:15 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Tue, Sep 30, 2014 at 11:18:00AM -0400, Neil Horman wrote:
> Add initial pass header files to support symbol versioning.
>
> ---
> Change notes
> v2)
> * Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
> non-existant RTE_SYMBOL_VERSIONING
>
> * Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
> properly
>
> * Improved/Clarified documentation
>
> v3)
> * Added missing macros to fully export the symver directive specification
>
> v4)
> * Added macro definitions for !SHARED_LIB case
> * Improved documentation
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
> ---
> lib/Makefile | 1 +
> lib/librte_compat/Makefile | 38 +++++++++++++++++
> lib/librte_compat/rte_compat.h | 96 ++++++++++++++++++++++++++++++++++++++++++
> mk/rte.lib.mk | 6 +++
> 4 files changed, 141 insertions(+)
> create mode 100644 lib/librte_compat/Makefile
> create mode 100644 lib/librte_compat/rte_compat.h
>
> diff --git a/lib/Makefile b/lib/Makefile
> index 10c5bb3..a85b55b 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -32,6 +32,7 @@
> include $(RTE_SDK)/mk/rte.vars.mk
>
> DIRS-$(CONFIG_RTE_LIBC) += libc
> +DIRS-y += librte_compat
> DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> new file mode 100644
> index 0000000..3415c7b
> --- /dev/null
> +++ b/lib/librte_compat/Makefile
> @@ -0,0 +1,38 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +# notice, this list of conditions and the following disclaimer.
> +# * 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.
> +# * Neither the name of Intel Corporation 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
> +# OWNER 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.
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +
> +# install includes
> +SYMLINK-y-include := rte_compat.h
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> new file mode 100644
> index 0000000..d99e362
> --- /dev/null
> +++ b/lib/librte_compat/rte_compat.h
> @@ -0,0 +1,96 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#ifndef _RTE_COMPAT_H_
> +#define _RTE_COMPAT_H_
> +
> +/*
> + * This is just a stringification macro for use below.
> + */
> +#define SA(x) #x
> +
> +#ifdef RTE_BUILD_SHARED_LIB
> +
> +/*
> + * Provides backwards compatibility when updating exported functions.
> + * When a symol is exported from a library to provide an API, it also provides a
> + * calling convention (ABI) that is embodied in its name, return type,
> + * arguments, etc. On occasion that function may need to change to accomodate
> + * new functionality, behavior, etc. When that occurs, it is desireable to
> + * allow for backwards compatibility for a time with older binaries that are
> + * dynamically linked to the dpdk. to support that the __vsym and
> + * VERSION_SYMBOL macros are created. They, in conjunction with the
> + * <library>_version.map file for a given library allow for multiple versions of
> + * a symbol to exist in a shared library so that older binaries need not be
> + * immediately recompiled. Their use is outlined in the following example:
> + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> + *
> + * To accomplish this:
> + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> + * foo is exported as a global symbol.
> + *
> + * 2) rename the existing function int foo(char *string) to
> + * int __vsym foo_v18(char *string)
> + *
> + * 3) Add this macro immediately below the function
> + * VERSION_SYMBOL(foo, _v18, 1.8);
> + *
> + * 4) Implement a new version of foo.
> + * char foo(int value, int otherval) { ...}
> + *
> + * 5) Mark the newest version as the default version
> + * BIND_DEFAULT_SYMBOL(foo, 1.9);
> + *
> + */
> +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> +#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
Hi Neil,
I was wondering about the use of BASE_SYMBOL macro (as you left it out of the example/doc).
>From what I understood (according to ld documentation on versioning), that macro would
bound the symbol to the unspecified base version of the symbol.
You would want that to provide backward compatibility to apps linked against DSOs pre-versioning.
I was under the impression that there would not be support for such apps (therefore no need
for BASE_SYMBOL macro).
Sergio
> +#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
> +#define __vsym __attribute__((used))
> +
> +#else
> +/*
> + * No symbol versioning in use
> + */
> +#define VERSION_SYMBOL(b, e, v)
> +#define __vsym
> +#define BASE_SYMBOL(b, n)
> +#define BIND_DEFAULT_SYMBOL(b, v)
> +
> +/*
> + * RTE_BUILD_SHARED_LIB
> + */
> +#endif
> +
> +
> +#endif /* _RTE_COMPAT_H_ */
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> index f458258..82ac309 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
>
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> LIB := $(patsubst %.a,%.so,$(LIB))
> +
> +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> +
> endif
>
> +
> _BUILD = $(LIB)
> _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> _CLEAN = doclean
> @@ -160,7 +164,9 @@ endif
> $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> @echo " INSTALL-LIB $(LIB)"
> @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> +ifneq ($(LIB),)
> $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> +endif
>
> #
> # Clean all generated files
> --
> 1.9.3
>
Looks good.
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH RFC] mbuf: Adjust TX flags to start at bit 32
2014-09-30 17:06 3% ` Neil Horman
@ 2014-10-01 8:47 0% ` Bruce Richardson
2014-10-01 11:14 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Bruce Richardson @ 2014-10-01 8:47 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Tue, Sep 30, 2014 at 01:06:32PM -0400, Neil Horman wrote:
> On Tue, Sep 30, 2014 at 04:26:02PM +0100, Bruce Richardson wrote:
> > This patch takes the existing TX flags defined for the mbuf and shifts
> > each uniquely defined one left so that additional RX flags can be
> > defined without having RX and TX flags mixed together.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > lib/librte_mbuf/rte_mbuf.h | 26 +++++++++++++-------------
> > 1 file changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> > index 1c6e115..c9fc4ec 100644
> > --- a/lib/librte_mbuf/rte_mbuf.h
> > +++ b/lib/librte_mbuf/rte_mbuf.h
> > @@ -86,26 +86,26 @@ extern "C" {
> > #define PKT_RX_IEEE1588_PTP 0x0200 /**< RX IEEE1588 L2 Ethernet PT Packet. */
> > #define PKT_RX_IEEE1588_TMST 0x0400 /**< RX IEEE1588 L2/L4 timestamped packet.*/
> >
> > -#define PKT_TX_VLAN_PKT 0x0800 /**< TX packet is a 802.1q VLAN packet. */
> > -#define PKT_TX_IP_CKSUM 0x1000 /**< IP cksum of TX pkt. computed by NIC. */
> > -#define PKT_TX_IPV4_CSUM 0x1000 /**< Alias of PKT_TX_IP_CKSUM. */
> > -#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> > -#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
> > +#define PKT_TX_VLAN_PKT (0x0001 << 32) /**< TX packet is a 802.1q VLAN packet. */
> > +#define PKT_TX_IP_CKSUM (0x0002 << 32) /**< IP cksum of TX pkt. computed by NIC. */
> > +#define PKT_TX_IPV4_CSUM PKT_TX_IP_CKSUM /**< Alias of PKT_TX_IP_CKSUM. */
> > +#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> > +#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
> >
> > /*
> > - * Bit 14~13 used for L4 packet type with checksum enabled.
> > + * Bit 35~34 used for L4 packet type with checksum enabled.
> > * 00: Reserved
> > * 01: TCP checksum
> > * 10: SCTP checksum
> > * 11: UDP checksum
> > */
> > -#define PKT_TX_L4_MASK 0x6000 /**< Mask bits for L4 checksum offload request. */
> > -#define PKT_TX_L4_NO_CKSUM 0x0000 /**< Disable L4 cksum of TX pkt. */
> > -#define PKT_TX_TCP_CKSUM 0x2000 /**< TCP cksum of TX pkt. computed by NIC. */
> > -#define PKT_TX_SCTP_CKSUM 0x4000 /**< SCTP cksum of TX pkt. computed by NIC. */
> > -#define PKT_TX_UDP_CKSUM 0x6000 /**< UDP cksum of TX pkt. computed by NIC. */
> > -/* Bit 15 */
> > -#define PKT_TX_IEEE1588_TMST 0x8000 /**< TX IEEE1588 packet to timestamp. */
> > +#define PKT_TX_L4_NO_CKSUM (0x0000 << 32) /**< Disable L4 cksum of TX pkt. */
> > +#define PKT_TX_TCP_CKSUM (0x0004 << 32) /**< TCP cksum of TX pkt. computed by NIC. */
> > +#define PKT_TX_SCTP_CKSUM (0x0008 << 32) /**< SCTP cksum of TX pkt. computed by NIC. */
> > +#define PKT_TX_UDP_CKSUM (0x000C << 32) /**< UDP cksum of TX pkt. computed by NIC. */
> > +#define PKT_TX_L4_MASK (0x000C << 32) /**< Mask for L4 cksum offload request. */
> > +/* Bit 36 */
> > +#define PKT_TX_IEEE1588_TMST (0x0010 << 32) /**< TX IEEE1588 packet to timestamp. */
> >
> > /* Use final bit of flags to indicate a control mbuf */
> > #define CTRL_MBUF_FLAG (1ULL << 63)
> > --
> > 1.9.3
> >
> >
>
> I'm not opposed to the patch at all, but I would like to point out that this is
> the sort of change that breaks ABI very easily (which is fine right now given
> the mbuf changes already staged for the release, but still something to be aware
> of). As such, are there advantages to this patch (other than the niceness of
> human readability)?
>
> If we're going to reshuffle these flags now, it might be nice to start tx flags
> at the most significant bit and count back, and start rx flags at the least
> significant bit and count up. That would ensure that we don't reserve flags for
> a direction without need.
>
> Best
> Neil
>
Good idea, though currently the most significant bit is being used as a flag
to indicate a control mbuf. My thinking is that we may potentially need
other flags that are not just for RX or TX, and to have those at the end.
However, given that that is likely to be the exception case, perhaps we
could reserve the last byte for non-RX/TX flags and then implement the
scheme you suggest. What do you think?
/Bruce
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH RFC] mbuf: Adjust TX flags to start at bit 32
2014-09-30 15:33 3% ` Bruce Richardson
@ 2014-09-30 17:06 3% ` Neil Horman
2014-10-01 8:47 0% ` Bruce Richardson
1 sibling, 1 reply; 200+ results
From: Neil Horman @ 2014-09-30 17:06 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev
On Tue, Sep 30, 2014 at 04:26:02PM +0100, Bruce Richardson wrote:
> This patch takes the existing TX flags defined for the mbuf and shifts
> each uniquely defined one left so that additional RX flags can be
> defined without having RX and TX flags mixed together.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> lib/librte_mbuf/rte_mbuf.h | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index 1c6e115..c9fc4ec 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -86,26 +86,26 @@ extern "C" {
> #define PKT_RX_IEEE1588_PTP 0x0200 /**< RX IEEE1588 L2 Ethernet PT Packet. */
> #define PKT_RX_IEEE1588_TMST 0x0400 /**< RX IEEE1588 L2/L4 timestamped packet.*/
>
> -#define PKT_TX_VLAN_PKT 0x0800 /**< TX packet is a 802.1q VLAN packet. */
> -#define PKT_TX_IP_CKSUM 0x1000 /**< IP cksum of TX pkt. computed by NIC. */
> -#define PKT_TX_IPV4_CSUM 0x1000 /**< Alias of PKT_TX_IP_CKSUM. */
> -#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> -#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
> +#define PKT_TX_VLAN_PKT (0x0001 << 32) /**< TX packet is a 802.1q VLAN packet. */
> +#define PKT_TX_IP_CKSUM (0x0002 << 32) /**< IP cksum of TX pkt. computed by NIC. */
> +#define PKT_TX_IPV4_CSUM PKT_TX_IP_CKSUM /**< Alias of PKT_TX_IP_CKSUM. */
> +#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> +#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
>
> /*
> - * Bit 14~13 used for L4 packet type with checksum enabled.
> + * Bit 35~34 used for L4 packet type with checksum enabled.
> * 00: Reserved
> * 01: TCP checksum
> * 10: SCTP checksum
> * 11: UDP checksum
> */
> -#define PKT_TX_L4_MASK 0x6000 /**< Mask bits for L4 checksum offload request. */
> -#define PKT_TX_L4_NO_CKSUM 0x0000 /**< Disable L4 cksum of TX pkt. */
> -#define PKT_TX_TCP_CKSUM 0x2000 /**< TCP cksum of TX pkt. computed by NIC. */
> -#define PKT_TX_SCTP_CKSUM 0x4000 /**< SCTP cksum of TX pkt. computed by NIC. */
> -#define PKT_TX_UDP_CKSUM 0x6000 /**< UDP cksum of TX pkt. computed by NIC. */
> -/* Bit 15 */
> -#define PKT_TX_IEEE1588_TMST 0x8000 /**< TX IEEE1588 packet to timestamp. */
> +#define PKT_TX_L4_NO_CKSUM (0x0000 << 32) /**< Disable L4 cksum of TX pkt. */
> +#define PKT_TX_TCP_CKSUM (0x0004 << 32) /**< TCP cksum of TX pkt. computed by NIC. */
> +#define PKT_TX_SCTP_CKSUM (0x0008 << 32) /**< SCTP cksum of TX pkt. computed by NIC. */
> +#define PKT_TX_UDP_CKSUM (0x000C << 32) /**< UDP cksum of TX pkt. computed by NIC. */
> +#define PKT_TX_L4_MASK (0x000C << 32) /**< Mask for L4 cksum offload request. */
> +/* Bit 36 */
> +#define PKT_TX_IEEE1588_TMST (0x0010 << 32) /**< TX IEEE1588 packet to timestamp. */
>
> /* Use final bit of flags to indicate a control mbuf */
> #define CTRL_MBUF_FLAG (1ULL << 63)
> --
> 1.9.3
>
>
I'm not opposed to the patch at all, but I would like to point out that this is
the sort of change that breaks ABI very easily (which is fine right now given
the mbuf changes already staged for the release, but still something to be aware
of). As such, are there advantages to this patch (other than the niceness of
human readability)?
If we're going to reshuffle these flags now, it might be nice to start tx flags
at the most significant bit and count back, and start rx flags at the least
significant bit and count up. That would ensure that we don't reserve flags for
a direction without need.
Best
Neil
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH RFC] mbuf: Adjust TX flags to start at bit 32
2014-09-30 16:00 0% ` Wiles, Roger Keith
@ 2014-09-30 16:03 0% ` Bruce Richardson
0 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2014-09-30 16:03 UTC (permalink / raw)
To: Wiles, Roger Keith; +Cc: dev
On Tue, Sep 30, 2014 at 05:00:04PM +0100, Wiles, Roger Keith wrote:
> Hi Bruce,
>
> I like the idea of the split, which should make it easier to do the testing of those bits.
> One comment below.
>
> On Sep 30, 2014, at 10:33 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
>
> > On Tue, Sep 30, 2014 at 04:26:02PM +0100, Bruce Richardson wrote:
> >> This patch takes the existing TX flags defined for the mbuf and shifts
> >> each uniquely defined one left so that additional RX flags can be
> >> defined without having RX and TX flags mixed together.
> >>
> >> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> >> ---
> >
> > This is just an RFC patch for now, as I'm looking for input to make sure
> > this is done right. Couple of opens, if people have input:
> > * is a 32/32 split for RX/TX flags appropriate? Are we likely to have about
> > equal numbers of each?
> > * Doing a grep for the TX flag use, it seems the defines are commonly used,
> > but if anyone is aware of anywhere where the code depends on the flags
> > having a particular value, please let me know.
> >
> > If I have time, I also hope to look at doing rework on the testpmd flag
> > handling based off Olivier's previous patches, but since that is not
> > affecting the public ABI, I consider it a bit lower priority.
> >
> > Thanks,
> > /Bruce
> >
> >> lib/librte_mbuf/rte_mbuf.h | 26 +++++++++++++-------------
> >> 1 file changed, 13 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> >> index 1c6e115..c9fc4ec 100644
> >> --- a/lib/librte_mbuf/rte_mbuf.h
> >> +++ b/lib/librte_mbuf/rte_mbuf.h
> >> @@ -86,26 +86,26 @@ extern "C" {
> >> #define PKT_RX_IEEE1588_PTP 0x0200 /**< RX IEEE1588 L2 Ethernet PT Packet. */
> >> #define PKT_RX_IEEE1588_TMST 0x0400 /**< RX IEEE1588 L2/L4 timestamped packet.*/
> >>
> >> -#define PKT_TX_VLAN_PKT 0x0800 /**< TX packet is a 802.1q VLAN packet. */
> >> -#define PKT_TX_IP_CKSUM 0x1000 /**< IP cksum of TX pkt. computed by NIC. */
> >> -#define PKT_TX_IPV4_CSUM 0x1000 /**< Alias of PKT_TX_IP_CKSUM. */
> >> -#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> >> -#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
> >> +#define PKT_TX_VLAN_PKT (0x0001 << 32) /**< TX packet is a 802.1q VLAN packet. */
> >> +#define PKT_TX_IP_CKSUM (0x0002 << 32) /**< IP cksum of TX pkt. computed by NIC. */
>
> One little nit in the patch is does (0x0001 << 32) need to be (0x0001ULL << 32)? I have not tested it and just a thought.
Yes, indeed it does, good catch!
/Bruce
>
> Thanks
> ++Keith
> >> +#define PKT_TX_IPV4_CSUM PKT_TX_IP_CKSUM /**< Alias of PKT_TX_IP_CKSUM. */
> >> +#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> >> +#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
> >>
> >> /*
> >> - * Bit 14~13 used for L4 packet type with checksum enabled.
> >> + * Bit 35~34 used for L4 packet type with checksum enabled.
> >> * 00: Reserved
> >> * 01: TCP checksum
> >> * 10: SCTP checksum
> >> * 11: UDP checksum
> >> */
> >> -#define PKT_TX_L4_MASK 0x6000 /**< Mask bits for L4 checksum offload request. */
> >> -#define PKT_TX_L4_NO_CKSUM 0x0000 /**< Disable L4 cksum of TX pkt. */
> >> -#define PKT_TX_TCP_CKSUM 0x2000 /**< TCP cksum of TX pkt. computed by NIC. */
> >> -#define PKT_TX_SCTP_CKSUM 0x4000 /**< SCTP cksum of TX pkt. computed by NIC. */
> >> -#define PKT_TX_UDP_CKSUM 0x6000 /**< UDP cksum of TX pkt. computed by NIC. */
> >> -/* Bit 15 */
> >> -#define PKT_TX_IEEE1588_TMST 0x8000 /**< TX IEEE1588 packet to timestamp. */
> >> +#define PKT_TX_L4_NO_CKSUM (0x0000 << 32) /**< Disable L4 cksum of TX pkt. */
> >> +#define PKT_TX_TCP_CKSUM (0x0004 << 32) /**< TCP cksum of TX pkt. computed by NIC. */
> >> +#define PKT_TX_SCTP_CKSUM (0x0008 << 32) /**< SCTP cksum of TX pkt. computed by NIC. */
> >> +#define PKT_TX_UDP_CKSUM (0x000C << 32) /**< UDP cksum of TX pkt. computed by NIC. */
> >> +#define PKT_TX_L4_MASK (0x000C << 32) /**< Mask for L4 cksum offload request. */
> >> +/* Bit 36 */
> >> +#define PKT_TX_IEEE1588_TMST (0x0010 << 32) /**< TX IEEE1588 packet to timestamp. */
> >>
> >> /* Use final bit of flags to indicate a control mbuf */
> >> #define CTRL_MBUF_FLAG (1ULL << 63)
> >> --
> >> 1.9.3
> >>
>
> Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH RFC] mbuf: Adjust TX flags to start at bit 32
2014-09-30 15:33 3% ` Bruce Richardson
@ 2014-09-30 16:00 0% ` Wiles, Roger Keith
2014-09-30 16:03 0% ` Bruce Richardson
0 siblings, 1 reply; 200+ results
From: Wiles, Roger Keith @ 2014-09-30 16:00 UTC (permalink / raw)
To: RICHARDSON, BRUCE; +Cc: dev
Hi Bruce,
I like the idea of the split, which should make it easier to do the testing of those bits.
One comment below.
On Sep 30, 2014, at 10:33 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
> On Tue, Sep 30, 2014 at 04:26:02PM +0100, Bruce Richardson wrote:
>> This patch takes the existing TX flags defined for the mbuf and shifts
>> each uniquely defined one left so that additional RX flags can be
>> defined without having RX and TX flags mixed together.
>>
>> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>> ---
>
> This is just an RFC patch for now, as I'm looking for input to make sure
> this is done right. Couple of opens, if people have input:
> * is a 32/32 split for RX/TX flags appropriate? Are we likely to have about
> equal numbers of each?
> * Doing a grep for the TX flag use, it seems the defines are commonly used,
> but if anyone is aware of anywhere where the code depends on the flags
> having a particular value, please let me know.
>
> If I have time, I also hope to look at doing rework on the testpmd flag
> handling based off Olivier's previous patches, but since that is not
> affecting the public ABI, I consider it a bit lower priority.
>
> Thanks,
> /Bruce
>
>> lib/librte_mbuf/rte_mbuf.h | 26 +++++++++++++-------------
>> 1 file changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
>> index 1c6e115..c9fc4ec 100644
>> --- a/lib/librte_mbuf/rte_mbuf.h
>> +++ b/lib/librte_mbuf/rte_mbuf.h
>> @@ -86,26 +86,26 @@ extern "C" {
>> #define PKT_RX_IEEE1588_PTP 0x0200 /**< RX IEEE1588 L2 Ethernet PT Packet. */
>> #define PKT_RX_IEEE1588_TMST 0x0400 /**< RX IEEE1588 L2/L4 timestamped packet.*/
>>
>> -#define PKT_TX_VLAN_PKT 0x0800 /**< TX packet is a 802.1q VLAN packet. */
>> -#define PKT_TX_IP_CKSUM 0x1000 /**< IP cksum of TX pkt. computed by NIC. */
>> -#define PKT_TX_IPV4_CSUM 0x1000 /**< Alias of PKT_TX_IP_CKSUM. */
>> -#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
>> -#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
>> +#define PKT_TX_VLAN_PKT (0x0001 << 32) /**< TX packet is a 802.1q VLAN packet. */
>> +#define PKT_TX_IP_CKSUM (0x0002 << 32) /**< IP cksum of TX pkt. computed by NIC. */
One little nit in the patch is does (0x0001 << 32) need to be (0x0001ULL << 32)? I have not tested it and just a thought.
Thanks
++Keith
>> +#define PKT_TX_IPV4_CSUM PKT_TX_IP_CKSUM /**< Alias of PKT_TX_IP_CKSUM. */
>> +#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
>> +#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
>>
>> /*
>> - * Bit 14~13 used for L4 packet type with checksum enabled.
>> + * Bit 35~34 used for L4 packet type with checksum enabled.
>> * 00: Reserved
>> * 01: TCP checksum
>> * 10: SCTP checksum
>> * 11: UDP checksum
>> */
>> -#define PKT_TX_L4_MASK 0x6000 /**< Mask bits for L4 checksum offload request. */
>> -#define PKT_TX_L4_NO_CKSUM 0x0000 /**< Disable L4 cksum of TX pkt. */
>> -#define PKT_TX_TCP_CKSUM 0x2000 /**< TCP cksum of TX pkt. computed by NIC. */
>> -#define PKT_TX_SCTP_CKSUM 0x4000 /**< SCTP cksum of TX pkt. computed by NIC. */
>> -#define PKT_TX_UDP_CKSUM 0x6000 /**< UDP cksum of TX pkt. computed by NIC. */
>> -/* Bit 15 */
>> -#define PKT_TX_IEEE1588_TMST 0x8000 /**< TX IEEE1588 packet to timestamp. */
>> +#define PKT_TX_L4_NO_CKSUM (0x0000 << 32) /**< Disable L4 cksum of TX pkt. */
>> +#define PKT_TX_TCP_CKSUM (0x0004 << 32) /**< TCP cksum of TX pkt. computed by NIC. */
>> +#define PKT_TX_SCTP_CKSUM (0x0008 << 32) /**< SCTP cksum of TX pkt. computed by NIC. */
>> +#define PKT_TX_UDP_CKSUM (0x000C << 32) /**< UDP cksum of TX pkt. computed by NIC. */
>> +#define PKT_TX_L4_MASK (0x000C << 32) /**< Mask for L4 cksum offload request. */
>> +/* Bit 36 */
>> +#define PKT_TX_IEEE1588_TMST (0x0010 << 32) /**< TX IEEE1588 packet to timestamp. */
>>
>> /* Use final bit of flags to indicate a control mbuf */
>> #define CTRL_MBUF_FLAG (1ULL << 63)
>> --
>> 1.9.3
>>
Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH RFC] mbuf: Adjust TX flags to start at bit 32
@ 2014-09-30 15:33 3% ` Bruce Richardson
2014-09-30 16:00 0% ` Wiles, Roger Keith
2014-09-30 17:06 3% ` Neil Horman
1 sibling, 1 reply; 200+ results
From: Bruce Richardson @ 2014-09-30 15:33 UTC (permalink / raw)
To: dev
On Tue, Sep 30, 2014 at 04:26:02PM +0100, Bruce Richardson wrote:
> This patch takes the existing TX flags defined for the mbuf and shifts
> each uniquely defined one left so that additional RX flags can be
> defined without having RX and TX flags mixed together.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
This is just an RFC patch for now, as I'm looking for input to make sure
this is done right. Couple of opens, if people have input:
* is a 32/32 split for RX/TX flags appropriate? Are we likely to have about
equal numbers of each?
* Doing a grep for the TX flag use, it seems the defines are commonly used,
but if anyone is aware of anywhere where the code depends on the flags
having a particular value, please let me know.
If I have time, I also hope to look at doing rework on the testpmd flag
handling based off Olivier's previous patches, but since that is not
affecting the public ABI, I consider it a bit lower priority.
Thanks,
/Bruce
> lib/librte_mbuf/rte_mbuf.h | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index 1c6e115..c9fc4ec 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -86,26 +86,26 @@ extern "C" {
> #define PKT_RX_IEEE1588_PTP 0x0200 /**< RX IEEE1588 L2 Ethernet PT Packet. */
> #define PKT_RX_IEEE1588_TMST 0x0400 /**< RX IEEE1588 L2/L4 timestamped packet.*/
>
> -#define PKT_TX_VLAN_PKT 0x0800 /**< TX packet is a 802.1q VLAN packet. */
> -#define PKT_TX_IP_CKSUM 0x1000 /**< IP cksum of TX pkt. computed by NIC. */
> -#define PKT_TX_IPV4_CSUM 0x1000 /**< Alias of PKT_TX_IP_CKSUM. */
> -#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> -#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
> +#define PKT_TX_VLAN_PKT (0x0001 << 32) /**< TX packet is a 802.1q VLAN packet. */
> +#define PKT_TX_IP_CKSUM (0x0002 << 32) /**< IP cksum of TX pkt. computed by NIC. */
> +#define PKT_TX_IPV4_CSUM PKT_TX_IP_CKSUM /**< Alias of PKT_TX_IP_CKSUM. */
> +#define PKT_TX_IPV4 PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */
> +#define PKT_TX_IPV6 PKT_RX_IPV6_HDR /**< IPv6 packet */
>
> /*
> - * Bit 14~13 used for L4 packet type with checksum enabled.
> + * Bit 35~34 used for L4 packet type with checksum enabled.
> * 00: Reserved
> * 01: TCP checksum
> * 10: SCTP checksum
> * 11: UDP checksum
> */
> -#define PKT_TX_L4_MASK 0x6000 /**< Mask bits for L4 checksum offload request. */
> -#define PKT_TX_L4_NO_CKSUM 0x0000 /**< Disable L4 cksum of TX pkt. */
> -#define PKT_TX_TCP_CKSUM 0x2000 /**< TCP cksum of TX pkt. computed by NIC. */
> -#define PKT_TX_SCTP_CKSUM 0x4000 /**< SCTP cksum of TX pkt. computed by NIC. */
> -#define PKT_TX_UDP_CKSUM 0x6000 /**< UDP cksum of TX pkt. computed by NIC. */
> -/* Bit 15 */
> -#define PKT_TX_IEEE1588_TMST 0x8000 /**< TX IEEE1588 packet to timestamp. */
> +#define PKT_TX_L4_NO_CKSUM (0x0000 << 32) /**< Disable L4 cksum of TX pkt. */
> +#define PKT_TX_TCP_CKSUM (0x0004 << 32) /**< TCP cksum of TX pkt. computed by NIC. */
> +#define PKT_TX_SCTP_CKSUM (0x0008 << 32) /**< SCTP cksum of TX pkt. computed by NIC. */
> +#define PKT_TX_UDP_CKSUM (0x000C << 32) /**< UDP cksum of TX pkt. computed by NIC. */
> +#define PKT_TX_L4_MASK (0x000C << 32) /**< Mask for L4 cksum offload request. */
> +/* Bit 36 */
> +#define PKT_TX_IEEE1588_TMST (0x0010 << 32) /**< TX IEEE1588 packet to timestamp. */
>
> /* Use final bit of flags to indicate a control mbuf */
> #define CTRL_MBUF_FLAG (1ULL << 63)
> --
> 1.9.3
>
^ permalink raw reply [relevance 3%]
* [dpdk-dev] [PATCH 1/4 v4] compat: Add infrastructure to support symbol versioning
2014-09-15 19:23 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
` (2 preceding siblings ...)
2014-09-29 15:44 3% ` [dpdk-dev] [PATCH 1/4 v3] " Neil Horman
@ 2014-09-30 15:18 3% ` Neil Horman
2014-10-01 10:15 0% ` Sergio Gonzalez Monroy
2014-10-01 11:28 0% ` Sergio Gonzalez Monroy
3 siblings, 2 replies; 200+ results
From: Neil Horman @ 2014-09-30 15:18 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
---
Change notes
v2)
* Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
non-existant RTE_SYMBOL_VERSIONING
* Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
properly
* Improved/Clarified documentation
v3)
* Added missing macros to fully export the symver directive specification
v4)
* Added macro definitions for !SHARED_LIB case
* Improved documentation
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++++++
lib/librte_compat/rte_compat.h | 96 ++++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 6 +++
4 files changed, 141 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 10c5bb3..a85b55b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -32,6 +32,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
DIRS-$(CONFIG_RTE_LIBC) += libc
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..3415c7b
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..d99e362
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,96 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+
+/*
+ * This is just a stringification macro for use below.
+ */
+#define SA(x) #x
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. to support that the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ * char foo(int value, int otherval) { ...}
+ *
+ * 5) Mark the newest version as the default version
+ * BIND_DEFAULT_SYMBOL(foo, 1.9);
+ *
+ */
+#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
+#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
+#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+#define BASE_SYMBOL(b, n)
+#define BIND_DEFAULT_SYMBOL(b, v)
+
+/*
+ * RTE_BUILD_SHARED_LIB
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index f458258..82ac309 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
@@ -160,7 +164,9 @@ endif
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
+ifneq ($(LIB),)
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+endif
#
# Clean all generated files
--
1.9.3
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 1/4 v3] compat: Add infrastructure to support symbol versioning
2014-09-29 15:44 3% ` [dpdk-dev] [PATCH 1/4 v3] " Neil Horman
@ 2014-09-30 8:13 0% ` Sergio Gonzalez Monroy
0 siblings, 0 replies; 200+ results
From: Sergio Gonzalez Monroy @ 2014-09-30 8:13 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Mon, Sep 29, 2014 at 11:44:03AM -0400, Neil Horman wrote:
> Add initial pass header files to support symbol versioning.
>
> ---
> Change notes
> v2)
> * Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
> non-existant RTE_SYMBOL_VERSIONING
>
> * Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
> properly
>
> * Improved/Clarified documentation
>
> v3)
> * Added missing macros to fully export the symver directive specification
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
> ---
> lib/Makefile | 1 +
> lib/librte_compat/Makefile | 38 ++++++++++++++++++
> lib/librte_compat/rte_compat.h | 90 ++++++++++++++++++++++++++++++++++++++++++
> mk/rte.lib.mk | 6 +++
> 4 files changed, 135 insertions(+)
> create mode 100644 lib/librte_compat/Makefile
> create mode 100644 lib/librte_compat/rte_compat.h
>
> diff --git a/lib/Makefile b/lib/Makefile
> index 10c5bb3..a85b55b 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -32,6 +32,7 @@
> include $(RTE_SDK)/mk/rte.vars.mk
>
> DIRS-$(CONFIG_RTE_LIBC) += libc
> +DIRS-y += librte_compat
> DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> new file mode 100644
> index 0000000..3415c7b
> --- /dev/null
> +++ b/lib/librte_compat/Makefile
> @@ -0,0 +1,38 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +# notice, this list of conditions and the following disclaimer.
> +# * 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.
> +# * Neither the name of Intel Corporation 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
> +# OWNER 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.
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +
> +# install includes
> +SYMLINK-y-include := rte_compat.h
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> new file mode 100644
> index 0000000..0b76771
> --- /dev/null
> +++ b/lib/librte_compat/rte_compat.h
> @@ -0,0 +1,90 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#ifndef _RTE_COMPAT_H_
> +#define _RTE_COMPAT_H_
> +
> +/*
> + * This is just a stringification macro for use below.
> + */
> +#define SA(x) #x
> +
> +#ifdef RTE_BUILD_SHARED_LIB
> +
> +/*
> + * Provides backwards compatibility when updating exported functions.
> + * When a symol is exported from a library to provide an API, it also provides a
> + * calling convention (ABI) that is embodied in its name, return type,
> + * arguments, etc. On occasion that function may need to change to accomodate
> + * new functionality, behavior, etc. When that occurs, it is desireable to
> + * allow for backwards compatibility for a time with older binaries that are
> + * dynamically linked to the dpdk. to support that the __vsym and
> + * VERSION_SYMBOL macros are created. They, in conjunction with the
> + * <library>_version.map file for a given library allow for multiple versions of
> + * a symbol to exist in a shared library so that older binaries need not be
> + * immediately recompiled. Their use is outlined in the following example:
> + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> + *
> + * To accomplish this:
> + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> + * foo is exported as a global symbol.
> + *
> + * 2) rename the existing function int foo(char *string) to
> + * int __vsym foo_v18(char *string)
> + *
> + * 3) Add this macro immediately below the function
> + * VERSION_SYMBOL(foo, _v18, 1.8);
> + *
> + * 4) Implement a new version of foo.
> + *
> + */
> +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> +#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
> +#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
> +#define __vsym __attribute__((used))
I think it would be useful to provide an example for the new macros.
> +
> +#else
> +/*
> + * No symbol versioning in use
> + */
> +#define VERSION_SYMBOL(b, e, v)
> +#define __vsym
Both new macros missing for non shared lib build.
Sergio
> +
> +/*
> + * RTE_BUILD_SHARED_LIB
> + */
> +#endif
> +
> +
> +#endif /* _RTE_COMPAT_H_ */
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> index f458258..82ac309 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
>
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> LIB := $(patsubst %.a,%.so,$(LIB))
> +
> +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> +
> endif
>
> +
> _BUILD = $(LIB)
> _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> _CLEAN = doclean
> @@ -160,7 +164,9 @@ endif
> $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> @echo " INSTALL-LIB $(LIB)"
> @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> +ifneq ($(LIB),)
> $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> +endif
>
> #
> # Clean all generated files
> --
> 1.9.3
>
^ permalink raw reply [relevance 0%]
* [dpdk-dev] [PATCH 1/4 v3] compat: Add infrastructure to support symbol versioning
2014-09-15 19:23 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-09-23 10:39 0% ` Sergio Gonzalez Monroy
2014-09-25 18:52 4% ` [dpdk-dev] [PATCH 1/4 v2] " Neil Horman
@ 2014-09-29 15:44 3% ` Neil Horman
2014-09-30 8:13 0% ` Sergio Gonzalez Monroy
2014-09-30 15:18 3% ` [dpdk-dev] [PATCH 1/4 v4] " Neil Horman
3 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-29 15:44 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
---
Change notes
v2)
* Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
non-existant RTE_SYMBOL_VERSIONING
* Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
properly
* Improved/Clarified documentation
v3)
* Added missing macros to fully export the symver directive specification
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 ++++++++++++++++++
lib/librte_compat/rte_compat.h | 90 ++++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 6 +++
4 files changed, 135 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 10c5bb3..a85b55b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -32,6 +32,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
DIRS-$(CONFIG_RTE_LIBC) += libc
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..3415c7b
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..0b76771
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,90 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+
+/*
+ * This is just a stringification macro for use below.
+ */
+#define SA(x) #x
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. to support that the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol.
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ * 4) Implement a new version of foo.
+ *
+ */
+#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
+#define BASE_SYMBOL(b, n) __asm__(".symver " SA(n) ", "SA(b)"@")
+#define BIND_DEFAULT_SYMBOL(b, v) __asm__(".symver " SA(b) ", "SA(b)"@@DPDK_"SA(v))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+
+/*
+ * RTE_BUILD_SHARED_LIB
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index f458258..82ac309 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
@@ -160,7 +164,9 @@ endif
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
+ifneq ($(LIB),)
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+endif
#
# Clean all generated files
--
1.9.3
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question
2014-09-29 12:30 0% ` Ananyev, Konstantin
@ 2014-09-29 14:57 0% ` Wiles, Roger Keith
0 siblings, 0 replies; 200+ results
From: Wiles, Roger Keith @ 2014-09-29 14:57 UTC (permalink / raw)
To: ANANYEV, KONSTANTIN; +Cc: dev
On Sep 29, 2014, at 7:30 AM, Ananyev, Konstantin <konstantin.ananyev@intel.com> wrote:
>
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
>> Sent: Monday, September 29, 2014 1:10 PM
>> To: Wiles, Roger Keith (Wind River)
>> Cc: dev@dpdk.org
>> Subject: Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question
>>
>> On Sun, Sep 28, 2014 at 11:06:17PM +0000, Wiles, Roger Keith wrote:
>>> Thanks Venky,
>>> On Sep 28, 2014, at 5:23 PM, Venkatesan, Venky <venky.venkatesan@intel.com> wrote:
>>>
>>>> Keith,
>>>>
>>>> On 9/28/2014 11:04 AM, Wiles, Roger Keith wrote:
>>>>> I am also looking at the bulk dequeue routines, which the ring can be fixed or variable. On fixed < 0 on error is returned and 0 if
>> successful. On a variable ring < 0 on error or n on success, but I think n can be zero in the variable case, correct?
>>>>>
>>>>> If these are true then why not have the routines return < 0 on error and >= 0 on success. Which means a dequeue from a fixed
>> ring would return only ’requested size n’ or < 0 if you error off the 0 case. The 0 case could be OK, if you allow zero to be return on a
>> empty ring for the fixed ring case.
>>>>>
>>>>> Does this make sense to anyone?
>>>> It won't make sense unless you're aware of the history behind these functions. The original functions that were implemented for
>> the ring were only the bulk functions (i.e. FIXED). They would return exactly the number of items requested for dequeue (0 if success,
>> negative if error), and not return any if the required number were not available.
>>>>
>>>> The burst (i.e. VARIABLE) functions came in much later (think it was r1.3 where we introduced them), and by that time, there were
>> already quite a number of deployments of DPDK in the field using the legacy ring functions. Therefore we made the decision to keep
>> the legacy behavior intact & not impacting deployed code - and merging the burst functions into the code. Given that there was no
>> "versioning" of the API/ABI in those releases :).
>>>
>>> I see why the code is this way. If the developers used ‘if ( ret == 0 ) { /* do something */ }’ then it would break if it returned a
>> positive value on success. I would expect the normal behavior to be ‘if ( ret < 0 ) { /* error case */ }’ and fall thru for the success case. I
>> would love to change the code to just return <0 on error or >= 0 on success. I wonder how many customers code would break
>> changing the code to do just just the two steps. I think it will remove some code in a couple places that were testing for FIXED or
>> VARIABLE?
>>>>
>>>> Hope that helps.
>>>> -Venky
>>>>
>>>>>
>>>>> Thanks
>>>>> ++Keith
>>>>>
>>>>> Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
>>>
>>> Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
>>>
>>
>> Since we are looking at making considerable ABI changes in this release and
>> (hopefully) also looking to version our ABI going forward, I would be in
>> favour of making any changes to these APIs in this current release if
>> possible. While the current behaviour makes sense for historical reason, I
>> think an overall change to the behaviour as Keith describes would be more
>> sensible long-term.
>
> It is doable, I suppose, but might become quite messy:
> Don't know how many people are using rte_ring_dequeue_bulk() all over the place.
> I suspect quite a lot.
> From other side - what the real gain we'll have from it?
> I don't see much so far.
> Konstantin
>
I see two possible gains one is a consistent return method for Fixed/Variable and some code reduction in a few places. Let me see if I can create a patch we can review and see if it seems reasonable.
>>
>> (Also to note my previous suggestion about upping the major version to 2.0
>> if we continue to increase the number of ABI/API changes in this release.
>> Anyone else any thoughts on that?)
Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question
2014-09-29 12:10 4% ` Bruce Richardson
2014-09-29 12:26 0% ` Neil Horman
@ 2014-09-29 12:30 0% ` Ananyev, Konstantin
2014-09-29 14:57 0% ` Wiles, Roger Keith
1 sibling, 1 reply; 200+ results
From: Ananyev, Konstantin @ 2014-09-29 12:30 UTC (permalink / raw)
To: Richardson, Bruce, Wiles, Roger Keith (Wind River); +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Monday, September 29, 2014 1:10 PM
> To: Wiles, Roger Keith (Wind River)
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question
>
> On Sun, Sep 28, 2014 at 11:06:17PM +0000, Wiles, Roger Keith wrote:
> > Thanks Venky,
> > On Sep 28, 2014, at 5:23 PM, Venkatesan, Venky <venky.venkatesan@intel.com> wrote:
> >
> > > Keith,
> > >
> > > On 9/28/2014 11:04 AM, Wiles, Roger Keith wrote:
> > >> I am also looking at the bulk dequeue routines, which the ring can be fixed or variable. On fixed < 0 on error is returned and 0 if
> successful. On a variable ring < 0 on error or n on success, but I think n can be zero in the variable case, correct?
> > >>
> > >> If these are true then why not have the routines return < 0 on error and >= 0 on success. Which means a dequeue from a fixed
> ring would return only ’requested size n’ or < 0 if you error off the 0 case. The 0 case could be OK, if you allow zero to be return on a
> empty ring for the fixed ring case.
> > >>
> > >> Does this make sense to anyone?
> > > It won't make sense unless you're aware of the history behind these functions. The original functions that were implemented for
> the ring were only the bulk functions (i.e. FIXED). They would return exactly the number of items requested for dequeue (0 if success,
> negative if error), and not return any if the required number were not available.
> > >
> > > The burst (i.e. VARIABLE) functions came in much later (think it was r1.3 where we introduced them), and by that time, there were
> already quite a number of deployments of DPDK in the field using the legacy ring functions. Therefore we made the decision to keep
> the legacy behavior intact & not impacting deployed code - and merging the burst functions into the code. Given that there was no
> "versioning" of the API/ABI in those releases :).
> >
> > I see why the code is this way. If the developers used ‘if ( ret == 0 ) { /* do something */ }’ then it would break if it returned a
> positive value on success. I would expect the normal behavior to be ‘if ( ret < 0 ) { /* error case */ }’ and fall thru for the success case. I
> would love to change the code to just return <0 on error or >= 0 on success. I wonder how many customers code would break
> changing the code to do just just the two steps. I think it will remove some code in a couple places that were testing for FIXED or
> VARIABLE?
> > >
> > > Hope that helps.
> > > -Venky
> > >
> > >>
> > >> Thanks
> > >> ++Keith
> > >>
> > >> Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
> >
> > Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
> >
>
> Since we are looking at making considerable ABI changes in this release and
> (hopefully) also looking to version our ABI going forward, I would be in
> favour of making any changes to these APIs in this current release if
> possible. While the current behaviour makes sense for historical reason, I
> think an overall change to the behaviour as Keith describes would be more
> sensible long-term.
It is doable, I suppose, but might become quite messy:
Don't know how many people are using rte_ring_dequeue_bulk() all over the place.
I suspect quite a lot.
From other side - what the real gain we'll have from it?
I don't see much so far.
Konstantin
>
> (Also to note my previous suggestion about upping the major version to 2.0
> if we continue to increase the number of ABI/API changes in this release.
> Anyone else any thoughts on that?)
>
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question
2014-09-29 12:10 4% ` Bruce Richardson
@ 2014-09-29 12:26 0% ` Neil Horman
2014-09-29 12:30 0% ` Ananyev, Konstantin
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2014-09-29 12:26 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev
On Mon, Sep 29, 2014 at 01:10:22PM +0100, Bruce Richardson wrote:
> On Sun, Sep 28, 2014 at 11:06:17PM +0000, Wiles, Roger Keith wrote:
> > Thanks Venky,
> > On Sep 28, 2014, at 5:23 PM, Venkatesan, Venky <venky.venkatesan@intel.com> wrote:
> >
> > > Keith,
> > >
> > > On 9/28/2014 11:04 AM, Wiles, Roger Keith wrote:
> > >> I am also looking at the bulk dequeue routines, which the ring can be fixed or variable. On fixed < 0 on error is returned and 0 if successful. On a variable ring < 0 on error or n on success, but I think n can be zero in the variable case, correct?
> > >>
> > >> If these are true then why not have the routines return < 0 on error and >= 0 on success. Which means a dequeue from a fixed ring would return only ’requested size n’ or < 0 if you error off the 0 case. The 0 case could be OK, if you allow zero to be return on a empty ring for the fixed ring case.
> > >>
> > >> Does this make sense to anyone?
> > > It won't make sense unless you're aware of the history behind these functions. The original functions that were implemented for the ring were only the bulk functions (i.e. FIXED). They would return exactly the number of items requested for dequeue (0 if success, negative if error), and not return any if the required number were not available.
> > >
> > > The burst (i.e. VARIABLE) functions came in much later (think it was r1.3 where we introduced them), and by that time, there were already quite a number of deployments of DPDK in the field using the legacy ring functions. Therefore we made the decision to keep the legacy behavior intact & not impacting deployed code - and merging the burst functions into the code. Given that there was no "versioning" of the API/ABI in those releases :).
> >
> > I see why the code is this way. If the developers used ‘if ( ret == 0 ) { /* do something */ }’ then it would break if it returned a positive value on success. I would expect the normal behavior to be ‘if ( ret < 0 ) { /* error case */ }’ and fall thru for the success case. I would love to change the code to just return <0 on error or >= 0 on success. I wonder how many customers code would break changing the code to do just just the two steps. I think it will remove some code in a couple places that were testing for FIXED or VARIABLE?
> > >
> > > Hope that helps.
> > > -Venky
> > >
> > >>
> > >> Thanks
> > >> ++Keith
> > >>
> > >> Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
> >
> > Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
> >
>
> Since we are looking at making considerable ABI changes in this release and
> (hopefully) also looking to version our ABI going forward, I would be in
> favour of making any changes to these APIs in this current release if
> possible. While the current behaviour makes sense for historical reason, I
> think an overall change to the behaviour as Keith describes would be more
> sensible long-term.
>
I agree, this seems like a sensible time to make these sorts of changes as we
identify them.
> (Also to note my previous suggestion about upping the major version to 2.0
> if we continue to increase the number of ABI/API changes in this release.
> Anyone else any thoughts on that?)
>
I feel like this is a policy decision, as I vew the versioning as arbitrary.
I'm really fine with it either way. Presumably moving to 2.0 would represent a
major shift in design, and I suppose adding versioning does amount to something
like that, so I could be supportive.
Neil
> /Bruce
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question
2014-09-28 23:06 0% ` Wiles, Roger Keith
@ 2014-09-29 12:10 4% ` Bruce Richardson
2014-09-29 12:26 0% ` Neil Horman
2014-09-29 12:30 0% ` Ananyev, Konstantin
0 siblings, 2 replies; 200+ results
From: Bruce Richardson @ 2014-09-29 12:10 UTC (permalink / raw)
To: Wiles, Roger Keith; +Cc: dev
On Sun, Sep 28, 2014 at 11:06:17PM +0000, Wiles, Roger Keith wrote:
> Thanks Venky,
> On Sep 28, 2014, at 5:23 PM, Venkatesan, Venky <venky.venkatesan@intel.com> wrote:
>
> > Keith,
> >
> > On 9/28/2014 11:04 AM, Wiles, Roger Keith wrote:
> >> I am also looking at the bulk dequeue routines, which the ring can be fixed or variable. On fixed < 0 on error is returned and 0 if successful. On a variable ring < 0 on error or n on success, but I think n can be zero in the variable case, correct?
> >>
> >> If these are true then why not have the routines return < 0 on error and >= 0 on success. Which means a dequeue from a fixed ring would return only ’requested size n’ or < 0 if you error off the 0 case. The 0 case could be OK, if you allow zero to be return on a empty ring for the fixed ring case.
> >>
> >> Does this make sense to anyone?
> > It won't make sense unless you're aware of the history behind these functions. The original functions that were implemented for the ring were only the bulk functions (i.e. FIXED). They would return exactly the number of items requested for dequeue (0 if success, negative if error), and not return any if the required number were not available.
> >
> > The burst (i.e. VARIABLE) functions came in much later (think it was r1.3 where we introduced them), and by that time, there were already quite a number of deployments of DPDK in the field using the legacy ring functions. Therefore we made the decision to keep the legacy behavior intact & not impacting deployed code - and merging the burst functions into the code. Given that there was no "versioning" of the API/ABI in those releases :).
>
> I see why the code is this way. If the developers used ‘if ( ret == 0 ) { /* do something */ }’ then it would break if it returned a positive value on success. I would expect the normal behavior to be ‘if ( ret < 0 ) { /* error case */ }’ and fall thru for the success case. I would love to change the code to just return <0 on error or >= 0 on success. I wonder how many customers code would break changing the code to do just just the two steps. I think it will remove some code in a couple places that were testing for FIXED or VARIABLE?
> >
> > Hope that helps.
> > -Venky
> >
> >>
> >> Thanks
> >> ++Keith
> >>
> >> Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
>
> Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
>
Since we are looking at making considerable ABI changes in this release and
(hopefully) also looking to version our ABI going forward, I would be in
favour of making any changes to these APIs in this current release if
possible. While the current behaviour makes sense for historical reason, I
think an overall change to the behaviour as Keith describes would be more
sensible long-term.
(Also to note my previous suggestion about upping the major version to 2.0
if we continue to increase the number of ABI/API changes in this release.
Anyone else any thoughts on that?)
/Bruce
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question
2014-09-28 22:23 3% ` Venkatesan, Venky
2014-09-28 22:36 0% ` Neil Horman
@ 2014-09-28 23:06 0% ` Wiles, Roger Keith
2014-09-29 12:10 4% ` Bruce Richardson
1 sibling, 1 reply; 200+ results
From: Wiles, Roger Keith @ 2014-09-28 23:06 UTC (permalink / raw)
To: VENKATESAN, NAMAKKAL; +Cc: dev
Thanks Venky,
On Sep 28, 2014, at 5:23 PM, Venkatesan, Venky <venky.venkatesan@intel.com> wrote:
> Keith,
>
> On 9/28/2014 11:04 AM, Wiles, Roger Keith wrote:
>> I am also looking at the bulk dequeue routines, which the ring can be fixed or variable. On fixed < 0 on error is returned and 0 if successful. On a variable ring < 0 on error or n on success, but I think n can be zero in the variable case, correct?
>>
>> If these are true then why not have the routines return < 0 on error and >= 0 on success. Which means a dequeue from a fixed ring would return only ’requested size n’ or < 0 if you error off the 0 case. The 0 case could be OK, if you allow zero to be return on a empty ring for the fixed ring case.
>>
>> Does this make sense to anyone?
> It won't make sense unless you're aware of the history behind these functions. The original functions that were implemented for the ring were only the bulk functions (i.e. FIXED). They would return exactly the number of items requested for dequeue (0 if success, negative if error), and not return any if the required number were not available.
>
> The burst (i.e. VARIABLE) functions came in much later (think it was r1.3 where we introduced them), and by that time, there were already quite a number of deployments of DPDK in the field using the legacy ring functions. Therefore we made the decision to keep the legacy behavior intact & not impacting deployed code - and merging the burst functions into the code. Given that there was no "versioning" of the API/ABI in those releases :).
I see why the code is this way. If the developers used ‘if ( ret == 0 ) { /* do something */ }’ then it would break if it returned a positive value on success. I would expect the normal behavior to be ‘if ( ret < 0 ) { /* error case */ }’ and fall thru for the success case. I would love to change the code to just return <0 on error or >= 0 on success. I wonder how many customers code would break changing the code to do just just the two steps. I think it will remove some code in a couple places that were testing for FIXED or VARIABLE?
>
> Hope that helps.
> -Venky
>
>>
>> Thanks
>> ++Keith
>>
>> Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question
2014-09-28 22:23 3% ` Venkatesan, Venky
@ 2014-09-28 22:36 0% ` Neil Horman
2014-09-28 23:06 0% ` Wiles, Roger Keith
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2014-09-28 22:36 UTC (permalink / raw)
To: Venkatesan, Venky; +Cc: dev
On Sun, Sep 28, 2014 at 03:23:44PM -0700, Venkatesan, Venky wrote:
> Keith,
>
> On 9/28/2014 11:04 AM, Wiles, Roger Keith wrote:
> >I am also looking at the bulk dequeue routines, which the ring can be fixed or variable. On fixed < 0 on error is returned and 0 if successful. On a variable ring < 0 on error or n on success, but I think n can be zero in the variable case, correct?
> >
> >If these are true then why not have the routines return < 0 on error and >= 0 on success. Which means a dequeue from a fixed ring would return only ’requested size n’ or < 0 if you error off the 0 case. The 0 case could be OK, if you allow zero to be return on a empty ring for the fixed ring case.
> >
> >Does this make sense to anyone?
> It won't make sense unless you're aware of the history behind these
> functions. The original functions that were implemented for the ring were
> only the bulk functions (i.e. FIXED). They would return exactly the number
> of items requested for dequeue (0 if success, negative if error), and not
> return any if the required number were not available.
>
> The burst (i.e. VARIABLE) functions came in much later (think it was r1.3
> where we introduced them), and by that time, there were already quite a
> number of deployments of DPDK in the field using the legacy ring functions.
> Therefore we made the decision to keep the legacy behavior intact & not
> impacting deployed code - and merging the burst functions into the code.
> Given that there was no "versioning" of the API/ABI in those releases :).
>
Hehe :)
Yes, API versioning would be a great benefit to this sort of problem. If only
there were a patchset available to create that ability ;)
Neil
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] Bulk dequeue of packets and the returned values, question
@ 2014-09-28 22:23 3% ` Venkatesan, Venky
2014-09-28 22:36 0% ` Neil Horman
2014-09-28 23:06 0% ` Wiles, Roger Keith
0 siblings, 2 replies; 200+ results
From: Venkatesan, Venky @ 2014-09-28 22:23 UTC (permalink / raw)
To: dev
Keith,
On 9/28/2014 11:04 AM, Wiles, Roger Keith wrote:
> I am also looking at the bulk dequeue routines, which the ring can be fixed or variable. On fixed < 0 on error is returned and 0 if successful. On a variable ring < 0 on error or n on success, but I think n can be zero in the variable case, correct?
>
> If these are true then why not have the routines return < 0 on error and >= 0 on success. Which means a dequeue from a fixed ring would return only ’requested size n’ or < 0 if you error off the 0 case. The 0 case could be OK, if you allow zero to be return on a empty ring for the fixed ring case.
>
> Does this make sense to anyone?
It won't make sense unless you're aware of the history behind these
functions. The original functions that were implemented for the ring
were only the bulk functions (i.e. FIXED). They would return exactly the
number of items requested for dequeue (0 if success, negative if error),
and not return any if the required number were not available.
The burst (i.e. VARIABLE) functions came in much later (think it was
r1.3 where we introduced them), and by that time, there were already
quite a number of deployments of DPDK in the field using the legacy ring
functions. Therefore we made the decision to keep the legacy behavior
intact & not impacting deployed code - and merging the burst functions
into the code. Given that there was no "versioning" of the API/ABI in
those releases :).
Hope that helps.
-Venky
>
> Thanks
> ++Keith
>
> Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
>
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-26 22:02 4% ` Stephen Hemminger
@ 2014-09-27 2:22 5% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-09-27 2:22 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
On Fri, Sep 26, 2014 at 03:02:55PM -0700, Stephen Hemminger wrote:
> On Fri, 26 Sep 2014 10:45:49 -0400
> Neil Horman <nhorman@tuxdriver.com> wrote:
>
> > On Fri, Sep 26, 2014 at 12:41:33PM +0200, Thomas Monjalon wrote:
> > > Hi Neil,
> > >
> > > 2014-09-24 14:19, Neil Horman:
> > > > Ping Thomas. I know you're busy, but I would like this to not fall off anyones
> > > > radar. You alluded to concerns regarding what, for lack of a better term,
> > > > ABI/API lockin. I had asked you to enuumerate/elaborate on specifics, but never
> > > > heard back. Are there further specifics you wish to discuss, or are you
> > > > satisfied with the above answers?
> > >
> > > Sorry for not being very reactive on this thread.
> > > All this discussion is very interesting but it's really not the proper
> > > time to apply it. As you said, it requires an extra effort. I'm not saying
> > > it will never be integrated. I'm just saying that we cannot change
> > > everything at the same time.
> > >
> > > Let me sum up the situation. This community project has been very active
> > > for few months now. First, we learnt how to make some releases together
> > > and we are improving the process to be able to deliver a new major release
> > > every 4 months while having some good quality process.
> > > But these releases are still not complete because documentation is not
> > > integrated yet. Then developers should have a role in documentation updates.
> > > We also need to integrate and learn how to use more tools to be more
> > > efficient and improve quality.
> > >
> > > So the question is "when should we care about API compatibility"?
> > > And the answer is: ASAP, but not now. I feel next year is a better target.
> > > Because the most important priority is to move together at a pace which
> > > allow most of us to stay in the race.
> > >
> >
> >
> > I'm sorry Thomas, I don't accept this. I asked you for details as to your
> > concerns regarding this patch series, and you've provided more vague comments.
> > I need details to address
> >
> > You say it requires extra effort, you're right it does. Any feature that you
> > integreate requires some additional effort. How is this patch any different
> > from adding the acl library or any other new API? Everything requires
> > maintenence, thats how software works. What specfically about this patch series
> > makes the effort insurmountable to you?
> >
> > You say you're improving your process. Great, this patch aids in that process
> > by ensuring backwards compatibility for a period of time. Given that the API
> > and ABI can still evolve within this framework, as I've described, how is this
> > patch series not a significant step forward toward your goal of quality process.
> >
> > You say documentation isn't integrated. So, what does getting documentation
> > integrated have to do with this patch set, or any other? I don't see you
> > holding any other patches based on documentation. Again, nothing in this series
> > prevents evolution of the API or ABI. If you're hope is to wait until
> > everything is perfect, then apply some control to the public facing API, and get
> > it all documented, none of thosse things will ever happen, I promise you.
> >
> > You say you also need to learn to use more tools to be more efficient and
> > improve quality. Great! Thats exactly what this is. If we mandate even a short
> > term commitment to ABI stability (1 single relese worth of time), we will
> > quickly identify what API's change quickly and where we need to be cautious with
> > our API design. If you just assume that developers will get better of their own
> > volition, it will never happen.
> >
> > You say this should go in next year, but not now. When exactly? What event do
> > you forsee occuring in the next 12-18 months that will change everything such
> > that we can start supporing an ABI for more than just a few weeks at the head of
> > the tree?
> >
> > To this end, I just did a quick search through the git history for dpdk to look
> > at the histories of all the header files that are exposed via the makefile
> > SYMLINK command (given that that provides a list of header files that
> > applications can include, and embodies all the function symbols and data types
> > applications have access to.
> >
> > There are 179 total commits in that list
> > Of those, a bit of spot checking suggests that about 10-15% of them actually
> > change ABI, and many of those came from Bruce's rework of the mbuf structure.
> > That about 17-20 instances over the last 2 years where an ABI update would have
> > been needed. That seems pretty reasonable to me. Where exactly is your concern
> > here?
> >
> > Neil
>
> Isn't ABI stablity a distro responsibility not a project responsibility?
> I have lots more API/ABI changes, just been too busy trying to release a real
> product using DPDK to upstream all the changes.
>
No. How well would glibc or any major library work without ABI stability?
Its definately a distros responsibility to not break ABI with backports from
upstream within a major release, but its upstreams responsibility to maintain
ABI for some period of time to prevent immediate distro breakage with an update.
Often libraries provide this by simply taking lots of care in their ABI
design, but if ABI flexibility is a need, providing some level of backwards
compatibility must fall on the upstream project.
Neil
>
>
^ permalink raw reply [relevance 5%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-26 14:45 5% ` Neil Horman
@ 2014-09-26 22:02 4% ` Stephen Hemminger
2014-09-27 2:22 5% ` Neil Horman
2014-10-01 18:59 0% ` Neil Horman
1 sibling, 1 reply; 200+ results
From: Stephen Hemminger @ 2014-09-26 22:02 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Fri, 26 Sep 2014 10:45:49 -0400
Neil Horman <nhorman@tuxdriver.com> wrote:
> On Fri, Sep 26, 2014 at 12:41:33PM +0200, Thomas Monjalon wrote:
> > Hi Neil,
> >
> > 2014-09-24 14:19, Neil Horman:
> > > Ping Thomas. I know you're busy, but I would like this to not fall off anyones
> > > radar. You alluded to concerns regarding what, for lack of a better term,
> > > ABI/API lockin. I had asked you to enuumerate/elaborate on specifics, but never
> > > heard back. Are there further specifics you wish to discuss, or are you
> > > satisfied with the above answers?
> >
> > Sorry for not being very reactive on this thread.
> > All this discussion is very interesting but it's really not the proper
> > time to apply it. As you said, it requires an extra effort. I'm not saying
> > it will never be integrated. I'm just saying that we cannot change
> > everything at the same time.
> >
> > Let me sum up the situation. This community project has been very active
> > for few months now. First, we learnt how to make some releases together
> > and we are improving the process to be able to deliver a new major release
> > every 4 months while having some good quality process.
> > But these releases are still not complete because documentation is not
> > integrated yet. Then developers should have a role in documentation updates.
> > We also need to integrate and learn how to use more tools to be more
> > efficient and improve quality.
> >
> > So the question is "when should we care about API compatibility"?
> > And the answer is: ASAP, but not now. I feel next year is a better target.
> > Because the most important priority is to move together at a pace which
> > allow most of us to stay in the race.
> >
>
>
> I'm sorry Thomas, I don't accept this. I asked you for details as to your
> concerns regarding this patch series, and you've provided more vague comments.
> I need details to address
>
> You say it requires extra effort, you're right it does. Any feature that you
> integreate requires some additional effort. How is this patch any different
> from adding the acl library or any other new API? Everything requires
> maintenence, thats how software works. What specfically about this patch series
> makes the effort insurmountable to you?
>
> You say you're improving your process. Great, this patch aids in that process
> by ensuring backwards compatibility for a period of time. Given that the API
> and ABI can still evolve within this framework, as I've described, how is this
> patch series not a significant step forward toward your goal of quality process.
>
> You say documentation isn't integrated. So, what does getting documentation
> integrated have to do with this patch set, or any other? I don't see you
> holding any other patches based on documentation. Again, nothing in this series
> prevents evolution of the API or ABI. If you're hope is to wait until
> everything is perfect, then apply some control to the public facing API, and get
> it all documented, none of thosse things will ever happen, I promise you.
>
> You say you also need to learn to use more tools to be more efficient and
> improve quality. Great! Thats exactly what this is. If we mandate even a short
> term commitment to ABI stability (1 single relese worth of time), we will
> quickly identify what API's change quickly and where we need to be cautious with
> our API design. If you just assume that developers will get better of their own
> volition, it will never happen.
>
> You say this should go in next year, but not now. When exactly? What event do
> you forsee occuring in the next 12-18 months that will change everything such
> that we can start supporing an ABI for more than just a few weeks at the head of
> the tree?
>
> To this end, I just did a quick search through the git history for dpdk to look
> at the histories of all the header files that are exposed via the makefile
> SYMLINK command (given that that provides a list of header files that
> applications can include, and embodies all the function symbols and data types
> applications have access to.
>
> There are 179 total commits in that list
> Of those, a bit of spot checking suggests that about 10-15% of them actually
> change ABI, and many of those came from Bruce's rework of the mbuf structure.
> That about 17-20 instances over the last 2 years where an ABI update would have
> been needed. That seems pretty reasonable to me. Where exactly is your concern
> here?
>
> Neil
Isn't ABI stablity a distro responsibility not a project responsibility?
I have lots more API/ABI changes, just been too busy trying to release a real
product using DPDK to upstream all the changes.
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 1/4 v2] compat: Add infrastructure to support symbol versioning
2014-09-26 16:22 0% ` Neil Horman
@ 2014-09-26 19:19 0% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-09-26 19:19 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
On Fri, Sep 26, 2014 at 12:22:56PM -0400, Neil Horman wrote:
> On Fri, Sep 26, 2014 at 04:33:04PM +0100, Sergio Gonzalez Monroy wrote:
> > On Fri, Sep 26, 2014 at 11:16:30AM -0400, Neil Horman wrote:
> > > On Fri, Sep 26, 2014 at 03:16:08PM +0100, Sergio Gonzalez Monroy wrote:
> > > > On Thu, Sep 25, 2014 at 02:52:32PM -0400, Neil Horman wrote:
> > > > > Add initial pass header files to support symbol versioning.
> > > > >
> > > > > ---
> > > > > Change notes
> > > > > v2)
> > > > > * Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
> > > > > non-existant RTE_SYMBOL_VERSIONING
> > > > >
> > > > > * Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
> > > > > properly
> > > > >
> > > > > * Improved/Clarified documentation
> > > > >
> > > > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > > > CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
> > > > > ---
> > > > > lib/Makefile | 1 +
> > > > > lib/librte_compat/Makefile | 38 ++++++++++++++++++
> > > > > lib/librte_compat/rte_compat.h | 87 ++++++++++++++++++++++++++++++++++++++++++
> > > > > mk/rte.lib.mk | 6 +++
> > > > > 4 files changed, 132 insertions(+)
> > > > > create mode 100644 lib/librte_compat/Makefile
> > > > > create mode 100644 lib/librte_compat/rte_compat.h
> > > > >
> > > > > diff --git a/lib/Makefile b/lib/Makefile
> > > > > index 10c5bb3..a85b55b 100644
> > > > > --- a/lib/Makefile
> > > > > +++ b/lib/Makefile
> > > > > @@ -32,6 +32,7 @@
> > > > > include $(RTE_SDK)/mk/rte.vars.mk
> > > > >
> > > > > DIRS-$(CONFIG_RTE_LIBC) += libc
> > > > > +DIRS-y += librte_compat
> > > > > DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> > > > > DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> > > > > DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> > > > > diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> > > > > new file mode 100644
> > > > > index 0000000..3415c7b
> > > > > --- /dev/null
> > > > > +++ b/lib/librte_compat/Makefile
> > > > > @@ -0,0 +1,38 @@
> > > > > +# BSD LICENSE
> > > > > +#
> > > > > +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
> > > > > +# All rights reserved.
> > > > > +#
> > > > > +# Redistribution and use in source and binary forms, with or without
> > > > > +# modification, are permitted provided that the following conditions
> > > > > +# are met:
> > > > > +#
> > > > > +# * Redistributions of source code must retain the above copyright
> > > > > +# notice, this list of conditions and the following disclaimer.
> > > > > +# * 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.
> > > > > +# * Neither the name of Intel Corporation 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
> > > > > +# OWNER 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.
> > > > > +
> > > > > +include $(RTE_SDK)/mk/rte.vars.mk
> > > > > +
> > > > > +
> > > > > +# install includes
> > > > > +SYMLINK-y-include := rte_compat.h
> > > > > +
> > > > > +include $(RTE_SDK)/mk/rte.lib.mk
> > > > > diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> > > > > new file mode 100644
> > > > > index 0000000..cff9aea
> > > > > --- /dev/null
> > > > > +++ b/lib/librte_compat/rte_compat.h
> > > > > @@ -0,0 +1,87 @@
> > > > > +/*-
> > > > > + * BSD LICENSE
> > > > > + *
> > > > > + * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
> > > > > + * All rights reserved.
> > > > > + *
> > > > > + * Redistribution and use in source and binary forms, with or without
> > > > > + * modification, are permitted provided that the following conditions
> > > > > + * are met:
> > > > > + *
> > > > > + * * Redistributions of source code must retain the above copyright
> > > > > + * notice, this list of conditions and the following disclaimer.
> > > > > + * * 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.
> > > > > + * * Neither the name of Intel Corporation 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
> > > > > + * OWNER 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.
> > > > > + */
> > > > > +
> > > > > +#ifndef _RTE_COMPAT_H_
> > > > > +#define _RTE_COMPAT_H_
> > > > > +
> > > > > +/*
> > > > > + * This is just a stringification macro for use below.
> > > > > + */
> > > > > +#define SA(x) #x
> > > > > +
> > > > > +#ifdef RTE_BUILD_SHARED_LIB
> > > > > +
> > > > > +/*
> > > > > + * Provides backwards compatibility when updating exported functions.
> > > > > + * When a symol is exported from a library to provide an API, it also provides a
> > > > > + * calling convention (ABI) that is embodied in its name, return type,
> > > > > + * arguments, etc. On occasion that function may need to change to accomodate
> > > > > + * new functionality, behavior, etc. When that occurs, it is desireable to
> > > > > + * allow for backwards compatibility for a time with older binaries that are
> > > > > + * dynamically linked to the dpdk. to support that the __vsym and
> > > > > + * VERSION_SYMBOL macros are created. They, in conjunction with the
> > > > > + * <library>_version.map file for a given library allow for multiple versions of
> > > > > + * a symbol to exist in a shared library so that older binaries need not be
> > > > > + * immediately recompiled. Their use is outlined in the following example:
> > > > > + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> > > > > + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> > > > > + *
> > > > > + * To accomplish this:
> > > > > + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> > > > > + * foo is exported as a global symbol. Note that foo must be removed from the
> > > > > + * DPDK.(X) node, or you will see multiple symbol definitions
> > > > > + *
> > > >
> > > > By removing the symbol from the previous node in the version map, you make
> > > > it local instead of global and applications linked against DPDK 1.8 will fail
> > > > with the new library.
> > > >
> > > It sounds like you just did the remove part, and not the add part. What does
> > > your new version map file look like?
> > >
> > > Neil
> > >
> >
> > $ cat lib/librte_acl/rte_acl_version.map
> > DPDK_1.8 {
> > global:
> > rte_acl_find_existing;
> > rte_acl_free;
> > rte_acl_add_rules;
> > rte_acl_reset_rules;
> > rte_acl_build;
> > rte_acl_reset;
> > rte_acl_classify;
> > rte_acl_dump;
> > rte_acl_list_dump;
> > rte_acl_ipv4vlan_add_rules;
> > rte_acl_ipv4vlan_build;
> > rte_acl_classify_scalar;
> > rte_acl_classify_alg;
> > rte_acl_set_ctx_classify;
> >
> > local: *;
> > };
> >
> > DPDK_1.9 {
> > global:
> > rte_acl_create;
> > } DPDK_1.8;
> >
> >
> > Anyway, if the DPDK_1.9 node was not defined, the dso would not have the symbol:
> > rte_acl_create@@DPDK_1.9
> >
> > Sergio
> >
> > > > Following the steps you describe, if we create a new version of the function
> > > > rte_acl_create we would end up with the following dso:
> > > >
> > > > $ readelf -s x86_64-native-linuxapp-gcc/lib/librte_acl.so | grep "create\|\.symtab\|\.dynsym"
> > > > Symbol table '.dynsym' contains 42 entries:
> > > > 28: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create@@DPDK_1.9
> > > > Symbol table '.symtab' contains 147 entries:
> > > > 94: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create_v18
> > > > 105: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create@@DPDK_1.8
> > > > 138: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create
> > > >
> > > > You can check that applications linked with the old lib will fail to run.
> > > > Note that to easily check this you should define the environment variable
> > > > LD_BIND_NOW to resolve all symbols at program startup (man ld.so).
> > > >
> > > > Sergio
> > > >
> Hm, thats odd, Using the same changes in my build here, I get both an exported
> global rte_acl_create@@DPDK_1.8 and @@DPDK_1.9 symbol. Let me take a closer
> look at it here once I get through the rest of my email
> Neil
>
> > > > > + * 2) rename the existing function int foo(char *string) to
> > > > > + * int __vsym foo_v18(char *string)
> > > > > + *
> > > > > + * 3) Add this macro immediately below the function
> > > > > + * VERSION_SYMBOL(foo, _v18, 1.8);
> > > > > + *
> > > > > + */
> > > > > +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
> > > > > +#define __vsym __attribute__((used))
> > > > > +
> > > > > +#else
> > > > > +/*
> > > > > + * No symbol versioning in use
> > > > > + */
> > > > > +#define VERSION_SYMBOL(b, e, v)
> > > > > +#define __vsym
> > > > > +
> > > > > +/*
> > > > > + * RTE_BUILD_SHARED_LIB
> > > > > + */
> > > > > +#endif
> > > > > +
> > > > > +
> > > > > +#endif /* _RTE_COMPAT_H_ */
> > > > > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> > > > > index f458258..82ac309 100644
> > > > > --- a/mk/rte.lib.mk
> > > > > +++ b/mk/rte.lib.mk
> > > > > @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
> > > > >
> > > > > ifeq ($(RTE_BUILD_SHARED_LIB),y)
> > > > > LIB := $(patsubst %.a,%.so,$(LIB))
> > > > > +
> > > > > +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> > > > > +
> > > > > endif
> > > > >
> > > > > +
> > > > > _BUILD = $(LIB)
> > > > > _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> > > > > _CLEAN = doclean
> > > > > @@ -160,7 +164,9 @@ endif
> > > > > $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> > > > > @echo " INSTALL-LIB $(LIB)"
> > > > > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> > > > > +ifneq ($(LIB),)
> > > > > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> > > > > +endif
> > > > >
> > > > > #
> > > > > # Clean all generated files
> > > > > --
> > > > > 1.9.3
> > > > >
> > > >
> >
>
Well, I have to apologize Sergio. Apparently I misread something in the guide
for symbol versioning and this isn't in fact working. It appeared to be working
for me because something was messed up in my tree and I wasn't relinking when I
updated the map file. So self-NAK on this series for now, I'll repost it
shortly. The good news is I have a bit of smaple code working properly, which
I've verified, and I should have a new version of this series (which should by
an large look the same) ready early next week
Best
Neil
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 1/4 v2] compat: Add infrastructure to support symbol versioning
2014-09-26 15:33 0% ` Sergio Gonzalez Monroy
@ 2014-09-26 16:22 0% ` Neil Horman
2014-09-26 19:19 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-26 16:22 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
On Fri, Sep 26, 2014 at 04:33:04PM +0100, Sergio Gonzalez Monroy wrote:
> On Fri, Sep 26, 2014 at 11:16:30AM -0400, Neil Horman wrote:
> > On Fri, Sep 26, 2014 at 03:16:08PM +0100, Sergio Gonzalez Monroy wrote:
> > > On Thu, Sep 25, 2014 at 02:52:32PM -0400, Neil Horman wrote:
> > > > Add initial pass header files to support symbol versioning.
> > > >
> > > > ---
> > > > Change notes
> > > > v2)
> > > > * Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
> > > > non-existant RTE_SYMBOL_VERSIONING
> > > >
> > > > * Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
> > > > properly
> > > >
> > > > * Improved/Clarified documentation
> > > >
> > > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > > CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
> > > > ---
> > > > lib/Makefile | 1 +
> > > > lib/librte_compat/Makefile | 38 ++++++++++++++++++
> > > > lib/librte_compat/rte_compat.h | 87 ++++++++++++++++++++++++++++++++++++++++++
> > > > mk/rte.lib.mk | 6 +++
> > > > 4 files changed, 132 insertions(+)
> > > > create mode 100644 lib/librte_compat/Makefile
> > > > create mode 100644 lib/librte_compat/rte_compat.h
> > > >
> > > > diff --git a/lib/Makefile b/lib/Makefile
> > > > index 10c5bb3..a85b55b 100644
> > > > --- a/lib/Makefile
> > > > +++ b/lib/Makefile
> > > > @@ -32,6 +32,7 @@
> > > > include $(RTE_SDK)/mk/rte.vars.mk
> > > >
> > > > DIRS-$(CONFIG_RTE_LIBC) += libc
> > > > +DIRS-y += librte_compat
> > > > DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> > > > DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> > > > DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> > > > diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> > > > new file mode 100644
> > > > index 0000000..3415c7b
> > > > --- /dev/null
> > > > +++ b/lib/librte_compat/Makefile
> > > > @@ -0,0 +1,38 @@
> > > > +# BSD LICENSE
> > > > +#
> > > > +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
> > > > +# All rights reserved.
> > > > +#
> > > > +# Redistribution and use in source and binary forms, with or without
> > > > +# modification, are permitted provided that the following conditions
> > > > +# are met:
> > > > +#
> > > > +# * Redistributions of source code must retain the above copyright
> > > > +# notice, this list of conditions and the following disclaimer.
> > > > +# * 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.
> > > > +# * Neither the name of Intel Corporation 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
> > > > +# OWNER 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.
> > > > +
> > > > +include $(RTE_SDK)/mk/rte.vars.mk
> > > > +
> > > > +
> > > > +# install includes
> > > > +SYMLINK-y-include := rte_compat.h
> > > > +
> > > > +include $(RTE_SDK)/mk/rte.lib.mk
> > > > diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> > > > new file mode 100644
> > > > index 0000000..cff9aea
> > > > --- /dev/null
> > > > +++ b/lib/librte_compat/rte_compat.h
> > > > @@ -0,0 +1,87 @@
> > > > +/*-
> > > > + * BSD LICENSE
> > > > + *
> > > > + * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
> > > > + * All rights reserved.
> > > > + *
> > > > + * Redistribution and use in source and binary forms, with or without
> > > > + * modification, are permitted provided that the following conditions
> > > > + * are met:
> > > > + *
> > > > + * * Redistributions of source code must retain the above copyright
> > > > + * notice, this list of conditions and the following disclaimer.
> > > > + * * 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.
> > > > + * * Neither the name of Intel Corporation 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
> > > > + * OWNER 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.
> > > > + */
> > > > +
> > > > +#ifndef _RTE_COMPAT_H_
> > > > +#define _RTE_COMPAT_H_
> > > > +
> > > > +/*
> > > > + * This is just a stringification macro for use below.
> > > > + */
> > > > +#define SA(x) #x
> > > > +
> > > > +#ifdef RTE_BUILD_SHARED_LIB
> > > > +
> > > > +/*
> > > > + * Provides backwards compatibility when updating exported functions.
> > > > + * When a symol is exported from a library to provide an API, it also provides a
> > > > + * calling convention (ABI) that is embodied in its name, return type,
> > > > + * arguments, etc. On occasion that function may need to change to accomodate
> > > > + * new functionality, behavior, etc. When that occurs, it is desireable to
> > > > + * allow for backwards compatibility for a time with older binaries that are
> > > > + * dynamically linked to the dpdk. to support that the __vsym and
> > > > + * VERSION_SYMBOL macros are created. They, in conjunction with the
> > > > + * <library>_version.map file for a given library allow for multiple versions of
> > > > + * a symbol to exist in a shared library so that older binaries need not be
> > > > + * immediately recompiled. Their use is outlined in the following example:
> > > > + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> > > > + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> > > > + *
> > > > + * To accomplish this:
> > > > + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> > > > + * foo is exported as a global symbol. Note that foo must be removed from the
> > > > + * DPDK.(X) node, or you will see multiple symbol definitions
> > > > + *
> > >
> > > By removing the symbol from the previous node in the version map, you make
> > > it local instead of global and applications linked against DPDK 1.8 will fail
> > > with the new library.
> > >
> > It sounds like you just did the remove part, and not the add part. What does
> > your new version map file look like?
> >
> > Neil
> >
>
> $ cat lib/librte_acl/rte_acl_version.map
> DPDK_1.8 {
> global:
> rte_acl_find_existing;
> rte_acl_free;
> rte_acl_add_rules;
> rte_acl_reset_rules;
> rte_acl_build;
> rte_acl_reset;
> rte_acl_classify;
> rte_acl_dump;
> rte_acl_list_dump;
> rte_acl_ipv4vlan_add_rules;
> rte_acl_ipv4vlan_build;
> rte_acl_classify_scalar;
> rte_acl_classify_alg;
> rte_acl_set_ctx_classify;
>
> local: *;
> };
>
> DPDK_1.9 {
> global:
> rte_acl_create;
> } DPDK_1.8;
>
>
> Anyway, if the DPDK_1.9 node was not defined, the dso would not have the symbol:
> rte_acl_create@@DPDK_1.9
>
> Sergio
>
> > > Following the steps you describe, if we create a new version of the function
> > > rte_acl_create we would end up with the following dso:
> > >
> > > $ readelf -s x86_64-native-linuxapp-gcc/lib/librte_acl.so | grep "create\|\.symtab\|\.dynsym"
> > > Symbol table '.dynsym' contains 42 entries:
> > > 28: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create@@DPDK_1.9
> > > Symbol table '.symtab' contains 147 entries:
> > > 94: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create_v18
> > > 105: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create@@DPDK_1.8
> > > 138: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create
> > >
> > > You can check that applications linked with the old lib will fail to run.
> > > Note that to easily check this you should define the environment variable
> > > LD_BIND_NOW to resolve all symbols at program startup (man ld.so).
> > >
> > > Sergio
> > >
Hm, thats odd, Using the same changes in my build here, I get both an exported
global rte_acl_create@@DPDK_1.8 and @@DPDK_1.9 symbol. Let me take a closer
look at it here once I get through the rest of my email
Neil
> > > > + * 2) rename the existing function int foo(char *string) to
> > > > + * int __vsym foo_v18(char *string)
> > > > + *
> > > > + * 3) Add this macro immediately below the function
> > > > + * VERSION_SYMBOL(foo, _v18, 1.8);
> > > > + *
> > > > + */
> > > > +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
> > > > +#define __vsym __attribute__((used))
> > > > +
> > > > +#else
> > > > +/*
> > > > + * No symbol versioning in use
> > > > + */
> > > > +#define VERSION_SYMBOL(b, e, v)
> > > > +#define __vsym
> > > > +
> > > > +/*
> > > > + * RTE_BUILD_SHARED_LIB
> > > > + */
> > > > +#endif
> > > > +
> > > > +
> > > > +#endif /* _RTE_COMPAT_H_ */
> > > > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> > > > index f458258..82ac309 100644
> > > > --- a/mk/rte.lib.mk
> > > > +++ b/mk/rte.lib.mk
> > > > @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
> > > >
> > > > ifeq ($(RTE_BUILD_SHARED_LIB),y)
> > > > LIB := $(patsubst %.a,%.so,$(LIB))
> > > > +
> > > > +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> > > > +
> > > > endif
> > > >
> > > > +
> > > > _BUILD = $(LIB)
> > > > _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> > > > _CLEAN = doclean
> > > > @@ -160,7 +164,9 @@ endif
> > > > $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> > > > @echo " INSTALL-LIB $(LIB)"
> > > > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> > > > +ifneq ($(LIB),)
> > > > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> > > > +endif
> > > >
> > > > #
> > > > # Clean all generated files
> > > > --
> > > > 1.9.3
> > > >
> > >
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe:
2014-09-26 15:41 0% ` Ananyev, Konstantin
@ 2014-09-26 16:21 3% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-09-26 16:21 UTC (permalink / raw)
To: Ananyev, Konstantin; +Cc: dev
On Fri, Sep 26, 2014 at 03:41:58PM +0000, Ananyev, Konstantin wrote:
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> > Sent: Friday, September 26, 2014 4:02 PM
> > To: Wodkowski, PawelX
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe:
> >
> > On Fri, Sep 26, 2014 at 02:01:05PM +0000, Wodkowski, PawelX wrote:
> > > > > > Maybe I don't see something obvious? :)
> > > >
> > > > I think you're missing the fact that your patch doesn't do what you assert above
> > > > either :)
> > >
> > > Issue is not in setting alarms but canceling it. If you look closer to my patch you
> > > see that it address this issue (look at added *do { lock(); ....; unlock(); } while( )*
> > > part).
> > >
> > I get where the issue is, and I'm looking at your patch. I see that you did
> > some locking there. The issue I'm pointing out is that, if you call
> > rte_eal_alarm_cancel on an alarm callback, you will exit the alarm_cancel
> > function with, by definition, one alarm executing (the one you are currently
> > running). You're patch works perfectly for the case where another thread calls
> > cancel, in that it waits until the executing alarm is complete, but it doesn't
> > work in the case where you are calling it from within the alarm callback.
>
> Hm, and why do we need it from alarm callback?
Because you might not know if you're in an alarm callback or not. Pawel
explained that the point of the patch was to ensure that alarms are canceled and
complete when you call rte_eal_alarm_cancel, and thats not always going to be
the case, even whith this patch.
> After cb_func() is finished given alarm entry will be removed anyway.
>
Yes, but thats true with or without this patch.
> > If you're goal is to guarantee that all the matching alarms are cancelled and
> > complete, you haven't done that, because the recursive state is still unhandled.
> >
> > > >
> > > > First, lets address rte_alarm_set. There is no notion of "re-arming" in this
> > > > alarm implementation, because theres no ability to refer to a specific alarm
> > > > from the callers perspective. When you call rte_eal_alarm_set you get a new
> > > > alarm every time. So I don't really see a race there. It might not be exactly
> > > > the behavior you want, but its not a race, becuase you're not modifying an
> > > > alarm
> > > > in the middle of execution, you're just creating a new alarm, which is safe.
> > >
> > > OK, it is safe, but this is not the case.
> > >
> > I don't know what you mean by this. We agree its safe, great. But it is the
> > case as I've described it, you can see it from the implementation, every call to
> > rte_eal_alarm_set starts with a malloc of a new alarm structure.
> >
> > > >
> > > > There is a race in what you describe above, insofar as its possible that you
> > > > might call rte_eal_alarm_cancel and return without having canceled all the
> > > > matching alarms. I don't see any clear documentation on what the behavior is
> > > > supposed to be, but if you want to ensure that all matching alarms are cancelled
> > > > or complete on return from rte_eal_alarm_cancel, thats perfectly fine (in linux
> > > > API parlance, thats usually denoted as a cancel_sync operation).
> > >
> > > Again, look at the patch. I changed documentation to inform about this behavior.
> > >
> >
> > This is the documentation included in the patch:
> > Change alarm cancel function to thread-safe.
> > It eliminates a race between threads using rte_alarm_cancel and
> > rte_alarm_set.
> >
> > neither have you compeltely described the race condition (though you now have
> > previously in this thread), nor have you completely addressed it (calling
> > rte_eal_alarm_cancel and rte_eal_alarm_set still behaves exactly as it did
> > previously with a 2nd thread).
> >
> > > >
> > > > For that race condition, you're correct, my patch doesn't address it, I see that
> > > > now. Though your patch doesn't either. If you call rte_eal_alarm_cancel from
> > > > within a callback function, then, by definition, you can't wait on the
> > > > completion of the active alarm, because thats a deadlock. Its a necessecary
> > > > evil, I grant you, but it means that you can't be guaranteed the cancelled and
> > > > complete (cancel_sync) behavior that you want, at least not with the current
> > > > api. If you want that behavior, you need to do one of two things:
> > >
> > > This patch does not break any API. It only removes undefined behavior.
> > >
> > I never said it did break ABI. I said that to completely fix it you would have
> > to break ABI. And it doesn't really remove undefined behavior, because you
> > still have the old behavior in the recursive case (which you may be ok with, I
> > don't know, but if you really want to address the behavior, you should address
> > this aspect of it).
> >
> > > >
> > > > 1) Modify the api to allow callers to individually reference timer instances, so
> > > > that when cancelling, we can return an appropriate return code to indicate to
> > > > the caller that this alarm is in-progress. That way you can guarantee the
> > > > caller that the specific alarm that you cancelled is either complete and cancelled
> > > > or currently executing. Add an api to expicitly wait on a referenced alarm as
> > > > well. This allows developers to know that, when executing an alarm callback, an
> > > > -ECURRENTLYEXECUTING return code is ok, because they are in the currently
> > > > executing context.
> > >
> > > This would brake API for sure.
> > Yes, it would. Bruce Richardson just made a major ABI break with his mbuf
> > cleanup set. If there was a time to change ABI here, now would be the time I
> > think.
>
> Ok, too many words for me, to be honest :)
Yeah, its getting a bit verbose :)
> Can I summarise:
> As I remember the purpose of the patch was to fix the race condition inside rte_alarm library.
> I believe that the patch provided by Michal & Pawel fixes the issues you discovered.
> If you think, that is not the case, could you please provide a list of remaining issues?
> Excluding ones that you just don't like it, and you are not happy with rte_alarm API in total?
Gladly. As Pawel explained the race, its possible that, after calling
rte_eal_alarm_cancel, an in-flight execution of an alarm callback may still be
running. The problem with that ostensibly is that data which is being accessed
by the callback might be then accessed in parallel with another process leading
to data corruption or some other problem. The issue I have with his patch is
that it doesn't completely close the race. While it does close the race for the
condition in whcih thread B is running the alarm callback while thread A is
executing the cancel operation, it does not close the case for when a single
thread B is running the cancel operation, as the in-flight execution itself is
still active. If such a cancellation occurs via an intermediary function (i.e.
one which is not aware that it is explicitly running an alarm callback, which
signals another thread to execute via some other method (ipc communication,
etc), the same data corruption may occur, because the canceled and complete
guarantee has been violated.
>
> If you have any concerns about mbuf reorg/expansion - probably better to contact Bruce and express them.
> Not to use it as an argument for breaking any existing API without really good reason behind.
>
No, no concerns at all, only pointing out that we've already broken ABI in this
release, which requires application writers to rebuild and adjust their
applications, so if we were going to adjust this api, now would be the time,
rather than in a futre release, requiring multiple application rebuilds.
Neil
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe:
2014-09-26 15:01 5% ` Neil Horman
@ 2014-09-26 15:41 0% ` Ananyev, Konstantin
2014-09-26 16:21 3% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Ananyev, Konstantin @ 2014-09-26 15:41 UTC (permalink / raw)
To: Neil Horman, Wodkowski, PawelX; +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman
> Sent: Friday, September 26, 2014 4:02 PM
> To: Wodkowski, PawelX
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe:
>
> On Fri, Sep 26, 2014 at 02:01:05PM +0000, Wodkowski, PawelX wrote:
> > > > > Maybe I don't see something obvious? :)
> > >
> > > I think you're missing the fact that your patch doesn't do what you assert above
> > > either :)
> >
> > Issue is not in setting alarms but canceling it. If you look closer to my patch you
> > see that it address this issue (look at added *do { lock(); ....; unlock(); } while( )*
> > part).
> >
> I get where the issue is, and I'm looking at your patch. I see that you did
> some locking there. The issue I'm pointing out is that, if you call
> rte_eal_alarm_cancel on an alarm callback, you will exit the alarm_cancel
> function with, by definition, one alarm executing (the one you are currently
> running). You're patch works perfectly for the case where another thread calls
> cancel, in that it waits until the executing alarm is complete, but it doesn't
> work in the case where you are calling it from within the alarm callback.
Hm, and why do we need it from alarm callback?
After cb_func() is finished given alarm entry will be removed anyway.
> If you're goal is to guarantee that all the matching alarms are cancelled and
> complete, you haven't done that, because the recursive state is still unhandled.
>
> > >
> > > First, lets address rte_alarm_set. There is no notion of "re-arming" in this
> > > alarm implementation, because theres no ability to refer to a specific alarm
> > > from the callers perspective. When you call rte_eal_alarm_set you get a new
> > > alarm every time. So I don't really see a race there. It might not be exactly
> > > the behavior you want, but its not a race, becuase you're not modifying an
> > > alarm
> > > in the middle of execution, you're just creating a new alarm, which is safe.
> >
> > OK, it is safe, but this is not the case.
> >
> I don't know what you mean by this. We agree its safe, great. But it is the
> case as I've described it, you can see it from the implementation, every call to
> rte_eal_alarm_set starts with a malloc of a new alarm structure.
>
> > >
> > > There is a race in what you describe above, insofar as its possible that you
> > > might call rte_eal_alarm_cancel and return without having canceled all the
> > > matching alarms. I don't see any clear documentation on what the behavior is
> > > supposed to be, but if you want to ensure that all matching alarms are cancelled
> > > or complete on return from rte_eal_alarm_cancel, thats perfectly fine (in linux
> > > API parlance, thats usually denoted as a cancel_sync operation).
> >
> > Again, look at the patch. I changed documentation to inform about this behavior.
> >
>
> This is the documentation included in the patch:
> Change alarm cancel function to thread-safe.
> It eliminates a race between threads using rte_alarm_cancel and
> rte_alarm_set.
>
> neither have you compeltely described the race condition (though you now have
> previously in this thread), nor have you completely addressed it (calling
> rte_eal_alarm_cancel and rte_eal_alarm_set still behaves exactly as it did
> previously with a 2nd thread).
>
> > >
> > > For that race condition, you're correct, my patch doesn't address it, I see that
> > > now. Though your patch doesn't either. If you call rte_eal_alarm_cancel from
> > > within a callback function, then, by definition, you can't wait on the
> > > completion of the active alarm, because thats a deadlock. Its a necessecary
> > > evil, I grant you, but it means that you can't be guaranteed the cancelled and
> > > complete (cancel_sync) behavior that you want, at least not with the current
> > > api. If you want that behavior, you need to do one of two things:
> >
> > This patch does not break any API. It only removes undefined behavior.
> >
> I never said it did break ABI. I said that to completely fix it you would have
> to break ABI. And it doesn't really remove undefined behavior, because you
> still have the old behavior in the recursive case (which you may be ok with, I
> don't know, but if you really want to address the behavior, you should address
> this aspect of it).
>
> > >
> > > 1) Modify the api to allow callers to individually reference timer instances, so
> > > that when cancelling, we can return an appropriate return code to indicate to
> > > the caller that this alarm is in-progress. That way you can guarantee the
> > > caller that the specific alarm that you cancelled is either complete and cancelled
> > > or currently executing. Add an api to expicitly wait on a referenced alarm as
> > > well. This allows developers to know that, when executing an alarm callback, an
> > > -ECURRENTLYEXECUTING return code is ok, because they are in the currently
> > > executing context.
> >
> > This would brake API for sure.
> Yes, it would. Bruce Richardson just made a major ABI break with his mbuf
> cleanup set. If there was a time to change ABI here, now would be the time I
> think.
Ok, too many words for me, to be honest :)
Can I summarise:
As I remember the purpose of the patch was to fix the race condition inside rte_alarm library.
I believe that the patch provided by Michal & Pawel fixes the issues you discovered.
If you think, that is not the case, could you please provide a list of remaining issues?
Excluding ones that you just don't like it, and you are not happy with rte_alarm API in total?
If you have any concerns about mbuf reorg/expansion - probably better to contact Bruce and express them.
Not to use it as an argument for breaking any existing API without really good reason behind.
Konstantin
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 1/4 v2] compat: Add infrastructure to support symbol versioning
2014-09-26 15:16 0% ` Neil Horman
@ 2014-09-26 15:33 0% ` Sergio Gonzalez Monroy
2014-09-26 16:22 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Sergio Gonzalez Monroy @ 2014-09-26 15:33 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Fri, Sep 26, 2014 at 11:16:30AM -0400, Neil Horman wrote:
> On Fri, Sep 26, 2014 at 03:16:08PM +0100, Sergio Gonzalez Monroy wrote:
> > On Thu, Sep 25, 2014 at 02:52:32PM -0400, Neil Horman wrote:
> > > Add initial pass header files to support symbol versioning.
> > >
> > > ---
> > > Change notes
> > > v2)
> > > * Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
> > > non-existant RTE_SYMBOL_VERSIONING
> > >
> > > * Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
> > > properly
> > >
> > > * Improved/Clarified documentation
> > >
> > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
> > > ---
> > > lib/Makefile | 1 +
> > > lib/librte_compat/Makefile | 38 ++++++++++++++++++
> > > lib/librte_compat/rte_compat.h | 87 ++++++++++++++++++++++++++++++++++++++++++
> > > mk/rte.lib.mk | 6 +++
> > > 4 files changed, 132 insertions(+)
> > > create mode 100644 lib/librte_compat/Makefile
> > > create mode 100644 lib/librte_compat/rte_compat.h
> > >
> > > diff --git a/lib/Makefile b/lib/Makefile
> > > index 10c5bb3..a85b55b 100644
> > > --- a/lib/Makefile
> > > +++ b/lib/Makefile
> > > @@ -32,6 +32,7 @@
> > > include $(RTE_SDK)/mk/rte.vars.mk
> > >
> > > DIRS-$(CONFIG_RTE_LIBC) += libc
> > > +DIRS-y += librte_compat
> > > DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> > > DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> > > DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> > > diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> > > new file mode 100644
> > > index 0000000..3415c7b
> > > --- /dev/null
> > > +++ b/lib/librte_compat/Makefile
> > > @@ -0,0 +1,38 @@
> > > +# BSD LICENSE
> > > +#
> > > +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
> > > +# All rights reserved.
> > > +#
> > > +# Redistribution and use in source and binary forms, with or without
> > > +# modification, are permitted provided that the following conditions
> > > +# are met:
> > > +#
> > > +# * Redistributions of source code must retain the above copyright
> > > +# notice, this list of conditions and the following disclaimer.
> > > +# * 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.
> > > +# * Neither the name of Intel Corporation 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
> > > +# OWNER 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.
> > > +
> > > +include $(RTE_SDK)/mk/rte.vars.mk
> > > +
> > > +
> > > +# install includes
> > > +SYMLINK-y-include := rte_compat.h
> > > +
> > > +include $(RTE_SDK)/mk/rte.lib.mk
> > > diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> > > new file mode 100644
> > > index 0000000..cff9aea
> > > --- /dev/null
> > > +++ b/lib/librte_compat/rte_compat.h
> > > @@ -0,0 +1,87 @@
> > > +/*-
> > > + * BSD LICENSE
> > > + *
> > > + * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
> > > + * All rights reserved.
> > > + *
> > > + * Redistribution and use in source and binary forms, with or without
> > > + * modification, are permitted provided that the following conditions
> > > + * are met:
> > > + *
> > > + * * Redistributions of source code must retain the above copyright
> > > + * notice, this list of conditions and the following disclaimer.
> > > + * * 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.
> > > + * * Neither the name of Intel Corporation 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
> > > + * OWNER 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.
> > > + */
> > > +
> > > +#ifndef _RTE_COMPAT_H_
> > > +#define _RTE_COMPAT_H_
> > > +
> > > +/*
> > > + * This is just a stringification macro for use below.
> > > + */
> > > +#define SA(x) #x
> > > +
> > > +#ifdef RTE_BUILD_SHARED_LIB
> > > +
> > > +/*
> > > + * Provides backwards compatibility when updating exported functions.
> > > + * When a symol is exported from a library to provide an API, it also provides a
> > > + * calling convention (ABI) that is embodied in its name, return type,
> > > + * arguments, etc. On occasion that function may need to change to accomodate
> > > + * new functionality, behavior, etc. When that occurs, it is desireable to
> > > + * allow for backwards compatibility for a time with older binaries that are
> > > + * dynamically linked to the dpdk. to support that the __vsym and
> > > + * VERSION_SYMBOL macros are created. They, in conjunction with the
> > > + * <library>_version.map file for a given library allow for multiple versions of
> > > + * a symbol to exist in a shared library so that older binaries need not be
> > > + * immediately recompiled. Their use is outlined in the following example:
> > > + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> > > + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> > > + *
> > > + * To accomplish this:
> > > + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> > > + * foo is exported as a global symbol. Note that foo must be removed from the
> > > + * DPDK.(X) node, or you will see multiple symbol definitions
> > > + *
> >
> > By removing the symbol from the previous node in the version map, you make
> > it local instead of global and applications linked against DPDK 1.8 will fail
> > with the new library.
> >
> It sounds like you just did the remove part, and not the add part. What does
> your new version map file look like?
>
> Neil
>
$ cat lib/librte_acl/rte_acl_version.map
DPDK_1.8 {
global:
rte_acl_find_existing;
rte_acl_free;
rte_acl_add_rules;
rte_acl_reset_rules;
rte_acl_build;
rte_acl_reset;
rte_acl_classify;
rte_acl_dump;
rte_acl_list_dump;
rte_acl_ipv4vlan_add_rules;
rte_acl_ipv4vlan_build;
rte_acl_classify_scalar;
rte_acl_classify_alg;
rte_acl_set_ctx_classify;
local: *;
};
DPDK_1.9 {
global:
rte_acl_create;
} DPDK_1.8;
Anyway, if the DPDK_1.9 node was not defined, the dso would not have the symbol:
rte_acl_create@@DPDK_1.9
Sergio
> > Following the steps you describe, if we create a new version of the function
> > rte_acl_create we would end up with the following dso:
> >
> > $ readelf -s x86_64-native-linuxapp-gcc/lib/librte_acl.so | grep "create\|\.symtab\|\.dynsym"
> > Symbol table '.dynsym' contains 42 entries:
> > 28: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create@@DPDK_1.9
> > Symbol table '.symtab' contains 147 entries:
> > 94: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create_v18
> > 105: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create@@DPDK_1.8
> > 138: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create
> >
> > You can check that applications linked with the old lib will fail to run.
> > Note that to easily check this you should define the environment variable
> > LD_BIND_NOW to resolve all symbols at program startup (man ld.so).
> >
> > Sergio
> >
> > > + * 2) rename the existing function int foo(char *string) to
> > > + * int __vsym foo_v18(char *string)
> > > + *
> > > + * 3) Add this macro immediately below the function
> > > + * VERSION_SYMBOL(foo, _v18, 1.8);
> > > + *
> > > + */
> > > +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
> > > +#define __vsym __attribute__((used))
> > > +
> > > +#else
> > > +/*
> > > + * No symbol versioning in use
> > > + */
> > > +#define VERSION_SYMBOL(b, e, v)
> > > +#define __vsym
> > > +
> > > +/*
> > > + * RTE_BUILD_SHARED_LIB
> > > + */
> > > +#endif
> > > +
> > > +
> > > +#endif /* _RTE_COMPAT_H_ */
> > > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> > > index f458258..82ac309 100644
> > > --- a/mk/rte.lib.mk
> > > +++ b/mk/rte.lib.mk
> > > @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
> > >
> > > ifeq ($(RTE_BUILD_SHARED_LIB),y)
> > > LIB := $(patsubst %.a,%.so,$(LIB))
> > > +
> > > +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> > > +
> > > endif
> > >
> > > +
> > > _BUILD = $(LIB)
> > > _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> > > _CLEAN = doclean
> > > @@ -160,7 +164,9 @@ endif
> > > $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> > > @echo " INSTALL-LIB $(LIB)"
> > > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> > > +ifneq ($(LIB),)
> > > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> > > +endif
> > >
> > > #
> > > # Clean all generated files
> > > --
> > > 1.9.3
> > >
> >
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 1/4 v2] compat: Add infrastructure to support symbol versioning
2014-09-26 14:16 0% ` Sergio Gonzalez Monroy
@ 2014-09-26 15:16 0% ` Neil Horman
2014-09-26 15:33 0% ` Sergio Gonzalez Monroy
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-26 15:16 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
On Fri, Sep 26, 2014 at 03:16:08PM +0100, Sergio Gonzalez Monroy wrote:
> On Thu, Sep 25, 2014 at 02:52:32PM -0400, Neil Horman wrote:
> > Add initial pass header files to support symbol versioning.
> >
> > ---
> > Change notes
> > v2)
> > * Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
> > non-existant RTE_SYMBOL_VERSIONING
> >
> > * Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
> > properly
> >
> > * Improved/Clarified documentation
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
> > ---
> > lib/Makefile | 1 +
> > lib/librte_compat/Makefile | 38 ++++++++++++++++++
> > lib/librte_compat/rte_compat.h | 87 ++++++++++++++++++++++++++++++++++++++++++
> > mk/rte.lib.mk | 6 +++
> > 4 files changed, 132 insertions(+)
> > create mode 100644 lib/librte_compat/Makefile
> > create mode 100644 lib/librte_compat/rte_compat.h
> >
> > diff --git a/lib/Makefile b/lib/Makefile
> > index 10c5bb3..a85b55b 100644
> > --- a/lib/Makefile
> > +++ b/lib/Makefile
> > @@ -32,6 +32,7 @@
> > include $(RTE_SDK)/mk/rte.vars.mk
> >
> > DIRS-$(CONFIG_RTE_LIBC) += libc
> > +DIRS-y += librte_compat
> > DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> > DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> > DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> > diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> > new file mode 100644
> > index 0000000..3415c7b
> > --- /dev/null
> > +++ b/lib/librte_compat/Makefile
> > @@ -0,0 +1,38 @@
> > +# BSD LICENSE
> > +#
> > +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
> > +# All rights reserved.
> > +#
> > +# Redistribution and use in source and binary forms, with or without
> > +# modification, are permitted provided that the following conditions
> > +# are met:
> > +#
> > +# * Redistributions of source code must retain the above copyright
> > +# notice, this list of conditions and the following disclaimer.
> > +# * 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.
> > +# * Neither the name of Intel Corporation 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
> > +# OWNER 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.
> > +
> > +include $(RTE_SDK)/mk/rte.vars.mk
> > +
> > +
> > +# install includes
> > +SYMLINK-y-include := rte_compat.h
> > +
> > +include $(RTE_SDK)/mk/rte.lib.mk
> > diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> > new file mode 100644
> > index 0000000..cff9aea
> > --- /dev/null
> > +++ b/lib/librte_compat/rte_compat.h
> > @@ -0,0 +1,87 @@
> > +/*-
> > + * BSD LICENSE
> > + *
> > + * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
> > + * All rights reserved.
> > + *
> > + * Redistribution and use in source and binary forms, with or without
> > + * modification, are permitted provided that the following conditions
> > + * are met:
> > + *
> > + * * Redistributions of source code must retain the above copyright
> > + * notice, this list of conditions and the following disclaimer.
> > + * * 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.
> > + * * Neither the name of Intel Corporation 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
> > + * OWNER 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.
> > + */
> > +
> > +#ifndef _RTE_COMPAT_H_
> > +#define _RTE_COMPAT_H_
> > +
> > +/*
> > + * This is just a stringification macro for use below.
> > + */
> > +#define SA(x) #x
> > +
> > +#ifdef RTE_BUILD_SHARED_LIB
> > +
> > +/*
> > + * Provides backwards compatibility when updating exported functions.
> > + * When a symol is exported from a library to provide an API, it also provides a
> > + * calling convention (ABI) that is embodied in its name, return type,
> > + * arguments, etc. On occasion that function may need to change to accomodate
> > + * new functionality, behavior, etc. When that occurs, it is desireable to
> > + * allow for backwards compatibility for a time with older binaries that are
> > + * dynamically linked to the dpdk. to support that the __vsym and
> > + * VERSION_SYMBOL macros are created. They, in conjunction with the
> > + * <library>_version.map file for a given library allow for multiple versions of
> > + * a symbol to exist in a shared library so that older binaries need not be
> > + * immediately recompiled. Their use is outlined in the following example:
> > + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> > + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> > + *
> > + * To accomplish this:
> > + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> > + * foo is exported as a global symbol. Note that foo must be removed from the
> > + * DPDK.(X) node, or you will see multiple symbol definitions
> > + *
>
> By removing the symbol from the previous node in the version map, you make
> it local instead of global and applications linked against DPDK 1.8 will fail
> with the new library.
>
It sounds like you just did the remove part, and not the add part. What does
your new version map file look like?
Neil
> Following the steps you describe, if we create a new version of the function
> rte_acl_create we would end up with the following dso:
>
> $ readelf -s x86_64-native-linuxapp-gcc/lib/librte_acl.so | grep "create\|\.symtab\|\.dynsym"
> Symbol table '.dynsym' contains 42 entries:
> 28: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create@@DPDK_1.9
> Symbol table '.symtab' contains 147 entries:
> 94: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create_v18
> 105: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create@@DPDK_1.8
> 138: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create
>
> You can check that applications linked with the old lib will fail to run.
> Note that to easily check this you should define the environment variable
> LD_BIND_NOW to resolve all symbols at program startup (man ld.so).
>
> Sergio
>
> > + * 2) rename the existing function int foo(char *string) to
> > + * int __vsym foo_v18(char *string)
> > + *
> > + * 3) Add this macro immediately below the function
> > + * VERSION_SYMBOL(foo, _v18, 1.8);
> > + *
> > + */
> > +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
> > +#define __vsym __attribute__((used))
> > +
> > +#else
> > +/*
> > + * No symbol versioning in use
> > + */
> > +#define VERSION_SYMBOL(b, e, v)
> > +#define __vsym
> > +
> > +/*
> > + * RTE_BUILD_SHARED_LIB
> > + */
> > +#endif
> > +
> > +
> > +#endif /* _RTE_COMPAT_H_ */
> > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> > index f458258..82ac309 100644
> > --- a/mk/rte.lib.mk
> > +++ b/mk/rte.lib.mk
> > @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
> >
> > ifeq ($(RTE_BUILD_SHARED_LIB),y)
> > LIB := $(patsubst %.a,%.so,$(LIB))
> > +
> > +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> > +
> > endif
> >
> > +
> > _BUILD = $(LIB)
> > _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> > _CLEAN = doclean
> > @@ -160,7 +164,9 @@ endif
> > $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> > @echo " INSTALL-LIB $(LIB)"
> > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> > +ifneq ($(LIB),)
> > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> > +endif
> >
> > #
> > # Clean all generated files
> > --
> > 1.9.3
> >
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe:
@ 2014-09-26 15:01 5% ` Neil Horman
2014-09-26 15:41 0% ` Ananyev, Konstantin
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-26 15:01 UTC (permalink / raw)
To: Wodkowski, PawelX; +Cc: dev
On Fri, Sep 26, 2014 at 02:01:05PM +0000, Wodkowski, PawelX wrote:
> > > > Maybe I don't see something obvious? :)
> >
> > I think you're missing the fact that your patch doesn't do what you assert above
> > either :)
>
> Issue is not in setting alarms but canceling it. If you look closer to my patch you
> see that it address this issue (look at added *do { lock(); ....; unlock(); } while( )*
> part).
>
I get where the issue is, and I'm looking at your patch. I see that you did
some locking there. The issue I'm pointing out is that, if you call
rte_eal_alarm_cancel on an alarm callback, you will exit the alarm_cancel
function with, by definition, one alarm executing (the one you are currently
running). You're patch works perfectly for the case where another thread calls
cancel, in that it waits until the executing alarm is complete, but it doesn't
work in the case where you are calling it from within the alarm callback. If
you're goal is to guarantee that all the matching alarms are cancelled and
complete, you haven't done that, because the recursive state is still unhandled.
> >
> > First, lets address rte_alarm_set. There is no notion of "re-arming" in this
> > alarm implementation, because theres no ability to refer to a specific alarm
> > from the callers perspective. When you call rte_eal_alarm_set you get a new
> > alarm every time. So I don't really see a race there. It might not be exactly
> > the behavior you want, but its not a race, becuase you're not modifying an
> > alarm
> > in the middle of execution, you're just creating a new alarm, which is safe.
>
> OK, it is safe, but this is not the case.
>
I don't know what you mean by this. We agree its safe, great. But it is the
case as I've described it, you can see it from the implementation, every call to
rte_eal_alarm_set starts with a malloc of a new alarm structure.
> >
> > There is a race in what you describe above, insofar as its possible that you
> > might call rte_eal_alarm_cancel and return without having canceled all the
> > matching alarms. I don't see any clear documentation on what the behavior is
> > supposed to be, but if you want to ensure that all matching alarms are cancelled
> > or complete on return from rte_eal_alarm_cancel, thats perfectly fine (in linux
> > API parlance, thats usually denoted as a cancel_sync operation).
>
> Again, look at the patch. I changed documentation to inform about this behavior.
>
This is the documentation included in the patch:
Change alarm cancel function to thread-safe.
It eliminates a race between threads using rte_alarm_cancel and
rte_alarm_set.
neither have you compeltely described the race condition (though you now have
previously in this thread), nor have you completely addressed it (calling
rte_eal_alarm_cancel and rte_eal_alarm_set still behaves exactly as it did
previously with a 2nd thread).
> >
> > For that race condition, you're correct, my patch doesn't address it, I see that
> > now. Though your patch doesn't either. If you call rte_eal_alarm_cancel from
> > within a callback function, then, by definition, you can't wait on the
> > completion of the active alarm, because thats a deadlock. Its a necessecary
> > evil, I grant you, but it means that you can't be guaranteed the cancelled and
> > complete (cancel_sync) behavior that you want, at least not with the current
> > api. If you want that behavior, you need to do one of two things:
>
> This patch does not break any API. It only removes undefined behavior.
>
I never said it did break ABI. I said that to completely fix it you would have
to break ABI. And it doesn't really remove undefined behavior, because you
still have the old behavior in the recursive case (which you may be ok with, I
don't know, but if you really want to address the behavior, you should address
this aspect of it).
> >
> > 1) Modify the api to allow callers to individually reference timer instances, so
> > that when cancelling, we can return an appropriate return code to indicate to
> > the caller that this alarm is in-progress. That way you can guarantee the
> > caller that the specific alarm that you cancelled is either complete and cancelled
> > or currently executing. Add an api to expicitly wait on a referenced alarm as
> > well. This allows developers to know that, when executing an alarm callback, an
> > -ECURRENTLYEXECUTING return code is ok, because they are in the currently
> > executing context.
>
> This would brake API for sure.
Yes, it would. Bruce Richardson just made a major ABI break with his mbuf
cleanup set. If there was a time to change ABI here, now would be the time I
think.
Neil
>
>
^ permalink raw reply [relevance 5%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-26 10:41 0% ` Thomas Monjalon
@ 2014-09-26 14:45 5% ` Neil Horman
2014-09-26 22:02 4% ` Stephen Hemminger
2014-10-01 18:59 0% ` Neil Horman
0 siblings, 2 replies; 200+ results
From: Neil Horman @ 2014-09-26 14:45 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Fri, Sep 26, 2014 at 12:41:33PM +0200, Thomas Monjalon wrote:
> Hi Neil,
>
> 2014-09-24 14:19, Neil Horman:
> > Ping Thomas. I know you're busy, but I would like this to not fall off anyones
> > radar. You alluded to concerns regarding what, for lack of a better term,
> > ABI/API lockin. I had asked you to enuumerate/elaborate on specifics, but never
> > heard back. Are there further specifics you wish to discuss, or are you
> > satisfied with the above answers?
>
> Sorry for not being very reactive on this thread.
> All this discussion is very interesting but it's really not the proper
> time to apply it. As you said, it requires an extra effort. I'm not saying
> it will never be integrated. I'm just saying that we cannot change
> everything at the same time.
>
> Let me sum up the situation. This community project has been very active
> for few months now. First, we learnt how to make some releases together
> and we are improving the process to be able to deliver a new major release
> every 4 months while having some good quality process.
> But these releases are still not complete because documentation is not
> integrated yet. Then developers should have a role in documentation updates.
> We also need to integrate and learn how to use more tools to be more
> efficient and improve quality.
>
> So the question is "when should we care about API compatibility"?
> And the answer is: ASAP, but not now. I feel next year is a better target.
> Because the most important priority is to move together at a pace which
> allow most of us to stay in the race.
>
I'm sorry Thomas, I don't accept this. I asked you for details as to your
concerns regarding this patch series, and you've provided more vague comments.
I need details to address
You say it requires extra effort, you're right it does. Any feature that you
integreate requires some additional effort. How is this patch any different
from adding the acl library or any other new API? Everything requires
maintenence, thats how software works. What specfically about this patch series
makes the effort insurmountable to you?
You say you're improving your process. Great, this patch aids in that process
by ensuring backwards compatibility for a period of time. Given that the API
and ABI can still evolve within this framework, as I've described, how is this
patch series not a significant step forward toward your goal of quality process.
You say documentation isn't integrated. So, what does getting documentation
integrated have to do with this patch set, or any other? I don't see you
holding any other patches based on documentation. Again, nothing in this series
prevents evolution of the API or ABI. If you're hope is to wait until
everything is perfect, then apply some control to the public facing API, and get
it all documented, none of thosse things will ever happen, I promise you.
You say you also need to learn to use more tools to be more efficient and
improve quality. Great! Thats exactly what this is. If we mandate even a short
term commitment to ABI stability (1 single relese worth of time), we will
quickly identify what API's change quickly and where we need to be cautious with
our API design. If you just assume that developers will get better of their own
volition, it will never happen.
You say this should go in next year, but not now. When exactly? What event do
you forsee occuring in the next 12-18 months that will change everything such
that we can start supporing an ABI for more than just a few weeks at the head of
the tree?
To this end, I just did a quick search through the git history for dpdk to look
at the histories of all the header files that are exposed via the makefile
SYMLINK command (given that that provides a list of header files that
applications can include, and embodies all the function symbols and data types
applications have access to.
There are 179 total commits in that list
Of those, a bit of spot checking suggests that about 10-15% of them actually
change ABI, and many of those came from Bruce's rework of the mbuf structure.
That about 17-20 instances over the last 2 years where an ABI update would have
been needed. That seems pretty reasonable to me. Where exactly is your concern
here?
Neil
> --
> Thomas
>
^ permalink raw reply [relevance 5%]
* Re: [dpdk-dev] [PATCH 1/4 v2] compat: Add infrastructure to support symbol versioning
2014-09-25 18:52 4% ` [dpdk-dev] [PATCH 1/4 v2] " Neil Horman
@ 2014-09-26 14:16 0% ` Sergio Gonzalez Monroy
2014-09-26 15:16 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Sergio Gonzalez Monroy @ 2014-09-26 14:16 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Thu, Sep 25, 2014 at 02:52:32PM -0400, Neil Horman wrote:
> Add initial pass header files to support symbol versioning.
>
> ---
> Change notes
> v2)
> * Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
> non-existant RTE_SYMBOL_VERSIONING
>
> * Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
> properly
>
> * Improved/Clarified documentation
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
> ---
> lib/Makefile | 1 +
> lib/librte_compat/Makefile | 38 ++++++++++++++++++
> lib/librte_compat/rte_compat.h | 87 ++++++++++++++++++++++++++++++++++++++++++
> mk/rte.lib.mk | 6 +++
> 4 files changed, 132 insertions(+)
> create mode 100644 lib/librte_compat/Makefile
> create mode 100644 lib/librte_compat/rte_compat.h
>
> diff --git a/lib/Makefile b/lib/Makefile
> index 10c5bb3..a85b55b 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -32,6 +32,7 @@
> include $(RTE_SDK)/mk/rte.vars.mk
>
> DIRS-$(CONFIG_RTE_LIBC) += libc
> +DIRS-y += librte_compat
> DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> new file mode 100644
> index 0000000..3415c7b
> --- /dev/null
> +++ b/lib/librte_compat/Makefile
> @@ -0,0 +1,38 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +# notice, this list of conditions and the following disclaimer.
> +# * 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.
> +# * Neither the name of Intel Corporation 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
> +# OWNER 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.
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +
> +# install includes
> +SYMLINK-y-include := rte_compat.h
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> new file mode 100644
> index 0000000..cff9aea
> --- /dev/null
> +++ b/lib/librte_compat/rte_compat.h
> @@ -0,0 +1,87 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#ifndef _RTE_COMPAT_H_
> +#define _RTE_COMPAT_H_
> +
> +/*
> + * This is just a stringification macro for use below.
> + */
> +#define SA(x) #x
> +
> +#ifdef RTE_BUILD_SHARED_LIB
> +
> +/*
> + * Provides backwards compatibility when updating exported functions.
> + * When a symol is exported from a library to provide an API, it also provides a
> + * calling convention (ABI) that is embodied in its name, return type,
> + * arguments, etc. On occasion that function may need to change to accomodate
> + * new functionality, behavior, etc. When that occurs, it is desireable to
> + * allow for backwards compatibility for a time with older binaries that are
> + * dynamically linked to the dpdk. to support that the __vsym and
> + * VERSION_SYMBOL macros are created. They, in conjunction with the
> + * <library>_version.map file for a given library allow for multiple versions of
> + * a symbol to exist in a shared library so that older binaries need not be
> + * immediately recompiled. Their use is outlined in the following example:
> + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> + *
> + * To accomplish this:
> + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
> + * foo is exported as a global symbol. Note that foo must be removed from the
> + * DPDK.(X) node, or you will see multiple symbol definitions
> + *
By removing the symbol from the previous node in the version map, you make
it local instead of global and applications linked against DPDK 1.8 will fail
with the new library.
Following the steps you describe, if we create a new version of the function
rte_acl_create we would end up with the following dso:
$ readelf -s x86_64-native-linuxapp-gcc/lib/librte_acl.so | grep "create\|\.symtab\|\.dynsym"
Symbol table '.dynsym' contains 42 entries:
28: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create@@DPDK_1.9
Symbol table '.symtab' contains 147 entries:
94: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create_v18
105: 0000000000001960 36 FUNC LOCAL DEFAULT 12 rte_acl_create@@DPDK_1.8
138: 0000000000001990 627 FUNC GLOBAL DEFAULT 12 rte_acl_create
You can check that applications linked with the old lib will fail to run.
Note that to easily check this you should define the environment variable
LD_BIND_NOW to resolve all symbols at program startup (man ld.so).
Sergio
> + * 2) rename the existing function int foo(char *string) to
> + * int __vsym foo_v18(char *string)
> + *
> + * 3) Add this macro immediately below the function
> + * VERSION_SYMBOL(foo, _v18, 1.8);
> + *
> + */
> +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
> +#define __vsym __attribute__((used))
> +
> +#else
> +/*
> + * No symbol versioning in use
> + */
> +#define VERSION_SYMBOL(b, e, v)
> +#define __vsym
> +
> +/*
> + * RTE_BUILD_SHARED_LIB
> + */
> +#endif
> +
> +
> +#endif /* _RTE_COMPAT_H_ */
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> index f458258..82ac309 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
>
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> LIB := $(patsubst %.a,%.so,$(LIB))
> +
> +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> +
> endif
>
> +
> _BUILD = $(LIB)
> _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> _CLEAN = doclean
> @@ -160,7 +164,9 @@ endif
> $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> @echo " INSTALL-LIB $(LIB)"
> @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> +ifneq ($(LIB),)
> $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> +endif
>
> #
> # Clean all generated files
> --
> 1.9.3
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe:
@ 2014-09-26 13:43 3% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-09-26 13:43 UTC (permalink / raw)
To: Wodkowski, PawelX; +Cc: dev
On Fri, Sep 26, 2014 at 06:33:12AM +0000, Wodkowski, PawelX wrote:
> > Given what you said above, I agree, at least in the current implementation. It
> > still seems like theres a simpler solution that doesn't require all the
> > comparative gymnastics.
>
> Yes, there is simpler solution, but this solution involve recursive locking.
> DPDK recursive spinlocks are no an option in here, so only option is posix recursive
> mutex, which I think is even worst option than this gymnastics.
>
I agree, lets avoid more locking if we can.
> >
> > What if, instead of testing if you're the callback thread, we turn the executing
> > field of alarm_entry into a bitfield, where bit 0 represents the former
> > "executing" state, and bit 1 is defined as a "cancelled" bit. Then
> > rte_eal_alarm_cancel becomes a search that, when an alarm is found simply or's
> > in the cancelled bit to the executing bit field. When the callback thread runs,
> > it skips executing any alarm that is marked as cancelled, but frees all alarm
> > entries that are executed or cancelled. That gives us a single point at which
> > frees of alarm entires happen? Something like the patch below (completely
> > untested)?
> >
> > It also seems like the alarm api as a whole could use some improvement. The
> > way its written right now, theres no way to refer to a specific alarm (i.e.
> > cancelation relies on the specification of a function and data pointer, which
> > may refer to multiple timers). Shouldn't rte_eal_alarm_set return an opaque
> > handle to a unique timer instance that can be store by a caller and used to
> > specfically cancel that timer? Thats how both the bsd and linux timer
> > subsystems model timers.
> >
>
> Goal was to not break user applications that use this library.
>
You break API all the time, why are you worried about it here? I'm all for
maintaining API definately, but once my ABI versioning code gets into place we
can manage this alot better.
> >
> >
> > diff --git a/lib/librte_eal/linuxapp/eal/eal_alarm.c
> > b/lib/librte_eal/linuxapp/eal/eal_alarm.c
> > index 480f0cb..73b6dc5 100644
> > --- a/lib/librte_eal/linuxapp/eal/eal_alarm.c
> > +++ b/lib/librte_eal/linuxapp/eal/eal_alarm.c
> > @@ -64,6 +64,9 @@
> > #define MS_PER_S 1000
> > #define US_PER_S (US_PER_MS * MS_PER_S)
> >
> > +#define ALARM_EXECUTING (1 << 0)
> > +#define ALARM_CANCELLED (1 << 1)
> > +
> > struct alarm_entry {
> > LIST_ENTRY(alarm_entry) next;
> > struct timeval time;
> > @@ -107,12 +110,14 @@ eal_alarm_callback(struct rte_intr_handle *hdl
> > __rte_unused,
> > gettimeofday(&now, NULL) == 0 &&
> > (ap->time.tv_sec < now.tv_sec || (ap->time.tv_sec ==
> > now.tv_sec &&
> > ap->time.tv_usec <=
> > now.tv_usec))){
> > - ap->executing = 1;
> > - rte_spinlock_unlock(&alarm_list_lk);
>
> Removing unlock here introduce deadlock.
>
Please look more closely, I've not removed anything, only moved where the lock
occurs.
> > + ap->executing |= ALARM_EXECUTING;
> > + if (likely(!(ap->executing & ALARM_CANCELLED)) {
> > + rte_spinlock_unlock(&alarm_list_lk);
The unlock is now here, conditional on needing to call the callback.
> >
> > - ap->cb_fn(ap->cb_arg);
> > + ap->cb_fn(ap->cb_arg);
> >
> > - rte_spinlock_lock(&alarm_list_lk);
> > + rte_spinlock_lock(&alarm_list_lk);
> > + }
> > LIST_REMOVE(ap, next);
> > rte_free(ap);
> > }
> > @@ -209,10 +214,9 @@ rte_eal_alarm_cancel(rte_eal_alarm_callback cb_fn,
> > void *cb_arg)
> > rte_spinlock_lock(&alarm_list_lk);
> > /* remove any matches at the start of the list */
> > while ((ap = LIST_FIRST(&alarm_list)) != NULL &&
> > - cb_fn == ap->cb_fn && ap->executing == 0 &&
> > + cb_fn == ap->cb_fn &&
> > (cb_arg == (void *)-1 || cb_arg == ap->cb_arg)) {
> > - LIST_REMOVE(ap, next);
> > - rte_free(ap);
> > + ap->executing |= ALARM_CANCELLED;
> > count++;
> > }
> > ap_prev = ap;
> > @@ -220,10 +224,9 @@ rte_eal_alarm_cancel(rte_eal_alarm_callback cb_fn,
> > void *cb_arg)
> > /* now go through list, removing entries not at start */
> > LIST_FOREACH(ap, &alarm_list, next) {
> > /* this won't be true first time through */
> > - if (cb_fn == ap->cb_fn && ap->executing == 0 &&
> > + if (cb_fn == ap->cb_fn &&
> > (cb_arg == (void *)-1 || cb_arg == ap->cb_arg))
> > {
> > - LIST_REMOVE(ap,next);
> > - rte_free(ap);
> > + ap->executing |= ALARM_CANCELLED;
> > count++;
> > ap = ap_prev;
> > }
>
> Pawel
>
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-24 18:19 3% ` Neil Horman
@ 2014-09-26 10:41 0% ` Thomas Monjalon
2014-09-26 14:45 5% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2014-09-26 10:41 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Hi Neil,
2014-09-24 14:19, Neil Horman:
> Ping Thomas. I know you're busy, but I would like this to not fall off anyones
> radar. You alluded to concerns regarding what, for lack of a better term,
> ABI/API lockin. I had asked you to enuumerate/elaborate on specifics, but never
> heard back. Are there further specifics you wish to discuss, or are you
> satisfied with the above answers?
Sorry for not being very reactive on this thread.
All this discussion is very interesting but it's really not the proper
time to apply it. As you said, it requires an extra effort. I'm not saying
it will never be integrated. I'm just saying that we cannot change
everything at the same time.
Let me sum up the situation. This community project has been very active
for few months now. First, we learnt how to make some releases together
and we are improving the process to be able to deliver a new major release
every 4 months while having some good quality process.
But these releases are still not complete because documentation is not
integrated yet. Then developers should have a role in documentation updates.
We also need to integrate and learn how to use more tools to be more
efficient and improve quality.
So the question is "when should we care about API compatibility"?
And the answer is: ASAP, but not now. I feel next year is a better target.
Because the most important priority is to move together at a pace which
allow most of us to stay in the race.
--
Thomas
^ permalink raw reply [relevance 0%]
* [dpdk-dev] [PATCH 1/4 v2] compat: Add infrastructure to support symbol versioning
2014-09-15 19:23 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-09-23 10:39 0% ` Sergio Gonzalez Monroy
@ 2014-09-25 18:52 4% ` Neil Horman
2014-09-26 14:16 0% ` Sergio Gonzalez Monroy
2014-09-29 15:44 3% ` [dpdk-dev] [PATCH 1/4 v3] " Neil Horman
2014-09-30 15:18 3% ` [dpdk-dev] [PATCH 1/4 v4] " Neil Horman
3 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-25 18:52 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
---
Change notes
v2)
* Fixed ifdef in rte_compat.h to test for RTE_BUILD_SHARED_LIB instead of the
non-existant RTE_SYMBOL_VERSIONING
* Fixed VERSION_SYMBOL macro to add the needed extra @ to make versioning work
properly
* Improved/Clarified documentation
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
CC: "Gonzalez Monroy, Sergio" <sergio.gonzalez.monroy@intel.com>
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 ++++++++++++++++++
lib/librte_compat/rte_compat.h | 87 ++++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 6 +++
4 files changed, 132 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 10c5bb3..a85b55b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -32,6 +32,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
DIRS-$(CONFIG_RTE_LIBC) += libc
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..3415c7b
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..cff9aea
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,87 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Neil Horman <nhorman@tuxdriver.com>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+
+/*
+ * This is just a stringification macro for use below.
+ */
+#define SA(x) #x
+
+#ifdef RTE_BUILD_SHARED_LIB
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. to support that the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.(X+1) node, in which
+ * foo is exported as a global symbol. Note that foo must be removed from the
+ * DPDK.(X) node, or you will see multiple symbol definitions
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ */
+#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+
+/*
+ * RTE_BUILD_SHARED_LIB
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index f458258..82ac309 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
@@ -160,7 +164,9 @@ endif
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
+ifneq ($(LIB),)
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+endif
#
# Clean all generated files
--
1.9.3
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-18 19:14 4% ` Neil Horman
2014-09-19 8:57 0% ` Richardson, Bruce
2014-09-19 14:18 0% ` Venkatesan, Venky
@ 2014-09-24 18:19 3% ` Neil Horman
2014-09-26 10:41 0% ` Thomas Monjalon
2 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-24 18:19 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Thu, Sep 18, 2014 at 03:14:01PM -0400, Neil Horman wrote:
> On Thu, Sep 18, 2014 at 08:23:36PM +0200, Thomas Monjalon wrote:
> > Hi Neil,
> >
> > 2014-09-15 15:23, Neil Horman:
> > > The DPDK ABI develops and changes quickly, which makes it difficult for
> > > applications to keep up with the latest version of the library, especially when
> > > it (the DPDK) is built as a set of shared objects, as applications may be built
> > > against an older version of the library.
> > >
> > > To mitigate this, this patch series introduces support for library and symbol
> > > versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
> > >
> > > 1) Adds initial support for library versioning. Each library now has a version
> > > map that explicitly calls out what symbols are exported to using applications,
> > > and assigns version(s) to them
> > >
> > > 2) Adds support macros so that when libraries create incompatible ABI's,
> > > multiple versions may be supported so that applications linked against older
> > > DPDK releases can continue to function
> > >
> > > 3) Adds library soname versioning suffixes so that when ABI's must be broken in
> > > a fashion that requires a rebuild of older applications, they will break at load
> > > time, rather than cause unexpected issues at run time.
> > >
> > > 4) Adds documentation for ABI policy, and provides space to document deprecated
> > > ABI versions, so that applications might be warned of impending changes.
> > >
> > > With these elements in place the DPDK has some support to allow for the extended
> > > maintenence of older API's while still allowing the freedom to develop new and
> > > improved API's.
> > >
> > > Implementing this feature will require some additional effort on the part of
> > > developers and reviewers. When reviewing patches, must be checked against
> > > existing exports to ensure that the function prototypes are not changing. If
> > > they are, the versioning macros must be used, and the library export map should
> > > be updated to reflect the new version of the function.
> > >
> > > When data structures change, if those structures are application accessible,
> > > apis that accept or return instances of those data structures should have new
> > > versions created so that users of the old data structure version might co-exist
> > > at the same time.
> >
> > Thanks for your efforts.
> > But I feel this change has too many constraints for the current status of
> > the DPDK. It's probably too early to adopt such policy.
> >
> I think you may be misunderstanding something. What constraints do you beleive
> that this patch imposes? Note it doesn't in any way prevent changes to the ABI
> of the DPDK, but rather gives us infrastructure to support multiple ABI
> revisions at the same time, so that applications built against DPDK shared
> libraries can continue to function properly at least for some time until we
> decide to deprecate that ABI level.
>
> This is all based on the versioning strategy outlined here:
> http://www.akkadia.org/drepper/dsohowto.pdf
>
> That may help clarify things for you.
>
> > By the way, this versioning doesn't cover structure changes.
> No, it doesn't. No link-time mechanism does so.
>
> > How could it be managed?
> Thats a subject that is open to discussion, but my initial thinking is that we
> need to handle it on a case by case basis:
>
> * For minor updates, where allocation of a structure is done on the heap and new
> fields need to be added, appending them to the end of a structure and providing
> an initial value is sufficient.
>
> * For major changes, where fields need to be removed, or re-arranged, mostly
> likely the API surfaces which accept or return those structures as
> inputs/outputs will need to have new versions written to accept the new version
> of the structure, and internally we will have to support both formats for a time
> (according to the policy I documented, that is currently a single major
> release). I.e. if you want to change struct foo, which is accepted as a
> parameter for the function bar(struct foo *ptr), then for a release we would
> need to create struct foo_v2 with the new format, map a new function foo_v2 to
> the exported foo@@DPDK_1.(X+1), and internally make the foo functions understand
> both the origional and v2 versions of the structure. Then in DPDK release
> 1.X+2, we can remove the old version after posting a deprecation notice with
> version 1.(X+1)
>
> > Don't you think it would be more reliable if managed by packaging?
> Solving this with packaging defeats the purpose of having shared libraries at
> all. While packaging each version of the dpdk separately is possible stopgap
> solution, in that it allows applications to link to differing versions of the
> library independently, but that negates any expectation of timely bugfixes for
> any given version of the DPDK. That is to say, if you package things this way,
> and wind up with several parallel versions of the same package, and for any
> bugfix that comes out upstream, the packager then has the responsibility to
> adapt that fix to each package. Thats an unscalable solution, and not something
> any packager is going to undertake willingly. I did a hybrid version of this in
> fedora for exactly that reason. I packaged the dpdk into its own directory, but
> have every intention of changing that directory every major release, so that
> application writers can clearly see when they need to stop updating the dpdk,
> lest their applications stop linking. I'm not going to have multiple dpdk
> packages to maintain in parallel, thats just too much work.
>
> >
> > Thank you for opening this discussion with a constructive proposal.
> > Let's check it later on once structures will be more stable since
> > performance is the most critical target.
> If I'm being honest, I have to say thats a cop out answer. We all know that
> structure stability isn't a priority for the DPDK, nor will it ever be in all
> likelyhood. It will continue to evolve and grow as the hardware does. And this
> patch set doesn't prevent that from happening. All it does is provide some
> level of stability in the API for a period of time to let 3rd party application
> writers write and package applications with some allowance of time to keep up
> with upstream changes on their own schedule.
>
> I grant you that writing a good API for a shared library is difficult, but
> (and feel free to disagree with this), if we don't start enforcing policies that
> require good API design, its not going to happen on its own. This patch set
> will highlight those API points which are difficult to maintain accross major
> releases, and force us to address and improve them. To that end I've already
> begun talking to some of the individual library maintainers off list to address
> some of the API aspects that I have concerns about (exporting variable rather
> than accessor functions, structures that don't need to be visible to users,
> etc), and they've started reviewing them. We can make this better, but we can't
> just say later, because theres no roadmap that lists structure stability as a
> line item. As hardware improves, structures will change to operate more
> efficiently or support more features. Without a hard plan, the initial goals of
> the DPDK (high performance networking) will relegate ABI to such a low priority
> that it will never be addressed.
>
> To that end, can we discuss specifics? Can you ennumerate direct points that
> you feel make this patch unworkable at this time? I know you mentioned some
> above, and I think I addressed them (though please ask follow up questions if
> I've been unclear). What other concerns do you have?
>
> Neil
>
>
Ping Thomas. I know you're busy, but I would like this to not fall off anyones
radar. You alluded to concerns regarding what, for lack of a better term,
ABI/API lockin. I had asked you to enuumerate/elaborate on specifics, but never
heard back. Are there further specifics you wish to discuss, or are you
satisfied with the above answers?
Best
Neil
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning
2014-09-23 16:29 0% ` Sergio Gonzalez Monroy
@ 2014-09-23 17:31 0% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-09-23 17:31 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
On Tue, Sep 23, 2014 at 05:29:48PM +0100, Sergio Gonzalez Monroy wrote:
> On Tue, Sep 23, 2014 at 10:58:29AM -0400, Neil Horman wrote:
> > On Tue, Sep 23, 2014 at 11:39:29AM +0100, Sergio Gonzalez Monroy wrote:
> > > Hi Neil,
> > >
> > > On Mon, Sep 15, 2014 at 03:23:48PM -0400, Neil Horman wrote:
> > > > Add initial pass header files to support symbol versioning.
> > > >
> > > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > > ---
> > > > lib/Makefile | 1 +
> > > > lib/librte_compat/Makefile | 38 +++++++++++++++++++
> > > > lib/librte_compat/rte_compat.h | 86 ++++++++++++++++++++++++++++++++++++++++++
> > > > mk/rte.lib.mk | 6 +++
> > > > 4 files changed, 131 insertions(+)
> > > > create mode 100644 lib/librte_compat/Makefile
> > > > create mode 100644 lib/librte_compat/rte_compat.h
> > > >
> > > > diff --git a/lib/Makefile b/lib/Makefile
> > > > index 10c5bb3..a85b55b 100644
> > > > --- a/lib/Makefile
> > > > +++ b/lib/Makefile
> > > > @@ -32,6 +32,7 @@
> > > > include $(RTE_SDK)/mk/rte.vars.mk
> > > >
> > > > DIRS-$(CONFIG_RTE_LIBC) += libc
> > > > +DIRS-y += librte_compat
> > > > DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> > > > DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> > > > DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> > > > diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> > > > new file mode 100644
> > > > index 0000000..a61511a
> > > > --- /dev/null
> > > > +++ b/lib/librte_compat/Makefile
> > > > @@ -0,0 +1,38 @@
> > > > +# BSD LICENSE
> > > > +#
> > > > +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> > > > +# All rights reserved.
> > > > +#
> > > > +# Redistribution and use in source and binary forms, with or without
> > > > +# modification, are permitted provided that the following conditions
> > > > +# are met:
> > > > +#
> > > > +# * Redistributions of source code must retain the above copyright
> > > > +# notice, this list of conditions and the following disclaimer.
> > > > +# * 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.
> > > > +# * Neither the name of Intel Corporation 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
> > > > +# OWNER 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.
> > > > +
> > > > +include $(RTE_SDK)/mk/rte.vars.mk
> > > > +
> > > > +
> > > > +# install includes
> > > > +SYMLINK-y-include := rte_compat.h
> > > > +
> > > > +include $(RTE_SDK)/mk/rte.lib.mk
> > > > diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> > > > new file mode 100644
> > > > index 0000000..6d65a53
> > > > --- /dev/null
> > > > +++ b/lib/librte_compat/rte_compat.h
> > > > @@ -0,0 +1,86 @@
> > > > +/*-
> > > > + * BSD LICENSE
> > > > + *
> > > > + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> > > > + * All rights reserved.
> > > > + *
> > > > + * Redistribution and use in source and binary forms, with or without
> > > > + * modification, are permitted provided that the following conditions
> > > > + * are met:
> > > > + *
> > > > + * * Redistributions of source code must retain the above copyright
> > > > + * notice, this list of conditions and the following disclaimer.
> > > > + * * 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.
> > > > + * * Neither the name of Intel Corporation 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
> > > > + * OWNER 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.
> > > > + */
> > > > +
> > > > +#ifndef _RTE_COMPAT_H_
> > > > +#define _RTE_COMPAT_H_
> > > > +
> > > > +/*
> > > > + * This is just a stringification macro for use below.
> > > > + */
> > > > +#define SA(x) #x
> > > > +
> > > > +#ifdef RTE_SYMBOL_VERSIONING
> > > > +
> > > > +/*
> > > > + * Provides backwards compatibility when updating exported functions.
> > > > + * When a symol is exported from a library to provide an API, it also provides a
> > > > + * calling convention (ABI) that is embodied in its name, return type,
> > > > + * arguments, etc. On occasion that function may need to change to accomodate
> > > > + * new functionality, behavior, etc. When that occurs, it is desireable to
> > > > + * allow for backwards compatibility for a time with older binaries that are
> > > > + * dynamically linked to the dpdk. to support that the __vsym and
> > > > + * VERSION_SYMBOL macros are created. They, in conjunction with the
> > > > + * <library>_version.map file for a given library allow for multiple versions of
> > > > + * a symbol to exist in a shared library so that older binaries need not be
> > > > + * immediately recompiled. Their use is outlined in the following example:
> > > > + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> > > > + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> > > > + *
> > > > + * To accomplish this:
> > > > + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.8 node, in which
> > > > + * foo is exported as a global symbol
> > > > + *
> > > > + * 2) rename the existing function int foo(char *string) to
> > > > + * int __vsym foo_v18(char *string)
> > > > + *
> > > > + * 3) Add this macro immediately below the function
> > > > + * VERSION_SYMBOL(foo, _v18, 1.8);
> > > > + *
> > > > + */
> > > > +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> > > > +#define __vsym __attribute__((used))
> > > > +
> > >
> > > I may be missing something here but would it not be neccessary to define a
> > > default symbol?
> > > Otherwise there would be multiple definitions of a given symbol and the linker
> > > won't know which symbol version to bind to.
> > >
> > > Following your example, something along these lines:
> > > 4) Edit lib/<library>/library_version.map to add a DPDK_1.9 node that is a
> > > successor to DPDK_1.8, in which foo is exported as a global symbol
> > > DPDK_1.9 {
> > > global: foo;
> > > } DPDK_1.8;
> > >
> > > 5) rename new function int foo(int index) to
> > > int __vsym foo_v19(int index)
> > >
> > > 6) Add this macro immediately below the function:
> > > DEFAULT_SYMBOL(foo, _v19, 1.9);
> > >
> > > #define DEFAULT_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
> > >
> >
> > You're spot on (though the macro that I created in rte_compat.h is
> > VERSION_SYMBOL).
> >
> > When you use a version script to create a DSO, at link time, the appropriate
> > version is appended to the symbol name (you can see it with objdump -t in a
> > linked binary). If you want to update the symbol to a new version, you do what
> > I documented in the header file (though now that I re-read it, it could be more
> > clear. Hows this for a change to the documentation:
> >
> > To make a new version of a function foo in a DSO:
> >
> > 1) Edit lib/<library>/library_version.map to add a DPDK_1.8 node, in which
> > foo is exported as a global symbol
> >
> > 2) rename the existing function int foo(char *string) to
> > int __vsym foo_v18(char *string)
> >
> > 3) Add this macro immediately below the function
> > VERSION_SYMBOL(foo, _v18, 1.8);
> >
> > 4) Implement the new version of the function foo.
> >
> >
> > Those steps above will create two symbols in your export table of the DSO:
> >
> > foo@@DPDK_1.8
> > foo@@DPDK_1.9
> >
> > Any application linked against this DSO will link against the latest version
> > (DPDK_1.9). But if you look at the symbols referenced in a binary linked
> > against an older version of the same DSO, you'll note they explicitly look for
> > foo@@DPDK_1.8. Thats how we provide backwards compatibility
> >
> > Does that answer your questions?
> >
> > Neil
> >
> Correct me if I am wrong but when we define multiple versions of a symbol we
> need to specify a default one.
You are corrected :). The "Default" symbol is implicitly the latest version of
the symbol (where the ordinality of the symbol versions is defined by the map
file).
> As an example, if we were to have three versions of foo the export table of the
> DSO should look something like this:
>
> foo@VER_1.0
> foo@VER_1.1
> foo@@VER_1.2
>
> In the above example, foo VER_1.2 is the default one and is such based on the
fact that it is ordinally the most recent in the version map file.
Its the default symbol because its the latest one according to the map file (and
denoted by the double @'s). When linking that is the only symbol visibile to
the application being linked.
> Effectively we would need two macros VERSION_SYMBOL and DEFAULT_VERSION_SYMBOL
> (maybe this name is more appropriate).
>
Nope, we don't, because as you note above, the default is implicit by the fact
that it is ordinally the latest, and the latest version of the symbol is the
only version that the linker "sees" when linking new applications. The
VERSION_SYMBOL macro exists to tie older binary applications to the older
versions of the symbol at _load_ time.
> #define VERSION_SYMBOL(b, e, v) \
> __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> #define DEFAULT_VERSION_SYMBOL(b, e, v) \
> __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
>
Nope. Don't need it.
> Following on the example, we should have something like:
>
> int __vsym foo_v18(char *string) {...}
> VERSION_SYMBOL(foo, _v18, 1.8);
>
> int __vsym foo_v19(int index) {...}
> DEFAULT_VERSION_SYMBOL(foo, _v19, 1.9);
>
Nope. Lets start a bit further back. Assume we have the following map file:
DPDK_1.8 {
global:
foo;
};
And we have this in a C file:
void foo(int num) {
<implementation for version 1.8>
}
Then we want to update the foo function to something that is binary
incompatible. We would change the version map file as follows:
DPDK_1.8 {
global:
foo;
}
DPDK_1.9 {
global:
foo;
} DPDK_1.8;
That construct makes the linker see DPDK_1.9 ad ordinally "newer" than DPDK_1.8,
so symobls that are global in that version are exported rather than their older
counterparts in the DPDK_1.8 export set. When the linker links a new
application it only links to the latest version
Then in the C file we do the following:
void foo_v18(int num) {
<implementation for version 1.8>
}
VERSION_SYMBOL(foo, _v18, 1.8);
int foo(char *name) {
<implementation for version 1.9>
}
With this change, the new foo function is implicitly matched to version 1.9 in
the map file, and thats what gets linked to new application. The
VERSION_SYMBOL macro exports an additional symbol, foo@@DPDK_1.9, so that
previously built applications, that were linked when the origional version of
foo was the latest, will still find the appropriate symbol as foo@@DPDK_1.8
We could in fact something like what you are suggesting, in that we could use
the VERSION_SYMBOL macro on every exported function so that we explicitly tied
every version of every exported symbol to a statically defined version of the
function with a variant name (i.e. we could have a foo_v18, a foo_v19, foo_vX,
for every supported API version if you wanted), but that creates alot more work
for us. for instance, when doing a non DSO build, you still have to map each
symbol to a specfic version, and you have to keep that updated. By doing it the
way I did above, the actual function name is always the latest version, and you
only have to rename functions if you need to modify the api (I'm working under
the assumption that needing to do this is going to be somewhat rare).
Hope that helps
Neil
> The DSO export table would have the following symbols:
>
> foo@DPDK_1.8
> foo@@DPDK_1.9
>
> Old binaries linked against DPDK 1.8 would have references to:
> foo@@DPDK_1.8
>
> and new binaries linked against DPDK 1.9 would have to:
> foo@@DPDK_1.9
>
> Sergio
>
> > > > +#else
> > > > +/*
> > > > + * No symbol versioning in use
> > > > + */
> > > > +#define VERSION_SYMBOL(b, e, v)
> > > > +#define __vsym
> > > > +
> > > > +/*
> > > > + * RTE_SYMBOL_VERSIONING
> > > > + */
> > > > +#endif
> > > > +
> > > > +
> > > > +#endif /* _RTE_COMPAT_H_ */
> > > > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> > > > index f458258..82ac309 100644
> > > > --- a/mk/rte.lib.mk
> > > > +++ b/mk/rte.lib.mk
> > > > @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
> > > >
> > > > ifeq ($(RTE_BUILD_SHARED_LIB),y)
> > > > LIB := $(patsubst %.a,%.so,$(LIB))
> > > > +
> > > > +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> > > > +
> > > > endif
> > > >
> > > > +
> > > > _BUILD = $(LIB)
> > > > _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> > > > _CLEAN = doclean
> > > > @@ -160,7 +164,9 @@ endif
> > > > $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> > > > @echo " INSTALL-LIB $(LIB)"
> > > > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> > > > +ifneq ($(LIB),)
> > > > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> > > > +endif
> > > >
> > > > #
> > > > # Clean all generated files
> > > > --
> > > > 1.9.3
> > > >
> > >
> > > Sergio
> > >
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning
2014-09-23 14:58 0% ` Neil Horman
@ 2014-09-23 16:29 0% ` Sergio Gonzalez Monroy
2014-09-23 17:31 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Sergio Gonzalez Monroy @ 2014-09-23 16:29 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Tue, Sep 23, 2014 at 10:58:29AM -0400, Neil Horman wrote:
> On Tue, Sep 23, 2014 at 11:39:29AM +0100, Sergio Gonzalez Monroy wrote:
> > Hi Neil,
> >
> > On Mon, Sep 15, 2014 at 03:23:48PM -0400, Neil Horman wrote:
> > > Add initial pass header files to support symbol versioning.
> > >
> > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > > ---
> > > lib/Makefile | 1 +
> > > lib/librte_compat/Makefile | 38 +++++++++++++++++++
> > > lib/librte_compat/rte_compat.h | 86 ++++++++++++++++++++++++++++++++++++++++++
> > > mk/rte.lib.mk | 6 +++
> > > 4 files changed, 131 insertions(+)
> > > create mode 100644 lib/librte_compat/Makefile
> > > create mode 100644 lib/librte_compat/rte_compat.h
> > >
> > > diff --git a/lib/Makefile b/lib/Makefile
> > > index 10c5bb3..a85b55b 100644
> > > --- a/lib/Makefile
> > > +++ b/lib/Makefile
> > > @@ -32,6 +32,7 @@
> > > include $(RTE_SDK)/mk/rte.vars.mk
> > >
> > > DIRS-$(CONFIG_RTE_LIBC) += libc
> > > +DIRS-y += librte_compat
> > > DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> > > DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> > > DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> > > diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> > > new file mode 100644
> > > index 0000000..a61511a
> > > --- /dev/null
> > > +++ b/lib/librte_compat/Makefile
> > > @@ -0,0 +1,38 @@
> > > +# BSD LICENSE
> > > +#
> > > +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> > > +# All rights reserved.
> > > +#
> > > +# Redistribution and use in source and binary forms, with or without
> > > +# modification, are permitted provided that the following conditions
> > > +# are met:
> > > +#
> > > +# * Redistributions of source code must retain the above copyright
> > > +# notice, this list of conditions and the following disclaimer.
> > > +# * 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.
> > > +# * Neither the name of Intel Corporation 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
> > > +# OWNER 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.
> > > +
> > > +include $(RTE_SDK)/mk/rte.vars.mk
> > > +
> > > +
> > > +# install includes
> > > +SYMLINK-y-include := rte_compat.h
> > > +
> > > +include $(RTE_SDK)/mk/rte.lib.mk
> > > diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> > > new file mode 100644
> > > index 0000000..6d65a53
> > > --- /dev/null
> > > +++ b/lib/librte_compat/rte_compat.h
> > > @@ -0,0 +1,86 @@
> > > +/*-
> > > + * BSD LICENSE
> > > + *
> > > + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> > > + * All rights reserved.
> > > + *
> > > + * Redistribution and use in source and binary forms, with or without
> > > + * modification, are permitted provided that the following conditions
> > > + * are met:
> > > + *
> > > + * * Redistributions of source code must retain the above copyright
> > > + * notice, this list of conditions and the following disclaimer.
> > > + * * 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.
> > > + * * Neither the name of Intel Corporation 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
> > > + * OWNER 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.
> > > + */
> > > +
> > > +#ifndef _RTE_COMPAT_H_
> > > +#define _RTE_COMPAT_H_
> > > +
> > > +/*
> > > + * This is just a stringification macro for use below.
> > > + */
> > > +#define SA(x) #x
> > > +
> > > +#ifdef RTE_SYMBOL_VERSIONING
> > > +
> > > +/*
> > > + * Provides backwards compatibility when updating exported functions.
> > > + * When a symol is exported from a library to provide an API, it also provides a
> > > + * calling convention (ABI) that is embodied in its name, return type,
> > > + * arguments, etc. On occasion that function may need to change to accomodate
> > > + * new functionality, behavior, etc. When that occurs, it is desireable to
> > > + * allow for backwards compatibility for a time with older binaries that are
> > > + * dynamically linked to the dpdk. to support that the __vsym and
> > > + * VERSION_SYMBOL macros are created. They, in conjunction with the
> > > + * <library>_version.map file for a given library allow for multiple versions of
> > > + * a symbol to exist in a shared library so that older binaries need not be
> > > + * immediately recompiled. Their use is outlined in the following example:
> > > + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> > > + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> > > + *
> > > + * To accomplish this:
> > > + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.8 node, in which
> > > + * foo is exported as a global symbol
> > > + *
> > > + * 2) rename the existing function int foo(char *string) to
> > > + * int __vsym foo_v18(char *string)
> > > + *
> > > + * 3) Add this macro immediately below the function
> > > + * VERSION_SYMBOL(foo, _v18, 1.8);
> > > + *
> > > + */
> > > +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> > > +#define __vsym __attribute__((used))
> > > +
> >
> > I may be missing something here but would it not be neccessary to define a
> > default symbol?
> > Otherwise there would be multiple definitions of a given symbol and the linker
> > won't know which symbol version to bind to.
> >
> > Following your example, something along these lines:
> > 4) Edit lib/<library>/library_version.map to add a DPDK_1.9 node that is a
> > successor to DPDK_1.8, in which foo is exported as a global symbol
> > DPDK_1.9 {
> > global: foo;
> > } DPDK_1.8;
> >
> > 5) rename new function int foo(int index) to
> > int __vsym foo_v19(int index)
> >
> > 6) Add this macro immediately below the function:
> > DEFAULT_SYMBOL(foo, _v19, 1.9);
> >
> > #define DEFAULT_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
> >
>
> You're spot on (though the macro that I created in rte_compat.h is
> VERSION_SYMBOL).
>
> When you use a version script to create a DSO, at link time, the appropriate
> version is appended to the symbol name (you can see it with objdump -t in a
> linked binary). If you want to update the symbol to a new version, you do what
> I documented in the header file (though now that I re-read it, it could be more
> clear. Hows this for a change to the documentation:
>
> To make a new version of a function foo in a DSO:
>
> 1) Edit lib/<library>/library_version.map to add a DPDK_1.8 node, in which
> foo is exported as a global symbol
>
> 2) rename the existing function int foo(char *string) to
> int __vsym foo_v18(char *string)
>
> 3) Add this macro immediately below the function
> VERSION_SYMBOL(foo, _v18, 1.8);
>
> 4) Implement the new version of the function foo.
>
>
> Those steps above will create two symbols in your export table of the DSO:
>
> foo@@DPDK_1.8
> foo@@DPDK_1.9
>
> Any application linked against this DSO will link against the latest version
> (DPDK_1.9). But if you look at the symbols referenced in a binary linked
> against an older version of the same DSO, you'll note they explicitly look for
> foo@@DPDK_1.8. Thats how we provide backwards compatibility
>
> Does that answer your questions?
>
> Neil
>
Correct me if I am wrong but when we define multiple versions of a symbol we
need to specify a default one.
As an example, if we were to have three versions of foo the export table of the
DSO should look something like this:
foo@VER_1.0
foo@VER_1.1
foo@@VER_1.2
In the above example, foo VER_1.2 is the default one and is indicated by
having double @.
Effectively we would need two macros VERSION_SYMBOL and DEFAULT_VERSION_SYMBOL
(maybe this name is more appropriate).
#define VERSION_SYMBOL(b, e, v) \
__asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
#define DEFAULT_VERSION_SYMBOL(b, e, v) \
__asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
Following on the example, we should have something like:
int __vsym foo_v18(char *string) {...}
VERSION_SYMBOL(foo, _v18, 1.8);
int __vsym foo_v19(int index) {...}
DEFAULT_VERSION_SYMBOL(foo, _v19, 1.9);
The DSO export table would have the following symbols:
foo@DPDK_1.8
foo@@DPDK_1.9
Old binaries linked against DPDK 1.8 would have references to:
foo@@DPDK_1.8
and new binaries linked against DPDK 1.9 would have to:
foo@@DPDK_1.9
Sergio
> > > +#else
> > > +/*
> > > + * No symbol versioning in use
> > > + */
> > > +#define VERSION_SYMBOL(b, e, v)
> > > +#define __vsym
> > > +
> > > +/*
> > > + * RTE_SYMBOL_VERSIONING
> > > + */
> > > +#endif
> > > +
> > > +
> > > +#endif /* _RTE_COMPAT_H_ */
> > > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> > > index f458258..82ac309 100644
> > > --- a/mk/rte.lib.mk
> > > +++ b/mk/rte.lib.mk
> > > @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
> > >
> > > ifeq ($(RTE_BUILD_SHARED_LIB),y)
> > > LIB := $(patsubst %.a,%.so,$(LIB))
> > > +
> > > +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> > > +
> > > endif
> > >
> > > +
> > > _BUILD = $(LIB)
> > > _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> > > _CLEAN = doclean
> > > @@ -160,7 +164,9 @@ endif
> > > $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> > > @echo " INSTALL-LIB $(LIB)"
> > > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> > > +ifneq ($(LIB),)
> > > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> > > +endif
> > >
> > > #
> > > # Clean all generated files
> > > --
> > > 1.9.3
> > >
> >
> > Sergio
> >
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning
2014-09-23 10:39 0% ` Sergio Gonzalez Monroy
@ 2014-09-23 14:58 0% ` Neil Horman
2014-09-23 16:29 0% ` Sergio Gonzalez Monroy
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-23 14:58 UTC (permalink / raw)
To: Sergio Gonzalez Monroy; +Cc: dev
On Tue, Sep 23, 2014 at 11:39:29AM +0100, Sergio Gonzalez Monroy wrote:
> Hi Neil,
>
> On Mon, Sep 15, 2014 at 03:23:48PM -0400, Neil Horman wrote:
> > Add initial pass header files to support symbol versioning.
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > ---
> > lib/Makefile | 1 +
> > lib/librte_compat/Makefile | 38 +++++++++++++++++++
> > lib/librte_compat/rte_compat.h | 86 ++++++++++++++++++++++++++++++++++++++++++
> > mk/rte.lib.mk | 6 +++
> > 4 files changed, 131 insertions(+)
> > create mode 100644 lib/librte_compat/Makefile
> > create mode 100644 lib/librte_compat/rte_compat.h
> >
> > diff --git a/lib/Makefile b/lib/Makefile
> > index 10c5bb3..a85b55b 100644
> > --- a/lib/Makefile
> > +++ b/lib/Makefile
> > @@ -32,6 +32,7 @@
> > include $(RTE_SDK)/mk/rte.vars.mk
> >
> > DIRS-$(CONFIG_RTE_LIBC) += libc
> > +DIRS-y += librte_compat
> > DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> > DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> > DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> > diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> > new file mode 100644
> > index 0000000..a61511a
> > --- /dev/null
> > +++ b/lib/librte_compat/Makefile
> > @@ -0,0 +1,38 @@
> > +# BSD LICENSE
> > +#
> > +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> > +# All rights reserved.
> > +#
> > +# Redistribution and use in source and binary forms, with or without
> > +# modification, are permitted provided that the following conditions
> > +# are met:
> > +#
> > +# * Redistributions of source code must retain the above copyright
> > +# notice, this list of conditions and the following disclaimer.
> > +# * 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.
> > +# * Neither the name of Intel Corporation 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
> > +# OWNER 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.
> > +
> > +include $(RTE_SDK)/mk/rte.vars.mk
> > +
> > +
> > +# install includes
> > +SYMLINK-y-include := rte_compat.h
> > +
> > +include $(RTE_SDK)/mk/rte.lib.mk
> > diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> > new file mode 100644
> > index 0000000..6d65a53
> > --- /dev/null
> > +++ b/lib/librte_compat/rte_compat.h
> > @@ -0,0 +1,86 @@
> > +/*-
> > + * BSD LICENSE
> > + *
> > + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> > + * All rights reserved.
> > + *
> > + * Redistribution and use in source and binary forms, with or without
> > + * modification, are permitted provided that the following conditions
> > + * are met:
> > + *
> > + * * Redistributions of source code must retain the above copyright
> > + * notice, this list of conditions and the following disclaimer.
> > + * * 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.
> > + * * Neither the name of Intel Corporation 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
> > + * OWNER 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.
> > + */
> > +
> > +#ifndef _RTE_COMPAT_H_
> > +#define _RTE_COMPAT_H_
> > +
> > +/*
> > + * This is just a stringification macro for use below.
> > + */
> > +#define SA(x) #x
> > +
> > +#ifdef RTE_SYMBOL_VERSIONING
> > +
> > +/*
> > + * Provides backwards compatibility when updating exported functions.
> > + * When a symol is exported from a library to provide an API, it also provides a
> > + * calling convention (ABI) that is embodied in its name, return type,
> > + * arguments, etc. On occasion that function may need to change to accomodate
> > + * new functionality, behavior, etc. When that occurs, it is desireable to
> > + * allow for backwards compatibility for a time with older binaries that are
> > + * dynamically linked to the dpdk. to support that the __vsym and
> > + * VERSION_SYMBOL macros are created. They, in conjunction with the
> > + * <library>_version.map file for a given library allow for multiple versions of
> > + * a symbol to exist in a shared library so that older binaries need not be
> > + * immediately recompiled. Their use is outlined in the following example:
> > + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> > + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> > + *
> > + * To accomplish this:
> > + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.8 node, in which
> > + * foo is exported as a global symbol
> > + *
> > + * 2) rename the existing function int foo(char *string) to
> > + * int __vsym foo_v18(char *string)
> > + *
> > + * 3) Add this macro immediately below the function
> > + * VERSION_SYMBOL(foo, _v18, 1.8);
> > + *
> > + */
> > +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> > +#define __vsym __attribute__((used))
> > +
>
> I may be missing something here but would it not be neccessary to define a
> default symbol?
> Otherwise there would be multiple definitions of a given symbol and the linker
> won't know which symbol version to bind to.
>
> Following your example, something along these lines:
> 4) Edit lib/<library>/library_version.map to add a DPDK_1.9 node that is a
> successor to DPDK_1.8, in which foo is exported as a global symbol
> DPDK_1.9 {
> global: foo;
> } DPDK_1.8;
>
> 5) rename new function int foo(int index) to
> int __vsym foo_v19(int index)
>
> 6) Add this macro immediately below the function:
> DEFAULT_SYMBOL(foo, _v19, 1.9);
>
> #define DEFAULT_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
>
You're spot on (though the macro that I created in rte_compat.h is
VERSION_SYMBOL).
When you use a version script to create a DSO, at link time, the appropriate
version is appended to the symbol name (you can see it with objdump -t in a
linked binary). If you want to update the symbol to a new version, you do what
I documented in the header file (though now that I re-read it, it could be more
clear. Hows this for a change to the documentation:
To make a new version of a function foo in a DSO:
1) Edit lib/<library>/library_version.map to add a DPDK_1.8 node, in which
foo is exported as a global symbol
2) rename the existing function int foo(char *string) to
int __vsym foo_v18(char *string)
3) Add this macro immediately below the function
VERSION_SYMBOL(foo, _v18, 1.8);
4) Implement the new version of the function foo.
Those steps above will create two symbols in your export table of the DSO:
foo@@DPDK_1.8
foo@@DPDK_1.9
Any application linked against this DSO will link against the latest version
(DPDK_1.9). But if you look at the symbols referenced in a binary linked
against an older version of the same DSO, you'll note they explicitly look for
foo@@DPDK_1.8. Thats how we provide backwards compatibility
Does that answer your questions?
Neil
> > +#else
> > +/*
> > + * No symbol versioning in use
> > + */
> > +#define VERSION_SYMBOL(b, e, v)
> > +#define __vsym
> > +
> > +/*
> > + * RTE_SYMBOL_VERSIONING
> > + */
> > +#endif
> > +
> > +
> > +#endif /* _RTE_COMPAT_H_ */
> > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> > index f458258..82ac309 100644
> > --- a/mk/rte.lib.mk
> > +++ b/mk/rte.lib.mk
> > @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
> >
> > ifeq ($(RTE_BUILD_SHARED_LIB),y)
> > LIB := $(patsubst %.a,%.so,$(LIB))
> > +
> > +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> > +
> > endif
> >
> > +
> > _BUILD = $(LIB)
> > _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> > _CLEAN = doclean
> > @@ -160,7 +164,9 @@ endif
> > $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> > @echo " INSTALL-LIB $(LIB)"
> > @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> > +ifneq ($(LIB),)
> > $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> > +endif
> >
> > #
> > # Clean all generated files
> > --
> > 1.9.3
> >
>
> Sergio
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning
2014-09-15 19:23 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2014-09-23 10:39 0% ` Sergio Gonzalez Monroy
2014-09-23 14:58 0% ` Neil Horman
2014-09-25 18:52 4% ` [dpdk-dev] [PATCH 1/4 v2] " Neil Horman
` (2 subsequent siblings)
3 siblings, 1 reply; 200+ results
From: Sergio Gonzalez Monroy @ 2014-09-23 10:39 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Hi Neil,
On Mon, Sep 15, 2014 at 03:23:48PM -0400, Neil Horman wrote:
> Add initial pass header files to support symbol versioning.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> ---
> lib/Makefile | 1 +
> lib/librte_compat/Makefile | 38 +++++++++++++++++++
> lib/librte_compat/rte_compat.h | 86 ++++++++++++++++++++++++++++++++++++++++++
> mk/rte.lib.mk | 6 +++
> 4 files changed, 131 insertions(+)
> create mode 100644 lib/librte_compat/Makefile
> create mode 100644 lib/librte_compat/rte_compat.h
>
> diff --git a/lib/Makefile b/lib/Makefile
> index 10c5bb3..a85b55b 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -32,6 +32,7 @@
> include $(RTE_SDK)/mk/rte.vars.mk
>
> DIRS-$(CONFIG_RTE_LIBC) += libc
> +DIRS-y += librte_compat
> DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
> DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
> DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
> diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
> new file mode 100644
> index 0000000..a61511a
> --- /dev/null
> +++ b/lib/librte_compat/Makefile
> @@ -0,0 +1,38 @@
> +# BSD LICENSE
> +#
> +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> +# All rights reserved.
> +#
> +# Redistribution and use in source and binary forms, with or without
> +# modification, are permitted provided that the following conditions
> +# are met:
> +#
> +# * Redistributions of source code must retain the above copyright
> +# notice, this list of conditions and the following disclaimer.
> +# * 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.
> +# * Neither the name of Intel Corporation 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
> +# OWNER 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.
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +
> +# install includes
> +SYMLINK-y-include := rte_compat.h
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
> new file mode 100644
> index 0000000..6d65a53
> --- /dev/null
> +++ b/lib/librte_compat/rte_compat.h
> @@ -0,0 +1,86 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#ifndef _RTE_COMPAT_H_
> +#define _RTE_COMPAT_H_
> +
> +/*
> + * This is just a stringification macro for use below.
> + */
> +#define SA(x) #x
> +
> +#ifdef RTE_SYMBOL_VERSIONING
> +
> +/*
> + * Provides backwards compatibility when updating exported functions.
> + * When a symol is exported from a library to provide an API, it also provides a
> + * calling convention (ABI) that is embodied in its name, return type,
> + * arguments, etc. On occasion that function may need to change to accomodate
> + * new functionality, behavior, etc. When that occurs, it is desireable to
> + * allow for backwards compatibility for a time with older binaries that are
> + * dynamically linked to the dpdk. to support that the __vsym and
> + * VERSION_SYMBOL macros are created. They, in conjunction with the
> + * <library>_version.map file for a given library allow for multiple versions of
> + * a symbol to exist in a shared library so that older binaries need not be
> + * immediately recompiled. Their use is outlined in the following example:
> + * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
> + * DPDK 1.(X+1) needs to change foo to be int foo(int index)
> + *
> + * To accomplish this:
> + * 1) Edit lib/<library>/library_version.map to add a DPDK_1.8 node, in which
> + * foo is exported as a global symbol
> + *
> + * 2) rename the existing function int foo(char *string) to
> + * int __vsym foo_v18(char *string)
> + *
> + * 3) Add this macro immediately below the function
> + * VERSION_SYMBOL(foo, _v18, 1.8);
> + *
> + */
> +#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
> +#define __vsym __attribute__((used))
> +
I may be missing something here but would it not be neccessary to define a
default symbol?
Otherwise there would be multiple definitions of a given symbol and the linker
won't know which symbol version to bind to.
Following your example, something along these lines:
4) Edit lib/<library>/library_version.map to add a DPDK_1.9 node that is a
successor to DPDK_1.8, in which foo is exported as a global symbol
DPDK_1.9 {
global: foo;
} DPDK_1.8;
5) rename new function int foo(int index) to
int __vsym foo_v19(int index)
6) Add this macro immediately below the function:
DEFAULT_SYMBOL(foo, _v19, 1.9);
#define DEFAULT_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@@DPDK_"SA(v))
> +#else
> +/*
> + * No symbol versioning in use
> + */
> +#define VERSION_SYMBOL(b, e, v)
> +#define __vsym
> +
> +/*
> + * RTE_SYMBOL_VERSIONING
> + */
> +#endif
> +
> +
> +#endif /* _RTE_COMPAT_H_ */
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> index f458258..82ac309 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
>
> ifeq ($(RTE_BUILD_SHARED_LIB),y)
> LIB := $(patsubst %.a,%.so,$(LIB))
> +
> +CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
> +
> endif
>
> +
> _BUILD = $(LIB)
> _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
> _CLEAN = doclean
> @@ -160,7 +164,9 @@ endif
> $(RTE_OUTPUT)/lib/$(LIB): $(LIB)
> @echo " INSTALL-LIB $(LIB)"
> @[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
> +ifneq ($(LIB),)
> $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
> +endif
>
> #
> # Clean all generated files
> --
> 1.9.3
>
Sergio
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-19 14:18 0% ` Venkatesan, Venky
@ 2014-09-19 17:45 4% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-09-19 17:45 UTC (permalink / raw)
To: Venkatesan, Venky; +Cc: dev
On Fri, Sep 19, 2014 at 07:18:36AM -0700, Venkatesan, Venky wrote:
> On 9/18/2014 12:14 PM, Neil Horman wrote:
> >On Thu, Sep 18, 2014 at 08:23:36PM +0200, Thomas Monjalon wrote:
> >>Hi Neil,
> >>
> >>2014-09-15 15:23, Neil Horman:
> >>>The DPDK ABI develops and changes quickly, which makes it difficult for
> >>>applications to keep up with the latest version of the library, especially when
> >>>it (the DPDK) is built as a set of shared objects, as applications may be built
> >>>against an older version of the library.
> >>>
> >>>To mitigate this, this patch series introduces support for library and symbol
> >>>versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
> >>>
> >>>1) Adds initial support for library versioning. Each library now has a version
> >>>map that explicitly calls out what symbols are exported to using applications,
> >>>and assigns version(s) to them
> >>>
> >>>2) Adds support macros so that when libraries create incompatible ABI's,
> >>>multiple versions may be supported so that applications linked against older
> >>>DPDK releases can continue to function
> >>>
> >>>3) Adds library soname versioning suffixes so that when ABI's must be broken in
> >>>a fashion that requires a rebuild of older applications, they will break at load
> >>>time, rather than cause unexpected issues at run time.
> >>>
> >>>4) Adds documentation for ABI policy, and provides space to document deprecated
> >>>ABI versions, so that applications might be warned of impending changes.
> >>>
> >>>With these elements in place the DPDK has some support to allow for the extended
> >>>maintenence of older API's while still allowing the freedom to develop new and
> >>>improved API's.
> >>>
> >>>Implementing this feature will require some additional effort on the part of
> >>>developers and reviewers. When reviewing patches, must be checked against
> >>>existing exports to ensure that the function prototypes are not changing. If
> >>>they are, the versioning macros must be used, and the library export map should
> >>>be updated to reflect the new version of the function.
> >>>
> >>>When data structures change, if those structures are application accessible,
> >>>apis that accept or return instances of those data structures should have new
> >>>versions created so that users of the old data structure version might co-exist
> >>>at the same time.
> >>Thanks for your efforts.
> >>But I feel this change has too many constraints for the current status of
> >>the DPDK. It's probably too early to adopt such policy.
> >>
> >I think you may be misunderstanding something. What constraints do you beleive
> >that this patch imposes? Note it doesn't in any way prevent changes to the ABI
> >of the DPDK, but rather gives us infrastructure to support multiple ABI
> >revisions at the same time, so that applications built against DPDK shared
> >libraries can continue to function properly at least for some time until we
> >decide to deprecate that ABI level.
> >
> >This is all based on the versioning strategy outlined here:
> >http://www.akkadia.org/drepper/dsohowto.pdf
> >
> >That may help clarify things for you.
> >
> >>By the way, this versioning doesn't cover structure changes.
> >No, it doesn't. No link-time mechanism does so.
> >
> >>How could it be managed?
> >Thats a subject that is open to discussion, but my initial thinking is that we
> >need to handle it on a case by case basis:
> >
> >* For minor updates, where allocation of a structure is done on the heap and new
> >fields need to be added, appending them to the end of a structure and providing
> >an initial value is sufficient.
> >
> >* For major changes, where fields need to be removed, or re-arranged, mostly
> >likely the API surfaces which accept or return those structures as
> >inputs/outputs will need to have new versions written to accept the new version
> >of the structure, and internally we will have to support both formats for a time
> >(according to the policy I documented, that is currently a single major
> >release). I.e. if you want to change struct foo, which is accepted as a
> >parameter for the function bar(struct foo *ptr), then for a release we would
> >need to create struct foo_v2 with the new format, map a new function foo_v2 to
> >the exported foo@@DPDK_1.(X+1), and internally make the foo functions understand
> >both the origional and v2 versions of the structure. Then in DPDK release
> >1.X+2, we can remove the old version after posting a deprecation notice with
> >version 1.(X+1)
> >
> >>Don't you think it would be more reliable if managed by packaging?
> >Solving this with packaging defeats the purpose of having shared libraries at
> >all. While packaging each version of the dpdk separately is possible stopgap
> >solution, in that it allows applications to link to differing versions of the
> >library independently, but that negates any expectation of timely bugfixes for
> >any given version of the DPDK. That is to say, if you package things this way,
> >and wind up with several parallel versions of the same package, and for any
> >bugfix that comes out upstream, the packager then has the responsibility to
> >adapt that fix to each package. Thats an unscalable solution, and not something
> >any packager is going to undertake willingly. I did a hybrid version of this in
> >fedora for exactly that reason. I packaged the dpdk into its own directory, but
> >have every intention of changing that directory every major release, so that
> >application writers can clearly see when they need to stop updating the dpdk,
> >lest their applications stop linking. I'm not going to have multiple dpdk
> >packages to maintain in parallel, thats just too much work.
> I do think that this is something that needs to be addressed in the DPDK
> (and not with packaging). Besides what Neil points out, DPDK can work with a
> lot of linux distros, and other operating systems too. Replicating the work
> with each (even if it is just two or three that we focus on) is wasteful.
While its nice and generous of the upstream community to provide packaging
samples, its also not something that that upstream development should really
need to worry about. Packaging is really meant to address the needs of the
distribution doing the packaging. Relying on it to solve versioning problems
in place of a more appropriate solution just leads to fragmentation accross
distributions, as invariably different distros will manage that versioning
differently, which leads to applications needing to manage versioning
differently, which is what I'm trying to avoid :)
> >>Thank you for opening this discussion with a constructive proposal.
> >>Let's check it later on once structures will be more stable since
> >>performance is the most critical target.
> Performance will always be a critical target for us. However, as we find
> more problems that need to be solved, we will add new libraries and new
> APIs. That can't be a reason to
> >If I'm being honest, I have to say thats a cop out answer. We all know that
> >structure stability isn't a priority for the DPDK, nor will it ever be in all
> >likelyhood. It will continue to evolve and grow as the hardware does. And this
> >patch set doesn't prevent that from happening. All it does is provide some
> >level of stability in the API for a period of time to let 3rd party application
> >writers write and package applications with some allowance of time to keep up
> >with upstream changes on their own schedule.
> >
> >I grant you that writing a good API for a shared library is difficult, but
> >(and feel free to disagree with this), if we don't start enforcing policies that
> >require good API design, its not going to happen on its own. This patch set
> >will highlight those API points which are difficult to maintain accross major
> >releases, and force us to address and improve them. To that end I've already
> >begun talking to some of the individual library maintainers off list to address
> >some of the API aspects that I have concerns about (exporting variable rather
> >than accessor functions, structures that don't need to be visible to users,
> >etc), and they've started reviewing them. We can make this better, but we can't
> >just say later, because theres no roadmap that lists structure stability as a
> >line item. As hardware improves, structures will change to operate more
> >efficiently or support more features. Without a hard plan, the initial goals of
> >the DPDK (high performance networking) will relegate ABI to such a low priority
> >that it will never be addressed.
> Neil, you're spot on here. To an extent, there will always be changes to the
> API for various reasons. We've done a reasonable job of managing changes so
> far, but there are going to be changes. I do think that this patch provides
> a way for applications to manage through those changes at the pace they can
> absorb.
>
Thank you. Let me be clear for anyone who might not have heard me say this
before. In no way am I trying to limit the evolution of the DPDK ABI or API.
All I'm trying to do here is provide some infrastructure that allows for exiting
ABI to carry on for a minimal guaranteed period of time (currently set to at
least one release beyond its deprecation notification). I won't lie, that does
mean that API design and maintenence will be a potential extra work effort, but
I don't think thats a bad thing, as doing so will lead to better API design
(that will hopefully just last longer naturally), and it will help expand the
reach of the DPDK as application writers can better separate their development
cycles from that of the DPDK itself.
> Secondly, one other usage scenario that we will run into is when apps using
> different versions of DPDK are installed on the same system - this patch at
> least gives us a start point to at least flag this problem.
Yeah, I'm not sure how I'll deal with that from a packaging standpoint yet, but
soname versioning at least gives me a tool to make it easier to do using
whatever method I choose.
> >
> >To that end, can we discuss specifics? Can you ennumerate direct points that
> >you feel make this patch unworkable at this time? I know you mentioned some
> >above, and I think I addressed them (though please ask follow up questions if
> >I've been unclear). What other concerns do you have?
> >
> >Neil
> This is a good start - I've put it into my development systems and will let
> you know if I find anything that is a showstopper.
>
Thanks!
Neil
> Regards,
> -Venky
>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-18 19:14 4% ` Neil Horman
2014-09-19 8:57 0% ` Richardson, Bruce
@ 2014-09-19 14:18 0% ` Venkatesan, Venky
2014-09-19 17:45 4% ` Neil Horman
2014-09-24 18:19 3% ` Neil Horman
2 siblings, 1 reply; 200+ results
From: Venkatesan, Venky @ 2014-09-19 14:18 UTC (permalink / raw)
To: dev
On 9/18/2014 12:14 PM, Neil Horman wrote:
> On Thu, Sep 18, 2014 at 08:23:36PM +0200, Thomas Monjalon wrote:
>> Hi Neil,
>>
>> 2014-09-15 15:23, Neil Horman:
>>> The DPDK ABI develops and changes quickly, which makes it difficult for
>>> applications to keep up with the latest version of the library, especially when
>>> it (the DPDK) is built as a set of shared objects, as applications may be built
>>> against an older version of the library.
>>>
>>> To mitigate this, this patch series introduces support for library and symbol
>>> versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
>>>
>>> 1) Adds initial support for library versioning. Each library now has a version
>>> map that explicitly calls out what symbols are exported to using applications,
>>> and assigns version(s) to them
>>>
>>> 2) Adds support macros so that when libraries create incompatible ABI's,
>>> multiple versions may be supported so that applications linked against older
>>> DPDK releases can continue to function
>>>
>>> 3) Adds library soname versioning suffixes so that when ABI's must be broken in
>>> a fashion that requires a rebuild of older applications, they will break at load
>>> time, rather than cause unexpected issues at run time.
>>>
>>> 4) Adds documentation for ABI policy, and provides space to document deprecated
>>> ABI versions, so that applications might be warned of impending changes.
>>>
>>> With these elements in place the DPDK has some support to allow for the extended
>>> maintenence of older API's while still allowing the freedom to develop new and
>>> improved API's.
>>>
>>> Implementing this feature will require some additional effort on the part of
>>> developers and reviewers. When reviewing patches, must be checked against
>>> existing exports to ensure that the function prototypes are not changing. If
>>> they are, the versioning macros must be used, and the library export map should
>>> be updated to reflect the new version of the function.
>>>
>>> When data structures change, if those structures are application accessible,
>>> apis that accept or return instances of those data structures should have new
>>> versions created so that users of the old data structure version might co-exist
>>> at the same time.
>> Thanks for your efforts.
>> But I feel this change has too many constraints for the current status of
>> the DPDK. It's probably too early to adopt such policy.
>>
> I think you may be misunderstanding something. What constraints do you beleive
> that this patch imposes? Note it doesn't in any way prevent changes to the ABI
> of the DPDK, but rather gives us infrastructure to support multiple ABI
> revisions at the same time, so that applications built against DPDK shared
> libraries can continue to function properly at least for some time until we
> decide to deprecate that ABI level.
>
> This is all based on the versioning strategy outlined here:
> http://www.akkadia.org/drepper/dsohowto.pdf
>
> That may help clarify things for you.
>
>> By the way, this versioning doesn't cover structure changes.
> No, it doesn't. No link-time mechanism does so.
>
>> How could it be managed?
> Thats a subject that is open to discussion, but my initial thinking is that we
> need to handle it on a case by case basis:
>
> * For minor updates, where allocation of a structure is done on the heap and new
> fields need to be added, appending them to the end of a structure and providing
> an initial value is sufficient.
>
> * For major changes, where fields need to be removed, or re-arranged, mostly
> likely the API surfaces which accept or return those structures as
> inputs/outputs will need to have new versions written to accept the new version
> of the structure, and internally we will have to support both formats for a time
> (according to the policy I documented, that is currently a single major
> release). I.e. if you want to change struct foo, which is accepted as a
> parameter for the function bar(struct foo *ptr), then for a release we would
> need to create struct foo_v2 with the new format, map a new function foo_v2 to
> the exported foo@@DPDK_1.(X+1), and internally make the foo functions understand
> both the origional and v2 versions of the structure. Then in DPDK release
> 1.X+2, we can remove the old version after posting a deprecation notice with
> version 1.(X+1)
>
>> Don't you think it would be more reliable if managed by packaging?
> Solving this with packaging defeats the purpose of having shared libraries at
> all. While packaging each version of the dpdk separately is possible stopgap
> solution, in that it allows applications to link to differing versions of the
> library independently, but that negates any expectation of timely bugfixes for
> any given version of the DPDK. That is to say, if you package things this way,
> and wind up with several parallel versions of the same package, and for any
> bugfix that comes out upstream, the packager then has the responsibility to
> adapt that fix to each package. Thats an unscalable solution, and not something
> any packager is going to undertake willingly. I did a hybrid version of this in
> fedora for exactly that reason. I packaged the dpdk into its own directory, but
> have every intention of changing that directory every major release, so that
> application writers can clearly see when they need to stop updating the dpdk,
> lest their applications stop linking. I'm not going to have multiple dpdk
> packages to maintain in parallel, thats just too much work.
I do think that this is something that needs to be addressed in the
DPDK (and not with packaging). Besides what Neil points out, DPDK can
work with a lot of linux distros, and other operating systems too.
Replicating the work with each (even if it is just two or three that we
focus on) is wasteful.
>> Thank you for opening this discussion with a constructive proposal.
>> Let's check it later on once structures will be more stable since
>> performance is the most critical target.
Performance will always be a critical target for us. However, as we find
more problems that need to be solved, we will add new libraries and new
APIs. That can't be a reason to
> If I'm being honest, I have to say thats a cop out answer. We all know that
> structure stability isn't a priority for the DPDK, nor will it ever be in all
> likelyhood. It will continue to evolve and grow as the hardware does. And this
> patch set doesn't prevent that from happening. All it does is provide some
> level of stability in the API for a period of time to let 3rd party application
> writers write and package applications with some allowance of time to keep up
> with upstream changes on their own schedule.
>
> I grant you that writing a good API for a shared library is difficult, but
> (and feel free to disagree with this), if we don't start enforcing policies that
> require good API design, its not going to happen on its own. This patch set
> will highlight those API points which are difficult to maintain accross major
> releases, and force us to address and improve them. To that end I've already
> begun talking to some of the individual library maintainers off list to address
> some of the API aspects that I have concerns about (exporting variable rather
> than accessor functions, structures that don't need to be visible to users,
> etc), and they've started reviewing them. We can make this better, but we can't
> just say later, because theres no roadmap that lists structure stability as a
> line item. As hardware improves, structures will change to operate more
> efficiently or support more features. Without a hard plan, the initial goals of
> the DPDK (high performance networking) will relegate ABI to such a low priority
> that it will never be addressed.
Neil, you're spot on here. To an extent, there will always be changes to
the API for various reasons. We've done a reasonable job of managing
changes so far, but there are going to be changes. I do think that this
patch provides a way for applications to manage through those changes at
the pace they can absorb.
Secondly, one other usage scenario that we will run into is when apps
using different versions of DPDK are installed on the same system - this
patch at least gives us a start point to at least flag this problem.
>
> To that end, can we discuss specifics? Can you ennumerate direct points that
> you feel make this patch unworkable at this time? I know you mentioned some
> above, and I think I addressed them (though please ask follow up questions if
> I've been unclear). What other concerns do you have?
>
> Neil
>
This is a good start - I've put it into my development systems and
will let you know if I find anything that is a showstopper.
Regards,
-Venky
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 2/4] Provide initial versioning for all DPDK libraries
2014-09-19 9:45 4% ` Bruce Richardson
@ 2014-09-19 10:22 0% ` Neil Horman
0 siblings, 0 replies; 200+ results
From: Neil Horman @ 2014-09-19 10:22 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev
On Fri, Sep 19, 2014 at 10:45:38AM +0100, Bruce Richardson wrote:
> On Mon, Sep 15, 2014 at 03:23:49PM -0400, Neil Horman wrote:
> > Add linker version script files to each DPDK library to put a stake in the
> > ground from which we can start cleaning up API's
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> > CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> > ---
> > <... snip for brevity ...>
> >
> > diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
> > index 65e566d..1f96645 100644
> > --- a/lib/librte_acl/Makefile
> > +++ b/lib/librte_acl/Makefile
> > @@ -37,6 +37,8 @@ LIB = librte_acl.a
> > CFLAGS += -O3
> > CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
> >
> > +EXPORT_MAP := $(RTE_SDK)/lib/librte_acl/rte_acl_version.map
> > +
> > # all source are stored in SRCS-y
> > SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
> >
> > diff --git a/lib/librte_acl/rte_acl_version.map b/lib/librte_acl/rte_acl_version.map
> > new file mode 100644
> > index 0000000..4480690
> > --- /dev/null
> > +++ b/lib/librte_acl/rte_acl_version.map
> > @@ -0,0 +1,19 @@
> > +DPDK_1.8 {
> > + global:
> > + rte_acl_create;
> > + rte_acl_find_existing;
> > + rte_acl_free;
> > + rte_acl_add_rules;
> > + rte_acl_reset_rules;
> > + rte_acl_build;
> > + rte_acl_reset;
> > + rte_acl_classify;
> > + rte_acl_dump;
> > + rte_acl_list_dump;
> > + rte_acl_ipv4vlan_add_rules;
> > + rte_acl_ipv4vlan_build;
> > + rte_acl_classify_scalar;
> > +
> > + local: *;
> > +};
> > +
>
> Looking at this versionning, it strikes me that this looks like the perfect
> opportunity to go to a 2.0 version number.
>
> My reasoning:
> * We have already got fairly significant ABI and indeed API changes in this
> release due to the mbuf rework. That allow makes it a logical point to
> bump the Intel DPDK major version number to 2.0
> * Having the API versioning start at a 2.0 looks neater than having it at
> 1.8, since .0 is a nice round version number to start with. Also if we
> decide in the near future for whatever reasons to go to a 2.0 release, the
> ABIs are probably still going to be 1.8. [Again, if we ever want to go to
> 2.0, now looks the perfect time]
> * For the naming of the .so files, starting with them at a .2 now seems
> reasonable to me, denoting a clean break with the older releases which did
> have a different ABI. [Though again it makes more sense if you consider
> that we may want to move to a 2.0 in future].
>
> What do people think?
>
I'm fine with it. Just so that we're clear, this patch treats versions like
arbitrary strings (the file structure denotes version ordinality), so 1.8 vs 2.0
makes absolutely no difference as far as it goes, the exported version value is
a matter of policy, but I'm fine with making that adjustment
Neil
> /Bruce
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 2/4] Provide initial versioning for all DPDK libraries
@ 2014-09-19 9:45 4% ` Bruce Richardson
2014-09-19 10:22 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Bruce Richardson @ 2014-09-19 9:45 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
On Mon, Sep 15, 2014 at 03:23:49PM -0400, Neil Horman wrote:
> Add linker version script files to each DPDK library to put a stake in the
> ground from which we can start cleaning up API's
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: Thomas Monjalon <thomas.monjalon@6wind.com>
> CC: "Richardson, Bruce" <bruce.richardson@intel.com>
> ---
> <... snip for brevity ...>
>
> diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
> index 65e566d..1f96645 100644
> --- a/lib/librte_acl/Makefile
> +++ b/lib/librte_acl/Makefile
> @@ -37,6 +37,8 @@ LIB = librte_acl.a
> CFLAGS += -O3
> CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
>
> +EXPORT_MAP := $(RTE_SDK)/lib/librte_acl/rte_acl_version.map
> +
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
>
> diff --git a/lib/librte_acl/rte_acl_version.map b/lib/librte_acl/rte_acl_version.map
> new file mode 100644
> index 0000000..4480690
> --- /dev/null
> +++ b/lib/librte_acl/rte_acl_version.map
> @@ -0,0 +1,19 @@
> +DPDK_1.8 {
> + global:
> + rte_acl_create;
> + rte_acl_find_existing;
> + rte_acl_free;
> + rte_acl_add_rules;
> + rte_acl_reset_rules;
> + rte_acl_build;
> + rte_acl_reset;
> + rte_acl_classify;
> + rte_acl_dump;
> + rte_acl_list_dump;
> + rte_acl_ipv4vlan_add_rules;
> + rte_acl_ipv4vlan_build;
> + rte_acl_classify_scalar;
> +
> + local: *;
> +};
> +
Looking at this versionning, it strikes me that this looks like the perfect
opportunity to go to a 2.0 version number.
My reasoning:
* We have already got fairly significant ABI and indeed API changes in this
release due to the mbuf rework. That allow makes it a logical point to
bump the Intel DPDK major version number to 2.0
* Having the API versioning start at a 2.0 looks neater than having it at
1.8, since .0 is a nice round version number to start with. Also if we
decide in the near future for whatever reasons to go to a 2.0 release, the
ABIs are probably still going to be 1.8. [Again, if we ever want to go to
2.0, now looks the perfect time]
* For the naming of the .so files, starting with them at a .2 now seems
reasonable to me, denoting a clean break with the older releases which did
have a different ABI. [Though again it makes more sense if you consider
that we may want to move to a 2.0 in future].
What do people think?
/Bruce
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-18 19:14 4% ` Neil Horman
@ 2014-09-19 8:57 0% ` Richardson, Bruce
2014-09-19 14:18 0% ` Venkatesan, Venky
2014-09-24 18:19 3% ` Neil Horman
2 siblings, 0 replies; 200+ results
From: Richardson, Bruce @ 2014-09-19 8:57 UTC (permalink / raw)
To: Neil Horman, Thomas Monjalon; +Cc: dev
> -----Original Message-----
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Thursday, September 18, 2014 8:14 PM
> To: Thomas Monjalon
> Cc: dev@dpdk.org; Richardson, Bruce
> Subject: Re: [PATCH 0/4] Add DSO symbol versioning to support backwards
> compatibility
>
> On Thu, Sep 18, 2014 at 08:23:36PM +0200, Thomas Monjalon wrote:
> > Hi Neil,
> >
> > 2014-09-15 15:23, Neil Horman:
> > > The DPDK ABI develops and changes quickly, which makes it difficult for
> > > applications to keep up with the latest version of the library, especially when
> > > it (the DPDK) is built as a set of shared objects, as applications may be built
> > > against an older version of the library.
> > >
> > > To mitigate this, this patch series introduces support for library and symbol
> > > versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
> > >
> > > 1) Adds initial support for library versioning. Each library now has a version
> > > map that explicitly calls out what symbols are exported to using applications,
> > > and assigns version(s) to them
> > >
> > > 2) Adds support macros so that when libraries create incompatible ABI's,
> > > multiple versions may be supported so that applications linked against older
> > > DPDK releases can continue to function
> > >
> > > 3) Adds library soname versioning suffixes so that when ABI's must be broken
> in
> > > a fashion that requires a rebuild of older applications, they will break at load
> > > time, rather than cause unexpected issues at run time.
> > >
> > > 4) Adds documentation for ABI policy, and provides space to document
> deprecated
> > > ABI versions, so that applications might be warned of impending changes.
> > >
> > > With these elements in place the DPDK has some support to allow for the
> extended
> > > maintenence of older API's while still allowing the freedom to develop new
> and
> > > improved API's.
> > >
> > > Implementing this feature will require some additional effort on the part of
> > > developers and reviewers. When reviewing patches, must be checked
> against
> > > existing exports to ensure that the function prototypes are not changing. If
> > > they are, the versioning macros must be used, and the library export map
> should
> > > be updated to reflect the new version of the function.
> > >
> > > When data structures change, if those structures are application accessible,
> > > apis that accept or return instances of those data structures should have new
> > > versions created so that users of the old data structure version might co-
> exist
> > > at the same time.
> >
> > Thanks for your efforts.
> > But I feel this change has too many constraints for the current status of
> > the DPDK. It's probably too early to adopt such policy.
> >
> I think you may be misunderstanding something. What constraints do you
> beleive
> that this patch imposes? Note it doesn't in any way prevent changes to the ABI
> of the DPDK, but rather gives us infrastructure to support multiple ABI
> revisions at the same time, so that applications built against DPDK shared
> libraries can continue to function properly at least for some time until we
> decide to deprecate that ABI level.
>
I view all this as a positive step. I consider backward compatibility as something that should always be encouraged, and I agree with Neil that this should allow us to guarantee compatibility for our customers while still having a path open to us to change things if we really need to.
> This is all based on the versioning strategy outlined here:
> http://www.akkadia.org/drepper/dsohowto.pdf
>
> That may help clarify things for you.
>
> > By the way, this versioning doesn't cover structure changes.
> No, it doesn't. No link-time mechanism does so.
>
> > How could it be managed?
> Thats a subject that is open to discussion, but my initial thinking is that we
> need to handle it on a case by case basis:
>
> * For minor updates, where allocation of a structure is done on the heap and
> new
> fields need to be added, appending them to the end of a structure and providing
> an initial value is sufficient.
>
> * For major changes, where fields need to be removed, or re-arranged, mostly
> likely the API surfaces which accept or return those structures as
> inputs/outputs will need to have new versions written to accept the new version
> of the structure, and internally we will have to support both formats for a time
> (according to the policy I documented, that is currently a single major
> release). I.e. if you want to change struct foo, which is accepted as a
> parameter for the function bar(struct foo *ptr), then for a release we would
> need to create struct foo_v2 with the new format, map a new function foo_v2
> to
> the exported foo@@DPDK_1.(X+1), and internally make the foo functions
> understand
> both the origional and v2 versions of the structure. Then in DPDK release
> 1.X+2, we can remove the old version after posting a deprecation notice with
> version 1.(X+1)
I really, really like having an official deprecation policy. The one proposed seems reasonable as a start point - we can always decide later whether we want a 1, 2 or 3 release gap between marking something as deprecated and having it removed.
/Bruce
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-18 18:23 0% ` [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility Thomas Monjalon
@ 2014-09-18 19:14 4% ` Neil Horman
2014-09-19 8:57 0% ` Richardson, Bruce
` (2 more replies)
0 siblings, 3 replies; 200+ results
From: Neil Horman @ 2014-09-18 19:14 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Thu, Sep 18, 2014 at 08:23:36PM +0200, Thomas Monjalon wrote:
> Hi Neil,
>
> 2014-09-15 15:23, Neil Horman:
> > The DPDK ABI develops and changes quickly, which makes it difficult for
> > applications to keep up with the latest version of the library, especially when
> > it (the DPDK) is built as a set of shared objects, as applications may be built
> > against an older version of the library.
> >
> > To mitigate this, this patch series introduces support for library and symbol
> > versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
> >
> > 1) Adds initial support for library versioning. Each library now has a version
> > map that explicitly calls out what symbols are exported to using applications,
> > and assigns version(s) to them
> >
> > 2) Adds support macros so that when libraries create incompatible ABI's,
> > multiple versions may be supported so that applications linked against older
> > DPDK releases can continue to function
> >
> > 3) Adds library soname versioning suffixes so that when ABI's must be broken in
> > a fashion that requires a rebuild of older applications, they will break at load
> > time, rather than cause unexpected issues at run time.
> >
> > 4) Adds documentation for ABI policy, and provides space to document deprecated
> > ABI versions, so that applications might be warned of impending changes.
> >
> > With these elements in place the DPDK has some support to allow for the extended
> > maintenence of older API's while still allowing the freedom to develop new and
> > improved API's.
> >
> > Implementing this feature will require some additional effort on the part of
> > developers and reviewers. When reviewing patches, must be checked against
> > existing exports to ensure that the function prototypes are not changing. If
> > they are, the versioning macros must be used, and the library export map should
> > be updated to reflect the new version of the function.
> >
> > When data structures change, if those structures are application accessible,
> > apis that accept or return instances of those data structures should have new
> > versions created so that users of the old data structure version might co-exist
> > at the same time.
>
> Thanks for your efforts.
> But I feel this change has too many constraints for the current status of
> the DPDK. It's probably too early to adopt such policy.
>
I think you may be misunderstanding something. What constraints do you beleive
that this patch imposes? Note it doesn't in any way prevent changes to the ABI
of the DPDK, but rather gives us infrastructure to support multiple ABI
revisions at the same time, so that applications built against DPDK shared
libraries can continue to function properly at least for some time until we
decide to deprecate that ABI level.
This is all based on the versioning strategy outlined here:
http://www.akkadia.org/drepper/dsohowto.pdf
That may help clarify things for you.
> By the way, this versioning doesn't cover structure changes.
No, it doesn't. No link-time mechanism does so.
> How could it be managed?
Thats a subject that is open to discussion, but my initial thinking is that we
need to handle it on a case by case basis:
* For minor updates, where allocation of a structure is done on the heap and new
fields need to be added, appending them to the end of a structure and providing
an initial value is sufficient.
* For major changes, where fields need to be removed, or re-arranged, mostly
likely the API surfaces which accept or return those structures as
inputs/outputs will need to have new versions written to accept the new version
of the structure, and internally we will have to support both formats for a time
(according to the policy I documented, that is currently a single major
release). I.e. if you want to change struct foo, which is accepted as a
parameter for the function bar(struct foo *ptr), then for a release we would
need to create struct foo_v2 with the new format, map a new function foo_v2 to
the exported foo@@DPDK_1.(X+1), and internally make the foo functions understand
both the origional and v2 versions of the structure. Then in DPDK release
1.X+2, we can remove the old version after posting a deprecation notice with
version 1.(X+1)
> Don't you think it would be more reliable if managed by packaging?
Solving this with packaging defeats the purpose of having shared libraries at
all. While packaging each version of the dpdk separately is possible stopgap
solution, in that it allows applications to link to differing versions of the
library independently, but that negates any expectation of timely bugfixes for
any given version of the DPDK. That is to say, if you package things this way,
and wind up with several parallel versions of the same package, and for any
bugfix that comes out upstream, the packager then has the responsibility to
adapt that fix to each package. Thats an unscalable solution, and not something
any packager is going to undertake willingly. I did a hybrid version of this in
fedora for exactly that reason. I packaged the dpdk into its own directory, but
have every intention of changing that directory every major release, so that
application writers can clearly see when they need to stop updating the dpdk,
lest their applications stop linking. I'm not going to have multiple dpdk
packages to maintain in parallel, thats just too much work.
>
> Thank you for opening this discussion with a constructive proposal.
> Let's check it later on once structures will be more stable since
> performance is the most critical target.
If I'm being honest, I have to say thats a cop out answer. We all know that
structure stability isn't a priority for the DPDK, nor will it ever be in all
likelyhood. It will continue to evolve and grow as the hardware does. And this
patch set doesn't prevent that from happening. All it does is provide some
level of stability in the API for a period of time to let 3rd party application
writers write and package applications with some allowance of time to keep up
with upstream changes on their own schedule.
I grant you that writing a good API for a shared library is difficult, but
(and feel free to disagree with this), if we don't start enforcing policies that
require good API design, its not going to happen on its own. This patch set
will highlight those API points which are difficult to maintain accross major
releases, and force us to address and improve them. To that end I've already
begun talking to some of the individual library maintainers off list to address
some of the API aspects that I have concerns about (exporting variable rather
than accessor functions, structures that don't need to be visible to users,
etc), and they've started reviewing them. We can make this better, but we can't
just say later, because theres no roadmap that lists structure stability as a
line item. As hardware improves, structures will change to operate more
efficiently or support more features. Without a hard plan, the initial goals of
the DPDK (high performance networking) will relegate ABI to such a low priority
that it will never be addressed.
To that end, can we discuss specifics? Can you ennumerate direct points that
you feel make this patch unworkable at this time? I know you mentioned some
above, and I think I addressed them (though please ask follow up questions if
I've been unclear). What other concerns do you have?
Neil
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
2014-09-15 19:23 4% [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility Neil Horman
` (3 preceding siblings ...)
2014-09-15 19:23 23% ` [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation Neil Horman
@ 2014-09-18 18:23 0% ` Thomas Monjalon
2014-09-18 19:14 4% ` Neil Horman
4 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2014-09-18 18:23 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Hi Neil,
2014-09-15 15:23, Neil Horman:
> The DPDK ABI develops and changes quickly, which makes it difficult for
> applications to keep up with the latest version of the library, especially when
> it (the DPDK) is built as a set of shared objects, as applications may be built
> against an older version of the library.
>
> To mitigate this, this patch series introduces support for library and symbol
> versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
>
> 1) Adds initial support for library versioning. Each library now has a version
> map that explicitly calls out what symbols are exported to using applications,
> and assigns version(s) to them
>
> 2) Adds support macros so that when libraries create incompatible ABI's,
> multiple versions may be supported so that applications linked against older
> DPDK releases can continue to function
>
> 3) Adds library soname versioning suffixes so that when ABI's must be broken in
> a fashion that requires a rebuild of older applications, they will break at load
> time, rather than cause unexpected issues at run time.
>
> 4) Adds documentation for ABI policy, and provides space to document deprecated
> ABI versions, so that applications might be warned of impending changes.
>
> With these elements in place the DPDK has some support to allow for the extended
> maintenence of older API's while still allowing the freedom to develop new and
> improved API's.
>
> Implementing this feature will require some additional effort on the part of
> developers and reviewers. When reviewing patches, must be checked against
> existing exports to ensure that the function prototypes are not changing. If
> they are, the versioning macros must be used, and the library export map should
> be updated to reflect the new version of the function.
>
> When data structures change, if those structures are application accessible,
> apis that accept or return instances of those data structures should have new
> versions created so that users of the old data structure version might co-exist
> at the same time.
Thanks for your efforts.
But I feel this change has too many constraints for the current status of
the DPDK. It's probably too early to adopt such policy.
By the way, this versioning doesn't cover structure changes.
How could it be managed?
Don't you think it would be more reliable if managed by packaging?
Thank you for opening this discussion with a constructive proposal.
Let's check it later on once structures will be more stable since
performance is the most critical target.
--
Thomas
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/3] New Thread Safe Hash Library
2014-09-18 15:31 0% ` De Lara Guarch, Pablo
2014-09-18 15:45 0% ` Thomas Monjalon
@ 2014-09-18 16:09 3% ` Neil Horman
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2014-09-18 16:09 UTC (permalink / raw)
To: De Lara Guarch, Pablo; +Cc: dev
On Thu, Sep 18, 2014 at 03:31:34PM +0000, De Lara Guarch, Pablo wrote:
> Hi Neil,
>
> > -----Original Message-----
> > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Sent: Thursday, September 18, 2014 1:21 PM
> > To: De Lara Guarch, Pablo
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 0/3] New Thread Safe Hash Library
> >
> > On Thu, Sep 18, 2014 at 11:34:28AM +0100, Pablo de Lara wrote:
> > > This is an alternative hash implementation to the existing hash library.
> > > This patch set provides a thread safe hash implementation, it allows users
> > > to use multiple readers/writers working on a same hash table.
> > > Main differences between the previous and the new implementation are:
> > >
> > > - Multiple readers/writers can work on the same hash table,
> > > whereas in the previous implementation writers could not work
> > > on the table at the same time readers do.
> > > - Previous implementation returned an index to a table after a lookup.
> > > This implementation returns 8-byte integers or pointers to external data.
> > > - Maximum entries to be looked up in bursts is 64, instead of 16.
> > > - Maximum key length has being increased to 128, instead of a maximum of
> > 64.
> > >
> > > Basic implementation:
> > >
> > > - A sparse table containing buckets (64-byte long) with hashes,
> > > most of which are empty, and indexes to the second table.
> > > - A compact table containing keys for final matching,
> > > plus data associated to them.
> > >
> > Thread safe hash tables seem to me like a configuration option rather than a
> > new
> > library. Instead of creating a whole new library (with a new API and ABI to
> > maintain, why not just add thread safety as a configurable option to the
> > existing hash library. That saves code space in the DPDK, and reduces
> > application complexity (as the same api is useable for thread safe and unsafe
> > hash tables)
>
> Makes sense, but implementation has changed so much to add it directly into the existing library.
> At first, this was designed to be a replacement of the existing library,
> but since API is a bit different from the old one, it was thought to leave it as an alternative,
> so users are not forced to have to change their applications if they don't want to use thread safe hash tables.
What are you talking about? The API calls between rte_hash and the new
rte_tshash are identical. The only thing that differs are the names slightly
(rte_hash vs rte_tshash), and some of the elements of the internal data
structure, which really shouldn't be accessed by the application anyway (though
that does play into some of the ABI work we've started looking at). It should
be pretty easy to modify the rte_hash library to optionally include thread
safety. A flag in the config structure, a spinlock in the internal
representation, and you're home free.
Neil
^ permalink raw reply [relevance 3%]
* Re: [dpdk-dev] [PATCH 0/3] New Thread Safe Hash Library
2014-09-18 15:31 0% ` De Lara Guarch, Pablo
@ 2014-09-18 15:45 0% ` Thomas Monjalon
2014-09-18 16:09 3% ` Neil Horman
1 sibling, 0 replies; 200+ results
From: Thomas Monjalon @ 2014-09-18 15:45 UTC (permalink / raw)
To: De Lara Guarch, Pablo; +Cc: dev
2014-09-18 15:31, De Lara Guarch, Pablo:
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Thread safe hash tables seem to me like a configuration option rather than
> > a new
> > library. Instead of creating a whole new library (with a new API and ABI
> > to maintain, why not just add thread safety as a configurable option to
> > the existing hash library. That saves code space in the DPDK, and
> > reduces application complexity (as the same api is useable for thread
> > safe and unsafe hash tables)
>
> Makes sense, but implementation has changed so much to add it directly into
> the existing library. At first, this was designed to be a replacement of
> the existing library, but since API is a bit different from the old one, it
> was thought to leave it as an alternative, so users are not forced to have
> to change their applications if they don't want to use thread safe hash
> tables.
It makes me smile :)
You basically explain that it's more complicated to properly merge two
different implementations than just throwing a new one in the big DPDK bucket.
My opinion is that it should not be integrated as is because we must try to
make DPDK something else than a trash bucket.
Thanks for continuing your effort to make DPDK easier and better.
--
Thomas
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/3] New Thread Safe Hash Library
2014-09-18 12:21 3% ` Neil Horman
@ 2014-09-18 15:31 0% ` De Lara Guarch, Pablo
2014-09-18 15:45 0% ` Thomas Monjalon
2014-09-18 16:09 3% ` Neil Horman
0 siblings, 2 replies; 200+ results
From: De Lara Guarch, Pablo @ 2014-09-18 15:31 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
Hi Neil,
> -----Original Message-----
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Thursday, September 18, 2014 1:21 PM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 0/3] New Thread Safe Hash Library
>
> On Thu, Sep 18, 2014 at 11:34:28AM +0100, Pablo de Lara wrote:
> > This is an alternative hash implementation to the existing hash library.
> > This patch set provides a thread safe hash implementation, it allows users
> > to use multiple readers/writers working on a same hash table.
> > Main differences between the previous and the new implementation are:
> >
> > - Multiple readers/writers can work on the same hash table,
> > whereas in the previous implementation writers could not work
> > on the table at the same time readers do.
> > - Previous implementation returned an index to a table after a lookup.
> > This implementation returns 8-byte integers or pointers to external data.
> > - Maximum entries to be looked up in bursts is 64, instead of 16.
> > - Maximum key length has being increased to 128, instead of a maximum of
> 64.
> >
> > Basic implementation:
> >
> > - A sparse table containing buckets (64-byte long) with hashes,
> > most of which are empty, and indexes to the second table.
> > - A compact table containing keys for final matching,
> > plus data associated to them.
> >
> Thread safe hash tables seem to me like a configuration option rather than a
> new
> library. Instead of creating a whole new library (with a new API and ABI to
> maintain, why not just add thread safety as a configurable option to the
> existing hash library. That saves code space in the DPDK, and reduces
> application complexity (as the same api is useable for thread safe and unsafe
> hash tables)
Makes sense, but implementation has changed so much to add it directly into the existing library.
At first, this was designed to be a replacement of the existing library,
but since API is a bit different from the old one, it was thought to leave it as an alternative,
so users are not forced to have to change their applications if they don't want to use thread safe hash tables.
>
> Neil
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCH 0/3] New Thread Safe Hash Library
@ 2014-09-18 12:21 3% ` Neil Horman
2014-09-18 15:31 0% ` De Lara Guarch, Pablo
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-18 12:21 UTC (permalink / raw)
To: Pablo de Lara; +Cc: dev
On Thu, Sep 18, 2014 at 11:34:28AM +0100, Pablo de Lara wrote:
> This is an alternative hash implementation to the existing hash library.
> This patch set provides a thread safe hash implementation, it allows users
> to use multiple readers/writers working on a same hash table.
> Main differences between the previous and the new implementation are:
>
> - Multiple readers/writers can work on the same hash table,
> whereas in the previous implementation writers could not work
> on the table at the same time readers do.
> - Previous implementation returned an index to a table after a lookup.
> This implementation returns 8-byte integers or pointers to external data.
> - Maximum entries to be looked up in bursts is 64, instead of 16.
> - Maximum key length has being increased to 128, instead of a maximum of 64.
>
> Basic implementation:
>
> - A sparse table containing buckets (64-byte long) with hashes,
> most of which are empty, and indexes to the second table.
> - A compact table containing keys for final matching,
> plus data associated to them.
>
Thread safe hash tables seem to me like a configuration option rather than a new
library. Instead of creating a whole new library (with a new API and ABI to
maintain, why not just add thread safety as a configurable option to the
existing hash library. That saves code space in the DPDK, and reduces
application complexity (as the same api is useable for thread safe and unsafe
hash tables)
Neil
^ permalink raw reply [relevance 3%]
* [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation
2014-09-15 19:23 4% [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility Neil Horman
` (2 preceding siblings ...)
2014-09-15 19:23 7% ` [dpdk-dev] [PATCH 3/4] Add library version extenstion Neil Horman
@ 2014-09-15 19:23 23% ` Neil Horman
2014-10-01 16:06 4% ` Sergio Gonzalez Monroy
2014-09-18 18:23 0% ` [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility Thomas Monjalon
4 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-15 19:23 UTC (permalink / raw)
To: dev
Adding a document describing rudimentary ABI policy and adding notice space for
any deprecation announcements
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
doc/abi.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 doc/abi.txt
diff --git a/doc/abi.txt b/doc/abi.txt
new file mode 100644
index 0000000..b6dcc7d
--- /dev/null
+++ b/doc/abi.txt
@@ -0,0 +1,17 @@
+ABI policy:
+ ABI versions are set at the time of major release labeling, and ABI may
+change multiple times between the last labeling and the HEAD label of the git
+tree without warning
+
+ ABI versions, once released are available until such time as their
+deprecation has been noted here for at least one major release cycle, after it
+has been tagged. E.g. the ABI for DPDK 1.8 is shipped, and then the decision to
+remove it is made during the development of DPDK 1.9. The decision will be
+recorded here, shipped with the DPDK 1.9 release, and actually removed when DPDK
+1.10 ships.
+
+ ABI versions may be deprecated in whole, or in part as needed by a given
+update.
+
+Deprecation Notices:
+
--
1.9.3
^ permalink raw reply [relevance 23%]
* [dpdk-dev] [PATCH 3/4] Add library version extenstion
2014-09-15 19:23 4% [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility Neil Horman
2014-09-15 19:23 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
@ 2014-09-15 19:23 7% ` Neil Horman
2014-10-01 11:27 0% ` Sergio Gonzalez Monroy
2014-09-15 19:23 23% ` [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation Neil Horman
2014-09-18 18:23 0% ` [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility Thomas Monjalon
4 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-15 19:23 UTC (permalink / raw)
To: dev
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken. This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
lib/librte_acl/Makefile | 2 ++
lib/librte_cfgfile/Makefile | 2 ++
lib/librte_cmdline/Makefile | 2 ++
lib/librte_compat/Makefile | 2 ++
lib/librte_distributor/Makefile | 2 ++
lib/librte_eal/bsdapp/eal/Makefile | 2 ++
lib/librte_eal/linuxapp/eal/Makefile | 2 ++
lib/librte_ether/Makefile | 2 ++
lib/librte_hash/Makefile | 2 ++
lib/librte_ip_frag/Makefile | 2 ++
lib/librte_ivshmem/Makefile | 2 ++
lib/librte_kni/Makefile | 2 ++
lib/librte_kvargs/Makefile | 2 ++
lib/librte_lpm/Makefile | 2 ++
lib/librte_malloc/Makefile | 2 ++
lib/librte_mbuf/Makefile | 2 ++
lib/librte_mempool/Makefile | 2 ++
lib/librte_meter/Makefile | 2 ++
lib/librte_pipeline/Makefile | 2 ++
lib/librte_pmd_bond/Makefile | 2 ++
lib/librte_pmd_e1000/Makefile | 2 ++
lib/librte_pmd_i40e/Makefile | 2 ++
lib/librte_pmd_ixgbe/Makefile | 2 ++
lib/librte_pmd_pcap/Makefile | 2 ++
lib/librte_pmd_ring/Makefile | 2 ++
lib/librte_pmd_virtio/Makefile | 2 ++
lib/librte_pmd_vmxnet3/Makefile | 2 ++
lib/librte_pmd_xenvirt/Makefile | 2 ++
lib/librte_port/Makefile | 2 ++
lib/librte_power/Makefile | 2 ++
lib/librte_ring/Makefile | 2 ++
lib/librte_sched/Makefile | 2 ++
lib/librte_table/Makefile | 2 ++
lib/librte_timer/Makefile | 2 ++
mk/rte.lib.mk | 12 +++++++++---
35 files changed, 77 insertions(+), 3 deletions(-)
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 1f96645..4db403b 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_acl/rte_acl_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index e655098..1c81579 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_cfgfile/rte_cfgfile_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 1a47173..b0ab5b6 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_cmdline/rte_cmdline_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
index a61511a..5f369e5 100644
--- a/lib/librte_compat/Makefile
+++ b/lib/librte_compat/Makefile
@@ -32,6 +32,8 @@
include $(RTE_SDK)/mk/rte.vars.mk
+LIBABIVER := 1
+
# install includes
SYMLINK-y-include := rte_compat.h
diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile
index 97d8bbb..12d9df1 100644
--- a/lib/librte_distributor/Makefile
+++ b/lib/librte_distributor/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_distributor/rte_distributor_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
index 2caaf00..2edd880 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -47,6 +47,8 @@ CFLAGS += $(WERROR_FLAGS) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_eal/bsdapp/eal/rte_eal_version.map
+LIBABIVER := 1
+
# specific to linuxapp exec-env
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) := eal.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_memory.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
index 254d59c..267f2c7 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -35,6 +35,8 @@ LIB = librte_eal.a
EXPORT_MAP := $(RTE_SDK)/lib/librte_eal/linuxapp/eal/rte_eal_version.map
+LIBABIVER := 1
+
VPATH += $(RTE_SDK)/lib/librte_eal/common
CFLAGS += -I$(SRCDIR)/include
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index f40b5cc..62bcf0c 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_ether/rte_ether_version.map
+LIBABIVER := 1
+
SRCS-y += rte_ethdev.c
#
diff --git a/lib/librte_hash/Makefile b/lib/librte_hash/Makefile
index a449ec2..17778ba 100644
--- a/lib/librte_hash/Makefile
+++ b/lib/librte_hash/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_hash/rte_hash_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_HASH) := rte_hash.c
SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index ede5a89..6b496dc 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_ip_frag/rte_ipfrag_version.map
+LIBABIVER := 1
+
#source files
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c
SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_reassembly.c
diff --git a/lib/librte_ivshmem/Makefile b/lib/librte_ivshmem/Makefile
index be6f21a..7c8dc17 100644
--- a/lib/librte_ivshmem/Makefile
+++ b/lib/librte_ivshmem/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAPS := $(RTE_SDK)/lib/librte_ivshmem/rte_ivshmem_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) := rte_ivshmem.c
diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
index c119fc1..59abd85 100644
--- a/lib/librte_kni/Makefile
+++ b/lib/librte_kni/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := $(RTE_SDK)/lib/librte_kni/rte_kni_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c
diff --git a/lib/librte_kvargs/Makefile b/lib/librte_kvargs/Makefile
index 83a42b1..10713db 100644
--- a/lib/librte_kvargs/Makefile
+++ b/lib/librte_kvargs/Makefile
@@ -40,6 +40,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_kvargs/rte_kvargs_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) := rte_kvargs.c
diff --git a/lib/librte_lpm/Makefile b/lib/librte_lpm/Makefile
index 05de8d9..c99bfbd 100644
--- a/lib/librte_lpm/Makefile
+++ b/lib/librte_lpm/Makefile
@@ -39,6 +39,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
EXPORT_MAP := $(RTE_SDK)/lib/librte_lpm/rte_lpm_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_LPM) := rte_lpm.c rte_lpm6.c
diff --git a/lib/librte_malloc/Makefile b/lib/librte_malloc/Makefile
index 1a5c288..3bb7a99 100644
--- a/lib/librte_malloc/Makefile
+++ b/lib/librte_malloc/Makefile
@@ -34,6 +34,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
# library name
LIB = librte_malloc.a
+LIBABIVER := 1
+
CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_malloc/rte_malloc_version.map
diff --git a/lib/librte_mbuf/Makefile b/lib/librte_mbuf/Makefile
index 5cd4941..3cf94d1 100644
--- a/lib/librte_mbuf/Makefile
+++ b/lib/librte_mbuf/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_mbuf/rte_mbuf_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MBUF) := rte_mbuf.c
diff --git a/lib/librte_mempool/Makefile b/lib/librte_mempool/Makefile
index 07b5b4e..2c2a6e8 100644
--- a/lib/librte_mempool/Makefile
+++ b/lib/librte_mempool/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_mempool/rte_mempool_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += rte_mempool.c
ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile
index 0778690..f58822e 100644
--- a/lib/librte_meter/Makefile
+++ b/lib/librte_meter/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_meter/rte_meter_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 5465d00..df44f51 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pipeline/rte_pipeline_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_bond/Makefile b/lib/librte_pmd_bond/Makefile
index 5b14ce2..2f1e83b 100644
--- a/lib/librte_pmd_bond/Makefile
+++ b/lib/librte_pmd_bond/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_bond/rte_eth_bond_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_e1000/Makefile b/lib/librte_pmd_e1000/Makefile
index e225bfe..a5e3b66 100644
--- a/lib/librte_pmd_e1000/Makefile
+++ b/lib/librte_pmd_e1000/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_e1000/rte_pmd_e1000_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index cfbe816..d59967a 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_i40e/rte_pmd_i40e_version.map
+LIBABIVER := 1
+
#
# Add extra flags for base driver files (also known as shared code)
# to disable warnings
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index 1dd14a6..fd17c09 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_ixgbe/rte_pmd_ixgbe_version.map
+LIBABIVER := 1
+
ifeq ($(CC), icc)
#
# CFLAGS for icc
diff --git a/lib/librte_pmd_pcap/Makefile b/lib/librte_pmd_pcap/Makefile
index fff5572..8f05c2c 100644
--- a/lib/librte_pmd_pcap/Makefile
+++ b/lib/librte_pmd_pcap/Makefile
@@ -42,6 +42,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_pcap/rte_pmd_pcap_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_ring/Makefile b/lib/librte_pmd_ring/Makefile
index 25ad27f..24c57fc 100644
--- a/lib/librte_pmd_ring/Makefile
+++ b/lib/librte_pmd_ring/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_ring/rte_eth_ring_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_virtio/Makefile b/lib/librte_pmd_virtio/Makefile
index bf51bd9..d0bec84 100644
--- a/lib/librte_pmd_virtio/Makefile
+++ b/lib/librte_pmd_virtio/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_virtio/rte_pmd_virtio_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index e5a1c6b..2b418f4 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -68,6 +68,8 @@ VPATH += $(RTE_SDK)/lib/librte_pmd_vmxnet3/vmxnet3
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_vmxnet3/rte_pmd_vmxnet3_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_pmd_xenvirt/Makefile b/lib/librte_pmd_xenvirt/Makefile
index 0a08b1b..6132c1c 100644
--- a/lib/librte_pmd_xenvirt/Makefile
+++ b/lib/librte_pmd_xenvirt/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_pmd_xenvirt/rte_eth_xenvirt_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index e812bda..828692f 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_port/rte_port_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index 26ee542..3261176 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing
EXPORT_MAP := $(RTE_SDK)/lib/librte_power/rte_power_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_POWER) := rte_power.c
diff --git a/lib/librte_ring/Makefile b/lib/librte_ring/Makefile
index 0adaa00..fa697ea 100644
--- a/lib/librte_ring/Makefile
+++ b/lib/librte_ring/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_ring/rte_ring_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_RING) := rte_ring.c
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index 205fb7a..1a54bf9 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -43,6 +43,8 @@ CFLAGS_rte_red.o := -D_GNU_SOURCE
EXPORT_MAP := $(RTE_SDK)/lib/librte_sched/rte_sched_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_table/Makefile b/lib/librte_table/Makefile
index 5b54acc..29b768c 100644
--- a/lib/librte_table/Makefile
+++ b/lib/librte_table/Makefile
@@ -41,6 +41,8 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := $(RTE_SDK)/lib/librte_table/rte_table_version.map
+LIBABIVER := 1
+
#
# all source are stored in SRCS-y
#
diff --git a/lib/librte_timer/Makefile b/lib/librte_timer/Makefile
index f703e5f..01772c7 100644
--- a/lib/librte_timer/Makefile
+++ b/lib/librte_timer/Makefile
@@ -38,6 +38,8 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
EXPORT_MAP := $(RTE_SDK)/lib/librte_timer/rte_timer_version.map
+LIBABIVER := 1
+
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) := rte_timer.c
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 82ac309..4d55cc9 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -37,10 +37,8 @@ include $(RTE_SDK)/mk/internal/rte.depdirs-pre.mk
# VPATH contains at least SRCDIR
VPATH += $(SRCDIR)
-
ifeq ($(RTE_BUILD_SHARED_LIB),y)
-LIB := $(patsubst %.a,%.so,$(LIB))
-
+LIB := $(patsubst %.a,%.so.$(LIBABIVER),$(LIB))
CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
endif
@@ -63,6 +61,7 @@ build: _postbuild
exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
+
ifeq ($(LINK_USING_CC),1)
# Override the definition of LD here, since we're linking with CC
LD := $(CC)
@@ -112,6 +111,10 @@ lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
#
ifeq ($(RTE_BUILD_SHARED_LIB),y)
$(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
+ifeq ($(LIBABIVER),)
+ @echo "Must Specify a $(LIB) ABI version"
+ @exit 1
+endif
@[ -d $(dir $@) ] || mkdir -p $(dir $@)
$(if $(D),\
@echo -n "$< -> $@ " ; \
@@ -125,6 +128,7 @@ $(LIB): $(OBJS-y) $(DEP_$(LIB)) FORCE
$(depfile_missing),\
$(depfile_newer)),\
$(O_TO_S_DO))
+
ifeq ($(RTE_BUILD_COMBINE_LIBS),y)
$(if $(or \
$(file_missing),\
@@ -162,10 +166,12 @@ endif
# install lib in $(RTE_OUTPUT)/lib
#
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
+ $(eval LIBSONAME := $(basename $(LIB)))
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
ifneq ($(LIB),)
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+ $(Q)ln -s -f $(RTE_OUTPUT)/lib/$(LIB) $(RTE_OUTPUT)/lib/$(LIBSONAME)
endif
#
--
1.9.3
^ permalink raw reply [relevance 7%]
* [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning
2014-09-15 19:23 4% [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility Neil Horman
@ 2014-09-15 19:23 4% ` Neil Horman
2014-09-23 10:39 0% ` Sergio Gonzalez Monroy
` (3 more replies)
` (3 subsequent siblings)
4 siblings, 4 replies; 200+ results
From: Neil Horman @ 2014-09-15 19:23 UTC (permalink / raw)
To: dev
Add initial pass header files to support symbol versioning.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
---
lib/Makefile | 1 +
lib/librte_compat/Makefile | 38 +++++++++++++++++++
lib/librte_compat/rte_compat.h | 86 ++++++++++++++++++++++++++++++++++++++++++
mk/rte.lib.mk | 6 +++
4 files changed, 131 insertions(+)
create mode 100644 lib/librte_compat/Makefile
create mode 100644 lib/librte_compat/rte_compat.h
diff --git a/lib/Makefile b/lib/Makefile
index 10c5bb3..a85b55b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -32,6 +32,7 @@
include $(RTE_SDK)/mk/rte.vars.mk
DIRS-$(CONFIG_RTE_LIBC) += libc
+DIRS-y += librte_compat
DIRS-$(CONFIG_RTE_LIBRTE_EAL) += librte_eal
DIRS-$(CONFIG_RTE_LIBRTE_MALLOC) += librte_malloc
DIRS-$(CONFIG_RTE_LIBRTE_RING) += librte_ring
diff --git a/lib/librte_compat/Makefile b/lib/librte_compat/Makefile
new file mode 100644
index 0000000..a61511a
--- /dev/null
+++ b/lib/librte_compat/Makefile
@@ -0,0 +1,38 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * 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.
+# * Neither the name of Intel Corporation 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
+# OWNER 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.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+
+# install includes
+SYMLINK-y-include := rte_compat.h
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_compat/rte_compat.h b/lib/librte_compat/rte_compat.h
new file mode 100644
index 0000000..6d65a53
--- /dev/null
+++ b/lib/librte_compat/rte_compat.h
@@ -0,0 +1,86 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _RTE_COMPAT_H_
+#define _RTE_COMPAT_H_
+
+/*
+ * This is just a stringification macro for use below.
+ */
+#define SA(x) #x
+
+#ifdef RTE_SYMBOL_VERSIONING
+
+/*
+ * Provides backwards compatibility when updating exported functions.
+ * When a symol is exported from a library to provide an API, it also provides a
+ * calling convention (ABI) that is embodied in its name, return type,
+ * arguments, etc. On occasion that function may need to change to accomodate
+ * new functionality, behavior, etc. When that occurs, it is desireable to
+ * allow for backwards compatibility for a time with older binaries that are
+ * dynamically linked to the dpdk. to support that the __vsym and
+ * VERSION_SYMBOL macros are created. They, in conjunction with the
+ * <library>_version.map file for a given library allow for multiple versions of
+ * a symbol to exist in a shared library so that older binaries need not be
+ * immediately recompiled. Their use is outlined in the following example:
+ * Assumptions: DPDK 1.(X) contains a function int foo(char *string)
+ * DPDK 1.(X+1) needs to change foo to be int foo(int index)
+ *
+ * To accomplish this:
+ * 1) Edit lib/<library>/library_version.map to add a DPDK_1.8 node, in which
+ * foo is exported as a global symbol
+ *
+ * 2) rename the existing function int foo(char *string) to
+ * int __vsym foo_v18(char *string)
+ *
+ * 3) Add this macro immediately below the function
+ * VERSION_SYMBOL(foo, _v18, 1.8);
+ *
+ */
+#define VERSION_SYMBOL(b, e, v) __asm__(".symver " SA(b) SA(e) ", "SA(b)"@DPDK_"SA(v))
+#define __vsym __attribute__((used))
+
+#else
+/*
+ * No symbol versioning in use
+ */
+#define VERSION_SYMBOL(b, e, v)
+#define __vsym
+
+/*
+ * RTE_SYMBOL_VERSIONING
+ */
+#endif
+
+
+#endif /* _RTE_COMPAT_H_ */
diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index f458258..82ac309 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -40,8 +40,12 @@ VPATH += $(SRCDIR)
ifeq ($(RTE_BUILD_SHARED_LIB),y)
LIB := $(patsubst %.a,%.so,$(LIB))
+
+CPU_LDFLAGS += --version-script=$(EXPORT_MAP)
+
endif
+
_BUILD = $(LIB)
_INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/lib/$(LIB)
_CLEAN = doclean
@@ -160,7 +164,9 @@ endif
$(RTE_OUTPUT)/lib/$(LIB): $(LIB)
@echo " INSTALL-LIB $(LIB)"
@[ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib
+ifneq ($(LIB),)
$(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib
+endif
#
# Clean all generated files
--
1.9.3
^ permalink raw reply [relevance 4%]
* [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility
@ 2014-09-15 19:23 4% Neil Horman
2014-09-15 19:23 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
` (4 more replies)
0 siblings, 5 replies; 200+ results
From: Neil Horman @ 2014-09-15 19:23 UTC (permalink / raw)
To: dev
The DPDK ABI develops and changes quickly, which makes it difficult for
applications to keep up with the latest version of the library, especially when
it (the DPDK) is built as a set of shared objects, as applications may be built
against an older version of the library.
To mitigate this, this patch series introduces support for library and symbol
versioning when the DPDK is built as a DSO. Specifically, it does 4 things:
1) Adds initial support for library versioning. Each library now has a version
map that explicitly calls out what symbols are exported to using applications,
and assigns version(s) to them
2) Adds support macros so that when libraries create incompatible ABI's,
multiple versions may be supported so that applications linked against older
DPDK releases can continue to function
3) Adds library soname versioning suffixes so that when ABI's must be broken in
a fashion that requires a rebuild of older applications, they will break at load
time, rather than cause unexpected issues at run time.
4) Adds documentation for ABI policy, and provides space to document deprecated
ABI versions, so that applications might be warned of impending changes.
With these elements in place the DPDK has some support to allow for the extended
maintenence of older API's while still allowing the freedom to develop new and
improved API's.
Implementing this feature will require some additional effort on the part of
developers and reviewers. When reviewing patches, must be checked against
existing exports to ensure that the function prototypes are not changing. If
they are, the versioning macros must be used, and the library export map should
be updated to reflect the new version of the function.
When data structures change, if those structures are application accessible,
apis that accept or return instances of those data structures should have new
versions created so that users of the old data structure version might co-exist
at the same time.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>
^ permalink raw reply [relevance 4%]
* Re: [dpdk-dev] [PATCHv5] librte_acl make it build/work for 'default' target
2014-09-02 13:43 0% ` Neil Horman
@ 2014-09-03 1:29 0% ` Thomas Monjalon
0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2014-09-03 1:29 UTC (permalink / raw)
To: Neil Horman, Konstantin Ananyev; +Cc: dev
> > Make ACL library to build/work on 'default' architecture:
> > - make rte_acl_classify_scalar really scalar
> > (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> > - Provide two versions of rte_acl_classify code path:
> > rte_acl_classify_sse() - could be build and used only on systems with sse4.2
> > and upper, return -ENOTSUP on lower arch.
> > rte_acl_classify_scalar() - a slower version, but could be build and used
> > on all systems.
> > - keep common code shared between these two codepaths.
> >
> > v2 chages:
> > run-time selection of most appropriate code-path for given ISA.
> > By default the highest supprted one is selected.
> > User can still override that selection by manually assigning new value to
> > the global function pointer rte_acl_default_classify.
> > rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
> > points to.
> >
> > V3 Changes
> > Updated classify pointer to be a function so as to better preserve ABI
> > REmoved macro definitions for match check functions to make them static inline
> >
> > V4 Changes
> > Rewrote classification selection mechanim to use a function table, so that we
> > can just store the preferred alg in the rte_acl_ctx struct so that multiprocess
> > access works. I understand that leaves us with an extra load instruction, but I
> > think thats ok, because it also allows...
> >
> > Addition of a new function rte_acl_classify_alg. This function lets you
> > specify an enum value to override the acl contexts default algorith when doing a
> > classification. This allows an application to specify a classification
> > algorithm without needing to pulicize each method. I know there was concern
> > over keeping those methods public, but we don't have a static ABI at the moment,
> > so this seems to me a reasonable thing to do, as it gives us less of an ABI
> > surface to worry about.
> >
> > Fixed misc missed static declarations
> > Removed acl_match_check.h and moved match_check function to acl_run.h
> > typdeffed function pointer to match check.
> >
> > V5 Changes
> > Updated examples/l3fwd-acl to comply with latest changes.
> > Applied other code review comments (mostly style changes).
> >
> > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
> Thanks Konstantin!
Applied for version 1.7.1.
Thanks a lot
--
Thomas
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCHv5] librte_acl make it build/work for 'default' target
2014-09-01 15:28 1% [dpdk-dev] [PATCHv5] " Konstantin Ananyev
@ 2014-09-02 13:43 0% ` Neil Horman
2014-09-03 1:29 0% ` Thomas Monjalon
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-09-02 13:43 UTC (permalink / raw)
To: Konstantin Ananyev; +Cc: dev
On Mon, Sep 01, 2014 at 04:28:44PM +0100, Konstantin Ananyev wrote:
> Make ACL library to build/work on 'default' architecture:
> - make rte_acl_classify_scalar really scalar
> (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> - Provide two versions of rte_acl_classify code path:
> rte_acl_classify_sse() - could be build and used only on systems with sse4.2
> and upper, return -ENOTSUP on lower arch.
> rte_acl_classify_scalar() - a slower version, but could be build and used
> on all systems.
> - keep common code shared between these two codepaths.
>
> v2 chages:
> run-time selection of most appropriate code-path for given ISA.
> By default the highest supprted one is selected.
> User can still override that selection by manually assigning new value to
> the global function pointer rte_acl_default_classify.
> rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
> points to.
>
> V3 Changes
> Updated classify pointer to be a function so as to better preserve ABI
> REmoved macro definitions for match check functions to make them static inline
>
> V4 Changes
> Rewrote classification selection mechanim to use a function table, so that we
> can just store the preferred alg in the rte_acl_ctx struct so that multiprocess
> access works. I understand that leaves us with an extra load instruction, but I
> think thats ok, because it also allows...
>
> Addition of a new function rte_acl_classify_alg. This function lets you
> specify an enum value to override the acl contexts default algorith when doing a
> classification. This allows an application to specify a classification
> algorithm without needing to pulicize each method. I know there was concern
> over keeping those methods public, but we don't have a static ABI at the moment,
> so this seems to me a reasonable thing to do, as it gives us less of an ABI
> surface to worry about.
>
> Fixed misc missed static declarations
> Removed acl_match_check.h and moved match_check function to acl_run.h
> typdeffed function pointer to match check.
>
> V5 Changes
> Updated examples/l3fwd-acl to comply with latest changes.
> Applied other code review comments (mostly style changes).
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Thanks Konstantin!
Neil
^ permalink raw reply [relevance 0%]
* [dpdk-dev] [PATCHv5] librte_acl make it build/work for 'default' target
@ 2014-09-01 15:28 1% Konstantin Ananyev
2014-09-02 13:43 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Konstantin Ananyev @ 2014-09-01 15:28 UTC (permalink / raw)
To: dev, dev
Make ACL library to build/work on 'default' architecture:
- make rte_acl_classify_scalar really scalar
(make sure it wouldn't use sse4 instrincts through resolve_priority()).
- Provide two versions of rte_acl_classify code path:
rte_acl_classify_sse() - could be build and used only on systems with sse4.2
and upper, return -ENOTSUP on lower arch.
rte_acl_classify_scalar() - a slower version, but could be build and used
on all systems.
- keep common code shared between these two codepaths.
v2 chages:
run-time selection of most appropriate code-path for given ISA.
By default the highest supprted one is selected.
User can still override that selection by manually assigning new value to
the global function pointer rte_acl_default_classify.
rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
points to.
V3 Changes
Updated classify pointer to be a function so as to better preserve ABI
REmoved macro definitions for match check functions to make them static inline
V4 Changes
Rewrote classification selection mechanim to use a function table, so that we
can just store the preferred alg in the rte_acl_ctx struct so that multiprocess
access works. I understand that leaves us with an extra load instruction, but I
think thats ok, because it also allows...
Addition of a new function rte_acl_classify_alg. This function lets you
specify an enum value to override the acl contexts default algorith when doing a
classification. This allows an application to specify a classification
algorithm without needing to pulicize each method. I know there was concern
over keeping those methods public, but we don't have a static ABI at the moment,
so this seems to me a reasonable thing to do, as it gives us less of an ABI
surface to worry about.
Fixed misc missed static declarations
Removed acl_match_check.h and moved match_check function to acl_run.h
typdeffed function pointer to match check.
V5 Changes
Updated examples/l3fwd-acl to comply with latest changes.
Applied other code review comments (mostly style changes).
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
app/test-acl/main.c | 20 +-
app/test/test_acl.c | 19 +-
examples/l3fwd-acl/main.c | 22 +-
lib/librte_acl/Makefile | 5 +-
lib/librte_acl/acl.h | 15 +
lib/librte_acl/acl_bld.c | 5 +-
lib/librte_acl/acl_run.c | 944 ----------------------------------------
lib/librte_acl/acl_run.h | 268 ++++++++++++
lib/librte_acl/acl_run_scalar.c | 193 ++++++++
lib/librte_acl/acl_run_sse.c | 626 ++++++++++++++++++++++++++
lib/librte_acl/rte_acl.c | 55 +++
lib/librte_acl/rte_acl.h | 56 ++-
12 files changed, 1239 insertions(+), 989 deletions(-)
delete mode 100644 lib/librte_acl/acl_run.c
create mode 100644 lib/librte_acl/acl_run.h
create mode 100644 lib/librte_acl/acl_run_scalar.c
create mode 100644 lib/librte_acl/acl_run_sse.c
diff --git a/app/test-acl/main.c b/app/test-acl/main.c
index d654409..44add10 100644
--- a/app/test-acl/main.c
+++ b/app/test-acl/main.c
@@ -772,6 +772,15 @@ acx_init(void)
if (config.acx == NULL)
rte_exit(rte_errno, "failed to create ACL context\n");
+ /* set default classify method to scalar for this context. */
+ if (config.scalar) {
+ ret = rte_acl_set_ctx_classify(config.acx,
+ RTE_ACL_CLASSIFY_SCALAR);
+ if (ret != 0)
+ rte_exit(ret, "failed to setup classify method "
+ "for ACL context\n");
+ }
+
/* add ACL rules. */
f = fopen(config.rule_file, "r");
if (f == NULL)
@@ -780,7 +789,7 @@ acx_init(void)
ret = add_cb_rules(f, config.acx);
if (ret != 0)
- rte_exit(rte_errno, "failed to add rules into ACL context\n");
+ rte_exit(ret, "failed to add rules into ACL context\n");
fclose(f);
@@ -815,13 +824,8 @@ search_ip5tuples_once(uint32_t categories, uint32_t step, int scalar)
v += config.trace_sz;
}
- if (scalar != 0)
- ret = rte_acl_classify_scalar(config.acx, data,
- results, n, categories);
-
- else
- ret = rte_acl_classify(config.acx, data,
- results, n, categories);
+ ret = rte_acl_classify(config.acx, data, results,
+ n, categories);
if (ret != 0)
rte_exit(ret, "classify for ipv%c_5tuples returns %d\n",
diff --git a/app/test/test_acl.c b/app/test/test_acl.c
index c6b3f86..356d620 100644
--- a/app/test/test_acl.c
+++ b/app/test/test_acl.c
@@ -146,8 +146,9 @@ test_classify_run(struct rte_acl_ctx *acx)
}
/* make a quick check for scalar */
- ret = rte_acl_classify_scalar(acx, data, results,
- RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES);
+ ret = rte_acl_classify_alg(acx, data, results,
+ RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES,
+ RTE_ACL_CLASSIFY_SCALAR);
if (ret != 0) {
printf("Line %i: SSE classify failed!\n", __LINE__);
goto err;
@@ -341,8 +342,8 @@ test_invalid_layout(void)
}
/* classify tuples */
- ret = rte_acl_classify(acx, data, results,
- RTE_DIM(results), 1);
+ ret = rte_acl_classify_alg(acx, data, results,
+ RTE_DIM(results), 1, RTE_ACL_CLASSIFY_SCALAR);
if (ret != 0) {
printf("Line %i: SSE classify failed!\n", __LINE__);
rte_acl_free(acx);
@@ -360,8 +361,9 @@ test_invalid_layout(void)
}
/* classify tuples (scalar) */
- ret = rte_acl_classify_scalar(acx, data, results,
- RTE_DIM(results), 1);
+ ret = rte_acl_classify_alg(acx, data, results, RTE_DIM(results), 1,
+ RTE_ACL_CLASSIFY_SCALAR);
+
if (ret != 0) {
printf("Line %i: Scalar classify failed!\n", __LINE__);
rte_acl_free(acx);
@@ -848,7 +850,8 @@ test_invalid_parameters(void)
/* scalar classify test */
/* cover zero categories in classify (should not fail) */
- result = rte_acl_classify_scalar(acx, NULL, NULL, 0, 0);
+ result = rte_acl_classify_alg(acx, NULL, NULL, 0, 0,
+ RTE_ACL_CLASSIFY_SCALAR);
if (result != 0) {
printf("Line %i: Scalar classify with zero categories "
"failed!\n", __LINE__);
@@ -857,7 +860,7 @@ test_invalid_parameters(void)
}
/* cover invalid but positive categories in classify */
- result = rte_acl_classify_scalar(acx, NULL, NULL, 0, 3);
+ result = rte_acl_classify(acx, NULL, NULL, 0, 3);
if (result == 0) {
printf("Line %i: Scalar classify with 3 categories "
"should have failed!\n", __LINE__);
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 9b2c21b..eac0eab 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -278,15 +278,6 @@ send_single_packet(struct rte_mbuf *m, uint8_t port);
(in) = end + 1; \
} while (0)
-#define CLASSIFY(context, data, res, num, cat) do { \
- if (scalar) \
- rte_acl_classify_scalar((context), (data), \
- (res), (num), (cat)); \
- else \
- rte_acl_classify((context), (data), \
- (res), (num), (cat)); \
-} while (0)
-
/*
* ACL rules should have higher priorities than route ones to ensure ACL rule
* always be found when input packets have multi-matches in the database.
@@ -1216,6 +1207,11 @@ setup_acl(struct rte_acl_rule *route_base,
if ((context = rte_acl_create(&acl_param)) == NULL)
rte_exit(EXIT_FAILURE, "Failed to create ACL context\n");
+ if (parm_config.scalar && rte_acl_set_ctx_classify(context,
+ RTE_ACL_CLASSIFY_SCALAR) != 0)
+ rte_exit(EXIT_FAILURE,
+ "Failed to setup classify method for ACL context\n");
+
if (rte_acl_add_rules(context, route_base, route_num) < 0)
rte_exit(EXIT_FAILURE, "add rules failed\n");
@@ -1436,10 +1432,8 @@ main_loop(__attribute__((unused)) void *dummy)
int socketid;
const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1)
/ US_PER_S * BURST_TX_DRAIN_US;
- int scalar = parm_config.scalar;
prev_tsc = 0;
-
lcore_id = rte_lcore_id();
qconf = &lcore_conf[lcore_id];
socketid = rte_lcore_to_socket_id(lcore_id);
@@ -1503,7 +1497,8 @@ main_loop(__attribute__((unused)) void *dummy)
nb_rx);
if (acl_search.num_ipv4) {
- CLASSIFY(acl_config.acx_ipv4[socketid],
+ rte_acl_classify(
+ acl_config.acx_ipv4[socketid],
acl_search.data_ipv4,
acl_search.res_ipv4,
acl_search.num_ipv4,
@@ -1515,7 +1510,8 @@ main_loop(__attribute__((unused)) void *dummy)
}
if (acl_search.num_ipv6) {
- CLASSIFY(acl_config.acx_ipv6[socketid],
+ rte_acl_classify(
+ acl_config.acx_ipv6[socketid],
acl_search.data_ipv6,
acl_search.res_ipv6,
acl_search.num_ipv6,
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 4fe4593..65e566d 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -43,7 +43,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += rte_acl.c
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_bld.c
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_gen.c
-SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run.c
+SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_scalar.c
+SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_sse.c
+
+CFLAGS_acl_run_sse.o += -msse4.1
# install this header file
SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include := rte_acl_osdep.h
diff --git a/lib/librte_acl/acl.h b/lib/librte_acl/acl.h
index b9d63fd..102fa51 100644
--- a/lib/librte_acl/acl.h
+++ b/lib/librte_acl/acl.h
@@ -153,6 +153,7 @@ struct rte_acl_ctx {
/** Name of the ACL context. */
int32_t socket_id;
/** Socket ID to allocate memory from. */
+ enum rte_acl_classify_alg alg;
void *rules;
uint32_t max_rules;
uint32_t rule_sz;
@@ -174,6 +175,20 @@ int rte_acl_gen(struct rte_acl_ctx *ctx, struct rte_acl_trie *trie,
struct rte_acl_bld_trie *node_bld_trie, uint32_t num_tries,
uint32_t num_categories, uint32_t data_index_sz, int match_num);
+typedef int (*rte_acl_classify_t)
+(const struct rte_acl_ctx *, const uint8_t **, uint32_t *, uint32_t, uint32_t);
+
+/*
+ * Different implementations of ACL classify.
+ */
+int
+rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories);
+
+int
+rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c
index 873447b..09d58ea 100644
--- a/lib/librte_acl/acl_bld.c
+++ b/lib/librte_acl/acl_bld.c
@@ -31,7 +31,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <nmmintrin.h>
#include <rte_acl.h>
#include "tb_mem.h"
#include "acl.h"
@@ -1480,8 +1479,8 @@ acl_calc_wildness(struct rte_acl_build_rule *head,
switch (rule->config->defs[n].type) {
case RTE_ACL_FIELD_TYPE_BITMASK:
- wild = (size -
- _mm_popcnt_u32(fld->mask_range.u8)) /
+ wild = (size - __builtin_popcount(
+ fld->mask_range.u8)) /
size;
break;
diff --git a/lib/librte_acl/acl_run.c b/lib/librte_acl/acl_run.c
deleted file mode 100644
index e3d9fc1..0000000
--- a/lib/librte_acl/acl_run.c
+++ /dev/null
@@ -1,944 +0,0 @@
-/*-
- * BSD LICENSE
- *
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Intel Corporation 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
- * OWNER 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.
- */
-
-#include <rte_acl.h>
-#include "acl_vect.h"
-#include "acl.h"
-
-#define MAX_SEARCHES_SSE8 8
-#define MAX_SEARCHES_SSE4 4
-#define MAX_SEARCHES_SSE2 2
-#define MAX_SEARCHES_SCALAR 2
-
-#define GET_NEXT_4BYTES(prm, idx) \
- (*((const int32_t *)((prm)[(idx)].data + *(prm)[idx].data_index++)))
-
-
-#define RTE_ACL_NODE_INDEX ((uint32_t)~RTE_ACL_NODE_TYPE)
-
-#define SCALAR_QRANGE_MULT 0x01010101
-#define SCALAR_QRANGE_MASK 0x7f7f7f7f
-#define SCALAR_QRANGE_MIN 0x80808080
-
-enum {
- SHUFFLE32_SLOT1 = 0xe5,
- SHUFFLE32_SLOT2 = 0xe6,
- SHUFFLE32_SLOT3 = 0xe7,
- SHUFFLE32_SWAP64 = 0x4e,
-};
-
-/*
- * Structure to manage N parallel trie traversals.
- * The runtime trie traversal routines can process 8, 4, or 2 tries
- * in parallel. Each packet may require multiple trie traversals (up to 4).
- * This structure is used to fill the slots (0 to n-1) for parallel processing
- * with the trie traversals needed for each packet.
- */
-struct acl_flow_data {
- uint32_t num_packets;
- /* number of packets processed */
- uint32_t started;
- /* number of trie traversals in progress */
- uint32_t trie;
- /* current trie index (0 to N-1) */
- uint32_t cmplt_size;
- uint32_t total_packets;
- uint32_t categories;
- /* number of result categories per packet. */
- /* maximum number of packets to process */
- const uint64_t *trans;
- const uint8_t **data;
- uint32_t *results;
- struct completion *last_cmplt;
- struct completion *cmplt_array;
-};
-
-/*
- * Structure to maintain running results for
- * a single packet (up to 4 tries).
- */
-struct completion {
- uint32_t *results; /* running results. */
- int32_t priority[RTE_ACL_MAX_CATEGORIES]; /* running priorities. */
- uint32_t count; /* num of remaining tries */
- /* true for allocated struct */
-} __attribute__((aligned(XMM_SIZE)));
-
-/*
- * One parms structure for each slot in the search engine.
- */
-struct parms {
- const uint8_t *data;
- /* input data for this packet */
- const uint32_t *data_index;
- /* data indirection for this trie */
- struct completion *cmplt;
- /* completion data for this packet */
-};
-
-/*
- * Define an global idle node for unused engine slots
- */
-static const uint32_t idle[UINT8_MAX + 1];
-
-static const rte_xmm_t mm_type_quad_range = {
- .u32 = {
- RTE_ACL_NODE_QRANGE,
- RTE_ACL_NODE_QRANGE,
- RTE_ACL_NODE_QRANGE,
- RTE_ACL_NODE_QRANGE,
- },
-};
-
-static const rte_xmm_t mm_type_quad_range64 = {
- .u32 = {
- RTE_ACL_NODE_QRANGE,
- RTE_ACL_NODE_QRANGE,
- 0,
- 0,
- },
-};
-
-static const rte_xmm_t mm_shuffle_input = {
- .u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c},
-};
-
-static const rte_xmm_t mm_shuffle_input64 = {
- .u32 = {0x00000000, 0x04040404, 0x80808080, 0x80808080},
-};
-
-static const rte_xmm_t mm_ones_16 = {
- .u16 = {1, 1, 1, 1, 1, 1, 1, 1},
-};
-
-static const rte_xmm_t mm_bytes = {
- .u32 = {UINT8_MAX, UINT8_MAX, UINT8_MAX, UINT8_MAX},
-};
-
-static const rte_xmm_t mm_bytes64 = {
- .u32 = {UINT8_MAX, UINT8_MAX, 0, 0},
-};
-
-static const rte_xmm_t mm_match_mask = {
- .u32 = {
- RTE_ACL_NODE_MATCH,
- RTE_ACL_NODE_MATCH,
- RTE_ACL_NODE_MATCH,
- RTE_ACL_NODE_MATCH,
- },
-};
-
-static const rte_xmm_t mm_match_mask64 = {
- .u32 = {
- RTE_ACL_NODE_MATCH,
- 0,
- RTE_ACL_NODE_MATCH,
- 0,
- },
-};
-
-static const rte_xmm_t mm_index_mask = {
- .u32 = {
- RTE_ACL_NODE_INDEX,
- RTE_ACL_NODE_INDEX,
- RTE_ACL_NODE_INDEX,
- RTE_ACL_NODE_INDEX,
- },
-};
-
-static const rte_xmm_t mm_index_mask64 = {
- .u32 = {
- RTE_ACL_NODE_INDEX,
- RTE_ACL_NODE_INDEX,
- 0,
- 0,
- },
-};
-
-/*
- * Allocate a completion structure to manage the tries for a packet.
- */
-static inline struct completion *
-alloc_completion(struct completion *p, uint32_t size, uint32_t tries,
- uint32_t *results)
-{
- uint32_t n;
-
- for (n = 0; n < size; n++) {
-
- if (p[n].count == 0) {
-
- /* mark as allocated and set number of tries. */
- p[n].count = tries;
- p[n].results = results;
- return &(p[n]);
- }
- }
-
- /* should never get here */
- return NULL;
-}
-
-/*
- * Resolve priority for a single result trie.
- */
-static inline void
-resolve_single_priority(uint64_t transition, int n,
- const struct rte_acl_ctx *ctx, struct parms *parms,
- const struct rte_acl_match_results *p)
-{
- if (parms[n].cmplt->count == ctx->num_tries ||
- parms[n].cmplt->priority[0] <=
- p[transition].priority[0]) {
-
- parms[n].cmplt->priority[0] = p[transition].priority[0];
- parms[n].cmplt->results[0] = p[transition].results[0];
- }
-
- parms[n].cmplt->count--;
-}
-
-/*
- * Resolve priority for multiple results. This consists comparing
- * the priority of the current traversal with the running set of
- * results for the packet. For each result, keep a running array of
- * the result (rule number) and its priority for each category.
- */
-static inline void
-resolve_priority(uint64_t transition, int n, const struct rte_acl_ctx *ctx,
- struct parms *parms, const struct rte_acl_match_results *p,
- uint32_t categories)
-{
- uint32_t x;
- xmm_t results, priority, results1, priority1, selector;
- xmm_t *saved_results, *saved_priority;
-
- for (x = 0; x < categories; x += RTE_ACL_RESULTS_MULTIPLIER) {
-
- saved_results = (xmm_t *)(&parms[n].cmplt->results[x]);
- saved_priority =
- (xmm_t *)(&parms[n].cmplt->priority[x]);
-
- /* get results and priorities for completed trie */
- results = MM_LOADU((const xmm_t *)&p[transition].results[x]);
- priority = MM_LOADU((const xmm_t *)&p[transition].priority[x]);
-
- /* if this is not the first completed trie */
- if (parms[n].cmplt->count != ctx->num_tries) {
-
- /* get running best results and their priorities */
- results1 = MM_LOADU(saved_results);
- priority1 = MM_LOADU(saved_priority);
-
- /* select results that are highest priority */
- selector = MM_CMPGT32(priority1, priority);
- results = MM_BLENDV8(results, results1, selector);
- priority = MM_BLENDV8(priority, priority1, selector);
- }
-
- /* save running best results and their priorities */
- MM_STOREU(saved_results, results);
- MM_STOREU(saved_priority, priority);
- }
-
- /* Count down completed tries for this search request */
- parms[n].cmplt->count--;
-}
-
-/*
- * Routine to fill a slot in the parallel trie traversal array (parms) from
- * the list of packets (flows).
- */
-static inline uint64_t
-acl_start_next_trie(struct acl_flow_data *flows, struct parms *parms, int n,
- const struct rte_acl_ctx *ctx)
-{
- uint64_t transition;
-
- /* if there are any more packets to process */
- if (flows->num_packets < flows->total_packets) {
- parms[n].data = flows->data[flows->num_packets];
- parms[n].data_index = ctx->trie[flows->trie].data_index;
-
- /* if this is the first trie for this packet */
- if (flows->trie == 0) {
- flows->last_cmplt = alloc_completion(flows->cmplt_array,
- flows->cmplt_size, ctx->num_tries,
- flows->results +
- flows->num_packets * flows->categories);
- }
-
- /* set completion parameters and starting index for this slot */
- parms[n].cmplt = flows->last_cmplt;
- transition =
- flows->trans[parms[n].data[*parms[n].data_index++] +
- ctx->trie[flows->trie].root_index];
-
- /*
- * if this is the last trie for this packet,
- * then setup next packet.
- */
- flows->trie++;
- if (flows->trie >= ctx->num_tries) {
- flows->trie = 0;
- flows->num_packets++;
- }
-
- /* keep track of number of active trie traversals */
- flows->started++;
-
- /* no more tries to process, set slot to an idle position */
- } else {
- transition = ctx->idle;
- parms[n].data = (const uint8_t *)idle;
- parms[n].data_index = idle;
- }
- return transition;
-}
-
-/*
- * Detect matches. If a match node transition is found, then this trie
- * traversal is complete and fill the slot with the next trie
- * to be processed.
- */
-static inline uint64_t
-acl_match_check_transition(uint64_t transition, int slot,
- const struct rte_acl_ctx *ctx, struct parms *parms,
- struct acl_flow_data *flows)
-{
- const struct rte_acl_match_results *p;
-
- p = (const struct rte_acl_match_results *)
- (flows->trans + ctx->match_index);
-
- if (transition & RTE_ACL_NODE_MATCH) {
-
- /* Remove flags from index and decrement active traversals */
- transition &= RTE_ACL_NODE_INDEX;
- flows->started--;
-
- /* Resolve priorities for this trie and running results */
- if (flows->categories == 1)
- resolve_single_priority(transition, slot, ctx,
- parms, p);
- else
- resolve_priority(transition, slot, ctx, parms, p,
- flows->categories);
-
- /* Fill the slot with the next trie or idle trie */
- transition = acl_start_next_trie(flows, parms, slot, ctx);
-
- } else if (transition == ctx->idle) {
- /* reset indirection table for idle slots */
- parms[slot].data_index = idle;
- }
-
- return transition;
-}
-
-/*
- * Extract transitions from an XMM register and check for any matches
- */
-static void
-acl_process_matches(xmm_t *indicies, int slot, const struct rte_acl_ctx *ctx,
- struct parms *parms, struct acl_flow_data *flows)
-{
- uint64_t transition1, transition2;
-
- /* extract transition from low 64 bits. */
- transition1 = MM_CVT64(*indicies);
-
- /* extract transition from high 64 bits. */
- *indicies = MM_SHUFFLE32(*indicies, SHUFFLE32_SWAP64);
- transition2 = MM_CVT64(*indicies);
-
- transition1 = acl_match_check_transition(transition1, slot, ctx,
- parms, flows);
- transition2 = acl_match_check_transition(transition2, slot + 1, ctx,
- parms, flows);
-
- /* update indicies with new transitions. */
- *indicies = MM_SET64(transition2, transition1);
-}
-
-/*
- * Check for a match in 2 transitions (contained in SSE register)
- */
-static inline void
-acl_match_check_x2(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
- struct acl_flow_data *flows, xmm_t *indicies, xmm_t match_mask)
-{
- xmm_t temp;
-
- temp = MM_AND(match_mask, *indicies);
- while (!MM_TESTZ(temp, temp)) {
- acl_process_matches(indicies, slot, ctx, parms, flows);
- temp = MM_AND(match_mask, *indicies);
- }
-}
-
-/*
- * Check for any match in 4 transitions (contained in 2 SSE registers)
- */
-static inline void
-acl_match_check_x4(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
- struct acl_flow_data *flows, xmm_t *indicies1, xmm_t *indicies2,
- xmm_t match_mask)
-{
- xmm_t temp;
-
- /* put low 32 bits of each transition into one register */
- temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
- 0x88);
- /* test for match node */
- temp = MM_AND(match_mask, temp);
-
- while (!MM_TESTZ(temp, temp)) {
- acl_process_matches(indicies1, slot, ctx, parms, flows);
- acl_process_matches(indicies2, slot + 2, ctx, parms, flows);
-
- temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
- (__m128)*indicies2,
- 0x88);
- temp = MM_AND(match_mask, temp);
- }
-}
-
-/*
- * Calculate the address of the next transition for
- * all types of nodes. Note that only DFA nodes and range
- * nodes actually transition to another node. Match
- * nodes don't move.
- */
-static inline xmm_t
-acl_calc_addr(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
- xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
- xmm_t *indicies1, xmm_t *indicies2)
-{
- xmm_t addr, node_types, temp;
-
- /*
- * Note that no transition is done for a match
- * node and therefore a stream freezes when
- * it reaches a match.
- */
-
- /* Shuffle low 32 into temp and high 32 into indicies2 */
- temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
- 0x88);
- *indicies2 = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
- (__m128)*indicies2, 0xdd);
-
- /* Calc node type and node addr */
- node_types = MM_ANDNOT(index_mask, temp);
- addr = MM_AND(index_mask, temp);
-
- /*
- * Calc addr for DFAs - addr = dfa_index + input_byte
- */
-
- /* mask for DFA type (0) nodes */
- temp = MM_CMPEQ32(node_types, MM_XOR(node_types, node_types));
-
- /* add input byte to DFA position */
- temp = MM_AND(temp, bytes);
- temp = MM_AND(temp, next_input);
- addr = MM_ADD32(addr, temp);
-
- /*
- * Calc addr for Range nodes -> range_index + range(input)
- */
- node_types = MM_CMPEQ32(node_types, type_quad_range);
-
- /*
- * Calculate number of range boundaries that are less than the
- * input value. Range boundaries for each node are in signed 8 bit,
- * ordered from -128 to 127 in the indicies2 register.
- * This is effectively a popcnt of bytes that are greater than the
- * input byte.
- */
-
- /* shuffle input byte to all 4 positions of 32 bit value */
- temp = MM_SHUFFLE8(next_input, shuffle_input);
-
- /* check ranges */
- temp = MM_CMPGT8(temp, *indicies2);
-
- /* convert -1 to 1 (bytes greater than input byte */
- temp = MM_SIGN8(temp, temp);
-
- /* horizontal add pairs of bytes into words */
- temp = MM_MADD8(temp, temp);
-
- /* horizontal add pairs of words into dwords */
- temp = MM_MADD16(temp, ones_16);
-
- /* mask to range type nodes */
- temp = MM_AND(temp, node_types);
-
- /* add index into node position */
- return MM_ADD32(addr, temp);
-}
-
-/*
- * Process 4 transitions (in 2 SIMD registers) in parallel
- */
-static inline xmm_t
-transition4(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
- xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
- const uint64_t *trans, xmm_t *indicies1, xmm_t *indicies2)
-{
- xmm_t addr;
- uint64_t trans0, trans2;
-
- /* Calculate the address (array index) for all 4 transitions. */
-
- addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
- bytes, type_quad_range, indicies1, indicies2);
-
- /* Gather 64 bit transitions and pack back into 2 registers. */
-
- trans0 = trans[MM_CVT32(addr)];
-
- /* get slot 2 */
-
- /* {x0, x1, x2, x3} -> {x2, x1, x2, x3} */
- addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT2);
- trans2 = trans[MM_CVT32(addr)];
-
- /* get slot 1 */
-
- /* {x2, x1, x2, x3} -> {x1, x1, x2, x3} */
- addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
- *indicies1 = MM_SET64(trans[MM_CVT32(addr)], trans0);
-
- /* get slot 3 */
-
- /* {x1, x1, x2, x3} -> {x3, x1, x2, x3} */
- addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT3);
- *indicies2 = MM_SET64(trans[MM_CVT32(addr)], trans2);
-
- return MM_SRL32(next_input, 8);
-}
-
-static inline void
-acl_set_flow(struct acl_flow_data *flows, struct completion *cmplt,
- uint32_t cmplt_size, const uint8_t **data, uint32_t *results,
- uint32_t data_num, uint32_t categories, const uint64_t *trans)
-{
- flows->num_packets = 0;
- flows->started = 0;
- flows->trie = 0;
- flows->last_cmplt = NULL;
- flows->cmplt_array = cmplt;
- flows->total_packets = data_num;
- flows->categories = categories;
- flows->cmplt_size = cmplt_size;
- flows->data = data;
- flows->results = results;
- flows->trans = trans;
-}
-
-/*
- * Execute trie traversal with 8 traversals in parallel
- */
-static inline void
-search_sse_8(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t total_packets, uint32_t categories)
-{
- int n;
- struct acl_flow_data flows;
- uint64_t index_array[MAX_SEARCHES_SSE8];
- struct completion cmplt[MAX_SEARCHES_SSE8];
- struct parms parms[MAX_SEARCHES_SSE8];
- xmm_t input0, input1;
- xmm_t indicies1, indicies2, indicies3, indicies4;
-
- acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
- total_packets, categories, ctx->trans_table);
-
- for (n = 0; n < MAX_SEARCHES_SSE8; n++) {
- cmplt[n].count = 0;
- index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
- }
-
- /*
- * indicies1 contains index_array[0,1]
- * indicies2 contains index_array[2,3]
- * indicies3 contains index_array[4,5]
- * indicies4 contains index_array[6,7]
- */
-
- indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
- indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
-
- indicies3 = MM_LOADU((xmm_t *) &index_array[4]);
- indicies4 = MM_LOADU((xmm_t *) &index_array[6]);
-
- /* Check for any matches. */
- acl_match_check_x4(0, ctx, parms, &flows,
- &indicies1, &indicies2, mm_match_mask.m);
- acl_match_check_x4(4, ctx, parms, &flows,
- &indicies3, &indicies4, mm_match_mask.m);
-
- while (flows.started > 0) {
-
- /* Gather 4 bytes of input data for each stream. */
- input0 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0),
- 0);
- input1 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 4),
- 0);
-
- input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 1), 1);
- input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 5), 1);
-
- input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 2), 2);
- input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 6), 2);
-
- input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 3), 3);
- input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 7), 3);
-
- /* Process the 4 bytes of input on each stream. */
-
- input0 = transition4(mm_index_mask.m, input0,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input1 = transition4(mm_index_mask.m, input1,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies3, &indicies4);
-
- input0 = transition4(mm_index_mask.m, input0,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input1 = transition4(mm_index_mask.m, input1,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies3, &indicies4);
-
- input0 = transition4(mm_index_mask.m, input0,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input1 = transition4(mm_index_mask.m, input1,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies3, &indicies4);
-
- input0 = transition4(mm_index_mask.m, input0,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input1 = transition4(mm_index_mask.m, input1,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies3, &indicies4);
-
- /* Check for any matches. */
- acl_match_check_x4(0, ctx, parms, &flows,
- &indicies1, &indicies2, mm_match_mask.m);
- acl_match_check_x4(4, ctx, parms, &flows,
- &indicies3, &indicies4, mm_match_mask.m);
- }
-}
-
-/*
- * Execute trie traversal with 4 traversals in parallel
- */
-static inline void
-search_sse_4(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, int total_packets, uint32_t categories)
-{
- int n;
- struct acl_flow_data flows;
- uint64_t index_array[MAX_SEARCHES_SSE4];
- struct completion cmplt[MAX_SEARCHES_SSE4];
- struct parms parms[MAX_SEARCHES_SSE4];
- xmm_t input, indicies1, indicies2;
-
- acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
- total_packets, categories, ctx->trans_table);
-
- for (n = 0; n < MAX_SEARCHES_SSE4; n++) {
- cmplt[n].count = 0;
- index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
- }
-
- indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
- indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
-
- /* Check for any matches. */
- acl_match_check_x4(0, ctx, parms, &flows,
- &indicies1, &indicies2, mm_match_mask.m);
-
- while (flows.started > 0) {
-
- /* Gather 4 bytes of input data for each stream. */
- input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
- input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
- input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 2), 2);
- input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 3), 3);
-
- /* Process the 4 bytes of input on each stream. */
- input = transition4(mm_index_mask.m, input,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input = transition4(mm_index_mask.m, input,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input = transition4(mm_index_mask.m, input,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input = transition4(mm_index_mask.m, input,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- /* Check for any matches. */
- acl_match_check_x4(0, ctx, parms, &flows,
- &indicies1, &indicies2, mm_match_mask.m);
- }
-}
-
-static inline xmm_t
-transition2(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
- xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
- const uint64_t *trans, xmm_t *indicies1)
-{
- uint64_t t;
- xmm_t addr, indicies2;
-
- indicies2 = MM_XOR(ones_16, ones_16);
-
- addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
- bytes, type_quad_range, indicies1, &indicies2);
-
- /* Gather 64 bit transitions and pack 2 per register. */
-
- t = trans[MM_CVT32(addr)];
-
- /* get slot 1 */
- addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
- *indicies1 = MM_SET64(trans[MM_CVT32(addr)], t);
-
- return MM_SRL32(next_input, 8);
-}
-
-/*
- * Execute trie traversal with 2 traversals in parallel.
- */
-static inline void
-search_sse_2(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t total_packets, uint32_t categories)
-{
- int n;
- struct acl_flow_data flows;
- uint64_t index_array[MAX_SEARCHES_SSE2];
- struct completion cmplt[MAX_SEARCHES_SSE2];
- struct parms parms[MAX_SEARCHES_SSE2];
- xmm_t input, indicies;
-
- acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
- total_packets, categories, ctx->trans_table);
-
- for (n = 0; n < MAX_SEARCHES_SSE2; n++) {
- cmplt[n].count = 0;
- index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
- }
-
- indicies = MM_LOADU((xmm_t *) &index_array[0]);
-
- /* Check for any matches. */
- acl_match_check_x2(0, ctx, parms, &flows, &indicies, mm_match_mask64.m);
-
- while (flows.started > 0) {
-
- /* Gather 4 bytes of input data for each stream. */
- input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
- input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
-
- /* Process the 4 bytes of input on each stream. */
-
- input = transition2(mm_index_mask64.m, input,
- mm_shuffle_input64.m, mm_ones_16.m,
- mm_bytes64.m, mm_type_quad_range64.m,
- flows.trans, &indicies);
-
- input = transition2(mm_index_mask64.m, input,
- mm_shuffle_input64.m, mm_ones_16.m,
- mm_bytes64.m, mm_type_quad_range64.m,
- flows.trans, &indicies);
-
- input = transition2(mm_index_mask64.m, input,
- mm_shuffle_input64.m, mm_ones_16.m,
- mm_bytes64.m, mm_type_quad_range64.m,
- flows.trans, &indicies);
-
- input = transition2(mm_index_mask64.m, input,
- mm_shuffle_input64.m, mm_ones_16.m,
- mm_bytes64.m, mm_type_quad_range64.m,
- flows.trans, &indicies);
-
- /* Check for any matches. */
- acl_match_check_x2(0, ctx, parms, &flows, &indicies,
- mm_match_mask64.m);
- }
-}
-
-/*
- * When processing the transition, rather than using if/else
- * construct, the offset is calculated for DFA and QRANGE and
- * then conditionally added to the address based on node type.
- * This is done to avoid branch mis-predictions. Since the
- * offset is rather simple calculation it is more efficient
- * to do the calculation and do a condition move rather than
- * a conditional branch to determine which calculation to do.
- */
-static inline uint32_t
-scan_forward(uint32_t input, uint32_t max)
-{
- return (input == 0) ? max : rte_bsf32(input);
-}
-
-static inline uint64_t
-scalar_transition(const uint64_t *trans_table, uint64_t transition,
- uint8_t input)
-{
- uint32_t addr, index, ranges, x, a, b, c;
-
- /* break transition into component parts */
- ranges = transition >> (sizeof(index) * CHAR_BIT);
-
- /* calc address for a QRANGE node */
- c = input * SCALAR_QRANGE_MULT;
- a = ranges | SCALAR_QRANGE_MIN;
- index = transition & ~RTE_ACL_NODE_INDEX;
- a -= (c & SCALAR_QRANGE_MASK);
- b = c & SCALAR_QRANGE_MIN;
- addr = transition ^ index;
- a &= SCALAR_QRANGE_MIN;
- a ^= (ranges ^ b) & (a ^ b);
- x = scan_forward(a, 32) >> 3;
- addr += (index == RTE_ACL_NODE_DFA) ? input : x;
-
- /* pickup next transition */
- transition = *(trans_table + addr);
- return transition;
-}
-
-int
-rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t num, uint32_t categories)
-{
- int n;
- uint64_t transition0, transition1;
- uint32_t input0, input1;
- struct acl_flow_data flows;
- uint64_t index_array[MAX_SEARCHES_SCALAR];
- struct completion cmplt[MAX_SEARCHES_SCALAR];
- struct parms parms[MAX_SEARCHES_SCALAR];
-
- if (categories != 1 &&
- ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
- return -EINVAL;
-
- acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results, num,
- categories, ctx->trans_table);
-
- for (n = 0; n < MAX_SEARCHES_SCALAR; n++) {
- cmplt[n].count = 0;
- index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
- }
-
- transition0 = index_array[0];
- transition1 = index_array[1];
-
- while (flows.started > 0) {
-
- input0 = GET_NEXT_4BYTES(parms, 0);
- input1 = GET_NEXT_4BYTES(parms, 1);
-
- for (n = 0; n < 4; n++) {
- if (likely((transition0 & RTE_ACL_NODE_MATCH) == 0))
- transition0 = scalar_transition(flows.trans,
- transition0, (uint8_t)input0);
-
- input0 >>= CHAR_BIT;
-
- if (likely((transition1 & RTE_ACL_NODE_MATCH) == 0))
- transition1 = scalar_transition(flows.trans,
- transition1, (uint8_t)input1);
-
- input1 >>= CHAR_BIT;
-
- }
- if ((transition0 | transition1) & RTE_ACL_NODE_MATCH) {
- transition0 = acl_match_check_transition(transition0,
- 0, ctx, parms, &flows);
- transition1 = acl_match_check_transition(transition1,
- 1, ctx, parms, &flows);
-
- }
- }
- return 0;
-}
-
-int
-rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t num, uint32_t categories)
-{
- if (categories != 1 &&
- ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
- return -EINVAL;
-
- if (likely(num >= MAX_SEARCHES_SSE8))
- search_sse_8(ctx, data, results, num, categories);
- else if (num >= MAX_SEARCHES_SSE4)
- search_sse_4(ctx, data, results, num, categories);
- else
- search_sse_2(ctx, data, results, num, categories);
-
- return 0;
-}
diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h
new file mode 100644
index 0000000..c191053
--- /dev/null
+++ b/lib/librte_acl/acl_run.h
@@ -0,0 +1,268 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _ACL_RUN_H_
+#define _ACL_RUN_H_
+
+#include <rte_acl.h>
+#include "acl_vect.h"
+#include "acl.h"
+
+#define MAX_SEARCHES_SSE8 8
+#define MAX_SEARCHES_SSE4 4
+#define MAX_SEARCHES_SSE2 2
+#define MAX_SEARCHES_SCALAR 2
+
+#define GET_NEXT_4BYTES(prm, idx) \
+ (*((const int32_t *)((prm)[(idx)].data + *(prm)[idx].data_index++)))
+
+
+#define RTE_ACL_NODE_INDEX ((uint32_t)~RTE_ACL_NODE_TYPE)
+
+#define SCALAR_QRANGE_MULT 0x01010101
+#define SCALAR_QRANGE_MASK 0x7f7f7f7f
+#define SCALAR_QRANGE_MIN 0x80808080
+
+/*
+ * Structure to manage N parallel trie traversals.
+ * The runtime trie traversal routines can process 8, 4, or 2 tries
+ * in parallel. Each packet may require multiple trie traversals (up to 4).
+ * This structure is used to fill the slots (0 to n-1) for parallel processing
+ * with the trie traversals needed for each packet.
+ */
+struct acl_flow_data {
+ uint32_t num_packets;
+ /* number of packets processed */
+ uint32_t started;
+ /* number of trie traversals in progress */
+ uint32_t trie;
+ /* current trie index (0 to N-1) */
+ uint32_t cmplt_size;
+ uint32_t total_packets;
+ uint32_t categories;
+ /* number of result categories per packet. */
+ /* maximum number of packets to process */
+ const uint64_t *trans;
+ const uint8_t **data;
+ uint32_t *results;
+ struct completion *last_cmplt;
+ struct completion *cmplt_array;
+};
+
+/*
+ * Structure to maintain running results for
+ * a single packet (up to 4 tries).
+ */
+struct completion {
+ uint32_t *results; /* running results. */
+ int32_t priority[RTE_ACL_MAX_CATEGORIES]; /* running priorities. */
+ uint32_t count; /* num of remaining tries */
+ /* true for allocated struct */
+} __attribute__((aligned(XMM_SIZE)));
+
+/*
+ * One parms structure for each slot in the search engine.
+ */
+struct parms {
+ const uint8_t *data;
+ /* input data for this packet */
+ const uint32_t *data_index;
+ /* data indirection for this trie */
+ struct completion *cmplt;
+ /* completion data for this packet */
+};
+
+/*
+ * Define an global idle node for unused engine slots
+ */
+static const uint32_t idle[UINT8_MAX + 1];
+
+/*
+ * Allocate a completion structure to manage the tries for a packet.
+ */
+static inline struct completion *
+alloc_completion(struct completion *p, uint32_t size, uint32_t tries,
+ uint32_t *results)
+{
+ uint32_t n;
+
+ for (n = 0; n < size; n++) {
+
+ if (p[n].count == 0) {
+
+ /* mark as allocated and set number of tries. */
+ p[n].count = tries;
+ p[n].results = results;
+ return &(p[n]);
+ }
+ }
+
+ /* should never get here */
+ return NULL;
+}
+
+/*
+ * Resolve priority for a single result trie.
+ */
+static inline void
+resolve_single_priority(uint64_t transition, int n,
+ const struct rte_acl_ctx *ctx, struct parms *parms,
+ const struct rte_acl_match_results *p)
+{
+ if (parms[n].cmplt->count == ctx->num_tries ||
+ parms[n].cmplt->priority[0] <=
+ p[transition].priority[0]) {
+
+ parms[n].cmplt->priority[0] = p[transition].priority[0];
+ parms[n].cmplt->results[0] = p[transition].results[0];
+ }
+}
+
+/*
+ * Routine to fill a slot in the parallel trie traversal array (parms) from
+ * the list of packets (flows).
+ */
+static inline uint64_t
+acl_start_next_trie(struct acl_flow_data *flows, struct parms *parms, int n,
+ const struct rte_acl_ctx *ctx)
+{
+ uint64_t transition;
+
+ /* if there are any more packets to process */
+ if (flows->num_packets < flows->total_packets) {
+ parms[n].data = flows->data[flows->num_packets];
+ parms[n].data_index = ctx->trie[flows->trie].data_index;
+
+ /* if this is the first trie for this packet */
+ if (flows->trie == 0) {
+ flows->last_cmplt = alloc_completion(flows->cmplt_array,
+ flows->cmplt_size, ctx->num_tries,
+ flows->results +
+ flows->num_packets * flows->categories);
+ }
+
+ /* set completion parameters and starting index for this slot */
+ parms[n].cmplt = flows->last_cmplt;
+ transition =
+ flows->trans[parms[n].data[*parms[n].data_index++] +
+ ctx->trie[flows->trie].root_index];
+
+ /*
+ * if this is the last trie for this packet,
+ * then setup next packet.
+ */
+ flows->trie++;
+ if (flows->trie >= ctx->num_tries) {
+ flows->trie = 0;
+ flows->num_packets++;
+ }
+
+ /* keep track of number of active trie traversals */
+ flows->started++;
+
+ /* no more tries to process, set slot to an idle position */
+ } else {
+ transition = ctx->idle;
+ parms[n].data = (const uint8_t *)idle;
+ parms[n].data_index = idle;
+ }
+ return transition;
+}
+
+static inline void
+acl_set_flow(struct acl_flow_data *flows, struct completion *cmplt,
+ uint32_t cmplt_size, const uint8_t **data, uint32_t *results,
+ uint32_t data_num, uint32_t categories, const uint64_t *trans)
+{
+ flows->num_packets = 0;
+ flows->started = 0;
+ flows->trie = 0;
+ flows->last_cmplt = NULL;
+ flows->cmplt_array = cmplt;
+ flows->total_packets = data_num;
+ flows->categories = categories;
+ flows->cmplt_size = cmplt_size;
+ flows->data = data;
+ flows->results = results;
+ flows->trans = trans;
+}
+
+typedef void (*resolve_priority_t)
+(uint64_t transition, int n, const struct rte_acl_ctx *ctx,
+ struct parms *parms, const struct rte_acl_match_results *p,
+ uint32_t categories);
+
+/*
+ * Detect matches. If a match node transition is found, then this trie
+ * traversal is complete and fill the slot with the next trie
+ * to be processed.
+ */
+static inline uint64_t
+acl_match_check(uint64_t transition, int slot,
+ const struct rte_acl_ctx *ctx, struct parms *parms,
+ struct acl_flow_data *flows, resolve_priority_t resolve_priority)
+{
+ const struct rte_acl_match_results *p;
+
+ p = (const struct rte_acl_match_results *)
+ (flows->trans + ctx->match_index);
+
+ if (transition & RTE_ACL_NODE_MATCH) {
+
+ /* Remove flags from index and decrement active traversals */
+ transition &= RTE_ACL_NODE_INDEX;
+ flows->started--;
+
+ /* Resolve priorities for this trie and running results */
+ if (flows->categories == 1)
+ resolve_single_priority(transition, slot, ctx,
+ parms, p);
+ else
+ resolve_priority(transition, slot, ctx, parms,
+ p, flows->categories);
+
+ /* Count down completed tries for this search request */
+ parms[slot].cmplt->count--;
+
+ /* Fill the slot with the next trie or idle trie */
+ transition = acl_start_next_trie(flows, parms, slot, ctx);
+
+ } else if (transition == ctx->idle) {
+ /* reset indirection table for idle slots */
+ parms[slot].data_index = idle;
+ }
+
+ return transition;
+}
+
+#endif /* _ACL_RUN_H_ */
diff --git a/lib/librte_acl/acl_run_scalar.c b/lib/librte_acl/acl_run_scalar.c
new file mode 100644
index 0000000..43c8fc3
--- /dev/null
+++ b/lib/librte_acl/acl_run_scalar.c
@@ -0,0 +1,193 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#include "acl_run.h"
+
+/*
+ * Resolve priority for multiple results (scalar version).
+ * This consists comparing the priority of the current traversal with the
+ * running set of results for the packet.
+ * For each result, keep a running array of the result (rule number) and
+ * its priority for each category.
+ */
+static inline void
+resolve_priority_scalar(uint64_t transition, int n,
+ const struct rte_acl_ctx *ctx, struct parms *parms,
+ const struct rte_acl_match_results *p, uint32_t categories)
+{
+ uint32_t i;
+ int32_t *saved_priority;
+ uint32_t *saved_results;
+ const int32_t *priority;
+ const uint32_t *results;
+
+ saved_results = parms[n].cmplt->results;
+ saved_priority = parms[n].cmplt->priority;
+
+ /* results and priorities for completed trie */
+ results = p[transition].results;
+ priority = p[transition].priority;
+
+ /* if this is not the first completed trie */
+ if (parms[n].cmplt->count != ctx->num_tries) {
+ for (i = 0; i < categories; i += RTE_ACL_RESULTS_MULTIPLIER) {
+
+ if (saved_priority[i] <= priority[i]) {
+ saved_priority[i] = priority[i];
+ saved_results[i] = results[i];
+ }
+ if (saved_priority[i + 1] <= priority[i + 1]) {
+ saved_priority[i + 1] = priority[i + 1];
+ saved_results[i + 1] = results[i + 1];
+ }
+ if (saved_priority[i + 2] <= priority[i + 2]) {
+ saved_priority[i + 2] = priority[i + 2];
+ saved_results[i + 2] = results[i + 2];
+ }
+ if (saved_priority[i + 3] <= priority[i + 3]) {
+ saved_priority[i + 3] = priority[i + 3];
+ saved_results[i + 3] = results[i + 3];
+ }
+ }
+ } else {
+ for (i = 0; i < categories; i += RTE_ACL_RESULTS_MULTIPLIER) {
+ saved_priority[i] = priority[i];
+ saved_priority[i + 1] = priority[i + 1];
+ saved_priority[i + 2] = priority[i + 2];
+ saved_priority[i + 3] = priority[i + 3];
+
+ saved_results[i] = results[i];
+ saved_results[i + 1] = results[i + 1];
+ saved_results[i + 2] = results[i + 2];
+ saved_results[i + 3] = results[i + 3];
+ }
+ }
+}
+
+/*
+ * When processing the transition, rather than using if/else
+ * construct, the offset is calculated for DFA and QRANGE and
+ * then conditionally added to the address based on node type.
+ * This is done to avoid branch mis-predictions. Since the
+ * offset is rather simple calculation it is more efficient
+ * to do the calculation and do a condition move rather than
+ * a conditional branch to determine which calculation to do.
+ */
+static inline uint32_t
+scan_forward(uint32_t input, uint32_t max)
+{
+ return (input == 0) ? max : rte_bsf32(input);
+}
+
+static inline uint64_t
+scalar_transition(const uint64_t *trans_table, uint64_t transition,
+ uint8_t input)
+{
+ uint32_t addr, index, ranges, x, a, b, c;
+
+ /* break transition into component parts */
+ ranges = transition >> (sizeof(index) * CHAR_BIT);
+
+ /* calc address for a QRANGE node */
+ c = input * SCALAR_QRANGE_MULT;
+ a = ranges | SCALAR_QRANGE_MIN;
+ index = transition & ~RTE_ACL_NODE_INDEX;
+ a -= (c & SCALAR_QRANGE_MASK);
+ b = c & SCALAR_QRANGE_MIN;
+ addr = transition ^ index;
+ a &= SCALAR_QRANGE_MIN;
+ a ^= (ranges ^ b) & (a ^ b);
+ x = scan_forward(a, 32) >> 3;
+ addr += (index == RTE_ACL_NODE_DFA) ? input : x;
+
+ /* pickup next transition */
+ transition = *(trans_table + addr);
+ return transition;
+}
+
+int
+rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories)
+{
+ int n;
+ uint64_t transition0, transition1;
+ uint32_t input0, input1;
+ struct acl_flow_data flows;
+ uint64_t index_array[MAX_SEARCHES_SCALAR];
+ struct completion cmplt[MAX_SEARCHES_SCALAR];
+ struct parms parms[MAX_SEARCHES_SCALAR];
+
+ if (categories != 1 &&
+ ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
+ return -EINVAL;
+
+ acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results, num,
+ categories, ctx->trans_table);
+
+ for (n = 0; n < MAX_SEARCHES_SCALAR; n++) {
+ cmplt[n].count = 0;
+ index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
+ }
+
+ transition0 = index_array[0];
+ transition1 = index_array[1];
+
+ while (flows.started > 0) {
+
+ input0 = GET_NEXT_4BYTES(parms, 0);
+ input1 = GET_NEXT_4BYTES(parms, 1);
+
+ for (n = 0; n < 4; n++) {
+ if (likely((transition0 & RTE_ACL_NODE_MATCH) == 0))
+ transition0 = scalar_transition(flows.trans,
+ transition0, (uint8_t)input0);
+
+ input0 >>= CHAR_BIT;
+
+ if (likely((transition1 & RTE_ACL_NODE_MATCH) == 0))
+ transition1 = scalar_transition(flows.trans,
+ transition1, (uint8_t)input1);
+
+ input1 >>= CHAR_BIT;
+
+ }
+ if ((transition0 | transition1) & RTE_ACL_NODE_MATCH) {
+ transition0 = acl_match_check(transition0,
+ 0, ctx, parms, &flows, resolve_priority_scalar);
+ transition1 = acl_match_check(transition1,
+ 1, ctx, parms, &flows, resolve_priority_scalar);
+
+ }
+ }
+ return 0;
+}
diff --git a/lib/librte_acl/acl_run_sse.c b/lib/librte_acl/acl_run_sse.c
new file mode 100644
index 0000000..4f3f115
--- /dev/null
+++ b/lib/librte_acl/acl_run_sse.c
@@ -0,0 +1,626 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#include "acl_run.h"
+
+enum {
+ SHUFFLE32_SLOT1 = 0xe5,
+ SHUFFLE32_SLOT2 = 0xe6,
+ SHUFFLE32_SLOT3 = 0xe7,
+ SHUFFLE32_SWAP64 = 0x4e,
+};
+
+static const rte_xmm_t mm_type_quad_range = {
+ .u32 = {
+ RTE_ACL_NODE_QRANGE,
+ RTE_ACL_NODE_QRANGE,
+ RTE_ACL_NODE_QRANGE,
+ RTE_ACL_NODE_QRANGE,
+ },
+};
+
+static const rte_xmm_t mm_type_quad_range64 = {
+ .u32 = {
+ RTE_ACL_NODE_QRANGE,
+ RTE_ACL_NODE_QRANGE,
+ 0,
+ 0,
+ },
+};
+
+static const rte_xmm_t mm_shuffle_input = {
+ .u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c},
+};
+
+static const rte_xmm_t mm_shuffle_input64 = {
+ .u32 = {0x00000000, 0x04040404, 0x80808080, 0x80808080},
+};
+
+static const rte_xmm_t mm_ones_16 = {
+ .u16 = {1, 1, 1, 1, 1, 1, 1, 1},
+};
+
+static const rte_xmm_t mm_bytes = {
+ .u32 = {UINT8_MAX, UINT8_MAX, UINT8_MAX, UINT8_MAX},
+};
+
+static const rte_xmm_t mm_bytes64 = {
+ .u32 = {UINT8_MAX, UINT8_MAX, 0, 0},
+};
+
+static const rte_xmm_t mm_match_mask = {
+ .u32 = {
+ RTE_ACL_NODE_MATCH,
+ RTE_ACL_NODE_MATCH,
+ RTE_ACL_NODE_MATCH,
+ RTE_ACL_NODE_MATCH,
+ },
+};
+
+static const rte_xmm_t mm_match_mask64 = {
+ .u32 = {
+ RTE_ACL_NODE_MATCH,
+ 0,
+ RTE_ACL_NODE_MATCH,
+ 0,
+ },
+};
+
+static const rte_xmm_t mm_index_mask = {
+ .u32 = {
+ RTE_ACL_NODE_INDEX,
+ RTE_ACL_NODE_INDEX,
+ RTE_ACL_NODE_INDEX,
+ RTE_ACL_NODE_INDEX,
+ },
+};
+
+static const rte_xmm_t mm_index_mask64 = {
+ .u32 = {
+ RTE_ACL_NODE_INDEX,
+ RTE_ACL_NODE_INDEX,
+ 0,
+ 0,
+ },
+};
+
+
+/*
+ * Resolve priority for multiple results (sse version).
+ * This consists comparing the priority of the current traversal with the
+ * running set of results for the packet.
+ * For each result, keep a running array of the result (rule number) and
+ * its priority for each category.
+ */
+static inline void
+resolve_priority_sse(uint64_t transition, int n, const struct rte_acl_ctx *ctx,
+ struct parms *parms, const struct rte_acl_match_results *p,
+ uint32_t categories)
+{
+ uint32_t x;
+ xmm_t results, priority, results1, priority1, selector;
+ xmm_t *saved_results, *saved_priority;
+
+ for (x = 0; x < categories; x += RTE_ACL_RESULTS_MULTIPLIER) {
+
+ saved_results = (xmm_t *)(&parms[n].cmplt->results[x]);
+ saved_priority =
+ (xmm_t *)(&parms[n].cmplt->priority[x]);
+
+ /* get results and priorities for completed trie */
+ results = MM_LOADU((const xmm_t *)&p[transition].results[x]);
+ priority = MM_LOADU((const xmm_t *)&p[transition].priority[x]);
+
+ /* if this is not the first completed trie */
+ if (parms[n].cmplt->count != ctx->num_tries) {
+
+ /* get running best results and their priorities */
+ results1 = MM_LOADU(saved_results);
+ priority1 = MM_LOADU(saved_priority);
+
+ /* select results that are highest priority */
+ selector = MM_CMPGT32(priority1, priority);
+ results = MM_BLENDV8(results, results1, selector);
+ priority = MM_BLENDV8(priority, priority1, selector);
+ }
+
+ /* save running best results and their priorities */
+ MM_STOREU(saved_results, results);
+ MM_STOREU(saved_priority, priority);
+ }
+}
+
+/*
+ * Extract transitions from an XMM register and check for any matches
+ */
+static void
+acl_process_matches(xmm_t *indicies, int slot, const struct rte_acl_ctx *ctx,
+ struct parms *parms, struct acl_flow_data *flows)
+{
+ uint64_t transition1, transition2;
+
+ /* extract transition from low 64 bits. */
+ transition1 = MM_CVT64(*indicies);
+
+ /* extract transition from high 64 bits. */
+ *indicies = MM_SHUFFLE32(*indicies, SHUFFLE32_SWAP64);
+ transition2 = MM_CVT64(*indicies);
+
+ transition1 = acl_match_check(transition1, slot, ctx,
+ parms, flows, resolve_priority_sse);
+ transition2 = acl_match_check(transition2, slot + 1, ctx,
+ parms, flows, resolve_priority_sse);
+
+ /* update indicies with new transitions. */
+ *indicies = MM_SET64(transition2, transition1);
+}
+
+/*
+ * Check for a match in 2 transitions (contained in SSE register)
+ */
+static inline void
+acl_match_check_x2(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
+ struct acl_flow_data *flows, xmm_t *indicies, xmm_t match_mask)
+{
+ xmm_t temp;
+
+ temp = MM_AND(match_mask, *indicies);
+ while (!MM_TESTZ(temp, temp)) {
+ acl_process_matches(indicies, slot, ctx, parms, flows);
+ temp = MM_AND(match_mask, *indicies);
+ }
+}
+
+/*
+ * Check for any match in 4 transitions (contained in 2 SSE registers)
+ */
+static inline void
+acl_match_check_x4(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
+ struct acl_flow_data *flows, xmm_t *indicies1, xmm_t *indicies2,
+ xmm_t match_mask)
+{
+ xmm_t temp;
+
+ /* put low 32 bits of each transition into one register */
+ temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
+ 0x88);
+ /* test for match node */
+ temp = MM_AND(match_mask, temp);
+
+ while (!MM_TESTZ(temp, temp)) {
+ acl_process_matches(indicies1, slot, ctx, parms, flows);
+ acl_process_matches(indicies2, slot + 2, ctx, parms, flows);
+
+ temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
+ (__m128)*indicies2,
+ 0x88);
+ temp = MM_AND(match_mask, temp);
+ }
+}
+
+/*
+ * Calculate the address of the next transition for
+ * all types of nodes. Note that only DFA nodes and range
+ * nodes actually transition to another node. Match
+ * nodes don't move.
+ */
+static inline xmm_t
+acl_calc_addr(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
+ xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
+ xmm_t *indicies1, xmm_t *indicies2)
+{
+ xmm_t addr, node_types, temp;
+
+ /*
+ * Note that no transition is done for a match
+ * node and therefore a stream freezes when
+ * it reaches a match.
+ */
+
+ /* Shuffle low 32 into temp and high 32 into indicies2 */
+ temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
+ 0x88);
+ *indicies2 = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
+ (__m128)*indicies2, 0xdd);
+
+ /* Calc node type and node addr */
+ node_types = MM_ANDNOT(index_mask, temp);
+ addr = MM_AND(index_mask, temp);
+
+ /*
+ * Calc addr for DFAs - addr = dfa_index + input_byte
+ */
+
+ /* mask for DFA type (0) nodes */
+ temp = MM_CMPEQ32(node_types, MM_XOR(node_types, node_types));
+
+ /* add input byte to DFA position */
+ temp = MM_AND(temp, bytes);
+ temp = MM_AND(temp, next_input);
+ addr = MM_ADD32(addr, temp);
+
+ /*
+ * Calc addr for Range nodes -> range_index + range(input)
+ */
+ node_types = MM_CMPEQ32(node_types, type_quad_range);
+
+ /*
+ * Calculate number of range boundaries that are less than the
+ * input value. Range boundaries for each node are in signed 8 bit,
+ * ordered from -128 to 127 in the indicies2 register.
+ * This is effectively a popcnt of bytes that are greater than the
+ * input byte.
+ */
+
+ /* shuffle input byte to all 4 positions of 32 bit value */
+ temp = MM_SHUFFLE8(next_input, shuffle_input);
+
+ /* check ranges */
+ temp = MM_CMPGT8(temp, *indicies2);
+
+ /* convert -1 to 1 (bytes greater than input byte */
+ temp = MM_SIGN8(temp, temp);
+
+ /* horizontal add pairs of bytes into words */
+ temp = MM_MADD8(temp, temp);
+
+ /* horizontal add pairs of words into dwords */
+ temp = MM_MADD16(temp, ones_16);
+
+ /* mask to range type nodes */
+ temp = MM_AND(temp, node_types);
+
+ /* add index into node position */
+ return MM_ADD32(addr, temp);
+}
+
+/*
+ * Process 4 transitions (in 2 SIMD registers) in parallel
+ */
+static inline xmm_t
+transition4(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
+ xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
+ const uint64_t *trans, xmm_t *indicies1, xmm_t *indicies2)
+{
+ xmm_t addr;
+ uint64_t trans0, trans2;
+
+ /* Calculate the address (array index) for all 4 transitions. */
+
+ addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
+ bytes, type_quad_range, indicies1, indicies2);
+
+ /* Gather 64 bit transitions and pack back into 2 registers. */
+
+ trans0 = trans[MM_CVT32(addr)];
+
+ /* get slot 2 */
+
+ /* {x0, x1, x2, x3} -> {x2, x1, x2, x3} */
+ addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT2);
+ trans2 = trans[MM_CVT32(addr)];
+
+ /* get slot 1 */
+
+ /* {x2, x1, x2, x3} -> {x1, x1, x2, x3} */
+ addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
+ *indicies1 = MM_SET64(trans[MM_CVT32(addr)], trans0);
+
+ /* get slot 3 */
+
+ /* {x1, x1, x2, x3} -> {x3, x1, x2, x3} */
+ addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT3);
+ *indicies2 = MM_SET64(trans[MM_CVT32(addr)], trans2);
+
+ return MM_SRL32(next_input, 8);
+}
+
+/*
+ * Execute trie traversal with 8 traversals in parallel
+ */
+static inline int
+search_sse_8(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t total_packets, uint32_t categories)
+{
+ int n;
+ struct acl_flow_data flows;
+ uint64_t index_array[MAX_SEARCHES_SSE8];
+ struct completion cmplt[MAX_SEARCHES_SSE8];
+ struct parms parms[MAX_SEARCHES_SSE8];
+ xmm_t input0, input1;
+ xmm_t indicies1, indicies2, indicies3, indicies4;
+
+ acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
+ total_packets, categories, ctx->trans_table);
+
+ for (n = 0; n < MAX_SEARCHES_SSE8; n++) {
+ cmplt[n].count = 0;
+ index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
+ }
+
+ /*
+ * indicies1 contains index_array[0,1]
+ * indicies2 contains index_array[2,3]
+ * indicies3 contains index_array[4,5]
+ * indicies4 contains index_array[6,7]
+ */
+
+ indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
+ indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
+
+ indicies3 = MM_LOADU((xmm_t *) &index_array[4]);
+ indicies4 = MM_LOADU((xmm_t *) &index_array[6]);
+
+ /* Check for any matches. */
+ acl_match_check_x4(0, ctx, parms, &flows,
+ &indicies1, &indicies2, mm_match_mask.m);
+ acl_match_check_x4(4, ctx, parms, &flows,
+ &indicies3, &indicies4, mm_match_mask.m);
+
+ while (flows.started > 0) {
+
+ /* Gather 4 bytes of input data for each stream. */
+ input0 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0),
+ 0);
+ input1 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 4),
+ 0);
+
+ input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 1), 1);
+ input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 5), 1);
+
+ input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 2), 2);
+ input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 6), 2);
+
+ input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 3), 3);
+ input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 7), 3);
+
+ /* Process the 4 bytes of input on each stream. */
+
+ input0 = transition4(mm_index_mask.m, input0,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input1 = transition4(mm_index_mask.m, input1,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies3, &indicies4);
+
+ input0 = transition4(mm_index_mask.m, input0,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input1 = transition4(mm_index_mask.m, input1,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies3, &indicies4);
+
+ input0 = transition4(mm_index_mask.m, input0,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input1 = transition4(mm_index_mask.m, input1,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies3, &indicies4);
+
+ input0 = transition4(mm_index_mask.m, input0,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input1 = transition4(mm_index_mask.m, input1,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies3, &indicies4);
+
+ /* Check for any matches. */
+ acl_match_check_x4(0, ctx, parms, &flows,
+ &indicies1, &indicies2, mm_match_mask.m);
+ acl_match_check_x4(4, ctx, parms, &flows,
+ &indicies3, &indicies4, mm_match_mask.m);
+ }
+
+ return 0;
+}
+
+/*
+ * Execute trie traversal with 4 traversals in parallel
+ */
+static inline int
+search_sse_4(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, int total_packets, uint32_t categories)
+{
+ int n;
+ struct acl_flow_data flows;
+ uint64_t index_array[MAX_SEARCHES_SSE4];
+ struct completion cmplt[MAX_SEARCHES_SSE4];
+ struct parms parms[MAX_SEARCHES_SSE4];
+ xmm_t input, indicies1, indicies2;
+
+ acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
+ total_packets, categories, ctx->trans_table);
+
+ for (n = 0; n < MAX_SEARCHES_SSE4; n++) {
+ cmplt[n].count = 0;
+ index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
+ }
+
+ indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
+ indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
+
+ /* Check for any matches. */
+ acl_match_check_x4(0, ctx, parms, &flows,
+ &indicies1, &indicies2, mm_match_mask.m);
+
+ while (flows.started > 0) {
+
+ /* Gather 4 bytes of input data for each stream. */
+ input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
+ input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
+ input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 2), 2);
+ input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 3), 3);
+
+ /* Process the 4 bytes of input on each stream. */
+ input = transition4(mm_index_mask.m, input,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input = transition4(mm_index_mask.m, input,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input = transition4(mm_index_mask.m, input,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input = transition4(mm_index_mask.m, input,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ /* Check for any matches. */
+ acl_match_check_x4(0, ctx, parms, &flows,
+ &indicies1, &indicies2, mm_match_mask.m);
+ }
+
+ return 0;
+}
+
+static inline xmm_t
+transition2(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
+ xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
+ const uint64_t *trans, xmm_t *indicies1)
+{
+ uint64_t t;
+ xmm_t addr, indicies2;
+
+ indicies2 = MM_XOR(ones_16, ones_16);
+
+ addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
+ bytes, type_quad_range, indicies1, &indicies2);
+
+ /* Gather 64 bit transitions and pack 2 per register. */
+
+ t = trans[MM_CVT32(addr)];
+
+ /* get slot 1 */
+ addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
+ *indicies1 = MM_SET64(trans[MM_CVT32(addr)], t);
+
+ return MM_SRL32(next_input, 8);
+}
+
+/*
+ * Execute trie traversal with 2 traversals in parallel.
+ */
+static inline int
+search_sse_2(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t total_packets, uint32_t categories)
+{
+ int n;
+ struct acl_flow_data flows;
+ uint64_t index_array[MAX_SEARCHES_SSE2];
+ struct completion cmplt[MAX_SEARCHES_SSE2];
+ struct parms parms[MAX_SEARCHES_SSE2];
+ xmm_t input, indicies;
+
+ acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
+ total_packets, categories, ctx->trans_table);
+
+ for (n = 0; n < MAX_SEARCHES_SSE2; n++) {
+ cmplt[n].count = 0;
+ index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
+ }
+
+ indicies = MM_LOADU((xmm_t *) &index_array[0]);
+
+ /* Check for any matches. */
+ acl_match_check_x2(0, ctx, parms, &flows, &indicies, mm_match_mask64.m);
+
+ while (flows.started > 0) {
+
+ /* Gather 4 bytes of input data for each stream. */
+ input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
+ input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
+
+ /* Process the 4 bytes of input on each stream. */
+
+ input = transition2(mm_index_mask64.m, input,
+ mm_shuffle_input64.m, mm_ones_16.m,
+ mm_bytes64.m, mm_type_quad_range64.m,
+ flows.trans, &indicies);
+
+ input = transition2(mm_index_mask64.m, input,
+ mm_shuffle_input64.m, mm_ones_16.m,
+ mm_bytes64.m, mm_type_quad_range64.m,
+ flows.trans, &indicies);
+
+ input = transition2(mm_index_mask64.m, input,
+ mm_shuffle_input64.m, mm_ones_16.m,
+ mm_bytes64.m, mm_type_quad_range64.m,
+ flows.trans, &indicies);
+
+ input = transition2(mm_index_mask64.m, input,
+ mm_shuffle_input64.m, mm_ones_16.m,
+ mm_bytes64.m, mm_type_quad_range64.m,
+ flows.trans, &indicies);
+
+ /* Check for any matches. */
+ acl_match_check_x2(0, ctx, parms, &flows, &indicies,
+ mm_match_mask64.m);
+ }
+
+ return 0;
+}
+
+int
+rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories)
+{
+ if (categories != 1 &&
+ ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
+ return -EINVAL;
+
+ if (likely(num >= MAX_SEARCHES_SSE8))
+ return search_sse_8(ctx, data, results, num, categories);
+ else if (num >= MAX_SEARCHES_SSE4)
+ return search_sse_4(ctx, data, results, num, categories);
+ else
+ return search_sse_2(ctx, data, results, num, categories);
+}
diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c
index 7c288bd..ea23220 100644
--- a/lib/librte_acl/rte_acl.c
+++ b/lib/librte_acl/rte_acl.c
@@ -38,6 +38,58 @@
TAILQ_HEAD(rte_acl_list, rte_tailq_entry);
+static const rte_acl_classify_t classify_fns[] = {
+ [RTE_ACL_CLASSIFY_DEFAULT] = rte_acl_classify_scalar,
+ [RTE_ACL_CLASSIFY_SCALAR] = rte_acl_classify_scalar,
+ [RTE_ACL_CLASSIFY_SSE] = rte_acl_classify_sse,
+};
+
+/* by default, use always avaialbe scalar code path. */
+static enum rte_acl_classify_alg rte_acl_default_classify =
+ RTE_ACL_CLASSIFY_SCALAR;
+
+static void
+rte_acl_set_default_classify(enum rte_acl_classify_alg alg)
+{
+ rte_acl_default_classify = alg;
+}
+
+extern int
+rte_acl_set_ctx_classify(struct rte_acl_ctx *ctx, enum rte_acl_classify_alg alg)
+{
+ if (ctx == NULL || (uint32_t)alg >= RTE_DIM(classify_fns))
+ return -EINVAL;
+
+ ctx->alg = alg;
+ return 0;
+}
+
+static void __attribute__((constructor))
+rte_acl_init(void)
+{
+ enum rte_acl_classify_alg alg = RTE_ACL_CLASSIFY_DEFAULT;
+
+ if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
+ alg = RTE_ACL_CLASSIFY_SSE;
+
+ rte_acl_set_default_classify(alg);
+}
+
+int
+rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories)
+{
+ return classify_fns[ctx->alg](ctx, data, results, num, categories);
+}
+
+int
+rte_acl_classify_alg(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories,
+ enum rte_acl_classify_alg alg)
+{
+ return classify_fns[alg](ctx, data, results, num, categories);
+}
+
struct rte_acl_ctx *
rte_acl_find_existing(const char *name)
{
@@ -165,6 +217,7 @@ rte_acl_create(const struct rte_acl_param *param)
ctx->max_rules = param->max_rule_num;
ctx->rule_sz = param->rule_size;
ctx->socket_id = param->socket_id;
+ ctx->alg = rte_acl_default_classify;
snprintf(ctx->name, sizeof(ctx->name), "%s", param->name);
te->data = (void *) ctx;
@@ -261,6 +314,8 @@ rte_acl_dump(const struct rte_acl_ctx *ctx)
if (!ctx)
return;
printf("acl context <%s>@%p\n", ctx->name, ctx);
+ printf(" socket_id=%"PRId32"\n", ctx->socket_id);
+ printf(" alg=%"PRId32"\n", ctx->alg);
printf(" max_rules=%"PRIu32"\n", ctx->max_rules);
printf(" rule_size=%"PRIu32"\n", ctx->rule_sz);
printf(" num_rules=%"PRIu32"\n", ctx->num_rules);
diff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h
index afc0f69..0e82339 100644
--- a/lib/librte_acl/rte_acl.h
+++ b/lib/librte_acl/rte_acl.h
@@ -259,7 +259,16 @@ void
rte_acl_reset(struct rte_acl_ctx *ctx);
/**
- * Search for a matching ACL rule for each input data buffer.
+ * Avaialble implementations of ACL classify.
+ */
+enum rte_acl_classify_alg {
+ RTE_ACL_CLASSIFY_DEFAULT = 0,
+ RTE_ACL_CLASSIFY_SCALAR = 1, /**< generic implementation. */
+ RTE_ACL_CLASSIFY_SSE = 2, /**< requries SSE4.1 support. */
+};
+
+/**
+ * Perform search for a matching ACL rule for each input data buffer.
* Each input data buffer can have up to *categories* matches.
* That implies that results array should be big enough to hold
* (categories * num) elements.
@@ -267,7 +276,7 @@ rte_acl_reset(struct rte_acl_ctx *ctx);
* RTE_ACL_RESULTS_MULTIPLIER and can't be bigger than RTE_ACL_MAX_CATEGORIES.
* If more than one rule is applicable for given input buffer and
* given category, then rule with highest priority will be returned as a match.
- * Note, that it is a caller responsibility to ensure that input parameters
+ * Note, that it is a caller's responsibility to ensure that input parameters
* are valid and point to correct memory locations.
*
* @param ctx
@@ -287,15 +296,15 @@ rte_acl_reset(struct rte_acl_ctx *ctx);
* zero on successful completion.
* -EINVAL for incorrect arguments.
*/
-int
-rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t num, uint32_t categories);
+extern int
+rte_acl_classify(const struct rte_acl_ctx *ctx,
+ const uint8_t **data,
+ uint32_t *results, uint32_t num,
+ uint32_t categories);
/**
- * Perform scalar search for a matching ACL rule for each input data buffer.
- * Note, that while the search itself will avoid explicit use of SSE/AVX
- * intrinsics, code for comparing matching results/priorities sill might use
- * vector intrinsics (for categories > 1).
+ * Perform search using specified algorithm for a matching ACL rule for
+ * each input data buffer.
* Each input data buffer can have up to *categories* matches.
* That implies that results array should be big enough to hold
* (categories * num) elements.
@@ -319,13 +328,36 @@ rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
* @param categories
* Number of maximum possible matches for each input buffer, one possible
* match per category.
+ * @param alg
+ * Algorithm to be used for the search.
+ * It is the caller responibility to ensure that the value refers to the
+ * existing algorithm, and that it could be run on the given CPU.
* @return
* zero on successful completion.
* -EINVAL for incorrect arguments.
*/
-int
-rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t num, uint32_t categories);
+extern int
+rte_acl_classify_alg(const struct rte_acl_ctx *ctx,
+ const uint8_t **data,
+ uint32_t *results, uint32_t num,
+ uint32_t categories,
+ enum rte_acl_classify_alg alg);
+
+/*
+ * Override the default classifier function for a given ACL context.
+ * @param ctx
+ * ACL context to change classify function for.
+ * @param alg
+ * New default classify algorithm for given ACL context.
+ * It is the caller responibility to ensure that the value refers to the
+ * existing algorithm, and that it could be run on the given CPU.
+ * @return
+ * - -EINVAL if the parameters are invalid.
+ * - Zero if operation completed successfully.
+ */
+extern int
+rte_acl_set_ctx_classify(struct rte_acl_ctx *ctx,
+ enum rte_acl_classify_alg alg);
/**
* Dump an ACL context structure to the console.
--
1.8.5.3
^ permalink raw reply [relevance 1%]
* Re: [dpdk-dev] [PATCHv4] librte_acl make it build/work for 'default' target
2014-08-28 20:38 1% ` [dpdk-dev] [PATCHv4] " Neil Horman
@ 2014-08-29 17:58 0% ` Ananyev, Konstantin
0 siblings, 0 replies; 200+ results
From: Ananyev, Konstantin @ 2014-08-29 17:58 UTC (permalink / raw)
To: Neil Horman, dev
> -----Original Message-----
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Thursday, August 28, 2014 9:38 PM
> To: dev@dpdk.org
> Cc: Neil Horman; Ananyev, Konstantin; thomas.monjalon@6wind.com
> Subject: [PATCHv4] librte_acl make it build/work for 'default' target
>
> Make ACL library to build/work on 'default' architecture:
> - make rte_acl_classify_scalar really scalar
> (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> - Provide two versions of rte_acl_classify code path:
> rte_acl_classify_sse() - could be build and used only on systems with sse4.2
> and upper, return -ENOTSUP on lower arch.
> rte_acl_classify_scalar() - a slower version, but could be build and used
> on all systems.
> - keep common code shared between these two codepaths.
>
> v2 chages:
> run-time selection of most appropriate code-path for given ISA.
> By default the highest supprted one is selected.
> User can still override that selection by manually assigning new value to
> the global function pointer rte_acl_default_classify.
> rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
> points to.
>
> V3 Changes
> Updated classify pointer to be a function so as to better preserve ABI
> REmoved macro definitions for match check functions to make them static inline
>
> V4 Changes
> Rewrote classification selection mechanim to use a function table, so that we
> can just store the preferred alg in the rte_acl_ctx struct so that multiprocess
> access works. I understand that leaves us with an extra load instruction, but I
> think thats ok, because it also allows...
>
> Addition of a new function rte_acl_classify_alg. This function lets you
> specify an enum value to override the acl contexts default algorith when doing a
> classification. This allows an application to specify a classification
> algorithm without needing to pulicize each method. I know there was concern
> over keeping those methods public, but we don't have a static ABI at the moment,
> so this seems to me a reasonable thing to do, as it gives us less of an ABI
> surface to worry about.
Good way to overcome the problem.
>From what I am seeing it adds a tiny slowdown (as expected) ...
Though it provides a good flexibility and I don't have any better ideas.
So I'd say let stick with that approach.
Below are few technical comments.
Thanks
Konstantin
>
> Fixed misc missed static declarations
>
> Removed acl_match_check.h and moved match_check function to acl_run.h
>
> typdeffed function pointer to match check.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> CC: konstantin.ananyev@intel.com
> CC: thomas.monjalon@6wind.com
> ---
> app/test-acl/main.c | 13 +-
> app/test/test_acl.c | 10 +-
> lib/librte_acl/Makefile | 5 +-
> lib/librte_acl/acl.h | 1 +
> lib/librte_acl/acl_bld.c | 5 +-
> lib/librte_acl/acl_run.c | 944 ----------------------------------------
> lib/librte_acl/acl_run.h | 271 ++++++++++++
> lib/librte_acl/acl_run_scalar.c | 197 +++++++++
> lib/librte_acl/acl_run_sse.c | 630 +++++++++++++++++++++++++++
> lib/librte_acl/rte_acl.c | 62 +++
> lib/librte_acl/rte_acl.h | 66 ++-
> 11 files changed, 1208 insertions(+), 996 deletions(-)
> delete mode 100644 lib/librte_acl/acl_run.c
> create mode 100644 lib/librte_acl/acl_run.h
> create mode 100644 lib/librte_acl/acl_run_scalar.c
> create mode 100644 lib/librte_acl/acl_run_sse.c
>
> diff --git a/app/test/test_acl.c b/app/test/test_acl.c
> index 869f6d3..2169f59 100644
> --- a/app/test/test_acl.c
> +++ b/app/test/test_acl.c
> @@ -859,7 +859,7 @@ test_invalid_parameters(void)
> }
>
> /* cover invalid but positive categories in classify */
> - result = rte_acl_classify_scalar(acx, NULL, NULL, 0, 3);
> + result = rte_acl_classify(acx, NULL, NULL, 0, 3);
Typo, should be:
rte_acl_classify_alg(acx, RTE_ACL_CLASSIFY_SCALAR, NULL, NULL, 0, 3);
> diff --git a/lib/librte_acl/acl.h b/lib/librte_acl/acl.h
> index b9d63fd..9236b7b 100644
> --- a/lib/librte_acl/acl.h
> +++ b/lib/librte_acl/acl.h
> @@ -168,6 +168,7 @@ struct rte_acl_ctx {
> void *mem;
> size_t mem_sz;
> struct rte_acl_config config; /* copy of build config. */
> + enum rte_acl_classify_alg alg;
> };
Each rte_acl_build() will reset all fields of rte_acl_ctx starting from num_categories and below.
So we need to move alg somewhere above num_categories:
--- a/lib/librte_acl/acl.h
+++ b/lib/librte_acl/acl.h
@@ -153,6 +153,7 @@ struct rte_acl_ctx {
/** Name of the ACL context. */
int32_t socket_id;
/** Socket ID to allocate memory from. */
+ enum rte_acl_classify_alg alg;
void *rules;
uint32_t max_rules;
uint32_t rule_sz;
@@ -168,9 +169,11 @@ struct rte_acl_ctx {
void *mem;
size_t mem_sz;
struct rte_acl_config config; /* copy of build config. */
- enum rte_acl_classify_alg alg;
};
> diff --git a/lib/librte_acl/acl_run_scalar.c b/lib/librte_acl/acl_run_scalar.c
> new file mode 100644
> index 0000000..4bf58c7
> --- /dev/null
> +++ b/lib/librte_acl/acl_run_scalar.c
> @@ -0,0 +1,197 @@
> +
> +#include "acl_run.h"
> +
> +int
> +rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t num, uint32_t categories);
No need to put this declaration here.
I think you can put both rte_acl_classify_sse(), rte_acl_classify_scalar() into acl.h (it is internal lib header).
And remove another declarations of these functions from rte_acl.c.
> diff --git a/lib/librte_acl/acl_run_sse.c b/lib/librte_acl/acl_run_sse.c
> new file mode 100644
> index 0000000..7ae63dd
> --- /dev/null
> +++ b/lib/librte_acl/acl_run_sse.c
> +#include "acl_run.h"
> +
+
+int
+rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories);
+
Move to acl.h.
> diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c
> index 7c288bd..741bed4 100644
> --- a/lib/librte_acl/rte_acl.c
> +++ b/lib/librte_acl/rte_acl.c
> @@ -33,11 +33,72 @@
>
> #include <rte_acl.h>
> #include "acl.h"
> +#include "acl_run.h"
acl_run.h contains defintions for a lot of functions and should be included only by acl_run_*.c.
I think it is better to move typedef int (*rte_acl_classify_t) into acl.h and don't include acl_run.h here.
>
> #define BIT_SIZEOF(x) (sizeof(x) * CHAR_BIT)
>
> TAILQ_HEAD(rte_acl_list, rte_tailq_entry);
>
> +extern int
> +rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t num, uint32_t categories);
> +
> +extern int
> +rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t num, uint32_t categories);
> +
As above: I think it is safe to move these declarations into acl.h.
> +static rte_acl_classify_t classify_fns[] = {
> + [RTE_ACL_CLASSIFY_DEFAULT] = rte_acl_classify_scalar,
> + [RTE_ACL_CLASSIFY_SCALAR] = rte_acl_classify_scalar,
> + [RTE_ACL_CLASSIFY_SSE] = rte_acl_classify_sse,
> +};
static const static rte_acl_classify_t classify_fns[]
?
> +
> +
> +extern int
> +rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t num, uint32_t categories);
Duplicate.
> +
> +/* by default, use always avaialbe scalar code path. */
> +static enum rte_acl_classify_alg rte_acl_default_classify = RTE_ACL_CLASSIFY_SCALAR;
Line is longer than 80 chars?
> +
> +void rte_acl_set_default_classify(enum rte_acl_classify_alg alg)
> +{
> + rte_acl_default_classify = alg;
> +}
void
rte_acls_set_default_classify(...)
Though, I am not sure why do we need it to be public now.
Users can setup ALG per context.
> +
> +void rte_acl_set_ctx_classify(struct rte_acl_ctx *ctx, enum rte_acl_classify_alg alg)
> +{
> + ctx->alg = alg;
> +}
Same as above:
void
rte_acl_set_ctx_classify(...)
Plus probably add checking that alg is a valid argument:
If ((uint32_t)alg < RTE_DIM(classify_fns)) {ctx->alg=alg; return 0;}
return -EINVAL;
> +
> +static void __attribute__((constructor))
> +rte_acl_init(void)
> +{
> + enum rte_acl_classify_alg alg = RTE_ACL_CLASSIFY_DEFAULT;
> +
> + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
> + alg = RTE_ACL_CLASSIFY_SSE;
> +
> + rte_acl_set_default_classify(alg);
> +}
> +
> +int rte_acl_classify(const struct rte_acl_ctx *ctx,
> + const uint8_t **data,
> + uint32_t *results, uint32_t num,
> + uint32_t categories)
> +{
> + return classify_fns[ctx->alg](ctx, data, results, num, categories);
> +}
> +
> +int rte_acl_classify_alg(const struct rte_acl_ctx *ctx,
> + enum rte_acl_classify_alg alg,
> + const uint8_t **data,
> + uint32_t *results, uint32_t num,
> + uint32_t categories)
> +{
> + return classify_fns[alg](ctx, data, results, num, categories);
> +}
Can you move alg argument to be the last one?
That would prevent copying parameters between registers.
Plus same thing with the function definition style.
> +
> struct rte_acl_ctx *
> rte_acl_find_existing(const char *name)
> {
> @@ -165,6 +226,7 @@ rte_acl_create(const struct rte_acl_param *param)
> ctx->max_rules = param->max_rule_num;
> ctx->rule_sz = param->rule_size;
> ctx->socket_id = param->socket_id;
> + ctx->alg = rte_acl_default_classify;
> snprintf(ctx->name, sizeof(ctx->name), "%s", param->name);
>
> te->data = (void *) ctx;
> diff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h
> index afc0f69..c092a49 100644
> --- a/lib/librte_acl/rte_acl.h
> +++ b/lib/librte_acl/rte_acl.h
> @@ -259,39 +259,6 @@ void
> rte_acl_reset(struct rte_acl_ctx *ctx);
>
> /**
> - * Search for a matching ACL rule for each input data buffer.
> - * Each input data buffer can have up to *categories* matches.
> - * That implies that results array should be big enough to hold
> - * (categories * num) elements.
> - * Also categories parameter should be either one or multiple of
> - * RTE_ACL_RESULTS_MULTIPLIER and can't be bigger than RTE_ACL_MAX_CATEGORIES.
> - * If more than one rule is applicable for given input buffer and
> - * given category, then rule with highest priority will be returned as a match.
> - * Note, that it is a caller responsibility to ensure that input parameters
> - * are valid and point to correct memory locations.
> - *
> - * @param ctx
> - * ACL context to search with.
> - * @param data
> - * Array of pointers to input data buffers to perform search.
> - * Note that all fields in input data buffers supposed to be in network
> - * byte order (MSB).
> - * @param results
> - * Array of search results, *categories* results per each input data buffer.
> - * @param num
> - * Number of elements in the input data buffers array.
> - * @param categories
> - * Number of maximum possible matches for each input buffer, one possible
> - * match per category.
> - * @return
> - * zero on successful completion.
> - * -EINVAL for incorrect arguments.
> - */
> -int
> -rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> - uint32_t *results, uint32_t num, uint32_t categories);
> -
> -/**
> * Perform scalar search for a matching ACL rule for each input data buffer.
> * Note, that while the search itself will avoid explicit use of SSE/AVX
> * intrinsics, code for comparing matching results/priorities sill might use
> @@ -323,9 +290,36 @@ rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> * zero on successful completion.
> * -EINVAL for incorrect arguments.
> */
> -int
> -rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> - uint32_t *results, uint32_t num, uint32_t categories);
> +
> +enum rte_acl_classify_alg {
> + RTE_ACL_CLASSIFY_DEFAULT = 0,
> + RTE_ACL_CLASSIFY_SCALAR = 1,
> + RTE_ACL_CLASSIFY_SSE = 2,
> +};
> +
I think you removed the wrong comment.
All public API function declaration supposed to be preceded by formal doxygen style comment:
Brief explanation, parameters and return value description, etc.
Please restore the proper comment for it.
BTW, two new functions above - they need a formal comments too.
> +extern int
> +rte_acl_classify(const struct rte_acl_ctx *ctx,
> + const uint8_t **data,
> + uint32_t *results, uint32_t num,
> + uint32_t categories);
> +
> +extern int
> +rte_acl_classify_alg(const struct rte_acl_ctx *ctx,
> + enum rte_acl_classify_alg alg,
> + const uint8_t **data,
> + uint32_t *results, uint32_t num,
> + uint32_t categories);
> +/*
> + * Set the default classify algorithm for newly allocated classify contexts
> + */
> +extern void
> +rte_acl_set_default_classify(enum rte_acl_classify_alg alg);
> +
> +/*
> + * Override the default classifier function for a given ctx
> + */
> +extern void
> +rte_acl_set_ctx_classify(struct rte_acl_ctx *ctx, enum rte_acl_classify_alg alg);
>
> /**
> * Dump an ACL context structure to the console.
> --
> 1.9.3
Also, need to update examples/l3fwd-acl/ (remove rte_acl_classify_scalar() calls).
Something like:
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 9b2c21b..8cbf202 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -278,15 +278,6 @@ send_single_packet(struct rte_mbuf *m, uint8_t port);
(in) = end + 1; \
} while (0)
-#define CLASSIFY(context, data, res, num, cat) do { \
- if (scalar) \
- rte_acl_classify_scalar((context), (data), \
- (res), (num), (cat)); \
- else \
- rte_acl_classify((context), (data), \
- (res), (num), (cat)); \
-} while (0)
-
/*
* ACL rules should have higher priorities than route ones to ensure ACL rule
* always be found when input packets have multi-matches in the database.
@@ -1253,6 +1244,9 @@ app_acl_init(void)
dump_acl_config();
+ if (parm_config.scalar)
+ rte_acl_set_default_classify(RTE_ACL_CLASSIFY_SCALAR);
+
/* Load rules from the input file */
if (add_rules(parm_config.rule_ipv4_name, &route_base_ipv4,
&route_num_ipv4, &acl_base_ipv4, &acl_num_ipv4,
@@ -1436,10 +1430,8 @@ main_loop(__attribute__((unused)) void *dummy)
int socketid;
const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1)
/ US_PER_S * BURST_TX_DRAIN_US;
- int scalar = parm_config.scalar;
prev_tsc = 0;
-
lcore_id = rte_lcore_id();
qconf = &lcore_conf[lcore_id];
socketid = rte_lcore_to_socket_id(lcore_id);
@@ -1503,7 +1495,8 @@ main_loop(__attribute__((unused)) void *dummy)
nb_rx);
if (acl_search.num_ipv4) {
- CLASSIFY(acl_config.acx_ipv4[socketid],
+ rte_acl_classify(
+ acl_config.acx_ipv4[socketid],
acl_search.data_ipv4,
acl_search.res_ipv4,
acl_search.num_ipv4,
@@ -1515,7 +1508,8 @@ main_loop(__attribute__((unused)) void *dummy)
}
if (acl_search.num_ipv6) {
- CLASSIFY(acl_config.acx_ipv6[socketid],
+ rte_acl_classify(
+ acl_config.acx_ipv6[socketid],
acl_search.data_ipv6,
acl_search.res_ipv6,
acl_search.num_ipv6,
^ permalink raw reply [relevance 0%]
* [dpdk-dev] [PATCHv4] librte_acl make it build/work for 'default' target
@ 2014-08-28 20:38 1% ` Neil Horman
2014-08-29 17:58 0% ` Ananyev, Konstantin
1 sibling, 1 reply; 200+ results
From: Neil Horman @ 2014-08-28 20:38 UTC (permalink / raw)
To: dev
Make ACL library to build/work on 'default' architecture:
- make rte_acl_classify_scalar really scalar
(make sure it wouldn't use sse4 instrincts through resolve_priority()).
- Provide two versions of rte_acl_classify code path:
rte_acl_classify_sse() - could be build and used only on systems with sse4.2
and upper, return -ENOTSUP on lower arch.
rte_acl_classify_scalar() - a slower version, but could be build and used
on all systems.
- keep common code shared between these two codepaths.
v2 chages:
run-time selection of most appropriate code-path for given ISA.
By default the highest supprted one is selected.
User can still override that selection by manually assigning new value to
the global function pointer rte_acl_default_classify.
rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
points to.
V3 Changes
Updated classify pointer to be a function so as to better preserve ABI
REmoved macro definitions for match check functions to make them static inline
V4 Changes
Rewrote classification selection mechanim to use a function table, so that we
can just store the preferred alg in the rte_acl_ctx struct so that multiprocess
access works. I understand that leaves us with an extra load instruction, but I
think thats ok, because it also allows...
Addition of a new function rte_acl_classify_alg. This function lets you
specify an enum value to override the acl contexts default algorith when doing a
classification. This allows an application to specify a classification
algorithm without needing to pulicize each method. I know there was concern
over keeping those methods public, but we don't have a static ABI at the moment,
so this seems to me a reasonable thing to do, as it gives us less of an ABI
surface to worry about.
Fixed misc missed static declarations
Removed acl_match_check.h and moved match_check function to acl_run.h
typdeffed function pointer to match check.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: konstantin.ananyev@intel.com
CC: thomas.monjalon@6wind.com
---
app/test-acl/main.c | 13 +-
app/test/test_acl.c | 10 +-
lib/librte_acl/Makefile | 5 +-
lib/librte_acl/acl.h | 1 +
lib/librte_acl/acl_bld.c | 5 +-
lib/librte_acl/acl_run.c | 944 ----------------------------------------
lib/librte_acl/acl_run.h | 271 ++++++++++++
lib/librte_acl/acl_run_scalar.c | 197 +++++++++
lib/librte_acl/acl_run_sse.c | 630 +++++++++++++++++++++++++++
lib/librte_acl/rte_acl.c | 62 +++
lib/librte_acl/rte_acl.h | 66 ++-
11 files changed, 1208 insertions(+), 996 deletions(-)
delete mode 100644 lib/librte_acl/acl_run.c
create mode 100644 lib/librte_acl/acl_run.h
create mode 100644 lib/librte_acl/acl_run_scalar.c
create mode 100644 lib/librte_acl/acl_run_sse.c
diff --git a/app/test-acl/main.c b/app/test-acl/main.c
index d654409..6551918 100644
--- a/app/test-acl/main.c
+++ b/app/test-acl/main.c
@@ -787,6 +787,10 @@ acx_init(void)
/* perform build. */
ret = rte_acl_build(config.acx, &cfg);
+ /* setup default rte_acl_classify */
+ if (config.scalar)
+ rte_acl_set_default_classify(RTE_ACL_CLASSIFY_SCALAR);
+
dump_verbose(DUMP_NONE, stdout,
"rte_acl_build(%u) finished with %d\n",
config.bld_categories, ret);
@@ -815,13 +819,8 @@ search_ip5tuples_once(uint32_t categories, uint32_t step, int scalar)
v += config.trace_sz;
}
- if (scalar != 0)
- ret = rte_acl_classify_scalar(config.acx, data,
- results, n, categories);
-
- else
- ret = rte_acl_classify(config.acx, data,
- results, n, categories);
+ ret = rte_acl_classify(config.acx, data, results,
+ n, categories);
if (ret != 0)
rte_exit(ret, "classify for ipv%c_5tuples returns %d\n",
diff --git a/app/test/test_acl.c b/app/test/test_acl.c
index 869f6d3..2169f59 100644
--- a/app/test/test_acl.c
+++ b/app/test/test_acl.c
@@ -148,7 +148,7 @@ test_classify_run(struct rte_acl_ctx *acx)
}
/* make a quick check for scalar */
- ret = rte_acl_classify_scalar(acx, data, results,
+ ret = rte_acl_classify_alg(acx, RTE_ACL_CLASSIFY_SCALAR, data, results,
RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES);
if (ret != 0) {
printf("Line %i: SSE classify failed!\n", __LINE__);
@@ -343,7 +343,7 @@ test_invalid_layout(void)
}
/* classify tuples */
- ret = rte_acl_classify(acx, data, results,
+ ret = rte_acl_classify_alg(acx, RTE_ACL_CLASSIFY_SCALAR, data, results,
RTE_DIM(results), 1);
if (ret != 0) {
printf("Line %i: SSE classify failed!\n", __LINE__);
@@ -362,7 +362,7 @@ test_invalid_layout(void)
}
/* classify tuples (scalar) */
- ret = rte_acl_classify_scalar(acx, data, results,
+ ret = rte_acl_classify_alg(acx, RTE_ACL_CLASSIFY_SCALAR, data, results,
RTE_DIM(results), 1);
if (ret != 0) {
printf("Line %i: Scalar classify failed!\n", __LINE__);
@@ -850,7 +850,7 @@ test_invalid_parameters(void)
/* scalar classify test */
/* cover zero categories in classify (should not fail) */
- result = rte_acl_classify_scalar(acx, NULL, NULL, 0, 0);
+ result = rte_acl_classify_alg(acx, RTE_ACL_CLASSIFY_SCALAR, NULL, NULL, 0, 0);
if (result != 0) {
printf("Line %i: Scalar classify with zero categories "
"failed!\n", __LINE__);
@@ -859,7 +859,7 @@ test_invalid_parameters(void)
}
/* cover invalid but positive categories in classify */
- result = rte_acl_classify_scalar(acx, NULL, NULL, 0, 3);
+ result = rte_acl_classify(acx, NULL, NULL, 0, 3);
if (result == 0) {
printf("Line %i: Scalar classify with 3 categories "
"should have failed!\n", __LINE__);
diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 4fe4593..65e566d 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -43,7 +43,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += rte_acl.c
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_bld.c
SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_gen.c
-SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run.c
+SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_scalar.c
+SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_sse.c
+
+CFLAGS_acl_run_sse.o += -msse4.1
# install this header file
SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include := rte_acl_osdep.h
diff --git a/lib/librte_acl/acl.h b/lib/librte_acl/acl.h
index b9d63fd..9236b7b 100644
--- a/lib/librte_acl/acl.h
+++ b/lib/librte_acl/acl.h
@@ -168,6 +168,7 @@ struct rte_acl_ctx {
void *mem;
size_t mem_sz;
struct rte_acl_config config; /* copy of build config. */
+ enum rte_acl_classify_alg alg;
};
int rte_acl_gen(struct rte_acl_ctx *ctx, struct rte_acl_trie *trie,
diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c
index 873447b..09d58ea 100644
--- a/lib/librte_acl/acl_bld.c
+++ b/lib/librte_acl/acl_bld.c
@@ -31,7 +31,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <nmmintrin.h>
#include <rte_acl.h>
#include "tb_mem.h"
#include "acl.h"
@@ -1480,8 +1479,8 @@ acl_calc_wildness(struct rte_acl_build_rule *head,
switch (rule->config->defs[n].type) {
case RTE_ACL_FIELD_TYPE_BITMASK:
- wild = (size -
- _mm_popcnt_u32(fld->mask_range.u8)) /
+ wild = (size - __builtin_popcount(
+ fld->mask_range.u8)) /
size;
break;
diff --git a/lib/librte_acl/acl_run.c b/lib/librte_acl/acl_run.c
deleted file mode 100644
index e3d9fc1..0000000
--- a/lib/librte_acl/acl_run.c
+++ /dev/null
@@ -1,944 +0,0 @@
-/*-
- * BSD LICENSE
- *
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Intel Corporation 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
- * OWNER 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.
- */
-
-#include <rte_acl.h>
-#include "acl_vect.h"
-#include "acl.h"
-
-#define MAX_SEARCHES_SSE8 8
-#define MAX_SEARCHES_SSE4 4
-#define MAX_SEARCHES_SSE2 2
-#define MAX_SEARCHES_SCALAR 2
-
-#define GET_NEXT_4BYTES(prm, idx) \
- (*((const int32_t *)((prm)[(idx)].data + *(prm)[idx].data_index++)))
-
-
-#define RTE_ACL_NODE_INDEX ((uint32_t)~RTE_ACL_NODE_TYPE)
-
-#define SCALAR_QRANGE_MULT 0x01010101
-#define SCALAR_QRANGE_MASK 0x7f7f7f7f
-#define SCALAR_QRANGE_MIN 0x80808080
-
-enum {
- SHUFFLE32_SLOT1 = 0xe5,
- SHUFFLE32_SLOT2 = 0xe6,
- SHUFFLE32_SLOT3 = 0xe7,
- SHUFFLE32_SWAP64 = 0x4e,
-};
-
-/*
- * Structure to manage N parallel trie traversals.
- * The runtime trie traversal routines can process 8, 4, or 2 tries
- * in parallel. Each packet may require multiple trie traversals (up to 4).
- * This structure is used to fill the slots (0 to n-1) for parallel processing
- * with the trie traversals needed for each packet.
- */
-struct acl_flow_data {
- uint32_t num_packets;
- /* number of packets processed */
- uint32_t started;
- /* number of trie traversals in progress */
- uint32_t trie;
- /* current trie index (0 to N-1) */
- uint32_t cmplt_size;
- uint32_t total_packets;
- uint32_t categories;
- /* number of result categories per packet. */
- /* maximum number of packets to process */
- const uint64_t *trans;
- const uint8_t **data;
- uint32_t *results;
- struct completion *last_cmplt;
- struct completion *cmplt_array;
-};
-
-/*
- * Structure to maintain running results for
- * a single packet (up to 4 tries).
- */
-struct completion {
- uint32_t *results; /* running results. */
- int32_t priority[RTE_ACL_MAX_CATEGORIES]; /* running priorities. */
- uint32_t count; /* num of remaining tries */
- /* true for allocated struct */
-} __attribute__((aligned(XMM_SIZE)));
-
-/*
- * One parms structure for each slot in the search engine.
- */
-struct parms {
- const uint8_t *data;
- /* input data for this packet */
- const uint32_t *data_index;
- /* data indirection for this trie */
- struct completion *cmplt;
- /* completion data for this packet */
-};
-
-/*
- * Define an global idle node for unused engine slots
- */
-static const uint32_t idle[UINT8_MAX + 1];
-
-static const rte_xmm_t mm_type_quad_range = {
- .u32 = {
- RTE_ACL_NODE_QRANGE,
- RTE_ACL_NODE_QRANGE,
- RTE_ACL_NODE_QRANGE,
- RTE_ACL_NODE_QRANGE,
- },
-};
-
-static const rte_xmm_t mm_type_quad_range64 = {
- .u32 = {
- RTE_ACL_NODE_QRANGE,
- RTE_ACL_NODE_QRANGE,
- 0,
- 0,
- },
-};
-
-static const rte_xmm_t mm_shuffle_input = {
- .u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c},
-};
-
-static const rte_xmm_t mm_shuffle_input64 = {
- .u32 = {0x00000000, 0x04040404, 0x80808080, 0x80808080},
-};
-
-static const rte_xmm_t mm_ones_16 = {
- .u16 = {1, 1, 1, 1, 1, 1, 1, 1},
-};
-
-static const rte_xmm_t mm_bytes = {
- .u32 = {UINT8_MAX, UINT8_MAX, UINT8_MAX, UINT8_MAX},
-};
-
-static const rte_xmm_t mm_bytes64 = {
- .u32 = {UINT8_MAX, UINT8_MAX, 0, 0},
-};
-
-static const rte_xmm_t mm_match_mask = {
- .u32 = {
- RTE_ACL_NODE_MATCH,
- RTE_ACL_NODE_MATCH,
- RTE_ACL_NODE_MATCH,
- RTE_ACL_NODE_MATCH,
- },
-};
-
-static const rte_xmm_t mm_match_mask64 = {
- .u32 = {
- RTE_ACL_NODE_MATCH,
- 0,
- RTE_ACL_NODE_MATCH,
- 0,
- },
-};
-
-static const rte_xmm_t mm_index_mask = {
- .u32 = {
- RTE_ACL_NODE_INDEX,
- RTE_ACL_NODE_INDEX,
- RTE_ACL_NODE_INDEX,
- RTE_ACL_NODE_INDEX,
- },
-};
-
-static const rte_xmm_t mm_index_mask64 = {
- .u32 = {
- RTE_ACL_NODE_INDEX,
- RTE_ACL_NODE_INDEX,
- 0,
- 0,
- },
-};
-
-/*
- * Allocate a completion structure to manage the tries for a packet.
- */
-static inline struct completion *
-alloc_completion(struct completion *p, uint32_t size, uint32_t tries,
- uint32_t *results)
-{
- uint32_t n;
-
- for (n = 0; n < size; n++) {
-
- if (p[n].count == 0) {
-
- /* mark as allocated and set number of tries. */
- p[n].count = tries;
- p[n].results = results;
- return &(p[n]);
- }
- }
-
- /* should never get here */
- return NULL;
-}
-
-/*
- * Resolve priority for a single result trie.
- */
-static inline void
-resolve_single_priority(uint64_t transition, int n,
- const struct rte_acl_ctx *ctx, struct parms *parms,
- const struct rte_acl_match_results *p)
-{
- if (parms[n].cmplt->count == ctx->num_tries ||
- parms[n].cmplt->priority[0] <=
- p[transition].priority[0]) {
-
- parms[n].cmplt->priority[0] = p[transition].priority[0];
- parms[n].cmplt->results[0] = p[transition].results[0];
- }
-
- parms[n].cmplt->count--;
-}
-
-/*
- * Resolve priority for multiple results. This consists comparing
- * the priority of the current traversal with the running set of
- * results for the packet. For each result, keep a running array of
- * the result (rule number) and its priority for each category.
- */
-static inline void
-resolve_priority(uint64_t transition, int n, const struct rte_acl_ctx *ctx,
- struct parms *parms, const struct rte_acl_match_results *p,
- uint32_t categories)
-{
- uint32_t x;
- xmm_t results, priority, results1, priority1, selector;
- xmm_t *saved_results, *saved_priority;
-
- for (x = 0; x < categories; x += RTE_ACL_RESULTS_MULTIPLIER) {
-
- saved_results = (xmm_t *)(&parms[n].cmplt->results[x]);
- saved_priority =
- (xmm_t *)(&parms[n].cmplt->priority[x]);
-
- /* get results and priorities for completed trie */
- results = MM_LOADU((const xmm_t *)&p[transition].results[x]);
- priority = MM_LOADU((const xmm_t *)&p[transition].priority[x]);
-
- /* if this is not the first completed trie */
- if (parms[n].cmplt->count != ctx->num_tries) {
-
- /* get running best results and their priorities */
- results1 = MM_LOADU(saved_results);
- priority1 = MM_LOADU(saved_priority);
-
- /* select results that are highest priority */
- selector = MM_CMPGT32(priority1, priority);
- results = MM_BLENDV8(results, results1, selector);
- priority = MM_BLENDV8(priority, priority1, selector);
- }
-
- /* save running best results and their priorities */
- MM_STOREU(saved_results, results);
- MM_STOREU(saved_priority, priority);
- }
-
- /* Count down completed tries for this search request */
- parms[n].cmplt->count--;
-}
-
-/*
- * Routine to fill a slot in the parallel trie traversal array (parms) from
- * the list of packets (flows).
- */
-static inline uint64_t
-acl_start_next_trie(struct acl_flow_data *flows, struct parms *parms, int n,
- const struct rte_acl_ctx *ctx)
-{
- uint64_t transition;
-
- /* if there are any more packets to process */
- if (flows->num_packets < flows->total_packets) {
- parms[n].data = flows->data[flows->num_packets];
- parms[n].data_index = ctx->trie[flows->trie].data_index;
-
- /* if this is the first trie for this packet */
- if (flows->trie == 0) {
- flows->last_cmplt = alloc_completion(flows->cmplt_array,
- flows->cmplt_size, ctx->num_tries,
- flows->results +
- flows->num_packets * flows->categories);
- }
-
- /* set completion parameters and starting index for this slot */
- parms[n].cmplt = flows->last_cmplt;
- transition =
- flows->trans[parms[n].data[*parms[n].data_index++] +
- ctx->trie[flows->trie].root_index];
-
- /*
- * if this is the last trie for this packet,
- * then setup next packet.
- */
- flows->trie++;
- if (flows->trie >= ctx->num_tries) {
- flows->trie = 0;
- flows->num_packets++;
- }
-
- /* keep track of number of active trie traversals */
- flows->started++;
-
- /* no more tries to process, set slot to an idle position */
- } else {
- transition = ctx->idle;
- parms[n].data = (const uint8_t *)idle;
- parms[n].data_index = idle;
- }
- return transition;
-}
-
-/*
- * Detect matches. If a match node transition is found, then this trie
- * traversal is complete and fill the slot with the next trie
- * to be processed.
- */
-static inline uint64_t
-acl_match_check_transition(uint64_t transition, int slot,
- const struct rte_acl_ctx *ctx, struct parms *parms,
- struct acl_flow_data *flows)
-{
- const struct rte_acl_match_results *p;
-
- p = (const struct rte_acl_match_results *)
- (flows->trans + ctx->match_index);
-
- if (transition & RTE_ACL_NODE_MATCH) {
-
- /* Remove flags from index and decrement active traversals */
- transition &= RTE_ACL_NODE_INDEX;
- flows->started--;
-
- /* Resolve priorities for this trie and running results */
- if (flows->categories == 1)
- resolve_single_priority(transition, slot, ctx,
- parms, p);
- else
- resolve_priority(transition, slot, ctx, parms, p,
- flows->categories);
-
- /* Fill the slot with the next trie or idle trie */
- transition = acl_start_next_trie(flows, parms, slot, ctx);
-
- } else if (transition == ctx->idle) {
- /* reset indirection table for idle slots */
- parms[slot].data_index = idle;
- }
-
- return transition;
-}
-
-/*
- * Extract transitions from an XMM register and check for any matches
- */
-static void
-acl_process_matches(xmm_t *indicies, int slot, const struct rte_acl_ctx *ctx,
- struct parms *parms, struct acl_flow_data *flows)
-{
- uint64_t transition1, transition2;
-
- /* extract transition from low 64 bits. */
- transition1 = MM_CVT64(*indicies);
-
- /* extract transition from high 64 bits. */
- *indicies = MM_SHUFFLE32(*indicies, SHUFFLE32_SWAP64);
- transition2 = MM_CVT64(*indicies);
-
- transition1 = acl_match_check_transition(transition1, slot, ctx,
- parms, flows);
- transition2 = acl_match_check_transition(transition2, slot + 1, ctx,
- parms, flows);
-
- /* update indicies with new transitions. */
- *indicies = MM_SET64(transition2, transition1);
-}
-
-/*
- * Check for a match in 2 transitions (contained in SSE register)
- */
-static inline void
-acl_match_check_x2(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
- struct acl_flow_data *flows, xmm_t *indicies, xmm_t match_mask)
-{
- xmm_t temp;
-
- temp = MM_AND(match_mask, *indicies);
- while (!MM_TESTZ(temp, temp)) {
- acl_process_matches(indicies, slot, ctx, parms, flows);
- temp = MM_AND(match_mask, *indicies);
- }
-}
-
-/*
- * Check for any match in 4 transitions (contained in 2 SSE registers)
- */
-static inline void
-acl_match_check_x4(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
- struct acl_flow_data *flows, xmm_t *indicies1, xmm_t *indicies2,
- xmm_t match_mask)
-{
- xmm_t temp;
-
- /* put low 32 bits of each transition into one register */
- temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
- 0x88);
- /* test for match node */
- temp = MM_AND(match_mask, temp);
-
- while (!MM_TESTZ(temp, temp)) {
- acl_process_matches(indicies1, slot, ctx, parms, flows);
- acl_process_matches(indicies2, slot + 2, ctx, parms, flows);
-
- temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
- (__m128)*indicies2,
- 0x88);
- temp = MM_AND(match_mask, temp);
- }
-}
-
-/*
- * Calculate the address of the next transition for
- * all types of nodes. Note that only DFA nodes and range
- * nodes actually transition to another node. Match
- * nodes don't move.
- */
-static inline xmm_t
-acl_calc_addr(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
- xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
- xmm_t *indicies1, xmm_t *indicies2)
-{
- xmm_t addr, node_types, temp;
-
- /*
- * Note that no transition is done for a match
- * node and therefore a stream freezes when
- * it reaches a match.
- */
-
- /* Shuffle low 32 into temp and high 32 into indicies2 */
- temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
- 0x88);
- *indicies2 = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
- (__m128)*indicies2, 0xdd);
-
- /* Calc node type and node addr */
- node_types = MM_ANDNOT(index_mask, temp);
- addr = MM_AND(index_mask, temp);
-
- /*
- * Calc addr for DFAs - addr = dfa_index + input_byte
- */
-
- /* mask for DFA type (0) nodes */
- temp = MM_CMPEQ32(node_types, MM_XOR(node_types, node_types));
-
- /* add input byte to DFA position */
- temp = MM_AND(temp, bytes);
- temp = MM_AND(temp, next_input);
- addr = MM_ADD32(addr, temp);
-
- /*
- * Calc addr for Range nodes -> range_index + range(input)
- */
- node_types = MM_CMPEQ32(node_types, type_quad_range);
-
- /*
- * Calculate number of range boundaries that are less than the
- * input value. Range boundaries for each node are in signed 8 bit,
- * ordered from -128 to 127 in the indicies2 register.
- * This is effectively a popcnt of bytes that are greater than the
- * input byte.
- */
-
- /* shuffle input byte to all 4 positions of 32 bit value */
- temp = MM_SHUFFLE8(next_input, shuffle_input);
-
- /* check ranges */
- temp = MM_CMPGT8(temp, *indicies2);
-
- /* convert -1 to 1 (bytes greater than input byte */
- temp = MM_SIGN8(temp, temp);
-
- /* horizontal add pairs of bytes into words */
- temp = MM_MADD8(temp, temp);
-
- /* horizontal add pairs of words into dwords */
- temp = MM_MADD16(temp, ones_16);
-
- /* mask to range type nodes */
- temp = MM_AND(temp, node_types);
-
- /* add index into node position */
- return MM_ADD32(addr, temp);
-}
-
-/*
- * Process 4 transitions (in 2 SIMD registers) in parallel
- */
-static inline xmm_t
-transition4(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
- xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
- const uint64_t *trans, xmm_t *indicies1, xmm_t *indicies2)
-{
- xmm_t addr;
- uint64_t trans0, trans2;
-
- /* Calculate the address (array index) for all 4 transitions. */
-
- addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
- bytes, type_quad_range, indicies1, indicies2);
-
- /* Gather 64 bit transitions and pack back into 2 registers. */
-
- trans0 = trans[MM_CVT32(addr)];
-
- /* get slot 2 */
-
- /* {x0, x1, x2, x3} -> {x2, x1, x2, x3} */
- addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT2);
- trans2 = trans[MM_CVT32(addr)];
-
- /* get slot 1 */
-
- /* {x2, x1, x2, x3} -> {x1, x1, x2, x3} */
- addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
- *indicies1 = MM_SET64(trans[MM_CVT32(addr)], trans0);
-
- /* get slot 3 */
-
- /* {x1, x1, x2, x3} -> {x3, x1, x2, x3} */
- addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT3);
- *indicies2 = MM_SET64(trans[MM_CVT32(addr)], trans2);
-
- return MM_SRL32(next_input, 8);
-}
-
-static inline void
-acl_set_flow(struct acl_flow_data *flows, struct completion *cmplt,
- uint32_t cmplt_size, const uint8_t **data, uint32_t *results,
- uint32_t data_num, uint32_t categories, const uint64_t *trans)
-{
- flows->num_packets = 0;
- flows->started = 0;
- flows->trie = 0;
- flows->last_cmplt = NULL;
- flows->cmplt_array = cmplt;
- flows->total_packets = data_num;
- flows->categories = categories;
- flows->cmplt_size = cmplt_size;
- flows->data = data;
- flows->results = results;
- flows->trans = trans;
-}
-
-/*
- * Execute trie traversal with 8 traversals in parallel
- */
-static inline void
-search_sse_8(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t total_packets, uint32_t categories)
-{
- int n;
- struct acl_flow_data flows;
- uint64_t index_array[MAX_SEARCHES_SSE8];
- struct completion cmplt[MAX_SEARCHES_SSE8];
- struct parms parms[MAX_SEARCHES_SSE8];
- xmm_t input0, input1;
- xmm_t indicies1, indicies2, indicies3, indicies4;
-
- acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
- total_packets, categories, ctx->trans_table);
-
- for (n = 0; n < MAX_SEARCHES_SSE8; n++) {
- cmplt[n].count = 0;
- index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
- }
-
- /*
- * indicies1 contains index_array[0,1]
- * indicies2 contains index_array[2,3]
- * indicies3 contains index_array[4,5]
- * indicies4 contains index_array[6,7]
- */
-
- indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
- indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
-
- indicies3 = MM_LOADU((xmm_t *) &index_array[4]);
- indicies4 = MM_LOADU((xmm_t *) &index_array[6]);
-
- /* Check for any matches. */
- acl_match_check_x4(0, ctx, parms, &flows,
- &indicies1, &indicies2, mm_match_mask.m);
- acl_match_check_x4(4, ctx, parms, &flows,
- &indicies3, &indicies4, mm_match_mask.m);
-
- while (flows.started > 0) {
-
- /* Gather 4 bytes of input data for each stream. */
- input0 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0),
- 0);
- input1 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 4),
- 0);
-
- input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 1), 1);
- input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 5), 1);
-
- input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 2), 2);
- input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 6), 2);
-
- input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 3), 3);
- input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 7), 3);
-
- /* Process the 4 bytes of input on each stream. */
-
- input0 = transition4(mm_index_mask.m, input0,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input1 = transition4(mm_index_mask.m, input1,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies3, &indicies4);
-
- input0 = transition4(mm_index_mask.m, input0,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input1 = transition4(mm_index_mask.m, input1,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies3, &indicies4);
-
- input0 = transition4(mm_index_mask.m, input0,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input1 = transition4(mm_index_mask.m, input1,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies3, &indicies4);
-
- input0 = transition4(mm_index_mask.m, input0,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input1 = transition4(mm_index_mask.m, input1,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies3, &indicies4);
-
- /* Check for any matches. */
- acl_match_check_x4(0, ctx, parms, &flows,
- &indicies1, &indicies2, mm_match_mask.m);
- acl_match_check_x4(4, ctx, parms, &flows,
- &indicies3, &indicies4, mm_match_mask.m);
- }
-}
-
-/*
- * Execute trie traversal with 4 traversals in parallel
- */
-static inline void
-search_sse_4(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, int total_packets, uint32_t categories)
-{
- int n;
- struct acl_flow_data flows;
- uint64_t index_array[MAX_SEARCHES_SSE4];
- struct completion cmplt[MAX_SEARCHES_SSE4];
- struct parms parms[MAX_SEARCHES_SSE4];
- xmm_t input, indicies1, indicies2;
-
- acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
- total_packets, categories, ctx->trans_table);
-
- for (n = 0; n < MAX_SEARCHES_SSE4; n++) {
- cmplt[n].count = 0;
- index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
- }
-
- indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
- indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
-
- /* Check for any matches. */
- acl_match_check_x4(0, ctx, parms, &flows,
- &indicies1, &indicies2, mm_match_mask.m);
-
- while (flows.started > 0) {
-
- /* Gather 4 bytes of input data for each stream. */
- input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
- input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
- input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 2), 2);
- input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 3), 3);
-
- /* Process the 4 bytes of input on each stream. */
- input = transition4(mm_index_mask.m, input,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input = transition4(mm_index_mask.m, input,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input = transition4(mm_index_mask.m, input,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- input = transition4(mm_index_mask.m, input,
- mm_shuffle_input.m, mm_ones_16.m,
- mm_bytes.m, mm_type_quad_range.m,
- flows.trans, &indicies1, &indicies2);
-
- /* Check for any matches. */
- acl_match_check_x4(0, ctx, parms, &flows,
- &indicies1, &indicies2, mm_match_mask.m);
- }
-}
-
-static inline xmm_t
-transition2(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
- xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
- const uint64_t *trans, xmm_t *indicies1)
-{
- uint64_t t;
- xmm_t addr, indicies2;
-
- indicies2 = MM_XOR(ones_16, ones_16);
-
- addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
- bytes, type_quad_range, indicies1, &indicies2);
-
- /* Gather 64 bit transitions and pack 2 per register. */
-
- t = trans[MM_CVT32(addr)];
-
- /* get slot 1 */
- addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
- *indicies1 = MM_SET64(trans[MM_CVT32(addr)], t);
-
- return MM_SRL32(next_input, 8);
-}
-
-/*
- * Execute trie traversal with 2 traversals in parallel.
- */
-static inline void
-search_sse_2(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t total_packets, uint32_t categories)
-{
- int n;
- struct acl_flow_data flows;
- uint64_t index_array[MAX_SEARCHES_SSE2];
- struct completion cmplt[MAX_SEARCHES_SSE2];
- struct parms parms[MAX_SEARCHES_SSE2];
- xmm_t input, indicies;
-
- acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
- total_packets, categories, ctx->trans_table);
-
- for (n = 0; n < MAX_SEARCHES_SSE2; n++) {
- cmplt[n].count = 0;
- index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
- }
-
- indicies = MM_LOADU((xmm_t *) &index_array[0]);
-
- /* Check for any matches. */
- acl_match_check_x2(0, ctx, parms, &flows, &indicies, mm_match_mask64.m);
-
- while (flows.started > 0) {
-
- /* Gather 4 bytes of input data for each stream. */
- input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
- input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
-
- /* Process the 4 bytes of input on each stream. */
-
- input = transition2(mm_index_mask64.m, input,
- mm_shuffle_input64.m, mm_ones_16.m,
- mm_bytes64.m, mm_type_quad_range64.m,
- flows.trans, &indicies);
-
- input = transition2(mm_index_mask64.m, input,
- mm_shuffle_input64.m, mm_ones_16.m,
- mm_bytes64.m, mm_type_quad_range64.m,
- flows.trans, &indicies);
-
- input = transition2(mm_index_mask64.m, input,
- mm_shuffle_input64.m, mm_ones_16.m,
- mm_bytes64.m, mm_type_quad_range64.m,
- flows.trans, &indicies);
-
- input = transition2(mm_index_mask64.m, input,
- mm_shuffle_input64.m, mm_ones_16.m,
- mm_bytes64.m, mm_type_quad_range64.m,
- flows.trans, &indicies);
-
- /* Check for any matches. */
- acl_match_check_x2(0, ctx, parms, &flows, &indicies,
- mm_match_mask64.m);
- }
-}
-
-/*
- * When processing the transition, rather than using if/else
- * construct, the offset is calculated for DFA and QRANGE and
- * then conditionally added to the address based on node type.
- * This is done to avoid branch mis-predictions. Since the
- * offset is rather simple calculation it is more efficient
- * to do the calculation and do a condition move rather than
- * a conditional branch to determine which calculation to do.
- */
-static inline uint32_t
-scan_forward(uint32_t input, uint32_t max)
-{
- return (input == 0) ? max : rte_bsf32(input);
-}
-
-static inline uint64_t
-scalar_transition(const uint64_t *trans_table, uint64_t transition,
- uint8_t input)
-{
- uint32_t addr, index, ranges, x, a, b, c;
-
- /* break transition into component parts */
- ranges = transition >> (sizeof(index) * CHAR_BIT);
-
- /* calc address for a QRANGE node */
- c = input * SCALAR_QRANGE_MULT;
- a = ranges | SCALAR_QRANGE_MIN;
- index = transition & ~RTE_ACL_NODE_INDEX;
- a -= (c & SCALAR_QRANGE_MASK);
- b = c & SCALAR_QRANGE_MIN;
- addr = transition ^ index;
- a &= SCALAR_QRANGE_MIN;
- a ^= (ranges ^ b) & (a ^ b);
- x = scan_forward(a, 32) >> 3;
- addr += (index == RTE_ACL_NODE_DFA) ? input : x;
-
- /* pickup next transition */
- transition = *(trans_table + addr);
- return transition;
-}
-
-int
-rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t num, uint32_t categories)
-{
- int n;
- uint64_t transition0, transition1;
- uint32_t input0, input1;
- struct acl_flow_data flows;
- uint64_t index_array[MAX_SEARCHES_SCALAR];
- struct completion cmplt[MAX_SEARCHES_SCALAR];
- struct parms parms[MAX_SEARCHES_SCALAR];
-
- if (categories != 1 &&
- ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
- return -EINVAL;
-
- acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results, num,
- categories, ctx->trans_table);
-
- for (n = 0; n < MAX_SEARCHES_SCALAR; n++) {
- cmplt[n].count = 0;
- index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
- }
-
- transition0 = index_array[0];
- transition1 = index_array[1];
-
- while (flows.started > 0) {
-
- input0 = GET_NEXT_4BYTES(parms, 0);
- input1 = GET_NEXT_4BYTES(parms, 1);
-
- for (n = 0; n < 4; n++) {
- if (likely((transition0 & RTE_ACL_NODE_MATCH) == 0))
- transition0 = scalar_transition(flows.trans,
- transition0, (uint8_t)input0);
-
- input0 >>= CHAR_BIT;
-
- if (likely((transition1 & RTE_ACL_NODE_MATCH) == 0))
- transition1 = scalar_transition(flows.trans,
- transition1, (uint8_t)input1);
-
- input1 >>= CHAR_BIT;
-
- }
- if ((transition0 | transition1) & RTE_ACL_NODE_MATCH) {
- transition0 = acl_match_check_transition(transition0,
- 0, ctx, parms, &flows);
- transition1 = acl_match_check_transition(transition1,
- 1, ctx, parms, &flows);
-
- }
- }
- return 0;
-}
-
-int
-rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t num, uint32_t categories)
-{
- if (categories != 1 &&
- ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
- return -EINVAL;
-
- if (likely(num >= MAX_SEARCHES_SSE8))
- search_sse_8(ctx, data, results, num, categories);
- else if (num >= MAX_SEARCHES_SSE4)
- search_sse_4(ctx, data, results, num, categories);
- else
- search_sse_2(ctx, data, results, num, categories);
-
- return 0;
-}
diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h
new file mode 100644
index 0000000..5009188
--- /dev/null
+++ b/lib/librte_acl/acl_run.h
@@ -0,0 +1,271 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#ifndef _ACL_RUN_H_
+#define _ACL_RUN_H_
+
+#include <rte_acl.h>
+#include "acl_vect.h"
+#include "acl.h"
+
+#define MAX_SEARCHES_SSE8 8
+#define MAX_SEARCHES_SSE4 4
+#define MAX_SEARCHES_SSE2 2
+#define MAX_SEARCHES_SCALAR 2
+
+#define GET_NEXT_4BYTES(prm, idx) \
+ (*((const int32_t *)((prm)[(idx)].data + *(prm)[idx].data_index++)))
+
+
+#define RTE_ACL_NODE_INDEX ((uint32_t)~RTE_ACL_NODE_TYPE)
+
+#define SCALAR_QRANGE_MULT 0x01010101
+#define SCALAR_QRANGE_MASK 0x7f7f7f7f
+#define SCALAR_QRANGE_MIN 0x80808080
+
+typedef int (*rte_acl_classify_t)
+(const struct rte_acl_ctx *, const uint8_t **, uint32_t *, uint32_t, uint32_t);
+
+/*
+ * Structure to manage N parallel trie traversals.
+ * The runtime trie traversal routines can process 8, 4, or 2 tries
+ * in parallel. Each packet may require multiple trie traversals (up to 4).
+ * This structure is used to fill the slots (0 to n-1) for parallel processing
+ * with the trie traversals needed for each packet.
+ */
+struct acl_flow_data {
+ uint32_t num_packets;
+ /* number of packets processed */
+ uint32_t started;
+ /* number of trie traversals in progress */
+ uint32_t trie;
+ /* current trie index (0 to N-1) */
+ uint32_t cmplt_size;
+ uint32_t total_packets;
+ uint32_t categories;
+ /* number of result categories per packet. */
+ /* maximum number of packets to process */
+ const uint64_t *trans;
+ const uint8_t **data;
+ uint32_t *results;
+ struct completion *last_cmplt;
+ struct completion *cmplt_array;
+};
+
+/*
+ * Structure to maintain running results for
+ * a single packet (up to 4 tries).
+ */
+struct completion {
+ uint32_t *results; /* running results. */
+ int32_t priority[RTE_ACL_MAX_CATEGORIES]; /* running priorities. */
+ uint32_t count; /* num of remaining tries */
+ /* true for allocated struct */
+} __attribute__((aligned(XMM_SIZE)));
+
+/*
+ * One parms structure for each slot in the search engine.
+ */
+struct parms {
+ const uint8_t *data;
+ /* input data for this packet */
+ const uint32_t *data_index;
+ /* data indirection for this trie */
+ struct completion *cmplt;
+ /* completion data for this packet */
+};
+
+/*
+ * Define an global idle node for unused engine slots
+ */
+static const uint32_t idle[UINT8_MAX + 1];
+
+/*
+ * Allocate a completion structure to manage the tries for a packet.
+ */
+static inline struct completion *
+alloc_completion(struct completion *p, uint32_t size, uint32_t tries,
+ uint32_t *results)
+{
+ uint32_t n;
+
+ for (n = 0; n < size; n++) {
+
+ if (p[n].count == 0) {
+
+ /* mark as allocated and set number of tries. */
+ p[n].count = tries;
+ p[n].results = results;
+ return &(p[n]);
+ }
+ }
+
+ /* should never get here */
+ return NULL;
+}
+
+/*
+ * Resolve priority for a single result trie.
+ */
+static inline void
+resolve_single_priority(uint64_t transition, int n,
+ const struct rte_acl_ctx *ctx, struct parms *parms,
+ const struct rte_acl_match_results *p)
+{
+ if (parms[n].cmplt->count == ctx->num_tries ||
+ parms[n].cmplt->priority[0] <=
+ p[transition].priority[0]) {
+
+ parms[n].cmplt->priority[0] = p[transition].priority[0];
+ parms[n].cmplt->results[0] = p[transition].results[0];
+ }
+}
+
+/*
+ * Routine to fill a slot in the parallel trie traversal array (parms) from
+ * the list of packets (flows).
+ */
+static inline uint64_t
+acl_start_next_trie(struct acl_flow_data *flows, struct parms *parms, int n,
+ const struct rte_acl_ctx *ctx)
+{
+ uint64_t transition;
+
+ /* if there are any more packets to process */
+ if (flows->num_packets < flows->total_packets) {
+ parms[n].data = flows->data[flows->num_packets];
+ parms[n].data_index = ctx->trie[flows->trie].data_index;
+
+ /* if this is the first trie for this packet */
+ if (flows->trie == 0) {
+ flows->last_cmplt = alloc_completion(flows->cmplt_array,
+ flows->cmplt_size, ctx->num_tries,
+ flows->results +
+ flows->num_packets * flows->categories);
+ }
+
+ /* set completion parameters and starting index for this slot */
+ parms[n].cmplt = flows->last_cmplt;
+ transition =
+ flows->trans[parms[n].data[*parms[n].data_index++] +
+ ctx->trie[flows->trie].root_index];
+
+ /*
+ * if this is the last trie for this packet,
+ * then setup next packet.
+ */
+ flows->trie++;
+ if (flows->trie >= ctx->num_tries) {
+ flows->trie = 0;
+ flows->num_packets++;
+ }
+
+ /* keep track of number of active trie traversals */
+ flows->started++;
+
+ /* no more tries to process, set slot to an idle position */
+ } else {
+ transition = ctx->idle;
+ parms[n].data = (const uint8_t *)idle;
+ parms[n].data_index = idle;
+ }
+ return transition;
+}
+
+static inline void
+acl_set_flow(struct acl_flow_data *flows, struct completion *cmplt,
+ uint32_t cmplt_size, const uint8_t **data, uint32_t *results,
+ uint32_t data_num, uint32_t categories, const uint64_t *trans)
+{
+ flows->num_packets = 0;
+ flows->started = 0;
+ flows->trie = 0;
+ flows->last_cmplt = NULL;
+ flows->cmplt_array = cmplt;
+ flows->total_packets = data_num;
+ flows->categories = categories;
+ flows->cmplt_size = cmplt_size;
+ flows->data = data;
+ flows->results = results;
+ flows->trans = trans;
+}
+
+typedef void (*resolve_priority_t)
+(uint64_t transition, int n, const struct rte_acl_ctx *ctx,
+ struct parms *parms, const struct rte_acl_match_results *p,
+ uint32_t categories);
+
+/*
+ * Detect matches. If a match node transition is found, then this trie
+ * traversal is complete and fill the slot with the next trie
+ * to be processed.
+ */
+static inline uint64_t
+acl_match_check(uint64_t transition, int slot,
+ const struct rte_acl_ctx *ctx, struct parms *parms,
+ struct acl_flow_data *flows, resolve_priority_t resolve_priority)
+{
+ const struct rte_acl_match_results *p;
+
+ p = (const struct rte_acl_match_results *)
+ (flows->trans + ctx->match_index);
+
+ if (transition & RTE_ACL_NODE_MATCH) {
+
+ /* Remove flags from index and decrement active traversals */
+ transition &= RTE_ACL_NODE_INDEX;
+ flows->started--;
+
+ /* Resolve priorities for this trie and running results */
+ if (flows->categories == 1)
+ resolve_single_priority(transition, slot, ctx,
+ parms, p);
+ else
+ resolve_priority(transition, slot, ctx, parms,
+ p, flows->categories);
+
+ /* Count down completed tries for this search request */
+ parms[slot].cmplt->count--;
+
+ /* Fill the slot with the next trie or idle trie */
+ transition = acl_start_next_trie(flows, parms, slot, ctx);
+
+ } else if (transition == ctx->idle) {
+ /* reset indirection table for idle slots */
+ parms[slot].data_index = idle;
+ }
+
+ return transition;
+}
+
+#endif /* _ACL_RUN_H_ */
diff --git a/lib/librte_acl/acl_run_scalar.c b/lib/librte_acl/acl_run_scalar.c
new file mode 100644
index 0000000..4bf58c7
--- /dev/null
+++ b/lib/librte_acl/acl_run_scalar.c
@@ -0,0 +1,197 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#include "acl_run.h"
+
+int
+rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories);
+
+/*
+ * Resolve priority for multiple results (scalar version).
+ * This consists comparing the priority of the current traversal with the
+ * running set of results for the packet.
+ * For each result, keep a running array of the result (rule number) and
+ * its priority for each category.
+ */
+static inline void
+resolve_priority_scalar(uint64_t transition, int n,
+ const struct rte_acl_ctx *ctx, struct parms *parms,
+ const struct rte_acl_match_results *p, uint32_t categories)
+{
+ uint32_t i;
+ int32_t *saved_priority;
+ uint32_t *saved_results;
+ const int32_t *priority;
+ const uint32_t *results;
+
+ saved_results = parms[n].cmplt->results;
+ saved_priority = parms[n].cmplt->priority;
+
+ /* results and priorities for completed trie */
+ results = p[transition].results;
+ priority = p[transition].priority;
+
+ /* if this is not the first completed trie */
+ if (parms[n].cmplt->count != ctx->num_tries) {
+ for (i = 0; i < categories; i += RTE_ACL_RESULTS_MULTIPLIER) {
+
+ if (saved_priority[i] <= priority[i]) {
+ saved_priority[i] = priority[i];
+ saved_results[i] = results[i];
+ }
+ if (saved_priority[i + 1] <= priority[i + 1]) {
+ saved_priority[i + 1] = priority[i + 1];
+ saved_results[i + 1] = results[i + 1];
+ }
+ if (saved_priority[i + 2] <= priority[i + 2]) {
+ saved_priority[i + 2] = priority[i + 2];
+ saved_results[i + 2] = results[i + 2];
+ }
+ if (saved_priority[i + 3] <= priority[i + 3]) {
+ saved_priority[i + 3] = priority[i + 3];
+ saved_results[i + 3] = results[i + 3];
+ }
+ }
+ } else {
+ for (i = 0; i < categories; i += RTE_ACL_RESULTS_MULTIPLIER) {
+ saved_priority[i] = priority[i];
+ saved_priority[i + 1] = priority[i + 1];
+ saved_priority[i + 2] = priority[i + 2];
+ saved_priority[i + 3] = priority[i + 3];
+
+ saved_results[i] = results[i];
+ saved_results[i + 1] = results[i + 1];
+ saved_results[i + 2] = results[i + 2];
+ saved_results[i + 3] = results[i + 3];
+ }
+ }
+}
+
+/*
+ * When processing the transition, rather than using if/else
+ * construct, the offset is calculated for DFA and QRANGE and
+ * then conditionally added to the address based on node type.
+ * This is done to avoid branch mis-predictions. Since the
+ * offset is rather simple calculation it is more efficient
+ * to do the calculation and do a condition move rather than
+ * a conditional branch to determine which calculation to do.
+ */
+static inline uint32_t
+scan_forward(uint32_t input, uint32_t max)
+{
+ return (input == 0) ? max : rte_bsf32(input);
+}
+
+static inline uint64_t
+scalar_transition(const uint64_t *trans_table, uint64_t transition,
+ uint8_t input)
+{
+ uint32_t addr, index, ranges, x, a, b, c;
+
+ /* break transition into component parts */
+ ranges = transition >> (sizeof(index) * CHAR_BIT);
+
+ /* calc address for a QRANGE node */
+ c = input * SCALAR_QRANGE_MULT;
+ a = ranges | SCALAR_QRANGE_MIN;
+ index = transition & ~RTE_ACL_NODE_INDEX;
+ a -= (c & SCALAR_QRANGE_MASK);
+ b = c & SCALAR_QRANGE_MIN;
+ addr = transition ^ index;
+ a &= SCALAR_QRANGE_MIN;
+ a ^= (ranges ^ b) & (a ^ b);
+ x = scan_forward(a, 32) >> 3;
+ addr += (index == RTE_ACL_NODE_DFA) ? input : x;
+
+ /* pickup next transition */
+ transition = *(trans_table + addr);
+ return transition;
+}
+
+int
+rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories)
+{
+ int n;
+ uint64_t transition0, transition1;
+ uint32_t input0, input1;
+ struct acl_flow_data flows;
+ uint64_t index_array[MAX_SEARCHES_SCALAR];
+ struct completion cmplt[MAX_SEARCHES_SCALAR];
+ struct parms parms[MAX_SEARCHES_SCALAR];
+
+ if (categories != 1 &&
+ ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
+ return -EINVAL;
+
+ acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results, num,
+ categories, ctx->trans_table);
+
+ for (n = 0; n < MAX_SEARCHES_SCALAR; n++) {
+ cmplt[n].count = 0;
+ index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
+ }
+
+ transition0 = index_array[0];
+ transition1 = index_array[1];
+
+ while (flows.started > 0) {
+
+ input0 = GET_NEXT_4BYTES(parms, 0);
+ input1 = GET_NEXT_4BYTES(parms, 1);
+
+ for (n = 0; n < 4; n++) {
+ if (likely((transition0 & RTE_ACL_NODE_MATCH) == 0))
+ transition0 = scalar_transition(flows.trans,
+ transition0, (uint8_t)input0);
+
+ input0 >>= CHAR_BIT;
+
+ if (likely((transition1 & RTE_ACL_NODE_MATCH) == 0))
+ transition1 = scalar_transition(flows.trans,
+ transition1, (uint8_t)input1);
+
+ input1 >>= CHAR_BIT;
+
+ }
+ if ((transition0 | transition1) & RTE_ACL_NODE_MATCH) {
+ transition0 = acl_match_check(transition0,
+ 0, ctx, parms, &flows, resolve_priority_scalar);
+ transition1 = acl_match_check(transition1,
+ 1, ctx, parms, &flows, resolve_priority_scalar);
+
+ }
+ }
+ return 0;
+}
diff --git a/lib/librte_acl/acl_run_sse.c b/lib/librte_acl/acl_run_sse.c
new file mode 100644
index 0000000..7ae63dd
--- /dev/null
+++ b/lib/librte_acl/acl_run_sse.c
@@ -0,0 +1,630 @@
+/*-
+ * BSD LICENSE
+ *
+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Intel Corporation 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
+ * OWNER 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.
+ */
+
+#include "acl_run.h"
+
+int
+rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories);
+
+enum {
+ SHUFFLE32_SLOT1 = 0xe5,
+ SHUFFLE32_SLOT2 = 0xe6,
+ SHUFFLE32_SLOT3 = 0xe7,
+ SHUFFLE32_SWAP64 = 0x4e,
+};
+
+static const rte_xmm_t mm_type_quad_range = {
+ .u32 = {
+ RTE_ACL_NODE_QRANGE,
+ RTE_ACL_NODE_QRANGE,
+ RTE_ACL_NODE_QRANGE,
+ RTE_ACL_NODE_QRANGE,
+ },
+};
+
+static const rte_xmm_t mm_type_quad_range64 = {
+ .u32 = {
+ RTE_ACL_NODE_QRANGE,
+ RTE_ACL_NODE_QRANGE,
+ 0,
+ 0,
+ },
+};
+
+static const rte_xmm_t mm_shuffle_input = {
+ .u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c},
+};
+
+static const rte_xmm_t mm_shuffle_input64 = {
+ .u32 = {0x00000000, 0x04040404, 0x80808080, 0x80808080},
+};
+
+static const rte_xmm_t mm_ones_16 = {
+ .u16 = {1, 1, 1, 1, 1, 1, 1, 1},
+};
+
+static const rte_xmm_t mm_bytes = {
+ .u32 = {UINT8_MAX, UINT8_MAX, UINT8_MAX, UINT8_MAX},
+};
+
+static const rte_xmm_t mm_bytes64 = {
+ .u32 = {UINT8_MAX, UINT8_MAX, 0, 0},
+};
+
+static const rte_xmm_t mm_match_mask = {
+ .u32 = {
+ RTE_ACL_NODE_MATCH,
+ RTE_ACL_NODE_MATCH,
+ RTE_ACL_NODE_MATCH,
+ RTE_ACL_NODE_MATCH,
+ },
+};
+
+static const rte_xmm_t mm_match_mask64 = {
+ .u32 = {
+ RTE_ACL_NODE_MATCH,
+ 0,
+ RTE_ACL_NODE_MATCH,
+ 0,
+ },
+};
+
+static const rte_xmm_t mm_index_mask = {
+ .u32 = {
+ RTE_ACL_NODE_INDEX,
+ RTE_ACL_NODE_INDEX,
+ RTE_ACL_NODE_INDEX,
+ RTE_ACL_NODE_INDEX,
+ },
+};
+
+static const rte_xmm_t mm_index_mask64 = {
+ .u32 = {
+ RTE_ACL_NODE_INDEX,
+ RTE_ACL_NODE_INDEX,
+ 0,
+ 0,
+ },
+};
+
+
+/*
+ * Resolve priority for multiple results (sse version).
+ * This consists comparing the priority of the current traversal with the
+ * running set of results for the packet.
+ * For each result, keep a running array of the result (rule number) and
+ * its priority for each category.
+ */
+static inline void
+resolve_priority_sse(uint64_t transition, int n, const struct rte_acl_ctx *ctx,
+ struct parms *parms, const struct rte_acl_match_results *p,
+ uint32_t categories)
+{
+ uint32_t x;
+ xmm_t results, priority, results1, priority1, selector;
+ xmm_t *saved_results, *saved_priority;
+
+ for (x = 0; x < categories; x += RTE_ACL_RESULTS_MULTIPLIER) {
+
+ saved_results = (xmm_t *)(&parms[n].cmplt->results[x]);
+ saved_priority =
+ (xmm_t *)(&parms[n].cmplt->priority[x]);
+
+ /* get results and priorities for completed trie */
+ results = MM_LOADU((const xmm_t *)&p[transition].results[x]);
+ priority = MM_LOADU((const xmm_t *)&p[transition].priority[x]);
+
+ /* if this is not the first completed trie */
+ if (parms[n].cmplt->count != ctx->num_tries) {
+
+ /* get running best results and their priorities */
+ results1 = MM_LOADU(saved_results);
+ priority1 = MM_LOADU(saved_priority);
+
+ /* select results that are highest priority */
+ selector = MM_CMPGT32(priority1, priority);
+ results = MM_BLENDV8(results, results1, selector);
+ priority = MM_BLENDV8(priority, priority1, selector);
+ }
+
+ /* save running best results and their priorities */
+ MM_STOREU(saved_results, results);
+ MM_STOREU(saved_priority, priority);
+ }
+}
+
+/*
+ * Extract transitions from an XMM register and check for any matches
+ */
+static void
+acl_process_matches(xmm_t *indicies, int slot, const struct rte_acl_ctx *ctx,
+ struct parms *parms, struct acl_flow_data *flows)
+{
+ uint64_t transition1, transition2;
+
+ /* extract transition from low 64 bits. */
+ transition1 = MM_CVT64(*indicies);
+
+ /* extract transition from high 64 bits. */
+ *indicies = MM_SHUFFLE32(*indicies, SHUFFLE32_SWAP64);
+ transition2 = MM_CVT64(*indicies);
+
+ transition1 = acl_match_check(transition1, slot, ctx,
+ parms, flows, resolve_priority_sse);
+ transition2 = acl_match_check(transition2, slot + 1, ctx,
+ parms, flows, resolve_priority_sse);
+
+ /* update indicies with new transitions. */
+ *indicies = MM_SET64(transition2, transition1);
+}
+
+/*
+ * Check for a match in 2 transitions (contained in SSE register)
+ */
+static inline void
+acl_match_check_x2(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
+ struct acl_flow_data *flows, xmm_t *indicies, xmm_t match_mask)
+{
+ xmm_t temp;
+
+ temp = MM_AND(match_mask, *indicies);
+ while (!MM_TESTZ(temp, temp)) {
+ acl_process_matches(indicies, slot, ctx, parms, flows);
+ temp = MM_AND(match_mask, *indicies);
+ }
+}
+
+/*
+ * Check for any match in 4 transitions (contained in 2 SSE registers)
+ */
+static inline void
+acl_match_check_x4(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
+ struct acl_flow_data *flows, xmm_t *indicies1, xmm_t *indicies2,
+ xmm_t match_mask)
+{
+ xmm_t temp;
+
+ /* put low 32 bits of each transition into one register */
+ temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
+ 0x88);
+ /* test for match node */
+ temp = MM_AND(match_mask, temp);
+
+ while (!MM_TESTZ(temp, temp)) {
+ acl_process_matches(indicies1, slot, ctx, parms, flows);
+ acl_process_matches(indicies2, slot + 2, ctx, parms, flows);
+
+ temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
+ (__m128)*indicies2,
+ 0x88);
+ temp = MM_AND(match_mask, temp);
+ }
+}
+
+/*
+ * Calculate the address of the next transition for
+ * all types of nodes. Note that only DFA nodes and range
+ * nodes actually transition to another node. Match
+ * nodes don't move.
+ */
+static inline xmm_t
+acl_calc_addr(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
+ xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
+ xmm_t *indicies1, xmm_t *indicies2)
+{
+ xmm_t addr, node_types, temp;
+
+ /*
+ * Note that no transition is done for a match
+ * node and therefore a stream freezes when
+ * it reaches a match.
+ */
+
+ /* Shuffle low 32 into temp and high 32 into indicies2 */
+ temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
+ 0x88);
+ *indicies2 = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
+ (__m128)*indicies2, 0xdd);
+
+ /* Calc node type and node addr */
+ node_types = MM_ANDNOT(index_mask, temp);
+ addr = MM_AND(index_mask, temp);
+
+ /*
+ * Calc addr for DFAs - addr = dfa_index + input_byte
+ */
+
+ /* mask for DFA type (0) nodes */
+ temp = MM_CMPEQ32(node_types, MM_XOR(node_types, node_types));
+
+ /* add input byte to DFA position */
+ temp = MM_AND(temp, bytes);
+ temp = MM_AND(temp, next_input);
+ addr = MM_ADD32(addr, temp);
+
+ /*
+ * Calc addr for Range nodes -> range_index + range(input)
+ */
+ node_types = MM_CMPEQ32(node_types, type_quad_range);
+
+ /*
+ * Calculate number of range boundaries that are less than the
+ * input value. Range boundaries for each node are in signed 8 bit,
+ * ordered from -128 to 127 in the indicies2 register.
+ * This is effectively a popcnt of bytes that are greater than the
+ * input byte.
+ */
+
+ /* shuffle input byte to all 4 positions of 32 bit value */
+ temp = MM_SHUFFLE8(next_input, shuffle_input);
+
+ /* check ranges */
+ temp = MM_CMPGT8(temp, *indicies2);
+
+ /* convert -1 to 1 (bytes greater than input byte */
+ temp = MM_SIGN8(temp, temp);
+
+ /* horizontal add pairs of bytes into words */
+ temp = MM_MADD8(temp, temp);
+
+ /* horizontal add pairs of words into dwords */
+ temp = MM_MADD16(temp, ones_16);
+
+ /* mask to range type nodes */
+ temp = MM_AND(temp, node_types);
+
+ /* add index into node position */
+ return MM_ADD32(addr, temp);
+}
+
+/*
+ * Process 4 transitions (in 2 SIMD registers) in parallel
+ */
+static inline xmm_t
+transition4(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
+ xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
+ const uint64_t *trans, xmm_t *indicies1, xmm_t *indicies2)
+{
+ xmm_t addr;
+ uint64_t trans0, trans2;
+
+ /* Calculate the address (array index) for all 4 transitions. */
+
+ addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
+ bytes, type_quad_range, indicies1, indicies2);
+
+ /* Gather 64 bit transitions and pack back into 2 registers. */
+
+ trans0 = trans[MM_CVT32(addr)];
+
+ /* get slot 2 */
+
+ /* {x0, x1, x2, x3} -> {x2, x1, x2, x3} */
+ addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT2);
+ trans2 = trans[MM_CVT32(addr)];
+
+ /* get slot 1 */
+
+ /* {x2, x1, x2, x3} -> {x1, x1, x2, x3} */
+ addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
+ *indicies1 = MM_SET64(trans[MM_CVT32(addr)], trans0);
+
+ /* get slot 3 */
+
+ /* {x1, x1, x2, x3} -> {x3, x1, x2, x3} */
+ addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT3);
+ *indicies2 = MM_SET64(trans[MM_CVT32(addr)], trans2);
+
+ return MM_SRL32(next_input, 8);
+}
+
+/*
+ * Execute trie traversal with 8 traversals in parallel
+ */
+static inline int
+search_sse_8(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t total_packets, uint32_t categories)
+{
+ int n;
+ struct acl_flow_data flows;
+ uint64_t index_array[MAX_SEARCHES_SSE8];
+ struct completion cmplt[MAX_SEARCHES_SSE8];
+ struct parms parms[MAX_SEARCHES_SSE8];
+ xmm_t input0, input1;
+ xmm_t indicies1, indicies2, indicies3, indicies4;
+
+ acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
+ total_packets, categories, ctx->trans_table);
+
+ for (n = 0; n < MAX_SEARCHES_SSE8; n++) {
+ cmplt[n].count = 0;
+ index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
+ }
+
+ /*
+ * indicies1 contains index_array[0,1]
+ * indicies2 contains index_array[2,3]
+ * indicies3 contains index_array[4,5]
+ * indicies4 contains index_array[6,7]
+ */
+
+ indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
+ indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
+
+ indicies3 = MM_LOADU((xmm_t *) &index_array[4]);
+ indicies4 = MM_LOADU((xmm_t *) &index_array[6]);
+
+ /* Check for any matches. */
+ acl_match_check_x4(0, ctx, parms, &flows,
+ &indicies1, &indicies2, mm_match_mask.m);
+ acl_match_check_x4(4, ctx, parms, &flows,
+ &indicies3, &indicies4, mm_match_mask.m);
+
+ while (flows.started > 0) {
+
+ /* Gather 4 bytes of input data for each stream. */
+ input0 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0),
+ 0);
+ input1 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 4),
+ 0);
+
+ input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 1), 1);
+ input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 5), 1);
+
+ input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 2), 2);
+ input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 6), 2);
+
+ input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 3), 3);
+ input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 7), 3);
+
+ /* Process the 4 bytes of input on each stream. */
+
+ input0 = transition4(mm_index_mask.m, input0,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input1 = transition4(mm_index_mask.m, input1,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies3, &indicies4);
+
+ input0 = transition4(mm_index_mask.m, input0,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input1 = transition4(mm_index_mask.m, input1,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies3, &indicies4);
+
+ input0 = transition4(mm_index_mask.m, input0,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input1 = transition4(mm_index_mask.m, input1,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies3, &indicies4);
+
+ input0 = transition4(mm_index_mask.m, input0,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input1 = transition4(mm_index_mask.m, input1,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies3, &indicies4);
+
+ /* Check for any matches. */
+ acl_match_check_x4(0, ctx, parms, &flows,
+ &indicies1, &indicies2, mm_match_mask.m);
+ acl_match_check_x4(4, ctx, parms, &flows,
+ &indicies3, &indicies4, mm_match_mask.m);
+ }
+
+ return 0;
+}
+
+/*
+ * Execute trie traversal with 4 traversals in parallel
+ */
+static inline int
+search_sse_4(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, int total_packets, uint32_t categories)
+{
+ int n;
+ struct acl_flow_data flows;
+ uint64_t index_array[MAX_SEARCHES_SSE4];
+ struct completion cmplt[MAX_SEARCHES_SSE4];
+ struct parms parms[MAX_SEARCHES_SSE4];
+ xmm_t input, indicies1, indicies2;
+
+ acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
+ total_packets, categories, ctx->trans_table);
+
+ for (n = 0; n < MAX_SEARCHES_SSE4; n++) {
+ cmplt[n].count = 0;
+ index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
+ }
+
+ indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
+ indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
+
+ /* Check for any matches. */
+ acl_match_check_x4(0, ctx, parms, &flows,
+ &indicies1, &indicies2, mm_match_mask.m);
+
+ while (flows.started > 0) {
+
+ /* Gather 4 bytes of input data for each stream. */
+ input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
+ input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
+ input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 2), 2);
+ input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 3), 3);
+
+ /* Process the 4 bytes of input on each stream. */
+ input = transition4(mm_index_mask.m, input,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input = transition4(mm_index_mask.m, input,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input = transition4(mm_index_mask.m, input,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ input = transition4(mm_index_mask.m, input,
+ mm_shuffle_input.m, mm_ones_16.m,
+ mm_bytes.m, mm_type_quad_range.m,
+ flows.trans, &indicies1, &indicies2);
+
+ /* Check for any matches. */
+ acl_match_check_x4(0, ctx, parms, &flows,
+ &indicies1, &indicies2, mm_match_mask.m);
+ }
+
+ return 0;
+}
+
+static inline xmm_t
+transition2(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
+ xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
+ const uint64_t *trans, xmm_t *indicies1)
+{
+ uint64_t t;
+ xmm_t addr, indicies2;
+
+ indicies2 = MM_XOR(ones_16, ones_16);
+
+ addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
+ bytes, type_quad_range, indicies1, &indicies2);
+
+ /* Gather 64 bit transitions and pack 2 per register. */
+
+ t = trans[MM_CVT32(addr)];
+
+ /* get slot 1 */
+ addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
+ *indicies1 = MM_SET64(trans[MM_CVT32(addr)], t);
+
+ return MM_SRL32(next_input, 8);
+}
+
+/*
+ * Execute trie traversal with 2 traversals in parallel.
+ */
+static inline int
+search_sse_2(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t total_packets, uint32_t categories)
+{
+ int n;
+ struct acl_flow_data flows;
+ uint64_t index_array[MAX_SEARCHES_SSE2];
+ struct completion cmplt[MAX_SEARCHES_SSE2];
+ struct parms parms[MAX_SEARCHES_SSE2];
+ xmm_t input, indicies;
+
+ acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
+ total_packets, categories, ctx->trans_table);
+
+ for (n = 0; n < MAX_SEARCHES_SSE2; n++) {
+ cmplt[n].count = 0;
+ index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
+ }
+
+ indicies = MM_LOADU((xmm_t *) &index_array[0]);
+
+ /* Check for any matches. */
+ acl_match_check_x2(0, ctx, parms, &flows, &indicies, mm_match_mask64.m);
+
+ while (flows.started > 0) {
+
+ /* Gather 4 bytes of input data for each stream. */
+ input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
+ input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
+
+ /* Process the 4 bytes of input on each stream. */
+
+ input = transition2(mm_index_mask64.m, input,
+ mm_shuffle_input64.m, mm_ones_16.m,
+ mm_bytes64.m, mm_type_quad_range64.m,
+ flows.trans, &indicies);
+
+ input = transition2(mm_index_mask64.m, input,
+ mm_shuffle_input64.m, mm_ones_16.m,
+ mm_bytes64.m, mm_type_quad_range64.m,
+ flows.trans, &indicies);
+
+ input = transition2(mm_index_mask64.m, input,
+ mm_shuffle_input64.m, mm_ones_16.m,
+ mm_bytes64.m, mm_type_quad_range64.m,
+ flows.trans, &indicies);
+
+ input = transition2(mm_index_mask64.m, input,
+ mm_shuffle_input64.m, mm_ones_16.m,
+ mm_bytes64.m, mm_type_quad_range64.m,
+ flows.trans, &indicies);
+
+ /* Check for any matches. */
+ acl_match_check_x2(0, ctx, parms, &flows, &indicies,
+ mm_match_mask64.m);
+ }
+
+ return 0;
+}
+
+int
+rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories)
+{
+ if (categories != 1 &&
+ ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
+ return -EINVAL;
+
+ if (likely(num >= MAX_SEARCHES_SSE8))
+ return search_sse_8(ctx, data, results, num, categories);
+ else if (num >= MAX_SEARCHES_SSE4)
+ return search_sse_4(ctx, data, results, num, categories);
+ else
+ return search_sse_2(ctx, data, results, num, categories);
+}
diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c
index 7c288bd..741bed4 100644
--- a/lib/librte_acl/rte_acl.c
+++ b/lib/librte_acl/rte_acl.c
@@ -33,11 +33,72 @@
#include <rte_acl.h>
#include "acl.h"
+#include "acl_run.h"
#define BIT_SIZEOF(x) (sizeof(x) * CHAR_BIT)
TAILQ_HEAD(rte_acl_list, rte_tailq_entry);
+extern int
+rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories);
+
+extern int
+rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories);
+
+static rte_acl_classify_t classify_fns[] = {
+ [RTE_ACL_CLASSIFY_DEFAULT] = rte_acl_classify_scalar,
+ [RTE_ACL_CLASSIFY_SCALAR] = rte_acl_classify_scalar,
+ [RTE_ACL_CLASSIFY_SSE] = rte_acl_classify_sse,
+};
+
+
+extern int
+rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
+ uint32_t *results, uint32_t num, uint32_t categories);
+
+/* by default, use always avaialbe scalar code path. */
+static enum rte_acl_classify_alg rte_acl_default_classify = RTE_ACL_CLASSIFY_SCALAR;
+
+void rte_acl_set_default_classify(enum rte_acl_classify_alg alg)
+{
+ rte_acl_default_classify = alg;
+}
+
+void rte_acl_set_ctx_classify(struct rte_acl_ctx *ctx, enum rte_acl_classify_alg alg)
+{
+ ctx->alg = alg;
+}
+
+static void __attribute__((constructor))
+rte_acl_init(void)
+{
+ enum rte_acl_classify_alg alg = RTE_ACL_CLASSIFY_DEFAULT;
+
+ if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
+ alg = RTE_ACL_CLASSIFY_SSE;
+
+ rte_acl_set_default_classify(alg);
+}
+
+int rte_acl_classify(const struct rte_acl_ctx *ctx,
+ const uint8_t **data,
+ uint32_t *results, uint32_t num,
+ uint32_t categories)
+{
+ return classify_fns[ctx->alg](ctx, data, results, num, categories);
+}
+
+int rte_acl_classify_alg(const struct rte_acl_ctx *ctx,
+ enum rte_acl_classify_alg alg,
+ const uint8_t **data,
+ uint32_t *results, uint32_t num,
+ uint32_t categories)
+{
+ return classify_fns[alg](ctx, data, results, num, categories);
+}
+
struct rte_acl_ctx *
rte_acl_find_existing(const char *name)
{
@@ -165,6 +226,7 @@ rte_acl_create(const struct rte_acl_param *param)
ctx->max_rules = param->max_rule_num;
ctx->rule_sz = param->rule_size;
ctx->socket_id = param->socket_id;
+ ctx->alg = rte_acl_default_classify;
snprintf(ctx->name, sizeof(ctx->name), "%s", param->name);
te->data = (void *) ctx;
diff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h
index afc0f69..c092a49 100644
--- a/lib/librte_acl/rte_acl.h
+++ b/lib/librte_acl/rte_acl.h
@@ -259,39 +259,6 @@ void
rte_acl_reset(struct rte_acl_ctx *ctx);
/**
- * Search for a matching ACL rule for each input data buffer.
- * Each input data buffer can have up to *categories* matches.
- * That implies that results array should be big enough to hold
- * (categories * num) elements.
- * Also categories parameter should be either one or multiple of
- * RTE_ACL_RESULTS_MULTIPLIER and can't be bigger than RTE_ACL_MAX_CATEGORIES.
- * If more than one rule is applicable for given input buffer and
- * given category, then rule with highest priority will be returned as a match.
- * Note, that it is a caller responsibility to ensure that input parameters
- * are valid and point to correct memory locations.
- *
- * @param ctx
- * ACL context to search with.
- * @param data
- * Array of pointers to input data buffers to perform search.
- * Note that all fields in input data buffers supposed to be in network
- * byte order (MSB).
- * @param results
- * Array of search results, *categories* results per each input data buffer.
- * @param num
- * Number of elements in the input data buffers array.
- * @param categories
- * Number of maximum possible matches for each input buffer, one possible
- * match per category.
- * @return
- * zero on successful completion.
- * -EINVAL for incorrect arguments.
- */
-int
-rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t num, uint32_t categories);
-
-/**
* Perform scalar search for a matching ACL rule for each input data buffer.
* Note, that while the search itself will avoid explicit use of SSE/AVX
* intrinsics, code for comparing matching results/priorities sill might use
@@ -323,9 +290,36 @@ rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
* zero on successful completion.
* -EINVAL for incorrect arguments.
*/
-int
-rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
- uint32_t *results, uint32_t num, uint32_t categories);
+
+enum rte_acl_classify_alg {
+ RTE_ACL_CLASSIFY_DEFAULT = 0,
+ RTE_ACL_CLASSIFY_SCALAR = 1,
+ RTE_ACL_CLASSIFY_SSE = 2,
+};
+
+extern int
+rte_acl_classify(const struct rte_acl_ctx *ctx,
+ const uint8_t **data,
+ uint32_t *results, uint32_t num,
+ uint32_t categories);
+
+extern int
+rte_acl_classify_alg(const struct rte_acl_ctx *ctx,
+ enum rte_acl_classify_alg alg,
+ const uint8_t **data,
+ uint32_t *results, uint32_t num,
+ uint32_t categories);
+/*
+ * Set the default classify algorithm for newly allocated classify contexts
+ */
+extern void
+rte_acl_set_default_classify(enum rte_acl_classify_alg alg);
+
+/*
+ * Override the default classifier function for a given ctx
+ */
+extern void
+rte_acl_set_ctx_classify(struct rte_acl_ctx *ctx, enum rte_acl_classify_alg alg);
/**
* Dump an ACL context structure to the console.
--
1.9.3
^ permalink raw reply [relevance 1%]
* Re: [dpdk-dev] [PATCHv3] librte_acl make it build/work for 'default' target
2014-08-27 19:18 0% ` Ananyev, Konstantin
2014-08-28 9:02 0% ` Richardson, Bruce
@ 2014-08-28 15:55 0% ` Neil Horman
1 sibling, 0 replies; 200+ results
From: Neil Horman @ 2014-08-28 15:55 UTC (permalink / raw)
To: Ananyev, Konstantin; +Cc: dev
On Wed, Aug 27, 2014 at 07:18:44PM +0000, Ananyev, Konstantin wrote:
>
>
> > -----Original Message-----
> > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Sent: Wednesday, August 27, 2014 7:57 PM
> > To: Ananyev, Konstantin
> > Cc: dev@dpdk.org; thomas.monjalon@6wind.com
> > Subject: Re: [PATCHv3] librte_acl make it build/work for 'default' target
> >
> > On Wed, Aug 27, 2014 at 11:25:04AM +0000, Ananyev, Konstantin wrote:
> > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > Sent: Tuesday, August 26, 2014 6:45 PM
> > > > To: Ananyev, Konstantin
> > > > Cc: dev@dpdk.org; thomas.monjalon@6wind.com
> > > > Subject: Re: [PATCHv3] librte_acl make it build/work for 'default' target
> > > >
> > > > On Mon, Aug 25, 2014 at 04:30:05PM +0000, Ananyev, Konstantin wrote:
> > > > > Hi Neil,
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > > > Sent: Thursday, August 21, 2014 9:15 PM
> > > > > > To: dev@dpdk.org
> > > > > > Cc: Ananyev, Konstantin; thomas.monjalon@6wind.com; Neil Horman
> > > > > > Subject: [PATCHv3] librte_acl make it build/work for 'default' target
> > > > > >
> > > > > > Make ACL library to build/work on 'default' architecture:
> > > > > > - make rte_acl_classify_scalar really scalar
> > > > > > (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> > > > > > - Provide two versions of rte_acl_classify code path:
> > > > > > rte_acl_classify_sse() - could be build and used only on systems with sse4.2
> > > > > > and upper, return -ENOTSUP on lower arch.
> > > > > > rte_acl_classify_scalar() - a slower version, but could be build and used
> > > > > > on all systems.
> > > > > > - keep common code shared between these two codepaths.
> > > > > >
> > > > > > v2 chages:
> > > > > > run-time selection of most appropriate code-path for given ISA.
> > > > > > By default the highest supprted one is selected.
> > > > > > User can still override that selection by manually assigning new value to
> > > > > > the global function pointer rte_acl_default_classify.
> > > > > > rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
> > > > > > points to.
> > > > > >
> > > > >
> > > > > I see you decided not to wait for me and fix everything by yourself :)
> > > > >
> > > > Yeah, sorry, I'm getting pinged about enabling these features in Fedora, and it
> > > > had been about 2 weeks, so I figured I'd just take care of it.
> > >
> > > No worries. I admit that it was a long delay from my side.
> > >
> > > >
> > > > > > V3 Changes
> > > > > > Updated classify pointer to be a function so as to better preserve ABI
> > > > >
> > > > > As I said in my previous mail it generates extra jump...
> > > > > Though from numbers I got the performance impact is negligible: < 1%.
> > > > > So I suppose, I don't have a good enough reason to object :)
> > > > >
> > > > Yeah, I just don't see a way around it. I was hoping that the compiler would
> > > > have been smart enough to see that the rte_acl_classify function was small and
> > > > in-linable, but apparently it won't do that. As you note however the
> > > > performance change is minor (I'm guessing within a standard deviation of your
> > > > results).
> > > >
> > > > > Though I still think we better keep rte_acl_classify_scalar() publically available (same as we do for rte acl_classify_sse()):
> > > > > First of all keep rte_acl_classify_scalar() is already part of our public API.
> > > > > Also, as I remember, one of the customers explicitly asked for scalar version and they planned to call it directly.
> > > > > Plus using rte_acl_select_classify() to always switch between implementations is not always handy:
> > > >
> > > > I'm not exactly opposed to this, though it seems odd to me that a user might
> > > > want to call a particular version of the classifier directly. But I certainly
> > > > can't predict everything a consumer wants to do. If we really need to keep it
> > > > public then, it begs the question, is providing a generic entry point even
> > > > worthwhile? Is it just as easy to expose the scalar/sse and any future versions
> > > > directly so the application can just embody the intellegence to select the best
> > > > path? That saves us having to maintain another API point. I can go with
> > > > consensus on that.
> > > >
> > > > > - it is global, which means that we can't simultaneously use classify_scalar() and classify_sse() for 2 different ACL contexts.
> > > > > - to properly support such switching we then will need to support something like (see app/test/test_acl.c below):
> > > > > old_alg = rte_acl_get_classify();
> > > > > rte_acl_select_classify(new_alg);
> > > > > ...
> > > > > rte_acl_select_classify(old_alg);
> > > > >
> > > > We could attach the classification method to the acl context, so each
> > > > rte_acl_ctx can point to whatever classifier funtion it wants to. That would
> > > > remove the global issues you point out above.
> > >
> > > I thought about that approach too.
> > > But there is one implication with DPDK MP model:
> > > Same ACL context can be shared by different DPDK processes,
> > > while acl_classify() could be loaded to the different addresses.
> > > Of course we can overcome it by creating a global table of function pointers indexed by calssify_alg and
> > > store inside ACL ctx alg instead of actual function pointer.
> > > But that means extra overhead of at least two loads per classify() call.
> > >
> > Hmm, how is the context shared around between processes? Is it just shared as a
> > common cow data page resulting from a fork? If so, then we should be good
> > because the DSO text will be at the same address (i.e. the pointer will still be
> > valid). If you do some sort of message passing, then, yes, thats a problem.
> >
>
> No, it is not parent-child relationship.
> There could be a group of independently spawned processes.
> One of them should be 'primary' (starts first), other 'secondary's'.
> All hugepage memory pages mapped by the primary process, supposed to be mapped to the same VAs by each secondary.
> So all stuff that is allocated from hugepage memory is shared between all processes in the group.
> More detailed description: http://dpdk.org/doc/intel/dpdk-prog-guide-1.7.0.pdf, section 23.
>
Ugh, so because you explicitly share heap memory space accross all processes, we
can never guarantee any pointers to statically allocated symbols, like functions
or global data. Great. Ok, I'll try rework this.
Neil
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCHv3] librte_acl make it build/work for 'default' target
2014-08-27 19:18 0% ` Ananyev, Konstantin
@ 2014-08-28 9:02 0% ` Richardson, Bruce
2014-08-28 15:55 0% ` Neil Horman
1 sibling, 0 replies; 200+ results
From: Richardson, Bruce @ 2014-08-28 9:02 UTC (permalink / raw)
To: Ananyev, Konstantin, Neil Horman; +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev, Konstantin
> Sent: Wednesday, August 27, 2014 8:19 PM
> To: Neil Horman
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCHv3] librte_acl make it build/work for 'default'
> target
>
>
>
> > -----Original Message-----
> > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Sent: Wednesday, August 27, 2014 7:57 PM
> > To: Ananyev, Konstantin
> > Cc: dev@dpdk.org; thomas.monjalon@6wind.com
> > Subject: Re: [PATCHv3] librte_acl make it build/work for 'default' target
> >
> > On Wed, Aug 27, 2014 at 11:25:04AM +0000, Ananyev, Konstantin wrote:
> > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > Sent: Tuesday, August 26, 2014 6:45 PM
> > > > To: Ananyev, Konstantin
> > > > Cc: dev@dpdk.org; thomas.monjalon@6wind.com
> > > > Subject: Re: [PATCHv3] librte_acl make it build/work for 'default' target
> > > >
> > > > On Mon, Aug 25, 2014 at 04:30:05PM +0000, Ananyev, Konstantin wrote:
> > > > > Hi Neil,
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > > > Sent: Thursday, August 21, 2014 9:15 PM
> > > > > > To: dev@dpdk.org
> > > > > > Cc: Ananyev, Konstantin; thomas.monjalon@6wind.com; Neil Horman
> > > > > > Subject: [PATCHv3] librte_acl make it build/work for 'default' target
> > > > > >
> > > > > > Make ACL library to build/work on 'default' architecture:
> > > > > > - make rte_acl_classify_scalar really scalar
> > > > > > (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> > > > > > - Provide two versions of rte_acl_classify code path:
> > > > > > rte_acl_classify_sse() - could be build and used only on systems with
> sse4.2
> > > > > > and upper, return -ENOTSUP on lower arch.
> > > > > > rte_acl_classify_scalar() - a slower version, but could be build and used
> > > > > > on all systems.
> > > > > > - keep common code shared between these two codepaths.
> > > > > >
> > > > > > v2 chages:
> > > > > > run-time selection of most appropriate code-path for given ISA.
> > > > > > By default the highest supprted one is selected.
> > > > > > User can still override that selection by manually assigning new value
> to
> > > > > > the global function pointer rte_acl_default_classify.
> > > > > > rte_acl_classify() becomes a macro calling whatever
> rte_acl_default_classify
> > > > > > points to.
> > > > > >
> > > > >
> > > > > I see you decided not to wait for me and fix everything by yourself :)
> > > > >
> > > > Yeah, sorry, I'm getting pinged about enabling these features in Fedora,
> and it
> > > > had been about 2 weeks, so I figured I'd just take care of it.
> > >
> > > No worries. I admit that it was a long delay from my side.
> > >
> > > >
> > > > > > V3 Changes
> > > > > > Updated classify pointer to be a function so as to better preserve ABI
> > > > >
> > > > > As I said in my previous mail it generates extra jump...
> > > > > Though from numbers I got the performance impact is negligible: < 1%.
> > > > > So I suppose, I don't have a good enough reason to object :)
> > > > >
> > > > Yeah, I just don't see a way around it. I was hoping that the compiler
> would
> > > > have been smart enough to see that the rte_acl_classify function was small
> and
> > > > in-linable, but apparently it won't do that. As you note however the
> > > > performance change is minor (I'm guessing within a standard deviation of
> your
> > > > results).
> > > >
> > > > > Though I still think we better keep rte_acl_classify_scalar() publically
> available (same as we do for rte acl_classify_sse()):
> > > > > First of all keep rte_acl_classify_scalar() is already part of our public API.
> > > > > Also, as I remember, one of the customers explicitly asked for scalar
> version and they planned to call it directly.
> > > > > Plus using rte_acl_select_classify() to always switch between
> implementations is not always handy:
> > > >
> > > > I'm not exactly opposed to this, though it seems odd to me that a user
> might
> > > > want to call a particular version of the classifier directly. But I certainly
> > > > can't predict everything a consumer wants to do. If we really need to keep
> it
> > > > public then, it begs the question, is providing a generic entry point even
> > > > worthwhile? Is it just as easy to expose the scalar/sse and any future
> versions
> > > > directly so the application can just embody the intellegence to select the
> best
> > > > path? That saves us having to maintain another API point. I can go with
> > > > consensus on that.
> > > >
> > > > > - it is global, which means that we can't simultaneously use
> classify_scalar() and classify_sse() for 2 different ACL contexts.
> > > > > - to properly support such switching we then will need to support
> something like (see app/test/test_acl.c below):
> > > > > old_alg = rte_acl_get_classify();
> > > > > rte_acl_select_classify(new_alg);
> > > > > ...
> > > > > rte_acl_select_classify(old_alg);
> > > > >
> > > > We could attach the classification method to the acl context, so each
> > > > rte_acl_ctx can point to whatever classifier funtion it wants to. That would
> > > > remove the global issues you point out above.
> > >
> > > I thought about that approach too.
> > > But there is one implication with DPDK MP model:
> > > Same ACL context can be shared by different DPDK processes,
> > > while acl_classify() could be loaded to the different addresses.
> > > Of course we can overcome it by creating a global table of function pointers
> indexed by calssify_alg and
> > > store inside ACL ctx alg instead of actual function pointer.
> > > But that means extra overhead of at least two loads per classify() call.
> > >
> > Hmm, how is the context shared around between processes? Is it just shared
> as a
> > common cow data page resulting from a fork? If so, then we should be good
> > because the DSO text will be at the same address (i.e. the pointer will still be
> > valid). If you do some sort of message passing, then, yes, thats a problem.
> >
>
> No, it is not parent-child relationship.
> There could be a group of independently spawned processes.
> One of them should be 'primary' (starts first), other 'secondary's'.
> All hugepage memory pages mapped by the primary process, supposed to be
> mapped to the same VAs by each secondary.
> So all stuff that is allocated from hugepage memory is shared between all
> processes in the group.
> More detailed description: http://dpdk.org/doc/intel/dpdk-prog-guide-
> 1.7.0.pdf, section 23.
>
Function pointers just don't work easily with multiprocess. Again some history, since today seems to be my Intel DPDK history day...
For the PMDs, originally we allowed NIC access only by the primary process, but later removed that limitation by having the secondary processes do a driver load and pci scan on startup, and having the ethdev structure split between the function pointer part which is not shared and configured independently in the secondary process as part of the pci scan, and the data part which is in hugepage memory and is shared across all processes. For the hash library, we needed a different approach and we looked at having tables of functions, but discarded the idea as largely unworkable when we took user-specified functions into account. What we ended up doing was provide separate api's to call the add/delete/lookup function with a pre-computed hash, so that multi-process apps could explicitly call the hash function without using a fn pointer and then pass in the computed value to the rest of the API calls.
Apologies for the digression from the immediate topic at hand, but I think it's something that is good to make people generally aware of when working with DPDK libs.
Regards,
/Bruce
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCHv3] librte_acl make it build/work for 'default' target
2014-08-27 18:56 0% ` Neil Horman
@ 2014-08-27 19:18 0% ` Ananyev, Konstantin
2014-08-28 9:02 0% ` Richardson, Bruce
2014-08-28 15:55 0% ` Neil Horman
0 siblings, 2 replies; 200+ results
From: Ananyev, Konstantin @ 2014-08-27 19:18 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
> -----Original Message-----
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Wednesday, August 27, 2014 7:57 PM
> To: Ananyev, Konstantin
> Cc: dev@dpdk.org; thomas.monjalon@6wind.com
> Subject: Re: [PATCHv3] librte_acl make it build/work for 'default' target
>
> On Wed, Aug 27, 2014 at 11:25:04AM +0000, Ananyev, Konstantin wrote:
> > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > Sent: Tuesday, August 26, 2014 6:45 PM
> > > To: Ananyev, Konstantin
> > > Cc: dev@dpdk.org; thomas.monjalon@6wind.com
> > > Subject: Re: [PATCHv3] librte_acl make it build/work for 'default' target
> > >
> > > On Mon, Aug 25, 2014 at 04:30:05PM +0000, Ananyev, Konstantin wrote:
> > > > Hi Neil,
> > > >
> > > > > -----Original Message-----
> > > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > > Sent: Thursday, August 21, 2014 9:15 PM
> > > > > To: dev@dpdk.org
> > > > > Cc: Ananyev, Konstantin; thomas.monjalon@6wind.com; Neil Horman
> > > > > Subject: [PATCHv3] librte_acl make it build/work for 'default' target
> > > > >
> > > > > Make ACL library to build/work on 'default' architecture:
> > > > > - make rte_acl_classify_scalar really scalar
> > > > > (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> > > > > - Provide two versions of rte_acl_classify code path:
> > > > > rte_acl_classify_sse() - could be build and used only on systems with sse4.2
> > > > > and upper, return -ENOTSUP on lower arch.
> > > > > rte_acl_classify_scalar() - a slower version, but could be build and used
> > > > > on all systems.
> > > > > - keep common code shared between these two codepaths.
> > > > >
> > > > > v2 chages:
> > > > > run-time selection of most appropriate code-path for given ISA.
> > > > > By default the highest supprted one is selected.
> > > > > User can still override that selection by manually assigning new value to
> > > > > the global function pointer rte_acl_default_classify.
> > > > > rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
> > > > > points to.
> > > > >
> > > >
> > > > I see you decided not to wait for me and fix everything by yourself :)
> > > >
> > > Yeah, sorry, I'm getting pinged about enabling these features in Fedora, and it
> > > had been about 2 weeks, so I figured I'd just take care of it.
> >
> > No worries. I admit that it was a long delay from my side.
> >
> > >
> > > > > V3 Changes
> > > > > Updated classify pointer to be a function so as to better preserve ABI
> > > >
> > > > As I said in my previous mail it generates extra jump...
> > > > Though from numbers I got the performance impact is negligible: < 1%.
> > > > So I suppose, I don't have a good enough reason to object :)
> > > >
> > > Yeah, I just don't see a way around it. I was hoping that the compiler would
> > > have been smart enough to see that the rte_acl_classify function was small and
> > > in-linable, but apparently it won't do that. As you note however the
> > > performance change is minor (I'm guessing within a standard deviation of your
> > > results).
> > >
> > > > Though I still think we better keep rte_acl_classify_scalar() publically available (same as we do for rte acl_classify_sse()):
> > > > First of all keep rte_acl_classify_scalar() is already part of our public API.
> > > > Also, as I remember, one of the customers explicitly asked for scalar version and they planned to call it directly.
> > > > Plus using rte_acl_select_classify() to always switch between implementations is not always handy:
> > >
> > > I'm not exactly opposed to this, though it seems odd to me that a user might
> > > want to call a particular version of the classifier directly. But I certainly
> > > can't predict everything a consumer wants to do. If we really need to keep it
> > > public then, it begs the question, is providing a generic entry point even
> > > worthwhile? Is it just as easy to expose the scalar/sse and any future versions
> > > directly so the application can just embody the intellegence to select the best
> > > path? That saves us having to maintain another API point. I can go with
> > > consensus on that.
> > >
> > > > - it is global, which means that we can't simultaneously use classify_scalar() and classify_sse() for 2 different ACL contexts.
> > > > - to properly support such switching we then will need to support something like (see app/test/test_acl.c below):
> > > > old_alg = rte_acl_get_classify();
> > > > rte_acl_select_classify(new_alg);
> > > > ...
> > > > rte_acl_select_classify(old_alg);
> > > >
> > > We could attach the classification method to the acl context, so each
> > > rte_acl_ctx can point to whatever classifier funtion it wants to. That would
> > > remove the global issues you point out above.
> >
> > I thought about that approach too.
> > But there is one implication with DPDK MP model:
> > Same ACL context can be shared by different DPDK processes,
> > while acl_classify() could be loaded to the different addresses.
> > Of course we can overcome it by creating a global table of function pointers indexed by calssify_alg and
> > store inside ACL ctx alg instead of actual function pointer.
> > But that means extra overhead of at least two loads per classify() call.
> >
> Hmm, how is the context shared around between processes? Is it just shared as a
> common cow data page resulting from a fork? If so, then we should be good
> because the DSO text will be at the same address (i.e. the pointer will still be
> valid). If you do some sort of message passing, then, yes, thats a problem.
>
No, it is not parent-child relationship.
There could be a group of independently spawned processes.
One of them should be 'primary' (starts first), other 'secondary's'.
All hugepage memory pages mapped by the primary process, supposed to be mapped to the same VAs by each secondary.
So all stuff that is allocated from hugepage memory is shared between all processes in the group.
More detailed description: http://dpdk.org/doc/intel/dpdk-prog-guide-1.7.0.pdf, section 23.
>
> > > Or alternatively we can just not
> > > provide a generic entry point and let each user select a specific function.
> >
> > I wonder can we have sort of mixed approach:
> > 1. provide a generic entry point that would be set to the best (from our knowledge) available classify function.
> > 2. Let each user use a specific function if he wants too.
> >
> > i.e:
> > - keep classify_scalar/classify_sse/classify_... public.
> > - keep your current implementation of rte_acl_classify()
> > BTW in that way, we probably can make acl_select_classify() static.
> >
> Agreed, depending on your answer above, this might be the best solution.
>
> > So most users would just use generic entry point and wouldn't need to write their own code wrappers around it.
> > For users who need to use a particular classify() version - they can call it directly.
> >
> It does seem reasonable. Let me know what the ctx sharing mechanism is from
> above, and we can settle this.
>
> > >
> > >
> > > > > REmoved macro definitions for match check functions to make them static inline
> > > >
> > > > More comments inlined below.
> > > >snip>
> > > > >
> > > > > /* make a quick check for scalar */
> > > > > - ret = rte_acl_classify_scalar(acx, data, results,
> > > > > + rte_acl_select_classify(ACL_CLASSIFY_SCALAR);
> > > > > + ret = rte_acl_classify(acx, data, results,
> > > > > RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES);
> > > >
> > > >
> > > > As I said above, that doesn't seem correct: we set rte_acl_default_classify = rte_acl_classify_scalar and never restore it back to
> the
> > > original value.
> > > > To support it properly, we need to:
> > > > old_alg = rte_acl_get_classify();
> > > > rte_acl_select_classify(new_alg);
> > > > ...
> > > > rte_acl_select_classify(old_alg);
> > > >
> > > So, for the purposes of this test application, I don't see that as being needed.
> > > Every call to rte_acl_classify is preceded by a setting of the classifier
> > > function, so you're safe.
> >
> > Not every, that's a problem.
> > As I can see, in test/test_acl.c you replaced
> > rte_acl_classify_scalar();
> > with
> > rte_acl_select_classify(SCALAR);
> > rte_acl_classify();
> >
> > And never restore previous value of rte_acl_default_classify.
> > Right now rte_acl_default_classify is global, so after first:
> > rte_acl_select_classify(SCALAR);
> > all subsequent rte_acl_classify() will actually use scalar version.
> >
> Hmm, ok, I'll take a closer look at it.
>
> > > If you're concerned about other processes using the
> > > dpdk library at the same time, you're still safe, as despite being a global
> > > variable, data pages in a DSO are Copy on Write, so each process gets their own
> > > copy of the global variable.
> >
> > No, my concern here is only about app/test here.
> >
> > >
> > > Multiple threads within the same process are problematic, I agree, and thats
> > > solvable with the per-acl-context mechanism that I described above, though that
> > > shouldn't be needed here as this seems to be a single threaded program.
> > >
> > > > Make all this just to keep UT valid seems like a big hassle to me.
> > > > So I said above - probably better just leave it to call rte_acl_classify_scalar() directly.
> > > >
> > > That works for me too, though the per-context mechanism seems kind of nice to
> > > me. Let me know what you prefer.
> > >
> > > ><snip>
> > > > >
> > > > > diff --git a/lib/librte_acl/acl_match_check.h b/lib/librte_acl/acl_match_check.h
> > > > > new file mode 100644
> > > > > index 0000000..4dc1982
> > > > > --- /dev/null
> > > > > +++ b/lib/librte_acl/acl_match_check.h
> > > >
> > > > As a nit: we probably don't need a special header just for one function and can place it inside acl_run.h.
> > > >
> > > Agreed, I can move that to acl_run.h.
> > >
> > > ><snip>
> > > > > + */
> > > > > +static inline uint64_t
> > > > > +acl_match_check(uint64_t transition, int slot,
> > > > > + const struct rte_acl_ctx *ctx, struct parms *parms,
> > > > > + struct acl_flow_data *flows, void (*resolve_priority)(
> > > > > + uint64_t transition, int n, const struct rte_acl_ctx *ctx,
> > > > > + struct parms *parms, const struct rte_acl_match_results *p,
> > > > > + uint32_t categories))
> > > >
> > > > Ugh, that's really hard to read.
> > > > Can we create a typedef for resolve_priority function type:
> > > > typedef void (*resolve_priority_t)(uint64_t, int,
> > > > const struct rte_acl_ctx *ctx, struct parms *,
> > > > const struct rte_acl_match_results *, uint32_t);
> > > > And use it here?
> > > >
> > > Sure, I'm fine with doing that.
> > >
> > > ><snip>
> > > > > +
> > > > > +/* by default, use always avaialbe scalar code path. */
> > > > > +rte_acl_classify_t rte_acl_default_classify = rte_acl_classify_scalar;
> > > >
> > > > Why not 'static'?
> > > > I thought you'd like to hide it from external world.
> > > >
> > > Doh! I didn't do the one thing that I really meant to do. I removed it from
> > > the header file but I forgot to declare the variable static. I'll fix that.
> > >
> > > > > +
> > > > > +void rte_acl_select_classify(enum acl_classify_alg alg)
> > > > > +{
> > > > > +
> > > > > + switch(alg)
> > > > > + {
> > > > > + case ACL_CLASSIFY_DEFAULT:
> > > > > + case ACL_CLASSIFY_SCALAR:
> > > > > + rte_acl_default_classify = rte_acl_classify_scalar;
> > > > > + break;
> > > > > + case ACL_CLASSIFY_SSE:
> > > > > + rte_acl_default_classify = rte_acl_classify_sse;
> > > > > + break;
> > > > > + }
> > > > > +
> > > > > +}
> > > >
> > > > As this is init phase function, I suppose we can add check that alg has a valid(supported) value, and return some error as return
> > > value, if not.
> > > >
> > > Not sure I follow what you're saying above, are you suggesting that we add a
> > > rte_cpu_get_flag_enabled check to rte_acl_select_classify above?
> > >
> > > ><snip>
> > > > > *
> > > > > @@ -286,9 +289,10 @@ rte_acl_reset(struct rte_acl_ctx *ctx);
> > > > > * @return
> > > > > * zero on successful completion.
> > > > > * -EINVAL for incorrect arguments.
> > > > > + * -ENOTSUP for unsupported platforms.
> > > >
> > > > Please remove the line above: current implementation doesn't return ENOTSUP
> > > > (I think that was left from v1).
> > > >
> > > Yup, probably was. I'll remove it.
> > >
> > > > > */
> > > > > int
> > > > > -rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > > > +rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > > > uint32_t *results, uint32_t num, uint32_t categories);
> > > > >
> > > > > /**
> > > > > @@ -323,9 +327,23 @@ rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > > > * zero on successful completion.
> > > > > * -EINVAL for incorrect arguments.
> > > > > */
> > > > > -int
> > > > > -rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > > > - uint32_t *results, uint32_t num, uint32_t categories);
> > > >
> > > >
> > > > As I said above we'd better keep it.
> > > >
> > > Ok, can do.
> > >
> > > > > +
> > > > > +enum acl_classify_alg {
> > > > > + ACL_CLASSIFY_DEFAULT = 0,
> > > > > + ACL_CLASSIFY_SCALAR = 1,
> > > > > + ACL_CLASSIFY_SSE = 2,
> > > > > +};
> > > >
> > > > As a nit: as this emum is part of public API, I think it is better to add rte_ prefix: enum rte_acl_classify_alg
> > > >
> > > Sure, done.
> > >
> > > > > +
> > > > > +extern inline int rte_acl_classify(const struct rte_acl_ctx *ctx,
> > > > > + const uint8_t **data,
> > > > > + uint32_t *results, uint32_t num,
> > > > > + uint32_t categories);
> > > >
> > > > Again as a nit: here and everywhere can we keep same style through the whole DPDK - function name from the new line:
> > > > extern nt
> > > > rte_acl_classify(...);
> > > >
> > > Ok
> > >
> > > I'll produce another version based on your feedback regarding the
> > > per-context-calssifier method vs. just removing the generic classifier.
> > >
> > > Regards
> > > Neil
> >
> >
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCHv3] librte_acl make it build/work for 'default' target
2014-08-27 11:25 0% ` Ananyev, Konstantin
@ 2014-08-27 18:56 0% ` Neil Horman
2014-08-27 19:18 0% ` Ananyev, Konstantin
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-08-27 18:56 UTC (permalink / raw)
To: Ananyev, Konstantin; +Cc: dev
On Wed, Aug 27, 2014 at 11:25:04AM +0000, Ananyev, Konstantin wrote:
> > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Sent: Tuesday, August 26, 2014 6:45 PM
> > To: Ananyev, Konstantin
> > Cc: dev@dpdk.org; thomas.monjalon@6wind.com
> > Subject: Re: [PATCHv3] librte_acl make it build/work for 'default' target
> >
> > On Mon, Aug 25, 2014 at 04:30:05PM +0000, Ananyev, Konstantin wrote:
> > > Hi Neil,
> > >
> > > > -----Original Message-----
> > > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > > Sent: Thursday, August 21, 2014 9:15 PM
> > > > To: dev@dpdk.org
> > > > Cc: Ananyev, Konstantin; thomas.monjalon@6wind.com; Neil Horman
> > > > Subject: [PATCHv3] librte_acl make it build/work for 'default' target
> > > >
> > > > Make ACL library to build/work on 'default' architecture:
> > > > - make rte_acl_classify_scalar really scalar
> > > > (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> > > > - Provide two versions of rte_acl_classify code path:
> > > > rte_acl_classify_sse() - could be build and used only on systems with sse4.2
> > > > and upper, return -ENOTSUP on lower arch.
> > > > rte_acl_classify_scalar() - a slower version, but could be build and used
> > > > on all systems.
> > > > - keep common code shared between these two codepaths.
> > > >
> > > > v2 chages:
> > > > run-time selection of most appropriate code-path for given ISA.
> > > > By default the highest supprted one is selected.
> > > > User can still override that selection by manually assigning new value to
> > > > the global function pointer rte_acl_default_classify.
> > > > rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
> > > > points to.
> > > >
> > >
> > > I see you decided not to wait for me and fix everything by yourself :)
> > >
> > Yeah, sorry, I'm getting pinged about enabling these features in Fedora, and it
> > had been about 2 weeks, so I figured I'd just take care of it.
>
> No worries. I admit that it was a long delay from my side.
>
> >
> > > > V3 Changes
> > > > Updated classify pointer to be a function so as to better preserve ABI
> > >
> > > As I said in my previous mail it generates extra jump...
> > > Though from numbers I got the performance impact is negligible: < 1%.
> > > So I suppose, I don't have a good enough reason to object :)
> > >
> > Yeah, I just don't see a way around it. I was hoping that the compiler would
> > have been smart enough to see that the rte_acl_classify function was small and
> > in-linable, but apparently it won't do that. As you note however the
> > performance change is minor (I'm guessing within a standard deviation of your
> > results).
> >
> > > Though I still think we better keep rte_acl_classify_scalar() publically available (same as we do for rte acl_classify_sse()):
> > > First of all keep rte_acl_classify_scalar() is already part of our public API.
> > > Also, as I remember, one of the customers explicitly asked for scalar version and they planned to call it directly.
> > > Plus using rte_acl_select_classify() to always switch between implementations is not always handy:
> >
> > I'm not exactly opposed to this, though it seems odd to me that a user might
> > want to call a particular version of the classifier directly. But I certainly
> > can't predict everything a consumer wants to do. If we really need to keep it
> > public then, it begs the question, is providing a generic entry point even
> > worthwhile? Is it just as easy to expose the scalar/sse and any future versions
> > directly so the application can just embody the intellegence to select the best
> > path? That saves us having to maintain another API point. I can go with
> > consensus on that.
> >
> > > - it is global, which means that we can't simultaneously use classify_scalar() and classify_sse() for 2 different ACL contexts.
> > > - to properly support such switching we then will need to support something like (see app/test/test_acl.c below):
> > > old_alg = rte_acl_get_classify();
> > > rte_acl_select_classify(new_alg);
> > > ...
> > > rte_acl_select_classify(old_alg);
> > >
> > We could attach the classification method to the acl context, so each
> > rte_acl_ctx can point to whatever classifier funtion it wants to. That would
> > remove the global issues you point out above.
>
> I thought about that approach too.
> But there is one implication with DPDK MP model:
> Same ACL context can be shared by different DPDK processes,
> while acl_classify() could be loaded to the different addresses.
> Of course we can overcome it by creating a global table of function pointers indexed by calssify_alg and
> store inside ACL ctx alg instead of actual function pointer.
> But that means extra overhead of at least two loads per classify() call.
>
Hmm, how is the context shared around between processes? Is it just shared as a
common cow data page resulting from a fork? If so, then we should be good
because the DSO text will be at the same address (i.e. the pointer will still be
valid). If you do some sort of message passing, then, yes, thats a problem.
> > Or alternatively we can just not
> > provide a generic entry point and let each user select a specific function.
>
> I wonder can we have sort of mixed approach:
> 1. provide a generic entry point that would be set to the best (from our knowledge) available classify function.
> 2. Let each user use a specific function if he wants too.
>
> i.e:
> - keep classify_scalar/classify_sse/classify_... public.
> - keep your current implementation of rte_acl_classify()
> BTW in that way, we probably can make acl_select_classify() static.
>
Agreed, depending on your answer above, this might be the best solution.
> So most users would just use generic entry point and wouldn't need to write their own code wrappers around it.
> For users who need to use a particular classify() version - they can call it directly.
>
It does seem reasonable. Let me know what the ctx sharing mechanism is from
above, and we can settle this.
> >
> >
> > > > REmoved macro definitions for match check functions to make them static inline
> > >
> > > More comments inlined below.
> > >snip>
> > > >
> > > > /* make a quick check for scalar */
> > > > - ret = rte_acl_classify_scalar(acx, data, results,
> > > > + rte_acl_select_classify(ACL_CLASSIFY_SCALAR);
> > > > + ret = rte_acl_classify(acx, data, results,
> > > > RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES);
> > >
> > >
> > > As I said above, that doesn't seem correct: we set rte_acl_default_classify = rte_acl_classify_scalar and never restore it back to the
> > original value.
> > > To support it properly, we need to:
> > > old_alg = rte_acl_get_classify();
> > > rte_acl_select_classify(new_alg);
> > > ...
> > > rte_acl_select_classify(old_alg);
> > >
> > So, for the purposes of this test application, I don't see that as being needed.
> > Every call to rte_acl_classify is preceded by a setting of the classifier
> > function, so you're safe.
>
> Not every, that's a problem.
> As I can see, in test/test_acl.c you replaced
> rte_acl_classify_scalar();
> with
> rte_acl_select_classify(SCALAR);
> rte_acl_classify();
>
> And never restore previous value of rte_acl_default_classify.
> Right now rte_acl_default_classify is global, so after first:
> rte_acl_select_classify(SCALAR);
> all subsequent rte_acl_classify() will actually use scalar version.
>
Hmm, ok, I'll take a closer look at it.
> > If you're concerned about other processes using the
> > dpdk library at the same time, you're still safe, as despite being a global
> > variable, data pages in a DSO are Copy on Write, so each process gets their own
> > copy of the global variable.
>
> No, my concern here is only about app/test here.
>
> >
> > Multiple threads within the same process are problematic, I agree, and thats
> > solvable with the per-acl-context mechanism that I described above, though that
> > shouldn't be needed here as this seems to be a single threaded program.
> >
> > > Make all this just to keep UT valid seems like a big hassle to me.
> > > So I said above - probably better just leave it to call rte_acl_classify_scalar() directly.
> > >
> > That works for me too, though the per-context mechanism seems kind of nice to
> > me. Let me know what you prefer.
> >
> > ><snip>
> > > >
> > > > diff --git a/lib/librte_acl/acl_match_check.h b/lib/librte_acl/acl_match_check.h
> > > > new file mode 100644
> > > > index 0000000..4dc1982
> > > > --- /dev/null
> > > > +++ b/lib/librte_acl/acl_match_check.h
> > >
> > > As a nit: we probably don't need a special header just for one function and can place it inside acl_run.h.
> > >
> > Agreed, I can move that to acl_run.h.
> >
> > ><snip>
> > > > + */
> > > > +static inline uint64_t
> > > > +acl_match_check(uint64_t transition, int slot,
> > > > + const struct rte_acl_ctx *ctx, struct parms *parms,
> > > > + struct acl_flow_data *flows, void (*resolve_priority)(
> > > > + uint64_t transition, int n, const struct rte_acl_ctx *ctx,
> > > > + struct parms *parms, const struct rte_acl_match_results *p,
> > > > + uint32_t categories))
> > >
> > > Ugh, that's really hard to read.
> > > Can we create a typedef for resolve_priority function type:
> > > typedef void (*resolve_priority_t)(uint64_t, int,
> > > const struct rte_acl_ctx *ctx, struct parms *,
> > > const struct rte_acl_match_results *, uint32_t);
> > > And use it here?
> > >
> > Sure, I'm fine with doing that.
> >
> > ><snip>
> > > > +
> > > > +/* by default, use always avaialbe scalar code path. */
> > > > +rte_acl_classify_t rte_acl_default_classify = rte_acl_classify_scalar;
> > >
> > > Why not 'static'?
> > > I thought you'd like to hide it from external world.
> > >
> > Doh! I didn't do the one thing that I really meant to do. I removed it from
> > the header file but I forgot to declare the variable static. I'll fix that.
> >
> > > > +
> > > > +void rte_acl_select_classify(enum acl_classify_alg alg)
> > > > +{
> > > > +
> > > > + switch(alg)
> > > > + {
> > > > + case ACL_CLASSIFY_DEFAULT:
> > > > + case ACL_CLASSIFY_SCALAR:
> > > > + rte_acl_default_classify = rte_acl_classify_scalar;
> > > > + break;
> > > > + case ACL_CLASSIFY_SSE:
> > > > + rte_acl_default_classify = rte_acl_classify_sse;
> > > > + break;
> > > > + }
> > > > +
> > > > +}
> > >
> > > As this is init phase function, I suppose we can add check that alg has a valid(supported) value, and return some error as return
> > value, if not.
> > >
> > Not sure I follow what you're saying above, are you suggesting that we add a
> > rte_cpu_get_flag_enabled check to rte_acl_select_classify above?
> >
> > ><snip>
> > > > *
> > > > @@ -286,9 +289,10 @@ rte_acl_reset(struct rte_acl_ctx *ctx);
> > > > * @return
> > > > * zero on successful completion.
> > > > * -EINVAL for incorrect arguments.
> > > > + * -ENOTSUP for unsupported platforms.
> > >
> > > Please remove the line above: current implementation doesn't return ENOTSUP
> > > (I think that was left from v1).
> > >
> > Yup, probably was. I'll remove it.
> >
> > > > */
> > > > int
> > > > -rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > > +rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > > uint32_t *results, uint32_t num, uint32_t categories);
> > > >
> > > > /**
> > > > @@ -323,9 +327,23 @@ rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > > * zero on successful completion.
> > > > * -EINVAL for incorrect arguments.
> > > > */
> > > > -int
> > > > -rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > > - uint32_t *results, uint32_t num, uint32_t categories);
> > >
> > >
> > > As I said above we'd better keep it.
> > >
> > Ok, can do.
> >
> > > > +
> > > > +enum acl_classify_alg {
> > > > + ACL_CLASSIFY_DEFAULT = 0,
> > > > + ACL_CLASSIFY_SCALAR = 1,
> > > > + ACL_CLASSIFY_SSE = 2,
> > > > +};
> > >
> > > As a nit: as this emum is part of public API, I think it is better to add rte_ prefix: enum rte_acl_classify_alg
> > >
> > Sure, done.
> >
> > > > +
> > > > +extern inline int rte_acl_classify(const struct rte_acl_ctx *ctx,
> > > > + const uint8_t **data,
> > > > + uint32_t *results, uint32_t num,
> > > > + uint32_t categories);
> > >
> > > Again as a nit: here and everywhere can we keep same style through the whole DPDK - function name from the new line:
> > > extern nt
> > > rte_acl_classify(...);
> > >
> > Ok
> >
> > I'll produce another version based on your feedback regarding the
> > per-context-calssifier method vs. just removing the generic classifier.
> >
> > Regards
> > Neil
>
>
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCHv3] librte_acl make it build/work for 'default' target
2014-08-26 17:44 0% ` Neil Horman
@ 2014-08-27 11:25 0% ` Ananyev, Konstantin
2014-08-27 18:56 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Ananyev, Konstantin @ 2014-08-27 11:25 UTC (permalink / raw)
To: Neil Horman; +Cc: dev
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Tuesday, August 26, 2014 6:45 PM
> To: Ananyev, Konstantin
> Cc: dev@dpdk.org; thomas.monjalon@6wind.com
> Subject: Re: [PATCHv3] librte_acl make it build/work for 'default' target
>
> On Mon, Aug 25, 2014 at 04:30:05PM +0000, Ananyev, Konstantin wrote:
> > Hi Neil,
> >
> > > -----Original Message-----
> > > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > > Sent: Thursday, August 21, 2014 9:15 PM
> > > To: dev@dpdk.org
> > > Cc: Ananyev, Konstantin; thomas.monjalon@6wind.com; Neil Horman
> > > Subject: [PATCHv3] librte_acl make it build/work for 'default' target
> > >
> > > Make ACL library to build/work on 'default' architecture:
> > > - make rte_acl_classify_scalar really scalar
> > > (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> > > - Provide two versions of rte_acl_classify code path:
> > > rte_acl_classify_sse() - could be build and used only on systems with sse4.2
> > > and upper, return -ENOTSUP on lower arch.
> > > rte_acl_classify_scalar() - a slower version, but could be build and used
> > > on all systems.
> > > - keep common code shared between these two codepaths.
> > >
> > > v2 chages:
> > > run-time selection of most appropriate code-path for given ISA.
> > > By default the highest supprted one is selected.
> > > User can still override that selection by manually assigning new value to
> > > the global function pointer rte_acl_default_classify.
> > > rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
> > > points to.
> > >
> >
> > I see you decided not to wait for me and fix everything by yourself :)
> >
> Yeah, sorry, I'm getting pinged about enabling these features in Fedora, and it
> had been about 2 weeks, so I figured I'd just take care of it.
No worries. I admit that it was a long delay from my side.
>
> > > V3 Changes
> > > Updated classify pointer to be a function so as to better preserve ABI
> >
> > As I said in my previous mail it generates extra jump...
> > Though from numbers I got the performance impact is negligible: < 1%.
> > So I suppose, I don't have a good enough reason to object :)
> >
> Yeah, I just don't see a way around it. I was hoping that the compiler would
> have been smart enough to see that the rte_acl_classify function was small and
> in-linable, but apparently it won't do that. As you note however the
> performance change is minor (I'm guessing within a standard deviation of your
> results).
>
> > Though I still think we better keep rte_acl_classify_scalar() publically available (same as we do for rte acl_classify_sse()):
> > First of all keep rte_acl_classify_scalar() is already part of our public API.
> > Also, as I remember, one of the customers explicitly asked for scalar version and they planned to call it directly.
> > Plus using rte_acl_select_classify() to always switch between implementations is not always handy:
>
> I'm not exactly opposed to this, though it seems odd to me that a user might
> want to call a particular version of the classifier directly. But I certainly
> can't predict everything a consumer wants to do. If we really need to keep it
> public then, it begs the question, is providing a generic entry point even
> worthwhile? Is it just as easy to expose the scalar/sse and any future versions
> directly so the application can just embody the intellegence to select the best
> path? That saves us having to maintain another API point. I can go with
> consensus on that.
>
> > - it is global, which means that we can't simultaneously use classify_scalar() and classify_sse() for 2 different ACL contexts.
> > - to properly support such switching we then will need to support something like (see app/test/test_acl.c below):
> > old_alg = rte_acl_get_classify();
> > rte_acl_select_classify(new_alg);
> > ...
> > rte_acl_select_classify(old_alg);
> >
> We could attach the classification method to the acl context, so each
> rte_acl_ctx can point to whatever classifier funtion it wants to. That would
> remove the global issues you point out above.
I thought about that approach too.
But there is one implication with DPDK MP model:
Same ACL context can be shared by different DPDK processes,
while acl_classify() could be loaded to the different addresses.
Of course we can overcome it by creating a global table of function pointers indexed by calssify_alg and
store inside ACL ctx alg instead of actual function pointer.
But that means extra overhead of at least two loads per classify() call.
> Or alternatively we can just not
> provide a generic entry point and let each user select a specific function.
I wonder can we have sort of mixed approach:
1. provide a generic entry point that would be set to the best (from our knowledge) available classify function.
2. Let each user use a specific function if he wants too.
i.e:
- keep classify_scalar/classify_sse/classify_... public.
- keep your current implementation of rte_acl_classify()
BTW in that way, we probably can make acl_select_classify() static.
So most users would just use generic entry point and wouldn't need to write their own code wrappers around it.
For users who need to use a particular classify() version - they can call it directly.
>
>
> > > REmoved macro definitions for match check functions to make them static inline
> >
> > More comments inlined below.
> >snip>
> > >
> > > /* make a quick check for scalar */
> > > - ret = rte_acl_classify_scalar(acx, data, results,
> > > + rte_acl_select_classify(ACL_CLASSIFY_SCALAR);
> > > + ret = rte_acl_classify(acx, data, results,
> > > RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES);
> >
> >
> > As I said above, that doesn't seem correct: we set rte_acl_default_classify = rte_acl_classify_scalar and never restore it back to the
> original value.
> > To support it properly, we need to:
> > old_alg = rte_acl_get_classify();
> > rte_acl_select_classify(new_alg);
> > ...
> > rte_acl_select_classify(old_alg);
> >
> So, for the purposes of this test application, I don't see that as being needed.
> Every call to rte_acl_classify is preceded by a setting of the classifier
> function, so you're safe.
Not every, that's a problem.
As I can see, in test/test_acl.c you replaced
rte_acl_classify_scalar();
with
rte_acl_select_classify(SCALAR);
rte_acl_classify();
And never restore previous value of rte_acl_default_classify.
Right now rte_acl_default_classify is global, so after first:
rte_acl_select_classify(SCALAR);
all subsequent rte_acl_classify() will actually use scalar version.
> If you're concerned about other processes using the
> dpdk library at the same time, you're still safe, as despite being a global
> variable, data pages in a DSO are Copy on Write, so each process gets their own
> copy of the global variable.
No, my concern here is only about app/test here.
>
> Multiple threads within the same process are problematic, I agree, and thats
> solvable with the per-acl-context mechanism that I described above, though that
> shouldn't be needed here as this seems to be a single threaded program.
>
> > Make all this just to keep UT valid seems like a big hassle to me.
> > So I said above - probably better just leave it to call rte_acl_classify_scalar() directly.
> >
> That works for me too, though the per-context mechanism seems kind of nice to
> me. Let me know what you prefer.
>
> ><snip>
> > >
> > > diff --git a/lib/librte_acl/acl_match_check.h b/lib/librte_acl/acl_match_check.h
> > > new file mode 100644
> > > index 0000000..4dc1982
> > > --- /dev/null
> > > +++ b/lib/librte_acl/acl_match_check.h
> >
> > As a nit: we probably don't need a special header just for one function and can place it inside acl_run.h.
> >
> Agreed, I can move that to acl_run.h.
>
> ><snip>
> > > + */
> > > +static inline uint64_t
> > > +acl_match_check(uint64_t transition, int slot,
> > > + const struct rte_acl_ctx *ctx, struct parms *parms,
> > > + struct acl_flow_data *flows, void (*resolve_priority)(
> > > + uint64_t transition, int n, const struct rte_acl_ctx *ctx,
> > > + struct parms *parms, const struct rte_acl_match_results *p,
> > > + uint32_t categories))
> >
> > Ugh, that's really hard to read.
> > Can we create a typedef for resolve_priority function type:
> > typedef void (*resolve_priority_t)(uint64_t, int,
> > const struct rte_acl_ctx *ctx, struct parms *,
> > const struct rte_acl_match_results *, uint32_t);
> > And use it here?
> >
> Sure, I'm fine with doing that.
>
> ><snip>
> > > +
> > > +/* by default, use always avaialbe scalar code path. */
> > > +rte_acl_classify_t rte_acl_default_classify = rte_acl_classify_scalar;
> >
> > Why not 'static'?
> > I thought you'd like to hide it from external world.
> >
> Doh! I didn't do the one thing that I really meant to do. I removed it from
> the header file but I forgot to declare the variable static. I'll fix that.
>
> > > +
> > > +void rte_acl_select_classify(enum acl_classify_alg alg)
> > > +{
> > > +
> > > + switch(alg)
> > > + {
> > > + case ACL_CLASSIFY_DEFAULT:
> > > + case ACL_CLASSIFY_SCALAR:
> > > + rte_acl_default_classify = rte_acl_classify_scalar;
> > > + break;
> > > + case ACL_CLASSIFY_SSE:
> > > + rte_acl_default_classify = rte_acl_classify_sse;
> > > + break;
> > > + }
> > > +
> > > +}
> >
> > As this is init phase function, I suppose we can add check that alg has a valid(supported) value, and return some error as return
> value, if not.
> >
> Not sure I follow what you're saying above, are you suggesting that we add a
> rte_cpu_get_flag_enabled check to rte_acl_select_classify above?
>
> ><snip>
> > > *
> > > @@ -286,9 +289,10 @@ rte_acl_reset(struct rte_acl_ctx *ctx);
> > > * @return
> > > * zero on successful completion.
> > > * -EINVAL for incorrect arguments.
> > > + * -ENOTSUP for unsupported platforms.
> >
> > Please remove the line above: current implementation doesn't return ENOTSUP
> > (I think that was left from v1).
> >
> Yup, probably was. I'll remove it.
>
> > > */
> > > int
> > > -rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > +rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > uint32_t *results, uint32_t num, uint32_t categories);
> > >
> > > /**
> > > @@ -323,9 +327,23 @@ rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > * zero on successful completion.
> > > * -EINVAL for incorrect arguments.
> > > */
> > > -int
> > > -rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > > - uint32_t *results, uint32_t num, uint32_t categories);
> >
> >
> > As I said above we'd better keep it.
> >
> Ok, can do.
>
> > > +
> > > +enum acl_classify_alg {
> > > + ACL_CLASSIFY_DEFAULT = 0,
> > > + ACL_CLASSIFY_SCALAR = 1,
> > > + ACL_CLASSIFY_SSE = 2,
> > > +};
> >
> > As a nit: as this emum is part of public API, I think it is better to add rte_ prefix: enum rte_acl_classify_alg
> >
> Sure, done.
>
> > > +
> > > +extern inline int rte_acl_classify(const struct rte_acl_ctx *ctx,
> > > + const uint8_t **data,
> > > + uint32_t *results, uint32_t num,
> > > + uint32_t categories);
> >
> > Again as a nit: here and everywhere can we keep same style through the whole DPDK - function name from the new line:
> > extern nt
> > rte_acl_classify(...);
> >
> Ok
>
> I'll produce another version based on your feedback regarding the
> per-context-calssifier method vs. just removing the generic classifier.
>
> Regards
> Neil
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCHv3] librte_acl make it build/work for 'default' target
2014-08-25 16:30 0% ` Ananyev, Konstantin
@ 2014-08-26 17:44 0% ` Neil Horman
2014-08-27 11:25 0% ` Ananyev, Konstantin
0 siblings, 1 reply; 200+ results
From: Neil Horman @ 2014-08-26 17:44 UTC (permalink / raw)
To: Ananyev, Konstantin; +Cc: dev
On Mon, Aug 25, 2014 at 04:30:05PM +0000, Ananyev, Konstantin wrote:
> Hi Neil,
>
> > -----Original Message-----
> > From: Neil Horman [mailto:nhorman@tuxdriver.com]
> > Sent: Thursday, August 21, 2014 9:15 PM
> > To: dev@dpdk.org
> > Cc: Ananyev, Konstantin; thomas.monjalon@6wind.com; Neil Horman
> > Subject: [PATCHv3] librte_acl make it build/work for 'default' target
> >
> > Make ACL library to build/work on 'default' architecture:
> > - make rte_acl_classify_scalar really scalar
> > (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> > - Provide two versions of rte_acl_classify code path:
> > rte_acl_classify_sse() - could be build and used only on systems with sse4.2
> > and upper, return -ENOTSUP on lower arch.
> > rte_acl_classify_scalar() - a slower version, but could be build and used
> > on all systems.
> > - keep common code shared between these two codepaths.
> >
> > v2 chages:
> > run-time selection of most appropriate code-path for given ISA.
> > By default the highest supprted one is selected.
> > User can still override that selection by manually assigning new value to
> > the global function pointer rte_acl_default_classify.
> > rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
> > points to.
> >
>
> I see you decided not to wait for me and fix everything by yourself :)
>
Yeah, sorry, I'm getting pinged about enabling these features in Fedora, and it
had been about 2 weeks, so I figured I'd just take care of it.
> > V3 Changes
> > Updated classify pointer to be a function so as to better preserve ABI
>
> As I said in my previous mail it generates extra jump...
> Though from numbers I got the performance impact is negligible: < 1%.
> So I suppose, I don't have a good enough reason to object :)
>
Yeah, I just don't see a way around it. I was hoping that the compiler would
have been smart enough to see that the rte_acl_classify function was small and
in-linable, but apparently it won't do that. As you note however the
performance change is minor (I'm guessing within a standard deviation of your
results).
> Though I still think we better keep rte_acl_classify_scalar() publically available (same as we do for rte acl_classify_sse()):
> First of all keep rte_acl_classify_scalar() is already part of our public API.
> Also, as I remember, one of the customers explicitly asked for scalar version and they planned to call it directly.
> Plus using rte_acl_select_classify() to always switch between implementations is not always handy:
I'm not exactly opposed to this, though it seems odd to me that a user might
want to call a particular version of the classifier directly. But I certainly
can't predict everything a consumer wants to do. If we really need to keep it
public then, it begs the question, is providing a generic entry point even
worthwhile? Is it just as easy to expose the scalar/sse and any future versions
directly so the application can just embody the intellegence to select the best
path? That saves us having to maintain another API point. I can go with
consensus on that.
> - it is global, which means that we can't simultaneously use classify_scalar() and classify_sse() for 2 different ACL contexts.
> - to properly support such switching we then will need to support something like (see app/test/test_acl.c below):
> old_alg = rte_acl_get_classify();
> rte_acl_select_classify(new_alg);
> ...
> rte_acl_select_classify(old_alg);
>
We could attach the classification method to the acl context, so each
rte_acl_ctx can point to whatever classifier funtion it wants to. That would
remove the global issues you point out above. Or alternatively we can just not
provide a generic entry point and let each user select a specific function.
> > REmoved macro definitions for match check functions to make them static inline
>
> More comments inlined below.
>snip>
> >
> > /* make a quick check for scalar */
> > - ret = rte_acl_classify_scalar(acx, data, results,
> > + rte_acl_select_classify(ACL_CLASSIFY_SCALAR);
> > + ret = rte_acl_classify(acx, data, results,
> > RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES);
>
>
> As I said above, that doesn't seem correct: we set rte_acl_default_classify = rte_acl_classify_scalar and never restore it back to the original value.
> To support it properly, we need to:
> old_alg = rte_acl_get_classify();
> rte_acl_select_classify(new_alg);
> ...
> rte_acl_select_classify(old_alg);
>
So, for the purposes of this test application, I don't see that as being needed.
Every call to rte_acl_classify is preceded by a setting of the classifier
function, so you're safe. If you're concerned about other processes using the
dpdk library at the same time, you're still safe, as despite being a global
variable, data pages in a DSO are Copy on Write, so each process gets their own
copy of the global variable.
Multiple threads within the same process are problematic, I agree, and thats
solvable with the per-acl-context mechanism that I described above, though that
shouldn't be needed here as this seems to be a single threaded program.
> Make all this just to keep UT valid seems like a big hassle to me.
> So I said above - probably better just leave it to call rte_acl_classify_scalar() directly.
>
That works for me too, though the per-context mechanism seems kind of nice to
me. Let me know what you prefer.
><snip>
> >
> > diff --git a/lib/librte_acl/acl_match_check.h b/lib/librte_acl/acl_match_check.h
> > new file mode 100644
> > index 0000000..4dc1982
> > --- /dev/null
> > +++ b/lib/librte_acl/acl_match_check.h
>
> As a nit: we probably don't need a special header just for one function and can place it inside acl_run.h.
>
Agreed, I can move that to acl_run.h.
><snip>
> > + */
> > +static inline uint64_t
> > +acl_match_check(uint64_t transition, int slot,
> > + const struct rte_acl_ctx *ctx, struct parms *parms,
> > + struct acl_flow_data *flows, void (*resolve_priority)(
> > + uint64_t transition, int n, const struct rte_acl_ctx *ctx,
> > + struct parms *parms, const struct rte_acl_match_results *p,
> > + uint32_t categories))
>
> Ugh, that's really hard to read.
> Can we create a typedef for resolve_priority function type:
> typedef void (*resolve_priority_t)(uint64_t, int,
> const struct rte_acl_ctx *ctx, struct parms *,
> const struct rte_acl_match_results *, uint32_t);
> And use it here?
>
Sure, I'm fine with doing that.
><snip>
> > +
> > +/* by default, use always avaialbe scalar code path. */
> > +rte_acl_classify_t rte_acl_default_classify = rte_acl_classify_scalar;
>
> Why not 'static'?
> I thought you'd like to hide it from external world.
>
Doh! I didn't do the one thing that I really meant to do. I removed it from
the header file but I forgot to declare the variable static. I'll fix that.
> > +
> > +void rte_acl_select_classify(enum acl_classify_alg alg)
> > +{
> > +
> > + switch(alg)
> > + {
> > + case ACL_CLASSIFY_DEFAULT:
> > + case ACL_CLASSIFY_SCALAR:
> > + rte_acl_default_classify = rte_acl_classify_scalar;
> > + break;
> > + case ACL_CLASSIFY_SSE:
> > + rte_acl_default_classify = rte_acl_classify_sse;
> > + break;
> > + }
> > +
> > +}
>
> As this is init phase function, I suppose we can add check that alg has a valid(supported) value, and return some error as return value, if not.
>
Not sure I follow what you're saying above, are you suggesting that we add a
rte_cpu_get_flag_enabled check to rte_acl_select_classify above?
><snip>
> > *
> > @@ -286,9 +289,10 @@ rte_acl_reset(struct rte_acl_ctx *ctx);
> > * @return
> > * zero on successful completion.
> > * -EINVAL for incorrect arguments.
> > + * -ENOTSUP for unsupported platforms.
>
> Please remove the line above: current implementation doesn't return ENOTSUP
> (I think that was left from v1).
>
Yup, probably was. I'll remove it.
> > */
> > int
> > -rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > +rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > uint32_t *results, uint32_t num, uint32_t categories);
> >
> > /**
> > @@ -323,9 +327,23 @@ rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > * zero on successful completion.
> > * -EINVAL for incorrect arguments.
> > */
> > -int
> > -rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> > - uint32_t *results, uint32_t num, uint32_t categories);
>
>
> As I said above we'd better keep it.
>
Ok, can do.
> > +
> > +enum acl_classify_alg {
> > + ACL_CLASSIFY_DEFAULT = 0,
> > + ACL_CLASSIFY_SCALAR = 1,
> > + ACL_CLASSIFY_SSE = 2,
> > +};
>
> As a nit: as this emum is part of public API, I think it is better to add rte_ prefix: enum rte_acl_classify_alg
>
Sure, done.
> > +
> > +extern inline int rte_acl_classify(const struct rte_acl_ctx *ctx,
> > + const uint8_t **data,
> > + uint32_t *results, uint32_t num,
> > + uint32_t categories);
>
> Again as a nit: here and everywhere can we keep same style through the whole DPDK - function name from the new line:
> extern nt
> rte_acl_classify(...);
>
Ok
I'll produce another version based on your feedback regarding the
per-context-calssifier method vs. just removing the generic classifier.
Regards
Neil
^ permalink raw reply [relevance 0%]
* Re: [dpdk-dev] [PATCHv3] librte_acl make it build/work for 'default' target
@ 2014-08-25 16:30 0% ` Ananyev, Konstantin
2014-08-26 17:44 0% ` Neil Horman
0 siblings, 1 reply; 200+ results
From: Ananyev, Konstantin @ 2014-08-25 16:30 UTC (permalink / raw)
To: Neil Horman, dev
Hi Neil,
> -----Original Message-----
> From: Neil Horman [mailto:nhorman@tuxdriver.com]
> Sent: Thursday, August 21, 2014 9:15 PM
> To: dev@dpdk.org
> Cc: Ananyev, Konstantin; thomas.monjalon@6wind.com; Neil Horman
> Subject: [PATCHv3] librte_acl make it build/work for 'default' target
>
> Make ACL library to build/work on 'default' architecture:
> - make rte_acl_classify_scalar really scalar
> (make sure it wouldn't use sse4 instrincts through resolve_priority()).
> - Provide two versions of rte_acl_classify code path:
> rte_acl_classify_sse() - could be build and used only on systems with sse4.2
> and upper, return -ENOTSUP on lower arch.
> rte_acl_classify_scalar() - a slower version, but could be build and used
> on all systems.
> - keep common code shared between these two codepaths.
>
> v2 chages:
> run-time selection of most appropriate code-path for given ISA.
> By default the highest supprted one is selected.
> User can still override that selection by manually assigning new value to
> the global function pointer rte_acl_default_classify.
> rte_acl_classify() becomes a macro calling whatever rte_acl_default_classify
> points to.
>
I see you decided not to wait for me and fix everything by yourself :)
> V3 Changes
> Updated classify pointer to be a function so as to better preserve ABI
As I said in my previous mail it generates extra jump...
Though from numbers I got the performance impact is negligible: < 1%.
So I suppose, I don't have a good enough reason to object :)
Though I still think we better keep rte_acl_classify_scalar() publically available (same as we do for rte acl_classify_sse()):
First of all keep rte_acl_classify_scalar() is already part of our public API.
Also, as I remember, one of the customers explicitly asked for scalar version and they planned to call it directly.
Plus using rte_acl_select_classify() to always switch between implementations is not always handy:
- it is global, which means that we can't simultaneously use classify_scalar() and classify_sse() for 2 different ACL contexts.
- to properly support such switching we then will need to support something like (see app/test/test_acl.c below):
old_alg = rte_acl_get_classify();
rte_acl_select_classify(new_alg);
...
rte_acl_select_classify(old_alg);
> REmoved macro definitions for match check functions to make them static inline
More comments inlined below.
Thanks
Konstantin
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> ---
> app/test-acl/main.c | 13 +-
> app/test/test_acl.c | 12 +-
> lib/librte_acl/Makefile | 5 +-
> lib/librte_acl/acl_bld.c | 5 +-
> lib/librte_acl/acl_match_check.h | 83 ++++
> lib/librte_acl/acl_run.c | 944 ---------------------------------------
> lib/librte_acl/acl_run.h | 220 +++++++++
> lib/librte_acl/acl_run_scalar.c | 198 ++++++++
> lib/librte_acl/acl_run_sse.c | 627 ++++++++++++++++++++++++++
> lib/librte_acl/rte_acl.c | 46 ++
> lib/librte_acl/rte_acl.h | 26 +-
> 11 files changed, 1216 insertions(+), 963 deletions(-)
> create mode 100644 lib/librte_acl/acl_match_check.h
> delete mode 100644 lib/librte_acl/acl_run.c
> create mode 100644 lib/librte_acl/acl_run.h
> create mode 100644 lib/librte_acl/acl_run_scalar.c
> create mode 100644 lib/librte_acl/acl_run_sse.c
>
> diff --git a/app/test-acl/main.c b/app/test-acl/main.c
> index d654409..a77f47d 100644
> --- a/app/test-acl/main.c
> +++ b/app/test-acl/main.c
> @@ -787,6 +787,10 @@ acx_init(void)
> /* perform build. */
> ret = rte_acl_build(config.acx, &cfg);
>
> + /* setup default rte_acl_classify */
> + if (config.scalar)
> + rte_acl_select_classify(ACL_CLASSIFY_SCALAR);
> +
> dump_verbose(DUMP_NONE, stdout,
> "rte_acl_build(%u) finished with %d\n",
> config.bld_categories, ret);
> @@ -815,13 +819,8 @@ search_ip5tuples_once(uint32_t categories, uint32_t step, int scalar)
> v += config.trace_sz;
> }
>
> - if (scalar != 0)
> - ret = rte_acl_classify_scalar(config.acx, data,
> - results, n, categories);
> -
> - else
> - ret = rte_acl_classify(config.acx, data,
> - results, n, categories);
> + ret = rte_acl_classify(config.acx, data, results,
> + n, categories);
>
> if (ret != 0)
> rte_exit(ret, "classify for ipv%c_5tuples returns %d\n",
> diff --git a/app/test/test_acl.c b/app/test/test_acl.c
> index 869f6d3..2fcef6e 100644
> --- a/app/test/test_acl.c
> +++ b/app/test/test_acl.c
> @@ -148,7 +148,8 @@ test_classify_run(struct rte_acl_ctx *acx)
> }
>
> /* make a quick check for scalar */
> - ret = rte_acl_classify_scalar(acx, data, results,
> + rte_acl_select_classify(ACL_CLASSIFY_SCALAR);
> + ret = rte_acl_classify(acx, data, results,
> RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES);
As I said above, that doesn't seem correct: we set rte_acl_default_classify = rte_acl_classify_scalar and never restore it back to the original value.
To support it properly, we need to:
old_alg = rte_acl_get_classify();
rte_acl_select_classify(new_alg);
...
rte_acl_select_classify(old_alg);
Make all this just to keep UT valid seems like a big hassle to me.
So I said above - probably better just leave it to call rte_acl_classify_scalar() directly.
> if (ret != 0) {
> printf("Line %i: SSE classify failed!\n", __LINE__);
> @@ -362,7 +363,8 @@ test_invalid_layout(void)
> }
>
> /* classify tuples (scalar) */
> - ret = rte_acl_classify_scalar(acx, data, results,
> + rte_acl_select_classify(ACL_CLASSIFY_SCALAR);
> + ret = rte_acl_classify(acx, data, results,
> RTE_DIM(results), 1);
> if (ret != 0) {
> printf("Line %i: Scalar classify failed!\n", __LINE__);
> @@ -850,7 +852,8 @@ test_invalid_parameters(void)
> /* scalar classify test */
>
> /* cover zero categories in classify (should not fail) */
> - result = rte_acl_classify_scalar(acx, NULL, NULL, 0, 0);
> + rte_acl_select_classify(ACL_CLASSIFY_SCALAR);
> + result = rte_acl_classify(acx, NULL, NULL, 0, 0);
> if (result != 0) {
> printf("Line %i: Scalar classify with zero categories "
> "failed!\n", __LINE__);
> @@ -859,7 +862,8 @@ test_invalid_parameters(void)
> }
>
> /* cover invalid but positive categories in classify */
> - result = rte_acl_classify_scalar(acx, NULL, NULL, 0, 3);
> + rte_acl_select_classify(ACL_CLASSIFY_SCALAR);
> + result = rte_acl_classify(acx, NULL, NULL, 0, 3);
> if (result == 0) {
> printf("Line %i: Scalar classify with 3 categories "
> "should have failed!\n", __LINE__);
> diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
> index 4fe4593..65e566d 100644
> --- a/lib/librte_acl/Makefile
> +++ b/lib/librte_acl/Makefile
> @@ -43,7 +43,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
> SRCS-$(CONFIG_RTE_LIBRTE_ACL) += rte_acl.c
> SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_bld.c
> SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_gen.c
> -SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run.c
> +SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_scalar.c
> +SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_sse.c
> +
> +CFLAGS_acl_run_sse.o += -msse4.1
>
> # install this header file
> SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include := rte_acl_osdep.h
> diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c
> index 873447b..09d58ea 100644
> --- a/lib/librte_acl/acl_bld.c
> +++ b/lib/librte_acl/acl_bld.c
> @@ -31,7 +31,6 @@
> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> */
>
> -#include <nmmintrin.h>
> #include <rte_acl.h>
> #include "tb_mem.h"
> #include "acl.h"
> @@ -1480,8 +1479,8 @@ acl_calc_wildness(struct rte_acl_build_rule *head,
>
> switch (rule->config->defs[n].type) {
> case RTE_ACL_FIELD_TYPE_BITMASK:
> - wild = (size -
> - _mm_popcnt_u32(fld->mask_range.u8)) /
> + wild = (size - __builtin_popcount(
> + fld->mask_range.u8)) /
> size;
> break;
>
> diff --git a/lib/librte_acl/acl_match_check.h b/lib/librte_acl/acl_match_check.h
> new file mode 100644
> index 0000000..4dc1982
> --- /dev/null
> +++ b/lib/librte_acl/acl_match_check.h
As a nit: we probably don't need a special header just for one function and can place it inside acl_run.h.
> @@ -0,0 +1,83 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#ifndef _ACL_MATCH_CHECK_H_
> +#define _ACL_MATCH_CHECK_H_
> +
> +/*
> + * Detect matches. If a match node transition is found, then this trie
> + * traversal is complete and fill the slot with the next trie
> + * to be processed.
> + */
> +static inline uint64_t
> +acl_match_check(uint64_t transition, int slot,
> + const struct rte_acl_ctx *ctx, struct parms *parms,
> + struct acl_flow_data *flows, void (*resolve_priority)(
> + uint64_t transition, int n, const struct rte_acl_ctx *ctx,
> + struct parms *parms, const struct rte_acl_match_results *p,
> + uint32_t categories))
Ugh, that's really hard to read.
Can we create a typedef for resolve_priority function type:
typedef void (*resolve_priority_t)(uint64_t, int,
const struct rte_acl_ctx *ctx, struct parms *,
const struct rte_acl_match_results *, uint32_t);
And use it here?
> +{
> + const struct rte_acl_match_results *p;
> +
> + p = (const struct rte_acl_match_results *)
> + (flows->trans + ctx->match_index);
> +
> + if (transition & RTE_ACL_NODE_MATCH) {
> +
> + /* Remove flags from index and decrement active traversals */
> + transition &= RTE_ACL_NODE_INDEX;
> + flows->started--;
> +
> + /* Resolve priorities for this trie and running results */
> + if (flows->categories == 1)
> + resolve_single_priority(transition, slot, ctx,
> + parms, p);
> + else
> + resolve_priority(transition, slot, ctx, parms,
> + p, flows->categories);
> +
> + /* Count down completed tries for this search request */
> + parms[slot].cmplt->count--;
> +
> + /* Fill the slot with the next trie or idle trie */
> + transition = acl_start_next_trie(flows, parms, slot, ctx);
> +
> + } else if (transition == ctx->idle) {
> + /* reset indirection table for idle slots */
> + parms[slot].data_index = idle;
> + }
> +
> + return transition;
> +}
> +
> +#endif
> diff --git a/lib/librte_acl/acl_run.c b/lib/librte_acl/acl_run.c
> deleted file mode 100644
> index e3d9fc1..0000000
> --- a/lib/librte_acl/acl_run.c
> +++ /dev/null
> @@ -1,944 +0,0 @@
> -/*-
> - * BSD LICENSE
> - *
> - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> - * All rights reserved.
> - *
> - * Redistribution and use in source and binary forms, with or without
> - * modification, are permitted provided that the following conditions
> - * are met:
> - *
> - * * Redistributions of source code must retain the above copyright
> - * notice, this list of conditions and the following disclaimer.
> - * * 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.
> - * * Neither the name of Intel Corporation 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
> - * OWNER 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.
> - */
> -
> -#include <rte_acl.h>
> -#include "acl_vect.h"
> -#include "acl.h"
> -
> -#define MAX_SEARCHES_SSE8 8
> -#define MAX_SEARCHES_SSE4 4
> -#define MAX_SEARCHES_SSE2 2
> -#define MAX_SEARCHES_SCALAR 2
> -
> -#define GET_NEXT_4BYTES(prm, idx) \
> - (*((const int32_t *)((prm)[(idx)].data + *(prm)[idx].data_index++)))
> -
> -
> -#define RTE_ACL_NODE_INDEX ((uint32_t)~RTE_ACL_NODE_TYPE)
> -
> -#define SCALAR_QRANGE_MULT 0x01010101
> -#define SCALAR_QRANGE_MASK 0x7f7f7f7f
> -#define SCALAR_QRANGE_MIN 0x80808080
> -
> -enum {
> - SHUFFLE32_SLOT1 = 0xe5,
> - SHUFFLE32_SLOT2 = 0xe6,
> - SHUFFLE32_SLOT3 = 0xe7,
> - SHUFFLE32_SWAP64 = 0x4e,
> -};
> -
> -/*
> - * Structure to manage N parallel trie traversals.
> - * The runtime trie traversal routines can process 8, 4, or 2 tries
> - * in parallel. Each packet may require multiple trie traversals (up to 4).
> - * This structure is used to fill the slots (0 to n-1) for parallel processing
> - * with the trie traversals needed for each packet.
> - */
> -struct acl_flow_data {
> - uint32_t num_packets;
> - /* number of packets processed */
> - uint32_t started;
> - /* number of trie traversals in progress */
> - uint32_t trie;
> - /* current trie index (0 to N-1) */
> - uint32_t cmplt_size;
> - uint32_t total_packets;
> - uint32_t categories;
> - /* number of result categories per packet. */
> - /* maximum number of packets to process */
> - const uint64_t *trans;
> - const uint8_t **data;
> - uint32_t *results;
> - struct completion *last_cmplt;
> - struct completion *cmplt_array;
> -};
> -
> -/*
> - * Structure to maintain running results for
> - * a single packet (up to 4 tries).
> - */
> -struct completion {
> - uint32_t *results; /* running results. */
> - int32_t priority[RTE_ACL_MAX_CATEGORIES]; /* running priorities. */
> - uint32_t count; /* num of remaining tries */
> - /* true for allocated struct */
> -} __attribute__((aligned(XMM_SIZE)));
> -
> -/*
> - * One parms structure for each slot in the search engine.
> - */
> -struct parms {
> - const uint8_t *data;
> - /* input data for this packet */
> - const uint32_t *data_index;
> - /* data indirection for this trie */
> - struct completion *cmplt;
> - /* completion data for this packet */
> -};
> -
> -/*
> - * Define an global idle node for unused engine slots
> - */
> -static const uint32_t idle[UINT8_MAX + 1];
> -
> -static const rte_xmm_t mm_type_quad_range = {
> - .u32 = {
> - RTE_ACL_NODE_QRANGE,
> - RTE_ACL_NODE_QRANGE,
> - RTE_ACL_NODE_QRANGE,
> - RTE_ACL_NODE_QRANGE,
> - },
> -};
> -
> -static const rte_xmm_t mm_type_quad_range64 = {
> - .u32 = {
> - RTE_ACL_NODE_QRANGE,
> - RTE_ACL_NODE_QRANGE,
> - 0,
> - 0,
> - },
> -};
> -
> -static const rte_xmm_t mm_shuffle_input = {
> - .u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c},
> -};
> -
> -static const rte_xmm_t mm_shuffle_input64 = {
> - .u32 = {0x00000000, 0x04040404, 0x80808080, 0x80808080},
> -};
> -
> -static const rte_xmm_t mm_ones_16 = {
> - .u16 = {1, 1, 1, 1, 1, 1, 1, 1},
> -};
> -
> -static const rte_xmm_t mm_bytes = {
> - .u32 = {UINT8_MAX, UINT8_MAX, UINT8_MAX, UINT8_MAX},
> -};
> -
> -static const rte_xmm_t mm_bytes64 = {
> - .u32 = {UINT8_MAX, UINT8_MAX, 0, 0},
> -};
> -
> -static const rte_xmm_t mm_match_mask = {
> - .u32 = {
> - RTE_ACL_NODE_MATCH,
> - RTE_ACL_NODE_MATCH,
> - RTE_ACL_NODE_MATCH,
> - RTE_ACL_NODE_MATCH,
> - },
> -};
> -
> -static const rte_xmm_t mm_match_mask64 = {
> - .u32 = {
> - RTE_ACL_NODE_MATCH,
> - 0,
> - RTE_ACL_NODE_MATCH,
> - 0,
> - },
> -};
> -
> -static const rte_xmm_t mm_index_mask = {
> - .u32 = {
> - RTE_ACL_NODE_INDEX,
> - RTE_ACL_NODE_INDEX,
> - RTE_ACL_NODE_INDEX,
> - RTE_ACL_NODE_INDEX,
> - },
> -};
> -
> -static const rte_xmm_t mm_index_mask64 = {
> - .u32 = {
> - RTE_ACL_NODE_INDEX,
> - RTE_ACL_NODE_INDEX,
> - 0,
> - 0,
> - },
> -};
> -
> -/*
> - * Allocate a completion structure to manage the tries for a packet.
> - */
> -static inline struct completion *
> -alloc_completion(struct completion *p, uint32_t size, uint32_t tries,
> - uint32_t *results)
> -{
> - uint32_t n;
> -
> - for (n = 0; n < size; n++) {
> -
> - if (p[n].count == 0) {
> -
> - /* mark as allocated and set number of tries. */
> - p[n].count = tries;
> - p[n].results = results;
> - return &(p[n]);
> - }
> - }
> -
> - /* should never get here */
> - return NULL;
> -}
> -
> -/*
> - * Resolve priority for a single result trie.
> - */
> -static inline void
> -resolve_single_priority(uint64_t transition, int n,
> - const struct rte_acl_ctx *ctx, struct parms *parms,
> - const struct rte_acl_match_results *p)
> -{
> - if (parms[n].cmplt->count == ctx->num_tries ||
> - parms[n].cmplt->priority[0] <=
> - p[transition].priority[0]) {
> -
> - parms[n].cmplt->priority[0] = p[transition].priority[0];
> - parms[n].cmplt->results[0] = p[transition].results[0];
> - }
> -
> - parms[n].cmplt->count--;
> -}
> -
> -/*
> - * Resolve priority for multiple results. This consists comparing
> - * the priority of the current traversal with the running set of
> - * results for the packet. For each result, keep a running array of
> - * the result (rule number) and its priority for each category.
> - */
> -static inline void
> -resolve_priority(uint64_t transition, int n, const struct rte_acl_ctx *ctx,
> - struct parms *parms, const struct rte_acl_match_results *p,
> - uint32_t categories)
> -{
> - uint32_t x;
> - xmm_t results, priority, results1, priority1, selector;
> - xmm_t *saved_results, *saved_priority;
> -
> - for (x = 0; x < categories; x += RTE_ACL_RESULTS_MULTIPLIER) {
> -
> - saved_results = (xmm_t *)(&parms[n].cmplt->results[x]);
> - saved_priority =
> - (xmm_t *)(&parms[n].cmplt->priority[x]);
> -
> - /* get results and priorities for completed trie */
> - results = MM_LOADU((const xmm_t *)&p[transition].results[x]);
> - priority = MM_LOADU((const xmm_t *)&p[transition].priority[x]);
> -
> - /* if this is not the first completed trie */
> - if (parms[n].cmplt->count != ctx->num_tries) {
> -
> - /* get running best results and their priorities */
> - results1 = MM_LOADU(saved_results);
> - priority1 = MM_LOADU(saved_priority);
> -
> - /* select results that are highest priority */
> - selector = MM_CMPGT32(priority1, priority);
> - results = MM_BLENDV8(results, results1, selector);
> - priority = MM_BLENDV8(priority, priority1, selector);
> - }
> -
> - /* save running best results and their priorities */
> - MM_STOREU(saved_results, results);
> - MM_STOREU(saved_priority, priority);
> - }
> -
> - /* Count down completed tries for this search request */
> - parms[n].cmplt->count--;
> -}
> -
> -/*
> - * Routine to fill a slot in the parallel trie traversal array (parms) from
> - * the list of packets (flows).
> - */
> -static inline uint64_t
> -acl_start_next_trie(struct acl_flow_data *flows, struct parms *parms, int n,
> - const struct rte_acl_ctx *ctx)
> -{
> - uint64_t transition;
> -
> - /* if there are any more packets to process */
> - if (flows->num_packets < flows->total_packets) {
> - parms[n].data = flows->data[flows->num_packets];
> - parms[n].data_index = ctx->trie[flows->trie].data_index;
> -
> - /* if this is the first trie for this packet */
> - if (flows->trie == 0) {
> - flows->last_cmplt = alloc_completion(flows->cmplt_array,
> - flows->cmplt_size, ctx->num_tries,
> - flows->results +
> - flows->num_packets * flows->categories);
> - }
> -
> - /* set completion parameters and starting index for this slot */
> - parms[n].cmplt = flows->last_cmplt;
> - transition =
> - flows->trans[parms[n].data[*parms[n].data_index++] +
> - ctx->trie[flows->trie].root_index];
> -
> - /*
> - * if this is the last trie for this packet,
> - * then setup next packet.
> - */
> - flows->trie++;
> - if (flows->trie >= ctx->num_tries) {
> - flows->trie = 0;
> - flows->num_packets++;
> - }
> -
> - /* keep track of number of active trie traversals */
> - flows->started++;
> -
> - /* no more tries to process, set slot to an idle position */
> - } else {
> - transition = ctx->idle;
> - parms[n].data = (const uint8_t *)idle;
> - parms[n].data_index = idle;
> - }
> - return transition;
> -}
> -
> -/*
> - * Detect matches. If a match node transition is found, then this trie
> - * traversal is complete and fill the slot with the next trie
> - * to be processed.
> - */
> -static inline uint64_t
> -acl_match_check_transition(uint64_t transition, int slot,
> - const struct rte_acl_ctx *ctx, struct parms *parms,
> - struct acl_flow_data *flows)
> -{
> - const struct rte_acl_match_results *p;
> -
> - p = (const struct rte_acl_match_results *)
> - (flows->trans + ctx->match_index);
> -
> - if (transition & RTE_ACL_NODE_MATCH) {
> -
> - /* Remove flags from index and decrement active traversals */
> - transition &= RTE_ACL_NODE_INDEX;
> - flows->started--;
> -
> - /* Resolve priorities for this trie and running results */
> - if (flows->categories == 1)
> - resolve_single_priority(transition, slot, ctx,
> - parms, p);
> - else
> - resolve_priority(transition, slot, ctx, parms, p,
> - flows->categories);
> -
> - /* Fill the slot with the next trie or idle trie */
> - transition = acl_start_next_trie(flows, parms, slot, ctx);
> -
> - } else if (transition == ctx->idle) {
> - /* reset indirection table for idle slots */
> - parms[slot].data_index = idle;
> - }
> -
> - return transition;
> -}
> -
> -/*
> - * Extract transitions from an XMM register and check for any matches
> - */
> -static void
> -acl_process_matches(xmm_t *indicies, int slot, const struct rte_acl_ctx *ctx,
> - struct parms *parms, struct acl_flow_data *flows)
> -{
> - uint64_t transition1, transition2;
> -
> - /* extract transition from low 64 bits. */
> - transition1 = MM_CVT64(*indicies);
> -
> - /* extract transition from high 64 bits. */
> - *indicies = MM_SHUFFLE32(*indicies, SHUFFLE32_SWAP64);
> - transition2 = MM_CVT64(*indicies);
> -
> - transition1 = acl_match_check_transition(transition1, slot, ctx,
> - parms, flows);
> - transition2 = acl_match_check_transition(transition2, slot + 1, ctx,
> - parms, flows);
> -
> - /* update indicies with new transitions. */
> - *indicies = MM_SET64(transition2, transition1);
> -}
> -
> -/*
> - * Check for a match in 2 transitions (contained in SSE register)
> - */
> -static inline void
> -acl_match_check_x2(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
> - struct acl_flow_data *flows, xmm_t *indicies, xmm_t match_mask)
> -{
> - xmm_t temp;
> -
> - temp = MM_AND(match_mask, *indicies);
> - while (!MM_TESTZ(temp, temp)) {
> - acl_process_matches(indicies, slot, ctx, parms, flows);
> - temp = MM_AND(match_mask, *indicies);
> - }
> -}
> -
> -/*
> - * Check for any match in 4 transitions (contained in 2 SSE registers)
> - */
> -static inline void
> -acl_match_check_x4(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
> - struct acl_flow_data *flows, xmm_t *indicies1, xmm_t *indicies2,
> - xmm_t match_mask)
> -{
> - xmm_t temp;
> -
> - /* put low 32 bits of each transition into one register */
> - temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
> - 0x88);
> - /* test for match node */
> - temp = MM_AND(match_mask, temp);
> -
> - while (!MM_TESTZ(temp, temp)) {
> - acl_process_matches(indicies1, slot, ctx, parms, flows);
> - acl_process_matches(indicies2, slot + 2, ctx, parms, flows);
> -
> - temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
> - (__m128)*indicies2,
> - 0x88);
> - temp = MM_AND(match_mask, temp);
> - }
> -}
> -
> -/*
> - * Calculate the address of the next transition for
> - * all types of nodes. Note that only DFA nodes and range
> - * nodes actually transition to another node. Match
> - * nodes don't move.
> - */
> -static inline xmm_t
> -acl_calc_addr(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
> - xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
> - xmm_t *indicies1, xmm_t *indicies2)
> -{
> - xmm_t addr, node_types, temp;
> -
> - /*
> - * Note that no transition is done for a match
> - * node and therefore a stream freezes when
> - * it reaches a match.
> - */
> -
> - /* Shuffle low 32 into temp and high 32 into indicies2 */
> - temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
> - 0x88);
> - *indicies2 = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
> - (__m128)*indicies2, 0xdd);
> -
> - /* Calc node type and node addr */
> - node_types = MM_ANDNOT(index_mask, temp);
> - addr = MM_AND(index_mask, temp);
> -
> - /*
> - * Calc addr for DFAs - addr = dfa_index + input_byte
> - */
> -
> - /* mask for DFA type (0) nodes */
> - temp = MM_CMPEQ32(node_types, MM_XOR(node_types, node_types));
> -
> - /* add input byte to DFA position */
> - temp = MM_AND(temp, bytes);
> - temp = MM_AND(temp, next_input);
> - addr = MM_ADD32(addr, temp);
> -
> - /*
> - * Calc addr for Range nodes -> range_index + range(input)
> - */
> - node_types = MM_CMPEQ32(node_types, type_quad_range);
> -
> - /*
> - * Calculate number of range boundaries that are less than the
> - * input value. Range boundaries for each node are in signed 8 bit,
> - * ordered from -128 to 127 in the indicies2 register.
> - * This is effectively a popcnt of bytes that are greater than the
> - * input byte.
> - */
> -
> - /* shuffle input byte to all 4 positions of 32 bit value */
> - temp = MM_SHUFFLE8(next_input, shuffle_input);
> -
> - /* check ranges */
> - temp = MM_CMPGT8(temp, *indicies2);
> -
> - /* convert -1 to 1 (bytes greater than input byte */
> - temp = MM_SIGN8(temp, temp);
> -
> - /* horizontal add pairs of bytes into words */
> - temp = MM_MADD8(temp, temp);
> -
> - /* horizontal add pairs of words into dwords */
> - temp = MM_MADD16(temp, ones_16);
> -
> - /* mask to range type nodes */
> - temp = MM_AND(temp, node_types);
> -
> - /* add index into node position */
> - return MM_ADD32(addr, temp);
> -}
> -
> -/*
> - * Process 4 transitions (in 2 SIMD registers) in parallel
> - */
> -static inline xmm_t
> -transition4(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
> - xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
> - const uint64_t *trans, xmm_t *indicies1, xmm_t *indicies2)
> -{
> - xmm_t addr;
> - uint64_t trans0, trans2;
> -
> - /* Calculate the address (array index) for all 4 transitions. */
> -
> - addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
> - bytes, type_quad_range, indicies1, indicies2);
> -
> - /* Gather 64 bit transitions and pack back into 2 registers. */
> -
> - trans0 = trans[MM_CVT32(addr)];
> -
> - /* get slot 2 */
> -
> - /* {x0, x1, x2, x3} -> {x2, x1, x2, x3} */
> - addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT2);
> - trans2 = trans[MM_CVT32(addr)];
> -
> - /* get slot 1 */
> -
> - /* {x2, x1, x2, x3} -> {x1, x1, x2, x3} */
> - addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
> - *indicies1 = MM_SET64(trans[MM_CVT32(addr)], trans0);
> -
> - /* get slot 3 */
> -
> - /* {x1, x1, x2, x3} -> {x3, x1, x2, x3} */
> - addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT3);
> - *indicies2 = MM_SET64(trans[MM_CVT32(addr)], trans2);
> -
> - return MM_SRL32(next_input, 8);
> -}
> -
> -static inline void
> -acl_set_flow(struct acl_flow_data *flows, struct completion *cmplt,
> - uint32_t cmplt_size, const uint8_t **data, uint32_t *results,
> - uint32_t data_num, uint32_t categories, const uint64_t *trans)
> -{
> - flows->num_packets = 0;
> - flows->started = 0;
> - flows->trie = 0;
> - flows->last_cmplt = NULL;
> - flows->cmplt_array = cmplt;
> - flows->total_packets = data_num;
> - flows->categories = categories;
> - flows->cmplt_size = cmplt_size;
> - flows->data = data;
> - flows->results = results;
> - flows->trans = trans;
> -}
> -
> -/*
> - * Execute trie traversal with 8 traversals in parallel
> - */
> -static inline void
> -search_sse_8(const struct rte_acl_ctx *ctx, const uint8_t **data,
> - uint32_t *results, uint32_t total_packets, uint32_t categories)
> -{
> - int n;
> - struct acl_flow_data flows;
> - uint64_t index_array[MAX_SEARCHES_SSE8];
> - struct completion cmplt[MAX_SEARCHES_SSE8];
> - struct parms parms[MAX_SEARCHES_SSE8];
> - xmm_t input0, input1;
> - xmm_t indicies1, indicies2, indicies3, indicies4;
> -
> - acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
> - total_packets, categories, ctx->trans_table);
> -
> - for (n = 0; n < MAX_SEARCHES_SSE8; n++) {
> - cmplt[n].count = 0;
> - index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
> - }
> -
> - /*
> - * indicies1 contains index_array[0,1]
> - * indicies2 contains index_array[2,3]
> - * indicies3 contains index_array[4,5]
> - * indicies4 contains index_array[6,7]
> - */
> -
> - indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
> - indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
> -
> - indicies3 = MM_LOADU((xmm_t *) &index_array[4]);
> - indicies4 = MM_LOADU((xmm_t *) &index_array[6]);
> -
> - /* Check for any matches. */
> - acl_match_check_x4(0, ctx, parms, &flows,
> - &indicies1, &indicies2, mm_match_mask.m);
> - acl_match_check_x4(4, ctx, parms, &flows,
> - &indicies3, &indicies4, mm_match_mask.m);
> -
> - while (flows.started > 0) {
> -
> - /* Gather 4 bytes of input data for each stream. */
> - input0 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0),
> - 0);
> - input1 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 4),
> - 0);
> -
> - input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 1), 1);
> - input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 5), 1);
> -
> - input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 2), 2);
> - input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 6), 2);
> -
> - input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 3), 3);
> - input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 7), 3);
> -
> - /* Process the 4 bytes of input on each stream. */
> -
> - input0 = transition4(mm_index_mask.m, input0,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies1, &indicies2);
> -
> - input1 = transition4(mm_index_mask.m, input1,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies3, &indicies4);
> -
> - input0 = transition4(mm_index_mask.m, input0,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies1, &indicies2);
> -
> - input1 = transition4(mm_index_mask.m, input1,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies3, &indicies4);
> -
> - input0 = transition4(mm_index_mask.m, input0,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies1, &indicies2);
> -
> - input1 = transition4(mm_index_mask.m, input1,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies3, &indicies4);
> -
> - input0 = transition4(mm_index_mask.m, input0,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies1, &indicies2);
> -
> - input1 = transition4(mm_index_mask.m, input1,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies3, &indicies4);
> -
> - /* Check for any matches. */
> - acl_match_check_x4(0, ctx, parms, &flows,
> - &indicies1, &indicies2, mm_match_mask.m);
> - acl_match_check_x4(4, ctx, parms, &flows,
> - &indicies3, &indicies4, mm_match_mask.m);
> - }
> -}
> -
> -/*
> - * Execute trie traversal with 4 traversals in parallel
> - */
> -static inline void
> -search_sse_4(const struct rte_acl_ctx *ctx, const uint8_t **data,
> - uint32_t *results, int total_packets, uint32_t categories)
> -{
> - int n;
> - struct acl_flow_data flows;
> - uint64_t index_array[MAX_SEARCHES_SSE4];
> - struct completion cmplt[MAX_SEARCHES_SSE4];
> - struct parms parms[MAX_SEARCHES_SSE4];
> - xmm_t input, indicies1, indicies2;
> -
> - acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
> - total_packets, categories, ctx->trans_table);
> -
> - for (n = 0; n < MAX_SEARCHES_SSE4; n++) {
> - cmplt[n].count = 0;
> - index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
> - }
> -
> - indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
> - indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
> -
> - /* Check for any matches. */
> - acl_match_check_x4(0, ctx, parms, &flows,
> - &indicies1, &indicies2, mm_match_mask.m);
> -
> - while (flows.started > 0) {
> -
> - /* Gather 4 bytes of input data for each stream. */
> - input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
> - input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
> - input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 2), 2);
> - input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 3), 3);
> -
> - /* Process the 4 bytes of input on each stream. */
> - input = transition4(mm_index_mask.m, input,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies1, &indicies2);
> -
> - input = transition4(mm_index_mask.m, input,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies1, &indicies2);
> -
> - input = transition4(mm_index_mask.m, input,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies1, &indicies2);
> -
> - input = transition4(mm_index_mask.m, input,
> - mm_shuffle_input.m, mm_ones_16.m,
> - mm_bytes.m, mm_type_quad_range.m,
> - flows.trans, &indicies1, &indicies2);
> -
> - /* Check for any matches. */
> - acl_match_check_x4(0, ctx, parms, &flows,
> - &indicies1, &indicies2, mm_match_mask.m);
> - }
> -}
> -
> -static inline xmm_t
> -transition2(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
> - xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
> - const uint64_t *trans, xmm_t *indicies1)
> -{
> - uint64_t t;
> - xmm_t addr, indicies2;
> -
> - indicies2 = MM_XOR(ones_16, ones_16);
> -
> - addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
> - bytes, type_quad_range, indicies1, &indicies2);
> -
> - /* Gather 64 bit transitions and pack 2 per register. */
> -
> - t = trans[MM_CVT32(addr)];
> -
> - /* get slot 1 */
> - addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
> - *indicies1 = MM_SET64(trans[MM_CVT32(addr)], t);
> -
> - return MM_SRL32(next_input, 8);
> -}
> -
> -/*
> - * Execute trie traversal with 2 traversals in parallel.
> - */
> -static inline void
> -search_sse_2(const struct rte_acl_ctx *ctx, const uint8_t **data,
> - uint32_t *results, uint32_t total_packets, uint32_t categories)
> -{
> - int n;
> - struct acl_flow_data flows;
> - uint64_t index_array[MAX_SEARCHES_SSE2];
> - struct completion cmplt[MAX_SEARCHES_SSE2];
> - struct parms parms[MAX_SEARCHES_SSE2];
> - xmm_t input, indicies;
> -
> - acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
> - total_packets, categories, ctx->trans_table);
> -
> - for (n = 0; n < MAX_SEARCHES_SSE2; n++) {
> - cmplt[n].count = 0;
> - index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
> - }
> -
> - indicies = MM_LOADU((xmm_t *) &index_array[0]);
> -
> - /* Check for any matches. */
> - acl_match_check_x2(0, ctx, parms, &flows, &indicies, mm_match_mask64.m);
> -
> - while (flows.started > 0) {
> -
> - /* Gather 4 bytes of input data for each stream. */
> - input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
> - input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
> -
> - /* Process the 4 bytes of input on each stream. */
> -
> - input = transition2(mm_index_mask64.m, input,
> - mm_shuffle_input64.m, mm_ones_16.m,
> - mm_bytes64.m, mm_type_quad_range64.m,
> - flows.trans, &indicies);
> -
> - input = transition2(mm_index_mask64.m, input,
> - mm_shuffle_input64.m, mm_ones_16.m,
> - mm_bytes64.m, mm_type_quad_range64.m,
> - flows.trans, &indicies);
> -
> - input = transition2(mm_index_mask64.m, input,
> - mm_shuffle_input64.m, mm_ones_16.m,
> - mm_bytes64.m, mm_type_quad_range64.m,
> - flows.trans, &indicies);
> -
> - input = transition2(mm_index_mask64.m, input,
> - mm_shuffle_input64.m, mm_ones_16.m,
> - mm_bytes64.m, mm_type_quad_range64.m,
> - flows.trans, &indicies);
> -
> - /* Check for any matches. */
> - acl_match_check_x2(0, ctx, parms, &flows, &indicies,
> - mm_match_mask64.m);
> - }
> -}
> -
> -/*
> - * When processing the transition, rather than using if/else
> - * construct, the offset is calculated for DFA and QRANGE and
> - * then conditionally added to the address based on node type.
> - * This is done to avoid branch mis-predictions. Since the
> - * offset is rather simple calculation it is more efficient
> - * to do the calculation and do a condition move rather than
> - * a conditional branch to determine which calculation to do.
> - */
> -static inline uint32_t
> -scan_forward(uint32_t input, uint32_t max)
> -{
> - return (input == 0) ? max : rte_bsf32(input);
> -}
> -
> -static inline uint64_t
> -scalar_transition(const uint64_t *trans_table, uint64_t transition,
> - uint8_t input)
> -{
> - uint32_t addr, index, ranges, x, a, b, c;
> -
> - /* break transition into component parts */
> - ranges = transition >> (sizeof(index) * CHAR_BIT);
> -
> - /* calc address for a QRANGE node */
> - c = input * SCALAR_QRANGE_MULT;
> - a = ranges | SCALAR_QRANGE_MIN;
> - index = transition & ~RTE_ACL_NODE_INDEX;
> - a -= (c & SCALAR_QRANGE_MASK);
> - b = c & SCALAR_QRANGE_MIN;
> - addr = transition ^ index;
> - a &= SCALAR_QRANGE_MIN;
> - a ^= (ranges ^ b) & (a ^ b);
> - x = scan_forward(a, 32) >> 3;
> - addr += (index == RTE_ACL_NODE_DFA) ? input : x;
> -
> - /* pickup next transition */
> - transition = *(trans_table + addr);
> - return transition;
> -}
> -
> -int
> -rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> - uint32_t *results, uint32_t num, uint32_t categories)
> -{
> - int n;
> - uint64_t transition0, transition1;
> - uint32_t input0, input1;
> - struct acl_flow_data flows;
> - uint64_t index_array[MAX_SEARCHES_SCALAR];
> - struct completion cmplt[MAX_SEARCHES_SCALAR];
> - struct parms parms[MAX_SEARCHES_SCALAR];
> -
> - if (categories != 1 &&
> - ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
> - return -EINVAL;
> -
> - acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results, num,
> - categories, ctx->trans_table);
> -
> - for (n = 0; n < MAX_SEARCHES_SCALAR; n++) {
> - cmplt[n].count = 0;
> - index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
> - }
> -
> - transition0 = index_array[0];
> - transition1 = index_array[1];
> -
> - while (flows.started > 0) {
> -
> - input0 = GET_NEXT_4BYTES(parms, 0);
> - input1 = GET_NEXT_4BYTES(parms, 1);
> -
> - for (n = 0; n < 4; n++) {
> - if (likely((transition0 & RTE_ACL_NODE_MATCH) == 0))
> - transition0 = scalar_transition(flows.trans,
> - transition0, (uint8_t)input0);
> -
> - input0 >>= CHAR_BIT;
> -
> - if (likely((transition1 & RTE_ACL_NODE_MATCH) == 0))
> - transition1 = scalar_transition(flows.trans,
> - transition1, (uint8_t)input1);
> -
> - input1 >>= CHAR_BIT;
> -
> - }
> - if ((transition0 | transition1) & RTE_ACL_NODE_MATCH) {
> - transition0 = acl_match_check_transition(transition0,
> - 0, ctx, parms, &flows);
> - transition1 = acl_match_check_transition(transition1,
> - 1, ctx, parms, &flows);
> -
> - }
> - }
> - return 0;
> -}
> -
> -int
> -rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> - uint32_t *results, uint32_t num, uint32_t categories)
> -{
> - if (categories != 1 &&
> - ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
> - return -EINVAL;
> -
> - if (likely(num >= MAX_SEARCHES_SSE8))
> - search_sse_8(ctx, data, results, num, categories);
> - else if (num >= MAX_SEARCHES_SSE4)
> - search_sse_4(ctx, data, results, num, categories);
> - else
> - search_sse_2(ctx, data, results, num, categories);
> -
> - return 0;
> -}
> diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h
> new file mode 100644
> index 0000000..c39650e
> --- /dev/null
> +++ b/lib/librte_acl/acl_run.h
> @@ -0,0 +1,220 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#ifndef _ACL_RUN_H_
> +#define _ACL_RUN_H_
> +
> +#include <rte_acl.h>
> +#include "acl_vect.h"
> +#include "acl.h"
> +
> +#define MAX_SEARCHES_SSE8 8
> +#define MAX_SEARCHES_SSE4 4
> +#define MAX_SEARCHES_SSE2 2
> +#define MAX_SEARCHES_SCALAR 2
> +
> +#define GET_NEXT_4BYTES(prm, idx) \
> + (*((const int32_t *)((prm)[(idx)].data + *(prm)[idx].data_index++)))
> +
> +
> +#define RTE_ACL_NODE_INDEX ((uint32_t)~RTE_ACL_NODE_TYPE)
> +
> +#define SCALAR_QRANGE_MULT 0x01010101
> +#define SCALAR_QRANGE_MASK 0x7f7f7f7f
> +#define SCALAR_QRANGE_MIN 0x80808080
> +
> +/*
> + * Structure to manage N parallel trie traversals.
> + * The runtime trie traversal routines can process 8, 4, or 2 tries
> + * in parallel. Each packet may require multiple trie traversals (up to 4).
> + * This structure is used to fill the slots (0 to n-1) for parallel processing
> + * with the trie traversals needed for each packet.
> + */
> +struct acl_flow_data {
> + uint32_t num_packets;
> + /* number of packets processed */
> + uint32_t started;
> + /* number of trie traversals in progress */
> + uint32_t trie;
> + /* current trie index (0 to N-1) */
> + uint32_t cmplt_size;
> + uint32_t total_packets;
> + uint32_t categories;
> + /* number of result categories per packet. */
> + /* maximum number of packets to process */
> + const uint64_t *trans;
> + const uint8_t **data;
> + uint32_t *results;
> + struct completion *last_cmplt;
> + struct completion *cmplt_array;
> +};
> +
> +/*
> + * Structure to maintain running results for
> + * a single packet (up to 4 tries).
> + */
> +struct completion {
> + uint32_t *results; /* running results. */
> + int32_t priority[RTE_ACL_MAX_CATEGORIES]; /* running priorities. */
> + uint32_t count; /* num of remaining tries */
> + /* true for allocated struct */
> +} __attribute__((aligned(XMM_SIZE)));
> +
> +/*
> + * One parms structure for each slot in the search engine.
> + */
> +struct parms {
> + const uint8_t *data;
> + /* input data for this packet */
> + const uint32_t *data_index;
> + /* data indirection for this trie */
> + struct completion *cmplt;
> + /* completion data for this packet */
> +};
> +
> +/*
> + * Define an global idle node for unused engine slots
> + */
> +static const uint32_t idle[UINT8_MAX + 1];
> +
> +/*
> + * Allocate a completion structure to manage the tries for a packet.
> + */
> +static inline struct completion *
> +alloc_completion(struct completion *p, uint32_t size, uint32_t tries,
> + uint32_t *results)
> +{
> + uint32_t n;
> +
> + for (n = 0; n < size; n++) {
> +
> + if (p[n].count == 0) {
> +
> + /* mark as allocated and set number of tries. */
> + p[n].count = tries;
> + p[n].results = results;
> + return &(p[n]);
> + }
> + }
> +
> + /* should never get here */
> + return NULL;
> +}
> +
> +/*
> + * Resolve priority for a single result trie.
> + */
> +static inline void
> +resolve_single_priority(uint64_t transition, int n,
> + const struct rte_acl_ctx *ctx, struct parms *parms,
> + const struct rte_acl_match_results *p)
> +{
> + if (parms[n].cmplt->count == ctx->num_tries ||
> + parms[n].cmplt->priority[0] <=
> + p[transition].priority[0]) {
> +
> + parms[n].cmplt->priority[0] = p[transition].priority[0];
> + parms[n].cmplt->results[0] = p[transition].results[0];
> + }
> +}
> +
> +/*
> + * Routine to fill a slot in the parallel trie traversal array (parms) from
> + * the list of packets (flows).
> + */
> +static inline uint64_t
> +acl_start_next_trie(struct acl_flow_data *flows, struct parms *parms, int n,
> + const struct rte_acl_ctx *ctx)
> +{
> + uint64_t transition;
> +
> + /* if there are any more packets to process */
> + if (flows->num_packets < flows->total_packets) {
> + parms[n].data = flows->data[flows->num_packets];
> + parms[n].data_index = ctx->trie[flows->trie].data_index;
> +
> + /* if this is the first trie for this packet */
> + if (flows->trie == 0) {
> + flows->last_cmplt = alloc_completion(flows->cmplt_array,
> + flows->cmplt_size, ctx->num_tries,
> + flows->results +
> + flows->num_packets * flows->categories);
> + }
> +
> + /* set completion parameters and starting index for this slot */
> + parms[n].cmplt = flows->last_cmplt;
> + transition =
> + flows->trans[parms[n].data[*parms[n].data_index++] +
> + ctx->trie[flows->trie].root_index];
> +
> + /*
> + * if this is the last trie for this packet,
> + * then setup next packet.
> + */
> + flows->trie++;
> + if (flows->trie >= ctx->num_tries) {
> + flows->trie = 0;
> + flows->num_packets++;
> + }
> +
> + /* keep track of number of active trie traversals */
> + flows->started++;
> +
> + /* no more tries to process, set slot to an idle position */
> + } else {
> + transition = ctx->idle;
> + parms[n].data = (const uint8_t *)idle;
> + parms[n].data_index = idle;
> + }
> + return transition;
> +}
> +
> +static inline void
> +acl_set_flow(struct acl_flow_data *flows, struct completion *cmplt,
> + uint32_t cmplt_size, const uint8_t **data, uint32_t *results,
> + uint32_t data_num, uint32_t categories, const uint64_t *trans)
> +{
> + flows->num_packets = 0;
> + flows->started = 0;
> + flows->trie = 0;
> + flows->last_cmplt = NULL;
> + flows->cmplt_array = cmplt;
> + flows->total_packets = data_num;
> + flows->categories = categories;
> + flows->cmplt_size = cmplt_size;
> + flows->data = data;
> + flows->results = results;
> + flows->trans = trans;
> +}
> +
> +#endif /* _ACL_RUN_H_ */
> diff --git a/lib/librte_acl/acl_run_scalar.c b/lib/librte_acl/acl_run_scalar.c
> new file mode 100644
> index 0000000..a59ff17
> --- /dev/null
> +++ b/lib/librte_acl/acl_run_scalar.c
> @@ -0,0 +1,198 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#include "acl_run.h"
> +#include "acl_match_check.h"
> +
> +int
> +rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t num, uint32_t categories);
> +
> +/*
> + * Resolve priority for multiple results (scalar version).
> + * This consists comparing the priority of the current traversal with the
> + * running set of results for the packet.
> + * For each result, keep a running array of the result (rule number) and
> + * its priority for each category.
> + */
> +static inline void
> +resolve_priority_scalar(uint64_t transition, int n,
> + const struct rte_acl_ctx *ctx, struct parms *parms,
> + const struct rte_acl_match_results *p, uint32_t categories)
> +{
> + uint32_t i;
> + int32_t *saved_priority;
> + uint32_t *saved_results;
> + const int32_t *priority;
> + const uint32_t *results;
> +
> + saved_results = parms[n].cmplt->results;
> + saved_priority = parms[n].cmplt->priority;
> +
> + /* results and priorities for completed trie */
> + results = p[transition].results;
> + priority = p[transition].priority;
> +
> + /* if this is not the first completed trie */
> + if (parms[n].cmplt->count != ctx->num_tries) {
> + for (i = 0; i < categories; i += RTE_ACL_RESULTS_MULTIPLIER) {
> +
> + if (saved_priority[i] <= priority[i]) {
> + saved_priority[i] = priority[i];
> + saved_results[i] = results[i];
> + }
> + if (saved_priority[i + 1] <= priority[i + 1]) {
> + saved_priority[i + 1] = priority[i + 1];
> + saved_results[i + 1] = results[i + 1];
> + }
> + if (saved_priority[i + 2] <= priority[i + 2]) {
> + saved_priority[i + 2] = priority[i + 2];
> + saved_results[i + 2] = results[i + 2];
> + }
> + if (saved_priority[i + 3] <= priority[i + 3]) {
> + saved_priority[i + 3] = priority[i + 3];
> + saved_results[i + 3] = results[i + 3];
> + }
> + }
> + } else {
> + for (i = 0; i < categories; i += RTE_ACL_RESULTS_MULTIPLIER) {
> + saved_priority[i] = priority[i];
> + saved_priority[i + 1] = priority[i + 1];
> + saved_priority[i + 2] = priority[i + 2];
> + saved_priority[i + 3] = priority[i + 3];
> +
> + saved_results[i] = results[i];
> + saved_results[i + 1] = results[i + 1];
> + saved_results[i + 2] = results[i + 2];
> + saved_results[i + 3] = results[i + 3];
> + }
> + }
> +}
> +
> +/*
> + * When processing the transition, rather than using if/else
> + * construct, the offset is calculated for DFA and QRANGE and
> + * then conditionally added to the address based on node type.
> + * This is done to avoid branch mis-predictions. Since the
> + * offset is rather simple calculation it is more efficient
> + * to do the calculation and do a condition move rather than
> + * a conditional branch to determine which calculation to do.
> + */
> +static inline uint32_t
> +scan_forward(uint32_t input, uint32_t max)
> +{
> + return (input == 0) ? max : rte_bsf32(input);
> +}
> +
> +static inline uint64_t
> +scalar_transition(const uint64_t *trans_table, uint64_t transition,
> + uint8_t input)
> +{
> + uint32_t addr, index, ranges, x, a, b, c;
> +
> + /* break transition into component parts */
> + ranges = transition >> (sizeof(index) * CHAR_BIT);
> +
> + /* calc address for a QRANGE node */
> + c = input * SCALAR_QRANGE_MULT;
> + a = ranges | SCALAR_QRANGE_MIN;
> + index = transition & ~RTE_ACL_NODE_INDEX;
> + a -= (c & SCALAR_QRANGE_MASK);
> + b = c & SCALAR_QRANGE_MIN;
> + addr = transition ^ index;
> + a &= SCALAR_QRANGE_MIN;
> + a ^= (ranges ^ b) & (a ^ b);
> + x = scan_forward(a, 32) >> 3;
> + addr += (index == RTE_ACL_NODE_DFA) ? input : x;
> +
> + /* pickup next transition */
> + transition = *(trans_table + addr);
> + return transition;
> +}
> +
> +int
> +rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t num, uint32_t categories)
> +{
> + int n;
> + uint64_t transition0, transition1;
> + uint32_t input0, input1;
> + struct acl_flow_data flows;
> + uint64_t index_array[MAX_SEARCHES_SCALAR];
> + struct completion cmplt[MAX_SEARCHES_SCALAR];
> + struct parms parms[MAX_SEARCHES_SCALAR];
> +
> + if (categories != 1 &&
> + ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
> + return -EINVAL;
> +
> + acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results, num,
> + categories, ctx->trans_table);
> +
> + for (n = 0; n < MAX_SEARCHES_SCALAR; n++) {
> + cmplt[n].count = 0;
> + index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
> + }
> +
> + transition0 = index_array[0];
> + transition1 = index_array[1];
> +
> + while (flows.started > 0) {
> +
> + input0 = GET_NEXT_4BYTES(parms, 0);
> + input1 = GET_NEXT_4BYTES(parms, 1);
> +
> + for (n = 0; n < 4; n++) {
> + if (likely((transition0 & RTE_ACL_NODE_MATCH) == 0))
> + transition0 = scalar_transition(flows.trans,
> + transition0, (uint8_t)input0);
> +
> + input0 >>= CHAR_BIT;
> +
> + if (likely((transition1 & RTE_ACL_NODE_MATCH) == 0))
> + transition1 = scalar_transition(flows.trans,
> + transition1, (uint8_t)input1);
> +
> + input1 >>= CHAR_BIT;
> +
> + }
> + if ((transition0 | transition1) & RTE_ACL_NODE_MATCH) {
> + transition0 = acl_match_check(transition0,
> + 0, ctx, parms, &flows, resolve_priority_scalar);
> + transition1 = acl_match_check(transition1,
> + 1, ctx, parms, &flows, resolve_priority_scalar);
> +
> + }
> + }
> + return 0;
> +}
> diff --git a/lib/librte_acl/acl_run_sse.c b/lib/librte_acl/acl_run_sse.c
> new file mode 100644
> index 0000000..3f5c721
> --- /dev/null
> +++ b/lib/librte_acl/acl_run_sse.c
> @@ -0,0 +1,627 @@
> +/*-
> + * BSD LICENSE
> + *
> + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + *
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * 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.
> + * * Neither the name of Intel Corporation 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
> + * OWNER 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.
> + */
> +
> +#include "acl_run.h"
> +#include "acl_match_check.h"
> +
> +enum {
> + SHUFFLE32_SLOT1 = 0xe5,
> + SHUFFLE32_SLOT2 = 0xe6,
> + SHUFFLE32_SLOT3 = 0xe7,
> + SHUFFLE32_SWAP64 = 0x4e,
> +};
> +
> +static const rte_xmm_t mm_type_quad_range = {
> + .u32 = {
> + RTE_ACL_NODE_QRANGE,
> + RTE_ACL_NODE_QRANGE,
> + RTE_ACL_NODE_QRANGE,
> + RTE_ACL_NODE_QRANGE,
> + },
> +};
> +
> +static const rte_xmm_t mm_type_quad_range64 = {
> + .u32 = {
> + RTE_ACL_NODE_QRANGE,
> + RTE_ACL_NODE_QRANGE,
> + 0,
> + 0,
> + },
> +};
> +
> +static const rte_xmm_t mm_shuffle_input = {
> + .u32 = {0x00000000, 0x04040404, 0x08080808, 0x0c0c0c0c},
> +};
> +
> +static const rte_xmm_t mm_shuffle_input64 = {
> + .u32 = {0x00000000, 0x04040404, 0x80808080, 0x80808080},
> +};
> +
> +static const rte_xmm_t mm_ones_16 = {
> + .u16 = {1, 1, 1, 1, 1, 1, 1, 1},
> +};
> +
> +static const rte_xmm_t mm_bytes = {
> + .u32 = {UINT8_MAX, UINT8_MAX, UINT8_MAX, UINT8_MAX},
> +};
> +
> +static const rte_xmm_t mm_bytes64 = {
> + .u32 = {UINT8_MAX, UINT8_MAX, 0, 0},
> +};
> +
> +static const rte_xmm_t mm_match_mask = {
> + .u32 = {
> + RTE_ACL_NODE_MATCH,
> + RTE_ACL_NODE_MATCH,
> + RTE_ACL_NODE_MATCH,
> + RTE_ACL_NODE_MATCH,
> + },
> +};
> +
> +static const rte_xmm_t mm_match_mask64 = {
> + .u32 = {
> + RTE_ACL_NODE_MATCH,
> + 0,
> + RTE_ACL_NODE_MATCH,
> + 0,
> + },
> +};
> +
> +static const rte_xmm_t mm_index_mask = {
> + .u32 = {
> + RTE_ACL_NODE_INDEX,
> + RTE_ACL_NODE_INDEX,
> + RTE_ACL_NODE_INDEX,
> + RTE_ACL_NODE_INDEX,
> + },
> +};
> +
> +static const rte_xmm_t mm_index_mask64 = {
> + .u32 = {
> + RTE_ACL_NODE_INDEX,
> + RTE_ACL_NODE_INDEX,
> + 0,
> + 0,
> + },
> +};
> +
> +
> +/*
> + * Resolve priority for multiple results (sse version).
> + * This consists comparing the priority of the current traversal with the
> + * running set of results for the packet.
> + * For each result, keep a running array of the result (rule number) and
> + * its priority for each category.
> + */
> +static inline void
> +resolve_priority_sse(uint64_t transition, int n, const struct rte_acl_ctx *ctx,
> + struct parms *parms, const struct rte_acl_match_results *p,
> + uint32_t categories)
> +{
> + uint32_t x;
> + xmm_t results, priority, results1, priority1, selector;
> + xmm_t *saved_results, *saved_priority;
> +
> + for (x = 0; x < categories; x += RTE_ACL_RESULTS_MULTIPLIER) {
> +
> + saved_results = (xmm_t *)(&parms[n].cmplt->results[x]);
> + saved_priority =
> + (xmm_t *)(&parms[n].cmplt->priority[x]);
> +
> + /* get results and priorities for completed trie */
> + results = MM_LOADU((const xmm_t *)&p[transition].results[x]);
> + priority = MM_LOADU((const xmm_t *)&p[transition].priority[x]);
> +
> + /* if this is not the first completed trie */
> + if (parms[n].cmplt->count != ctx->num_tries) {
> +
> + /* get running best results and their priorities */
> + results1 = MM_LOADU(saved_results);
> + priority1 = MM_LOADU(saved_priority);
> +
> + /* select results that are highest priority */
> + selector = MM_CMPGT32(priority1, priority);
> + results = MM_BLENDV8(results, results1, selector);
> + priority = MM_BLENDV8(priority, priority1, selector);
> + }
> +
> + /* save running best results and their priorities */
> + MM_STOREU(saved_results, results);
> + MM_STOREU(saved_priority, priority);
> + }
> +}
> +
> +/*
> + * Extract transitions from an XMM register and check for any matches
> + */
> +static void
> +acl_process_matches(xmm_t *indicies, int slot, const struct rte_acl_ctx *ctx,
> + struct parms *parms, struct acl_flow_data *flows)
> +{
> + uint64_t transition1, transition2;
> +
> + /* extract transition from low 64 bits. */
> + transition1 = MM_CVT64(*indicies);
> +
> + /* extract transition from high 64 bits. */
> + *indicies = MM_SHUFFLE32(*indicies, SHUFFLE32_SWAP64);
> + transition2 = MM_CVT64(*indicies);
> +
> + transition1 = acl_match_check(transition1, slot, ctx,
> + parms, flows, resolve_priority_sse);
> + transition2 = acl_match_check(transition2, slot + 1, ctx,
> + parms, flows, resolve_priority_sse);
> +
> + /* update indicies with new transitions. */
> + *indicies = MM_SET64(transition2, transition1);
> +}
> +
> +/*
> + * Check for a match in 2 transitions (contained in SSE register)
> + */
> +static inline void
> +acl_match_check_x2(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
> + struct acl_flow_data *flows, xmm_t *indicies, xmm_t match_mask)
> +{
> + xmm_t temp;
> +
> + temp = MM_AND(match_mask, *indicies);
> + while (!MM_TESTZ(temp, temp)) {
> + acl_process_matches(indicies, slot, ctx, parms, flows);
> + temp = MM_AND(match_mask, *indicies);
> + }
> +}
> +
> +/*
> + * Check for any match in 4 transitions (contained in 2 SSE registers)
> + */
> +static inline void
> +acl_match_check_x4(int slot, const struct rte_acl_ctx *ctx, struct parms *parms,
> + struct acl_flow_data *flows, xmm_t *indicies1, xmm_t *indicies2,
> + xmm_t match_mask)
> +{
> + xmm_t temp;
> +
> + /* put low 32 bits of each transition into one register */
> + temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
> + 0x88);
> + /* test for match node */
> + temp = MM_AND(match_mask, temp);
> +
> + while (!MM_TESTZ(temp, temp)) {
> + acl_process_matches(indicies1, slot, ctx, parms, flows);
> + acl_process_matches(indicies2, slot + 2, ctx, parms, flows);
> +
> + temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
> + (__m128)*indicies2,
> + 0x88);
> + temp = MM_AND(match_mask, temp);
> + }
> +}
> +
> +/*
> + * Calculate the address of the next transition for
> + * all types of nodes. Note that only DFA nodes and range
> + * nodes actually transition to another node. Match
> + * nodes don't move.
> + */
> +static inline xmm_t
> +acl_calc_addr(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
> + xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
> + xmm_t *indicies1, xmm_t *indicies2)
> +{
> + xmm_t addr, node_types, temp;
> +
> + /*
> + * Note that no transition is done for a match
> + * node and therefore a stream freezes when
> + * it reaches a match.
> + */
> +
> + /* Shuffle low 32 into temp and high 32 into indicies2 */
> + temp = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1, (__m128)*indicies2,
> + 0x88);
> + *indicies2 = (xmm_t)MM_SHUFFLEPS((__m128)*indicies1,
> + (__m128)*indicies2, 0xdd);
> +
> + /* Calc node type and node addr */
> + node_types = MM_ANDNOT(index_mask, temp);
> + addr = MM_AND(index_mask, temp);
> +
> + /*
> + * Calc addr for DFAs - addr = dfa_index + input_byte
> + */
> +
> + /* mask for DFA type (0) nodes */
> + temp = MM_CMPEQ32(node_types, MM_XOR(node_types, node_types));
> +
> + /* add input byte to DFA position */
> + temp = MM_AND(temp, bytes);
> + temp = MM_AND(temp, next_input);
> + addr = MM_ADD32(addr, temp);
> +
> + /*
> + * Calc addr for Range nodes -> range_index + range(input)
> + */
> + node_types = MM_CMPEQ32(node_types, type_quad_range);
> +
> + /*
> + * Calculate number of range boundaries that are less than the
> + * input value. Range boundaries for each node are in signed 8 bit,
> + * ordered from -128 to 127 in the indicies2 register.
> + * This is effectively a popcnt of bytes that are greater than the
> + * input byte.
> + */
> +
> + /* shuffle input byte to all 4 positions of 32 bit value */
> + temp = MM_SHUFFLE8(next_input, shuffle_input);
> +
> + /* check ranges */
> + temp = MM_CMPGT8(temp, *indicies2);
> +
> + /* convert -1 to 1 (bytes greater than input byte */
> + temp = MM_SIGN8(temp, temp);
> +
> + /* horizontal add pairs of bytes into words */
> + temp = MM_MADD8(temp, temp);
> +
> + /* horizontal add pairs of words into dwords */
> + temp = MM_MADD16(temp, ones_16);
> +
> + /* mask to range type nodes */
> + temp = MM_AND(temp, node_types);
> +
> + /* add index into node position */
> + return MM_ADD32(addr, temp);
> +}
> +
> +/*
> + * Process 4 transitions (in 2 SIMD registers) in parallel
> + */
> +static inline xmm_t
> +transition4(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
> + xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
> + const uint64_t *trans, xmm_t *indicies1, xmm_t *indicies2)
> +{
> + xmm_t addr;
> + uint64_t trans0, trans2;
> +
> + /* Calculate the address (array index) for all 4 transitions. */
> +
> + addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
> + bytes, type_quad_range, indicies1, indicies2);
> +
> + /* Gather 64 bit transitions and pack back into 2 registers. */
> +
> + trans0 = trans[MM_CVT32(addr)];
> +
> + /* get slot 2 */
> +
> + /* {x0, x1, x2, x3} -> {x2, x1, x2, x3} */
> + addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT2);
> + trans2 = trans[MM_CVT32(addr)];
> +
> + /* get slot 1 */
> +
> + /* {x2, x1, x2, x3} -> {x1, x1, x2, x3} */
> + addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
> + *indicies1 = MM_SET64(trans[MM_CVT32(addr)], trans0);
> +
> + /* get slot 3 */
> +
> + /* {x1, x1, x2, x3} -> {x3, x1, x2, x3} */
> + addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT3);
> + *indicies2 = MM_SET64(trans[MM_CVT32(addr)], trans2);
> +
> + return MM_SRL32(next_input, 8);
> +}
> +
> +/*
> + * Execute trie traversal with 8 traversals in parallel
> + */
> +static inline int
> +search_sse_8(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t total_packets, uint32_t categories)
> +{
> + int n;
> + struct acl_flow_data flows;
> + uint64_t index_array[MAX_SEARCHES_SSE8];
> + struct completion cmplt[MAX_SEARCHES_SSE8];
> + struct parms parms[MAX_SEARCHES_SSE8];
> + xmm_t input0, input1;
> + xmm_t indicies1, indicies2, indicies3, indicies4;
> +
> + acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
> + total_packets, categories, ctx->trans_table);
> +
> + for (n = 0; n < MAX_SEARCHES_SSE8; n++) {
> + cmplt[n].count = 0;
> + index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
> + }
> +
> + /*
> + * indicies1 contains index_array[0,1]
> + * indicies2 contains index_array[2,3]
> + * indicies3 contains index_array[4,5]
> + * indicies4 contains index_array[6,7]
> + */
> +
> + indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
> + indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
> +
> + indicies3 = MM_LOADU((xmm_t *) &index_array[4]);
> + indicies4 = MM_LOADU((xmm_t *) &index_array[6]);
> +
> + /* Check for any matches. */
> + acl_match_check_x4(0, ctx, parms, &flows,
> + &indicies1, &indicies2, mm_match_mask.m);
> + acl_match_check_x4(4, ctx, parms, &flows,
> + &indicies3, &indicies4, mm_match_mask.m);
> +
> + while (flows.started > 0) {
> +
> + /* Gather 4 bytes of input data for each stream. */
> + input0 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0),
> + 0);
> + input1 = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 4),
> + 0);
> +
> + input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 1), 1);
> + input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 5), 1);
> +
> + input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 2), 2);
> + input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 6), 2);
> +
> + input0 = MM_INSERT32(input0, GET_NEXT_4BYTES(parms, 3), 3);
> + input1 = MM_INSERT32(input1, GET_NEXT_4BYTES(parms, 7), 3);
> +
> + /* Process the 4 bytes of input on each stream. */
> +
> + input0 = transition4(mm_index_mask.m, input0,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies1, &indicies2);
> +
> + input1 = transition4(mm_index_mask.m, input1,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies3, &indicies4);
> +
> + input0 = transition4(mm_index_mask.m, input0,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies1, &indicies2);
> +
> + input1 = transition4(mm_index_mask.m, input1,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies3, &indicies4);
> +
> + input0 = transition4(mm_index_mask.m, input0,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies1, &indicies2);
> +
> + input1 = transition4(mm_index_mask.m, input1,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies3, &indicies4);
> +
> + input0 = transition4(mm_index_mask.m, input0,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies1, &indicies2);
> +
> + input1 = transition4(mm_index_mask.m, input1,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies3, &indicies4);
> +
> + /* Check for any matches. */
> + acl_match_check_x4(0, ctx, parms, &flows,
> + &indicies1, &indicies2, mm_match_mask.m);
> + acl_match_check_x4(4, ctx, parms, &flows,
> + &indicies3, &indicies4, mm_match_mask.m);
> + }
> +
> + return 0;
> +}
> +
> +/*
> + * Execute trie traversal with 4 traversals in parallel
> + */
> +static inline int
> +search_sse_4(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, int total_packets, uint32_t categories)
> +{
> + int n;
> + struct acl_flow_data flows;
> + uint64_t index_array[MAX_SEARCHES_SSE4];
> + struct completion cmplt[MAX_SEARCHES_SSE4];
> + struct parms parms[MAX_SEARCHES_SSE4];
> + xmm_t input, indicies1, indicies2;
> +
> + acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
> + total_packets, categories, ctx->trans_table);
> +
> + for (n = 0; n < MAX_SEARCHES_SSE4; n++) {
> + cmplt[n].count = 0;
> + index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
> + }
> +
> + indicies1 = MM_LOADU((xmm_t *) &index_array[0]);
> + indicies2 = MM_LOADU((xmm_t *) &index_array[2]);
> +
> + /* Check for any matches. */
> + acl_match_check_x4(0, ctx, parms, &flows,
> + &indicies1, &indicies2, mm_match_mask.m);
> +
> + while (flows.started > 0) {
> +
> + /* Gather 4 bytes of input data for each stream. */
> + input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
> + input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
> + input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 2), 2);
> + input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 3), 3);
> +
> + /* Process the 4 bytes of input on each stream. */
> + input = transition4(mm_index_mask.m, input,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies1, &indicies2);
> +
> + input = transition4(mm_index_mask.m, input,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies1, &indicies2);
> +
> + input = transition4(mm_index_mask.m, input,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies1, &indicies2);
> +
> + input = transition4(mm_index_mask.m, input,
> + mm_shuffle_input.m, mm_ones_16.m,
> + mm_bytes.m, mm_type_quad_range.m,
> + flows.trans, &indicies1, &indicies2);
> +
> + /* Check for any matches. */
> + acl_match_check_x4(0, ctx, parms, &flows,
> + &indicies1, &indicies2, mm_match_mask.m);
> + }
> +
> + return 0;
> +}
> +
> +static inline xmm_t
> +transition2(xmm_t index_mask, xmm_t next_input, xmm_t shuffle_input,
> + xmm_t ones_16, xmm_t bytes, xmm_t type_quad_range,
> + const uint64_t *trans, xmm_t *indicies1)
> +{
> + uint64_t t;
> + xmm_t addr, indicies2;
> +
> + indicies2 = MM_XOR(ones_16, ones_16);
> +
> + addr = acl_calc_addr(index_mask, next_input, shuffle_input, ones_16,
> + bytes, type_quad_range, indicies1, &indicies2);
> +
> + /* Gather 64 bit transitions and pack 2 per register. */
> +
> + t = trans[MM_CVT32(addr)];
> +
> + /* get slot 1 */
> + addr = MM_SHUFFLE32(addr, SHUFFLE32_SLOT1);
> + *indicies1 = MM_SET64(trans[MM_CVT32(addr)], t);
> +
> + return MM_SRL32(next_input, 8);
> +}
> +
> +/*
> + * Execute trie traversal with 2 traversals in parallel.
> + */
> +static inline int
> +search_sse_2(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t total_packets, uint32_t categories)
> +{
> + int n;
> + struct acl_flow_data flows;
> + uint64_t index_array[MAX_SEARCHES_SSE2];
> + struct completion cmplt[MAX_SEARCHES_SSE2];
> + struct parms parms[MAX_SEARCHES_SSE2];
> + xmm_t input, indicies;
> +
> + acl_set_flow(&flows, cmplt, RTE_DIM(cmplt), data, results,
> + total_packets, categories, ctx->trans_table);
> +
> + for (n = 0; n < MAX_SEARCHES_SSE2; n++) {
> + cmplt[n].count = 0;
> + index_array[n] = acl_start_next_trie(&flows, parms, n, ctx);
> + }
> +
> + indicies = MM_LOADU((xmm_t *) &index_array[0]);
> +
> + /* Check for any matches. */
> + acl_match_check_x2(0, ctx, parms, &flows, &indicies, mm_match_mask64.m);
> +
> + while (flows.started > 0) {
> +
> + /* Gather 4 bytes of input data for each stream. */
> + input = MM_INSERT32(mm_ones_16.m, GET_NEXT_4BYTES(parms, 0), 0);
> + input = MM_INSERT32(input, GET_NEXT_4BYTES(parms, 1), 1);
> +
> + /* Process the 4 bytes of input on each stream. */
> +
> + input = transition2(mm_index_mask64.m, input,
> + mm_shuffle_input64.m, mm_ones_16.m,
> + mm_bytes64.m, mm_type_quad_range64.m,
> + flows.trans, &indicies);
> +
> + input = transition2(mm_index_mask64.m, input,
> + mm_shuffle_input64.m, mm_ones_16.m,
> + mm_bytes64.m, mm_type_quad_range64.m,
> + flows.trans, &indicies);
> +
> + input = transition2(mm_index_mask64.m, input,
> + mm_shuffle_input64.m, mm_ones_16.m,
> + mm_bytes64.m, mm_type_quad_range64.m,
> + flows.trans, &indicies);
> +
> + input = transition2(mm_index_mask64.m, input,
> + mm_shuffle_input64.m, mm_ones_16.m,
> + mm_bytes64.m, mm_type_quad_range64.m,
> + flows.trans, &indicies);
> +
> + /* Check for any matches. */
> + acl_match_check_x2(0, ctx, parms, &flows, &indicies,
> + mm_match_mask64.m);
> + }
> +
> + return 0;
> +}
> +
> +int
> +rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t num, uint32_t categories)
> +{
> + if (categories != 1 &&
> + ((RTE_ACL_RESULTS_MULTIPLIER - 1) & categories) != 0)
> + return -EINVAL;
> +
> + if (likely(num >= MAX_SEARCHES_SSE8))
> + return search_sse_8(ctx, data, results, num, categories);
> + else if (num >= MAX_SEARCHES_SSE4)
> + return search_sse_4(ctx, data, results, num, categories);
> + else
> + return search_sse_2(ctx, data, results, num, categories);
> +}
> diff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c
> index 7c288bd..b9173c1 100644
> --- a/lib/librte_acl/rte_acl.c
> +++ b/lib/librte_acl/rte_acl.c
> @@ -38,6 +38,52 @@
>
> TAILQ_HEAD(rte_acl_list, rte_tailq_entry);
>
> +typedef int (*rte_acl_classify_t)
> +(const struct rte_acl_ctx *, const uint8_t **, uint32_t *, uint32_t, uint32_t);
> +
> +extern int
> +rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> + uint32_t *results, uint32_t num, uint32_t categories);
> +
> +/* by default, use always avaialbe scalar code path. */
> +rte_acl_classify_t rte_acl_default_classify = rte_acl_classify_scalar;
Why not 'static'?
I thought you'd like to hide it from external world.
> +
> +void rte_acl_select_classify(enum acl_classify_alg alg)
> +{
> +
> + switch(alg)
> + {
> + case ACL_CLASSIFY_DEFAULT:
> + case ACL_CLASSIFY_SCALAR:
> + rte_acl_default_classify = rte_acl_classify_scalar;
> + break;
> + case ACL_CLASSIFY_SSE:
> + rte_acl_default_classify = rte_acl_classify_sse;
> + break;
> + }
> +
> +}
As this is init phase function, I suppose we can add check that alg has a valid(supported) value, and return some error as return value, if not.
> +
> +static void __attribute__((constructor))
> +rte_acl_init(void)
> +{
> + enum acl_classify_alg alg = ACL_CLASSIFY_DEFAULT;
> +
> + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
> + alg = ACL_CLASSIFY_SSE;
> +
> + rte_acl_select_classify(alg);
> +}
> +
> +inline int rte_acl_classify(const struct rte_acl_ctx *ctx,
> + const uint8_t **data,
> + uint32_t *results, uint32_t num,
> + uint32_t categories)
> +{
> + return rte_acl_default_classify(ctx, data, results, num, categories);
> +}
> +
> +
> struct rte_acl_ctx *
> rte_acl_find_existing(const char *name)
> {
> diff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h
> index afc0f69..650b306 100644
> --- a/lib/librte_acl/rte_acl.h
> +++ b/lib/librte_acl/rte_acl.h
> @@ -267,6 +267,9 @@ rte_acl_reset(struct rte_acl_ctx *ctx);
> * RTE_ACL_RESULTS_MULTIPLIER and can't be bigger than RTE_ACL_MAX_CATEGORIES.
> * If more than one rule is applicable for given input buffer and
> * given category, then rule with highest priority will be returned as a match.
> + * Note, that this function could be run only on CPUs with SSE4.1 support.
> + * It is up to the caller to make sure that this function is only invoked on
> + * a machine that supports SSE4.1 ISA.
> * Note, that it is a caller responsibility to ensure that input parameters
> * are valid and point to correct memory locations.
> *
> @@ -286,9 +289,10 @@ rte_acl_reset(struct rte_acl_ctx *ctx);
> * @return
> * zero on successful completion.
> * -EINVAL for incorrect arguments.
> + * -ENOTSUP for unsupported platforms.
Please remove the line above: current implementation doesn't return ENOTSUP
(I think that was left from v1).
> */
> int
> -rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> +rte_acl_classify_sse(const struct rte_acl_ctx *ctx, const uint8_t **data,
> uint32_t *results, uint32_t num, uint32_t categories);
>
> /**
> @@ -323,9 +327,23 @@ rte_acl_classify(const struct rte_acl_ctx *ctx, const uint8_t **data,
> * zero on successful completion.
> * -EINVAL for incorrect arguments.
> */
> -int
> -rte_acl_classify_scalar(const struct rte_acl_ctx *ctx, const uint8_t **data,
> - uint32_t *results, uint32_t num, uint32_t categories);
As I said above we'd better keep it.
> +
> +enum acl_classify_alg {
> + ACL_CLASSIFY_DEFAULT = 0,
> + ACL_CLASSIFY_SCALAR = 1,
> + ACL_CLASSIFY_SSE = 2,
> +};
As a nit: as this emum is part of public API, I think it is better to add rte_ prefix: enum rte_acl_classify_alg
> +
> +extern inline int rte_acl_classify(const struct rte_acl_ctx *ctx,
> + const uint8_t **data,
> + uint32_t *results, uint32_t num,
> + uint32_t categories);
Again as a nit: here and everywhere can we keep same style through the whole DPDK - function name from the new line:
extern nt
rte_acl_classify(...);
> +/**
> + * Analyze ISA of the current CPU and points rte_acl_default_classify
> + * to the highest applicable version of classify function.
> + */
> +extern void
> +rte_acl_select_classify(enum acl_classify_alg alg);
>
> /**
> * Dump an ACL context structure to the console.
> --
> 1.9.3
^ permalink raw reply [relevance 0%]
Results 13801-14000 of ~18000 next (older) | prev (newer) | reverse | sort options + mbox downloads above
-- links below jump to the message on this page --
2014-08-07 18:31 [dpdk-dev] [PATCHv2] librte_acl make it build/work for 'default' target Konstantin Ananyev
2014-08-21 20:15 ` [dpdk-dev] [PATCHv3] " Neil Horman
2014-08-25 16:30 0% ` Ananyev, Konstantin
2014-08-26 17:44 0% ` Neil Horman
2014-08-27 11:25 0% ` Ananyev, Konstantin
2014-08-27 18:56 0% ` Neil Horman
2014-08-27 19:18 0% ` Ananyev, Konstantin
2014-08-28 9:02 0% ` Richardson, Bruce
2014-08-28 15:55 0% ` Neil Horman
2014-08-28 20:38 1% ` [dpdk-dev] [PATCHv4] " Neil Horman
2014-08-29 17:58 0% ` Ananyev, Konstantin
2014-09-01 15:28 1% [dpdk-dev] [PATCHv5] " Konstantin Ananyev
2014-09-02 13:43 0% ` Neil Horman
2014-09-03 1:29 0% ` Thomas Monjalon
2014-09-15 19:23 4% [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility Neil Horman
2014-09-15 19:23 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-09-23 10:39 0% ` Sergio Gonzalez Monroy
2014-09-23 14:58 0% ` Neil Horman
2014-09-23 16:29 0% ` Sergio Gonzalez Monroy
2014-09-23 17:31 0% ` Neil Horman
2014-09-25 18:52 4% ` [dpdk-dev] [PATCH 1/4 v2] " Neil Horman
2014-09-26 14:16 0% ` Sergio Gonzalez Monroy
2014-09-26 15:16 0% ` Neil Horman
2014-09-26 15:33 0% ` Sergio Gonzalez Monroy
2014-09-26 16:22 0% ` Neil Horman
2014-09-26 19:19 0% ` Neil Horman
2014-09-29 15:44 3% ` [dpdk-dev] [PATCH 1/4 v3] " Neil Horman
2014-09-30 8:13 0% ` Sergio Gonzalez Monroy
2014-09-30 15:18 3% ` [dpdk-dev] [PATCH 1/4 v4] " Neil Horman
2014-10-01 10:15 0% ` Sergio Gonzalez Monroy
2014-10-01 10:38 0% ` Neil Horman
2014-10-01 11:28 0% ` Sergio Gonzalez Monroy
2014-09-15 19:23 ` [dpdk-dev] [PATCH 2/4] Provide initial versioning for all DPDK libraries Neil Horman
2014-09-19 9:45 4% ` Bruce Richardson
2014-09-19 10:22 0% ` Neil Horman
2014-09-15 19:23 7% ` [dpdk-dev] [PATCH 3/4] Add library version extenstion Neil Horman
2014-10-01 11:27 0% ` Sergio Gonzalez Monroy
2014-09-15 19:23 23% ` [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation Neil Horman
2014-10-01 16:06 4% ` Sergio Gonzalez Monroy
2014-09-18 18:23 0% ` [dpdk-dev] [PATCH 0/4] Add DSO symbol versioning to support backwards compatibility Thomas Monjalon
2014-09-18 19:14 4% ` Neil Horman
2014-09-19 8:57 0% ` Richardson, Bruce
2014-09-19 14:18 0% ` Venkatesan, Venky
2014-09-19 17:45 4% ` Neil Horman
2014-09-24 18:19 3% ` Neil Horman
2014-09-26 10:41 0% ` Thomas Monjalon
2014-09-26 14:45 5% ` Neil Horman
2014-09-26 22:02 4% ` Stephen Hemminger
2014-09-27 2:22 5% ` Neil Horman
2014-10-01 18:59 0% ` Neil Horman
2014-10-07 21:01 0% ` Neil Horman
2014-10-08 15:57 0% ` Thomas Monjalon
2014-10-08 18:46 3% ` Butler, Siobhan A
2014-10-08 19:09 4% ` Neil Horman
2014-09-18 10:34 [dpdk-dev] [PATCH 0/3] New Thread Safe Hash Library Pablo de Lara
2014-09-18 12:21 3% ` Neil Horman
2014-09-18 15:31 0% ` De Lara Guarch, Pablo
2014-09-18 15:45 0% ` Thomas Monjalon
2014-09-18 16:09 3% ` Neil Horman
2014-09-25 12:56 [dpdk-dev] [PATCH v2] Change alarm cancel function to thread-safe: Michal Jastrzebski
2014-09-25 15:08 ` Neil Horman
2014-09-25 16:03 ` Ananyev, Konstantin
2014-09-25 17:23 ` Neil Horman
2014-09-25 23:24 ` Ananyev, Konstantin
2014-09-26 11:46 ` Neil Horman
2014-09-26 12:37 ` Wodkowski, PawelX
2014-09-26 13:40 ` Neil Horman
2014-09-26 14:01 ` Wodkowski, PawelX
2014-09-26 15:01 5% ` Neil Horman
2014-09-26 15:41 0% ` Ananyev, Konstantin
2014-09-26 16:21 3% ` Neil Horman
2014-09-26 6:33 ` Wodkowski, PawelX
2014-09-26 13:43 3% ` Neil Horman
2014-09-28 18:04 [dpdk-dev] Bulk dequeue of packets and the returned values, question Wiles, Roger Keith
2014-09-28 22:23 3% ` Venkatesan, Venky
2014-09-28 22:36 0% ` Neil Horman
2014-09-28 23:06 0% ` Wiles, Roger Keith
2014-09-29 12:10 4% ` Bruce Richardson
2014-09-29 12:26 0% ` Neil Horman
2014-09-29 12:30 0% ` Ananyev, Konstantin
2014-09-29 14:57 0% ` Wiles, Roger Keith
2014-09-30 15:26 [dpdk-dev] [PATCH RFC] mbuf: Adjust TX flags to start at bit 32 Bruce Richardson
2014-09-30 15:33 3% ` Bruce Richardson
2014-09-30 16:00 0% ` Wiles, Roger Keith
2014-09-30 16:03 0% ` Bruce Richardson
2014-09-30 17:06 3% ` Neil Horman
2014-10-01 8:47 0% ` Bruce Richardson
2014-10-01 11:14 0% ` Neil Horman
2014-10-01 4:27 [dpdk-dev] [PATCH] Fix linking errors when CONFIG_RTE_BUILD_SHARED_LIB is enabled mukawa
2014-10-01 10:50 ` Neil Horman
2014-10-01 11:56 ` Thomas Monjalon
2014-10-02 2:48 2% ` Tetsuya Mukawa
2014-10-02 8:12 0% ` Sergio Gonzalez Monroy
2014-10-02 8:28 2% ` Tetsuya Mukawa
2014-10-02 8:53 0% ` Sergio Gonzalez Monroy
2014-10-02 9:05 0% ` Tetsuya Mukawa
2014-10-03 11:11 0% ` Sergio Gonzalez Monroy
2014-10-02 15:56 [dpdk-dev] [PATCH 0/4] Fix build issues with CONFIG_RTE_BUILD_COMBINE_LIBS=y Sergio Gonzalez Monroy
2014-10-02 17:26 ` Neil Horman
2014-10-02 20:04 ` Matthew Hall
2014-10-02 20:24 ` Neil Horman
2014-10-03 10:31 ` Sergio Gonzalez Monroy
2014-10-03 11:28 ` Neil Horman
2014-10-03 23:52 ` Stephen Hemminger
2014-10-04 2:30 3% ` Neil Horman
2014-10-06 10:52 ` [dpdk-dev] [PATCH v2 0/4] Update build process Sergio Gonzalez Monroy
2014-10-06 10:52 ` [dpdk-dev] [PATCH v2 3/4] Update library " Sergio Gonzalez Monroy
2014-10-06 20:46 ` Matthew Hall
2014-10-07 9:55 3% ` Sergio Gonzalez Monroy
2014-10-08 22:36 0% ` Matthew Hall
2014-10-09 9:44 0% ` Sergio Gonzalez Monroy
2014-10-22 13:48 2% [dpdk-dev] [dpdk-announce] DPDK Features for Q1 2015 O'driscoll, Tim
2014-10-22 16:10 3% ` Luke Gorrie
2014-10-24 9:22 [dpdk-dev] DPDK Community Conference Call - Friday 31st October O'driscoll, Tim
2014-10-31 15:34 ` O'driscoll, Tim
2014-10-31 17:36 ` O'driscoll, Tim
2014-11-01 12:59 3% ` Neil Horman
2014-11-01 14:05 0% ` Vincent JARDIN
2014-11-11 10:16 [dpdk-dev] Community conference call - Tuesday 18th November O'driscoll, Tim
2014-11-14 10:52 4% ` O'driscoll, Tim
2014-11-18 12:56 0% ` O'driscoll, Tim
2014-11-19 12:33 3% ` O'driscoll, Tim
2014-11-20 9:27 0% ` Walukiewicz, Miroslaw
2014-11-13 12:01 8% [dpdk-dev] [PATCH] x32 ABI support, first iteration Daniel Mrzyglod
2014-11-13 12:20 9% ` Mrzyglod, DanielX T
2014-11-14 0:45 4% ` Neil Horman
[not found] ` <86228AFD5BCD8E4EBFD2B90117B5E81E10D789EA@SHSMSX103.ccr.corp.intel.com>
2015-02-09 5:29 4% ` Tang, HaifengX
2014-11-19 11:22 [dpdk-dev] versioning and maintenance Thomas Monjalon
2014-11-19 11:35 ` Bruce Richardson
2014-11-19 15:13 4% ` Neil Horman
2014-11-20 17:09 4% ` Thomas Monjalon
2014-11-20 18:25 5% ` Neil Horman
2014-11-20 21:08 3% ` Thomas Monjalon
2014-11-21 1:05 4% ` Neil Horman
2014-11-21 13:23 4% ` Thomas Monjalon
2014-11-21 20:17 4% ` Neil Horman
2014-12-20 21:01 4% [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
2014-12-20 21:01 4% ` [dpdk-dev] [PATCH 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-12-20 21:01 7% ` [dpdk-dev] [PATCH 3/4] Add library version extenstion Neil Horman
2014-12-20 21:01 23% ` [dpdk-dev] [PATCH 4/4] docs: Add ABI documentation Neil Horman
2014-12-22 20:24 4% ` [dpdk-dev] [PATCH v2 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-12-22 20:24 7% ` [dpdk-dev] [PATCH v2 3/4] Add library version extenstion Neil Horman
2014-12-22 20:24 23% ` [dpdk-dev] [PATCH v2 4/4] docs: Add ABI documentation Neil Horman
2014-12-23 9:48 4% ` Iremonger, Bernard
2014-12-23 13:01 4% ` Neil Horman
2014-12-23 15:51 4% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2014-12-23 15:51 7% ` [dpdk-dev] [PATCH v3 3/4] Add library version extenstion Neil Horman
2014-12-29 16:23 0% ` Sergio Gonzalez Monroy
2015-01-14 15:48 0% ` Thomas Monjalon
2014-12-23 15:51 23% ` [dpdk-dev] [PATCH v3 4/4] docs: Add ABI documentation Neil Horman
2014-12-29 16:24 4% ` Sergio Gonzalez Monroy
2015-01-14 15:59 4% ` Thomas Monjalon
2015-01-14 20:07 7% ` Neil Horman
2015-01-16 13:34 7% ` Thomas Monjalon
2015-01-14 15:25 0% ` [dpdk-dev] [PATCH v3 1/4] compat: Add infrastructure to support symbol versioning Thomas Monjalon
2015-01-14 20:29 0% ` Neil Horman
2015-01-09 12:35 0% ` [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Neil Horman
2015-01-15 19:35 3% ` [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2015-01-15 19:35 7% ` [dpdk-dev] [PATCH v4 3/4] Add library version extenstion Neil Horman
2015-01-15 19:35 23% ` [dpdk-dev] [PATCH v4 4/4] docs: Add ABI documentation Neil Horman
2015-01-30 17:13 3% ` [dpdk-dev] [PATCH v4 1/4] compat: Add infrastructure to support symbol versioning Gray, Mark D
2015-01-16 15:33 3% ` [dpdk-dev] [PATCH v5 " Neil Horman
2015-01-16 15:33 7% ` [dpdk-dev] [PATCH v5 3/4] Add library version extenstion Neil Horman
2015-01-16 15:33 23% ` [dpdk-dev] [PATCH v5 4/4] docs: Add ABI documentation Neil Horman
2015-01-20 7:14 4% ` Thomas Monjalon
2015-01-20 10:47 4% ` Bruce Richardson
2015-01-20 13:37 4% ` Iremonger, Bernard
2015-01-20 13:46 4% ` Thomas Monjalon
2015-01-20 14:24 4% ` Neil Horman
2015-01-20 14:29 4% ` Butler, Siobhan A
2015-01-20 14:41 4% ` Neil Horman
2015-01-20 14:50 4% ` Butler, Siobhan A
2015-01-20 15:30 4% ` Neil Horman
2015-01-20 14:32 4% ` O'driscoll, Tim
2015-01-20 14:00 8% ` Thomas Monjalon
2015-01-20 14:37 7% ` Neil Horman
2015-01-20 15:06 9% ` Thomas Monjalon
2015-01-20 15:35 4% ` Neil Horman
2015-01-20 21:17 3% ` [dpdk-dev] [PATCH v6 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2015-01-20 21:17 7% ` [dpdk-dev] [PATCH v6 3/4] Add library version extenstion Neil Horman
2015-01-20 21:17 24% ` [dpdk-dev] [PATCH v6 4/4] docs: Add ABI documentation Neil Horman
2015-01-21 10:13 8% ` Iremonger, Bernard
2015-01-21 10:25 10% ` Thomas Monjalon
2015-01-21 14:59 8% ` Neil Horman
2015-01-21 16:05 8% ` Thomas Monjalon
2015-01-21 19:43 4% ` Neil Horman
2015-01-21 22:24 9% ` Thomas Monjalon
2015-01-22 19:21 4% ` Neil Horman
2015-01-21 20:59 3% ` [dpdk-dev] [PATCH v7 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2015-01-21 20:59 7% ` [dpdk-dev] [PATCH v7 3/4] Add library version extenstion Neil Horman
2015-01-21 20:59 23% ` [dpdk-dev] [PATCH v7 4/4] docs: Add ABI documentation Neil Horman
2015-01-22 10:56 8% ` Iremonger, Bernard
2015-01-22 15:37 7% ` Neil Horman
2015-01-22 15:49 3% ` [dpdk-dev] [PATCH v8 1/4] compat: Add infrastructure to support symbol versioning Neil Horman
2015-01-22 15:49 7% ` [dpdk-dev] [PATCH v8 3/4] Add library version extenstion Neil Horman
2015-01-22 15:49 23% ` [dpdk-dev] [PATCH v8 4/4] docs: Add ABI documentation Neil Horman
2015-01-22 16:46 4% ` Butler, Siobhan A
[not found] ` <1422898822-16422-1-git-send-email-nhorman@tuxdriver.com>
[not found] ` <1422898822-16422-4-git-send-email-nhorman@tuxdriver.com>
2015-02-03 15:24 8% ` [dpdk-dev] [PATCH v9 " Thomas Monjalon
2015-02-03 16:01 0% ` [dpdk-dev] Add DSO symbol versioning to supportbackwards compatibility Thomas Monjalon
2015-02-03 20:20 0% ` Neil Horman
2014-12-22 16:47 [dpdk-dev] [PATCH RFC 0/3] DPDK ethdev callback support Bruce Richardson
2015-02-12 19:57 ` [dpdk-dev] [PATCH " John McNamara
2015-02-12 19:57 ` [dpdk-dev] [PATCH 2/3] ethdev: Add in data rxtx " John McNamara
2015-02-12 21:12 3% ` Neil Horman
2015-02-13 14:54 3% ` [dpdk-dev] [PATCH 0/3] DPDK ethdev " Declan Doherty
2015-02-13 15:39 4% ` [dpdk-dev] [PATCH v2 0/4] " John McNamara
2015-02-13 15:39 5% ` [dpdk-dev] [PATCH v2 4/4] abi: Added rxtx callback functions to ABI versioning John McNamara
2015-02-13 15:59 5% ` Thomas Monjalon
2015-02-13 15:48 0% ` [dpdk-dev] [PATCH v2 0/4] DPDK ethdev callback support Declan Doherty
2015-01-29 15:20 [dpdk-dev] [PATCH 0/8] Improve build process Sergio Gonzalez Monroy
2015-01-29 16:38 3% ` Neil Horman
2015-01-29 17:02 0% ` Thomas Monjalon
2015-01-29 17:04 0% ` Gonzalez Monroy, Sergio
2015-01-29 19:45 0% ` Neil Horman
2015-01-30 13:39 0% ` Gonzalez Monroy, Sergio
2015-01-30 14:05 0% ` Neil Horman
2015-01-30 17:38 0% ` Gonzalez Monroy, Sergio
2015-01-30 18:12 0% ` Neil Horman
2015-02-11 11:11 ` Gonzalez Monroy, Sergio
2015-02-12 9:22 ` Panu Matilainen
2015-02-12 10:03 ` Gonzalez Monroy, Sergio
2015-02-12 12:23 ` Neil Horman
2015-02-12 14:07 ` Panu Matilainen
2015-02-12 15:52 3% ` Neil Horman
2015-02-13 10:14 0% ` Panu Matilainen
2015-02-13 11:08 0% ` Gonzalez Monroy, Sergio
2015-02-13 12:51 0% ` Neil Horman
2015-01-30 21:16 17% [dpdk-dev] [PATCH] ABI: Add abi checking utility Neil Horman
2015-02-02 18:18 17% ` [dpdk-dev] [PATCH v2] " Neil Horman
2015-02-04 22:23 4% [dpdk-dev] [PATCH 0/3] update maintainers areas Thomas Monjalon
2015-02-04 22:23 14% ` [dpdk-dev] [PATCH 2/3] maintainers: add ABI versioning Thomas Monjalon
2015-02-05 1:39 4% ` Neil Horman
2015-02-09 14:20 7% ` Thomas Monjalon
2015-02-09 14:21 0% ` [dpdk-dev] [PATCH 0/3] update maintainers areas Thomas Monjalon
2015-02-05 1:13 [dpdk-dev] [PATCH 0/7] Hyper-v driver and infrastructure Stephen Hemminger
2015-02-05 1:13 1% ` [dpdk-dev] [PATCH 3/7] hv: add basic vmbus support Stephen Hemminger
2015-02-05 1:50 0% ` Neil Horman
[not found] <2601191342CEEE43887BDE71AB977258213E4175@irsmsx105.ger.corp.intel.com>
2015-02-09 10:22 4% ` [dpdk-dev] [PATCH] x32 ABI support, first iteration Ananyev, Konstantin
2015-02-12 13:18 4% ` De Lara Guarch, Pablo
2015-02-11 1:31 [dpdk-dev] [PATCH v4 01/15] fm10k: add base driver Chen Jing D(Mark)
2015-02-13 8:19 4% ` [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver Chen Jing D(Mark)
2015-02-13 8:19 7% ` [dpdk-dev] [PATCH v5 17/17] fm10k: Add ABI version of librte_pmd_fm10k Chen Jing D(Mark)
2015-02-13 8:37 0% ` [dpdk-dev] [PATCH v5 00/17] lib/librte_pmd_fm10k : fm10k pmd driver Zhang, Helin
2015-02-15 5:07 0% ` Qiu, Michael
2015-02-13 15:58 11% [dpdk-dev] [PATCH] doc: Add requirements for x32 ABI Daniel Mrzyglod
2015-02-16 10:18 4% [dpdk-dev] [PULL REQUEST] fm10k: new polling mode driver for PF/VF Chen Jing D(Mark)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).