return mlx5_glue->devx_umem_dereg(pumem);
}
+static inline void *
+mlx5_os_devx_create_event_channel(void *ctx, int flags)
+{
+ return mlx5_glue->devx_create_event_channel(ctx, flags);
+}
+
+static inline void
+mlx5_os_devx_destroy_event_channel(void *eventc)
+{
+ mlx5_glue->devx_destroy_event_channel(eventc);
+}
+
+static inline int
+mlx5_os_devx_subscribe_devx_event(void *eventc,
+ void *obj,
+ uint16_t events_sz, uint16_t events_num[],
+ uint64_t cookie)
+{
+ return mlx5_glue->devx_subscribe_devx_event(eventc, obj, events_sz,
+ events_num, cookie);
+}
+
/**
* Memory allocation optionally with alignment.
*
claim_zero(mlx5_devx_cmd_destroy(rxq_obj->rq));
claim_zero(mlx5_devx_cmd_destroy(rxq_obj->devx_cq));
if (rxq_obj->devx_channel)
- mlx5_glue->devx_destroy_event_channel
+ mlx5_os_devx_destroy_event_channel
(rxq_obj->devx_channel);
mlx5_rxq_release_devx_rq_resources(rxq_obj->rxq_ctrl);
mlx5_rxq_release_devx_cq_resources(rxq_obj->rxq_ctrl);
rxq_data->cqe_n = log_cqe_n;
rxq_data->cqn = cq_obj->id;
if (rxq_ctrl->obj->devx_channel) {
- ret = mlx5_glue->devx_subscribe_devx_event
+ ret = mlx5_os_devx_subscribe_devx_event
(rxq_ctrl->obj->devx_channel,
cq_obj->obj,
sizeof(event_nums),
int devx_ev_flag =
MLX5DV_DEVX_CREATE_EVENT_CHANNEL_FLAGS_OMIT_EV_DATA;
- tmpl->devx_channel = mlx5_glue->devx_create_event_channel
+ tmpl->devx_channel = mlx5_os_devx_create_event_channel
(priv->sh->ctx,
devx_ev_flag);
if (!tmpl->devx_channel) {
if (tmpl->devx_cq)
claim_zero(mlx5_devx_cmd_destroy(tmpl->devx_cq));
if (tmpl->devx_channel)
- mlx5_glue->devx_destroy_event_channel(tmpl->devx_channel);
+ mlx5_os_devx_destroy_event_channel(tmpl->devx_channel);
mlx5_rxq_release_devx_rq_resources(rxq_ctrl);
mlx5_rxq_release_devx_cq_resources(rxq_ctrl);
rte_errno = ret; /* Restore rte_errno. */
mlx5_txpp_destroy_event_channel(struct mlx5_dev_ctx_shared *sh)
{
if (sh->txpp.echan) {
- mlx5_glue->devx_destroy_event_channel(sh->txpp.echan);
+ mlx5_os_devx_destroy_event_channel(sh->txpp.echan);
sh->txpp.echan = NULL;
}
}
mlx5_txpp_create_event_channel(struct mlx5_dev_ctx_shared *sh)
{
MLX5_ASSERT(!sh->txpp.echan);
- sh->txpp.echan = mlx5_glue->devx_create_event_channel(sh->ctx,
+ sh->txpp.echan = mlx5_os_devx_create_event_channel(sh->ctx,
MLX5DV_DEVX_CREATE_EVENT_CHANNEL_FLAGS_OMIT_EV_DATA);
if (!sh->txpp.echan) {
rte_errno = errno;
return -rte_errno;
}
/* Subscribe CQ event to the event channel controlled by the driver. */
- ret = mlx5_glue->devx_subscribe_devx_event(sh->txpp.echan,
+ ret = mlx5_os_devx_subscribe_devx_event(sh->txpp.echan,
sh->txpp.rearm_queue.cq->obj,
sizeof(event_nums),
event_nums, 0);
#include <rte_alarm.h>
#include <mlx5_common.h>
+#include <mlx5_common_os.h>
#include <mlx5_glue.h>
#include "mlx5_vdpa_utils.h"
sizeof(out.buf)) >=
(ssize_t)sizeof(out.event_resp.cookie))
;
- mlx5_glue->devx_destroy_event_channel(priv->eventc);
+ mlx5_os_devx_destroy_event_channel(priv->eventc);
priv->eventc = NULL;
}
#endif
DRV_LOG(ERR, "Failed to query EQ number %d.", rte_errno);
return -1;
}
- priv->eventc = mlx5_glue->devx_create_event_channel(priv->ctx,
+ priv->eventc = mlx5_os_devx_create_event_channel(priv->ctx,
MLX5DV_DEVX_CREATE_EVENT_CHANNEL_FLAGS_OMIT_EV_DATA);
if (!priv->eventc) {
rte_errno = errno;
cq->cq_ci = 0;
rte_spinlock_init(&cq->sl);
/* Subscribe CQ event to the event channel controlled by the driver. */
- ret = mlx5_glue->devx_subscribe_devx_event(priv->eventc, cq->cq->obj,
+ ret = mlx5_os_devx_subscribe_devx_event(priv->eventc, cq->cq->obj,
sizeof(event_nums),
event_nums,
(uint64_t)(uintptr_t)cq);