net/dpaa2: add dpdmux initialization and configuration
[dpdk.git] / drivers / net / mlx5 / mlx5.c
index 62ac54f..c5ed402 100644 (file)
@@ -346,11 +346,6 @@ mlx5_dev_close(struct rte_eth_dev *dev)
        }
        memset(priv, 0, sizeof(*priv));
        priv->domain_id = RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID;
-       /*
-        * flag to rte_eth_dev_close() that it should release the port resources
-        * (calling rte_eth_dev_release_port()) in addition to closing it.
-        */
-       dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        /*
         * Reset mac_addrs to NULL such that it is not freed as part of
         * rte_eth_dev_release_port(). mac_addrs is part of dev_private so
@@ -399,6 +394,7 @@ const struct eth_dev_ops mlx5_dev_ops = {
        .filter_ctrl = mlx5_dev_filter_ctrl,
        .rx_descriptor_status = mlx5_rx_descriptor_status,
        .tx_descriptor_status = mlx5_tx_descriptor_status,
+       .rx_queue_count = mlx5_rx_queue_count,
        .rx_queue_intr_enable = mlx5_rx_intr_enable,
        .rx_queue_intr_disable = mlx5_rx_intr_disable,
        .is_removed = mlx5_is_removed,
@@ -731,7 +727,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
               struct mlx5_dev_config config,
               const struct mlx5_switch_info *switch_info)
 {
-       struct ibv_context *ctx;
+       struct ibv_context *ctx = NULL;
        struct ibv_device_attr_ex attr;
        struct ibv_port_attr port_attr;
        struct ibv_pd *pd = NULL;
@@ -790,10 +786,16 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
        /* Prepare shared data between primary and secondary process. */
        mlx5_prepare_shared_data();
        errno = 0;
-       ctx = mlx5_glue->open_device(ibv_dev);
-       if (!ctx) {
-               rte_errno = errno ? errno : ENODEV;
-               return NULL;
+       ctx = mlx5_glue->dv_open_device(ibv_dev);
+       if (ctx) {
+               config.devx = 1;
+               DRV_LOG(DEBUG, "DEVX is supported");
+       } else {
+               ctx = mlx5_glue->open_device(ibv_dev);
+               if (!ctx) {
+                       rte_errno = errno ? errno : ENODEV;
+                       return NULL;
+               }
        }
 #ifdef HAVE_IBV_MLX5_MOD_SWP
        dv_attr.comp_mask |= MLX5DV_CONTEXT_MASK_SWP;
@@ -1113,6 +1115,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                err = ENOMEM;
                goto error;
        }
+       /* Flag to call rte_eth_dev_release_port() in rte_eth_dev_close(). */
+       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        if (priv->representor) {
                eth_dev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
                eth_dev->data->representor_id = priv->representor_id;
@@ -1587,6 +1591,14 @@ static const struct rte_pci_id mlx5_pci_id_map[] = {
                RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
                               PCI_DEVICE_ID_MELLANOX_CONNECTX5BFVF)
        },
+       {
+               RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
+                               PCI_DEVICE_ID_MELLANOX_CONNECTX6)
+       },
+       {
+               RTE_PCI_DEVICE(PCI_VENDOR_ID_MELLANOX,
+                               PCI_DEVICE_ID_MELLANOX_CONNECTX6VF)
+       },
        {
                .vendor_id = 0
        }