X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fmlx5%2Fwindows%2Fmlx5_glue.c;h=535487a8d4e5bcc5b62c2da7381ac34fd3680703;hb=e6a6829f9996b1cf066669ad1721b3d04552c048;hp=7f8a00aaa780a1fa385b28f1d2ba5a8792c2bf2c;hpb=7525ebd8ebb02822b8f7286ba028be0b165d9c40;p=dpdk.git diff --git a/drivers/common/mlx5/windows/mlx5_glue.c b/drivers/common/mlx5/windows/mlx5_glue.c index 7f8a00aaa7..535487a8d4 100644 --- a/drivers/common/mlx5/windows/mlx5_glue.c +++ b/drivers/common/mlx5/windows/mlx5_glue.c @@ -12,7 +12,7 @@ #include #include "mlx5_glue.h" -#include "mlx5_common_utils.h" +#include "../mlx5_common_log.h" #include "mlx5_win_ext.h" /* @@ -256,6 +256,9 @@ mlx5_glue_devx_free_uar(void *uar) devx_free_uar((devx_uar_handle *)uar); } +static_assert(MLX5_ST_SZ_BYTES(fte_match_param) == 0x200, + "PRM size of fte_match_param is broken! cannot compile Windows!"); + static void* mlx5_glue_devx_fs_rule_add(void *ctx, void *in, uint32_t inlen) @@ -280,6 +283,51 @@ mlx5_glue_devx_fs_rule_del(void *flow) return devx_fs_rule_del(flow); } +static int +mlx5_glue_query_rt_values(void *ctx, void *devx_clock) +{ + struct mlx5_context *mlx5_ctx; + struct mlx5_devx_clock *clock; + int err; + + if (!ctx) { + errno = EINVAL; + return errno; + } + mlx5_ctx = (struct mlx5_context *)ctx; + clock = (struct mlx5_devx_clock *)devx_clock; + err = devx_hca_clock_query( + mlx5_ctx->devx_ctx, + &clock->p_iseg_internal_timer, + &clock->clock_frequency_hz, + &clock->is_stable_clock_frequency); + if (err) { + errno = err; + return errno; + } + return 0; +} + +static int +mlx5_glue_devx_init_showdown_event(void *ctx) +{ + struct mlx5_context *mlx5_ctx; + int err; + + if (!ctx) { + errno = EINVAL; + return errno; + } + mlx5_ctx = (struct mlx5_context *)ctx; + err = devx_query_shutdown_event(mlx5_ctx->devx_ctx, + &mlx5_ctx->shutdown_event_obj); + if (err) { + errno = err; + return errno; + } + return 0; +} + alignas(RTE_CACHE_LINE_SIZE) const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){ .version = MLX5_GLUE_VERSION, @@ -301,4 +349,6 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){ .devx_fs_rule_add = mlx5_glue_devx_fs_rule_add, .devx_fs_rule_del = mlx5_glue_devx_fs_rule_del, .devx_query_eqn = mlx5_glue_devx_query_eqn, + .query_rt_values = mlx5_glue_query_rt_values, + .devx_init_showdown_event = mlx5_glue_devx_init_showdown_event, };