[dpdk-dev,2/2] net: align ethdev and eal driver names
Commit Message
On 11/10/2016 1:51 PM, David Marchand wrote:
> Some virtual pmds report a different name than the vdev driver name
> registered in eal.
> While it does not hurt, let's try to be consistent.
>
> Signed-off-by: David Marchand <david.marchand@6wind.com>
> ---
Since you did all the work, instead of second patch what do you think
doing something like [1] (basically adding eth_dev->rte_driver link) and
when done for all vdevs, remove eth_dev->data->drv_name completely?
[1]
struct rte_eth_dev_sriov {
Comments
Hello Ferruh,
On Thu, Nov 10, 2016 at 7:46 PM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> On 11/10/2016 1:51 PM, David Marchand wrote:
>> Some virtual pmds report a different name than the vdev driver name
>> registered in eal.
>> While it does not hurt, let's try to be consistent.
>>
>> Signed-off-by: David Marchand <david.marchand@6wind.com>
>> ---
>
> Since you did all the work, instead of second patch what do you think
> doing something like [1] (basically adding eth_dev->rte_driver link) and
> when done for all vdevs, remove eth_dev->data->drv_name completely?
Hum, in the end, it is better to wait for Shreyansh 17.02 patches.
Either I will rebase this patchset, or it won't be necessary anymore.
b/drivers/net/null/rte_eth_null.c
@@ -553,9 +553,9 @@ eth_dev_null_create(const char *name,
TAILQ_INIT(ð_dev->link_intr_cbs);
eth_dev->driver = NULL;
+ eth_dev->rte_driver = &pmd_null_drv.driver;
data->dev_flags = RTE_ETH_DEV_DETACHABLE;
data->kdrv = RTE_KDRV_NONE;
- data->drv_name = pmd_null_drv.driver.name;
data->numa_node = numa_node;
/* finally assign rx and tx ops */
@@ -259,6 +259,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
}
eth_dev->pci_dev = pci_dev;
eth_dev->driver = eth_drv;
+ eth_dev->rte_driver = pci_drv->driver.name;
eth_dev->data->rx_mbuf_alloc_failed = 0;
/* init user callbacks */
@@ -1557,7 +1558,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct
rte_eth_dev_info *dev_info)
RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
(*dev->dev_ops->dev_infos_get)(dev, dev_info);
dev_info->pci_dev = dev->pci_dev;
- dev_info->driver_name = dev->data->drv_name;
+ dev_info->driver_name = dev->rte_driver->name;
dev_info->nb_rx_queues = dev->data->nb_rx_queues;
dev_info->nb_tx_queues = dev->data->nb_tx_queues;
}
@@ -3214,7 +3215,6 @@ 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->device.numa_node;
- eth_dev->data->drv_name = pci_dev->driver->driver.name;
}
int
@@ -1642,6 +1642,7 @@ struct rte_eth_dev {
*/
struct rte_eth_rxtx_callback
*pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
uint8_t attached; /**< Flag indicating the port is attached */
+ struct rte_driver *rte_driver;
} __rte_cache_aligned;