From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15]) by dpdk.org (Postfix) with ESMTP id 0703EADAB for ; Fri, 8 Jul 2016 21:10:37 +0200 (CEST) Received: from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz [147.229.13.147]) by wes1-so1.wedos.net (Postfix) with ESMTPSA id 3rmPG468ZxzCCP; Fri, 8 Jul 2016 21:10:36 +0200 (CEST) From: Jan Viktorin To: dev@dpdk.org Cc: Jan Viktorin , Shreyansh Jain , thomas.monjalon@6wind.com, David Marchand Date: Fri, 8 Jul 2016 21:09:41 +0200 Message-Id: <20160708190945.24225-12-viktorin@rehivetech.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160708190945.24225-1-viktorin@rehivetech.com> References: <20160708190945.24225-1-viktorin@rehivetech.com> Subject: [dpdk-dev] [PATCH v1 11/15] eal/pci: inherit rte_driver by rte_pci_driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 19:10:37 -0000 Signed-off-by: Jan Viktorin --- app/test/test_pci.c | 10 +++++++--- app/test/virtual_pmd.c | 2 +- drivers/crypto/qat/rte_qat_cryptodev.c | 4 +++- drivers/net/bnx2x/bnx2x_ethdev.c | 8 ++++++-- drivers/net/cxgbe/cxgbe_ethdev.c | 4 +++- drivers/net/cxgbe/sge.c | 6 +++--- drivers/net/e1000/em_ethdev.c | 4 +++- drivers/net/e1000/igb_ethdev.c | 8 ++++++-- drivers/net/ena/ena_ethdev.c | 4 +++- drivers/net/enic/enic_ethdev.c | 4 +++- drivers/net/fm10k/fm10k_ethdev.c | 4 +++- drivers/net/i40e/i40e_ethdev.c | 4 +++- drivers/net/i40e/i40e_ethdev_vf.c | 4 +++- drivers/net/i40e/i40e_fdir.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++-- drivers/net/mlx4/mlx4.c | 4 +++- drivers/net/mlx5/mlx5.c | 4 +++- drivers/net/nfp/nfp_net.c | 4 +++- drivers/net/qede/qede_ethdev.c | 4 ++++ drivers/net/szedata2/rte_eth_szedata2.c | 4 +++- drivers/net/virtio/virtio_ethdev.c | 6 ++++-- drivers/net/vmxnet3/vmxnet3_ethdev.c | 7 +++++-- drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +- lib/librte_cryptodev/rte_cryptodev.c | 4 ++-- lib/librte_eal/common/eal_common_pci.c | 4 ++-- lib/librte_eal/common/include/rte_pci.h | 4 +++- lib/librte_ether/rte_ethdev.c | 4 ++-- 27 files changed, 89 insertions(+), 38 deletions(-) diff --git a/app/test/test_pci.c b/app/test/test_pci.c index 354a0ad..9be08f9 100644 --- a/app/test/test_pci.c +++ b/app/test/test_pci.c @@ -78,14 +78,18 @@ struct rte_pci_id my_driver_id2[] = { }; struct rte_pci_driver my_driver = { - .name = "test_driver", + .driver = { + .name = "test_driver", + }, .devinit = my_driver_init, .id_table = my_driver_id, .drv_flags = 0, }; struct rte_pci_driver my_driver2 = { - .name = "test_driver2", + .driver = { + .name = "test_driver2", + }, .devinit = my_driver_init, .id_table = my_driver_id2, .drv_flags = 0, @@ -95,7 +99,7 @@ static int my_driver_init(__attribute__((unused)) struct rte_pci_driver *dr, struct rte_pci_device *dev) { - printf("My driver init called in %s\n", dr->name); + printf("My driver init called in %s\n", dr->driver.name); printf("%x:%x:%x.%d", dev->addr.domain, dev->addr.bus, dev->addr.devid, dev->addr.function); printf(" - vendor:%x device:%x\n", dev->id.vendor_id, dev->id.device_id); diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index 8a1f0d0..56eeb99 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -586,7 +586,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, goto err; pci_dev->numa_node = socket_id; - pci_drv->name = virtual_ethdev_driver_name; + pci_drv->driver.name = virtual_ethdev_driver_name; pci_drv->id_table = id_table; if (isr_support) diff --git a/drivers/crypto/qat/rte_qat_cryptodev.c b/drivers/crypto/qat/rte_qat_cryptodev.c index 970970a..fab8bd8 100644 --- a/drivers/crypto/qat/rte_qat_cryptodev.c +++ b/drivers/crypto/qat/rte_qat_cryptodev.c @@ -114,7 +114,9 @@ crypto_qat_dev_init(__attribute__((unused)) struct rte_cryptodev_driver *crypto_ static struct rte_cryptodev_driver rte_qat_pmd = { .pci_drv = { - .name = "rte_qat_pmd", + .driver = { + .name = "rte_qat_pmd", + }, .id_table = pci_id_qat_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .devinit = rte_cryptodev_pci_probe, diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 5ab3c75..062a93f 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -503,7 +503,9 @@ eth_bnx2xvf_dev_init(struct rte_eth_dev *eth_dev) static struct eth_driver rte_bnx2x_pmd = { .pci_drv = { - .name = "rte_bnx2x_pmd", + .driver = { + .name = "rte_bnx2x_pmd", + }, .id_table = pci_id_bnx2x_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, .devinit = rte_eth_dev_pci_probe, @@ -520,7 +522,9 @@ RTE_EAL_PCI_REGISTER(rte_bnx2x_pmd); */ static struct eth_driver rte_bnx2xvf_pmd = { .pci_drv = { - .name = "rte_bnx2xvf_pmd", + .driver = { + .name = "rte_bnx2xvf_pmd", + }, .id_table = pci_id_bnx2xvf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index 1389371..33934c3 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -866,7 +866,9 @@ out_free_adapter: static struct eth_driver rte_cxgbe_pmd = { .pci_drv = { - .name = "rte_cxgbe_pmd", + .driver = { + .name = "rte_cxgbe_pmd", + }, .id_table = cxgb4_pci_tbl, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c index ab5a842..c03c760 100644 --- a/drivers/net/cxgbe/sge.c +++ b/drivers/net/cxgbe/sge.c @@ -1645,7 +1645,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, iq->size = cxgbe_roundup(iq->size, 16); snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - eth_dev->driver->pci_drv.name, fwevtq ? "fwq_ring" : "rx_ring", + eth_dev->driver->pci_drv.driver.name, 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,7 +1697,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, fl->size = cxgbe_roundup(fl->size, 8); snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - eth_dev->driver->pci_drv.name, + eth_dev->driver->pci_drv.driver.name, 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,7 +1893,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq, 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.name, "tx_ring", + eth_dev->driver->pci_drv.driver.name, "tx_ring", eth_dev->data->port_id, queue_id); snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name); diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index c67e67f..2de3075 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -364,7 +364,9 @@ eth_em_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_em_pmd = { .pci_drv = { - .name = "rte_em_pmd", + .driver = { + .name = "rte_em_pmd", + }, .id_table = pci_id_em_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index a523944..c414c03 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -979,7 +979,9 @@ eth_igbvf_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_igb_pmd = { .pci_drv = { - .name = "rte_igb_pmd", + .driver = { + .name = "rte_igb_pmd", + }, .id_table = pci_id_igb_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, @@ -998,7 +1000,9 @@ RTE_EAL_PCI_REGISTER(rte_igb_pmd); */ static struct eth_driver rte_igbvf_pmd = { .pci_drv = { - .name = "rte_igbvf_pmd", + .driver = { + .name = "rte_igbvf_pmd", + }, .id_table = pci_id_igbvf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index dc32435..35fffc0 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1428,7 +1428,9 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, static struct eth_driver rte_ena_pmd = { .pci_drv = { - .name = "rte_ena_pmd", + .driver = { + .name = "rte_ena_pmd", + }, .id_table = pci_id_ena_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index d5e395d..0eb7948 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -657,7 +657,9 @@ 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", + .driver = { + .name = "rte_enic_pmd", + }, .id_table = pci_id_enic_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 8ec8f5e..4ffa66c 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -3060,7 +3060,9 @@ static const struct rte_pci_id pci_id_fm10k_map[] = { static struct eth_driver rte_pmd_fm10k = { .pci_drv = { - .name = "rte_pmd_fm10k", + .driver = { + .name = "rte_pmd_fm10k", + }, .id_table = pci_id_fm10k_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f2712ab..0eb82f8 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -641,7 +641,9 @@ static const struct rte_i40e_xstats_name_off rte_i40e_txq_prio_strings[] = { static struct eth_driver rte_i40e_pmd = { .pci_drv = { - .name = "rte_i40e_pmd", + .driver = { + .name = "rte_i40e_pmd", + }, .id_table = pci_id_i40e_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 3411831..f67f9fa 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1552,7 +1552,9 @@ i40evf_dev_uninit(struct rte_eth_dev *eth_dev) */ static struct eth_driver rte_i40evf_pmd = { .pci_drv = { - .name = "rte_i40evf_pmd", + .driver = { + .name = "rte_i40evf_pmd", + }, .id_table = pci_id_i40evf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 8aa41e5..0a79dd1 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -249,7 +249,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.name, + eth_dev->driver->pci_drv.driver.name, I40E_FDIR_MZ_NAME, eth_dev->data->port_id); mz = i40e_memzone_reserve(z_name, I40E_FDIR_PKT_LEN, SOCKET_ID_ANY); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index dd521e8..82a81fa 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1489,7 +1489,9 @@ eth_ixgbevf_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_ixgbe_pmd = { .pci_drv = { - .name = "rte_ixgbe_pmd", + .driver = { + .name = "rte_ixgbe_pmd", + }, .id_table = pci_id_ixgbe_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, @@ -1508,7 +1510,9 @@ RTE_EAL_PCI_REGISTER(rte_ixgbe_pmd); */ static struct eth_driver rte_ixgbevf_pmd = { .pci_drv = { - .name = "rte_ixgbevf_pmd", + .driver = { + .name = "rte_ixgbevf_pmd", + }, .id_table = pci_id_ixgbevf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index ba42c33..310d98c 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -5829,7 +5829,9 @@ static const struct rte_pci_id mlx4_pci_id_map[] = { static struct eth_driver mlx4_driver = { .pci_drv = { - .name = MLX4_DRIVER_NAME, + .driver = { + .name = MLX4_DRIVER_NAME, + }, .id_table = mlx4_pci_id_map, .devinit = mlx4_pci_devinit, .drv_flags = RTE_PCI_DRV_INTR_LSC, diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index f6399fc..3f6509a 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -638,7 +638,9 @@ static const struct rte_pci_id mlx5_pci_id_map[] = { static struct eth_driver mlx5_driver = { .pci_drv = { - .name = MLX5_DRIVER_NAME, + .driver = { + .name = MLX5_DRIVER_NAME, + }, .id_table = mlx5_pci_id_map, .devinit = mlx5_pci_devinit, .drv_flags = RTE_PCI_DRV_INTR_LSC, diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 951c8b4..69c2678 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2464,7 +2464,9 @@ static struct rte_pci_id pci_id_nfp_net_map[] = { static struct eth_driver rte_nfp_net_pmd = { .pci_drv = { - .name = "rte_nfp_net_pmd", + .driver = { + .name = "rte_nfp_net_pmd", + }, .id_table = pci_id_nfp_net_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 4fcb54c..6d06f53 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1052,7 +1052,9 @@ static struct rte_pci_id pci_id_qede_map[] = { static struct eth_driver rte_qedevf_pmd = { .pci_drv = { + .driver { .name = "rte_qedevf_pmd", + }, .id_table = pci_id_qedevf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, @@ -1066,7 +1068,9 @@ static struct eth_driver rte_qedevf_pmd = { static struct eth_driver rte_qede_pmd = { .pci_drv = { + .driver = { .name = "rte_qede_pmd", + }, .id_table = pci_id_qede_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index d925bc6..c0d6963 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -1572,7 +1572,9 @@ static const struct rte_pci_id rte_szedata2_pci_id_table[] = { static struct eth_driver szedata2_eth_driver = { .pci_drv = { - .name = RTE_SZEDATA2_PCI_DRIVER_NAME, + .driver = { + .name = RTE_SZEDATA2_PCI_DRIVER_NAME, + }, .id_table = rte_szedata2_pci_id_table, .devinit = rte_eth_dev_pci_probe, .devuninit = rte_eth_dev_pci_remove, diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 9f5faf1..9c06c46 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1252,7 +1252,9 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_virtio_pmd = { .pci_drv = { - .name = "rte_virtio_pmd", + .driver = { + .name = "rte_virtio_pmd", + }, .id_table = pci_id_virtio_map, .drv_flags = RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, @@ -1473,7 +1475,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct virtio_hw *hw = dev->data->dev_private; - dev_info->driver_name = dev->driver->pci_drv.name; + dev_info->driver_name = dev->driver->pci_drv.driver.name; dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues; dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues; dev_info->min_rx_bufsize = VIRTIO_MIN_RX_BUFSIZE; diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 79c5f6d..a7438d1 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -138,7 +138,8 @@ gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size, const struct rte_memzone *mz; snprintf(z_name, sizeof(z_name), "%s_%d_%s", - dev->driver->pci_drv.name, dev->data->port_id, post_string); + dev->driver->pci_drv.driver.name, + dev->data->port_id, post_string); mz = rte_memzone_lookup(z_name); if (mz) @@ -329,7 +330,9 @@ eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_vmxnet3_pmd = { .pci_drv = { - .name = "rte_vmxnet3_pmd", + .driver = { + .name = "rte_vmxnet3_pmd", + }, .id_table = pci_id_vmxnet3_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index ccafc0c..536f0ac 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -772,7 +772,7 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name, const struct rte_memzone *mz; snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - dev->driver->pci_drv.name, ring_name, + dev->driver->pci_drv.driver.name, ring_name, dev->data->port_id, queue_id); mz = rte_memzone_lookup(z_name); diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 3b587e4..afb13d7 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -370,7 +370,7 @@ rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv, return 0; CDEV_LOG_ERR("driver %s: crypto_dev_init(vendor_id=0x%x device_id=0x%x)" - " failed", pci_drv->name, + " failed", pci_drv->driver.name, (unsigned) pci_dev->id.vendor_id, (unsigned) pci_dev->id.device_id); @@ -781,7 +781,7 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info) dev_info->pci_dev = dev->pci_dev; if (dev->driver) - dev_info->driver_name = dev->driver->pci_drv.name; + dev_info->driver_name = dev->driver->pci_drv.driver.name; } diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index d05dda4..3bcb059 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -193,7 +193,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d } RTE_LOG(INFO, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id, - dev->id.device_id, dr->name); + dev->id.device_id, dr->driver.name); if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) { /* map resources for devices that use igb_uio */ @@ -253,7 +253,7 @@ rte_eal_pci_detach_dev(struct rte_pci_driver *dr, loc->function, dev->numa_node); RTE_LOG(DEBUG, EAL, " remove driver: %x:%x %s\n", dev->id.vendor_id, - dev->id.device_id, dr->name); + dev->id.device_id, dr->driver.name); if (dr->devuninit && (dr->devuninit(dev) < 0)) return -1; /* negative value is an error */ diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 950ea89..139d76f 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -202,13 +202,15 @@ typedef int (pci_devuninit_t)(struct rte_pci_device *); */ struct rte_pci_driver { TAILQ_ENTRY(rte_pci_driver) next; /**< Next in list. */ - const char *name; /**< Driver name. */ + struct rte_driver driver; /**< Inherit the core driver. */ pci_devinit_t *devinit; /**< Device init. function. */ pci_devuninit_t *devuninit; /**< Device uninit function. */ const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */ uint32_t drv_flags; /**< Flags contolling handling of device. */ }; +#define to_pci_driver(drv) container_of((drv), struct rte_pci_driver, driver) + /** Device needs PCI BAR mapping (done with either IGB_UIO or VFIO) */ #define RTE_PCI_DRV_NEED_MAPPING 0x0001 /** Device needs to be unbound even if no module is provided */ diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 48c7254..f2e0716 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2562,7 +2562,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, const struct rte_memzone *mz; snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - dev->driver->pci_drv.name, ring_name, + dev->driver->pci_drv.driver.name, ring_name, dev->data->port_id, queue_id); mz = rte_memzone_lookup(z_name); @@ -3216,7 +3216,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de eth_dev->data->kdrv = pci_dev->kdrv; eth_dev->data->numa_node = pci_dev->numa_node; - eth_dev->data->drv_name = pci_dev->driver->name; + eth_dev->data->drv_name = pci_dev->driver->driver.name; } int -- 2.9.0