[dpdk-dev] [PATCH v5 06/21] eal/soc: introduce very essential SoC infra definitions

Shreyansh Jain shreyansh.jain at nxp.com
Tue Oct 25 07:36:36 CEST 2016


Hello Jan,

On Monday 24 October 2016 09:51 PM, Jan Viktorin wrote:
> On Mon, 24 Oct 2016 17:29:25 +0530
> Shreyansh Jain <shreyansh.jain at nxp.com> wrote:
>
>> From: Jan Viktorin <viktorin at rehivetech.com>
>>
>> Define initial structures and functions for the SoC infrastructure.
>> This patch supports only a very minimal functions for now.
>> More features will be added in the following commits.
>>
>> Includes rte_device/rte_driver inheritance of
>> rte_soc_device/rte_soc_driver.
>>
>> Signed-off-by: Jan Viktorin <viktorin at rehivetech.com>
>> Signed-off-by: Shreyansh Jain <shreyansh.jain at nxp.com>
>> Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
>> ---
>>  app/test/Makefile                       |   1 +
>>  app/test/test_soc.c                     |  90 +++++++++++++++++++++
>>  lib/librte_eal/common/Makefile          |   2 +-
>>  lib/librte_eal/common/eal_private.h     |   4 +
>>  lib/librte_eal/common/include/rte_soc.h | 138 ++++++++++++++++++++++++++++++++
>>  5 files changed, 234 insertions(+), 1 deletion(-)
>>  create mode 100644 app/test/test_soc.c
>>  create mode 100644 lib/librte_eal/common/include/rte_soc.h
>>
>> diff --git a/app/test/Makefile b/app/test/Makefile
>
> [...]
>
>> +++ b/lib/librte_eal/common/include/rte_soc.h
>> @@ -0,0 +1,138 @@
>
> [...]
>
>> +
>> +#include <stdio.h>
>> +#include <stdlib.h>
>> +#include <stdint.h>
>> +#include <inttypes.h>
>> +#include <string.h>
>> +
>> +#include <rte_dev.h>
>> +#include <rte_debug.h>
>> +
>> +struct rte_soc_id {
>> +	const char *compatible; /**< OF compatible specification */
>> +	uint64_t priv_data;     /**< SoC Driver specific data */
>
> Do you expect this to be a pointer?

A 64 bit entry, which can be typecasted to pointer by implementations, 
if required. Or, it might as well remain as a 64bit entry as ID.

>
>> +};
>> +
>
> [...]
>
>> +
>> +/**
>> + * Initialization function for the driver called during SoC probing.
>> + */
>> +typedef int (soc_devinit_t)(struct rte_soc_driver *, struct rte_soc_device *);
>> +
>> +/**
>> + * Uninitialization function for the driver called during hotplugging.
>> + */
>> +typedef int (soc_devuninit_t)(struct rte_soc_device *);
>> +
>> +/**
>> + * A structure describing a SoC driver.
>> + */
>> +struct rte_soc_driver {
>> +	TAILQ_ENTRY(rte_soc_driver) next;  /**< Next in list */
>> +	struct rte_driver driver;          /**< Inherit core driver. */
>> +	soc_devinit_t *devinit;            /**< Device initialization */
>> +	soc_devuninit_t *devuninit;        /**< Device uninitialization */
>
> Shouldn't those functions be named probe/remove?

Indeed. I think there was a comment on v4 as well - I thought I had 
fixed it but it seems I have mixed up my patches. I will send v6 
immediately with this fixed. Thanks for pointing out.

>
>> +	const struct rte_soc_id *id_table; /**< ID table, NULL terminated */
>> +};
>> +
>
> [...]
>
>> +#endif
>
>
>

-
Shreyansh


More information about the dev mailing list