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

Change-Id: Iefc40760a51ac2ac72e8b2c632ba8e56e0dc342f
---
 drivers/net/ethernet/mellanox/mlx5/core/en/channels.c | 9 +++++++++
 1 file changed, 9 insertions(+)

--- a/drivers/net/ethernet/mellanox/mlx5/core/en/channels.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/channels.c
@@ -18,9 +18,13 @@ static struct mlx5e_channel *mlx5e_chann
 
 bool mlx5e_channels_is_xsk(struct mlx5e_channels *chs, unsigned int ix)
 {
+#ifdef HAVE_XSK_ZERO_COPY_SUPPORT
 	struct mlx5e_channel *c = mlx5e_channels_get(chs, ix);
 
 	return test_bit(MLX5E_CHANNEL_STATE_XSK, c->state);
+#else
+	return false;
+#endif
 }
 
 void mlx5e_channels_get_regular_rqn(struct mlx5e_channels *chs, unsigned int ix, u32 *rqn,
@@ -36,6 +40,7 @@ void mlx5e_channels_get_regular_rqn(stru
 void mlx5e_channels_get_xsk_rqn(struct mlx5e_channels *chs, unsigned int ix, u32 *rqn,
 				u32 *vhca_id)
 {
+#ifdef HAVE_XSK_ZERO_COPY_SUPPORT
 	struct mlx5e_channel *c = mlx5e_channels_get(chs, ix);
 
 	WARN_ON_ONCE(!test_bit(MLX5E_CHANNEL_STATE_XSK, c->state));
@@ -43,6 +48,10 @@ void mlx5e_channels_get_xsk_rqn(struct m
 	*rqn = c->xskrq.rqn;
 	if (vhca_id)
 		*vhca_id = MLX5_CAP_GEN(c->mdev, vhca_id);
+#else
+	return;
+
+#endif
 }
 
 bool mlx5e_channels_get_ptp_rqn(struct mlx5e_channels *chs, u32 *rqn)
