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 128E4A0548; Fri, 24 Sep 2021 16:42:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C3A1412F8; Fri, 24 Sep 2021 16:42:04 +0200 (CEST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mails.dpdk.org (Postfix) with ESMTP id 6ADEC4126F for ; Fri, 24 Sep 2021 16:42:03 +0200 (CEST) Received: by mail-lf1-f41.google.com with SMTP id t10so41260415lfd.8 for ; Fri, 24 Sep 2021 07:42:03 -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=L97SuvE1zLrMvenHH7b1D/+hB8Zer5sMA7D+2OsiEgk=; b=KppA8aM63i0v2AVZ+Z+oz5Hsmi8xw2uUFMw71dSisD3LCRnOWHgjRbW/p+3gWiP8I0 xeJ/GaKeBmv1+bJdkKSqZn9Rt96TDFklpQXvTelQESZy1J3LYD4N5ARinepW7aaAEb/O j4dU+jRURmM1tTux/E7sZF3zeFJGJuZgRu4HKuHHom+/wuNXKEpbVnY81fLDt0e0Zo9Y qkOEnNbLGH9K2OsHSNgVJ7vI90KA+0u0ufRVYOzetC4NdkKsi+OeZV0m6MP+SFFrWoL2 ZigU75CKUQg0i0Lp4edRKunsaJw9kTIE4WEjBi16a5wU3vvVV92v42TWKcs2c3YCVw+2 ADQg== 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=L97SuvE1zLrMvenHH7b1D/+hB8Zer5sMA7D+2OsiEgk=; b=1f5iSEM+w2/Hk06bBh7NYVL2EE+/kVZET7tqTHzBUN6cdpKKh8sLZxY566z6r3WeRQ 4XiIfW+Z0l9iGa3jK9Cm8pKU70JUD8aZ7W1tk4AC6GaduH/PaIbC6ZMwHE4gkCpTQBjT w68fVFciBL1QyzxtjYBUL4g+u+IcFsDLjL2L4Y804NAo/fgF71Y0QZ3ul3GMcwYz66k4 8j9TSHGkjvVG1lwuVIHlqWTg3BfAvpkjQ3wySxV6pdEjiB292bfwd3zc6d/whvA5Lgfg Jc/g2tTHnMb3I/Eb27vbpFbuqqaLVRfIuHebF+D+BHVSQlTay8DOzGMzyQ6BSrgySHqj gCBg== X-Gm-Message-State: AOAM5333mVcvG6FYPGHSu3Nd6ef4IdRabogBWLC6i3cSV+rl6Ob+BjAx gBRncXEfuof515szK79V+DYznjMO3QDaJnLwuRw//xE16NGSug== X-Google-Smtp-Source: ABdhPJwsVgEtC4WzLrcXQLlCY4tUeNdlUfgSwAO2hnIvODG6AzDUL1GIjbTtM+u3NZfL7EKSuLAHhesoxr4wzXBZ/ig= X-Received: by 2002:a05:6512:33c3:: with SMTP id d3mr9849189lfg.194.1632494520360; Fri, 24 Sep 2021 07:42:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: William Tu Date: Fri, 24 Sep 2021 07:41:23 -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" 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