ib_rep.h 1.0 KB

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