Date: Fri, 1 Dec 2006 16:52:31 +0000 (GMT) From: wpaul@FreeBSD.ORG (Bill Paul) To: ed@fxq.nl (Ed Schouten) Cc: pyunyh@gmail.com, stable@freebsd.org, net@freebsd.org Subject: Re: re(4) needs promisc to work properly Message-ID: <20061201165231.4089216A416@hub.freebsd.org> In-Reply-To: <20061201161131.GD16100@hoeg.nl> from Ed Schouten at "Dec 1, 2006 05:11:31 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
> Hello Bill, > > * Bill Paul <wpaul@FreeBSD.ORG> wrote: > > > - Switching from and to promiscuous mode takes 7 seconds. All packets > > > are dropped in the mean time. > > > > The SIOCSIFFLAGS handler in re_ioctl() currently just takes a shortcut > > of calling re_init(). While this does eventually end up changing the RX > > filter settings accordingly, it takes a while because re_init() also shuts > > down and re-initializes the whole chip (including resetting the link). > > > > This is relatively easy to fix though. The IFF_PROMISC flag can be > > singled out and handled separately. (A few other drivers already do this.) > > I wrote a small patch that moves all rxcfg code in re_init_locked() to a > separate function. This way, we can just call that function instead of > re_init_locked when reaching SIOCSIFFLAGS. I tested it by reverting your > patch and ping6'ing the box. When I run tcpdump, the box doesn't freeze > and enters promiscuous mode (suddenly the ping6 starts to work then). > > What do you think about this patch? I'm a little concerned about the fact that now SIOCSIFFLAGS can never cause re_init_locked() to be called. There are some cases where it does need to be called (like when the IFF_UP flag is first set to turn the interface on). I usually do it like in the vge(4) driver: if it's just the IFF_PROMISC bit that's being toggled, then I only toggle the promisc mode bit in the RX config register. -Bill
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061201165231.4089216A416>