All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] NetClientInfo::can_receive change notification and its purpose
@ 2014-02-02  1:47 Max Filippov
  2014-02-02  9:50 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Max Filippov @ 2014-02-02  1:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Anthony Liguori

Hello,

is there any way to notify networking core that adapter's
NetClientInfo::can_receive return value is about to change from 0 to 1?
I'm trying to talk to DHCP server from the recent (2014.01) u-boot running
in the xtensa system emulation over the tap interface. On the guest I see
the following picture (lines marked **...** are printed from the qemu):

U-Boot> dhcp
**open_eth_can_receive: 0**
**open_eth_can_receive: 0**
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5

Retry count exceeded; starting again
ethoc
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5

Retry count exceeded; starting again
^C
**open_eth_can_receive: 1**
**open_eth_can_receive: 1**

The u-boot driver enables packet reception on the network adapter just
before it starts sending packets, but on the networking core doesn't check
that NetClientInfo::can_receive has changed until I press ^C to interrupt
it. Then it receives some of the pending packets, but throws them away.
On the host side I see that DHCP server replies immediately.

When I remove NetClientInfo::can_receive callback from my network
adapter and throw away packets that cannot be received in the
NetClientInfo::receive callback it all works well. So I've got two questions:
- is there any way to push NetClientInfo::can_receive update to the
  network core?
- wouldn't it be more correct to emulate real hardware more closely:
  always be ready to receive a packet, but throw it away if there's e.g.
  no buffers or the receiver is disabled?

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] NetClientInfo::can_receive change notification and its purpose
  2014-02-02  1:47 [Qemu-devel] NetClientInfo::can_receive change notification and its purpose Max Filippov
@ 2014-02-02  9:50 ` Paolo Bonzini
  2014-02-02 10:33   ` Max Filippov
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2014-02-02  9:50 UTC (permalink / raw)
  To: Max Filippov, qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi

Il 02/02/2014 02:47, Max Filippov ha scritto:
> Hello,
>
> is there any way to notify networking core that adapter's
> NetClientInfo::can_receive return value is about to change from 0 to 1?

Yes, qemu_flush_queued_packets.

See commit e8b4c68 (e1000: flush queue whenever can_receive can go from 
false to true, 2012-08-09).

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] NetClientInfo::can_receive change notification and its purpose
  2014-02-02  9:50 ` Paolo Bonzini
@ 2014-02-02 10:33   ` Max Filippov
  0 siblings, 0 replies; 3+ messages in thread
From: Max Filippov @ 2014-02-02 10:33 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Stefan Hajnoczi, Anthony Liguori

On Sun, Feb 2, 2014 at 1:50 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 02/02/2014 02:47, Max Filippov ha scritto:
>
>> Hello,
>>
>> is there any way to notify networking core that adapter's
>> NetClientInfo::can_receive return value is about to change from 0 to 1?
>
> Yes, qemu_flush_queued_packets.
>
> See commit e8b4c68 (e1000: flush queue whenever can_receive can go from
> false to true, 2012-08-09).

Thanks Paolo!

-- Max

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-02 10:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-02  1:47 [Qemu-devel] NetClientInfo::can_receive change notification and its purpose Max Filippov
2014-02-02  9:50 ` Paolo Bonzini
2014-02-02 10:33   ` Max Filippov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.