[PATCH] eal: fail initialization if TSC frequency is zero

Stephen Hemminger stephen at networkplumber.org
Sun Sep 27 22:09:44 CEST 2026


On Sun, 27 Sep 2026 12:54:40 -0700
Stephen Hemminger <stephen at networkplumber.org> wrote:

> +	/*
> +	 * Several get_tsc_freq_arch() implementations return zero when the
> +	 * frequency cannot be read, and a TSC that does not advance at least
> +	 * once per second measures as zero.  Such a counter cannot be scaled
> +	 * to a time at all, so fail rather than let callers of
> +	 * rte_get_tsc_hz() divide by zero.
> +	 */
> +	if (freq == 0) {
> +		EAL_LOG(ERR, "TSC frequency could not be determined");
> +		return -1;
> +	}
> +

Sorry for the AI generated comment here. Will fix in next version.


More information about the dev mailing list