]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.1.7/net-mlx5e-disable-rxhash-when-cqe-compress-is-enabled.patch
Linux 5.1.7
[thirdparty/kernel/stable-queue.git] / releases / 5.1.7 / net-mlx5e-disable-rxhash-when-cqe-compress-is-enabled.patch
1 From foo@baz Fri 31 May 2019 03:16:39 PM PDT
2 From: Saeed Mahameed <saeedm@mellanox.com>
3 Date: Thu, 23 May 2019 12:55:10 -0700
4 Subject: net/mlx5e: Disable rxhash when CQE compress is enabled
5
6 From: Saeed Mahameed <saeedm@mellanox.com>
7
8 [ Upstream commit c0194e2d0ef0e5ce5e21a35640d23a706827ae28 ]
9
10 When CQE compression is enabled (Multi-host systems), compressed CQEs
11 might arrive to the driver rx, compressed CQEs don't have a valid hash
12 offload and the driver already reports a hash value of 0 and invalid hash
13 type on the skb for compressed CQEs, but this is not good enough.
14
15 On a congested PCIe, where CQE compression will kick in aggressively,
16 gro will deliver lots of out of order packets due to the invalid hash
17 and this might cause a serious performance drop.
18
19 The only valid solution, is to disable rxhash offload at all when CQE
20 compression is favorable (Multi-host systems).
21
22 Fixes: 7219ab34f184 ("net/mlx5e: CQE compression")
23 Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25 ---
26 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 13 +++++++++++++
27 1 file changed, 13 insertions(+)
28
29 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
30 +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
31 @@ -3750,6 +3750,12 @@ static netdev_features_t mlx5e_fix_featu
32 netdev_warn(netdev, "Disabling LRO, not supported in legacy RQ\n");
33 }
34
35 + if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS)) {
36 + features &= ~NETIF_F_RXHASH;
37 + if (netdev->features & NETIF_F_RXHASH)
38 + netdev_warn(netdev, "Disabling rxhash, not supported when CQE compress is active\n");
39 + }
40 +
41 mutex_unlock(&priv->state_lock);
42
43 return features;
44 @@ -3875,6 +3881,9 @@ int mlx5e_hwstamp_set(struct mlx5e_priv
45 memcpy(&priv->tstamp, &config, sizeof(config));
46 mutex_unlock(&priv->state_lock);
47
48 + /* might need to fix some features */
49 + netdev_update_features(priv->netdev);
50 +
51 return copy_to_user(ifr->ifr_data, &config,
52 sizeof(config)) ? -EFAULT : 0;
53 }
54 @@ -4734,6 +4743,10 @@ static void mlx5e_build_nic_netdev(struc
55 if (!priv->channels.params.scatter_fcs_en)
56 netdev->features &= ~NETIF_F_RXFCS;
57
58 + /* prefere CQE compression over rxhash */
59 + if (MLX5E_GET_PFLAG(&priv->channels.params, MLX5E_PFLAG_RX_CQE_COMPRESS))
60 + netdev->features &= ~NETIF_F_RXHASH;
61 +
62 #define FT_CAP(f) MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_receive.f)
63 if (FT_CAP(flow_modify_en) &&
64 FT_CAP(modify_root) &&