From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by dpdk.org (Postfix) with ESMTP id 82EC75946 for ; Thu, 28 Aug 2014 12:50:10 +0200 (CEST) Received: by mail-vc0-f174.google.com with SMTP id hy4so575394vcb.33 for ; Thu, 28 Aug 2014 03:54:18 -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=zONXr96e1kf6B8wBriqRqjZSnsSTbtXcGMCyszGzqug=; b=qDUxyG21soqddX5zRPNa72R3X0gZiHZJJ+2ZVJNDW6xnVsk6jn2S44V8EUQ7KoupRd 8lb5lY36O809DrM8Gjri9ZBXDE38CZR0yM+ZsMNx8pGOYvBtfn9ly+Xc3fnBG7BmtTp/ h+STIsT4enmhNcV6xlyiHz/2fmmsxPLmImsgVnofLkxc2tt3yRkEDzuPuMElSeUjx289 vJ++j7/nYnXplbdj654mcpPYVD+JPbI89oMd7Rxg7WytjO5R2dfZQHHgRkGXqOzZG0SU P6ZtwSsFIEKCKMLypzqaReUWHkirXvVRVRfhRKHWjNxi29j6t0IrhSSqysgJe1nsVjxQ 6POQ== MIME-Version: 1.0 X-Received: by 10.220.132.207 with SMTP id c15mr2535632vct.12.1409223258067; Thu, 28 Aug 2014 03:54:18 -0700 (PDT) Received: by 10.52.181.197 with HTTP; Thu, 28 Aug 2014 03:54:18 -0700 (PDT) Date: Thu, 28 Aug 2014 19:54:18 +0900 Message-ID: From: =?UTF-8?B?7J206re87ZmN?= To: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [ethdev] Multiple devices with single PCI 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, 28 Aug 2014 10:50:10 -0000 Hello. I found that DPDK has an abstraction for having multiple devices with single PCI. (RTE_PCI_DRV_MULTIPLE flag) However, their is a naming collision while registering multiple devices. Here is my possible solution. Best regards. Keunhong. ===================================================== commit b4fb08c42584283a7c5fbb251ab23f0e2b5f099e Author: leeopop 2014-07-24 22:28:12 Committer: leeopop 2014-07-24 22:28:12 Parent: bcc733c4780a007f56564277a79309c427367cc2 (ethdev: fix build of named allocation debug) Branches: master, github/master multiple dev support ------------------------ lib/librte_ether/rte_ethdev.c ------------------------ diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index fd1010a..06dda6b 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -204,8 +204,12 @@ eth_drv = (struct eth_driver *)pci_drv; /* Create unique Ethernet device name using PCI address */ - snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN, "%d:%d.%d", - pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); + if(pci_drv->drv_flags & RTE_PCI_DRV_MULTIPLE) + snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN, "%d:%d.%d-%d", + pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function, nb_ports); + else + snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN, "%d:%d.%d", + pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); eth_dev = rte_eth_dev_allocate(ethdev_name); if (eth_dev == NULL)