[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200312233648.1767-2-joe@wand.net.nz>
Date: Thu, 12 Mar 2020 16:36:42 -0700
From: Joe Stringer <joe@...d.net.nz>
To: bpf@...r.kernel.org
Cc: netdev@...r.kernel.org, daniel@...earbox.net, ast@...nel.org,
eric.dumazet@...il.com, lmb@...udflare.com
Subject: [PATCH bpf-next 1/7] dst: Move skb_dst_drop to skbuff.c
Prepare for extending this function to handle dst_sk_prefetch by moving
it away from the generic dst header and into the skbuff code.
Signed-off-by: Joe Stringer <joe@...d.net.nz>
---
include/linux/skbuff.h | 1 +
include/net/dst.h | 14 --------------
net/core/skbuff.c | 15 +++++++++++++++
3 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 21749b2cdc9b..860cee22c49b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1047,6 +1047,7 @@ static inline bool skb_unref(struct sk_buff *skb)
return true;
}
+void skb_dst_drop(struct sk_buff *skb);
void skb_release_head_state(struct sk_buff *skb);
void kfree_skb(struct sk_buff *skb);
void kfree_skb_list(struct sk_buff *segs);
diff --git a/include/net/dst.h b/include/net/dst.h
index 3448cf865ede..b6a2ecab53ce 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -259,20 +259,6 @@ static inline void refdst_drop(unsigned long refdst)
dst_release((struct dst_entry *)(refdst & SKB_DST_PTRMASK));
}
-/**
- * skb_dst_drop - drops skb dst
- * @skb: buffer
- *
- * Drops dst reference count if a reference was taken.
- */
-static inline void skb_dst_drop(struct sk_buff *skb)
-{
- if (skb->_skb_refdst) {
- refdst_drop(skb->_skb_refdst);
- skb->_skb_refdst = 0UL;
- }
-}
-
static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
{
nskb->_skb_refdst = refdst;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index e1101a4f90a6..6b2798450fd4 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1034,6 +1034,21 @@ struct sk_buff *alloc_skb_for_msg(struct sk_buff *first)
}
EXPORT_SYMBOL_GPL(alloc_skb_for_msg);
+/**
+ * skb_dst_drop - drops skb dst
+ * @skb: buffer
+ *
+ * Drops dst reference count if a reference was taken.
+ */
+void skb_dst_drop(struct sk_buff *skb)
+{
+ if (skb->_skb_refdst) {
+ refdst_drop(skb->_skb_refdst);
+ skb->_skb_refdst = 0UL;
+ }
+}
+EXPORT_SYMBOL_GPL(skb_dst_drop);
+
/**
* skb_morph - morph one skb into another
* @dst: the skb to receive the contents
--
2.20.1
Powered by blists - more mailing lists