File Index
Files and directories
Sign in
FILE

ct_fs.h

File preview with syntax highlighting.

linux-6.19.14/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs.h C
 1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
 2/* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. */
 3
 4#ifndef __MLX5_EN_TC_CT_FS_H__
 5#define __MLX5_EN_TC_CT_FS_H__
 6
 7struct mlx5_ct_fs {
 8	const struct net_device *netdev;
 9	struct mlx5_core_dev *dev;
10
11	/* private data */
12	void *priv_data[];
13};
14
15struct mlx5_ct_fs_rule {
16};
17
18struct mlx5_ct_fs_ops {
19	int (*init)(struct mlx5_ct_fs *fs, struct mlx5_flow_table *ct,
20		    struct mlx5_flow_table *ct_nat, struct mlx5_flow_table *post_ct);
21	void (*destroy)(struct mlx5_ct_fs *fs);
22
23	struct mlx5_ct_fs_rule * (*ct_rule_add)(struct mlx5_ct_fs *fs,
24						struct mlx5_flow_spec *spec,
25						struct mlx5_flow_attr *attr,
26						struct flow_rule *flow_rule);
27	void (*ct_rule_del)(struct mlx5_ct_fs *fs, struct mlx5_ct_fs_rule *fs_rule);
28	int (*ct_rule_update)(struct mlx5_ct_fs *fs, struct mlx5_ct_fs_rule *fs_rule,
29			      struct mlx5_flow_spec *spec, struct mlx5_flow_attr *attr);
30
31	size_t priv_size;
32};
33
34static inline void *mlx5_ct_fs_priv(struct mlx5_ct_fs *fs)
35{
36	return &fs->priv_data;
37}
38
39struct mlx5_ct_fs_ops *mlx5_ct_fs_dmfs_ops_get(void);
40
41#if IS_ENABLED(CONFIG_MLX5_SW_STEERING)
42struct mlx5_ct_fs_ops *mlx5_ct_fs_smfs_ops_get(void);
43#else
44static inline struct mlx5_ct_fs_ops *
45mlx5_ct_fs_smfs_ops_get(void)
46{
47	return NULL;
48}
49#endif /* IS_ENABLED(CONFIG_MLX5_SW_STEERING) */
50
51#if IS_ENABLED(CONFIG_MLX5_HW_STEERING)
52struct mlx5_ct_fs_ops *mlx5_ct_fs_hmfs_ops_get(void);
53#else
54static inline struct mlx5_ct_fs_ops *
55mlx5_ct_fs_hmfs_ops_get(void)
56{
57	return NULL;
58}
59#endif /* IS_ENABLED(CONFIG_MLX5_SW_STEERING) */
60
61#endif /* __MLX5_EN_TC_CT_FS_H__ */
~/ Read-only file preview.