#include <rte_regexdev_driver.h>
#include <mlx5_common_pci.h>
+#include <mlx5_common.h>
#include <mlx5_glue.h>
#include <mlx5_devx_cmds.h>
#include <mlx5_prm.h>
return 0;
}
-static struct ibv_device *
-mlx5_regex_get_ib_device_match(struct rte_pci_addr *addr)
-{
- int n;
- struct ibv_device **ibv_list = mlx5_glue->get_device_list(&n);
- struct ibv_device *ibv_match = NULL;
-
- if (!ibv_list) {
- rte_errno = ENOSYS;
- return NULL;
- }
- while (n-- > 0) {
- struct rte_pci_addr pci_addr;
-
- DRV_LOG(DEBUG, "Checking device \"%s\"..", ibv_list[n]->name);
- if (mlx5_dev_to_pci_addr(ibv_list[n]->ibdev_path, &pci_addr))
- continue;
- if (rte_pci_addr_cmp(addr, &pci_addr))
- continue;
- ibv_match = ibv_list[n];
- break;
- }
- if (!ibv_match)
- rte_errno = ENOENT;
- mlx5_glue->free_device_list(ibv_list);
- return ibv_match;
-}
static int
mlx5_regex_engines_status(struct ibv_context *ctx, int num_engines)
{
int ret;
uint32_t val;
- ibv = mlx5_regex_get_ib_device_match(&pci_dev->addr);
+ ibv = mlx5_os_get_ibv_device(&pci_dev->addr);
if (!ibv) {
DRV_LOG(ERR, "No matching IB device for PCI slot "
PCI_PRI_FMT ".", pci_dev->addr.domain,
}
priv->regexdev->dev_ops = &mlx5_regexdev_ops;
priv->regexdev->enqueue = mlx5_regexdev_enqueue;
+#ifdef HAVE_MLX5_UMR_IMKEY
+ if (!attr.umr_indirect_mkey_disabled &&
+ !attr.umr_modify_entity_size_disabled)
+ priv->has_umr = 1;
+ if (priv->has_umr)
+ priv->regexdev->enqueue = mlx5_regexdev_enqueue_gga;
+#endif
priv->regexdev->dequeue = mlx5_regexdev_dequeue;
priv->regexdev->device = (struct rte_device *)pci_dev;
priv->regexdev->data->dev_private = priv;
rte_errno = ENOMEM;
goto error;
}
+ DRV_LOG(INFO, "RegEx GGA is %s.",
+ priv->has_umr ? "supported" : "unsupported");
return 0;
error: