* [PATCH net-next] hinic: use skb_put_padto()
@ 2026-10-16 9:35 Eric Dumazet
2026-10-20 20:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2026-10-16 9:35 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, netdev, Eric Dumazet, Cai Huoqing, Andrew Lunn
hinic_xmit_frame() pads short frames with skb_pad(), then
sets skb->len directly, leaving skb->tail stale.
Use skb_put_padto(), which updates both and is a litle less confusing.
Also remove one pointless netdev_err() call.
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
---
Cc: Cai Huoqing <cai.huoqing@linux.dev>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
---
Part of a medium plan to get rid of skb_pad(), source of many mistakes.
drivers/net/ethernet/huawei/hinic/hinic_tx.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_tx.c b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
index 9b60966736db537ae87e2871a977975c4c6b919d..899d103f24803b3731240f5982c9545c2e390b38 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_tx.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
@@ -563,14 +563,8 @@ netdev_tx_t hinic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
txq = &nic_dev->txqs[q_id];
qp = container_of(txq->sq, struct hinic_qp, sq);
- if (skb->len < MIN_SKB_LEN) {
- if (skb_pad(skb, MIN_SKB_LEN - skb->len)) {
- netdev_err(netdev, "Failed to pad skb\n");
- goto update_error_stats;
- }
-
- skb->len = MIN_SKB_LEN;
- }
+ if (skb_put_padto(skb, MIN_SKB_LEN))
+ goto update_error_stats;
nr_sges = skb_shinfo(skb)->nr_frags + 1;
if (nr_sges > 17) {
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] hinic: use skb_put_padto()
2026-10-16 9:35 [PATCH net-next] hinic: use skb_put_padto() Eric Dumazet
@ 2026-10-20 20:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-20 20:30 UTC (permalink / raw)
To: Eric Dumazet
Cc: davem, kuba, pabeni, horms, netdev, cai.huoqing, andrew+netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 16 Oct 2026 11:35:18 +0200 you wrote:
> hinic_xmit_frame() pads short frames with skb_pad(), then
> sets skb->len directly, leaving skb->tail stale.
>
> Use skb_put_padto(), which updates both and is a litle less confusing.
>
> Also remove one pointless netdev_err() call.
>
> [...]
Here is the summary with links:
- [net-next] hinic: use skb_put_padto()
https://git.kernel.org/netdev/net-next/c/42ee6e77ab45
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-20 20:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 9:35 [PATCH net-next] hinic: use skb_put_padto() Eric Dumazet
2026-10-20 20:30 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.