All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: add comment for sock_efree() usage
@ 2015-03-10 18:03 Oliver Hartkopp
  2015-03-10 18:32 ` Alexander Duyck
  2015-03-10 20:12 ` David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Oliver Hartkopp @ 2015-03-10 18:03 UTC (permalink / raw)
  To: netdev; +Cc: eric.dumazet, alexander.h.duyck, Oliver Hartkopp

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
 net/core/sock.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/core/sock.c b/net/core/sock.c
index 93c8b20..78e89eb 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1655,6 +1655,10 @@ void sock_rfree(struct sk_buff *skb)
 }
 EXPORT_SYMBOL(sock_rfree);
 
+/*
+ * Buffer destructor for skbs that are not used directly in read or write
+ * path, e.g. for error handler skbs. Automatically called from kfree_skb.
+ */
 void sock_efree(struct sk_buff *skb)
 {
 	sock_put(skb->sk);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] net: add comment for sock_efree() usage
@ 2015-03-10 17:19 Oliver Hartkopp
  2015-03-10 17:29 ` Alexander Duyck
  2015-03-10 19:55 ` Marc Kleine-Budde
  0 siblings, 2 replies; 8+ messages in thread
From: Oliver Hartkopp @ 2015-03-10 17:19 UTC (permalink / raw)
  To: linux-can; +Cc: eric.dumazet, alexander.h.duyck, Oliver Hartkopp

In opposite to sock_rfree() and sock_wfree() the function sock_efree() does
not need to change the sk_[rw]_mem_alloc length. Add the comment to point out
the idea for using sock_efree() in the _e_rror handler or e.g. timestamp path.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
 net/core/sock.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/core/sock.c b/net/core/sock.c
index 93c8b20..7a1eac8 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1655,6 +1655,10 @@ void sock_rfree(struct sk_buff *skb)
 }
 EXPORT_SYMBOL(sock_rfree);
 
+/*
+ * Buffer destructor for skbs that don't have sk_[rw]_mem_alloc accounting.
+ * E.g. error handler / timestamp path. Automatically called from kfree_skb.
+ */
 void sock_efree(struct sk_buff *skb)
 {
 	sock_put(skb->sk);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-10 20:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10 18:03 [PATCH] net: add comment for sock_efree() usage Oliver Hartkopp
2015-03-10 18:32 ` Alexander Duyck
2015-03-10 20:12 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2015-03-10 17:19 Oliver Hartkopp
2015-03-10 17:29 ` Alexander Duyck
2015-03-10 17:39   ` Oliver Hartkopp
2015-03-10 17:50     ` Alexander Duyck
2015-03-10 19:55 ` Marc Kleine-Budde

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.