Re: [PATCH net-next v2 13/18] xsk: allow attaching XSk pool via xdp_rxq_info_reg_mem_model()

Alexander Lobakin
2024-10-21T14:24:21Z

From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Date: Thu, 17 Oct 2024 14:49:51 +0200

> On Tue, Oct 15, 2024 at 04:53:45PM +0200, Alexander Lobakin wrote:
>> When you register an XSk pool as XDP Rxq info memory model, you then
>> need to manually attach it after the registration.
>> Let the user combine both actions into one by just passing a pointer
>> to the pool directly to xdp_rxq_info_reg_mem_model(), which will take
>> care of calling xsk_pool_set_rxq_info(). This looks similar to how a
>> &page_pool gets registered and reduce repeating driver code.
>>
>> Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
>
> Makes sense, but why not address callsites in drivers while at it?
> Otherwise in case this would be merged this would be called twice. Not a
> big deal though.

You said yourself that this series is big enough already :D
This won't be called twice as here I call it only when
`allocator != NULL`, but all the callsites pass NULL when they
want to register an XSk pool. It's not NULL only in case of
Page Pool.

>
> Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Thanks,
Olek