net/mlx5: add ConnectX6-DX device ID
[dpdk.git] / drivers / net / mlx5 / mlx5.c
index 01a2ef7..102c6ab 100644 (file)
@@ -531,6 +531,12 @@ assert(spawn);
                        goto error;
                }
        }
+       sh->flow_id_pool = mlx5_flow_id_pool_alloc();
+       if (!sh->flow_id_pool) {
+               DRV_LOG(ERR, "can't create flow id pool");
+               err = ENOMEM;
+               goto error;
+       }
 #endif /* HAVE_IBV_FLOW_DV_SUPPORT */
        /*
         * Once the device is added to the list of memory event
@@ -570,6 +576,8 @@ error:
                claim_zero(mlx5_glue->dealloc_pd(sh->pd));
        if (sh->ctx)
                claim_zero(mlx5_glue->close_device(sh->ctx));
+       if (sh->flow_id_pool)
+               mlx5_flow_id_pool_release(sh->flow_id_pool);
        rte_free(sh);
        assert(err > 0);
        rte_errno = err;
@@ -641,6 +649,8 @@ mlx5_free_shared_ibctx(struct mlx5_ibv_shared *sh)
                claim_zero(mlx5_devx_cmd_destroy(sh->td));
        if (sh->ctx)
                claim_zero(mlx5_glue->close_device(sh->ctx));
+       if (sh->flow_id_pool)
+               mlx5_flow_id_pool_release(sh->flow_id_pool);
        rte_free(sh);
 exit:
        pthread_mutex_unlock(&mlx5_ibv_list_mutex);
@@ -809,7 +819,7 @@ mlx5_init_shared_data(void)
                                                 SOCKET_ID_ANY, 0);
                        if (mz == NULL) {
                                DRV_LOG(ERR,
-                                       "Cannot allocate mlx5 shared data\n");
+                                       "Cannot allocate mlx5 shared data");
                                ret = -rte_errno;
                                goto error;
                        }
@@ -821,7 +831,7 @@ mlx5_init_shared_data(void)
                        mz = rte_memzone_lookup(MZ_MLX5_PMD_SHARED_DATA);
                        if (mz == NULL) {
                                DRV_LOG(ERR,
-                                       "Cannot attach mlx5 shared data\n");
+                                       "Cannot attach mlx5 shared data");
                                ret = -rte_errno;
                                goto error;
                        }
@@ -2009,7 +2019,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                              MLX5DV_DEVX_PORT_MATCH_REG_C_0;
        err = mlx5_glue->devx_port_query(sh->ctx, spawn->ibv_port, &devx_port);
        if (err) {
-               DRV_LOG(WARNING, "can't query devx port %d on device %s\n",
+               DRV_LOG(WARNING, "can't query devx port %d on device %s",
                        spawn->ibv_port, spawn->ibv_dev->name);
                devx_port.comp_mask = 0;
        }
@@ -2018,14 +2028,14 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                priv->vport_meta_mask = devx_port.reg_c_0.mask;
                if (!priv->vport_meta_mask) {
                        DRV_LOG(ERR, "vport zero mask for port %d"
-                                    " on bonding device %s\n",
+                                    " on bonding device %s",
                                     spawn->ibv_port, spawn->ibv_dev->name);
                        err = ENOTSUP;
                        goto error;
                }
                if (priv->vport_meta_tag & ~priv->vport_meta_mask) {
                        DRV_LOG(ERR, "invalid vport tag for port %d"
-                                    " on bonding device %s\n",
+                                    " on bonding device %s",
                                     spawn->ibv_port, spawn->ibv_dev->name);
                        err = ENOTSUP;
                        goto error;
@@ -2034,7 +2044,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                priv->vport_id = devx_port.vport_num;
        } else if (spawn->pf_bond >= 0) {
                DRV_LOG(ERR, "can't deduce vport index for port %d"
-                            " on bonding device %s\n",
+                            " on bonding device %s",
                             spawn->ibv_port, spawn->ibv_dev->name);
                err = ENOTSUP;
                goto error;
@@ -2181,7 +2191,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                priv->counter_fallback = 1;
 #endif
                if (priv->counter_fallback)
-                       DRV_LOG(INFO, "Use fall-back DV counter management\n");
+                       DRV_LOG(INFO, "Use fall-back DV counter management");
                /* Check for LRO support. */
                if (config.dest_tir && config.hca_attr.lro_cap &&
                    config.dv_flow_en) {
@@ -2881,6 +2891,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
        case PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF:
        case PCI_DEVICE_ID_MELLANOX_CONNECTX5BFVF:
        case PCI_DEVICE_ID_MELLANOX_CONNECTX6VF:
+       case PCI_DEVICE_ID_MELLANOX_CONNECTX6DXVF:
                dev_config.vf = 1;
                break;
        default:
@@ -3050,6 +3061,14 @@ static const struct rte_pci_id mlx5_pci_id_map[] = {
                RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
                                PCI_DEVICE_ID_MELLANOX_CONNECTX6VF)
        },
+       {
+               RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
+                               PCI_DEVICE_ID_MELLANOX_CONNECTX6DX)
+       },
+       {
+               RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
+                               PCI_DEVICE_ID_MELLANOX_CONNECTX6DXVF)
+       },
        {
                .vendor_id = 0
        }