* [PATCH net-next] hinic3: use skb_put_padto()
@ 2026-10-09 8:45 Eric Dumazet
0 siblings, 0 replies; only message in thread
From: Eric Dumazet @ 2026-10-09 8:45 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, netdev, Eric Dumazet
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.
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
---
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(-)
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
index d19cfbe3ed3b372136e64d767dea366bc4f46637..f92568f0f00b74e28c789b7ef444db9d4fab4d0c 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_tx.c
@@ -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;
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-09 8:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09 8:45 [PATCH net-next] hinic3: use skb_put_padto() Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox