From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5840BC31E for ; Tue, 21 Jun 2016 18:02:05 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 21 Jun 2016 09:02:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,504,1459839600"; d="scan'208";a="1002395171" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.90]) ([10.237.220.90]) by orsmga002.jf.intel.com with ESMTP; 21 Jun 2016 09:02:00 -0700 To: "Damjan Marion (damarion)" , "dev@dpdk.org" References: <9A518F3E-04B9-4E40-BDDE-B16433A21BF9@cisco.com> From: Ferruh Yigit Message-ID: <576964F7.3020804@intel.com> Date: Tue, 21 Jun 2016 17:01:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <9A518F3E-04B9-4E40-BDDE-B16433A21BF9@cisco.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] weak functions in some drivers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 16:02:05 -0000 Hi Damjan, On 6/21/2016 4:01 PM, Damjan Marion (damarion) wrote: > > 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. App is linking with correct instance of the function for me, how can I reproduce this linkage issue? > > Workaround we applied to get int working: -Wl,--whole-archive -Wl,—no-whole-archive These flags already wraps PMD libraries, can you please give more detail about workaround? Thanks, ferruh