qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 00/16] Add a -netdev option


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH 00/16] Add a -netdev option
Date: Fri, 09 Oct 2009 19:33:34 +0200
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)

Edgar E. Iglesias schrieb:
> On Thu, Oct 08, 2009 at 04:37:41PM -0500, Anthony Liguori wrote:
>   
>> Stefan Weil wrote:
>>     
>>> Hi Mark,
>>>
>>> today, qemu's ethernet devices are a fixed combination of
>>> MAC (Media Access Controller) and PHY (Physical Layer).
>>>
>>> Real hardware is different: the controllers provide a MAC,
>>> and many provide a PHY, too, but all controllers allow
>>> one or even several external PHY(s).
>>>
>>> Most (or all?) controllers use the same standard interface
>>> to address their PHY (internal or external), something
>>> which is completely missing today in qemu.
>>>
>>> A better solution would use separate code for MAC and
>>> PHY, so the controllers could share common code for the
>>> PHY.
>>>
>>> Configuration of a different PHY should be possible,
>>> so users can run a system emulation of different
>>> MAC-PHY combinations.
>>>
>>> In addition to the PHY type, a PHY needs attributes
>>> (link speed and link status).
>>>   
>>>       
>> But PHY doesn't really exist in the context of QEMU because virtualizing 
>> at the ethernet level.
>>     
>
> I think PHY's exist, at least with pure emulation.
>
> Regarding the MII path I think you are right. But many if not most ethernet
> controllers expose a way for software to directly communicate with PHY's
> over MDIO. And software drivers usually read/write PHY registers to
> check/change PHY related settings (speed, link status, duplex settings etc).
>
> etraxfs_eth.c has a small dummy model of a PHY at the MDIO level. Enough to
> fool software to think that's there is a one. Off-tree I've got at least 2
> more controllers with emulated PHY's that are needed to please guest
> software.
>
> Cheers

All other controllers do it the same way as etraxfs_eth.c.
And yes, most operating systems do read/write PHY registers.

PHY emulation needs code for the device model, and for
configuration (PHY type, link status (online / offline),
link speed (10, 100, 1000 Mbps), link type (half duplex,
full duplex). There is a 1:n relationship between MAC and PHY.

Maybe the link status is needed for the core packet handling,
too.

Cheers,
Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]