On Tue, May 02, 2017 at 08:40:32AM -0700, John Fastabend wrote: > This adds a peek routine to skb_array.h for use with qdisc. > > Signed-off-by: John Fastabend <john.r.fastab...@intel.com> > --- > include/linux/skb_array.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h > index f4dfade..33f1f0c 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);
I think it's better to call this __skb_array_peek: the issue is that callers must be careful with it's use - see the comment near __ptr_ring_peek. -- MST