1 | /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ |
2 | /* |
3 | * Copyright (c) 2018 Mellanox Technologies. All rights reserved. |
4 | */ |
5 | |
6 | #ifndef __MLX5_IB_REP_H__ |
7 | #define __MLX5_IB_REP_H__ |
8 | |
9 | #include <linux/mlx5/eswitch.h> |
10 | #include "mlx5_ib.h" |
11 | |
12 | extern const struct mlx5_ib_profile raw_eth_profile; |
13 | |
14 | #ifdef CONFIG_MLX5_ESWITCH |
15 | int mlx5r_rep_init(void); |
16 | void mlx5r_rep_cleanup(void); |
17 | struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, |
18 | struct mlx5_ib_sq *sq, |
19 | u32 port); |
20 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, |
21 | u16 vport_num); |
22 | #else /* CONFIG_MLX5_ESWITCH */ |
23 | static inline int mlx5r_rep_init(void) { return 0; } |
24 | static inline void mlx5r_rep_cleanup(void) {} |
25 | static inline |
26 | struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, |
27 | struct mlx5_ib_sq *sq, |
28 | u32 port) |
29 | { |
30 | return NULL; |
31 | } |
32 | |
33 | static inline |
34 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, |
35 | u16 vport_num) |
36 | { |
37 | return NULL; |
38 | } |
39 | #endif |
40 | #endif /* __MLX5_IB_REP_H__ */ |
41 | |