netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 1/5] ptr_ring: array based FIFO for pointers
Date: Fri, 3 Jun 2016 19:38:49 +0200	[thread overview]
Message-ID: <20160603193849.6c9c040d@redhat.com> (raw)
In-Reply-To: <1464883305-32368-2-git-send-email-mst@redhat.com>


On Thu, 2 Jun 2016 19:08:18 +0300 "Michael S. Tsirkin" <mst@redhat.com> wrote:

> A simple array based FIFO of pointers.  Intended for net stack which
> commonly has a single consumer/producer.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  include/linux/ptr_ring.h | 264 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 264 insertions(+)
>  create mode 100644 include/linux/ptr_ring.h
> 
> diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h
> new file mode 100644
> index 0000000..d265d72
> --- /dev/null
> +++ b/include/linux/ptr_ring.h
[...]
> +static inline void *ptr_ring_consume_bh(struct ptr_ring *r)
                                       ^^^
> +{
> +	void *ptr;
> +
> +	spin_lock(&r->consumer_lock);

Ups! should have been spin_lock_bh()

> +	ptr = __ptr_ring_consume(r);
> +	spin_unlock(&r->consumer_lock);

and spin_unlock_bh()

> +
> +	return ptr;
> +}



-- 
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

  reply	other threads:[~2016-06-03 17:38 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 [this message]
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
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=20160603193849.6c9c040d@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).