DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] weak functions in some drivers
@ 2016-06-21 15:01 Damjan Marion (damarion)
  2016-06-21 16:01 ` Ferruh Yigit
  2016-06-27 18:13 ` Ferruh Yigit
  0 siblings, 2 replies; 12+ messages in thread
From: Damjan Marion (damarion) @ 2016-06-21 15:01 UTC (permalink / raw)
  To: dev


Hello,

We just spent few hours troubleshooting why vPMD is not working
in i40e driver. Conclusion was that problem is caused by linker 
linking the wrong instance of the i40e_rx_vec_dev_conf_condition_check(...).

That function is defined 2 times, once in i40e_rxtx.c and once in 
i40e_rxtx_vec.c. First one is defined as weak and it just returns -1.

librte_pmd_i40e.a contains both versions:

$ objdump -x librte_pmd_i40e.a| grep i40e_rx_vec_dev_conf_condition_check
0000000000006ca0  w    F .text	0000000000000006 i40e_rx_vec_dev_conf_condition_check
00000000000007c1 g     F .text.unlikely	000000000000001c i40e_rx_vec_dev_conf_condition_check

However when we are linking our app, linker was picking 1st (weak) one and vPMD init was failing.

Workaround we applied to get int working:  -Wl,--whole-archive <LIBS> -Wl,—no-whole-archive

What is not clear to me is motivation to use weak here instead of simply using CONFIG_RTE_I40E_INC_VECTOR
macro to exclude stubs in i40e_rxtx.c. It will make library smaller and avoid issues like this one
which are quite hard to troubleshoot.

BTW Looks like same issue is happening with fm10k driver.

Thanks,

Damjan




^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [dpdk-dev] weak functions in some drivers
@ 2016-06-29 13:26 Elo, Matias (Nokia - FI/Espoo)
  2016-06-30  8:14 ` Sergio Gonzalez Monroy
  0 siblings, 1 reply; 12+ messages in thread
From: Elo, Matias (Nokia - FI/Espoo) @ 2016-06-29 13:26 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, damarion

>> What is not clear to me is motivation to use weak here instead of simply using >CONFIG_RTE_I40E_INC_VECTOR
>> macro to exclude stubs in i40e_rxtx.c. It will make library smaller and avoid issues like this one
>> which are quite hard to troubleshoot.
>
>Since this issue seen in fd.io, I didn't investigated more, but I don't
>want to clock your valid question, this is an attempt to resurrect the
>question ...

Hi,

We are having exactly the same problem. For us the aforementioned workaround doesn't seem to work and vector mode is always disabled with the i40e drivers. If I modify i40e_rxtx.c and exclude the stub functions using CONFIG_RTE_I40E_INC_VECTOR everything works as expected.

We are building DPDK with the CONFIG_RTE_BUILD_COMBINE_LIBS option enabled and link DPDK library to our application.

Any other ideas how this could be fixed?

Regards,
Matias

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-07-14 15:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-21 15:01 [dpdk-dev] weak functions in some drivers Damjan Marion (damarion)
2016-06-21 16:01 ` Ferruh Yigit
2016-06-21 16:08   ` Damjan Marion (damarion)
2016-06-27 18:13 ` Ferruh Yigit
2016-06-29 13:26 Elo, Matias (Nokia - FI/Espoo)
2016-06-30  8:14 ` Sergio Gonzalez Monroy
2016-06-30  8:40   ` Elo, Matias (Nokia - FI/Espoo)
2016-07-01  9:42     ` Elo, Matias (Nokia - FI/Espoo)
2016-07-01 10:05       ` Sergio Gonzalez Monroy
2016-07-01 10:16         ` Elo, Matias (Nokia - FI/Espoo)
2016-07-01 10:19           ` Sergio Gonzalez Monroy
2016-07-14 15:43             ` Zoltan Kiss

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).