* [PATCH] net: skbuff: Fix misleading comments for skb_put() and skb_push()
@ 2026-07-24 15:06 Ziran Zhang
2026-07-25 7:15 ` Willem de Bruijn
0 siblings, 1 reply; 2+ messages in thread
From: Ziran Zhang @ 2026-07-24 15:06 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, netdev, linux-kernel, Ziran Zhang
Both functions only move the tail/data pointer, they do not copy data.
Update the function descriptions and @len parameter, so they can accurately
reflect the semantics.
Signed-off-by: Ziran Zhang <zhangcoder@yeah.net>
---
net/core/skbuff.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 18dabb4e9..35ad782ad 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2614,9 +2614,9 @@ void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
EXPORT_SYMBOL_GPL(pskb_put);
/**
- * skb_put - add data to a buffer
+ * skb_put - extend the data area at the tail of a buffer
* @skb: buffer to use
- * @len: amount of data to add
+ * @len: number of bytes to extend
*
* This function extends the used data area of the buffer. If this would
* exceed the total buffer size the kernel will panic. A pointer to the
@@ -2635,9 +2635,9 @@ void *skb_put(struct sk_buff *skb, unsigned int len)
EXPORT_SYMBOL(skb_put);
/**
- * skb_push - add data to the start of a buffer
+ * skb_push - extend the data area at the start of a buffer
* @skb: buffer to use
- * @len: amount of data to add
+ * @len: number of bytes to extend
*
* This function extends the used data area of the buffer at the buffer
* start. If this would exceed the total buffer headroom the kernel will
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: skbuff: Fix misleading comments for skb_put() and skb_push()
2026-07-24 15:06 [PATCH] net: skbuff: Fix misleading comments for skb_put() and skb_push() Ziran Zhang
@ 2026-07-25 7:15 ` Willem de Bruijn
0 siblings, 0 replies; 2+ messages in thread
From: Willem de Bruijn @ 2026-07-25 7:15 UTC (permalink / raw)
To: Ziran Zhang, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
Cc: Simon Horman, netdev, linux-kernel, Ziran Zhang
Ziran Zhang wrote:
> Both functions only move the tail/data pointer, they do not copy data.
> Update the function descriptions and @len parameter, so they can accurately
> reflect the semantics.
>
> Signed-off-by: Ziran Zhang <zhangcoder@yeah.net>
This seems subjective and superfluous to me. Certainly not a fix. No
mention of copy is made in the existing comments.
> ---
> net/core/skbuff.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 18dabb4e9..35ad782ad 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -2614,9 +2614,9 @@ void *pskb_put(struct sk_buff *skb, struct sk_buff *tail, int len)
> EXPORT_SYMBOL_GPL(pskb_put);
>
> /**
> - * skb_put - add data to a buffer
> + * skb_put - extend the data area at the tail of a buffer
> * @skb: buffer to use
> - * @len: amount of data to add
> + * @len: number of bytes to extend
> *
> * This function extends the used data area of the buffer. If this would
> * exceed the total buffer size the kernel will panic. A pointer to the
> @@ -2635,9 +2635,9 @@ void *skb_put(struct sk_buff *skb, unsigned int len)
> EXPORT_SYMBOL(skb_put);
>
> /**
> - * skb_push - add data to the start of a buffer
> + * skb_push - extend the data area at the start of a buffer
> * @skb: buffer to use
> - * @len: amount of data to add
> + * @len: number of bytes to extend
> *
> * This function extends the used data area of the buffer at the buffer
> * start. If this would exceed the total buffer headroom the kernel will
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-25 7:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 15:06 [PATCH] net: skbuff: Fix misleading comments for skb_put() and skb_push() Ziran Zhang
2026-07-25 7:15 ` Willem de Bruijn
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.