Skip to contentSkip to conversation

Hyper-V Poll Mode Driver

PATCH In review Stephen Hemminger 2 participants 9 messages Apr 20, 2015 – Apr 21, 2015 2 messages not in the archive Library code

lore
Share & tools
lore
#0 lore raw

cover Hyper-V Poll Mode Driver

This is revised version of earlier patches to support Hyper-V poll mode driver. The main changes were to rebase onto DPDK 2.0 with a few other style cleanups to keep checkpatch at bay.

Stephen Hemminger (7):
ether: add function to query for link state interrupt
pmd: change drivers initialization for pci
hv: add basic vmbus support
hv: uio driver
hv: poll mode driver
hv: enable driver in common config
hv: add kernel patch

 config/common_linuxapp                             |    9 +
 lib/Makefile                                       |    1 +
 lib/librte_eal/common/Makefile                     |    2 +-
 lib/librte_eal/common/eal_common_options.c         |    5 +
 lib/librte_eal/common/eal_internal_cfg.h           |    1 +
 lib/librte_eal/common/eal_options.h                |    2 +
 lib/librte_eal/common/eal_private.h                |   10 +
 lib/librte_eal/linuxapp/Makefile                   |    3 +
 lib/librte_eal/linuxapp/eal/Makefile               |    3 +
 lib/librte_eal/linuxapp/eal/eal.c                  |   11 +
 lib/librte_eal/linuxapp/hv_uio/Makefile            |   57 +
 lib/librte_eal/linuxapp/hv_uio/hv_uio.c            |  551 +++++++
 lib/librte_eal/linuxapp/hv_uio/hyperv_net.h        |  907 +++++++++++
 .../linuxapp/hv_uio/vmbus-get-pages.patch          |   55 +
 lib/librte_ether/rte_ethdev.c                      |  142 +-
 lib/librte_ether/rte_ethdev.h                      |   27 +-
 lib/librte_pmd_e1000/em_ethdev.c                   |    2 +-
 lib/librte_pmd_e1000/igb_ethdev.c                  |    4 +-
 lib/librte_pmd_enic/enic_ethdev.c                  |    2 +-
 lib/librte_pmd_fm10k/fm10k_ethdev.c                |    2 +-
 lib/librte_pmd_hyperv/Makefile                     |   28 +
 lib/librte_pmd_hyperv/hyperv.h                     |  169 ++
 lib/librte_pmd_hyperv/hyperv_drv.c                 | 1653 ++++++++++++++++++++
 lib/librte_pmd_hyperv/hyperv_drv.h                 |  558 +++++++
 lib/librte_pmd_hyperv/hyperv_ethdev.c              |  332 ++++
 lib/librte_pmd_hyperv/hyperv_logs.h                |   69 +
 lib/librte_pmd_hyperv/hyperv_rxtx.c                |  403 +++++
 lib/librte_pmd_hyperv/hyperv_rxtx.h                |   35 +
 lib/librte_pmd_i40e/i40e_ethdev.c                  |    2 +-
 lib/librte_pmd_i40e/i40e_ethdev_vf.c               |    2 +-
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c                |    4 +-
 lib/librte_pmd_virtio/virtio_ethdev.c              |    2 +-
 lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c            |    2 +-
 mk/rte.app.mk                                      |    4 +
 34 files changed, 5039 insertions(+), 20 deletions(-)
 create mode 100644 lib/librte_eal/linuxapp/hv_uio/Makefile
 create mode 100644 lib/librte_eal/linuxapp/hv_uio/hv_uio.c
 create mode 100644 lib/librte_eal/linuxapp/hv_uio/hyperv_net.h
 create mode 100644 lib/librte_eal/linuxapp/hv_uio/vmbus-get-pages.patch
 create mode 100644 lib/librte_pmd_hyperv/Makefile
 create mode 100644 lib/librte_pmd_hyperv/hyperv.h
 create mode 100644 lib/librte_pmd_hyperv/hyperv_drv.c
 create mode 100644 lib/librte_pmd_hyperv/hyperv_drv.h
 create mode 100644 lib/librte_pmd_hyperv/hyperv_ethdev.c
 create mode 100644 lib/librte_pmd_hyperv/hyperv_logs.h
 create mode 100644 lib/librte_pmd_hyperv/hyperv_rxtx.c
 create mode 100644 lib/librte_pmd_hyperv/hyperv_rxtx.h
