From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3613FA0C47; Sat, 25 Sep 2021 15:45:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3C6D4003D; Sat, 25 Sep 2021 15:45:55 +0200 (CEST) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mails.dpdk.org (Postfix) with ESMTP id A16044003C for ; Sat, 25 Sep 2021 15:45:54 +0200 (CEST) Received: by mail-lf1-f43.google.com with SMTP id y28so52694248lfb.0 for ; Sat, 25 Sep 2021 06:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v6zem+vukAV3+yzPMSnKEppR154qUIifFBhfHuVt6g8=; b=TDSYJn4ekZkZwSHDyzde2wP32HlT1p4x6wuLlAZ8TyvrwY6swQsis8zAQkMBhiA9ab jn/JPlGEMXLWoTm/eT4drFqWwtmrV6nVJEpI8b8VxsT7X7hMb6b6s6lr4nlOsSzMgBVV T9IVd4/ji+sRCW4ZSm99oXIXl4D7pbHRKZQ26p3lXXKAxCvSQSOEOxq3MDpnndU5zNb3 cv/S+5K06Q7S7tNx3slQ2gfjaosGvg7PSvPoC9KtvkVDjEwwJ5a2Qv06huLcOP2+ghjC yg5bZoic/aQ0pZgTo12rzHPya7+v24jR/MGQQo6B/6+/MZV6Hpm00ggiaLkEqNZ7NVoL u7vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v6zem+vukAV3+yzPMSnKEppR154qUIifFBhfHuVt6g8=; b=aUotYfjhF3jDSXvev0Z+dhBy3kcLA7JZLLLlHFtOuYYS5Wbqfn84AgQh4QP35H9Db7 yGqiUhwmEcjZXqnfMS+aScWtm/W2yQGvEWkRYPI06Wfxkff3LedA30TM/3OZiHeDOW6m IWBls3Tf5gqEpO/qjjPej7l3ioPHmtUwEQmVIe7eD/vIokVfgDUoNOQ6PkNIMXsY30SP W5RgoxYAdehiVvKyxkTk6MlgPBue4QUrZz34/dRcCV/5O/U/AYerBZTirhfbGV8l3T/K NhlB+abjazS6mufq/2AZq4XNUJG0QOf920AkKVUNcjzw7rpEke9NiOx26idZiiLfz2ki 6a8g== X-Gm-Message-State: AOAM533O3vEi5al3ri55TYDrj8D0/Ld+0h7ouwbZGvPf2Gi58JlegQQl hhr8ZrpIcFcspk5nWhS5u9J+hQZQd3sBTll4VMBaG64QsRnhAA== X-Google-Smtp-Source: ABdhPJyGkqARHtiqDoL0LVdyQ3JAiCcunxLxWDOeD+TAnyHllyxaDXZyENup4bw6Jvrp2gXjOCKNx4DMWfWQ1XXFcws= X-Received: by 2002:a19:c3d3:: with SMTP id t202mr14707789lff.678.1632577553936; Sat, 25 Sep 2021 06:45:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: William Tu Date: Sat, 25 Sep 2021 06:45:17 -0700 Message-ID: To: dpdk-dev Cc: Dmitry Kozliuk Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] RTE_REGISTER_BUS does not work on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" I've resolved the issue by adding -Wl,/WHOLEARCHIVE at libdpdk.pc Thanks William On Fri, Sep 24, 2021 at 7:41 AM William Tu wrote: > > Hi, > > I continued my experiment and observed below > 1. for dpdk-testpmd.exe which works fine, the functions in driver/bus/pci/* > are there in the binary, ex: > PS C:\dpdk\build\app> dumpbin.exe /ALL .\dpdk-testpmd.exe | grep rte_pci_set_b > 0001D1F0 0068DB40 0068DC32 0073BDEC rte_pci_set_bus_master > So I think that's why > RTE_REGISTER_BUS(pci, rte_pci_bus.bus) works in dpdk-testpmd.exe > > 2. for my own application binary which static links DPDK library using > pkgconfig, > PS C:\example\build> dumpbin.exe /ALL .\demo.exe | grep rte_pci_set > > and it only has symbols from lib/eal/*, ex: > PS C:\example\build> dumpbin.exe /ALL .\demo.exe | grep rte_bus_re > 00000D14 000152D0 0001559E 00095CC8 rte_bus_register > > Apparently the pci bus constructor function doesn't exist in my binary. > I'm going to try using meson subproject > https://mesonbuild.com/Subprojects.html > > Thanks, > William > > On Thu, Sep 23, 2021 at 10:47 AM William Tu wrote: > > > > Hi, > > > > I'm trying to run OVS-DPDK on Windows (building OVS binaries and > > statically link DPDK windows library), and it doesn't work due to > > rte_bus_scan() find no available devices. (However, when using > > dpdk-testpmd.exe, it finds the device successfully) > > > > I realized that the PCI bus driver calls RTE_REGISTER_BUS to > > register itself, and it's a macro creating the businitfn_pci, and calls > > rte_bus_register. But somehow on my system, it does not invoke > > so actually the 'rte_bus_list' is empty. And I guess this is due to > > "constructor" function not working correctly when I static link DPDK. > > > > When linking DPDK using gcc, OVS passes the linker option '--whole-archive'. > > https://github.com/openvswitch/ovs/blob/master/acinclude.m4#L509 > > > > I tried adding -Wl,-force_load, or -Wl,/WHOLEARCHIVE at libdpdk.pc. > > So far I still couldn't get it to work. Any suggestions or comments are welcome! > > > > Thank you > > William