On Tue, Sep 02, 2025 at 09:00:16PM +0800, Mingrui Cui wrote: > When page size is 4K, DEFAULT_FRAG_SIZE of 2048 ensures that with 3 > fragments per WQE, odd-indexed WQEs always share the same page with > their subsequent WQE. However, this relationship does not hold for page > sizes larger than 8K. In this case, wqe_index_mask cannot guarantee that > newly allocated WQEs won't share the same page with old WQEs. > > If the last WQE in a bulk processed by mlx5e_post_rx_wqes() shares a > page with its subsequent WQE, allocating a page for that WQE will > overwrite mlx5e_frag_page, preventing the original page from being > recycled. When the next WQE is processed, the newly allocated page will > be immediately recycled. > > In the next round, if these two WQEs are handled in the same bulk, > page_pool_defrag_page() will be called again on the page, causing > pp_frag_count to become negative. > > Fix this by making DEFAULT_FRAG_SIZE always equal to half of the page > size. > Was there an actual encountered issue or is this a code clarity fix? For 64K page size, linear mode will be used so the constant will not be used for calculating the frag size. Thanks, Dragos