From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT: drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c

Change-Id: I5e5b75c2f0755b037a2574e267525ce0fe76c060
---
 drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c
@@ -869,6 +869,7 @@ int mlx5_esw_qos_modify_vport_rate(struc
 
 #define MLX5_LINKSPEED_UNIT 125000 /* 1Mbps in Bps */
 
+#ifdef HAVE_DEVLINK_HAS_RATE_FUNCTIONS
 /* Converts bytes per second value passed in a pointer into megabits per
  * second, rewriting last. If converted rate exceed link speed or is not a
  * fraction of Mbps - returns error.
@@ -899,6 +900,7 @@ static int esw_qos_devlink_rate_to_mbps(
 	*rate = value;
 	return 0;
 }
+#endif
 
 static bool esw_qos_groups_are_supported(struct mlx5_core_dev *dev)
 {
