[dpdk-dev] [RFC 14/24] vhost: move librte_vhost to drivers/

Stefan Hajnoczi stefanha at redhat.com
Fri Jan 19 14:44:34 CET 2018


PCI drivers depend on the rte_bus_pci.h header file which is only
available when drivers/ is built.  Code in lib/ cannot depend on code in
drivers/ because lib/ is built first during make install.

This patch moves librte_vhost into drivers/ so that later patches can
add a virtio-vhost-pci driver to librte_vhost without exporting all
private vhost.h symbols.

Signed-off-by: Stefan Hajnoczi <stefanha at redhat.com>
---
Is there a better way of giving a PCI driver access to librte_vhost
transport (not a public API that apps should use)?
---
 drivers/Makefile                                    | 2 ++
 {lib => drivers}/librte_vhost/Makefile              | 0
 lib/Makefile                                        | 3 ---
 {lib => drivers}/librte_vhost/fd_man.h              | 0
 {lib => drivers}/librte_vhost/iotlb.h               | 0
 {lib => drivers}/librte_vhost/rte_vhost.h           | 0
 {lib => drivers}/librte_vhost/vhost.h               | 0
 {lib => drivers}/librte_vhost/vhost_user.h          | 0
 {lib => drivers}/librte_vhost/fd_man.c              | 0
 {lib => drivers}/librte_vhost/iotlb.c               | 0
 {lib => drivers}/librte_vhost/socket.c              | 0
 {lib => drivers}/librte_vhost/trans_af_unix.c       | 0
 {lib => drivers}/librte_vhost/vhost.c               | 0
 {lib => drivers}/librte_vhost/vhost_user.c          | 0
 {lib => drivers}/librte_vhost/virtio_net.c          | 0
 {lib => drivers}/librte_vhost/rte_vhost_version.map | 0
 16 files changed, 2 insertions(+), 3 deletions(-)
 rename {lib => drivers}/librte_vhost/Makefile (100%)
 rename {lib => drivers}/librte_vhost/fd_man.h (100%)
 rename {lib => drivers}/librte_vhost/iotlb.h (100%)
 rename {lib => drivers}/librte_vhost/rte_vhost.h (100%)
 rename {lib => drivers}/librte_vhost/vhost.h (100%)
 rename {lib => drivers}/librte_vhost/vhost_user.h (100%)
 rename {lib => drivers}/librte_vhost/fd_man.c (100%)
 rename {lib => drivers}/librte_vhost/iotlb.c (100%)
 rename {lib => drivers}/librte_vhost/socket.c (100%)
 rename {lib => drivers}/librte_vhost/trans_af_unix.c (100%)
 rename {lib => drivers}/librte_vhost/vhost.c (100%)
 rename {lib => drivers}/librte_vhost/vhost_user.c (100%)
 rename {lib => drivers}/librte_vhost/virtio_net.c (100%)
 rename {lib => drivers}/librte_vhost/rte_vhost_version.map (100%)

diff --git a/drivers/Makefile b/drivers/Makefile
index 57e1a48a8..67f110c25 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -12,5 +12,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
 DEPDIRS-crypto := bus mempool
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
 DEPDIRS-event := bus mempool net
+DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += librte_vhost
+DEPDIRS-librte_vhost := bus
 
 include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/lib/librte_vhost/Makefile b/drivers/librte_vhost/Makefile
similarity index 100%
rename from lib/librte_vhost/Makefile
rename to drivers/librte_vhost/Makefile
diff --git a/lib/Makefile b/lib/Makefile
index 679912a28..dd916901b 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -30,9 +30,6 @@ DEPDIRS-librte_security += librte_ether
 DEPDIRS-librte_security += librte_cryptodev
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += librte_eventdev
 DEPDIRS-librte_eventdev := librte_eal librte_ring librte_ether librte_hash
-DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += librte_vhost
-DEPDIRS-librte_vhost := librte_eal librte_mempool librte_mbuf librte_ether \
-			librte_net
 DIRS-$(CONFIG_RTE_LIBRTE_HASH) += librte_hash
 DEPDIRS-librte_hash := librte_eal librte_ring
 DIRS-$(CONFIG_RTE_LIBRTE_EFD) += librte_efd
diff --git a/lib/librte_vhost/fd_man.h b/drivers/librte_vhost/fd_man.h
similarity index 100%
rename from lib/librte_vhost/fd_man.h
rename to drivers/librte_vhost/fd_man.h
diff --git a/lib/librte_vhost/iotlb.h b/drivers/librte_vhost/iotlb.h
similarity index 100%
rename from lib/librte_vhost/iotlb.h
rename to drivers/librte_vhost/iotlb.h
diff --git a/lib/librte_vhost/rte_vhost.h b/drivers/librte_vhost/rte_vhost.h
similarity index 100%
rename from lib/librte_vhost/rte_vhost.h
rename to drivers/librte_vhost/rte_vhost.h
diff --git a/lib/librte_vhost/vhost.h b/drivers/librte_vhost/vhost.h
similarity index 100%
rename from lib/librte_vhost/vhost.h
rename to drivers/librte_vhost/vhost.h
diff --git a/lib/librte_vhost/vhost_user.h b/drivers/librte_vhost/vhost_user.h
similarity index 100%
rename from lib/librte_vhost/vhost_user.h
rename to drivers/librte_vhost/vhost_user.h
diff --git a/lib/librte_vhost/fd_man.c b/drivers/librte_vhost/fd_man.c
similarity index 100%
rename from lib/librte_vhost/fd_man.c
rename to drivers/librte_vhost/fd_man.c
diff --git a/lib/librte_vhost/iotlb.c b/drivers/librte_vhost/iotlb.c
similarity index 100%
rename from lib/librte_vhost/iotlb.c
rename to drivers/librte_vhost/iotlb.c
diff --git a/lib/librte_vhost/socket.c b/drivers/librte_vhost/socket.c
similarity index 100%
rename from lib/librte_vhost/socket.c
rename to drivers/librte_vhost/socket.c
diff --git a/lib/librte_vhost/trans_af_unix.c b/drivers/librte_vhost/trans_af_unix.c
similarity index 100%
rename from lib/librte_vhost/trans_af_unix.c
rename to drivers/librte_vhost/trans_af_unix.c
diff --git a/lib/librte_vhost/vhost.c b/drivers/librte_vhost/vhost.c
similarity index 100%
rename from lib/librte_vhost/vhost.c
rename to drivers/librte_vhost/vhost.c
diff --git a/lib/librte_vhost/vhost_user.c b/drivers/librte_vhost/vhost_user.c
similarity index 100%
rename from lib/librte_vhost/vhost_user.c
rename to drivers/librte_vhost/vhost_user.c
diff --git a/lib/librte_vhost/virtio_net.c b/drivers/librte_vhost/virtio_net.c
similarity index 100%
rename from lib/librte_vhost/virtio_net.c
rename to drivers/librte_vhost/virtio_net.c
diff --git a/lib/librte_vhost/rte_vhost_version.map b/drivers/librte_vhost/rte_vhost_version.map
similarity index 100%
rename from lib/librte_vhost/rte_vhost_version.map
rename to drivers/librte_vhost/rte_vhost_version.map
-- 
2.14.3



More information about the dev mailing list