File: fs.h

package info (click to toggle)
linux 6.16.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,724,576 kB
  • sloc: ansic: 26,558,545; asm: 271,315; sh: 143,998; python: 72,469; makefile: 57,126; perl: 36,821; xml: 19,553; cpp: 5,820; yacc: 4,915; lex: 2,955; awk: 1,667; sed: 28; ruby: 25
file content (32 lines) | stat: -rw-r--r-- 1,145 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/*
 * Copyright (c) 2013-2020, Mellanox Technologies inc. All rights reserved.
 */

#ifndef _MLX5_IB_FS_H
#define _MLX5_IB_FS_H

#include "mlx5_ib.h"

int mlx5_ib_fs_init(struct mlx5_ib_dev *dev);
void mlx5_ib_fs_cleanup_anchor(struct mlx5_ib_dev *dev);

static inline void mlx5_ib_fs_cleanup(struct mlx5_ib_dev *dev)
{
	/* When a steering anchor is created, a special flow table is also
	 * created for the user to reference. Since the user can reference it,
	 * the kernel cannot trust that when the user destroys the steering
	 * anchor, they no longer reference the flow table.
	 *
	 * To address this issue, when a user destroys a steering anchor, only
	 * the flow steering rule in the table is destroyed, but the table
	 * itself is kept to deal with the above scenario. The remaining
	 * resources are only removed when the RDMA device is destroyed, which
	 * is a safe assumption that all references are gone.
	 */
	mlx5_ib_fs_cleanup_anchor(dev);
	kfree(dev->flow_db->rdma_transport_tx);
	kfree(dev->flow_db->rdma_transport_rx);
	kfree(dev->flow_db);
}
#endif /* _MLX5_IB_FS_H */