[dpdk-dev,v5,10/17] ethdev: get rid of eth driver register callback

Message ID 1466586396-22618-11-git-send-email-shreyansh.jain@nxp.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Shreyansh Jain June 22, 2016, 9:06 a.m. UTC
  Now that all pdev are pci drivers, we don't need to register ethdev drivers
through a dedicated channel.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 lib/librte_ether/rte_ethdev.c          | 22 ----------------------
 lib/librte_ether/rte_ethdev.h          | 12 ------------
 lib/librte_ether/rte_ether_version.map |  1 -
 3 files changed, 35 deletions(-)
  

Comments

Neil Horman June 22, 2016, 1:28 p.m. UTC | #1
On Wed, Jun 22, 2016 at 02:36:29PM +0530, Shreyansh Jain wrote:
> Now that all pdev are pci drivers, we don't need to register ethdev drivers
> through a dedicated channel.
> 
> Signed-off-by: David Marchand <david.marchand@6wind.com>
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> ---
>  lib/librte_ether/rte_ethdev.c          | 22 ----------------------
>  lib/librte_ether/rte_ethdev.h          | 12 ------------
>  lib/librte_ether/rte_ether_version.map |  1 -
>  3 files changed, 35 deletions(-)
> 
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 312c42c..06065fe 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -340,28 +340,6 @@ rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
>  	return 0;
>  }
>  
> -/**
> - * Register an Ethernet [Poll Mode] driver.
> - *
> - * Function invoked by the initialization function of an Ethernet driver
> - * to simultaneously register itself as a PCI driver and as an Ethernet
> - * Poll Mode Driver.
> - * Invokes the rte_eal_pci_register() function to register the *pci_drv*
> - * structure embedded in the *eth_drv* structure, after having stored the
> - * address of the rte_eth_dev_init() function in the *devinit* field of
> - * the *pci_drv* structure.
> - * During the PCI probing phase, the rte_eth_dev_init() function is
> - * invoked for each PCI [Ethernet device] matching the embedded PCI
> - * identifiers provided by the driver.
> - */
> -void
> -rte_eth_driver_register(struct eth_driver *eth_drv)
> -{
> -	eth_drv->pci_drv.devinit = rte_eth_dev_pci_probe;
> -	eth_drv->pci_drv.devuninit = rte_eth_dev_pci_remove;
> -	rte_eal_pci_register(&eth_drv->pci_drv);
> -}
> -
>  int
>  rte_eth_dev_is_valid_port(uint8_t port_id)
>  {
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 2249466..ffd24e4 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -1862,18 +1862,6 @@ struct eth_driver {
>  };
>  
>  /**
> - * @internal
> - * A function invoked by the initialization function of an Ethernet driver
> - * to simultaneously register itself as a PCI driver and as an Ethernet
> - * Poll Mode Driver (PMD).
> - *
> - * @param eth_drv
> - *   The pointer to the *eth_driver* structure associated with
> - *   the Ethernet driver.
> - */
> -void rte_eth_driver_register(struct eth_driver *eth_drv);
> -
> -/**
>   * 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
>   *
> diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
> index cf4581c..8151007 100644
> --- a/lib/librte_ether/rte_ether_version.map
> +++ b/lib/librte_ether/rte_ether_version.map
> @@ -80,7 +80,6 @@ DPDK_2.2 {
>  	rte_eth_dev_vlan_filter;
>  	rte_eth_dev_wd_timeout_store;
>  	rte_eth_dma_zone_reserve;
> -	rte_eth_driver_register;
>  	rte_eth_led_off;
>  	rte_eth_led_on;
>  	rte_eth_link;
Nak, Same issue as the crypto registration

> -- 
> 2.7.4
> 
>
  
Shreyansh Jain June 22, 2016, 1:44 p.m. UTC | #2
On Wednesday 22 June 2016 06:58 PM, Neil Horman wrote:
> On Wed, Jun 22, 2016 at 02:36:29PM +0530, Shreyansh Jain wrote:
>> Now that all pdev are pci drivers, we don't need to register ethdev drivers
>> through a dedicated channel.
>>
>> Signed-off-by: David Marchand <david.marchand@6wind.com>
>> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
>> ---
>>  lib/librte_ether/rte_ethdev.c          | 22 ----------------------
>>  lib/librte_ether/rte_ethdev.h          | 12 ------------
>>  lib/librte_ether/rte_ether_version.map |  1 -
>>  3 files changed, 35 deletions(-)
>>
>> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
>> index 312c42c..06065fe 100644
>> --- a/lib/librte_ether/rte_ethdev.c
>> +++ b/lib/librte_ether/rte_ethdev.c
>> @@ -340,28 +340,6 @@ rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
>>  	return 0;
>>  }
>>  
>> -/**
>> - * Register an Ethernet [Poll Mode] driver.
>> - *
>> - * Function invoked by the initialization function of an Ethernet driver
>> - * to simultaneously register itself as a PCI driver and as an Ethernet
>> - * Poll Mode Driver.
>> - * Invokes the rte_eal_pci_register() function to register the *pci_drv*
>> - * structure embedded in the *eth_drv* structure, after having stored the
>> - * address of the rte_eth_dev_init() function in the *devinit* field of
>> - * the *pci_drv* structure.
>> - * During the PCI probing phase, the rte_eth_dev_init() function is
>> - * invoked for each PCI [Ethernet device] matching the embedded PCI
>> - * identifiers provided by the driver.
>> - */
>> -void
>> -rte_eth_driver_register(struct eth_driver *eth_drv)
>> -{
>> -	eth_drv->pci_drv.devinit = rte_eth_dev_pci_probe;
>> -	eth_drv->pci_drv.devuninit = rte_eth_dev_pci_remove;
>> -	rte_eal_pci_register(&eth_drv->pci_drv);
>> -}
>> -
>>  int
>>  rte_eth_dev_is_valid_port(uint8_t port_id)
>>  {
>> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
>> index 2249466..ffd24e4 100644
>> --- a/lib/librte_ether/rte_ethdev.h
>> +++ b/lib/librte_ether/rte_ethdev.h
>> @@ -1862,18 +1862,6 @@ struct eth_driver {
>>  };
>>  
>>  /**
>> - * @internal
>> - * A function invoked by the initialization function of an Ethernet driver
>> - * to simultaneously register itself as a PCI driver and as an Ethernet
>> - * Poll Mode Driver (PMD).
>> - *
>> - * @param eth_drv
>> - *   The pointer to the *eth_driver* structure associated with
>> - *   the Ethernet driver.
>> - */
>> -void rte_eth_driver_register(struct eth_driver *eth_drv);
>> -
>> -/**
>>   * 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
>>   *
>> diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
>> index cf4581c..8151007 100644
>> --- a/lib/librte_ether/rte_ether_version.map
>> +++ b/lib/librte_ether/rte_ether_version.map
>> @@ -80,7 +80,6 @@ DPDK_2.2 {
>>  	rte_eth_dev_vlan_filter;
>>  	rte_eth_dev_wd_timeout_store;
>>  	rte_eth_dma_zone_reserve;
>> -	rte_eth_driver_register;
>>  	rte_eth_led_off;
>>  	rte_eth_led_on;
>>  	rte_eth_link;
> Nak, Same issue as the crypto registration

Yes, I agree. I will fix this in next version.

> 
>> -- 
>> 2.7.4
>>
>>
>
  

Patch

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 312c42c..06065fe 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -340,28 +340,6 @@  rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
 	return 0;
 }
 
-/**
- * Register an Ethernet [Poll Mode] driver.
- *
- * Function invoked by the initialization function of an Ethernet driver
- * to simultaneously register itself as a PCI driver and as an Ethernet
- * Poll Mode Driver.
- * Invokes the rte_eal_pci_register() function to register the *pci_drv*
- * structure embedded in the *eth_drv* structure, after having stored the
- * address of the rte_eth_dev_init() function in the *devinit* field of
- * the *pci_drv* structure.
- * During the PCI probing phase, the rte_eth_dev_init() function is
- * invoked for each PCI [Ethernet device] matching the embedded PCI
- * identifiers provided by the driver.
- */
-void
-rte_eth_driver_register(struct eth_driver *eth_drv)
-{
-	eth_drv->pci_drv.devinit = rte_eth_dev_pci_probe;
-	eth_drv->pci_drv.devuninit = rte_eth_dev_pci_remove;
-	rte_eal_pci_register(&eth_drv->pci_drv);
-}
-
 int
 rte_eth_dev_is_valid_port(uint8_t port_id)
 {
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 2249466..ffd24e4 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1862,18 +1862,6 @@  struct eth_driver {
 };
 
 /**
- * @internal
- * A function invoked by the initialization function of an Ethernet driver
- * to simultaneously register itself as a PCI driver and as an Ethernet
- * Poll Mode Driver (PMD).
- *
- * @param eth_drv
- *   The pointer to the *eth_driver* structure associated with
- *   the Ethernet driver.
- */
-void rte_eth_driver_register(struct eth_driver *eth_drv);
-
-/**
  * 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
  *
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index cf4581c..8151007 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -80,7 +80,6 @@  DPDK_2.2 {
 	rte_eth_dev_vlan_filter;
 	rte_eth_dev_wd_timeout_store;
 	rte_eth_dma_zone_reserve;
-	rte_eth_driver_register;
 	rte_eth_led_off;
 	rte_eth_led_on;
 	rte_eth_link;