qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Beniamino Galvani <b.galvani@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Li Guang <lig.fnst@cn.fujitsu.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] hw/net: add support for Allwinner EMAC Fast Ethernet controller
Date: Mon, 6 Jan 2014 14:12:27 +0800	[thread overview]
Message-ID: <20140106061227.GA20766@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <CAEgOgz65gQSLVffUhbMH9YC=DW5KTWdqjxS=VTSPCqBV5GmYNA@mail.gmail.com>

On Mon, Jan 06, 2014 at 01:46:54PM +1000, Peter Crosthwaite wrote:
> On Mon, Jan 6, 2014 at 1:27 PM, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > On Thu, Jan 02, 2014 at 08:25:10PM +1000, Peter Crosthwaite wrote:
> >> Hi Beniamino,
> >>
> >> On Thu, Jan 2, 2014 at 7:18 PM, Beniamino Galvani <b.galvani@gmail.com> wrote:
> >> > This patch adds support for the Fast Ethernet MAC found on Allwinner
> >> > SoCs, together with a basic emulation of Realtek RTL8201CP PHY.
> >> >
> >>
> >> More a comment for net in general, but I think sooner or later we need
> >> to move towards a split between phy and mac on the device level.
> >> continuing the phy-within-mac philosophy is going to make the
> >> socification efforts awkward. Are MII and friends a busses (as in
> >> TYPE_BUS) in their own right, and connection of mac and phy has to
> >> happen on the board level?
> >
> > I see PHY and MAC split as advantageous because it allows code reuse and
> > better testing.  The main thing I'd like to see is PHY device tests
> > using tests/libqtest.h.
> >
> > If someone wants to implement it, great.  It would make it easier to add
> > more NIC models in the future.
> >
> > Regarding SOCification and busses, I'm not sure.  Is it okay to just say
> > a NIC has-a PHY (i.e. composition)?
> >
> 
> Generally speaking, in the (ARM) SoCification the MAC is part of the
> SoC which in the latest styling guidelines is a composite device. This
> composite is supposed to reflect the self contained SoC product which
> the PHY is usually not a part of. So we have two opposing compositions
> here:
> 
> NIC = MAC + PHY
> SOC = CPUs + MAC + ...
> 
> MAC can't be in both. So for SoCs the NIC concept needs to abandoned.
> After all the expansion of NIC as "Network Interface Card" is a little
> bit PCish. Your average SoC networking solution has no such "card".
> Just an on chip MAC (same pacakge/die as CPU etc) connecting to a PHY
> via PCB traces.
> 
> So I think long term, MII has to be a TYPE_BUS that is visible on the
> top level SoC device. Self contained NICs (as we know them today) are
> then also implementable as container devices (of MAC and PHY) that use
> this bus internally (in much the same way the SoC boards would attach
> external PHY to SoC).

Okay, that makes sense.  Given the amount of emulated hardware in QEMU
today, I think it would be okay to simply add new MAC/PHYs while still
supporting the NICs of old.  If someone is enthusiastic about
refactoring and testing existing NICs then great.  But I think it's more
pragmatic to simply start working with a split MAC/PHY where that is
beneficial.

Stefan

  reply	other threads:[~2014-01-06  6:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-02  9:18 [Qemu-devel] [PATCH 0/2] hw/arm: add ethernet support to Allwinner A10 Beniamino Galvani
2014-01-02  9:18 ` [Qemu-devel] [PATCH 1/2] hw/net: add support for Allwinner EMAC Fast Ethernet controller Beniamino Galvani
2014-01-02 10:25   ` Peter Crosthwaite
2014-01-02 14:58     ` Beniamino Galvani
2014-01-03  1:26       ` Peter Crosthwaite
2014-01-03 17:42         ` Beniamino Galvani
2014-01-06  3:27     ` Stefan Hajnoczi
2014-01-06  3:46       ` Peter Crosthwaite
2014-01-06  6:12         ` Stefan Hajnoczi [this message]
2014-01-10 21:48           ` Beniamino Galvani
2014-01-10 22:16             ` Peter Crosthwaite
2014-01-10 22:48           ` Peter Crosthwaite
2014-01-12 13:59             ` Edgar E. Iglesias
2014-01-12 22:00               ` Peter Crosthwaite
2014-01-13  4:00                 ` Stefan Hajnoczi
2014-01-04  0:56   ` Peter Crosthwaite
2014-01-04  9:36     ` Beniamino Galvani
2014-01-02  9:18 ` [Qemu-devel] [PATCH 2/2] hw/arm/allwinner-a10: initialize EMAC Beniamino Galvani
2014-01-02 10:20   ` Peter Crosthwaite
2014-01-02 10:21     ` Peter Crosthwaite
2014-01-02 17:19     ` Beniamino Galvani
2014-01-02 22:32       ` Peter Crosthwaite
2014-01-06  0:49   ` Li Guang
2014-01-06 13:56     ` Beniamino Galvani
2014-01-08  7:27       ` Li Guang
2014-01-08  8:14         ` Peter Crosthwaite

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=20140106061227.GA20766@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=b.galvani@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=lig.fnst@cn.fujitsu.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --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).