From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) by dpdk.org (Postfix) with ESMTP id A2FFAFABC for ; Mon, 19 Dec 2016 22:59:57 +0100 (CET) Received: by mail-it0-f42.google.com with SMTP id c20so69151771itb.0 for ; Mon, 19 Dec 2016 13:59:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rOsLd2XkF0ew1FCpnwvJGOyWy6o1A9hmdElpiJO7064=; b=Bbbc8/a93WMMMFRP8lwv4AUHOHgUo7KnAbIkVCUgyqynpiOuSPoFLG0QDAiqjGueUB hguAMFno32qTb3J8DSpCwrASwh0ke3BJ7ZV76PX8lsFb81RJuQXUskezmbuP1k3dHS5R sFYo7BxSQAioC6o2P8OclllQ5Y0rm1qBQZE6B1/vDBLsTdeFpDrA6zAW5IbOKDsKhkE/ FnZV+ckrCOGcV2Zb64u0A84woLkcd7a100QWFT0ncqvMbSPcrKAtY2yfXVaW978Ar8WY LP9vDfu+WGZtnAg1cM1nYo6A/cya3+A5FfsURD0+kX9Gj40wIKcdiQEqlqUHpRAxnjv9 hEgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rOsLd2XkF0ew1FCpnwvJGOyWy6o1A9hmdElpiJO7064=; b=M6OsmLLatBww2PP4BaULMIrdVKD5LDnI7MMU3i7pXen84xX4eg05CyUG0EqIhzJ7bG nRHB5emwP0pgG+JzEX/us2WzNp4mYe9imcuLEtY3qClLbZdAfvrzo/VThdLPal/yOHCi R7u8cFz3TPnHQ62eBhMpmvdQTZPSCtppOB7hSWPFqt7adFeeRo/ufegu0rUZn2/Z9Zab Sk5bAFXJOeI5Edvxeas5Ictw1KItDRSMtODdH6YO0LOQA+cQTmfnKpDAZbilzV4hTig0 oTlB8jc79G84NJXhu16KPpnAH4AWs8OSlcT52twjKAzbvCwJt3wd85yH4+otK6EY/pS6 cv2w== X-Gm-Message-State: AKaTC00DAs2TtUHt+kUfNmfoX+X/o7apR6HhAiRFy90m+HAU0hbLp7TQxFQlq7mK66m/4A== X-Received: by 10.36.116.202 with SMTP id o193mr18365681itc.96.1482184796896; Mon, 19 Dec 2016 13:59:56 -0800 (PST) Received: from xeon-e3.wavecable.com (204-195-18-65.wavecable.com. [204.195.18.65]) by smtp.gmail.com with ESMTPSA id p20sm8270581itc.2.2016.12.19.13.59.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Dec 2016 13:59:56 -0800 (PST) From: Stephen Hemminger X-Google-Original-From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 19 Dec 2016 13:59:35 -0800 Message-Id: <20161219215944.17226-5-sthemmin@microsoft.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161219215944.17226-1-sthemmin@microsoft.com> References: <20161219215944.17226-1-sthemmin@microsoft.com> Subject: [dpdk-dev] [PATCH 04/13] eal: introduce driver type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 21:59:58 -0000 Since multiple buses and device types need to be supported. Provide type field in driver. --- lib/librte_eal/common/include/rte_dev.h | 15 ++++++++++++--- lib/librte_eal/common/include/rte_pci.h | 1 + lib/librte_eal/common/include/rte_vdev.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index e5471a22..3f4e26e6 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -144,12 +144,21 @@ void rte_eal_device_insert(struct rte_device *dev); void rte_eal_device_remove(struct rte_device *dev); /** + * Type of device driver + */ +enum rte_driver_type { + PMD_VIRTUAL, + PMD_PCI, +}; + +/** * A structure describing a device driver. */ struct rte_driver { TAILQ_ENTRY(rte_driver) next; /**< Next in list. */ - const char *name; /**< Driver name. */ - const char *alias; /**< Driver alias. */ + const char *name; /**< Driver name. */ + const char *alias; /**< Driver alias. */ + enum rte_driver_type type; /**< Driver type. */ }; /** @@ -243,4 +252,4 @@ __attribute__((used)) = str } #endif -#endif /* _RTE_VDEV_H_ */ +#endif /* _RTE_DEV_H_ */ diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 9ce88472..d377d539 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -492,6 +492,7 @@ RTE_INIT(pciinitfn_ ##nm); \ static void pciinitfn_ ##nm(void) \ {\ (pci_drv).driver.name = RTE_STR(nm);\ + (pci_drv).driver.type = PMD_PCI; \ rte_eal_pci_register(&pci_drv); \ } \ RTE_PMD_EXPORT_NAME(nm, __COUNTER__) diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h index 784e837d..98fb5bb5 100644 --- a/lib/librte_eal/common/include/rte_vdev.h +++ b/lib/librte_eal/common/include/rte_vdev.h @@ -88,6 +88,7 @@ static void vdrvinitfn_ ##vdrv(void)\ {\ (vdrv).driver.name = RTE_STR(nm);\ (vdrv).driver.alias = vdrvinit_ ## nm ## _alias;\ + (vdrv).driver.type = PMD_VIRTUAL;\ rte_eal_vdrv_register(&vdrv);\ } \ RTE_PMD_EXPORT_NAME(nm, __COUNTER__) -- 2.11.0