From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: "Cureington, Tony" <tony.cureington@hp.com>
Cc: Andrew Morton <akpm@digeo.com>,
Pascal Brisset <pascal.brisset-ml@wanadoo.fr>,
bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com
Subject: Re: [Bonding-devel] Re: Bonding driver unreliable under high CPU load
Date: Tue, 17 Sep 2002 15:45:57 -0400 [thread overview]
Message-ID: <3D878675.3000403@mandrakesoft.com> (raw)
In-Reply-To: 72A87F7160C0994D8C5A36E2FDC227F502B3E70D@txnexc01.americas.cpqcorp.net
Cureington, Tony wrote:
> /* Yes, the mii is overlaid on the ifreq.ifr_ifru */
> mii = (struct mii_ioctl_data *)&ifr.ifr_data;
> if (ioctl(dev, &ifr, SIOCGMIIPHY) != 0) {
> return MII_LINK_READY; /* can't tell */
> }
>
> mii->reg_num = 1;
> if (ioctl(dev, &ifr, SIOCGMIIREG) == 0) {
> /*
> * mii->val_out contains MII reg 1, BMSR
> * 0x0004 means link established
> */
> return mii->val_out;
> }
Speaking of bonding, I wonder about the above code -- why do you return
mii->val_out directly? AFAICS you should test BMSR_LSTATUS (a.k.a.
0x0004) and return MII_LINK_READY or zero -- not a bunch of random bits.
The status word can certainly be non-zero even when link is absent.
Also, a further question: do you have access to the slave struct
net_device? If so, just test netif_carrier_ok(slave_dev) and avoid all
that ioctl calling if it returns non-zero.
Jeff
next prev parent reply other threads:[~2002-09-17 19:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-17 19:28 [Bonding-devel] Re: Bonding driver unreliable under high CPU load Cureington, Tony
2002-09-17 19:45 ` Jeff Garzik [this message]
2002-09-17 19:53 ` [Bonding-devel] Re: Bonding driver unreliable under high CPUload Andrew Morton
2002-09-17 19:58 ` Chad N. Tindel
2002-09-17 20:07 ` Jeff Garzik
2002-09-17 20:11 ` Chad N. Tindel
2002-09-17 20:23 ` Jeff Garzik
2002-09-17 20:11 ` Jeff Garzik
2002-09-17 20:24 ` Andrew Morton
2002-09-17 20:30 ` Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2002-09-17 19:46 [Bonding-devel] Re: Bonding driver unreliable under high CPU load Jay Vosburgh
2002-09-17 20:01 Jay Vosburgh
2002-09-17 20:15 ` Jeff Garzik
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=3D878675.3000403@mandrakesoft.com \
--to=jgarzik@mandrakesoft.com \
--cc=akpm@digeo.com \
--cc=bonding-devel@lists.sourceforge.net \
--cc=netdev@oss.sgi.com \
--cc=pascal.brisset-ml@wanadoo.fr \
--cc=tony.cureington@hp.com \
/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 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.