Signature · 1 line
2.1.4

A message that is not in the archive (sent off-list or not yet received): 1429566854-17490-1-git-send-email-stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org

#2 lore raw

PATCH 1/7 ether: add function to query for link state interrupt

From: Stephen Hemminger <[email protected]>

Allow application to query whether link state will work. This is also part of abstracting dependency on PCI.

---
 lib/librte_ether/rte_ethdev.c | 14 ++++++++++++++
 lib/librte_ether/rte_ethdev.h | 12 ++++++++++++
 2 files changed, 26 insertions(+)
lib/librte_ether/rte_ethdev.c +14 -0
index e20cca5..9577d17 100644
@@ -1340,6 +1340,20 @@ rte_eth_dev_start(uint8_t port_id)
 	return 0;
 }
 
+int
+rte_eth_has_link_state(uint8_t port_id)
+{
+	struct rte_eth_dev *dev;
+
+	if (port_id >= nb_ports) {
+		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
+		return 0;
+	}
+	dev = &rte_eth_devices[port_id];
+
+	return (dev->pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC) != 0;
+}
+
 void
 rte_eth_dev_stop(uint8_t port_id)
 {
lib/librte_ether/rte_ethdev.h +12 -0
index 4648290..991023b 100644
@@ -2064,6 +2064,18 @@ extern void rte_eth_link_get_nowait(uint8_t port_id,
 				struct rte_eth_link *link);
 
 /**
+ * Test whether device supports link state interrupt mode.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @return
+ *   - (1) if link state interrupt is supported
+ *   - (0) if link state interrupt is not supported
+ */
+extern int
+rte_eth_has_link_state(uint8_t port_id);
+
+/**
  * Retrieve the general I/O statistics of an Ethernet device.
  *
  * @param port_id
Signature · 1 line
2.1.4
#3 lore raw

PATCH 2/7 pmd: change drivers initialization for pci

In reply to a message not in the archive

From: Stephen Hemminger <[email protected]>

The change to generic ether device structure to support multiple bus types requires a change to all existing PMD but only in the initialization (and the change is backwards compatiable).

---
 lib/librte_pmd_e1000/em_ethdev.c        | 2 +-
 lib/librte_pmd_e1000/igb_ethdev.c       | 4 ++--
 lib/librte_pmd_enic/enic_ethdev.c       | 2 +-
 lib/librte_pmd_fm10k/fm10k_ethdev.c     | 2 +-
 lib/librte_pmd_i40e/i40e_ethdev.c       | 2 +-
 lib/librte_pmd_i40e/i40e_ethdev_vf.c    | 2 +-
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c     | 4 ++--
 lib/librte_pmd_virtio/virtio_ethdev.c   | 2 +-
 lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 2 +-
 9 files changed, 11 insertions(+), 11 deletions(-)
lib/librte_pmd_e1000/em_ethdev.c +1 -1
index 82e0b7a..e57530e 100644
@@ -281,7 +281,7 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev)
 }
 
 static struct eth_driver rte_em_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_em_pmd",
 		.id_table = pci_id_em_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
lib/librte_pmd_e1000/igb_ethdev.c +2 -2
index e2b7cf3..67273b0 100644
@@ -680,7 +680,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
 }
 
 static struct eth_driver rte_igb_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_igb_pmd",
 		.id_table = pci_id_igb_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
@@ -693,7 +693,7 @@ static struct eth_driver rte_igb_pmd = {
  * virtual function driver struct
  */
 static struct eth_driver rte_igbvf_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_igbvf_pmd",
 		.id_table = pci_id_igbvf_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
lib/librte_pmd_enic/enic_ethdev.c +1 -1
index 63a594d..dbef5c6 100644
@@ -609,7 +609,7 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)
 }
 
 static struct eth_driver rte_enic_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_enic_pmd",
 		.id_table = pci_id_enic_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
