DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xiao Wang <xiao.w.wang@intel.com>
To: dev@dpdk.org
Cc: zhihong.wang@intel.com, jianfeng.tan@intel.com,
	tiwei.bie@intel.com, maxime.coquelin@redhat.com,
	yliu@fridaylinux.org, cunming.liang@intel.com,
	dan.daly@intel.com, remy.horton@intel.com,
	mohammad.abdul.awal@intel.com, Xiao Wang <xiao.w.wang@intel.com>
Subject: [dpdk-dev] [PATCH RFC 1/4] bus/pci: expose PCI API to app
Date: Fri, 29 Dec 2017 10:04:59 -0800	[thread overview]
Message-ID: <1514570702-154906-2-git-send-email-xiao.w.wang@intel.com> (raw)
In-Reply-To: <1514570702-154906-1-git-send-email-xiao.w.wang@intel.com>

The vDPA device driver in later patch can use the existing pci api to
set up device.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/bus/pci/linux/pci.c      | 4 ++--
 drivers/bus/pci/linux/pci_init.h | 8 ++++++++
 drivers/bus/pci/linux/pci_vfio.c | 6 +++---
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
index 5da6728..6fe35bb 100644
--- a/drivers/bus/pci/linux/pci.c
+++ b/drivers/bus/pci/linux/pci.c
@@ -61,7 +61,7 @@
 
 extern struct rte_pci_bus rte_pci_bus;
 
-static int
+int
 pci_get_kernel_driver_by_path(const char *filename, char *dri_name)
 {
 	int count;
@@ -198,7 +198,7 @@
 }
 
 /* parse the "resource" sysfs file */
-static int
+int
 pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev)
 {
 	FILE *f;
diff --git a/drivers/bus/pci/linux/pci_init.h b/drivers/bus/pci/linux/pci_init.h
index f342c47..dbca3dd 100644
--- a/drivers/bus/pci/linux/pci_init.h
+++ b/drivers/bus/pci/linux/pci_init.h
@@ -35,6 +35,7 @@
 #define EAL_PCI_INIT_H_
 
 #include <linux/version.h>
+#include <stdbool.h>
 
 #include <rte_vfio.h>
 
@@ -106,6 +107,13 @@ void pci_vfio_ioport_write(struct rte_pci_ioport *p,
 
 int pci_vfio_is_enabled(void);
 
+int pci_get_kernel_driver_by_path(const char *filename, char *dri_name);
+int pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev);
+
+int pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table);
+int pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd);
+int pci_vfio_set_bus_master(int dev_fd, bool op);
+
 #endif
 
 #endif /* EAL_PCI_INIT_H_ */
diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 1f93fa4..f1a47b7 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -89,7 +89,7 @@
 }
 
 /* get PCI BAR number where MSI-X interrupts are */
-static int
+int
 pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)
 {
 	int ret;
@@ -174,7 +174,7 @@
 }
 
 /* set PCI bus mastering */
-static int
+int
 pci_vfio_set_bus_master(int dev_fd, bool op)
 {
 	uint16_t reg;
@@ -207,7 +207,7 @@
 }
 
 /* set up interrupt support (but not enable interrupts) */
-static int
+int
 pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd)
 {
 	int i, ret, intr_idx;
-- 
1.8.3.1

  reply	other threads:[~2017-12-29  9:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-29 18:04 [dpdk-dev] [PATCH RFC 0/4] examples/vdpa: add virtio-net PCI device driver Xiao Wang
2017-12-29 18:04 ` Xiao Wang [this message]
2017-12-29 18:05 ` [dpdk-dev] [PATCH RFC 2/4] vhost: expose vhost lib to app Xiao Wang
2017-12-29 18:05 ` [dpdk-dev] [PATCH RFC 3/4] vhost: get all callfd before setting datapath Xiao Wang
2017-12-29 18:05 ` [dpdk-dev] [PATCH RFC 4/4] examples/vdpa: add virtio-net PCI device driver Xiao Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1514570702-154906-2-git-send-email-xiao.w.wang@intel.com \
    --to=xiao.w.wang@intel.com \
    --cc=cunming.liang@intel.com \
    --cc=dan.daly@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mohammad.abdul.awal@intel.com \
    --cc=remy.horton@intel.com \
    --cc=tiwei.bie@intel.com \
    --cc=yliu@fridaylinux.org \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).