summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.h
blob: 1fb185d6ac7f7ca9ab92404122996609256ccd93 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
 * Copyright (c) 2019 Mellanox Technologies
 */

#ifndef _MLX5_FS_DR_
#define _MLX5_FS_DR_

#include "mlx5dr.h"

struct mlx5_flow_root_namespace;
struct fs_fte;

struct mlx5_fs_dr_action {
	struct mlx5dr_action *dr_action;
};

struct mlx5_fs_dr_ns {
	struct mlx5_dr_ns *dr_ns;
};

struct mlx5_fs_dr_rule {
	struct mlx5dr_rule    *dr_rule;
	/* Only actions created by fs_dr */
	struct mlx5dr_action  **dr_actions;
	int                      num_actions;
};

struct mlx5_fs_dr_domain {
	struct mlx5dr_domain	*dr_domain;
};

struct mlx5_fs_dr_matcher {
	struct mlx5dr_matcher *dr_matcher;
};

struct mlx5_fs_dr_table {
	struct mlx5dr_table  *dr_table;
	struct mlx5dr_action *miss_action;
};

#ifdef CONFIG_MLX5_SW_STEERING

bool mlx5_fs_dr_is_supported(struct mlx5_core_dev *dev);

const struct mlx5_flow_cmds *mlx5_fs_cmd_get_dr_cmds(void);

#else

static inline const struct mlx5_flow_cmds *mlx5_fs_cmd_get_dr_cmds(void)
{
	return NULL;
}

static inline bool mlx5_fs_dr_is_supported(struct mlx5_core_dev *dev)
{
	return false;
}

#endif /* CONFIG_MLX5_SW_STEERING */
#endif