When LRO is enabled on the MLX, mlx5e_skb_from_cqe_mpwrq_nonlinear copies parts of the payload to the linear part of the skb. This triggers suboptimal processing in GRO, causing slow throughput,... This patch series addresses this by copying a lower-bound estimate of the protocol headers - trying to avoid the payload part. This results in a significant throughput improvement (detailled results in the specific patch). Signed-off-by: Christoph Paasch <cpaasch@xxxxxxxxxx> --- Changes in v3: - Avoid computing headlen when it is not absolutely necessary (e.g., xdp decides to "consume" the packet) (Dragos Tatulea <dtatulea@xxxxxxxxxx> & Jakub Kicinski <kuba@xxxxxxxxxx>) - Given the above change, consolidate the check for min3(...) in the new function to avoid code duplication. - Make sure local variables are in reverse xmas-tree order. - Refine comment about why the check for l4_type worsk as is. - Link to v2: https://lore.kernel.org/r/20250816-cpaasch-pf-927-netmlx5-avoid-copying-the-payload-to-the-malloced-area-v2-0-b11b30bc2d10@xxxxxxxxxx Changes in v2: - Refine commit-message with more info and testing data - Make mlx5e_cqe_get_min_hdr_len() return MLX5E_RX_MAX_HEAD when l3_type is neither IPv4 nor IPv6. Same for the l4_type. That way behavior is unchanged for other traffic types. - Rename mlx5e_cqe_get_min_hdr_len to mlx5e_cqe_estimate_hdr_len - Link to v1: https://lore.kernel.org/r/20250713-cpaasch-pf-927-netmlx5-avoid-copying-the-payload-to-the-malloced-area-v1-0-ecaed8c2844e@xxxxxxxxxx --- Christoph Paasch (2): net/mlx5: Bring back get_cqe_l3_hdr_type net/mlx5: Avoid copying payload to the skb's linear part drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 49 ++++++++++++++++++++++++- include/linux/mlx5/device.h | 12 +++++- 2 files changed, 59 insertions(+), 2 deletions(-) --- base-commit: 6e8e6baf16ce7d2310959ae81d0194a56874e0d2 change-id: 20250712-cpaasch-pf-927-netmlx5-avoid-copying-the-payload-to-the-malloced-area-6524917455a6 Best regards, -- Christoph Paasch <cpaasch@xxxxxxxxxx>