Skip to contentSkip to conversation

DPDK libs as one big shared object

DISCUSSION Morten Brørup 4 participants 6 messages Jun 16, 2025 – Jun 26, 2025

lore
Share & tools
lore
#0 lore raw

Why are we still building one .so file per DPDK library, instead of just building one big dpdk.so for all DPDK libraries? I think it's legacy from when DPDK libraries were versioned individually, and thus not relevant anymore.

Wouldn't building one big dpdk.so eliminate the problems with circular dependencies between DPDK libraries?

-Morten

#1 lore raw
Quoted 7 lines

Why are we still building one .so file per DPDK library, instead of just building one big dpdk.so for all DPDK libraries?
I think it's legacy from when DPDK libraries were versioned individually, and thus not relevant anymore.

Wouldn't building one big dpdk.so eliminate the problems with circular dependencies between DPDK libraries?

Obviously, the source code should remain organized as individual directories per library.
I'm only suggesting linking them all into one object, so any DPDK lib can call any function in any other DPDK lib.

Perhaps only the core libs or always_enable libs should be linked into one object.

Here's an example benefit:
I'm currently trying to convince the PMU lib author to make PMU depend on EAL [1], so missing error handling of sysconf(_SC_PAGESIZE) can be in the EAL for all uses, instead of copy-pasting sysconf(_SC_PAGESIZE) error handling to everywhere it is used. But this is difficult with the dependency chain for the patch adding PMU to Trace: Trace depends on PMU, and EAL depends on Trace, therefore EAL depends on PMU.

[1]: https://inbox.dpdk.org/dev/[email protected]/

#2 lore raw

18/06/2025 09:39, Morten Brørup:

Quoted 4 lines
Quoted 4 lines

Why are we still building one .so file per DPDK library, instead of just building one big dpdk.so for all DPDK libraries?
I think it's legacy from when DPDK libraries were versioned individually, and thus not relevant anymore.

I think it helps with selective packaging.

Quoted 6 lines
Quoted 2 lines

Wouldn't building one big dpdk.so eliminate the problems with circular dependencies between DPDK libraries?

Obviously, the source code should remain organized as individual directories per library.
I'm only suggesting linking them all into one object, so any DPDK lib can call any function in any other DPDK lib.

Quoted 7 lines

Perhaps only the core libs or always_enable libs should be linked into one object.

Here's an example benefit:
I'm currently trying to convince the PMU lib author to make PMU depend on EAL [1], so missing error handling of sysconf(_SC_PAGESIZE) can be in the EAL for all uses, instead of copy-pasting sysconf(_SC_PAGESIZE) error handling to everywhere it is used. But this is difficult with the dependency chain for the patch adding PMU to Trace: Trace depends on PMU, and EAL depends on Trace, therefore EAL depends on PMU.

[1]: https://inbox.dpdk.org/dev/[email protected]/

I don't see a problem to copy-paste in the few libs not depending on EAL.

The real solution for EAL dependencies is to split it more. The malloc, init & logic part should be in separate libraries, depending on the real low-level EAL.

Then all libs could depend on the low-level EAL,
and avoid copy-pasting.

#3 lore raw
Quoted 7 lines · On Wed, 18 Jun 2025 12:01:45 +0200 Thomas Monjalon <[email protected]> wrote:

18/06/2025 09:39, Morten Brørup:

Quoted 4 lines
Quoted 4 lines

Why are we still building one .so file per DPDK library, instead of just building one big dpdk.so for all DPDK libraries?
I think it's legacy from when DPDK libraries were versioned individually, and thus not relevant anymore.

I think it helps with selective packaging.

That only impacts disk space. The linker is able to only load what is needed at run time. It was a choice made in the build process. Not sure if was the right one most other projects don't have so many libraries to worry about.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Wouldn't building one big dpdk.so eliminate the problems with circular dependencies between DPDK libraries?

Yes is why most of the big Gnome and KDE libs are all one shared object.

Quoted 12 lines
Quoted 11 lines

Obviously, the source code should remain organized as individual directories per library.
I'm only suggesting linking them all into one object, so any DPDK lib can call any function in any other DPDK lib.

Perhaps only the core libs or always_enable libs should be linked into one object.

Here's an example benefit:
I'm currently trying to convince the PMU lib author to make PMU depend on EAL [1], so missing error handling of sysconf(_SC_PAGESIZE) can be in the EAL for all uses, instead of copy-pasting sysconf(_SC_PAGESIZE) error handling to everywhere it is used. But this is difficult with the dependency chain for the patch adding PMU to Trace: Trace depends on PMU, and EAL depends on Trace, therefore EAL depends on PMU.

[1]: https://inbox.dpdk.org/dev/[email protected]/

Quoted 8 lines

I don't see a problem to copy-paste in the few libs not depending on EAL.

