[dpdk-users] Using DPDK with a pre-existing C++ application compiled in Eclipse.

Gaëtan Rivet gaetan.rivet at 6wind.com
Tue Jun 20 23:15:04 CEST 2017


On Tue, Jun 20, 2017 at 05:21:41PM +0100, terry.montague.1980 at btinternet.com wrote:
> 
> 
> Hi Gaetan,
> 
> I mean I'm building DPDK before I link with my app eclipse.
> 

Ok.
You can thus take the librte_pmd_i40e.a file within your build result,
and link against it. This should yield better result than using dynamic
linking with the shared object. It's only a matter of giving the proper
flags at compile time, you should have everything necessary.

> Switching CONFIG_RTE_BUILD_SHARED_LIB to 'y', rebuilding DPDK  and adding -d options for the path as well as librte_pmd_i40e.so.1.1 going into  rte_eal_init(), I'm seeing the devices being detected.
> 
> Any ideas on this problem with libdpdk.so below ?
> 

Unfortunately no, sorry. I never use the DPDK this way (well, I also
never really configured the DPDK myself).

I do not know why the EAL react this way. However both for performance
and as a way to bypass this issue, I'd suggest trying to use static
linking and see if that's acceptable for you. You get better perf and
the EAL plugin issue is unlikely to happen.

