| .. | .. |
|---|
| 9 | 9 | #include <linux/mlx5/eswitch.h> |
|---|
| 10 | 10 | #include "mlx5_ib.h" |
|---|
| 11 | 11 | |
|---|
| 12 | +extern const struct mlx5_ib_profile raw_eth_profile; |
|---|
| 13 | + |
|---|
| 12 | 14 | #ifdef CONFIG_MLX5_ESWITCH |
|---|
| 13 | 15 | u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw); |
|---|
| 14 | 16 | struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, |
|---|
| 15 | | - int vport_index); |
|---|
| 17 | + u16 vport_num); |
|---|
| 16 | 18 | struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw); |
|---|
| 17 | 19 | struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, |
|---|
| 18 | | - int vport_index); |
|---|
| 19 | | -void mlx5_ib_register_vport_reps(struct mlx5_ib_dev *dev); |
|---|
| 20 | | -void mlx5_ib_unregister_vport_reps(struct mlx5_ib_dev *dev); |
|---|
| 21 | | -int create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, |
|---|
| 22 | | - struct mlx5_ib_sq *sq); |
|---|
| 20 | + u16 vport_num); |
|---|
| 21 | +void mlx5_ib_register_vport_reps(struct mlx5_core_dev *mdev); |
|---|
| 22 | +void mlx5_ib_unregister_vport_reps(struct mlx5_core_dev *mdev); |
|---|
| 23 | +struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, |
|---|
| 24 | + struct mlx5_ib_sq *sq, |
|---|
| 25 | + u16 port); |
|---|
| 23 | 26 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, |
|---|
| 24 | | - int vport_index); |
|---|
| 27 | + u16 vport_num); |
|---|
| 25 | 28 | #else /* CONFIG_MLX5_ESWITCH */ |
|---|
| 26 | 29 | static inline u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw) |
|---|
| 27 | 30 | { |
|---|
| 28 | | - return SRIOV_NONE; |
|---|
| 31 | + return MLX5_ESWITCH_NONE; |
|---|
| 29 | 32 | } |
|---|
| 30 | 33 | |
|---|
| 31 | 34 | static inline |
|---|
| 32 | 35 | struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, |
|---|
| 33 | | - int vport_index) |
|---|
| 36 | + u16 vport_num) |
|---|
| 34 | 37 | { |
|---|
| 35 | 38 | return NULL; |
|---|
| 36 | 39 | } |
|---|
| .. | .. |
|---|
| 43 | 46 | |
|---|
| 44 | 47 | static inline |
|---|
| 45 | 48 | struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, |
|---|
| 46 | | - int vport_index) |
|---|
| 49 | + u16 vport_num) |
|---|
| 47 | 50 | { |
|---|
| 48 | 51 | return NULL; |
|---|
| 49 | 52 | } |
|---|
| 50 | 53 | |
|---|
| 51 | | -static inline void mlx5_ib_register_vport_reps(struct mlx5_ib_dev *dev) {} |
|---|
| 52 | | -static inline void mlx5_ib_unregister_vport_reps(struct mlx5_ib_dev *dev) {} |
|---|
| 53 | | -static inline int create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, |
|---|
| 54 | | - struct mlx5_ib_sq *sq) |
|---|
| 54 | +static inline void mlx5_ib_register_vport_reps(struct mlx5_core_dev *mdev) {} |
|---|
| 55 | +static inline void mlx5_ib_unregister_vport_reps(struct mlx5_core_dev *mdev) {} |
|---|
| 56 | +static inline |
|---|
| 57 | +struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, |
|---|
| 58 | + struct mlx5_ib_sq *sq, |
|---|
| 59 | + u16 port) |
|---|
| 55 | 60 | { |
|---|
| 56 | | - return 0; |
|---|
| 61 | + return NULL; |
|---|
| 57 | 62 | } |
|---|
| 58 | 63 | |
|---|
| 59 | 64 | static inline |
|---|
| 60 | 65 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, |
|---|
| 61 | | - int vport_index) |
|---|
| 66 | + u16 vport_num) |
|---|
| 62 | 67 | { |
|---|
| 63 | 68 | return NULL; |
|---|
| 64 | 69 | } |
|---|
| .. | .. |
|---|
| 67 | 72 | static inline |
|---|
| 68 | 73 | struct mlx5_ib_dev *mlx5_ib_rep_to_dev(struct mlx5_eswitch_rep *rep) |
|---|
| 69 | 74 | { |
|---|
| 70 | | - return (struct mlx5_ib_dev *)rep->rep_if[REP_IB].priv; |
|---|
| 75 | + return rep->rep_data[REP_IB].priv; |
|---|
| 71 | 76 | } |
|---|
| 72 | 77 | #endif /* __MLX5_IB_REP_H__ */ |
|---|