qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Dmitry Smagin <dmitry.s.smagin@gmail.com>
Cc: Dmitry Smagin <exmortis@yandex.ru>,
	qemu-devel@nongnu.org, Antony Pavlov <antonynpavlov@gmail.com>
Subject: Re: [Qemu-devel] [RFC] hw/net: add DEC Tulip NIC emulation
Date: Tue, 3 Dec 2013 15:44:05 +0100	[thread overview]
Message-ID: <20131203144405.GG24604@stefanha-thinkpad.muc.redhat.com> (raw)
In-Reply-To: <1385131669-16845-1-git-send-email-dmitry.s.smagin@gmail.com>

On Fri, Nov 22, 2013 at 06:47:49PM +0400, Dmitry Smagin wrote:
> From: Antony Pavlov <antonynpavlov@gmail.com>
> 
> This patch adds emulation of DEC/Intel Tulip 21143 with some external chips:
>   * Intel LXT971A 10/100 Mbps PHY MII Tranceiver;
>   * Microchip 93LC46B 1K Microwire Compatible Serial EEPROM.
> 
> Restrictions and TODOs:
>   - Tulip always work in promisc-mode with no packet filtering
>     (TODO: check qemu packet filtering interfaces)
> 
>   - Address errors in packet descriptors are not checked
> 
>   - Tulip is bound to PCI, no other bus is possible for now
>     (TODO: Rewrite code to permit Tulip to live on buses other than PCI)
> 
>   - Internal transceiver is not emulated
>     The reason: internal transceiver works with 10 Mbps but we need 100Mbps
>     which only external transceivers can give.
> 
>   - Link status is not emulated, it's always ON
>     (TODO: use standard qemu interface)
> 
>   - Incorrect behavior of the Tulip driver is not checked and there's no error
>     signaling via register CSR5
> 
>   - Only transfer/receive (TI/RI) interrupts are emulated
> 
>   - Subsystem IDs in EEPROM image are not good
>     (TODO: find proper IDs)

The NIC needs to tell QEMU when it transitions from a rx descriptors
exhausted state to a rx refilled state.  For example, the e1000 NIC
calls qemu_flush_queued_packets(qemu_get_queue(s->nic)) when the RDT
hardware register is written to by the guest.

This is necessary since the netdev (e.g. tap) disables receive when the
NIC runs out of rx descriptors.

> +static const VMStateDescription vmstate_tulip = {
> +    .name = "tulip",
> +    .version_id = 2,
> +    .minimum_version_id = 1,
> +    .minimum_version_id_old = 1,
> +    .fields      = (VMStateField[]) {
> +        VMSTATE_PCI_DEVICE(dev, TulipState),
> +        VMSTATE_MACADDR(conf.macaddr, TulipState),

This looks a little sparse :).  Other hardware registers probably need
to be saved/loaded too.

      reply	other threads:[~2013-12-03 14:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22 14:47 [Qemu-devel] [RFC] hw/net: add DEC Tulip NIC emulation Dmitry Smagin
2013-12-03 14:44 ` Stefan Hajnoczi [this message]

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=20131203144405.GG24604@stefanha-thinkpad.muc.redhat.com \
    --to=stefanha@gmail.com \
    --cc=antonynpavlov@gmail.com \
    --cc=dmitry.s.smagin@gmail.com \
    --cc=exmortis@yandex.ru \
    --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).