]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: Disable TX MPWQE in kdump mode
authorAlaa Hleihel <alaa@nvidia.com>
Mon, 10 May 2021 11:17:55 +0000 (14:17 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 3 Jun 2021 20:10:20 +0000 (13:10 -0700)
Under kdump environment we want to use the smallest possible amount
of resources, that includes setting SQ size to minimum.
However, when running on a device that supports TX MPWQE, then the SQ stop
room becomes larger than with non-capable device and requires increasing
the SQ size.

Since TX MPWQE offload is not necessary in kdump mode, disable it to
reduce the memory requirements for capable devices.

With this change, the needed SQ stop room size drops by 31.

Signed-off-by: Alaa Hleihel <alaa@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index d966d5f40e7835d162e46e1335163852f498c694..b1b51bbba0541c2560db298eff2f68f8e9aece24 100644 (file)
@@ -1162,6 +1162,13 @@ mlx5e_calc_max_nch(struct mlx5e_priv *priv, const struct mlx5e_profile *profile)
        return priv->netdev->num_rx_queues / max_t(u8, profile->rq_groups, 1);
 }
 
+static inline bool
+mlx5e_tx_mpwqe_supported(struct mlx5_core_dev *mdev)
+{
+       return !is_kdump_kernel() &&
+               MLX5_CAP_ETH(mdev, enhanced_multi_pkt_send_wqe);
+}
+
 int mlx5e_priv_init(struct mlx5e_priv *priv,
                    struct net_device *netdev,
                    struct mlx5_core_dev *mdev);
index 8360289813f0dba27f9697536984fc508f3eb7fb..5daf7185b0351217fd1dfa780c7003a9da107e6c 100644 (file)
@@ -1984,7 +1984,7 @@ static int set_pflag_tx_mpwqe_common(struct net_device *netdev, u32 flag, bool e
        struct mlx5_core_dev *mdev = priv->mdev;
        struct mlx5e_params new_params;
 
-       if (enable && !MLX5_CAP_ETH(mdev, enhanced_multi_pkt_send_wqe))
+       if (enable && !mlx5e_tx_mpwqe_supported(mdev))
                return -EOPNOTSUPP;
 
        new_params = priv->channels.params;
index e36d0c6a08db9f9dd1dcede5510567195d08633f..b1981dc9cc7b57e7ca4b733afe2df0f2fb8aeb32 100644 (file)
@@ -4620,12 +4620,10 @@ void mlx5e_build_nic_params(struct mlx5e_priv *priv, struct mlx5e_xsk *xsk, u16
        params->log_sq_size = is_kdump_kernel() ?
                MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE :
                MLX5E_PARAMS_DEFAULT_LOG_SQ_SIZE;
-       MLX5E_SET_PFLAG(params, MLX5E_PFLAG_SKB_TX_MPWQE,
-                       MLX5_CAP_ETH(mdev, enhanced_multi_pkt_send_wqe));
+       MLX5E_SET_PFLAG(params, MLX5E_PFLAG_SKB_TX_MPWQE, mlx5e_tx_mpwqe_supported(mdev));
 
        /* XDP SQ */
-       MLX5E_SET_PFLAG(params, MLX5E_PFLAG_XDP_TX_MPWQE,
-                       MLX5_CAP_ETH(mdev, enhanced_multi_pkt_send_wqe));
+       MLX5E_SET_PFLAG(params, MLX5E_PFLAG_XDP_TX_MPWQE, mlx5e_tx_mpwqe_supported(mdev));
 
        /* set CQE compression */
        params->rx_cqe_compress_def = false;