DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Damjan Marion (damarion)" <damarion@cisco.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] weak functions in some drivers
Date: Tue, 21 Jun 2016 15:01:20 +0000	[thread overview]
Message-ID: <9A518F3E-04B9-4E40-BDDE-B16433A21BF9@cisco.com> (raw)


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




             reply	other threads:[~2016-06-21 15:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21 15:01 Damjan Marion (damarion) [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9A518F3E-04B9-4E40-BDDE-B16433A21BF9@cisco.com \
    --to=damarion@cisco.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).