VMBUS and driver infrastructure
Subsystems (2)
cover VMBUS and driver infrastructure
These are the patches to allow building drivers on VMBUS with DPDK. The Hyper-V PMD (later patch set) builds on this.
Most of the infrastructure for the bus and device model is already done, the one missing piece was that the eth_driver structure still assumed all devices were PCI.
Stephen Hemminger (6):
ethdev: increase length ethernet device internal name
i40e: don't refer to eth_dev->pci_dev
vmxnet3: don't refer to eth_dev->pci_dev
cxgbe: don't refer to eth_dev->pci_dev
ethdev: break ethernet driver and pci_driver connection
eal: VMBUS infrastructure
app/test/virtual_pmd.c | 22 +- doc/guides/rel_notes/deprecation.rst | 3 + drivers/net/bnx2x/bnx2x_ethdev.c | 16 +- drivers/net/bnxt/bnxt_ethdev.c | 22 +- drivers/net/cxgbe/cxgbe_ethdev.c | 8 +- drivers/net/cxgbe/sge.c | 9 +- drivers/net/e1000/em_ethdev.c | 10 +- drivers/net/e1000/igb_ethdev.c | 20 +- drivers/net/ena/ena_ethdev.c | 8 +- drivers/net/enic/enic_ethdev.c | 8 +- drivers/net/fm10k/fm10k_ethdev.c | 10 +- drivers/net/i40e/i40e_ethdev.c | 10 +- drivers/net/i40e/i40e_ethdev_vf.c | 10 +- drivers/net/i40e/i40e_fdir.c | 3 +- drivers/net/ixgbe/ixgbe_ethdev.c | 20 +- drivers/net/mlx4/mlx4.c | 8 +- drivers/net/mlx5/mlx5.c | 8 +- drivers/net/nfp/nfp_net.c | 8 +- drivers/net/qede/qede_ethdev.c | 42 +- drivers/net/szedata2/rte_eth_szedata2.c | 10 +- drivers/net/thunderx/nicvf_ethdev.c | 8 +- drivers/net/virtio/virtio_ethdev.c | 10 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 10 +- drivers/net/vmxnet3/vmxnet3_rxtx.c | 5 +- lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_devargs.c | 7 + lib/librte_eal/common/eal_common_options.c | 38 ++ lib/librte_eal/common/eal_internal_cfg.h | 3 +- lib/librte_eal/common/eal_options.h | 6 + lib/librte_eal/common/eal_private.h | 5 + lib/librte_eal/common/include/rte_devargs.h | 8 + lib/librte_eal/common/include/rte_vmbus.h | 249 ++++++++ lib/librte_eal/linuxapp/eal/Makefile | 6 + lib/librte_eal/linuxapp/eal/eal.c | 11 + lib/librte_eal/linuxapp/eal/eal_vmbus.c | 907 ++++++++++++++++++++++++++++ lib/librte_ether/rte_ethdev.c | 99 ++- lib/librte_ether/rte_ethdev.h | 49 +- mk/rte.app.mk | 1 + 38 files changed, 1542 insertions(+), 137 deletions(-) create mode 100644 lib/librte_eal/common/include/rte_vmbus.h create mode 100644 lib/librte_eal/linuxapp/eal/eal_vmbus.c
Signature · 1 line
2.11.0
PATCH 1/6 ethdev: increase length ethernet device internal name
Allow sufficicent space for UUID in string form (36+1) which is necessary with VMBUS.
--- doc/guides/rel_notes/deprecation.rst | 3 +++ lib/librte_ether/rte_ethdev.h | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-)
doc/guides/rel_notes/deprecation.rst +3 -0
@@ -58,6 +58,9 @@ Deprecation Notices ``port`` field, may be moved or removed as part of this mbuf work. A ``timestamp`` will also be added. +* ethdev: for 17.02 the size of internal device name will be increased + to 40 characters to allow for storing UUID. + * The mbuf flags PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated and are respectively replaced by PKT_RX_VLAN_STRIPPED and PKT_RX_QINQ_STRIPPED, that are better described. The old flags and
lib/librte_ether/rte_ethdev.h +5 -1
@@ -1649,7 +1649,11 @@ struct rte_eth_dev_sriov { };#define RTE_ETH_DEV_SRIOV (dev) ((dev)->data->sriov) -#define RTE_ETH_NAME_MAX_LEN (32) +/* +* Internal identifier length +* Sufficiently large to allow for UUID or PCI address +*/ +#define RTE_ETH_NAME_MAX_LEN 40/** * @internal
Signature · 1 line
2.11.0
PATCH 2/6 i40e: don't refer to eth_dev->pci_dev
In reply to Stephen HemmingerLater patches remove pci_dev from the ethernet device structure. Fix the i40e code to just use it's own name when forming zone name.
--- drivers/net/i40e/i40e_fdir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/i40e/i40e_fdir.c +1 -2
@@ -250,8 +250,7 @@ i40e_fdir_setup(struct i40e_pf *pf) }/* reserve memory for the fdir programming packet */ -snprintf (z_name,sizeof (z_name),"%s_%s_%d" , - eth_dev->driver->pci_drv.driver.name, +snprintf (z_name,sizeof (z_name),"i40e_%s_%d" ,I40E_FDIR_MZ_NAME , eth_dev->data->port_id); mz =i40e_memzone_reserve (z_name,I40E_FDIR_PKT_LEN ,SOCKET_ID_ANY );
Signature · 1 line
2.11.0
PATCH 3/6 vmxnet3: don't refer to eth_dev->pci_dev
In reply to Stephen HemmingerFix the vmxnet3 code to just use it's own name when forming zone name.
--- drivers/net/vmxnet3/vmxnet3_rxtx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/vmxnet3/vmxnet3_rxtx.c +2 -3
@@ -793,9 +793,8 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,char z_name[RTE_MEMZONE_NAMESIZE ];const struct rte_memzone *mz; -snprintf (z_name,sizeof (z_name),"%s_%s_%d_%d" , - dev->driver->pci_drv.driver.name, ring_name, - dev->data->port_id, queue_id); +snprintf (z_name,sizeof (z_name),"vmxnet3_%s_%d_%d" , + ring_name, dev->data->port_id, queue_id); mz =rte_memzone_lookup (z_name);if (mz)
Signature · 1 line
2.11.0
PATCH 4/6 cxgbe: don't refer to eth_dev->pci_dev
In reply to Stephen HemmingerLater patches remove pci_dev from the ethernet device structure. Fix the cxgbe code to just use it's own name when forming zone name.
--- drivers/net/cxgbe/sge.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/net/cxgbe/sge.c +3 -6
@@ -1644,8 +1644,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,/* Size needs to be multiple of 16, including status entry. */ iq->size =cxgbe_roundup (iq->size,16 ); -snprintf (z_name,sizeof (z_name),"%s_%s_%d_%d" , - eth_dev->driver->pci_drv.driver.name, +snprintf (z_name,sizeof (z_name),"cxgbe_%s_%d_%d" , fwevtq ?"fwq_ring" :"rx_ring" , eth_dev->data->port_id, queue_id);snprintf (z_name_sw,sizeof (z_name_sw),"%s_sw_ring" , z_name);
@@ -1697,8 +1696,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, fl->size = s->fl_starve_thres -1 +2 *8 ; fl->size =cxgbe_roundup (fl->size,8 ); -snprintf (z_name,sizeof (z_name),"%s_%s_%d_%d" , - eth_dev->driver->pci_drv.driver.name, +snprintf (z_name,sizeof (z_name),"cxgbe_%s_%d_%d" , fwevtq ?"fwq_ring" :"fl_ring" , eth_dev->data->port_id, queue_id);snprintf (z_name_sw,sizeof (z_name_sw),"%s_sw_ring" , z_name);
@@ -1893,8 +1891,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,/* Add status entries */ nentries = txq->q.size + s->stat_len /sizeof (struct tx_desc ); -snprintf (z_name,sizeof (z_name),"%s_%s_%d_%d" , - eth_dev->driver->pci_drv.driver.name,"tx_ring" , +snprintf (z_name,sizeof (z_name),"cxgbe_tx_ring_%d_%d" , eth_dev->data->port_id, queue_id);snprintf (z_name_sw,sizeof (z_name_sw),"%s_sw_ring" , z_name);
Signature · 1 line
2.11.0
PATCH 5/6 ethdev: break ethernet driver and pci_driver connection
In reply to Stephen HemmingerThere are multiple buses and device types now. Therefore it no longer makes sense that PCI driver information is part of the Ethernet driver structure.
This patch removes pci_driver from eth_driver and introduces a new combined structure for use in all existing PMD's. The rationale is that although all existing PCI drivers are Ethernet drivers, it make sense that future projects may want to support PCI devices that are not Ethernet.
It also removes the requirement that driver is first element in PCI driver structure.
--- app/test/virtual_pmd.c | 22 ++++++++--------- drivers/net/bnx2x/bnx2x_ethdev.c | 16 ++++++++----- drivers/net/bnxt/bnxt_ethdev.c | 22 +++++++++-------- drivers/net/cxgbe/cxgbe_ethdev.c | 8 ++++--- drivers/net/e1000/em_ethdev.c | 10 ++++---- drivers/net/e1000/igb_ethdev.c | 20 +++++++++------- drivers/net/ena/ena_ethdev.c | 8 ++++--- drivers/net/enic/enic_ethdev.c | 8 ++++--- drivers/net/fm10k/fm10k_ethdev.c | 10 ++++---- drivers/net/i40e/i40e_ethdev.c | 10 ++++---- drivers/net/i40e/i40e_ethdev_vf.c | 10 ++++---- drivers/net/ixgbe/ixgbe_ethdev.c | 20 +++++++++------- drivers/net/mlx4/mlx4.c | 8 ++++--- drivers/net/mlx5/mlx5.c | 8 ++++--- drivers/net/nfp/nfp_net.c | 8 ++++--- drivers/net/qede/qede_ethdev.c | 42 +++++++++++++++++---------------- drivers/net/szedata2/rte_eth_szedata2.c | 10 ++++---- drivers/net/thunderx/nicvf_ethdev.c | 8 ++++--- drivers/net/virtio/virtio_ethdev.c | 10 ++++---- drivers/net/vmxnet3/vmxnet3_ethdev.c | 10 ++++---- lib/librte_ether/rte_ethdev.c | 9 +++---- lib/librte_ether/rte_ethdev.h | 18 +++++++++----- 22 files changed, 172 insertions(+), 123 deletions(-)
app/test/virtual_pmd.c +10 -12
@@ -533,7 +533,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,struct rte_pci_device *pci_dev =NULL ;struct rte_eth_dev *eth_dev =NULL ;struct eth_driver *eth_drv =NULL ; -struct rte_pci_driver *pci_drv =NULL ; +struct rte_pci_eth_driver *pci_eth_drv =NULL ;struct rte_pci_id *id_table =NULL ;struct virtual_ethdev_private *dev_private =NULL ;char name_buf[RTE_RING_NAMESIZE ];
@@ -554,8 +554,8 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,if (eth_drv ==NULL ) goto err; - pci_drv =rte_zmalloc_socket (name,sizeof (*pci_drv),0 , socket_id); -if (pci_drv ==NULL ) + pci_eth_drv =rte_zmalloc_socket (name,sizeof (*pci_eth_drv),0 , socket_id); +if (pci_eth_drv ==NULL ) goto err; id_table =rte_zmalloc_socket (name,sizeof (*id_table),0 , socket_id);
@@ -585,17 +585,15 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, goto err; pci_dev->device.numa_node = socket_id; - pci_drv->driver.name = virtual_ethdev_driver_name; - pci_drv->id_table = id_table; + pci_eth_drv->pci_drv.driver.name = virtual_ethdev_driver_name; + pci_eth_drv->pci_drv.id_table = id_table;if (isr_support) - pci_drv->drv_flags |=RTE_PCI_DRV_INTR_LSC ; + pci_eth_drv->pci_drv.drv_flags |=RTE_PCI_DRV_INTR_LSC ;else - pci_drv->drv_flags &= ~RTE_PCI_DRV_INTR_LSC ; + pci_eth_drv->pci_drv.drv_flags &= ~RTE_PCI_DRV_INTR_LSC ; - - eth_drv->pci_drv = (struct rte_pci_driver )(*pci_drv); - eth_dev->driver = eth_drv; + eth_dev->driver = &pci_eth_drv->eth_drv; eth_dev->data->nb_rx_queues = (uint16_t )1 ; eth_dev->data->nb_tx_queues = (uint16_t )1 ;
@@ -622,7 +620,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, dev_private->dev_ops = virtual_ethdev_default_dev_ops; eth_dev->dev_ops = &dev_private->dev_ops; - pci_dev->device.driver = ð_drv->pci_drv.driver; + pci_dev->device.driver = &pci_eth_drv->pci_drv.driver; eth_dev->device = &pci_dev->device; eth_dev->rx_pkt_burst = virtual_ethdev_rx_burst_success;
@@ -632,7 +630,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, err:rte_free (pci_dev); -rte_free (pci_drv); +rte_free (pci_eth_drv);rte_free (eth_drv);rte_free (id_table);rte_free (dev_private);
drivers/net/bnx2x/bnx2x_ethdev.c +10 -6
@@ -617,29 +617,33 @@ eth_bnx2xvf_dev_init(struct rte_eth_dev *eth_dev)return bnx2x_common_dev_init (eth_dev,1 ); } -static struct eth_driver rte_bnx2x_pmd = { +static struct rte_pci_eth_driver rte_bnx2x_pmd = { .pci_drv = { .id_table = pci_id_bnx2x_map, .drv_flags =RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_INTR_LSC , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_bnx2x_dev_init, - .dev_private_size =sizeof (struct bnx2x_softc ), + eth_drv = { + .eth_dev_init = eth_bnx2x_dev_init, + .dev_private_size =sizeof (struct bnx2x_softc ), + }, };/* * virtual function driver struct */ -static struct eth_driver rte_bnx2xvf_pmd = { +static struct rte_pci_eth_driver rte_bnx2xvf_pmd = { .pci_drv = { .id_table = pci_id_bnx2xvf_map, .drv_flags =RTE_PCI_DRV_NEED_MAPPING , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_bnx2xvf_dev_init, - .dev_private_size =sizeof (struct bnx2x_softc ), + eth_drv = { + .eth_dev_init = eth_bnx2xvf_dev_init, + .dev_private_size =sizeof (struct bnx2x_softc ), + }, };RTE_PMD_REGISTER_PCI (net_bnx2x, rte_bnx2x_pmd.pci_drv);
drivers/net/bnxt/bnxt_ethdev.c +12 -10
@@ -1164,17 +1164,19 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) {return rc; } -static struct eth_driver bnxt_rte_pmd = { +static struct rte_pci_eth_driver bnxt_rte_pmd = { .pci_drv = { - .id_table = bnxt_pci_id_map, - .drv_flags =RTE_PCI_DRV_NEED_MAPPING | -RTE_PCI_DRV_DETACHABLE |RTE_PCI_DRV_INTR_LSC , - .probe = rte_eth_dev_pci_probe, - .remove = rte_eth_dev_pci_remove - }, - .eth_dev_init = bnxt_dev_init, - .eth_dev_uninit = bnxt_dev_uninit, - .dev_private_size =sizeof (struct bnxt ), + .id_table = bnxt_pci_id_map, + .drv_flags =RTE_PCI_DRV_NEED_MAPPING | +RTE_PCI_DRV_DETACHABLE |RTE_PCI_DRV_INTR_LSC , + .probe = rte_eth_dev_pci_probe, + .remove = rte_eth_dev_pci_remove + }, + .eth_drv = { + .eth_dev_init = bnxt_dev_init, + .eth_dev_uninit = bnxt_dev_uninit, + .dev_private_size =sizeof (struct bnxt ), + }, };RTE_PMD_REGISTER_PCI (net_bnxt, bnxt_rte_pmd.pci_drv);
drivers/net/cxgbe/cxgbe_ethdev.c +5 -3
@@ -1039,15 +1039,17 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev)return err; } -static struct eth_driver rte_cxgbe_pmd = { +static struct rte_pci_eth_driver rte_cxgbe_pmd = { .pci_drv = { .id_table = cxgb4_pci_tbl, .drv_flags =RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_INTR_LSC , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_cxgbe_dev_init, - .dev_private_size =sizeof (struct port_info ), + .eth_drv = { + .eth_dev_init = eth_cxgbe_dev_init, + .dev_private_size =sizeof (struct port_info ), + }, };RTE_PMD_REGISTER_PCI (net_cxgbe, rte_cxgbe_pmd.pci_drv);
drivers/net/e1000/em_ethdev.c +6 -4
@@ -388,7 +388,7 @@ eth_em_dev_uninit(struct rte_eth_dev *eth_dev)return 0 ; } -static struct eth_driver rte_em_pmd = { +static struct rte_pci_eth_driver rte_em_pmd = { .pci_drv = { .id_table = pci_id_em_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
@@ -396,9 +396,11 @@ static struct eth_driver rte_em_pmd = { .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_em_dev_init, - .eth_dev_uninit = eth_em_dev_uninit, - .dev_private_size = sizeof(struct e1000_adapter), + .eth_drv = { + .eth_dev_init = eth_em_dev_init, + .eth_dev_uninit = eth_em_dev_uninit, + .dev_private_size = sizeof(struct e1000_adapter), + }, }; static int
drivers/net/e1000/igb_ethdev.c +12 -8
@@ -1078,7 +1078,7 @@ eth_igbvf_dev_uninit(struct rte_eth_dev *eth_dev)return 0 ; } -static struct eth_driver rte_igb_pmd = { +static struct rte_pci_eth_driver rte_igb_pmd = { .pci_drv = { .id_table = pci_id_igb_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
@@ -1086,24 +1086,28 @@ static struct eth_driver rte_igb_pmd = { .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_igb_dev_init, - .eth_dev_uninit = eth_igb_dev_uninit, - .dev_private_size = sizeof(struct e1000_adapter), + .eth_drv = { + .eth_dev_init = eth_igb_dev_init, + .eth_dev_uninit = eth_igb_dev_uninit, + .dev_private_size = sizeof(struct e1000_adapter), + }, };/* * virtual function driver struct */ -static struct eth_driver rte_igbvf_pmd = { +static struct rte_pci_eth_driver rte_igbvf_pmd = { .pci_drv = { .id_table = pci_id_igbvf_map, .drv_flags =RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_DETACHABLE , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_igbvf_dev_init, - .eth_dev_uninit = eth_igbvf_dev_uninit, - .dev_private_size =sizeof (struct e1000_adapter ), + .eth_drv = { + .eth_dev_init = eth_igbvf_dev_init, + .eth_dev_uninit = eth_igbvf_dev_uninit, + .dev_private_size =sizeof (struct e1000_adapter ), + }, }; static void
drivers/net/ena/ena_ethdev.c +5 -3
@@ -1705,15 +1705,17 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,return sent_idx; } -static struct eth_driver rte_ena_pmd = { +static struct rte_pci_eth_driver rte_ena_pmd = { .pci_drv = { .id_table = pci_id_ena_map, .drv_flags =RTE_PCI_DRV_NEED_MAPPING , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_ena_dev_init, - .dev_private_size =sizeof (struct ena_adapter ), + .eth_drv = { + .eth_dev_init = eth_ena_dev_init, + .dev_private_size =sizeof (struct ena_adapter ), + }, };RTE_PMD_REGISTER_PCI (net_ena, rte_ena_pmd.pci_drv);
drivers/net/enic/enic_ethdev.c +5 -3
@@ -633,15 +633,17 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)return enic_probe (enic); } -static struct eth_driver rte_enic_pmd = { +static struct rte_pci_eth_driver rte_enic_pmd = { .pci_drv = { .id_table = pci_id_enic_map, .drv_flags =RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_INTR_LSC , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_enicpmd_dev_init, - .dev_private_size =sizeof (struct enic ), + .eth_drv = { + .eth_dev_init = eth_enicpmd_dev_init, + .dev_private_size =sizeof (struct enic ), + }, };RTE_PMD_REGISTER_PCI (net_enic, rte_enic_pmd.pci_drv);
drivers/net/fm10k/fm10k_ethdev.c +6 -4
@@ -3069,7 +3069,7 @@ static const struct rte_pci_id pci_id_fm10k_map[] = { { .vendor_id = 0, /* sentinel */ }, }; -static struct eth_driver rte_pmd_fm10k = { +static struct rte_pci_eth_driver rte_pmd_fm10k = { .pci_drv = { .id_table = pci_id_fm10k_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
@@ -3077,9 +3077,11 @@ static struct eth_driver rte_pmd_fm10k = { .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_fm10k_dev_init, - .eth_dev_uninit = eth_fm10k_dev_uninit, - .dev_private_size = sizeof(struct fm10k_adapter), + .eth_drv = { + .eth_dev_init = eth_fm10k_dev_init, + .eth_dev_uninit = eth_fm10k_dev_uninit, + .dev_private_size = sizeof(struct fm10k_adapter), + }, };RTE_PMD_REGISTER_PCI (net_fm10k, rte_pmd_fm10k.pci_drv);
drivers/net/i40e/i40e_ethdev.c +6 -4
@@ -668,7 +668,7 @@ static const struct rte_i40e_xstats_name_off rte_i40e_txq_prio_strings[] = {#define I40E_NB_TXQ_PRIO_XSTATS (sizeof(rte_i40e_txq_prio_strings) / \ sizeof(rte_i40e_txq_prio_strings[0])) -static struct eth_driver rte_i40e_pmd = { +static struct rte_pci_eth_driver rte_i40e_pmd = { .pci_drv = { .id_table = pci_id_i40e_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
@@ -676,9 +676,11 @@ static struct eth_driver rte_i40e_pmd = { .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_i40e_dev_init, - .eth_dev_uninit = eth_i40e_dev_uninit, - .dev_private_size = sizeof(struct i40e_adapter), + .eth_drv = { + .eth_dev_init = eth_i40e_dev_init, + .eth_dev_uninit = eth_i40e_dev_uninit, + .dev_private_size = sizeof(struct i40e_adapter), + }, }; static inline int
drivers/net/i40e/i40e_ethdev_vf.c +6 -4
@@ -1526,16 +1526,18 @@ i40evf_dev_uninit(struct rte_eth_dev *eth_dev)/* * virtual function driver struct */ -static struct eth_driver rte_i40evf_pmd = { +static struct rte_pci_eth_driver rte_i40evf_pmd = { .pci_drv = { .id_table = pci_id_i40evf_map, .drv_flags =RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_DETACHABLE , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = i40evf_dev_init, - .eth_dev_uninit = i40evf_dev_uninit, - .dev_private_size =sizeof (struct i40e_adapter ), + .eth_drv = { + .eth_dev_init = i40evf_dev_init, + .eth_dev_uninit = i40evf_dev_uninit, + .dev_private_size =sizeof (struct i40e_adapter ), + }, };RTE_PMD_REGISTER_PCI (net_i40e_vf, rte_i40evf_pmd.pci_drv);
drivers/net/ixgbe/ixgbe_ethdev.c +12 -8
@@ -1560,7 +1560,7 @@ eth_ixgbevf_dev_uninit(struct rte_eth_dev *eth_dev)return 0 ; } -static struct eth_driver rte_ixgbe_pmd = { +static struct rte_pci_eth_driver rte_ixgbe_pmd = { .pci_drv = { .id_table = pci_id_ixgbe_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
@@ -1568,24 +1568,28 @@ static struct eth_driver rte_ixgbe_pmd = { .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_ixgbe_dev_init, - .eth_dev_uninit = eth_ixgbe_dev_uninit, - .dev_private_size = sizeof(struct ixgbe_adapter), + .eth_drv = { + .eth_dev_init = eth_ixgbe_dev_init, + .eth_dev_uninit = eth_ixgbe_dev_uninit, + .dev_private_size = sizeof(struct ixgbe_adapter), + }, };/* * virtual function driver struct */ -static struct eth_driver rte_ixgbevf_pmd = { +static struct rte_pci_eth_driver rte_ixgbevf_pmd = { .pci_drv = { .id_table = pci_id_ixgbevf_map, .drv_flags =RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_DETACHABLE , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_ixgbevf_dev_init, - .eth_dev_uninit = eth_ixgbevf_dev_uninit, - .dev_private_size =sizeof (struct ixgbe_adapter ), + .eth_drv = { + .eth_dev_init = eth_ixgbevf_dev_init, + .eth_dev_uninit = eth_ixgbevf_dev_uninit, + .dev_private_size =sizeof (struct ixgbe_adapter ), + }, }; static int
drivers/net/mlx4/mlx4.c +5 -3
@@ -5524,7 +5524,7 @@ priv_dev_interrupt_handler_install(struct priv *priv, struct rte_eth_dev *dev) } } -static struct eth_driver mlx4_driver; +static struct rte_pci_eth_driver mlx4_driver;/** * DPDK callback to register a PCI device.
@@ -5903,7 +5903,7 @@ static const struct rte_pci_id mlx4_pci_id_map[] = { } }; -static struct eth_driver mlx4_driver = { +static struct rte_pci_eth_driver mlx4_driver = { .pci_drv = { .driver = { .name =MLX4_DRIVER_NAME
@@ -5912,7 +5912,9 @@ static struct eth_driver mlx4_driver = { .probe = mlx4_pci_probe, .drv_flags = RTE_PCI_DRV_INTR_LSC, }, - .dev_private_size = sizeof(struct priv) + .eth_drv = { + .dev_private_size = sizeof(struct priv), + }, };/**
drivers/net/mlx5/mlx5.c +5 -3
@@ -338,7 +338,7 @@ mlx5_args(struct priv *priv, struct rte_devargs *devargs)return 0 ; } -static struct eth_driver mlx5_driver; +static struct rte_pci_eth_driver mlx5_driver;/** * DPDK callback to register a PCI device.
@@ -723,7 +723,7 @@ static const struct rte_pci_id mlx5_pci_id_map[] = { } }; -static struct eth_driver mlx5_driver = { +static struct rte_pci_eth_driver mlx5_driver = { .pci_drv = { .driver = { .name =MLX5_DRIVER_NAME
@@ -732,7 +732,9 @@ static struct eth_driver mlx5_driver = { .probe = mlx5_pci_probe, .drv_flags = RTE_PCI_DRV_INTR_LSC, }, - .dev_private_size = sizeof(struct priv) + .eth_drv = { + .dev_private_size = sizeof(struct priv), + }, };/**
drivers/net/nfp/nfp_net.c +5 -3
@@ -2472,7 +2472,7 @@ static struct rte_pci_id pci_id_nfp_net_map[] = { }, }; -static struct eth_driver rte_nfp_net_pmd = { +static struct rte_pci_eth_driver rte_nfp_net_pmd = { .pci_drv = { .id_table = pci_id_nfp_net_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
@@ -2480,8 +2480,10 @@ static struct eth_driver rte_nfp_net_pmd = { .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = nfp_net_init, - .dev_private_size = sizeof(struct nfp_net_adapter), + .eth_drv = { + .eth_dev_init = nfp_net_init, + .dev_private_size = sizeof(struct nfp_net_adapter), + }, };RTE_PMD_REGISTER_PCI (net_nfp, rte_nfp_net_pmd.pci_drv);
drivers/net/qede/qede_ethdev.c +22 -20
52 lines not on this page · raw message
drivers/net/szedata2/rte_eth_szedata2.c +6 -4
@@ -1587,15 +1587,17 @@ static const struct rte_pci_id rte_szedata2_pci_id_table[] = { } }; -static struct eth_driver szedata2_eth_driver = { +static struct rte_pci_eth_driver szedata2_eth_driver = { .pci_drv = { .id_table = rte_szedata2_pci_id_table, .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = rte_szedata2_eth_dev_init, - .eth_dev_uninit = rte_szedata2_eth_dev_uninit, - .dev_private_size =sizeof (struct pmd_internals ), + .eth_drv = { + .eth_dev_init = rte_szedata2_eth_dev_init, + .eth_dev_uninit = rte_szedata2_eth_dev_uninit, + .dev_private_size =sizeof (struct pmd_internals ), + }, };RTE_PMD_REGISTER_PCI (RTE_SZEDATA2_DRIVER_NAME , szedata2_eth_driver.pci_drv);
drivers/net/thunderx/nicvf_ethdev.c +5 -3
@@ -2111,15 +2111,17 @@ static const struct rte_pci_id pci_id_nicvf_map[] = { }, }; -static struct eth_driver rte_nicvf_pmd = { +static struct rte_pci_eth_driver rte_nicvf_pmd = { .pci_drv = { .id_table = pci_id_nicvf_map, .drv_flags =RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_INTR_LSC , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = nicvf_eth_dev_init, - .dev_private_size =sizeof (struct nicvf ), + .eth_drv = { + .eth_dev_init = nicvf_eth_dev_init, + .dev_private_size =sizeof (struct nicvf ), + }, };RTE_PMD_REGISTER_PCI (net_thunderx, rte_nicvf_pmd.pci_drv);
drivers/net/virtio/virtio_ethdev.c +6 -4
@@ -1375,7 +1375,7 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)return 0 ; } -static struct eth_driver rte_virtio_pmd = { +static struct rte_pci_eth_driver rte_virtio_pmd = { .pci_drv = { .driver = { .name ="net_virtio" ,
@@ -1385,9 +1385,11 @@ static struct eth_driver rte_virtio_pmd = { .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_virtio_dev_init, - .eth_dev_uninit = eth_virtio_dev_uninit, - .dev_private_size = sizeof(struct virtio_hw), + .eth_drv = { + .eth_dev_init = eth_virtio_dev_init, + .eth_dev_uninit = eth_virtio_dev_uninit, + .dev_private_size = sizeof(struct virtio_hw), + }, };RTE_INIT (rte_virtio_pmd_init);
drivers/net/vmxnet3/vmxnet3_ethdev.c +6 -4
@@ -333,16 +333,18 @@ eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev)return 0 ; } -static struct eth_driver rte_vmxnet3_pmd = { +static struct rte_pci_eth_driver rte_vmxnet3_pmd = { .pci_drv = { .id_table = pci_id_vmxnet3_map, .drv_flags =RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_DETACHABLE , .probe = rte_eth_dev_pci_probe, .remove = rte_eth_dev_pci_remove, }, - .eth_dev_init = eth_vmxnet3_dev_init, - .eth_dev_uninit = eth_vmxnet3_dev_uninit, - .dev_private_size =sizeof (struct vmxnet3_hw ), + .eth_drv = { + .eth_dev_init = eth_vmxnet3_dev_init, + .eth_dev_uninit = eth_vmxnet3_dev_uninit, + .dev_private_size =sizeof (struct vmxnet3_hw ), + }, }; static int
lib/librte_ether/rte_ethdev.c +5 -4
@@ -239,13 +239,14 @@ int rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) { - struct eth_driver *eth_drv; + const struct rte_pci_eth_driver *pci_eth_drv; +const struct eth_driver *eth_drv;struct rte_eth_dev *eth_dev;char ethdev_name[RTE_ETH_NAME_MAX_LEN ]; -int diag; - eth_drv = (struct eth_driver *)pci_drv; + pci_eth_drv = container_of(pci_drv, struct rte_pci_eth_driver, pci_drv); + eth_drv = &pci_eth_drv->eth_drv;rte_eal_pci_device_name (&pci_dev->addr, ethdev_name,sizeof (ethdev_name));
@@ -263,7 +264,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, } eth_dev->device = &pci_dev->device; eth_dev->intr_handle = &pci_dev->intr_handle; - eth_dev->driver = eth_drv; + eth_dev->driver = &pci_eth_drv->eth_drv;/* Invoke PMD device initialization function */ diag = (*eth_drv->eth_dev_init)(eth_dev);
lib/librte_ether/rte_ethdev.h +12 -6
@@ -1851,25 +1851,31 @@ typedef int (*eth_dev_uninit_t)(struct rte_eth_dev *eth_dev);* @internal * The structure associated with a PMD Ethernet driver. * -* Each Ethernet driver acts as a PCI driver and is represented by a generic +* Each Ethernet driver acts is represented by a generic * *eth_driver* structure that holds: * -* - An *rte_pci_driver* structure (which must be the first field). +* - The *eth_dev_init* function invoked for each matching device. * -* - The *eth_dev_init* function invoked for each matching PCI device. -* -* - The *eth_dev_uninit* function invoked for each matching PCI device. +* - The *eth_dev_uninit* function invoked for each matching device. * * - 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. */ 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. */ };/** +* @internal +* The structure associated with a PMD PCI Ethernet driver. +*/ +struct rte_pci_eth_driver { +struct rte_pci_driver pci_drv;/**< Underlying PCI driver. */ +struct eth_driver eth_drv;/**< Ethernet driver. */ +}; + +/** * Convert a numerical speed in Mbps to a bitmap flag that can be used in * the bitmap link_speeds of the struct rte_eth_conf *
Signature · 1 line
2.11.0
PATCH 6/6 eal: VMBUS infrastructure
In reply to Stephen HemmingerAdd support for VMBUS on Hyper-V/Azure. VMBUS is similar to PCI but has different addressing and internal API's.
--- lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_devargs.c | 7 + lib/librte_eal/common/eal_common_options.c | 38 ++ lib/librte_eal/common/eal_internal_cfg.h | 3 +- lib/librte_eal/common/eal_options.h | 6 + lib/librte_eal/common/eal_private.h | 5 + lib/librte_eal/common/include/rte_devargs.h | 8 + lib/librte_eal/common/include/rte_vmbus.h | 249 ++++++++ lib/librte_eal/linuxapp/eal/Makefile | 6 + lib/librte_eal/linuxapp/eal/eal.c | 11 + lib/librte_eal/linuxapp/eal/eal_vmbus.c | 907 ++++++++++++++++++++++++++++ lib/librte_ether/rte_ethdev.c | 90 +++ lib/librte_ether/rte_ethdev.h | 25 + mk/rte.app.mk | 1 + 14 files changed, 1356 insertions(+), 2 deletions(-) create mode 100644 lib/librte_eal/common/include/rte_vmbus.h create mode 100644 lib/librte_eal/linuxapp/eal/eal_vmbus.c
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 INC += rte_per_lcore.h rte_random.h INC += rte_tailq.h rte_interrupts.h rte_alarm.h INC += rte_string_fns.h rte_version.h
lib/librte_eal/common/eal_common_devargs.c +7 -0
@@ -113,6 +113,13 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str) goto fail;break ; +case RTE_DEVTYPE_WHITELISTED_VMBUS : +case RTE_DEVTYPE_BLACKLISTED_VMBUS : +#ifdef RTE_LIBRTE_HV_PMD +if (uuid_parse (buf, devargs->uuid) ==0 ) +break ; +#endif + goto fail; }free (buf);
lib/librte_eal/common/eal_common_options.c +38 -0
@@ -95,6 +95,11 @@ eal_long_options[] = { {OPT_VFIO_INTR, 1, NULL, OPT_VFIO_INTR_NUM }, {OPT_VMWARE_TSC_MAP, 0, NULL, OPT_VMWARE_TSC_MAP_NUM }, {OPT_XEN_DOM0, 0, NULL, OPT_XEN_DOM0_NUM }, +#ifdef RTE_LIBRTE_HV_PMD + {OPT_NO_VMBUS, 0, NULL, OPT_NO_VMBUS_NUM }, + {OPT_VMBUS_BLACKLIST, 1, NULL, OPT_VMBUS_BLACKLIST_NUM }, + {OPT_VMBUS_WHITELIST, 1, NULL, OPT_VMBUS_WHITELIST_NUM }, +#endif {0, 0, NULL, 0 } };
@@ -858,6 +863,21 @@ eal_parse_common_option(int opt, const char *optarg, conf->no_pci =1 ;break ; +#ifdef RTE_LIBRTE_HV_PMD +case OPT_NO_VMBUS_NUM : + conf->no_vmbus =1 ; +break ; +case OPT_VMBUS_BLACKLIST_NUM : +if (rte_eal_devargs_add (RTE_DEVTYPE_BLACKLISTED_VMBUS , + optarg) <0 ) +return -1 ; +break ; +case OPT_VMBUS_WHITELIST_NUM : +if (rte_eal_devargs_add (RTE_DEVTYPE_WHITELISTED_VMBUS , + optarg) <0 ) +return -1 ; +break ; +#endif case OPT_NO_HPET_NUM : conf->no_hpet =1 ;break ;
@@ -1017,6 +1037,14 @@ eal_check_common_options(struct internal_config *internal_cfg)return -1 ; } +#ifdef RTE_LIBRTE_HV_PMD +if (rte_eal_devargs_type_count (RTE_DEVTYPE_WHITELISTED_VMBUS ) !=0 && +rte_eal_devargs_type_count (RTE_DEVTYPE_BLACKLISTED_VMBUS ) !=0 ) { +RTE_LOG (ERR ,EAL ,"Options vmbus blacklist and whitelist " +"cannot be used at the same time\n" ); +return -1 ; + } +#endif return 0 ; }
@@ -1066,5 +1094,15 @@ eal_common_usage(void)" --" OPT_NO_PCI " Disable PCI\n" " --" OPT_NO_HPET " Disable HPET\n" " --" OPT_NO_SHCONF " No shared config (mmap'd files)\n" +#ifdef RTE_LIBRTE_HV_PMD +" --" OPT_NO_VMBUS " Disable VMBUS\n" +" --" OPT_VMBUS_BLACKLIST " Add a VMBUS device to black list.\n" +" Prevent EAL from using this PCI device. The argument\n" +" format is device UUID.\n" +" --" OPT_VMBUS_WHITELIST " Add a VMBUS device to white list.\n" +" Only use the specified VMBUS devices. The argument format\n" +" is device UUID This option can be present\n" +" several times (once per device).\n" +#endif "\n", RTE_MAX_LCORE); }
lib/librte_eal/common/eal_internal_cfg.h +2 -1
@@ -69,7 +69,8 @@ struct internal_config {volatile unsigned no_pci;/**< true to disable PCI */ volatile unsigned no_hpet;/**< true to disable HPET */ volatile unsigned vmware_tsc_map;/**< true to use VMware TSC mapping -* instead of native TSC */ +* instead of native TSC */ +volatile unsigned no_vmbus;/**< true to disable VMBUS */ volatile unsigned no_shconf;/**< true if there is no shared config */ volatile unsigned create_uio_dev;/**< true to create /dev/uioX devices */ volatile enum rte_proc_type_t process_type;/**< multi-process proc type */
lib/librte_eal/common/eal_options.h +6 -0
@@ -83,6 +83,12 @@ enum {OPT_VMWARE_TSC_MAP_NUM , #define OPT_XEN_DOM0 "xen-dom0"OPT_XEN_DOM0_NUM , +#define OPT_NO_VMBUS "no-vmbus" +OPT_NO_VMBUS_NUM , +#define OPT_VMBUS_BLACKLIST "vmbus-blacklist" +OPT_VMBUS_BLACKLIST_NUM , +#define OPT_VMBUS_WHITELIST "vmbus-whitelist" +OPT_VMBUS_WHITELIST_NUM , OPT_LONG_MAX_NUM };
lib/librte_eal/common/eal_private.h +5 -0
@@ -210,6 +210,11 @@ int pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, struct mapped_pci_resource *uio_res, int map_idx);/** +* VMBUS related functions and structures +*/ +int rte_eal_vmbus_init (void ); + +/** * 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/common/include/rte_devargs.h +8 -0
@@ -51,6 +51,9 @@ extern "C" {#include <stdio.h> #include <sys/queue.h> #include <rte_pci.h> +#ifdef RTE_LIBRTE_HV_PMD +#include <uuid/uuid.h> +#endif /** * Type of generic device
@@ -59,6 +62,8 @@ enum rte_devtype {RTE_DEVTYPE_WHITELISTED_PCI ,RTE_DEVTYPE_BLACKLISTED_PCI ,RTE_DEVTYPE_VIRTUAL , +RTE_DEVTYPE_WHITELISTED_VMBUS , + RTE_DEVTYPE_BLACKLISTED_VMBUS, };/**
@@ -88,6 +93,9 @@ struct rte_devargs {/** Driver name. */ char drv_name[32 ]; } virt; +#ifdef RTE_LIBRTE_HV_PMD +uuid_t uuid; +#endif };/** Arguments string as given by user or "" for no argument. */ char *args;
lib/librte_eal/common/include/rte_vmbus.h new file +249 -0
249 lines not on this page · raw message
lib/librte_eal/linuxapp/eal/Makefile +6 -0
@@ -71,6 +71,11 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_timer.c SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_interrupts.c SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_alarm.c +ifeq ($(CONFIG_RTE_LIBRTE_HV_PMD),y) +SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_vmbus.c +LDLIBS += -luuid +endif + # from common dir SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_lcore.c SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_timer.c
@@ -114,6 +119,7 @@ CFLAGS_eal_hugepage_info.o := -D_GNU_SOURCE CFLAGS_eal_pci.o := -D_GNU_SOURCE CFLAGS_eal_pci_uio.o := -D_GNU_SOURCE CFLAGS_eal_pci_vfio.o := -D_GNU_SOURCE +CFLAGS_eal_vmbux.o := -D_GNU_SOURCE CFLAGS_eal_common_whitelist.o := -D_GNU_SOURCE CFLAGS_eal_common_options.o := -D_GNU_SOURCE CFLAGS_eal_common_thread.o := -D_GNU_SOURCE
lib/librte_eal/linuxapp/eal/eal.c +11 -0
@@ -70,6 +70,7 @@#include <rte_cpuflags.h> #include <rte_interrupts.h> #include <rte_pci.h> +#include <rte_vmbus.h> #include <rte_dev.h> #include <rte_devargs.h> #include <rte_common.h>
@@ -830,6 +831,11 @@ rte_eal_init(int argc, char **argv)eal_check_mem_on_local_socket (); +#ifdef RTE_LIBRTE_HV_PMD +if (rte_eal_vmbus_init () <0 ) +RTE_LOG (ERR ,EAL ,"Cannot init VMBUS\n" ); +#endif +if (eal_plugins_init () <0 )rte_panic ("Cannot init plugins\n" );
@@ -884,6 +890,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 +if (rte_eal_dev_init () <0 )rte_panic ("Cannot init pmd devices\n" );
lib/librte_eal/linuxapp/eal/eal_vmbus.c new file +907 -0
907 lines not on this page · raw message
lib/librte_ether/rte_ethdev.c +90 -0
93 lines not on this page · raw message
lib/librte_ether/rte_ethdev.h +25 -0
@@ -180,6 +180,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_ether.h"
@@ -1876,6 +1877,15 @@ struct rte_pci_eth_driver { };/** +* @internal +* The structure associated with a PMD VMBUS Ethernet driver. +*/ +struct rte_vmbus_eth_driver { +struct rte_vmbus_driver vmbus_drv;/**< Underlying VMBUS driver. */ +struct eth_driver eth_drv;/**< Ethernet driver. */ +}; + +/** * Convert a numerical speed in Mbps to a bitmap flag that can be used in * the bitmap link_speeds of the struct rte_eth_conf *
@@ -4399,6 +4409,21 @@ int rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,*/ int rte_eth_dev_pci_remove (struct rte_pci_device *pci_dev); +/** +* @internal +* Wrapper for use by vmbus drivers as a .probe function to attach to a ethdev +* interface. +*/ +int rte_eth_dev_vmbus_probe (struct rte_vmbus_driver *vmbus_drv, +struct rte_vmbus_device *vmbus_dev); + +/** +* @internal +* Wrapper for use by vmbus drivers as a .remove function to detach a ethdev +* interface. +*/ +int rte_eth_dev_vmbus_remove (struct rte_vmbus_device *vmbus_dev); + #ifdef __cplusplus }#endif
mk/rte.app.mk +1 -0
@@ -130,6 +130,7 @@ ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost endif # $(CONFIG_RTE_LIBRTE_VHOST) _LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio +_LDLIBS-$(CONFIG_RTE_LIBRTE_HV_PMD) += -luuid ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb
Signature · 1 line
2.11.0
Re: [PATCH 2/6] i40e: don't refer to eth_dev->pci_dev
In reply to Stephen HemmingerQuoted 9 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Tuesday, January 3, 2017 7:09 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH 2/6] i40e: don't refer toeth_dev->pci_dev
Quoted 4 lines
Later patches remove
pci_devfrom the ethernet device structure. Fix the i40e code to just use it's own name when forming zone name.Signed-off-by Stephen Hemminger <[email protected]>