mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-21 06:50:25 +00:00
RDMA/mlx5: Compile fs.c regardless of INFINIBAND_USER_ACCESS config
Change mlx5 Makefile, fs.c and fs.h to support fs compilation regardless of INFINIBAND_USER_ACCESS config. In addition allow optional counters support regardless of the config. Signed-off-by: Patrisious Haddad <phaddad@nvidia.com> Link: https://patch.msgid.link/b8dd220456a91538b22c3aff150ab021d7b9e1bf.1741875070.git.leon@kernel.org Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
88ae02feda
commit
36e0d43367
4 changed files with 7 additions and 22 deletions
|
@ -9,6 +9,7 @@ mlx5_ib-y := ah.o \
|
||||||
data_direct.o \
|
data_direct.o \
|
||||||
dm.o \
|
dm.o \
|
||||||
doorbell.o \
|
doorbell.o \
|
||||||
|
fs.o \
|
||||||
gsi.o \
|
gsi.o \
|
||||||
ib_virt.o \
|
ib_virt.o \
|
||||||
mad.o \
|
mad.o \
|
||||||
|
@ -26,7 +27,6 @@ mlx5_ib-y := ah.o \
|
||||||
mlx5_ib-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += odp.o
|
mlx5_ib-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += odp.o
|
||||||
mlx5_ib-$(CONFIG_MLX5_ESWITCH) += ib_rep.o
|
mlx5_ib-$(CONFIG_MLX5_ESWITCH) += ib_rep.o
|
||||||
mlx5_ib-$(CONFIG_INFINIBAND_USER_ACCESS) += devx.o \
|
mlx5_ib-$(CONFIG_INFINIBAND_USER_ACCESS) += devx.o \
|
||||||
fs.o \
|
|
||||||
qos.o \
|
qos.o \
|
||||||
std_types.o
|
std_types.o
|
||||||
mlx5_ib-$(CONFIG_MLX5_MACSEC) += macsec.o
|
mlx5_ib-$(CONFIG_MLX5_MACSEC) += macsec.o
|
||||||
|
|
|
@ -849,7 +849,6 @@ static void mlx5_ib_dealloc_counters(struct mlx5_ib_dev *dev)
|
||||||
dev->port[i].cnts.opfcs, j, &in_use_opfc))
|
dev->port[i].cnts.opfcs, j, &in_use_opfc))
|
||||||
goto skip;
|
goto skip;
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS))
|
|
||||||
mlx5_ib_fs_remove_op_fc(dev,
|
mlx5_ib_fs_remove_op_fc(dev,
|
||||||
&dev->port[i].cnts.opfcs[j], j);
|
&dev->port[i].cnts.opfcs[j], j);
|
||||||
mlx5_fc_destroy(dev->mdev,
|
mlx5_fc_destroy(dev->mdev,
|
||||||
|
@ -1115,8 +1114,7 @@ static const struct ib_device_ops hw_stats_ops = {
|
||||||
.counter_dealloc = mlx5_ib_counter_dealloc,
|
.counter_dealloc = mlx5_ib_counter_dealloc,
|
||||||
.counter_alloc_stats = mlx5_ib_counter_alloc_stats,
|
.counter_alloc_stats = mlx5_ib_counter_alloc_stats,
|
||||||
.counter_update_stats = mlx5_ib_counter_update_stats,
|
.counter_update_stats = mlx5_ib_counter_update_stats,
|
||||||
.modify_hw_stat = IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS) ?
|
.modify_hw_stat = mlx5_ib_modify_stat,
|
||||||
mlx5_ib_modify_stat : NULL,
|
|
||||||
.counter_init = mlx5_ib_counter_init,
|
.counter_init = mlx5_ib_counter_init,
|
||||||
|
|
||||||
INIT_RDMA_OBJ_SIZE(rdma_counter, mlx5_rdma_counter, rdma_counter),
|
INIT_RDMA_OBJ_SIZE(rdma_counter, mlx5_rdma_counter, rdma_counter),
|
||||||
|
|
|
@ -679,7 +679,7 @@ enum flow_table_type {
|
||||||
#define MLX5_FS_MAX_TYPES 6
|
#define MLX5_FS_MAX_TYPES 6
|
||||||
#define MLX5_FS_MAX_ENTRIES BIT(16)
|
#define MLX5_FS_MAX_ENTRIES BIT(16)
|
||||||
|
|
||||||
static bool mlx5_ib_shared_ft_allowed(struct ib_device *device)
|
static bool __maybe_unused mlx5_ib_shared_ft_allowed(struct ib_device *device)
|
||||||
{
|
{
|
||||||
struct mlx5_ib_dev *dev = to_mdev(device);
|
struct mlx5_ib_dev *dev = to_mdev(device);
|
||||||
|
|
||||||
|
@ -3030,6 +3030,7 @@ DECLARE_UVERBS_NAMED_OBJECT(
|
||||||
&UVERBS_METHOD(MLX5_IB_METHOD_STEERING_ANCHOR_DESTROY));
|
&UVERBS_METHOD(MLX5_IB_METHOD_STEERING_ANCHOR_DESTROY));
|
||||||
|
|
||||||
const struct uapi_definition mlx5_ib_flow_defs[] = {
|
const struct uapi_definition mlx5_ib_flow_defs[] = {
|
||||||
|
#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
|
||||||
UAPI_DEF_CHAIN_OBJ_TREE_NAMED(
|
UAPI_DEF_CHAIN_OBJ_TREE_NAMED(
|
||||||
MLX5_IB_OBJECT_FLOW_MATCHER),
|
MLX5_IB_OBJECT_FLOW_MATCHER),
|
||||||
UAPI_DEF_CHAIN_OBJ_TREE(
|
UAPI_DEF_CHAIN_OBJ_TREE(
|
||||||
|
@ -3040,6 +3041,7 @@ const struct uapi_definition mlx5_ib_flow_defs[] = {
|
||||||
UAPI_DEF_CHAIN_OBJ_TREE_NAMED(
|
UAPI_DEF_CHAIN_OBJ_TREE_NAMED(
|
||||||
MLX5_IB_OBJECT_STEERING_ANCHOR,
|
MLX5_IB_OBJECT_STEERING_ANCHOR,
|
||||||
UAPI_DEF_IS_OBJ_SUPPORTED(mlx5_ib_shared_ft_allowed)),
|
UAPI_DEF_IS_OBJ_SUPPORTED(mlx5_ib_shared_ft_allowed)),
|
||||||
|
#endif
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,23 +8,8 @@
|
||||||
|
|
||||||
#include "mlx5_ib.h"
|
#include "mlx5_ib.h"
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
|
|
||||||
int mlx5_ib_fs_init(struct mlx5_ib_dev *dev);
|
int mlx5_ib_fs_init(struct mlx5_ib_dev *dev);
|
||||||
void mlx5_ib_fs_cleanup_anchor(struct mlx5_ib_dev *dev);
|
void mlx5_ib_fs_cleanup_anchor(struct mlx5_ib_dev *dev);
|
||||||
#else
|
|
||||||
static inline int mlx5_ib_fs_init(struct mlx5_ib_dev *dev)
|
|
||||||
{
|
|
||||||
dev->flow_db = kzalloc(sizeof(*dev->flow_db), GFP_KERNEL);
|
|
||||||
|
|
||||||
if (!dev->flow_db)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
mutex_init(&dev->flow_db->lock);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void mlx5_ib_fs_cleanup_anchor(struct mlx5_ib_dev *dev) {}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline void mlx5_ib_fs_cleanup(struct mlx5_ib_dev *dev)
|
static inline void mlx5_ib_fs_cleanup(struct mlx5_ib_dev *dev)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue