diff mbox

[dpdk-dev,v3,25/28] eal/pci: Remove pci_probe/close_all_drivers()

Message ID 1418106629-22227-26-git-send-email-mukawa@igel.co.jp (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Tetsuya Mukawa Dec. 9, 2014, 6:30 a.m. UTC
These functions are actually wrappers of pci_invoke_all_drivers().
Just call it directly.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
 lib/librte_eal/common/eal_common_pci.c | 30 ++++--------------------------
 1 file changed, 4 insertions(+), 26 deletions(-)

Comments

Michael Qiu Dec. 11, 2014, 6:02 a.m. UTC | #1
Why you do not call pci_invoke_all_drivers() directly in former patches?

What you do is first modify then remove....

Thanks,
Michael

On 12/9/2014 2:34 PM, Tetsuya Mukawa wrote:
> These functions are actually wrappers of pci_invoke_all_drivers().
> Just call it directly.
>
> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
> ---
>  lib/librte_eal/common/eal_common_pci.c | 30 ++++--------------------------
>  1 file changed, 4 insertions(+), 26 deletions(-)
>
> diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
> index 5ff7b49..5044d8e 100644
> --- a/lib/librte_eal/common/eal_common_pci.c
> +++ b/lib/librte_eal/common/eal_common_pci.c
> @@ -130,29 +130,7 @@ pci_invoke_all_drivers(struct rte_pci_device *dev, int type)
>  	return 1;
>  }
>  
> -/*
> - * If vendor/device ID match, call the devinit() function of all
> - * registered driver for the given device. Return -1 if initialization
> - * failed, return 1 if no driver is found for this device.
> - */
> -static int
> -pci_probe_all_drivers(struct rte_pci_device *dev)
> -{
> -	return pci_invoke_all_drivers(dev, INVOKE_PROBE);
> -}
> -
>  #if defined(RTE_LIBRTE_EAL_HOTPLUG) && defined(RTE_LIBRTE_EAL_LINUXAPP)
> -/*
> - * If vendor/device ID match, call the devclose() function of all
> - * registered driver for the given device. Return -1 if initialization
> - * failed, return 1 if no driver is found for this device.
> - */
> -static int
> -pci_close_all_drivers(struct rte_pci_device *dev)
> -{
> -	return pci_invoke_all_drivers(dev, INVOKE_CLOSE);
> -}
> -
>  static int
>  rte_eal_pci_invoke_one(struct rte_pci_addr *addr, int type)
>  {
> @@ -165,10 +143,10 @@ rte_eal_pci_invoke_one(struct rte_pci_addr *addr, int type)
>  
>  		switch (type) {
>  		case INVOKE_PROBE:
> -			ret = pci_probe_all_drivers(dev);
> +			ret = pci_invoke_all_drivers(dev, INVOKE_PROBE);
>  			break;
>  		case INVOKE_CLOSE:
> -			ret = pci_close_all_drivers(dev);
> +			ret = pci_invoke_all_drivers(dev, INVOKE_CLOSE);
>  			break;
>  		}
>  		if (ret < 0)
> @@ -237,10 +215,10 @@ rte_eal_pci_probe(void)
>  
>  		/* probe all or only whitelisted devices */
>  		if (probe_all)
> -			ret = pci_probe_all_drivers(dev);
> +			ret = pci_invoke_all_drivers(dev, INVOKE_PROBE);
>  		else if (devargs != NULL &&
>  			devargs->type == RTE_DEVTYPE_WHITELISTED_PCI)
> -			ret = pci_probe_all_drivers(dev);
> +			ret = pci_invoke_all_drivers(dev, INVOKE_PROBE);
>  		if (ret < 0)
>  			rte_exit(EXIT_FAILURE, "Requested device " PCI_PRI_FMT
>  				 " cannot be used\n", dev->addr.domain, dev->addr.bus,
Tetsuya Mukawa Dec. 11, 2014, 7:20 a.m. UTC | #2
(2014/12/11 15:02), Qiu, Michael wrote:
> Why you do not call pci_invoke_all_drivers() directly in former patches?
>
> What you do is first modify then remove....

I have received comments for former patches internally.
And you know, this patch series are long.
For those reviewers, I didn't want to change original patch separation
radically.
Anyway, I will merge a few patches. At the time I will merge these.

Thanks,
Tetsuya

> Thanks,
> Michael
>
> On 12/9/2014 2:34 PM, Tetsuya Mukawa wrote:
>> These functions are actually wrappers of pci_invoke_all_drivers().
>> Just call it directly.
>>
>> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
>> ---
>>  lib/librte_eal/common/eal_common_pci.c | 30 ++++--------------------------
>>  1 file changed, 4 insertions(+), 26 deletions(-)
>>
>> diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
>> index 5ff7b49..5044d8e 100644
>> --- a/lib/librte_eal/common/eal_common_pci.c
>> +++ b/lib/librte_eal/common/eal_common_pci.c
>> @@ -130,29 +130,7 @@ pci_invoke_all_drivers(struct rte_pci_device *dev, int type)
>>  	return 1;
>>  }
>>  
>> -/*
>> - * If vendor/device ID match, call the devinit() function of all
>> - * registered driver for the given device. Return -1 if initialization
>> - * failed, return 1 if no driver is found for this device.
>> - */
>> -static int
>> -pci_probe_all_drivers(struct rte_pci_device *dev)
>> -{
>> -	return pci_invoke_all_drivers(dev, INVOKE_PROBE);
>> -}
>> -
>>  #if defined(RTE_LIBRTE_EAL_HOTPLUG) && defined(RTE_LIBRTE_EAL_LINUXAPP)
>> -/*
>> - * If vendor/device ID match, call the devclose() function of all
>> - * registered driver for the given device. Return -1 if initialization
>> - * failed, return 1 if no driver is found for this device.
>> - */
>> -static int
>> -pci_close_all_drivers(struct rte_pci_device *dev)
>> -{
>> -	return pci_invoke_all_drivers(dev, INVOKE_CLOSE);
>> -}
>> -
>>  static int
>>  rte_eal_pci_invoke_one(struct rte_pci_addr *addr, int type)
>>  {
>> @@ -165,10 +143,10 @@ rte_eal_pci_invoke_one(struct rte_pci_addr *addr, int type)
>>  
>>  		switch (type) {
>>  		case INVOKE_PROBE:
>> -			ret = pci_probe_all_drivers(dev);
>> +			ret = pci_invoke_all_drivers(dev, INVOKE_PROBE);
>>  			break;
>>  		case INVOKE_CLOSE:
>> -			ret = pci_close_all_drivers(dev);
>> +			ret = pci_invoke_all_drivers(dev, INVOKE_CLOSE);
>>  			break;
>>  		}
>>  		if (ret < 0)
>> @@ -237,10 +215,10 @@ rte_eal_pci_probe(void)
>>  
>>  		/* probe all or only whitelisted devices */
>>  		if (probe_all)
>> -			ret = pci_probe_all_drivers(dev);
>> +			ret = pci_invoke_all_drivers(dev, INVOKE_PROBE);
>>  		else if (devargs != NULL &&
>>  			devargs->type == RTE_DEVTYPE_WHITELISTED_PCI)
>> -			ret = pci_probe_all_drivers(dev);
>> +			ret = pci_invoke_all_drivers(dev, INVOKE_PROBE);
>>  		if (ret < 0)
>>  			rte_exit(EXIT_FAILURE, "Requested device " PCI_PRI_FMT
>>  				 " cannot be used\n", dev->addr.domain, dev->addr.bus,
diff mbox

Patch

diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 5ff7b49..5044d8e 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -130,29 +130,7 @@  pci_invoke_all_drivers(struct rte_pci_device *dev, int type)
 	return 1;
 }
 
-/*
- * If vendor/device ID match, call the devinit() function of all
- * registered driver for the given device. Return -1 if initialization
- * failed, return 1 if no driver is found for this device.
- */
-static int
-pci_probe_all_drivers(struct rte_pci_device *dev)
-{
-	return pci_invoke_all_drivers(dev, INVOKE_PROBE);
-}
-
 #if defined(RTE_LIBRTE_EAL_HOTPLUG) && defined(RTE_LIBRTE_EAL_LINUXAPP)
-/*
- * If vendor/device ID match, call the devclose() function of all
- * registered driver for the given device. Return -1 if initialization
- * failed, return 1 if no driver is found for this device.
- */
-static int
-pci_close_all_drivers(struct rte_pci_device *dev)
-{
-	return pci_invoke_all_drivers(dev, INVOKE_CLOSE);
-}
-
 static int
 rte_eal_pci_invoke_one(struct rte_pci_addr *addr, int type)
 {
@@ -165,10 +143,10 @@  rte_eal_pci_invoke_one(struct rte_pci_addr *addr, int type)
 
 		switch (type) {
 		case INVOKE_PROBE:
-			ret = pci_probe_all_drivers(dev);
+			ret = pci_invoke_all_drivers(dev, INVOKE_PROBE);
 			break;
 		case INVOKE_CLOSE:
-			ret = pci_close_all_drivers(dev);
+			ret = pci_invoke_all_drivers(dev, INVOKE_CLOSE);
 			break;
 		}
 		if (ret < 0)
@@ -237,10 +215,10 @@  rte_eal_pci_probe(void)
 
 		/* probe all or only whitelisted devices */
 		if (probe_all)
-			ret = pci_probe_all_drivers(dev);
+			ret = pci_invoke_all_drivers(dev, INVOKE_PROBE);
 		else if (devargs != NULL &&
 			devargs->type == RTE_DEVTYPE_WHITELISTED_PCI)
-			ret = pci_probe_all_drivers(dev);
+			ret = pci_invoke_all_drivers(dev, INVOKE_PROBE);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE, "Requested device " PCI_PRI_FMT
 				 " cannot be used\n", dev->addr.domain, dev->addr.bus,