net/af_xdp: allow bigger batch sizes
[dpdk.git] / drivers / vdpa / mlx5 / mlx5_vdpa.c
index 5020a99..4c2d886 100644 (file)
@@ -295,6 +295,8 @@ mlx5_vdpa_dev_close(int vid)
        }
        priv->configured = 0;
        priv->vid = 0;
+       /* The mutex may stay locked after event thread cancel - initiate it. */
+       pthread_mutex_init(&priv->vq_config_lock, NULL);
        DRV_LOG(INFO, "vDPA device %d was closed.", vid);
        return ret;
 }
@@ -612,6 +614,7 @@ mlx5_vdpa_args_check_handler(const char *key, const char *val, void *opaque)
 {
        struct mlx5_vdpa_priv *priv = opaque;
        unsigned long tmp;
+       int n_cores = sysconf(_SC_NPROCESSORS_ONLN);
 
        if (strcmp(key, "class") == 0)
                return 0;
@@ -630,6 +633,17 @@ mlx5_vdpa_args_check_handler(const char *key, const char *val, void *opaque)
                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);
        }
@@ -641,8 +655,9 @@ mlx5_vdpa_config_get(struct rte_devargs *devargs, struct mlx5_vdpa_priv *priv)
 {
        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;