[dpdk-dev] [PATCH v6 05/19] net/ngbe: set MAC type and LAN ID with device initialization

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Fri Jul 2 18:05:18 CEST 2021


On 6/17/21 1:59 PM, Jiawen Wu wrote:
> Add basic init and uninit function.
> Map device IDs and subsystem IDs to single ID for easy operation.
> Then initialize the shared code.
> 
> Signed-off-by: Jiawen Wu <jiawenwu at trustnetic.com>

[snip]

> diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c
> index e05766752a..a355c7dc29 100644
> --- a/drivers/net/ngbe/ngbe_ethdev.c
> +++ b/drivers/net/ngbe/ngbe_ethdev.c

> @@ -53,9 +71,9 @@ eth_ngbe_dev_uninit(struct rte_eth_dev *eth_dev)
>  	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
>  		return 0;
>  
> -	RTE_SET_USED(eth_dev);
> +	ngbe_dev_close(eth_dev);

Why is return value ignored?

>  
> -	return -EINVAL;
> +	return 0;
>  }
>  
>  static int
> @@ -86,6 +104,19 @@ static struct rte_pci_driver rte_ngbe_pmd = {
>  	.remove = eth_ngbe_pci_remove,
>  };
>  
> +/*
> + * Reset and stop device.
> + */
> +static int
> +ngbe_dev_close(struct rte_eth_dev *dev)
> +{
> +	PMD_INIT_FUNC_TRACE();
> +
> +	RTE_SET_USED(dev);
> +
> +	return -EINVAL;

Is it really a problem to implement close here for the
symmetry? Such asymmetry will result in failures if
I try to run, for example, testpmd on the patch.

> +}
> +
>  RTE_PMD_REGISTER_PCI(net_ngbe, rte_ngbe_pmd);
>  RTE_PMD_REGISTER_PCI_TABLE(net_ngbe, pci_id_ngbe_map);
>  RTE_PMD_REGISTER_KMOD_DEP(net_ngbe, "* igb_uio | uio_pci_generic | vfio-pci");

[snip]


More information about the dev mailing list