From: Amit Cohen <amcohen@xxxxxxxxxx> Date: Sun, 17 Nov 2024 12:42:11 +0000 > > >> -----Original Message----- >> From: Alexander Lobakin <aleksander.lobakin@xxxxxxxxx> >> Sent: Friday, 15 November 2024 16:35 >> To: Ido Schimmel <idosch@xxxxxxxxxx> [...] >> 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