From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by dpdk.org (Postfix) with ESMTP id 24C7E5A66 for ; Thu, 16 Jul 2015 15:00:51 +0200 (CEST) Received: by widjy10 with SMTP id jy10so15095219wid.1 for ; Thu, 16 Jul 2015 06:00:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=SaApt9xiN1GShENGjGejhLoqIBvhlaXfG3Yz8YZstAI=; b=g+W99HoHj4sUsIvv6eCtpb9aW35KiowdNTEiAm1bHcXnm46Xxvat4jX1D3CKPEav31 1vU3bGP4r/RkfThbC+nF/dkYUfaQeZkEkc2UbbdIhnkEjOHcDcT53RMICwc9Wr9xsHYj ZjkRecEtvnKzqIzJCLWcfCmROJJTTzvxwJt05+cI/ZBc3GkL1VvVG+Bs7Bik5L+f0Frj dN1GPm0GQMLE3XXng3vUCnulKljiyW5dOZzBZvcpTCbBVz3gq55JRb9v96pQm3dmQCl8 TKqCxDIep/lX6yicrL33tVl9GXiUmr0Ix3o7f/WOIA54qnRd0oWwdEnDtD4leRqMhxM3 GRYw== X-Gm-Message-State: ALoCoQnHagQ8Fmwm10ysPAOqcEt4M+A+DTOCaFNSm6RNp37c2qq5B/k9TfXo7Xf8ZCX+h1bTSbdP X-Received: by 10.194.77.97 with SMTP id r1mr17821164wjw.98.1437051650608; Thu, 16 Jul 2015 06:00:50 -0700 (PDT) Received: from [192.168.0.101] ([90.152.119.35]) by smtp.googlemail.com with ESMTPSA id jy6sm13005559wjc.4.2015.07.16.06.00.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 06:00:49 -0700 (PDT) Message-ID: <55A7AB01.1030208@linaro.org> Date: Thu, 16 Jul 2015 14:00:49 +0100 From: Zoltan Kiss User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Polevoy, Igor" , "dev@dpdk.org" References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] driver initialization in DPDK 2.0 built into a shared library. 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: Thu, 16 Jul 2015 13:00:51 -0000 On 14/07/15 19:21, Polevoy, Igor wrote: > Hi, > We are developing an application that uses DPDK PMD functionality . > We are using a linux shared library which contains the network packets processing code and it is statically linked with all the necessary DPDK libs. > The .so is loaded by the main program. > For the DPDK compilation we have added the -fPIC to the GCC options. > > While it all worked fine with DPDK 1.6 where we had the rte_pmd_init_all method, in the 2.0 version the > drivers registration methods (PMD_REGISTER_DRIVER) are not called when the shared library is loaded. > > Although, I can go along the lines of the rte_pmd_init all and manually call the driver registration, I'm concerned > that DPDK has other drivers initialization calls, and I don't actually know which are needed or could be needed and when. > > Do you have any advice on that? What is the best way to resolve this issue? > > Thank you > Igor. > I've seen a similar problem, but in a different setup. My app (OVS) links to ODP-DPDK statically, which then links to DPDK code statically. I found that the devinitfn_* functions are not called because OVS doesn't call directly into the DPDK library, only into ODP-DPDK. The workaround for me was to refer to those functions in the ODP-DPDK code: #define PMD_EXT(drv) extern void devinitfn_##drv(void); PMD_EXT(bond_drv) PMD_EXT(em_pmd_drv) ... But there might be better solutions than that. This one is fragile, if you update DPDK you have to remember adding these references for new PMDs. Zoli