From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-x243.google.com (mail-ie0-x243.google.com [IPv6:2607:f8b0:4001:c03::243]) by dpdk.org (Postfix) with ESMTP id 558DE1F3 for ; Thu, 29 Aug 2013 09:54:23 +0200 (CEST) Received: by mail-ie0-f195.google.com with SMTP id f4so31646iea.2 for ; Thu, 29 Aug 2013 00:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=fwji3unYyewWIqqdq3ogk4z8eCrLdb2QOSFGp7CykKg=; b=FlDTP4C3kuDNg+sdTczsdZowsXbDdCd41ojKm7mCKaOjDZ6iOlHVGMMyaCr3P+jyM9 YUlZNO/z1un2Ode0lsDUX3WN2zW2OdWmRk05O6Pr8RZq1VQt/tbqu+uDxA0LQsnwA+d3 adZSjIybP9hjlRgHA63NTwhCePRRdUsLWhblxOFB9uYgN++bz/DcQAoGM2+D4SsE/w4X uXTp7/P/2GddhrwAfqR+41/TNNBDWlwMO9hGBA8OZxSy8dokxGosoJ1XoU/CNPhTiAx1 CtPgqFRm6SA1ObveOQa3L2d5VtL5jRvnqXZ03+g6BUMbF8IFR/uL7VAtyiNctRpmfAM4 1fPQ== MIME-Version: 1.0 X-Received: by 10.42.208.211 with SMTP id gd19mr1017934icb.15.1377762895368; Thu, 29 Aug 2013 00:54:55 -0700 (PDT) Received: by 10.64.5.226 with HTTP; Thu, 29 Aug 2013 00:54:55 -0700 (PDT) Date: Thu, 29 Aug 2013 16:54:55 +0900 Message-ID: From: Tetsuya Mukawa To: dev@dpdk.org Content-Type: text/plain; charset=ISO-8859-1 Subject: [dpdk-dev] About 'CONFIG_RTE_EAL_UNBIND_PORTS' 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, 29 Aug 2013 07:54:23 -0000 Hi folks, Someone, could you please let me know what is a case that I need to enable 'CONFIG_RTE_EAL_UNBIND_PORTS'? Also, if 'CONFIG_RTE_EAL_UNBIND_PORTS' is enabled, it seems an application dumps error when it exits This error is displayed by following code. -------------------------------------- pci_exit_process(struct rte_pci_device *dev) { .............. if (close(dev->intr_handle.fd) == -1){ RTE_LOG(ERR, EAL, "Error closing interrupt handle\n"); return -1; } -------------------------------------- I've confirmed when the issue occurs, always the fd is '0'. I guess that the fd should be initialized as '-1', but actually it is initialized as '0'. So during finalization, pci_exit_process() may try to close STDIN. (But I am not sure why closing STDIN returns error. STDIN might be already closed by somewhere?) Anyway, here is a patch I wrote to fix the issue. Is this correct? -------------------------------------- diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index c793148..7bb03e9 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -519,6 +519,8 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, dev->addr.devid = devid; dev->addr.function = function; + dev->intr_handle.fd = -1; + /* get vendor id */ rte_snprintf(filename, sizeof(filename), "%s/vendor", dirname); if (eal_parse_sysfs_value(filename, &tmp) < 0) { @@ -718,7 +720,8 @@ pci_exit_process(struct rte_pci_device *dev) RTE_LOG(ERR, EAL, "Error with munmap\n"); return -1; } - if (close(dev->intr_handle.fd) == -1){ + if ((dev->intr_handle.fd != -1) && + (close(dev->intr_handle.fd) == -1)) { RTE_LOG(ERR, EAL, "Error closing interrupt handle\n"); return -1; } -------------------------------------- Also here is the procedure to reproduce the issue. 1. Prepare Fedora16(3.6.11-4.fc16.x86_64) as a guest OS. 2. Add 2 network interfaces(virtio-net) to the guest. 3. Compile dpdk-1.3.2r2 with CONFIG_RTE_EAL_UNBIND_PORTS' enabled on the guest. 4. Run testpmd using virtio-net-pmd on the guest. 5. Quit testpmd, and check error messages. Best Regards, Tetsuya Mukawa