[ipxe-devel] [gPXE-devel] [PATCH][forcedeth] Exit poll() as early as possible if no work to do

Thomas Miletich thomas.miletich at gmail.com
Thu Nov 11 21:51:09 UTC 2010

On Thu, Nov 11, 2010 at 10:31 PM, Michael Brown <mbrown at fensystems.co.uk> wrote:
> On Thursday 11 Nov 2010 21:15:35 Thomas Miletich wrote:
>> I got my hands on an old nforce mainboard with a 10de:0066 forcedeth
>> LoM today. Chainloading pxelinux from gPXE and loading linux over tftp
>> was very slow(around 0.25-0.5MByte/s).
>> While trying to find the cause I made the following change. It
>> resolves the problem for me; transfers are back at ~10MByte/sec in my
>> 100MBit test setup now.
>> I think the if () should be placed where it is now, so we exit ASAP in
>> poll(). Anyway, I don't understand why this resolved the speed issue I
>> was seeing. If anyone has any ideas, please let me know.
> Question: does this affect the ability to autonegotiate?  The code block
>     /* Link change interrupt occured. Call always if link is down,
>      * to give auto-neg a chance to finish */
>     if ( ( status & NVREG_IRQ_LINK ) || ! ( netdev_link_ok ( netdev ) ) )
>          forcedeth_link_status ( netdev );
> suggests that we don't see an NVREG_IRQ_LINK interrupt status while the link
> is down, and your patch would cause forcedeth_poll() to exit before testing
> netdev_link_ok().
> forcedeth_link_status() gets called explicitly in probe().  I would therefore
> expect that with your patch we may work only if the link is up at the time
> probe() is called.
> Could you try starting iPXE+your patch with the link down (e.g. cable
> unplugged), open the net device, plug in the cable, and see if ifstat reports
> link-up?

Nice catch! However, ifstat doesn't show the link as up, neither with
nor without the patch if I just sit there and wait for it to come up.
It does however come up if I do something like 'dhcp net0', even with
the patch applied.

Line 775 in forcedeth_open() suggests it's doing some auto-neg related work:

ret = nv_update_linkspeed ( priv );

So I opened the interface('ifopen net0') and plugged the cable in.
ifstats shows the link as up as soon as I plug the cable in, even with
the patch applied.

Please keep in mind that this card is listed as 'nforce2', the 2nd PCI
ID in the linux and [g|i]PXE drivers, which suggests it's one of the
very first chip revisions. I assume this card variant hasn't gotten
much, if any, testing since the driver update in July. This could very
well only apply to a few card variants.


> Thanks,
> Michael

More information about the ipxe-devel mailing list