X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fmlx5%2Flinux%2Fmlx5_common_os.c;h=15892121726848f666a74693df92b7ad9a97ac7e;hb=ca1418ce39108e7c2a778a14448457ad1264b183;hp=2aa5684b05f8c6ae935b2941ef67592997cbda39;hpb=887183effa2aeef70508b37fe304a3f7c526d334;p=dpdk.git diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c index 2aa5684b05..1589212172 100644 --- a/drivers/common/mlx5/linux/mlx5_common_os.c +++ b/drivers/common/mlx5/linux/mlx5_common_os.c @@ -424,8 +424,13 @@ mlx5_os_get_ibv_device(const struct rte_pci_addr *addr) ibv_match = ibv_list[n]; break; } - if (ibv_match == NULL) + if (ibv_match == NULL) { + DRV_LOG(WARNING, + "No Verbs device matches PCI device " PCI_PRI_FMT "," + " are kernel drivers loaded?", + addr->domain, addr->bus, addr->devid, addr->function); rte_errno = ENOENT; + } mlx5_glue->free_device_list(ibv_list); return ibv_match; } @@ -465,14 +470,14 @@ mlx5_restore_doorbell_mapping_env(int value) * * @param cdev * Pointer to the mlx5 device. - * @param ctx_ptr - * Pointer to fill inside pointer to device context. + * @param classes + * Chosen classes come from device arguments. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -mlx5_os_open_device(struct mlx5_common_device *cdev, void **ctx_ptr) +mlx5_os_open_device(struct mlx5_common_device *cdev, uint32_t classes) { struct ibv_device *ibv; struct ibv_context *ctx = NULL; @@ -494,18 +499,20 @@ mlx5_os_open_device(struct mlx5_common_device *cdev, void **ctx_ptr) if (ctx) { cdev->config.devx = 1; DRV_LOG(DEBUG, "DevX is supported."); - } else { + } else if (classes == MLX5_CLASS_ETH) { /* The environment variable is still configured. */ ctx = mlx5_glue->open_device(ibv); if (ctx == NULL) goto error; DRV_LOG(DEBUG, "DevX is NOT supported."); + } else { + goto error; } /* The device is created, no need for environment. */ mlx5_restore_doorbell_mapping_env(dbmap_env); /* Hint libmlx5 to use PMD allocator for data plane resources */ mlx5_set_context_attr(cdev->dev, ctx); - *ctx_ptr = (void *)ctx; + cdev->ctx = ctx; return 0; error: rte_errno = errno ? errno : ENODEV;