xref: /kernel/linux/linux-5.10/drivers/infiniband/hw/mlx5/fs.h (revision 8c2ecf20)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/drivers/infiniband/hw/mlx5/
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2013-2020, Mellanox Technologies inc. All rights reserved.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef _MLX5_IB_FS_H
78c2ecf20Sopenharmony_ci#define _MLX5_IB_FS_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include "mlx5_ib.h"
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
128c2ecf20Sopenharmony_ciint mlx5_ib_fs_init(struct mlx5_ib_dev *dev);
138c2ecf20Sopenharmony_ci#else
148c2ecf20Sopenharmony_cistatic inline int mlx5_ib_fs_init(struct mlx5_ib_dev *dev)
158c2ecf20Sopenharmony_ci{
168c2ecf20Sopenharmony_ci	dev->flow_db = kzalloc(sizeof(*dev->flow_db), GFP_KERNEL);
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci	if (!dev->flow_db)
198c2ecf20Sopenharmony_ci		return -ENOMEM;
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci	mutex_init(&dev->flow_db->lock);
228c2ecf20Sopenharmony_ci	return 0;
238c2ecf20Sopenharmony_ci}
248c2ecf20Sopenharmony_ci#endif
258c2ecf20Sopenharmony_cistatic inline void mlx5_ib_fs_cleanup(struct mlx5_ib_dev *dev)
268c2ecf20Sopenharmony_ci{
278c2ecf20Sopenharmony_ci	kfree(dev->flow_db);
288c2ecf20Sopenharmony_ci}
298c2ecf20Sopenharmony_ci#endif /* _MLX5_IB_FS_H */
30

Indexes created Thu Nov 07 10:32:03 CST 2024