[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <624840f7-423a-44cd-a2c0-9b7e3b3f8555@intel.com>
Date: Tue, 26 Nov 2024 17:38:38 +0100
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Amit Cohen <amcohen@...dia.com>
CC: Ido Schimmel <idosch@...sch.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, "Paolo
Abeni" <pabeni@...hat.com>, Toke Høiland-Jørgensen
<toke@...hat.com>, Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann
<daniel@...earbox.net>, John Fastabend <john.fastabend@...il.com>, "Andrii
Nakryiko" <andrii@...nel.org>, Maciej Fijalkowski
<maciej.fijalkowski@...el.com>, Stanislav Fomichev <sdf@...ichev.me>, "Magnus
Karlsson" <magnus.karlsson@...el.com>,
"nex.sw.ncis.osdt.itp.upstreaming@...el.com"
<nex.sw.ncis.osdt.itp.upstreaming@...el.com>, "bpf@...r.kernel.org"
<bpf@...r.kernel.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v5 12/19] xdp: add generic
xdp_build_skb_from_buff()
From: Amit Cohen <amcohen@...dia.com>
Date: Sun, 17 Nov 2024 12:42:11 +0000
>
>
>> -----Original Message-----
>> From: Alexander Lobakin <aleksander.lobakin@...el.com>
>> Sent: Friday, 15 November 2024 16:35
>> To: Ido Schimmel <idosch@...sch.org>
[...]
>> Regarding your usecase -- after calling this function, you are free to
>> overwrite any skb fields as this helper doesn't pass it up the stack.
>> For example, in ice driver we have port reps and sometimes we need to
>> pass a different net_device, not the one saved in rxq_info. So when
>> switching to this function, we'll do eth_type_trans() once again (it's
>> either way under unlikely() in our code as it's swichdev slowpath).
>> Same for the queue number in rxq_info.
>
> With this series, maintaining 'struct xdp_mem_allocator' in hash-table looks unnecessary.
> If so, xdp_reg_mem_model() does not need 'allocator' when mem_type is Page-Pool.
>
> Is there a reason for not removing 'mem_id_ht'? With this patch, the nodes are no longer used.
They actually are. xdp_unreg_mem_model() performs lookup and calls
page_pool_destroy() basing on what id you have in rxq_info.mem.
__xdp_reg_mem_model() calls page_pool_use_xdp_mem() which increments
pool's refcount, so that the pool can't be destroyed until the
xdp_rxq_info it's connected to is unregistered.
xdp_rxq_info is 64 bytes on x86_64, meaning replacing xdp_mem_info there
with direct PP pointer will blow it up to 128 bytes (64-byte CL) (don't
forget that xdp_rxq_info still needs to have mem.type set).
>
>>
>>>
>>>>
>>>> To be clear, I understand it is not a common use case.
>>>>
>>>> Thanks
>>
>> Thanks,
>> Olek
Thanks,
Olek
Powered by blists - more mailing lists