{
struct mlx5_vdpa_priv *priv = opaque;
unsigned long tmp;
+ int n_cores = sysconf(_SC_NPROCESSORS_ONLN);
if (strcmp(key, "class") == 0)
return 0;
priv->event_us = (uint32_t)tmp;
} else if (strcmp(key, "no_traffic_time") == 0) {
priv->no_traffic_time_s = (uint32_t)tmp;
+ } else if (strcmp(key, "event_core") == 0) {
+ if (tmp >= (unsigned long)n_cores)
+ DRV_LOG(WARNING, "Invalid event_core %s.", val);
+ else
+ priv->event_core = tmp;
+ } else if (strcmp(key, "hw_latency_mode") == 0) {
+ priv->hw_latency_mode = (uint32_t)tmp;
+ } else if (strcmp(key, "hw_max_latency_us") == 0) {
+ priv->hw_max_latency_us = (uint32_t)tmp;
+ } else if (strcmp(key, "hw_max_pending_comp") == 0) {
+ priv->hw_max_pending_comp = (uint32_t)tmp;
} else {
DRV_LOG(WARNING, "Invalid key %s.", key);
}
{
struct rte_kvargs *kvlist;
- priv->event_mode = MLX5_VDPA_EVENT_MODE_DYNAMIC_TIMER;
+ priv->event_mode = MLX5_VDPA_EVENT_MODE_FIXED_TIMER;
priv->event_us = 0;
+ priv->event_core = -1;
priv->no_traffic_time_s = MLX5_VDPA_DEFAULT_NO_TRAFFIC_TIME_S;
if (devargs == NULL)
return;
return;
rte_kvargs_process(kvlist, NULL, mlx5_vdpa_args_check_handler, priv);
rte_kvargs_free(kvlist);
- if (!priv->event_us) {
- if (priv->event_mode == MLX5_VDPA_EVENT_MODE_DYNAMIC_TIMER)
- priv->event_us = MLX5_VDPA_DEFAULT_TIMER_STEP_US;
- else if (priv->event_mode == MLX5_VDPA_EVENT_MODE_FIXED_TIMER)
- priv->event_us = MLX5_VDPA_DEFAULT_TIMER_DELAY_US;
- }
+ if (!priv->event_us &&
+ priv->event_mode == MLX5_VDPA_EVENT_MODE_DYNAMIC_TIMER)
+ priv->event_us = MLX5_VDPA_DEFAULT_TIMER_STEP_US;
DRV_LOG(DEBUG, "event mode is %d.", priv->event_mode);
DRV_LOG(DEBUG, "event_us is %u us.", priv->event_us);
DRV_LOG(DEBUG, "no traffic time is %u s.", priv->no_traffic_time_s);