The real solution for EAL dependencies is to split it more. The malloc, init & logic part should be in separate libraries, depending on the real low-level EAL.

Then all libs could depend on the low-level EAL,
and avoid copy-pasting.

There have always been two overlapping targets.
Embedded standalone and standalone network appliance , where building more than is needed is a nuisance. And distributions which need to turn on everything

#4 lore raw

26/06/2025 14:53, Stephen Hemminger:

Quoted 40 lines
Quoted 7 lines · On Wed, 18 Jun 2025 12:01:45 +0200 Thomas Monjalon <[email protected]> wrote:

18/06/2025 09:39, Morten Brørup:

Quoted 4 lines
Quoted 4 lines

Why are we still building one .so file per DPDK library, instead of just building one big dpdk.so for all DPDK libraries?
I think it's legacy from when DPDK libraries were versioned individually, and thus not relevant anymore.

I think it helps with selective packaging.

That only impacts disk space. The linker is able to only load what is needed at run time. It was a choice made in the build process. Not sure if was the right one most other projects don't have so many libraries to worry about.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Wouldn't building one big dpdk.so eliminate the problems with circular dependencies between DPDK libraries?

Yes is why most of the big Gnome and KDE libs are all one shared object.

Quoted 18 lines
Quoted 11 lines

Obviously, the source code should remain organized as individual directories per library.
I'm only suggesting linking them all into one object, so any DPDK lib can call any function in any other DPDK lib.

Perhaps only the core libs or always_enable libs should be linked into one object.

Here's an example benefit:
I'm currently trying to convince the PMU lib author to make PMU depend on EAL [1], so missing error handling of sysconf(_SC_PAGESIZE) can be in the EAL for all uses, instead of copy-pasting sysconf(_SC_PAGESIZE) error handling to everywhere it is used. But this is difficult with the dependency chain for the patch adding PMU to Trace: Trace depends on PMU, and EAL depends on Trace, therefore EAL depends on PMU.

[1]: https://inbox.dpdk.org/dev/[email protected]/

I don't see a problem to copy-paste in the few libs not depending on EAL.

The real solution for EAL dependencies is to split it more. The malloc, init & logic part should be in separate libraries, depending on the real low-level EAL.

Quoted 6 lines
Quoted 2 lines

Then all libs could depend on the low-level EAL,
and avoid copy-pasting.

There have always been two overlapping targets.
Embedded standalone and standalone network appliance , where building more than is needed is a nuisance. And distributions which need to turn on everything

I heard distributions want to be able to not package some parts.

#5 lore raw
Quoted 41 lines · Thomas Monjalon

26/06/2025 14:53, Stephen Hemminger:

Quoted 40 lines
Quoted 7 lines · On Wed, 18 Jun 2025 12:01:45 +0200 Thomas Monjalon <[email protected]> wrote:

18/06/2025 09:39, Morten Brørup:

Quoted 4 lines
Quoted 4 lines

Why are we still building one .so file per DPDK library, instead of just building one big dpdk.so for all DPDK libraries?
I think it's legacy from when DPDK libraries were versioned individually, and thus not relevant anymore.

I think it helps with selective packaging.

That only impacts disk space. The linker is able to only load what is needed at run time. It was a choice made in the build process. Not sure if was the right one most other projects don't have so many libraries to worry about.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Wouldn't building one big dpdk.so eliminate the problems with circular dependencies between DPDK libraries?

Yes is why most of the big Gnome and KDE libs are all one shared object.

Quoted 18 lines
Quoted 11 lines

Obviously, the source code should remain organized as individual directories per library.
I'm only suggesting linking them all into one object, so any DPDK lib can call any function in any other DPDK lib.

Perhaps only the core libs or always_enable libs should be linked into one object.

Here's an example benefit:
I'm currently trying to convince the PMU lib author to make PMU depend on EAL [1], so missing error handling of sysconf(_SC_PAGESIZE) can be in the EAL for all uses, instead of copy-pasting sysconf(_SC_PAGESIZE) error handling to everywhere it is used. But this is difficult with the dependency chain for the patch adding PMU to Trace: Trace depends on PMU, and EAL depends on Trace, therefore EAL depends on PMU.

[1]: https://inbox.dpdk.org/dev/[email protected]/

I don't see a problem to copy-paste in the few libs not depending on EAL.

The real solution for EAL dependencies is to split it more. The malloc, init & logic part should be in separate libraries, depending on the real low-level EAL.

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Then all libs could depend on the low-level EAL,
and avoid copy-pasting.

There have always been two overlapping targets.
Embedded standalone and standalone network appliance , where building more than is needed is a nuisance. And distributions which need to turn on everything

I heard distributions want to be able to not package some parts.

I believe the intention is to only bundle up the mandatory parts of DPDK, e.g. EAL and dependencies + maybe mempool or a few other libs. In that case, there should be no option to drop some parts.

/Bruce