[PATCH v12] app/procinfo: display eventdev xstats

Sevincer, Abdullah abdullah.sevincer at intel.com
Mon Mar 20 19:35:17 CET 2023



> -----Original Message-----
> From: Sevincer, Abdullah <abdullah.sevincer at intel.com>

> +static uint8_t evdev_id;
> +static uint8_t num_ports;
> +static uint8_t ports[MAX_PORTS_QUEUES];
>+static uint8_t num_queues;
> +static uint8_t queues[MAX_PORTS_QUEUES]; static uint32_t 
> +enable_shw_all_eventdev_queues; static uint32_t

<snip>

> +enable_shw_all_eventdev_ports; static uint32_t 
> +enable_dump_eventdev_xstats; static uint32_t 
> +enable_eventdev_reset_xstats; static uint32_t 
> +enable_shw_eventdev_device_xstats;

>+How about keeping  a struct to maintain  all the data together that way you know on which all ports and queues of eventdev we have requested display. 
>+You can refer the existing code "struct desc_param" to see how this is done Then you can declare global variables of type struct eventdev_params eventdev_var[MAX_EVENTDEV_DEV] to handle data of all evendev ids as an array, instead of keeping >+many global variables.
.

>+Ex: 
>+struct eventdev_params {
>+           	unit8_t eventdev_id;
>+           	unit8_t ports[MAX_PORTS_QUEUES]
>+          	 unit8_t queues[MAX_PORTS_QUEUES]
>+          	 static uint8_t num_queues
>+          	 static uint8_t num_ports
>+
>+	static uint32_t enable_shw_all_eventdev_queues;
>+	static uint32_t enable_shw_all_eventdev_ports;
>+	static uint32_t enable_dump_eventdev_xstats;
>+	static uint32_t enable_eventdev_reset_xstats;
>+	static uint32_t enable_shw_eventdev_device_xstats;
>+}

Also, all global variables are tied to a command itself like "static uint32_t enable_shw_port_priv" or "static uint32_t enable_shw_ring" . I also want the same for eventdev params to be called a command like the others in the file. If user wants he/she can chain commands. The "struct desc_param" is handling one command only but its 3 parameters (queue_id, offset and num) are put in the structure, for easy parsing. None of the command line arguments, hence global variables are handled/put in a structure. Would you like to change that for proc app going forward?




More information about the dev mailing list