[net-next,13/14] net: skb_array: expose peek API

Message ID 20171207175759.5771.37749.stgit@john-Precision-Tower-5810
State Accepted
Delegated to: David Miller
Headers show
Series
  • lockless qdisc series
Related show

Commit Message

John Fastabend Dec. 7, 2017, 5:57 p.m.
This adds a peek routine to skb_array.h for use with qdisc.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
---
 include/linux/skb_array.h |    5 +++++
 1 file changed, 5 insertions(+)

Patch

diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h
index 8621ffd..c7addf3 100644
--- a/include/linux/skb_array.h
+++ b/include/linux/skb_array.h
@@ -72,6 +72,11 @@  static inline bool __skb_array_empty(struct skb_array *a)
 	return !__ptr_ring_peek(&a->ring);
 }
 
+static inline struct sk_buff *__skb_array_peek(struct skb_array *a)
+{
+	return __ptr_ring_peek(&a->ring);
+}
+
 static inline bool skb_array_empty(struct skb_array *a)
 {
 	return ptr_ring_empty(&a->ring);