lib/librte_pmd_fm10k/fm10k_ethdev.c +1 -1
index 1a96cf2..ed6aaa6 100644
@@ -1843,7 +1843,7 @@ static struct rte_pci_id pci_id_fm10k_map[] = {
 };
 
 static struct eth_driver rte_pmd_fm10k = {
-	{
+	.pci_drv = {
 		.name = "rte_pmd_fm10k",
 		.id_table = pci_id_fm10k_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
lib/librte_pmd_i40e/i40e_ethdev.c +1 -1
index dc44764..ba13d68 100644
@@ -265,7 +265,7 @@ static const struct eth_dev_ops i40e_eth_dev_ops = {
 };
 
 static struct eth_driver rte_i40e_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_i40e_pmd",
 		.id_table = pci_id_i40e_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
lib/librte_pmd_i40e/i40e_ethdev_vf.c +1 -1
index 4581c5b..0186fbd 100644
@@ -1201,7 +1201,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
  * virtual function driver struct
  */
 static struct eth_driver rte_i40evf_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_i40evf_pmd",
 		.id_table = pci_id_i40evf_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
lib/librte_pmd_ixgbe/ixgbe_ethdev.c +2 -2
index 1b3b4b5..757ae96 100644
@@ -1087,7 +1087,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 }
 
 static struct eth_driver rte_ixgbe_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_ixgbe_pmd",
 		.id_table = pci_id_ixgbe_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
@@ -1100,7 +1100,7 @@ static struct eth_driver rte_ixgbe_pmd = {
  * virtual function driver struct
  */
 static struct eth_driver rte_ixgbevf_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_ixgbevf_pmd",
 		.id_table = pci_id_ixgbevf_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
lib/librte_pmd_virtio/virtio_ethdev.c +1 -1
index ffa26a0..e39206d 100644
@@ -1238,7 +1238,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
 }
 
 static struct eth_driver rte_virtio_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_virtio_pmd",
 		.id_table = pci_id_virtio_map,
 	},
lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c +1 -1
index 577e0f9..97278cf 100644
@@ -261,7 +261,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
 }
 
 static struct eth_driver rte_vmxnet3_pmd = {
-	{
+	.pci_drv = {
 		.name = "rte_vmxnet3_pmd",
 		.id_table = pci_id_vmxnet3_map,
 		.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
Signature · 1 line
2.1.4
#4 lore raw

PATCH 3/7 hv: add basic vmbus support

In reply to a message not in the archive

The hyper-v device driver forces the base EAL code to change to support multiple bus types. This is done changing the pci_device in ether driver to a generic union.

As much as possible this is done in a backwards source compatiable way. It will break ABI for device drivers.

---
 lib/librte_eal/common/Makefile             |   2 +-
 lib/librte_eal/common/eal_common_options.c |   5 ++
 lib/librte_eal/common/eal_internal_cfg.h   |   1 +
 lib/librte_eal/common/eal_options.h        |   2 +
 lib/librte_eal/common/eal_private.h        |  10 +++
 lib/librte_eal/linuxapp/eal/Makefile       |   3 +
 lib/librte_eal/linuxapp/eal/eal.c          |  11 +++
 lib/librte_ether/rte_ethdev.c              | 128 +++++++++++++++++++++++++++--
 lib/librte_ether/rte_ethdev.h              |  15 +++-
 9 files changed, 168 insertions(+), 9 deletions(-)
lib/librte_eal/common/Makefile +1 -1
index 3ea3bbf..202485e 100644
@@ -33,7 +33,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 INC := rte_branch_prediction.h rte_common.h
 INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
-INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h
+INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h rte_vmbus.h
 INC += rte_pci_dev_ids.h rte_per_lcore.h rte_random.h
 INC += rte_rwlock.h rte_tailq.h rte_interrupts.h rte_alarm.h
 INC += rte_string_fns.h rte_version.h
lib/librte_eal/common/eal_common_options.c +5 -0
index 8fcb1ab..76a3394 100644
@@ -80,6 +80,7 @@ eal_long_options[] = {
 	{OPT_NO_HPET,           0, NULL, OPT_NO_HPET_NUM          },
 	{OPT_NO_HUGE,           0, NULL, OPT_NO_HUGE_NUM          },
 	{OPT_NO_PCI,            0, NULL, OPT_NO_PCI_NUM           },
+	{OPT_NO_VMBUS,		0, NULL, OPT_NO_VMBUS_NUM	  },
 	{OPT_NO_SHCONF,         0, NULL, OPT_NO_SHCONF_NUM        },
 	{OPT_PCI_BLACKLIST,     1, NULL, OPT_PCI_BLACKLIST_NUM    },
 	{OPT_PCI_WHITELIST,     1, NULL, OPT_PCI_WHITELIST_NUM    },
@@ -726,6 +727,10 @@ eal_parse_common_option(int opt, const char *optarg,
 		conf->no_pci = 1;
 		break;
 
+	case OPT_NO_VMBUS_NUM:
+		conf->no_vmbus = 1;
+		break;
+
 	case OPT_NO_HPET_NUM:
 		conf->no_hpet = 1;
 		break;
lib/librte_eal/common/eal_internal_cfg.h +1 -0
index e2ecb0d..0e7de34 100644
@@ -66,6 +66,7 @@ struct internal_config {
 	volatile unsigned no_hugetlbfs;   /**< true to disable hugetlbfs */
 	volatile unsigned xen_dom0_support; /**< support app running on Xen Dom0*/
 	volatile unsigned no_pci;         /**< true to disable PCI */
+	volatile unsigned no_vmbus;	  /**< true to disable VMBUS */
 	volatile unsigned no_hpet;        /**< true to disable HPET */
 	volatile unsigned vmware_tsc_map; /**< true to use VMware TSC mapping
 										* instead of native TSC */
lib/librte_eal/common/eal_options.h +2 -0
index f6714d9..54f03dc 100644
@@ -67,6 +67,8 @@ enum {
 	OPT_NO_HUGE_NUM,
 #define OPT_NO_PCI            "no-pci"
 	OPT_NO_PCI_NUM,
+#define OPT_NO_VMBUS          "no-vmbus"
+	OPT_NO_VMBUS_NUM,
 #define OPT_NO_SHCONF         "no-shconf"
 	OPT_NO_SHCONF_NUM,
 #define OPT_SOCKET_MEM        "socket-mem"
lib/librte_eal/common/eal_private.h +10 -0
index 4acf5a0..039e9f3 100644
@@ -180,6 +180,16 @@ int rte_eal_pci_close_one_driver(struct rte_pci_driver *dr,
 		struct rte_pci_device *dev);
 
 /**
+ * VMBUS related functions and structures
+ */
+int rte_eal_vmbus_init(void);
+
+struct rte_vmbus_driver;
+struct rte_vmbus_device;
+
+int rte_eal_vmbus_probe_one_driver(struct rte_vmbus_driver *dr,
+		struct rte_vmbus_device *dev);
+/**
  * Init tail queues for non-EAL library structures. This is to allow
  * the rings, mempools, etc. lists to be shared among multiple processes
  *
lib/librte_eal/linuxapp/eal/Makefile +3 -0
index 01f7b70..acd5127 100644
@@ -74,6 +74,9 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_alarm.c
 ifeq ($(CONFIG_RTE_LIBRTE_IVSHMEM),y)
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_ivshmem.c
 endif
+ifeq ($(CONFIG_RTE_LIBRTE_HV_PMD),y)
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_vmbus.c
+endif
 
 # from common dir
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
lib/librte_eal/linuxapp/eal/eal.c +11 -0
index bd770cf..86d0e31 100644
@@ -70,6 +70,7 @@
 #include <rte_cpuflags.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
+#include <rte_vmbus.h>
 #include <rte_devargs.h>
 #include <rte_common.h>
 #include <rte_version.h>
@@ -796,6 +797,11 @@ rte_eal_init(int argc, char **argv)
 
 	rte_eal_mcfg_complete();
 
+#ifdef RTE_LIBRTE_HV_PMD
+	if (rte_eal_vmbus_init() < 0)
+		RTE_LOG(ERR, EAL, "Cannot init VMBUS\n");
+#endif
+
 	TAILQ_FOREACH(solib, &solib_list, next) {
 		RTE_LOG(INFO, EAL, "open shared lib %s\n", solib->name);
 		solib->lib_handle = dlopen(solib->name, RTLD_NOW);
@@ -845,6 +851,11 @@ rte_eal_init(int argc, char **argv)
 	if (rte_eal_pci_probe())
 		rte_panic("Cannot probe PCI\n");
 
+#ifdef RTE_LIBRTE_HV_PMD
+	if (rte_eal_vmbus_probe() < 0)
+		rte_panic("Cannot probe VMBUS\n");
+#endif
+
 	return fctret;
 }
 
lib/librte_ether/rte_ethdev.c +122 -6

152 lines not on this page · raw message

lib/librte_ether/rte_ethdev.h +13 -2
index 991023b..9e08f3e 100644
@@ -178,6 +178,7 @@ extern "C" {
 #include <rte_log.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
+#include <rte_vmbus.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_mbuf.h>
@@ -1477,7 +1478,10 @@ struct rte_eth_dev {
 	struct rte_eth_dev_data *data;  /**< Pointer to device data */
 	const struct eth_driver *driver;/**< Driver for this device */
 	const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
-	struct rte_pci_device *pci_dev; /**< PCI info. supplied by probing */
+	union {
+		struct rte_pci_device *pci_dev; /**< PCI info. supplied by probig */
+		struct rte_vmbus_device *vmbus_dev; /**< VMBUS info. supplied by probing */
+	};
 	/** User application callbacks for NIC interrupts */
 	struct rte_eth_dev_cb_list link_intr_cbs;
 	/**
@@ -1696,7 +1700,14 @@ typedef int (*eth_dev_uninit_t)(struct rte_eth_dev *eth_dev);
  * - The size of the private data to allocate for each matching device.
  */
 struct eth_driver {
-	struct rte_pci_driver pci_drv;    /**< The PMD is also a PCI driver. */
+	union {
+		struct rte_pci_driver pci_drv;    /**< The PMD is also a PCI driver. */
+		struct rte_vmbus_driver vmbus_drv;/**< The PMD is also a VMBUS drv. */
+	};
+	enum {
+		RTE_BUS_PCI=0,
+		RTE_BUS_VMBUS
+	} bus_type;			  /**< Device bus type. */
 	eth_dev_init_t eth_dev_init;      /**< Device init function. */
 	eth_dev_uninit_t eth_dev_uninit;  /**< Device uninit function. */
 	unsigned int dev_private_size;    /**< Size of device private data. */
Signature · 1 line
2.1.4

A message that is not in the archive (sent off-list or not yet received): 1429566854-17490-4-git-send-email-stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org

#6 lore raw

Re: [PATCH 3/7] hv: add basic vmbus support

Quoted 25 lines · Stephen Hemminger

The hyper-v device driver forces the base EAL code to change to support multiple bus types. This is done changing the pci_device in ether driver to a generic union.

As much as possible this is done in a backwards source compatiable way. It will break ABI for device drivers.

---
 lib/librte_eal/common/Makefile             |   2 +-
 lib/librte_eal/common/eal_common_options.c |   5 ++
 lib/librte_eal/common/eal_internal_cfg.h   |   1 +
 lib/librte_eal/common/eal_options.h        |   2 +
 lib/librte_eal/common/eal_private.h        |  10 +++
 lib/librte_eal/linuxapp/eal/Makefile       |   3 +
 lib/librte_eal/linuxapp/eal/eal.c          |  11 +++
 lib/librte_ether/rte_ethdev.c              | 128 +++++++++++++++++++++++++++--
 lib/librte_ether/rte_ethdev.h              |  15 +++-
 9 files changed, 168 insertions(+), 9 deletions(-)
lib/librte_eal/common/Makefile +0 -0
index 3ea3bbf..202485e 100644

lib/librte_eal/common/Makefile include $(RTE_SDK)/mk/rte.vars.mk · line 36

Quoted 5 lines
lib/librte_eal/common/Makefile +1 -1
@@ -33,7 +33,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
 
 INC := rte_branch_prediction.h rte_common.h
 INC += rte_debug.h rte_eal.h rte_errno.h rte_launch.h rte_lcore.h
-INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h
+INC += rte_log.h rte_memory.h rte_memzone.h rte_pci.h rte_vmbus.h

rte_vmbus.h isn't included in this patch set and breaks the build

Neil

#7 lore raw

PATCH 4/7 hv: uio driver

In reply to a message not in the archive

From: Stephen Hemminger <[email protected]>

Add new UIO driver in kernel to support DPDK Poll Mode Driver.

---
 lib/librte_eal/linuxapp/Makefile            |   3 +
 lib/librte_eal/linuxapp/hv_uio/Makefile     |  57 ++
 lib/librte_eal/linuxapp/hv_uio/hv_uio.c     | 551 +++++++++++++++++
 lib/librte_eal/linuxapp/hv_uio/hyperv_net.h | 907 ++++++++++++++++++++++++++++
 4 files changed, 1518 insertions(+)
 create mode 100644 lib/librte_eal/linuxapp/hv_uio/Makefile
 create mode 100644 lib/librte_eal/linuxapp/hv_uio/hv_uio.c
 create mode 100644 lib/librte_eal/linuxapp/hv_uio/hyperv_net.h
lib/librte_eal/linuxapp/Makefile +3 -0
index 8fcfdf6..a28d289 100644
@@ -41,5 +41,8 @@ endif
 ifeq ($(CONFIG_RTE_LIBRTE_XEN_DOM0),y)
 DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += xen_dom0
 endif
+ifeq ($(CONFIG_RTE_LIBRTE_HV_PMD),y)
+DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += hv_uio
+endif
 
 include $(RTE_SDK)/mk/rte.subdir.mk
lib/librte_eal/linuxapp/hv_uio/Makefile new file +57 -0

57 lines not on this page · raw message

lib/librte_eal/linuxapp/hv_uio/hv_uio.c new file +551 -0

551 lines not on this page · raw message

lib/librte_eal/linuxapp/hv_uio/hyperv_net.h new file +907 -0

907 lines not on this page · raw message

Signature · 1 line
2.1.4
#8 lore raw

PATCH 5/7 hv: poll mode driver

In reply to a message not in the archive

From: Stephen Hemminger <[email protected]>

This is new Poll Mode driver for using hyper-v virtual network interface.

---
 lib/Makefile                          |    1 +
 lib/librte_pmd_hyperv/Makefile        |   28 +
 lib/librte_pmd_hyperv/hyperv.h        |  169 ++++
 lib/librte_pmd_hyperv/hyperv_drv.c    | 1653 +++++++++++++++++++++++++++++++++
 lib/librte_pmd_hyperv/hyperv_drv.h    |  558 +++++++++++
 lib/librte_pmd_hyperv/hyperv_ethdev.c |  332 +++++++
 lib/librte_pmd_hyperv/hyperv_logs.h   |   69 ++
 lib/librte_pmd_hyperv/hyperv_rxtx.c   |  403 ++++++++
 lib/librte_pmd_hyperv/hyperv_rxtx.h   |   35 +
 mk/rte.app.mk                         |    4 +
 10 files changed, 3252 insertions(+)
 create mode 100644 lib/librte_pmd_hyperv/Makefile
 create mode 100644 lib/librte_pmd_hyperv/hyperv.h
 create mode 100644 lib/librte_pmd_hyperv/hyperv_drv.c
 create mode 100644 lib/librte_pmd_hyperv/hyperv_drv.h
 create mode 100644 lib/librte_pmd_hyperv/hyperv_ethdev.c
 create mode 100644 lib/librte_pmd_hyperv/hyperv_logs.h
 create mode 100644 lib/librte_pmd_hyperv/hyperv_rxtx.c
 create mode 100644 lib/librte_pmd_hyperv/hyperv_rxtx.h
lib/Makefile +1 -0
index d94355d..6c1daf2 100644
@@ -47,6 +47,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += librte_pmd_i40e
 DIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += librte_pmd_fm10k
 DIRS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += librte_pmd_mlx4
 DIRS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += librte_pmd_enic
+DIRS-$(CONFIG_RTE_LIBRTE_HV_PMD) += librte_pmd_hyperv
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += librte_pmd_bond
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_RING) += librte_pmd_ring
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += librte_pmd_pcap
lib/librte_pmd_hyperv/Makefile new file +28 -0
new file mode 100644
index 0000000..4ba08c8
@@ -0,0 +1,28 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2013-2015 Brocade Communications Systems, Inc.
+#   All rights reserved.
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+#
+# library name
+#
+LIB = librte_pmd_hyperv.a
+
+CFLAGS += -O3
+CFLAGS += $(WERROR_FLAGS)
+
+#
+# all source are stored in SRCS-y
+#
+SRCS-$(CONFIG_RTE_LIBRTE_HV_PMD) += hyperv_ethdev.c
+SRCS-$(CONFIG_RTE_LIBRTE_HV_PMD) += hyperv_rxtx.c
+SRCS-$(CONFIG_RTE_LIBRTE_HV_PMD) += hyperv_drv.c
+
+# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_HV_PMD) += lib/librte_eal lib/librte_ether
+DEPDIRS-$(CONFIG_RTE_LIBRTE_HV_PMD) += lib/librte_mempool lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_HV_PMD) += lib/librte_malloc
+
+include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_pmd_hyperv/hyperv.h new file +169 -0

169 lines not on this page · raw message

lib/librte_pmd_hyperv/hyperv_drv.c new file +1653 -0

1,653 lines not on this page · raw message

lib/librte_pmd_hyperv/hyperv_drv.h new file +558 -0

558 lines not on this page · raw message

lib/librte_pmd_hyperv/hyperv_ethdev.c new file +332 -0

332 lines not on this page · raw message

lib/librte_pmd_hyperv/hyperv_logs.h new file +69 -0

69 lines not on this page · raw message

lib/librte_pmd_hyperv/hyperv_rxtx.c new file +403 -0

184 lines not on this page · raw message

lib/librte_pmd_hyperv/hyperv_rxtx.h new file +35 -0
new file mode 100644
index 0000000..c45a704

Lines of this file are not shown. View the raw message.

mk/rte.app.mk +4 -0
index 62a76ae..e0416d1 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.1.4

Part of the diff is not shown here. View the raw message.

#9 lore raw

PATCH 6/7 hv: enable driver in common config

In reply to a message not in the archive

From: Stephen Hemminger <[email protected]>

Add hyperv driver config to enable it.

---
 config/common_linuxapp | 9 +++++++++
 1 file changed, 9 insertions(+)
config/common_linuxapp +9 -0
index 0078dc9..58cc352 100644
@@ -234,6 +234,15 @@ CONFIG_RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE=n
 CONFIG_RTE_LIBRTE_VMXNET3_DEBUG_DRIVER=n
 
 #
+# Compile burst-mode Hyperv PMD driver
+#
+CONFIG_RTE_LIBRTE_HV_PMD=y
+CONFIG_RTE_LIBRTE_HV_DEBUG=n
+CONFIG_RTE_LIBRTE_HV_DEBUG_INIT=n
+CONFIG_RTE_LIBRTE_HV_DEBUG_RX=n
+CONFIG_RTE_LIBRTE_HV_DEBUG_TX=n
+
+#
 # Compile example software rings based PMD
 #
 CONFIG_RTE_LIBRTE_PMD_RING=y
Signature · 1 line
2.1.4
#10 lore raw

PATCH 7/7 hv: add kernel patch

In reply to a message not in the archive

From: Stephen Hemminger <[email protected]>

For users using non latest kernels, put kernel patch in for them to use.

---
 .../linuxapp/hv_uio/vmbus-get-pages.patch          | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 lib/librte_eal/linuxapp/hv_uio/vmbus-get-pages.patch
lib/librte_eal/linuxapp/hv_uio/vmbus-get-pages.patch new file +55 -0
new file mode 100644
index 0000000..ae27fbd
@@ -0,0 +1,55 @@
+hyper-v: allow access to vmbus from userspace driver
+
+This is patch from  to allow access to hyper-v vmbus from UIO driver.
+
+Signed-off-by: Stas Egorov <segorov-nYU0QVwCCFFWk0Htik3J/[email protected]>
+Signed-off-by: Stephen Hemminger <[email protected]>
+
+---
+v2 - simplify and rename to vmbus_get_monitor_pages
+
+ drivers/hv/connection.c |   20 +++++++++++++++++---
+ include/linux/hyperv.h  |    3 +++
+ 2 files changed, 20 insertions(+), 3 deletions(-)
+
+--- a/drivers/hv/connection.c	2015-02-03 10:58:51.751752450 -0800
++++ b/drivers/hv/connection.c	2015-02-04 14:59:51.636194383 -0800
+@@ -64,6 +64,15 @@ static __u32 vmbus_get_next_version(__u3
+ 	}
+ }
+
++void vmbus_get_monitor_pages(unsigned long *int_page,
++			     unsigned long monitor_pages[2])
++{
++	*int_page = (unsigned long)vmbus_connection.int_page;
++	monitor_pages[0] = (unsigned long)vmbus_connection.monitor_pages[0];
++	monitor_pages[1] = (unsigned long)vmbus_connection.monitor_pages[1];
++}
++EXPORT_SYMBOL_GPL(vmbus_get_monitor_pages);
++
+ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
+ 					__u32 version)
+ {
+@@ -347,10 +356,7 @@ static void process_chn_event(u32 relid)
+ 			else
+ 				bytes_to_read = 0;
+ 		} while (read_state && (bytes_to_read != 0));
+-	} else {
+-		pr_err("no channel callback for relid - %u\n", relid);
+ 	}
+-
+ }
+
+ /*
+--- a/include/linux/hyperv.h	2015-02-03 10:58:51.751752450 -0800
++++ b/include/linux/hyperv.h	2015-02-04 15:00:26.388355012 -0800
+@@ -868,6 +868,9 @@ extern int vmbus_recvpacket_raw(struct v
+
+ extern void vmbus_ontimer(unsigned long data);
+
++extern void vmbus_get_monitor_pages(unsigned long *int_page,
++				    unsigned long monitor_pages[2]);
++
+ /* Base driver object */
+ struct hv_driver {
+ 	const char *name;
Signature · 1 line
2.1.4