net/mlx5: remove TCF support
[dpdk.git] / drivers / net / mlx5 / mlx5.c
index aee9f97..d93f92d 100644 (file)
 /* Select port representors to instantiate. */
 #define MLX5_REPRESENTOR "representor"
 
+/* Device parameter to configure the maximum number of dump files per queue. */
+#define MLX5_MAX_DUMP_FILES_NUM "max_dump_files_num"
+
 #ifndef HAVE_IBV_MLX5_MOD_MPW
 #define MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED (1 << 2)
 #define MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW (1 << 3)
@@ -313,7 +316,7 @@ mlx5_free_shared_ibctx(struct mlx5_ibv_shared *sh)
         **/
        assert(!sh->intr_cnt);
        if (sh->intr_cnt)
-               rte_intr_callback_unregister
+               mlx5_intr_callback_unregister
                        (&sh->intr_handle, mlx5_dev_interrupt_handler, sh);
        pthread_mutex_destroy(&sh->intr_mutex);
        if (sh->pd)
@@ -687,8 +690,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
                close(priv->nl_socket_route);
        if (priv->nl_socket_rdma >= 0)
                close(priv->nl_socket_rdma);
-       if (priv->tcf_context)
-               mlx5_flow_tcf_context_destroy(priv->tcf_context);
        if (priv->sh) {
                /*
                 * Free the shared context in last turn, because the cleanup
@@ -927,6 +928,8 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
                config->dv_flow_en = !!tmp;
        } else if (strcmp(MLX5_MR_EXT_MEMSEG_EN, key) == 0) {
                config->mr_ext_memseg_en = !!tmp;
+       } else if (strcmp(MLX5_MAX_DUMP_FILES_NUM, key) == 0) {
+               config->max_dump_files_num = tmp;
        } else {
                DRV_LOG(WARNING, "%s: unknown parameter", key);
                rte_errno = EINVAL;
@@ -971,6 +974,7 @@ mlx5_args(struct mlx5_dev_config *config, struct rte_devargs *devargs)
                MLX5_DV_FLOW_EN,
                MLX5_MR_EXT_MEMSEG_EN,
                MLX5_REPRESENTOR,
+               MLX5_MAX_DUMP_FILES_NUM,
                NULL,
        };
        struct rte_kvargs *kvlist;
@@ -981,8 +985,10 @@ mlx5_args(struct mlx5_dev_config *config, struct rte_devargs *devargs)
                return 0;
        /* Following UGLY cast is done to pass checkpatch. */
        kvlist = rte_kvargs_parse(devargs->args, params);
-       if (kvlist == NULL)
-               return 0;
+       if (kvlist == NULL) {
+               rte_errno = EINVAL;
+               return -rte_errno;
+       }
        /* Process parameters. */
        for (i = 0; (params[i] != NULL); ++i) {
                if (rte_kvargs_count(kvlist, params[i])) {
@@ -1440,6 +1446,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                DRV_LOG(WARNING, "Multi-Packet RQ isn't supported");
                config.mprq.enabled = 0;
        }
+       if (config.max_dump_files_num == 0)
+               config.max_dump_files_num = 128;
        eth_dev = rte_eth_dev_allocate(name);
        if (eth_dev == NULL) {
                DRV_LOG(ERR, "can not allocate rte ethdev");
@@ -1499,34 +1507,6 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
        claim_zero(mlx5_mac_addr_add(eth_dev, &mac, 0, 0));
        if (config.vf && config.vf_nl_en)
                mlx5_nl_mac_addr_sync(eth_dev);
-       priv->tcf_context = mlx5_flow_tcf_context_create();
-       if (!priv->tcf_context) {
-               err = -rte_errno;
-               DRV_LOG(WARNING,
-                       "flow rules relying on switch offloads will not be"
-                       " supported: cannot open libmnl socket: %s",
-                       strerror(rte_errno));
-       } else {
-               struct rte_flow_error error;
-               unsigned int ifindex = mlx5_ifindex(eth_dev);
-
-               if (!ifindex) {
-                       err = -rte_errno;
-                       error.message =
-                               "cannot retrieve network interface index";
-               } else {
-                       err = mlx5_flow_tcf_init(priv->tcf_context,
-                                                ifindex, &error);
-               }
-               if (err) {
-                       DRV_LOG(WARNING,
-                               "flow rules relying on switch offloads will"
-                               " not be supported: %s: %s",
-                               error.message, strerror(rte_errno));
-                       mlx5_flow_tcf_context_destroy(priv->tcf_context);
-                       priv->tcf_context = NULL;
-               }
-       }
        TAILQ_INIT(&priv->flows);
        TAILQ_INIT(&priv->ctrl_flows);
        /* Hint libmlx5 to use PMD allocator for data plane resources */
@@ -1592,8 +1572,6 @@ error:
                        close(priv->nl_socket_route);
                if (priv->nl_socket_rdma >= 0)
                        close(priv->nl_socket_rdma);
-               if (priv->tcf_context)
-                       mlx5_flow_tcf_context_destroy(priv->tcf_context);
                if (own_domain_id)
                        claim_zero(rte_eth_switch_domain_free(priv->domain_id));
                rte_free(priv);