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] ne2000: Drop ne2000_can_receive
Date: Thu, 2 Jul 2015 14:41:30 +0100 [thread overview]
Message-ID: <20150702134130.GJ21214@stefanha-thinkpad.home> (raw)
In-Reply-To: <1435728305-5064-1-git-send-email-famz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]
On Wed, Jul 01, 2015 at 01:25:05PM +0800, Fam Zheng wrote:
> ne2000_receive already checks the same conditions and drops the packet
> if it's not ready, removing the .can_receive callback avoids the
> necessity to add explicit flushes when the conditions turn true (which
> is required by the new semantics of .can_receive since 6e99c63
> "net/socket: Drop net_socket_can_send").
>
> Plus the "return 1" if E8390_STOP is also suspicious.
I think that is actually correct behavior. It says we want to discard
packets instead of queuing them if the NIC is stopped.
This patch is incomplete. Previously the NIC never woke up after
ne2000_buffer_full() transitioned false -> true. Now the NIC never
queues packets anymore.
ne2000_receive() needs to be changed to:
if (s->cmd & E8390_STOP) {
return -1;
}
if (ne2000_buffer_full(s)) {
return 0;
}
This moves the old .can_receive() behavior into .receive().
Flush calls need to be added to each of the locations where
ne2000_buffer_full() transitions from true -> false.
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-07-02 13:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 5:25 [Qemu-devel] [PATCH] ne2000: Drop ne2000_can_receive Fam Zheng
2015-07-02 13:41 ` Stefan Hajnoczi [this message]
2015-09-02 13:51 ` Stefan Hajnoczi
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=20150702134130.GJ21214@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).