From: Ben Greear <greearb@candelatech.com>
To: "Feldman, Scott" <scott.feldman@intel.com>,
"'netdev@oss.sgi.com'" <netdev@oss.sgi.com>
Subject: Re: Problems with e1000 in 2.4.23
Date: Sun, 30 Nov 2003 21:39:48 -0800 [thread overview]
Message-ID: <3FCAD424.70103@candelatech.com> (raw)
In-Reply-To: <C6F5CF431189FA4CBAEC9E7DD5441E0102CBDD09@orsmsx402.jf.intel.com>
Feldman, Scott wrote:
>>Could the problem happen because I do the set-multi even if
>>the NIC is down? Is there enough locking in the
>>e1000_ethtool additions?
>
>
> Change ETHTOOL_SETRXALL to work more like ETHTOOL_SRXCSUM, with the
> check for netif_running and down/up or reset.
The set_multi is called from net/core/dev.c (or near-abouts) when
the promisc changes, and I'm quite sure that does not require the
NIC to be bounced.
So, if I really have to bounce the NIC to change the 'rx-all' flags,
then I'll have to move that code path out of the 'set-multi' method
and have it be a stand-alone method.
Or, is the problem just that I should NOT be twiddling any bits when
the NIC is down? Unless I'm confused, the only lock acquired when
changing PROMISC (which on e100 at least used to flush a bunch of the
rx-all flags, even though the receive logic threw them away later)
is the tx-lock.
For instance, would this perhaps be a better method:
static int e1000_ethtool_setrxall(struct net_device *netdev, uint32_t val) {
unsigned short old_flags = netdev->priv_flags;
if (val) {
netdev->priv_flags |= IFF_ACCEPT_ALL_FRAMES;
}
else {
netdev->priv_flags &= ~(IFF_ACCEPT_ALL_FRAMES);
}
/* printk("e1000_ethtool_setrxall (%s) val: %d\n",
netdev->name, val); */
if (old_flags != netdev->priv_flags) {
spin_lock_bh(&netdev->xmit_lock);
if (netif_running(netdev)) {
/*printk("Kicking e1000 for setrxall..\n");*/
e1000_set_multi(netdev);
} else {
/* Value will be flushed into the hardware when the device is
* brought up.
*/
}
spin_unlock_bh(&netdev->xmit_lock);
}
return 0;
}
...
case ETHTOOL_SETRXALL: {
struct ethtool_value id;
if (copy_from_user(&id, addr, sizeof(id)))
return -EFAULT;
e1000_ethtool_setrxall(netdev, id.data);
return 0;
}
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2003-12-01 5:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-01 4:06 Problems with e1000 in 2.4.23 Feldman, Scott
2003-12-01 5:39 ` Ben Greear [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-12-01 2:19 Feldman, Scott
2003-12-01 2:51 ` Ben Greear
2003-12-01 8:06 ` David S. Miller
2003-12-01 17:26 ` Ben Greear
2003-11-30 7:08 Ben Greear
2003-11-30 8:35 ` Ben Greear
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=3FCAD424.70103@candelatech.com \
--to=greearb@candelatech.com \
--cc=netdev@oss.sgi.com \
--cc=scott.feldman@intel.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.