X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fmlx5.c;h=c5ed402710981d8e6f919b16843807ca05e8439b;hb=1def64c2d79e07eb3ec73f5d1ca797e512a3e4d5;hp=62ac54f933240add36c27aa7fe837e08c0999ad8;hpb=09d8b41699bb0d90f736015a977fd3613769b4e0;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 62ac54f933..c5ed402710 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -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 }