Re: [PATCH net v2] net: usb: rtl8150: Fix frame padding

From: Simon Horman

Date: Wed Oct 15 2025 - 05:27:29 EST


On Tue, Oct 14, 2025 at 08:35:28PM +0200, Michal Pecio wrote:
> TX frames aren't padded and unknown memory is sent into the ether.
>
> Theoretically, it isn't even guaranteed that the extra memory exists
> and can be sent out, which could cause further problems. In practice,
> I found that plenty of tailroom exists in the skb itself (in my test
> with ping at least) and skb_padto() easily succeeds, so use it here.
>
> In the event of -ENOMEM drop the frame like other drivers do.
>
> The use of one more padding byte instead of a USB zero-length packet
> is retained to avoid regression. I have a dodgy Etron xHCI controller
> which doesn't seem to support sending ZLPs at all.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Michal Pecio <michal.pecio@xxxxxxxxx>
> ---
>
> v2: update TX stats when dropping packets
>
> v1: https://lore.kernel.org/netdev/20251012220042.4ca776b1.michal.pecio@xxxxxxxxx/

Thanks for the update.

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>