net/mlx5e: Add missing LRO cap check
authorTariq Toukan <tariqt@mellanox.com>
Thu, 2 Jan 2020 14:17:41 +0000 (16:17 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 26 Feb 2020 01:05:42 +0000 (17:05 -0800)
The LRO boolean state in params->lro_en must not be set in case
the NIC is not capable.
Enforce this check and remove the TODO comment.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 966983674663f776a04e0d96dc36eb2e8cdfcaad..a4d3e1b6ab20fdf29d83a8c78f206a90ff4be0b5 100644 (file)
@@ -4770,9 +4770,8 @@ void mlx5e_build_nic_params(struct mlx5e_priv *priv,
        mlx5e_build_rq_params(mdev, params);
 
        /* HW LRO */
-
-       /* TODO: && MLX5_CAP_ETH(mdev, lro_cap) */
-       if (params->rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ) {
+       if (MLX5_CAP_ETH(mdev, lro_cap) &&
+           params->rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ) {
                /* No XSK params: checking the availability of striding RQ in general. */
                if (!mlx5e_rx_mpwqe_is_linear_skb(mdev, params, NULL))
                        params->lro_en = !slow_pci_heuristic(mdev);