[dpdk-dev] [PATCH 6/7] Move EAL common functions

Thomas Monjalon thomas.monjalon at 6wind.com
Mon Jan 5 16:49:33 CET 2015


2014-12-25 10:33, Ravi Kerur:
> +#ifdef RTE_EXEC_ENV_BSDAPP
> +	if (set_tsc_freq_from_sysctl() < 0)
> +#else /* RTE_EXEC_ENV_BSDAPP */
> +	if (set_tsc_freq_from_clock() < 0)
> +#endif /* RTE_EXEC_ENV_BSDAPP */

In case there is only 1 line in ifdef, it's clearer to not
comment #else and #endif.

> --- a/lib/librte_eal/common/eal_externs.h
> +++ b/lib/librte_eal/common/eal_externs.h
> @@ -39,4 +39,7 @@ extern struct rte_config rte_config;
>  extern int mem_cfg_fd;
>  extern rte_usage_hook_t	rte_application_usage_hook;
>  
> +/* Extern declarations defined in eal_common_timer.c */
> +extern uint64_t eal_tsc_resolution_hz;
> +

Why is this extern needed?
It would be nicer to have functions returning resolution after probing.
Then it's stored in linuxapp or bsdapp and retrieved with the existing
function rte_get_tsc_hz().

Thanks
-- 
Thomas


More information about the dev mailing list