> Many thanks 
> 
> Terry
> 
> EAL: Running eal_plugins_init
> EAL: open shared lib librte_pmd_i40e.so.1.1
> EAL: open shared lib /usr/local/lib/librte_net.so.1.1
> EAL: open shared lib /usr/local/lib/librte_port.so.3.1
> EAL: open shared lib /usr/local/lib/libboost_random.so.1.63.0
> EAL: open shared lib /usr/local/lib/libboost_math_c99l.so.1.63.0
> EAL: open shared lib /usr/local/lib/libApp.so
> EAL: open shared lib /usr/local/lib/libmc_enc_vc1.so
> EAL: open shared lib /usr/local/lib/libboost_fiber.so
> EAL: open shared lib /usr/local/lib/libmc_dec_dv100.so
> EAL: open shared lib /usr/local/lib/libmc_mfimport.so
> EAL: open shared lib /usr/local/lib/librte_pmd_crypto_scheduler.so.1.1
> EAL: open shared lib /usr/local/lib/librte_eal.so
> EAL: open shared lib /usr/local/lib/librte_mempool.so
> EAL: open shared lib /usr/local/lib/librte_pmd_bnxt.so.1.1
> EAL: open shared lib /usr/local/lib/librte_mbuf.so
> EAL: open shared lib /usr/local/lib/libboost_math_c99f.so
> EAL: open shared lib /usr/local/lib/librte_pmd_bnxt.so
> EAL: open shared lib /usr/local/lib/libmc_config_vc3.so
> EAL: open shared lib /usr/local/lib/libboost_date_time.so.1.63.0
> EAL: open shared lib /usr/local/lib/libboost_math_tr1.so.1.63.0
> EAL: open shared lib /usr/local/lib/librte_lpm.so
> EAL: open shared lib /usr/local/lib/libboost_context.so.1.63.0
> EAL: open shared lib /usr/local/lib/libmc_enc_mp2v.so
> EAL: open shared lib /usr/local/lib/libPixelXMLProtocol.so
> EAL: open shared lib /usr/local/lib/libboost_random.so
> EAL: open shared lib /usr/local/lib/libboost_iostreams.so
> EAL: open shared lib /usr/local/lib/libmc_enc_j2k.so
> EAL: open shared lib /usr/local/lib/librte_pmd_bond.so
> EAL: open shared lib /usr/local/lib/libboost_chrono.so
> EAL: open shared lib /usr/local/lib/librte_meter.so
> EAL: open shared lib /usr/local/lib/librte_pmd_bond.so.1.1
> EAL: open shared lib /usr/local/lib/libboost_log.so.1.63.0
> EAL: open shared lib /usr/local/lib/librte_hash.so.2.1
> EAL: open shared lib /usr/local/lib/libboost_wserialization.so
> EAL: open shared lib /usr/local/lib/libboost_chrono.so.1.63.0
> EAL: open shared lib /usr/local/lib/librte_acl.so.2.1
> EAL: open shared lib /usr/local/lib/libmc_parser_sdp.so
> EAL: open shared lib /usr/local/lib/librte_metrics.so.1.1
> EAL: open shared lib /usr/local/lib/librte_pmd_ring.so.2.1
> EAL: open shared lib /usr/local/lib/libmc_demux_mxf.so
> EAL: open shared lib /usr/local/lib/libmc_demux_dv.so
> EAL: open shared lib /usr/local/lib/librte_latencystats.so
> EAL: open shared lib /usr/local/lib/librte_pipeline.so.3.1
> EAL: open shared lib /usr/local/lib/librte_cryptodev.so.2.1
> EAL: open shared lib /usr/local/lib/libboost_filesystem.so
> EAL: open shared lib /usr/local/lib/libmc_demux_asf.so
> EAL: open shared lib /usr/local/lib/librte_pmd_skeleton_event.so
> EAL: open shared lib /usr/local/lib/libmc_demux_mp4.so
> EAL: open shared lib /usr/local/lib/libboost_program_options.so.1.63.0
> EAL: open shared lib /usr/local/lib/libboost_serialization.so.1.63.0
> EAL: open shared lib /usr/local/lib/libmc_bc_dec_avc.so
> EAL: open shared lib /usr/local/lib/librte_eventdev.so
> EAL: open shared lib /usr/local/lib/librte_ring.so
> EAL: open shared lib /usr/local/lib/libdemo_trans_audio_converter.so
> EAL: open shared lib /usr/local/lib/libboost_locale.so
> EAL: open shared lib /usr/local/lib/libboost_unit_test_framework.so.1.63.0
> EAL: open shared lib /usr/local/lib/librte_sched.so
> EAL: open shared lib /usr/local/lib/libboost_graph.so.1.63.0
> EAL: open shared lib /usr/local/lib/libmc_enc_mpa.so
> EAL: open shared lib /usr/local/lib/librte_bitratestats.so.1.1
> EAL: open shared lib /usr/local/lib/librte_cmdline.so.2.1
> EAL: open shared lib /usr/local/lib/librte_pmd_lio.so.1.1
> EAL: open shared lib /usr/local/lib/librte_pmd_af_packet.so
> EAL: open shared lib /usr/local/lib/libboost_regex.so.1.63.0
> EAL: open shared lib /usr/local/lib/librte_efd.so
> EAL: open shared lib /usr/local/lib/librte_pmd_fm10k.so.1.1
> EAL: open shared lib /usr/local/lib/libboost_math_tr1l.so.1.63.0
> EAL: open shared lib /usr/local/lib/libboost_timer.so.1.63.0
> EAL: open shared lib /usr/local/lib/librte_latencystats.so.1.1
> EAL: open shared lib /usr/local/lib/libmc_bc_net_source.so
> EAL: open shared lib /usr/local/lib/librte_pmd_octeontx_ssovf.so.1.1
> EAL: open shared lib /usr/local/lib/librte_pmd_thunderx_nicvf.so.1.1
> EAL: open shared lib /usr/local/lib/librte_timer.so
> EAL: open shared lib /usr/local/lib/libboost_coroutine.so
> EAL: open shared lib /usr/local/lib/libboost_math_tr1l.so
> EAL: open shared lib /usr/local/lib/librte_mempool_ring.so
> EAL: open shared lib /usr/local/lib/libDNxHR.so
> EAL: open shared lib /usr/local/lib/libmc_mux_asf.so
> EAL: open shared lib /usr/local/lib/librte_cfgfile.so.2.1
> EAL: open shared lib /usr/local/lib/librte_pmd_nfp.so.1.1
> EAL: open shared lib /usr/local/lib/libmc_bc_enc_avc.so
> EAL: open shared lib /usr/local/lib/librte_eal.so.4.1
> EAL: open shared lib /usr/local/lib/librte_pmd_vmxnet3_uio.so.1.1
> EAL: open shared lib /usr/local/lib/librte_pmd_ark.so.1.1
> EAL: open shared lib /usr/local/lib/librte_meter.so.1.1
> EAL: open shared lib /usr/local/lib/librte_reorder.so
> EAL: open shared lib /usr/local/lib/libboost_fiber.so.1.63.0
> EAL: open shared lib /usr/local/lib/libboost_iostreams.so.1.63.0
> EAL: open shared lib /usr/local/lib/librte_pmd_sfc_efx.so
> EAL: open shared lib /usr/local/lib/libboost_context.so
> EAL: open shared lib /usr/local/lib/libboost_type_erasure.so
> EAL: open shared lib /usr/local/lib/librte_lpm.so.2.1
> EAL: open shared lib /usr/local/lib/libboost_thread.so
> EAL: open shared lib /usr/local/lib/libmc_net_source.so
> EAL: open shared lib /usr/local/lib/librte_efd.so.1.1
> EAL: open shared lib /usr/local/lib/libboost_coroutine.so.1.63.0
> EAL: open shared lib /usr/local/lib/librte_pmd_sw_event.so
> EAL: open shared lib /usr/local/lib/libmc_manifest_generator.so
> EAL: open shared lib /usr/local/lib/libAVX2Support.so
> EAL: open shared lib /usr/local/lib/libmc_dec_spic.so
> EAL: open shared lib /usr/local/lib/libPipeline.so
> EAL: open shared lib /usr/local/lib/librte_pmd_ark.so
> EAL: open shared lib /usr/local/lib/libmc_dec_mp2v.so
> EAL: open shared lib /usr/local/lib/librte_eventdev.so.1.1
> EAL: open shared lib /usr/local/lib/librte_pmd_virtio.so.1.1
> EAL: open shared lib /usr/local/lib/librte_pmd_cxgbe.so.1.1
> EAL: open shared lib /usr/local/lib/libboost_unit_test_framework.so
> EAL: open shared lib /usr/local/lib/libdpdk.so
> EAL: /usr/local/lib/libdpdk.so: invalid ELF header
> EAL: FATAL: Cannot init plugins
> 
> 
> ----Original message----
> From : gaetan.rivet at 6wind.com
> Date : 20/06/17 - 16:57 (BST)
> To : terry.montague.1980 at btinternet.com
> Cc : users at dpdk.org
> Subject : Re: [dpdk-users] Using DPDK with a pre-existing C++ application compiled in Eclipse.
> 
> On Tue, Jun 20, 2017 at 04:04:50PM +0100, terry.montague.1980 at btinternet.com wrote:
> > 
> > 
> > Hi Gaëtan,
> > 
> > Its really only the net-i40e driver I need (for Intel XL710 cards). I'm not building DPDK itself as a shared library though.
> > 
> 
> Where are you getting your prebuilt rte_ libs?
> If you have the corresponding archive file, do you link rte_pmd_i40e?
> 
> > Best Regards
> > 
> > Terry
> > 
> > 
> > 
> > ----Original message----
> > From : gaetan.rivet at 6wind.com
> > Date : 20/06/17 - 15:57 (BST)
> > To : terry.montague.1980 at btinternet.com
> > Cc : users at dpdk.org
> > Subject : Re: [dpdk-users] Using DPDK with a pre-existing C++ application compiled in Eclipse.
> > 
> > Hi,
> > 
> > On Tue, Jun 20, 2017 at 03:47:07PM +0100, terry.montague.1980 at btinternet.com wrote:
> > > Hi there,
> > > Please excuse what to some may appear to be an stupid question.
> > > I'm trying to use DPDK with an existing C++ application on Linux, using Eclipse Neon.2 as the IDE due to the use of a lot of 3rd party libraries. I'm not using the DPDK build process with the .mk makefiles. I'm just linking to the prebuilt rte_ libs.
> > > I have got the project to compile, but when running rte_eal_init() with some suitable arguments that I know to be good in a simple standalone application, the PMDs appear to be absent, so the app cannot probe any PCI devices.
> > > Is there any way this approach is going to work, or do applications that use DPDK have to be compiled as per the example applications with rte.vars.mk/rte.extapp.mk ?
> > > Thanks in advance.
> > > Terry
> > 
> > Which NIC are you using? Which PMD do you need?
> > 
> > You can dynamically link specific DPDK drivers using -d in the EAL
> > parameters. Note that using PMDs as dynamic libraries may slightly
> > impair performances.
> > 
> > -- 
> > Gaëtan Rivet
> > 6WIND
> > 
> > 
> 
> -- 
> Gaëtan Rivet
> 6WIND
> 

-- 
Gaëtan Rivet
6WIND


More information about the users mailing list