Skip to contentSkip to conversation

net/af_xdp: add libelf for pmd_af_xdp.

PATCH In review William Tu 2 participants 3 messages May 15, 2019 – May 16, 2019

lore
Share & tools
lore

William Tu

author
#0 lore raw

PATCH 1/1 net/af_xdp: add libelf for pmd_af_xdp.

The libbpf requires linking elf library. Fix it by adding -lelf.

Fixes f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
---
 mk/rte.app.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.app.mk +1 -1
index 7c9b4b538e52..e5d15218618a 100644
@@ -145,7 +145,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL)  += -lrte_mempool_dpaa2
 endif
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET)  += -lrte_pmd_af_packet
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP)     += -lrte_pmd_af_xdp -lbpf
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP)     += -lrte_pmd_af_xdp -lbpf -lelf
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD)        += -lrte_pmd_ark
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD)   += -lrte_pmd_atlantic
 _LDLIBS-$(CONFIG_RTE_LIBRTE_AVP_PMD)        += -lrte_pmd_avp
Signature · 1 line
2.7.4
#1 lore raw
Quoted 17 lines · William Tu

The libbpf requires linking elf library. Fix it by adding -lelf.

Fixes f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
Signed-off-by William Tu <

[email protected]

Quoted 1 line
---
 mk/rte.app.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.app.mk +0 -1
index 7c9b4b538e52..e5d15218618a 100644
@@ -145,7 +145,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL)  +=
-lrte_mempool_dpaa2

mk/rte.app.mk _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL) += · line 151

Quoted 10 lines
mk/rte.app.mk +1 -3
 endif
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET)  += -lrte_pmd_af_packet
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP)     += -lrte_pmd_af_xdp
-lbpf
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP)     += -lrte_pmd_af_xdp
-lbpf -lelf
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD)        += -lrte_pmd_ark
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD)   += -lrte_pmd_atlantic
 _LDLIBS-$(CONFIG_RTE_LIBRTE_AVP_PMD)        += -lrte_pmd_avp

Hi,

This was already discussed, and libbpf needs to link with libelf itself as it's an internal dependency. It was already fixed in the kernel tree some time ago, so it should be correct with a recent version. If you are using an old version you can either update or fix it in your application. So I don't think we should carry this work-around ourselves in DPDK, as we'll end up overlinking when using fixed libbpf versions.

Signature · 2 lines
Kind regards,
Luca Boccassi
author
#2 lore raw
Quoted 32 lines · Luca Boccassi
Quoted 17 lines · William Tu

The libbpf requires linking elf library. Fix it by adding -lelf.

Fixes f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
Signed-off-by William Tu <

[email protected]

Quoted 1 line
---
 mk/rte.app.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/rte.app.mk +0 -1
index 7c9b4b538e52..e5d15218618a 100644
@@ -145,7 +145,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL)  +=
-lrte_mempool_dpaa2

mk/rte.app.mk _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL) += · line 151

Quoted 10 lines
mk/rte.app.mk +1 -3
 endif
 
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET)  += -lrte_pmd_af_packet
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP)     += -lrte_pmd_af_xdp
-lbpf
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_XDP)     += -lrte_pmd_af_xdp
-lbpf -lelf
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ARK_PMD)        += -lrte_pmd_ark
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ATLANTIC_PMD)   += -lrte_pmd_atlantic
 _LDLIBS-$(CONFIG_RTE_LIBRTE_AVP_PMD)        += -lrte_pmd_avp

Hi,

Quoted 7 lines

This was already discussed, and libbpf needs to link with libelf itself as it's an internal dependency. It was already fixed in the kernel tree some time ago, so it should be correct with a recent version. If you are using an old version you can either update or fix it in your application. So I don't think we should carry this work-around ourselves in DPDK, as we'll end up overlinking when using fixed libbpf versions.

OK. Thank you!