]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net/mlx5e: Fix RQ creation flow for queues which doesn't support XDP
authorAya Levin <ayal@nvidia.com>
Wed, 7 Apr 2021 11:09:05 +0000 (14:09 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 14 Apr 2021 18:03:10 +0000 (11:03 -0700)
Allow to create an RQ which is not registered as an XDP RQ. For example:
the trap-RQ doesn't register as an XDP RQ.

Fixes: 869c5f926247 ("net/mlx5e: Generalize open RQ")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 2f47608bb9b9e2ff6e5ca6cbee7c2a642c58acdb..6847e7b909a52485254835f4c6ca8b55f0dcb7c4 100644 (file)
@@ -510,8 +510,9 @@ static int mlx5e_alloc_rq(struct mlx5e_params *params,
                        rq->page_pool = NULL;
                        goto err_free_by_rq_type;
                }
-               err = xdp_rxq_info_reg_mem_model(&rq->xdp_rxq,
-                                                MEM_TYPE_PAGE_POOL, rq->page_pool);
+               if (xdp_rxq_info_is_reg(&rq->xdp_rxq))
+                       err = xdp_rxq_info_reg_mem_model(&rq->xdp_rxq,
+                                                        MEM_TYPE_PAGE_POOL, rq->page_pool);
        }
        if (err)
                goto err_free_by_rq_type;