mirror of
https://github.com/torvalds/linux.git
synced 2025-11-07 03:59:22 +02:00
Implement the device API for ufile_hw_cleanup operation, which iterates over the ufile uobjects lists, and attempts to destroy DevX QPs, by issuing up to 8 commands in parallel. This function is responsible only for cleaning the FW resources of the QP, and doesn't necessarily cleanup all of its resources. Hence the normal serialized cleanup flow is still executed after it in __uverbs_cleanup_ufile() to cleanup the remaining resources and handle the cleanup of SW objects. In order to avoid double cleanup for the FW resources, new DevX flag was added DEVX_OBJ_FLAGS_HW_FREED, which marks the object's FW resources as already freed. Since QP destruction is the most time-consuming operation in FW, parallelizing it reduces the cleanup time of applications that use DevX QPs. Signed-off-by: Patrisious Haddad <phaddad@nvidia.com> Link: https://patch.msgid.link/2f82675d0412542cba1c47a6b86f589521ae41e1.1730373303.git.leon@kernel.org Signed-off-by: Leon Romanovsky <leon@kernel.org>
49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
|
|
/*
|
|
* Copyright (c) 2019-2020, Mellanox Technologies inc. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _MLX5_IB_DEVX_H
|
|
#define _MLX5_IB_DEVX_H
|
|
|
|
#include "mlx5_ib.h"
|
|
|
|
#define MLX5_MAX_DESTROY_INBOX_SIZE_DW MLX5_ST_SZ_DW(delete_fte_in)
|
|
struct devx_obj {
|
|
struct mlx5_ib_dev *ib_dev;
|
|
u64 obj_id;
|
|
u32 dinlen; /* destroy inbox length */
|
|
u32 dinbox[MLX5_MAX_DESTROY_INBOX_SIZE_DW];
|
|
u32 flags;
|
|
union {
|
|
struct mlx5_ib_mkey mkey;
|
|
struct mlx5_core_dct core_dct;
|
|
struct mlx5_core_cq core_cq;
|
|
u32 flow_counter_bulk_size;
|
|
};
|
|
struct list_head event_sub; /* holds devx_event_subscription entries */
|
|
};
|
|
#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
|
|
int mlx5_ib_devx_create(struct mlx5_ib_dev *dev, bool is_user);
|
|
void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev, u16 uid);
|
|
int mlx5_ib_devx_init(struct mlx5_ib_dev *dev);
|
|
void mlx5_ib_devx_cleanup(struct mlx5_ib_dev *dev);
|
|
void mlx5_ib_ufile_hw_cleanup(struct ib_uverbs_file *ufile);
|
|
#else
|
|
static inline int mlx5_ib_devx_create(struct mlx5_ib_dev *dev, bool is_user)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
static inline void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev, u16 uid) {}
|
|
static inline int mlx5_ib_devx_init(struct mlx5_ib_dev *dev)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void mlx5_ib_devx_cleanup(struct mlx5_ib_dev *dev)
|
|
{
|
|
}
|
|
static inline void mlx5_ib_ufile_hw_cleanup(struct ib_uverbs_file *ufile)
|
|
{
|
|
}
|
|
#endif
|
|
#endif /* _MLX5_IB_DEVX_H */
|