qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: jasowang@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] xen: Drop net_rx_ok
Date: Thu, 2 Jul 2015 13:39:16 +0100	[thread overview]
Message-ID: <20150702123916.GD21214@stefanha-thinkpad.home> (raw)
In-Reply-To: <1435632157-9275-1-git-send-email-famz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

On Tue, Jun 30, 2015 at 10:42:37AM +0800, Fam Zheng wrote:
> This is necessary because once we return false from .can_receive, we
> need to flush the queue when the .can_receive conditions become true
> again, (for example when more buffer is available).
> 
> We can rely on net_rx_packet (which checks the same conditions) to drop
> the packet if the device is not ready, so drop net_xen_info.can_receive.

This patch changes behavior:

Previously can_receive() false meant packets are queued.

Now those same conditions result in net_rx_packet() returning -1, so
packets are discarded.

In order to keep the spirit of the queuing mechanism - where we tell a
sender to hold off until more rx buffers become available - I think the
following line in net_rx_packet() needs to be changed:

  if (rc == rp || RING_REQUEST_CONS_OVERFLOW(&netdev->rx_ring, rc)) {
      xen_be_printf(&netdev->xendev, 2, "no buffer, drop packet\n");
      return -1;  <-- this should be changed to return 0
  }

That change assumes that net_event()'s flush is always called when the
rx ring gets more free space.

Any thoughts from Xen folks?

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-07-02 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30  2:42 [Qemu-devel] [PATCH] xen: Drop net_rx_ok Fam Zheng
2015-07-02 12:39 ` Stefan Hajnoczi [this message]
2015-07-20 17:12   ` Stefan Hajnoczi
2015-07-27 13:16     ` Stefan Hajnoczi
2015-07-27 22:05       ` Chen Gang
2015-07-29  9:28       ` Stefano Stabellini

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=20150702123916.GD21214@stefanha-thinkpad.home \
    --to=stefanha@redhat.com \
    --cc=famz@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.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).