From: Jesper Dangaard Brouer <brouer@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: linux-kernel@vger.kernel.org, Jason Wang <jasowang@redhat.com>,
Eric Dumazet <eric.dumazet@gmail.com>,
davem@davemloft.net, netdev@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
kvm@vger.kernel.org, brouer@redhat.com
Subject: Re: [PATCH RFC v7 3/5] skb_array: array based FIFO for skbs
Date: Fri, 3 Jun 2016 19:05:40 +0200 [thread overview]
Message-ID: <20160603190540.79421e54@redhat.com> (raw)
In-Reply-To: <1464883305-32368-4-git-send-email-mst@redhat.com>
Could not compile this new version of skb_array.h, it complains about
implicit declaration of function 'skb_vlan_tag_present' and
'VLAN_HLEN' being undeclared.
Fix this by including linux/if_vlan.h, but is that correct?
On Thu, 2 Jun 2016 19:08:26 +0300 "Michael S. Tsirkin" <mst@redhat.com> wrote:
> A simple array based FIFO of pointers. Intended for net stack so uses
> skbs for type safety. Implemented as a set of wrappers around ptr_array.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> include/linux/skb_array.h | 143 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 143 insertions(+)
> create mode 100644 include/linux/skb_array.h
>
> diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h
> new file mode 100644
> index 0000000..ed6a2b5
> --- /dev/null
> +++ b/include/linux/skb_array.h
> @@ -0,0 +1,143 @@
[...]
> +
> +#ifndef _LINUX_SKB_ARRAY_H
> +#define _LINUX_SKB_ARRAY_H 1
> +
> +#ifdef __KERNEL__
> +#include <linux/ptr_ring.h>
> +#include <linux/skbuff.h>
Added:
+#include <linux/if_vlan.h>
> +#endif
[...]
> +static inline int __skb_array_len_with_tag(struct sk_buff *skb)
> +{
> + if (likely(skb)) {
> + int len = skb->len;
> +
> + if (skb_vlan_tag_present(skb))
> + len += VLAN_HLEN;
> +
> + return len;
> + } else {
> + return 0;
> + }
> +}
> +
> +static inline int skb_array_peek_len(struct skb_array *a)
> +{
> + return PTR_RING_PEEK_CALL(&a->ring, __skb_array_len_with_tag);
> +}
> +
[...]
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2016-06-03 17:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 16:08 [PATCH RFC v7 0/5] skb_array: array based FIFO for skbs Michael S. Tsirkin
2016-06-02 16:08 ` [PATCH RFC v7 1/5] ptr_ring: array based FIFO for pointers Michael S. Tsirkin
2016-06-03 17:38 ` Jesper Dangaard Brouer
2016-06-02 16:08 ` [PATCH RFC v7 2/5] ptr_ring: ring test Michael S. Tsirkin
2016-06-02 16:08 ` [PATCH RFC v7 3/5] skb_array: array based FIFO for skbs Michael S. Tsirkin
2016-06-03 12:58 ` Jesper Dangaard Brouer
2016-06-03 13:04 ` Michael S. Tsirkin
2016-06-06 1:45 ` Jason Wang
2016-06-03 17:05 ` Jesper Dangaard Brouer [this message]
2016-06-02 16:08 ` [PATCH RFC v7 4/5] ptr_ring: resize support Michael S. Tsirkin
2016-06-02 16:08 ` [PATCH RFC v7 5/5] skb_array: " Michael S. Tsirkin
2016-06-03 18:41 ` [PATCH RFC v7 0/5] skb_array: array based FIFO for skbs Jesper Dangaard Brouer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160603190540.79421e54@redhat.com \
--to=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).