[dpdk-dev,31/56] net/sfc: implement dummy callback to get device information

Message ID 1479740470-6723-32-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
checkpatch/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Nov. 21, 2016, 3 p.m. UTC
  Just a stub to be filled in when corresponding functionality is
implemented.

Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/efx/sfc_ethdev.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit Nov. 23, 2016, 3:26 p.m. UTC | #1
On 11/21/2016 3:00 PM, Andrew Rybchenko wrote:
> Just a stub to be filled in when corresponding functionality is
> implemented.

What about merging this stub with real implementation?
Or perhaps replace with code that adds dummy .dev_configure?

> 
> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
>  drivers/net/sfc/efx/sfc_ethdev.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/sfc/efx/sfc_ethdev.c b/drivers/net/sfc/efx/sfc_ethdev.c
> index ff20a13..0deff07 100644
> --- a/drivers/net/sfc/efx/sfc_ethdev.c
> +++ b/drivers/net/sfc/efx/sfc_ethdev.c
> @@ -37,9 +37,16 @@
>  #include "sfc_kvargs.h"
>  
>  
> +static void
> +sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
> +{
> +	struct sfc_adapter *sa = dev->data->dev_private;
> +
> +	sfc_log_init(sa, "entry");
> +}
> +
>  static const struct eth_dev_ops sfc_eth_dev_ops = {
> -	/* Just dummy init to avoid build-time warning */
> -	.dev_configure			= NULL,
> +	.dev_infos_get			= sfc_dev_infos_get,
>  };
>  
>  static int
>
  
Andrew Rybchenko Nov. 24, 2016, 3:05 p.m. UTC | #2
On 11/23/2016 06:26 PM, Ferruh Yigit wrote:
> On 11/21/2016 3:00 PM, Andrew Rybchenko wrote:
>> Just a stub to be filled in when corresponding functionality is
>> implemented.
> What about merging this stub with real implementation?
> Or perhaps replace with code that adds dummy .dev_configure?

Thanks, I like the second idea. Will do in v2.

>> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> ---
>>   drivers/net/sfc/efx/sfc_ethdev.c | 11 +++++++++--
>>   1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/sfc/efx/sfc_ethdev.c b/drivers/net/sfc/efx/sfc_ethdev.c
>> index ff20a13..0deff07 100644
>> --- a/drivers/net/sfc/efx/sfc_ethdev.c
>> +++ b/drivers/net/sfc/efx/sfc_ethdev.c
>> @@ -37,9 +37,16 @@
>>   #include "sfc_kvargs.h"
>>   
>>   
>> +static void
>> +sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>> +{
>> +	struct sfc_adapter *sa = dev->data->dev_private;
>> +
>> +	sfc_log_init(sa, "entry");
>> +}
>> +
>>   static const struct eth_dev_ops sfc_eth_dev_ops = {
>> -	/* Just dummy init to avoid build-time warning */
>> -	.dev_configure			= NULL,
>> +	.dev_infos_get			= sfc_dev_infos_get,
>>   };
>>   
>>   static int
>>
  

Patch

diff --git a/drivers/net/sfc/efx/sfc_ethdev.c b/drivers/net/sfc/efx/sfc_ethdev.c
index ff20a13..0deff07 100644
--- a/drivers/net/sfc/efx/sfc_ethdev.c
+++ b/drivers/net/sfc/efx/sfc_ethdev.c
@@ -37,9 +37,16 @@ 
 #include "sfc_kvargs.h"
 
 
+static void
+sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+{
+	struct sfc_adapter *sa = dev->data->dev_private;
+
+	sfc_log_init(sa, "entry");
+}
+
 static const struct eth_dev_ops sfc_eth_dev_ops = {
-	/* Just dummy init to avoid build-time warning */
-	.dev_configure			= NULL,
+	.dev_infos_get			= sfc_dev_infos_get,
 };
 
 static int