* **Queue Disable**: Disable power scheme for certain queue/port/core.
+* **Get Emptypoll Max**: Get the configured number of empty polls to wait before
+ entering sleep state.
+
+* **Set Emptypoll Max**: Set the number of empty polls to wait before entering
+ sleep state.
+
References
----------
#include "rte_power_pmd_mgmt.h"
-#define EMPTYPOLL_MAX 512
+unsigned int emptypoll_max;
/* store some internal state */
static struct pmd_conf_data {
qcfg->n_empty_polls++;
/* if we haven't reached threshold for empty polls, we can't sleep */
- if (qcfg->n_empty_polls <= EMPTYPOLL_MAX)
+ if (qcfg->n_empty_polls <= emptypoll_max)
return false;
/*
/* this callback can't do more than one queue, omit multiqueue logic */
if (unlikely(nb_rx == 0)) {
queue_conf->n_empty_polls++;
- if (unlikely(queue_conf->n_empty_polls > EMPTYPOLL_MAX)) {
+ if (unlikely(queue_conf->n_empty_polls > emptypoll_max)) {
struct rte_power_monitor_cond pmc;
int ret;
return 0;
}
+void
+rte_power_pmd_mgmt_set_emptypoll_max(unsigned int max)
+{
+ emptypoll_max = max;
+}
+
+unsigned int
+rte_power_pmd_mgmt_get_emptypoll_max(void)
+{
+ return emptypoll_max;
+}
+
RTE_INIT(rte_power_ethdev_pmgmt_init) {
size_t i;
struct pmd_core_cfg *cfg = &lcore_cfgs[i];
TAILQ_INIT(&cfg->head);
}
+
+ /* initialize config defaults */
+ emptypoll_max = 512;
}
rte_power_ethdev_pmgmt_queue_disable(unsigned int lcore_id,
uint16_t port_id, uint16_t queue_id);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
+ *
+ * Set a emptypoll_max to specified value. Used to specify the number of empty
+ * polls to wait before entering sleep state.
+ *
+ * @param max
+ * The value to set emptypoll_max to.
+ */
+__rte_experimental
+void
+rte_power_pmd_mgmt_set_emptypoll_max(unsigned int max);
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
+ *
+ * Get the current value of emptypoll_max.
+ *
+ * @return
+ * The current emptypoll_max value
+ */
+__rte_experimental
+unsigned int
+rte_power_pmd_mgmt_get_emptypoll_max(void);
+
#ifdef __cplusplus
}
#endif
# added in 21.02
rte_power_ethdev_pmgmt_queue_disable;
rte_power_ethdev_pmgmt_queue_enable;
+
+ # added in 22.07
+ rte_power_pmd_mgmt_get_emptypoll_max;
+ rte_power_pmd_mgmt_set_emptypoll_max;
};