Skip to contentSkip to conversation

hinic3: use skb_put_padto()

PATCH Applied Eric Dumazet 2 participants 2 messages Oct 9 – Oct 15

Subsystems (3)
lore
Share & tools
lore

Eric Dumazet

author maintainer
#0 lore raw

PATCH 1/1 hinic3: use skb_put_padto()

hinic3_send_one_skb() pads short frames with skb_pad(), then sets skb->len directly, leaving skb->tail stale.

Use skb_put_padto(), which updates both.

---
Medium term goal : remove skb_pad() in favor of more robust alternatives.

 drivers/net/ethernet/huawei/hinic3/hinic3_tx.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/ethernet/huawei/hinic3/hinic3_tx.c +2 -6
index d19cfbe3ed3b372136e64d767dea366bc4f46637..f92568f0f00b74e28c789b7ef444db9d4fab4d0c 100644
@@ -541,12 +541,8 @@ static netdev_tx_t hinic3_send_one_skb(struct sk_buff *skb,
 	u32 offload;
 	int err;
 
-	if (unlikely(skb->len < MIN_SKB_LEN)) {
-		if (skb_pad(skb, MIN_SKB_LEN - skb->len))
-			goto err_out;
-
-		skb->len = MIN_SKB_LEN;
-	}
+	if (skb_put_padto(skb, MIN_SKB_LEN))
+		goto err_out;
 
 	offload = hinic3_tx_offload(skb, &task, &queue_info, txq);
 	num_sge = skb_shinfo(skb)->nr_frags + 1;
Signature · 1 line
2.53.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Fri, 9 Oct 2026 10:45:33 +0200 you wrote:

hinic3_send_one_skb() pads short frames with skb_pad(), then sets skb->len directly, leaving skb->tail stale.

Use skb_put_padto(), which updates both.

[...]

Here is the summary with links:
- [net-next] hinic3: use skb_put_padto()

    https://git.kernel.org/netdev/net-next/c/6329e8232aa8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html