qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Yasevich <vyasevic@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: jasowang@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] rtl8139: Do not consume the packet during overflow in standard mode.
Date: Wed, 26 Aug 2015 09:02:39 -0400	[thread overview]
Message-ID: <55DDB8EF.3020300@redhat.com> (raw)
In-Reply-To: <20150826121823.GE30715@stefanha-thinkpad.redhat.com>

On 08/26/2015 08:18 AM, Stefan Hajnoczi wrote:
> On Fri, Aug 21, 2015 at 02:59:24PM -0700, Vladislav Yasevich wrote:
>> When operation in standard mode, we currently return the size
>> of packet during buffer overflow.  This consumes the overflow
>> packet.  Return 0 instead so we can re-process the overflow packet
>> when we have room.
>>
>> This fixes issues with lost/dropped fragments of large messages.
>>
>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
>> ---
>>  hw/net/rtl8139.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
>> index edbb61c..359e001 100644
>> --- a/hw/net/rtl8139.c
>> +++ b/hw/net/rtl8139.c
>> @@ -1157,7 +1157,7 @@ static ssize_t rtl8139_do_receive(NetClientState *nc, const uint8_t *buf, size_t
>>              s->IntrStatus |= RxOverflow;
>>              ++s->RxMissed;
>>              rtl8139_update_irq(s);
>> -            return size_;
>> +            return 0;
> 
> Every .receive() return 0 must be paired with a
> qemu_flush_queued_packets() call.

Isn't that already there.  A few drivers already return 0 to trigger a requeue.  What's
missing?


> 
> Is rtl8139_RxBufPtr_write() guaranteed to be called when the guest
> refills rx buffers?
> 

It calls it on read, once it's consumed a packet, to advance to the next packet in the
buffer.

-vlad

  reply	other threads:[~2015-08-26 13:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 21:59 [Qemu-devel] [PATCH 0/2] rtl8139: Fix buffer overflow in standard mode Vladislav Yasevich
2015-08-21 21:59 ` [Qemu-devel] [PATCH 1/2] rtl8139: Do not consume the packet during " Vladislav Yasevich
2015-08-26 12:18   ` Stefan Hajnoczi
2015-08-26 13:02     ` Vlad Yasevich [this message]
2015-08-21 21:59 ` [Qemu-devel] [PATCH 2/2] rtl8139: correctly track full receive buffer " Vladislav Yasevich
2015-08-26 12:36   ` Stefan Hajnoczi
2015-08-26 13:07     ` Vlad Yasevich
  -- strict thread matches above, loose matches on Subject: below --
2015-08-26 19:51 [Qemu-devel] [PATCH v2 0/2] rtl8139: Fix buffer overflow " Vladislav Yasevich
2015-08-26 19:51 ` [Qemu-devel] [PATCH 1/2] rtl8139: Do not consume the packet during " Vladislav Yasevich

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=55DDB8EF.3020300@redhat.com \
    --to=vyasevic@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).