OSDN Git Service

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 d966d5f..b1b51bb 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 8360289..5daf718 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 e36d0c6..b1981dc 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;