[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2e34593e-65e3-df74-1280-5db6dc948130@redhat.com>
Date: Fri, 27 May 2022 19:38:42 +0200
From: Jesper Dangaard Brouer <jbrouer@...hat.com>
To: Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
keliu <liuke94@...wei.com>
Cc: brouer@...hat.com, bjorn@...nel.org, magnus.karlsson@...el.com,
jonathan.lemon@...il.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, ast@...nel.org,
daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com,
netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: xdp: Directly use ida_alloc()/free()
On 27/05/2022 19.08, Maciej Fijalkowski wrote:
> On Fri, May 27, 2022 at 06:46:09AM +0000, keliu wrote:
>> Use ida_alloc()/ida_free() instead of deprecated
>> ida_simple_get()/ida_simple_remove() .
>>
>> Signed-off-by: keliu <liuke94@...wei.com>
Could you use your full name with capital letters?
>
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
>
> For future AF_XDP related patches please specify the bpf-next tree in the
> patch subject (or bpf if it's a fix).
I agree.
Could you also take care of net/core/xdp.c ?
Patch LGTM
Acked-by: Jesper Dangaard Brouer <brouer@...hat.com>
>> ---
>> net/xdp/xdp_umem.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
>> index f01ef6bda390..869b9b9b9fad 100644
>> --- a/net/xdp/xdp_umem.c
>> +++ b/net/xdp/xdp_umem.c
>> @@ -57,7 +57,7 @@ static int xdp_umem_addr_map(struct xdp_umem *umem, struct page **pages,
>> static void xdp_umem_release(struct xdp_umem *umem)
>> {
>> umem->zc = false;
>> - ida_simple_remove(&umem_ida, umem->id);
>> + ida_free(&umem_ida, umem->id);
>>
>> xdp_umem_addr_unmap(umem);
>> xdp_umem_unpin_pages(umem);
>> @@ -242,7 +242,7 @@ struct xdp_umem *xdp_umem_create(struct xdp_umem_reg *mr)
>> if (!umem)
>> return ERR_PTR(-ENOMEM);
>>
>> - err = ida_simple_get(&umem_ida, 0, 0, GFP_KERNEL);
>> + err = ida_alloc(&umem_ida, GFP_KERNEL);
>> if (err < 0) {
>> kfree(umem);
>> return ERR_PTR(err);
>> @@ -251,7 +251,7 @@ struct xdp_umem *xdp_umem_create(struct xdp_umem_reg *mr)
>>
>> err = xdp_umem_reg(umem, mr);
>> if (err) {
>> - ida_simple_remove(&umem_ida, umem->id);
>> + ida_free(&umem_ida, umem->id);
>> kfree(umem);
>> return ERR_PTR(err);
>> }
>> --
>> 2.25.1
>>
>
Powered by blists - more mailing lists