Skip to contentSkip to conversation

fm10k: use skb_put_padto()

PATCH Applied Eric Dumazet 2 participants 2 messages Oct 16 – Oct 20

Subsystems (3)
lore
Share & tools
lore

Eric Dumazet

author maintainer
#0 lore raw

PATCH 1/1 fm10k: use skb_put_padto()

Replace the open-coded skb_pad() + __skb_put() sequence in fm10k_xmit_frame() with skb_put_padto().

---
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>
---
Part of a medium term plan to get rid of skb_pad(), source of many mistakes.

 drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +2 -7
index c86701be4364aeae2831d8551b0012ab27b4bfa7..669a02c6415c65a37e43cb283cc24f57b31dd770 100644
@@ -561,13 +561,8 @@ static netdev_tx_t fm10k_xmit_frame(struct sk_buff *skb, struct net_device *dev)
 	/* The minimum packet size for a single buffer is 17B so pad the skb
 	 * in order to meet this minimum size requirement.
 	 */
-	if (unlikely(skb->len < 17)) {
-		int pad_len = 17 - skb->len;
-
-		if (skb_pad(skb, pad_len))
-			return NETDEV_TX_OK;
-		__skb_put(skb, pad_len);
-	}
+	if (skb_put_padto(skb, 17))
+		return NETDEV_TX_OK;
 
 	if (r_idx >= num_tx_queues)
 		r_idx %= num_tx_queues;
Signature · 1 line
2.53.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 10 lines · On Fri, 16 Oct 2026 11:43:12 +0200 you wrote:

Replace the open-coded skb_pad() + __skb_put() sequence in fm10k_xmit_frame() with skb_put_padto().

---
Cc: Tony Nguyen <[email protected]>
Cc: Przemek Kitszel <[email protected]>
Cc: Andrew Lunn <[email protected]>

[...]

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

    https://git.kernel.org/netdev/net-next/c/8754a53984e6

You are awesome, thank you!

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