diff options
author | Jesper Dangaard Brouer <brouer@redhat.com> | 2019-06-18 15:05:37 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-19 17:23:13 +0200 |
commit | e54cfd7e1745e52eb6c67ee9c77aefb8e4666a88 (patch) | |
tree | baf9b88f268bb9c2d947b008f3687b8b073ba6f5 /drivers | |
parent | veth: use xdp_release_frame for XDP_PASS (diff) | |
download | linux-e54cfd7e1745e52eb6c67ee9c77aefb8e4666a88.tar.xz linux-e54cfd7e1745e52eb6c67ee9c77aefb8e4666a88.zip |
page_pool: introduce page_pool_free and use in mlx5
In case driver fails to register the page_pool with XDP return API (via
xdp_rxq_info_reg_mem_model()), then the driver can free the page_pool
resources more directly than calling page_pool_destroy(), which does a
unnecessarily RCU free procedure.
This patch is preparing for removing page_pool_destroy(), from driver
invocation.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index a8e8350b38aa..46323709ad47 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -545,8 +545,10 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c, } err = xdp_rxq_info_reg_mem_model(&rq->xdp_rxq, MEM_TYPE_PAGE_POOL, rq->page_pool); - if (err) + if (err) { + page_pool_free(rq->page_pool); goto err_free; + } for (i = 0; i < wq_sz; i++) { if (rq->wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ) { @@ -611,8 +613,6 @@ err_rq_wq_destroy: if (rq->xdp_prog) bpf_prog_put(rq->xdp_prog); xdp_rxq_info_unreg(&rq->xdp_rxq); - if (rq->page_pool) - page_pool_destroy(rq->page_pool); mlx5_wq_destroy(&rq->wq_ctrl); return err; |