net/axgbe: toggle PLL settings during rate change
[dpdk.git] / lib / power / power_cppc_cpufreq.c
index e92973a..25185a7 100644 (file)
@@ -246,6 +246,11 @@ power_get_available_freqs(struct cppc_power_info *pi)
                        pi->nominal_perf * UNIT_DIFF : pi->nominal_perf;
        num_freqs = (nominal_perf - scaling_min_freq) / BUS_FREQ + 1 +
                pi->turbo_available;
+       if (num_freqs >= RTE_MAX_LCORE_FREQS) {
+               RTE_LOG(ERR, POWER, "Too many available frequencies: %d\n",
+                               num_freqs);
+               goto out;
+       }
 
        /* Generate the freq bucket array. */
        for (i = 0, pi->nb_freqs = 0; i < num_freqs; i++) {
@@ -616,7 +621,7 @@ power_cppc_enable_turbo(unsigned int lcore_id)
                return -1;
        }
 
-       /* TODO: must set to max once enbling Turbo? Considering add condition:
+       /* TODO: must set to max once enabling Turbo? Considering add condition:
         * if ((pi->turbo_available) && (pi->curr_idx <= 1))
         */
        /* Max may have changed, so call to max function */