yongari [Sun, 23 Mar 2008 05:06:16 +0000 (05:06 +0000)]
VLAN hardware tag information should be set for all desciptors of a
multi-descriptor transmission attempt. Datasheet said nothing about
this requirements. This should fix a long-standing VLAN hardware
tagging issues with re(4).
yongari [Sun, 23 Mar 2008 04:59:13 +0000 (04:59 +0000)]
Always honor configured VLAN/checksum offload capabilities.
Previously re(4) used to blindly enable VLAN hardware tag stripping
and Rx checksum offload regardless of enabled optional features of
interface.
jeff [Sun, 23 Mar 2008 01:44:28 +0000 (01:44 +0000)]
- Only return 1 from sync_vnode() in cases where the vnode is still
at the head of the sync list. This prevents sched_sync() from
re-queueing a vnode which may have been freed already.
marcel [Sun, 23 Mar 2008 01:31:59 +0000 (01:31 +0000)]
Redefine G_PART_SCHEME_DECLARE() from populating a private linker set
to declaring a proper module. The module event handler is part of the
gpart core and will add the scheme to an internal list on module load
and will remove the scheme from the internal list on module unload.
This makes it possible to dynamically load and unload partitioning
schemes.
marcel [Sun, 23 Mar 2008 01:23:35 +0000 (01:23 +0000)]
Add g_retaste(), which given a class will present all non-open providers
to it for tasting. This is useful when the class, through means outside
the scope of GEOM, can claim providers previously unclaimed.
The g_retaste() function posts an event which is handled by the
g_retaste_event().
qingli [Sat, 22 Mar 2008 18:13:39 +0000 (18:13 +0000)]
Reuse the mbuf that was just retrieved from the receive ring if mbuf
exhaustion is encountered. There was a fix made previously for this
problem but the solution (breaking out of the receive loop) does not
seem to work. mbuf reuse strategy is already adopted by other drivers
such as if_bge. The problem was recreated and the patch is also
verified in the same test environment.
sam [Sat, 22 Mar 2008 16:55:51 +0000 (16:55 +0000)]
add hints to specify how NPE ports are mapped to MAC+PHY; these
could be commented out as they just duplicate the defaults that
are built into the code
sam [Sat, 22 Mar 2008 16:53:28 +0000 (16:53 +0000)]
Improve mac+phy configuration so that hints can be used to describe
layouts different than the defaults:
o hint.npe.0.mac="A", "B", etc. specifies the window for MAC register accesses
o hint.npe.0.mii="A", "B", etc. specifies PHY registers
o hint.npe.1.phy=%d specifies the PHY to map to a port
This allows devices like NSLU to be setup w/o code changes and will
also be used for forthcoming support for more Avila boards.
sam [Sat, 22 Mar 2008 16:24:02 +0000 (16:24 +0000)]
Defer state change on disassociate to avoid unnecessarily dropping the
lease: track the current bssid and if it changes (as reported in an
assoc/reassoc) event only then kick the state machine. This gives us
immediate response when roaming but otherwise causes us to fallback on
the normal state machine.
stefanf [Sat, 22 Mar 2008 14:06:01 +0000 (14:06 +0000)]
Reset the internal state used for the 'getopts' built-in when 'shift' or 'set'
are used to modify the arguments. Not doing so caused random memory reads or
null pointer dereferences when 'getopts' was called again later (SUSv3 says
getopts produces unspecified results in this case).
remko [Sat, 22 Mar 2008 12:50:43 +0000 (12:50 +0000)]
In route.c in newroute() there's a call to exit(0) if the command was
'get'. Since rtmsg() always gets called and returns 0 on success and -1
on failure, it's possible to exit with a suitable exit code by calling
exit(ret != 0) instead, as is done at the end of newroute().
jeff [Sat, 22 Mar 2008 09:15:16 +0000 (09:15 +0000)]
- Complete part of the unfinished bufobj work by consistently using
BO_LOCK/UNLOCK/MTX when manipulating the bufobj.
- Create a new lock in the bufobj to lock bufobj fields independently.
This leaves the vnode interlock as an 'identity' lock while the bufobj
is an io lock. The bufobj lock is ordered before the vnode interlock
and also before the mnt ilock.
- Exploit this new lock order to simplify softdep_check_suspend().
- A few sync related functions are marked with a new XXX to note that
we may not properly interlock against a non-zero bv_cnt when
attempting to sync all vnodes on a mountlist. I do not believe this
race is important. If I'm wrong this will make these locations easier
to find.
alfred [Sat, 22 Mar 2008 07:29:45 +0000 (07:29 +0000)]
Fix a race where timeout/untimeout could cause crashes for Giant locked
code.
The bug:
There exists a race condition for timeout/untimeout(9) due to the
way that the softclock thread dequeues timeouts.
The softclock thread sets the c_func and c_arg of the callout to
NULL while holding the callout lock but not Giant. It then drops
the callout lock and acquires Giant.
It is at this point where untimeout(9) on another cpu/thread could
be called.
Since c_arg and c_func are cleared, untimeout(9) does not touch the
callout and returns as if the callout is canceled.
The softclock then tries to acquire Giant and likely blocks due to
the other cpu/thread holding it.
The other cpu/thread then likely deallocates the backing store that
c_arg points to and finishes working and hence drops Giant.
Softclock resumes and acquires giant and calls the function with
the now free'd c_arg and we have corruption/crash.
The fix:
We need to track curr_callout even for timeout(9) (LOCAL_ALLOC)
callouts. We need to free the callout after the softclock processes
it to deal with the race here.
remko [Fri, 21 Mar 2008 20:16:25 +0000 (20:16 +0000)]
Replace reference from vinum.8 to gvinum.8, it was advised in the PR to
replace this with vinum.4, but that's the kernel interface manual, which
is not appropriate in my understanding. I think that gvinum is a suitable
replacement for this.
PR: docs/121938
Submitted by: "Federico" <federicogalvezdurand at yahoo dot com>
MFC after: 3 days
kib [Fri, 21 Mar 2008 12:38:44 +0000 (12:38 +0000)]
Reduce contention on the vnode interlock by not acquiring the BO_LOCK
around the check for the BV_BKGRDINPROG in the brelse() and bqrelse().
See the comment for the explanation why it is safe.
kib [Fri, 21 Mar 2008 12:33:00 +0000 (12:33 +0000)]
Reduce the acquisition of the vnode interlock in the ffs_read() and
ffs_extread() when setting the IN_ACCESS flag by checking whether the
IN_ACCESS is already set. The possible race there is admissible.
jeff [Fri, 21 Mar 2008 10:00:05 +0000 (10:00 +0000)]
- Reduce contention on the global bdonelock and bpinlock by using
a pool mutex to protect these sleep/wakeup/counter races. This
still is preferable to bloating each bio with a mtx.
jeff [Fri, 21 Mar 2008 08:23:25 +0000 (08:23 +0000)]
- Add a new td flag TDF_NEEDSUSPCHK that is set whenever a thread needs
to enter thread_suspend_check().
- Set TDF_ASTPENDING along with TDF_NEEDSUSPCHK so we can move the
thread_suspend_check() to ast() rather than userret().
- Check TDF_NEEDSUSPCHK in the sleepq_catch_signals() optimization so
that we don't miss a suspend request. If this is set use the
expensive signal path.
- Set NEEDSUSPCHK when creating a new thread in thr in case the
creating thread is due to be suspended as well but has not yet.
davidxu [Fri, 21 Mar 2008 02:31:55 +0000 (02:31 +0000)]
Resolve __error()'s PLT early so that it needs not to be resolved again,
otherwise rwlock is recursivly called when signal happens and the __error
was never resolved before.
jhb [Thu, 20 Mar 2008 21:53:27 +0000 (21:53 +0000)]
Explicitly use spinlock_enter/exit rather than locking the icu_lock spin
lock in the 8259A drivers as these drivers are only used on UP systems.
This slightly reduces the penalty of an SMP kernel (such as GENERIC) on
a UP x86 machine.
jhb [Thu, 20 Mar 2008 21:24:32 +0000 (21:24 +0000)]
Implement a BUS_BIND_INTR() method in the bus interface to bind an IRQ
resource to a CPU. The default method is to pass the request up to the
parent similar to BUS_CONFIG_INTR() so that all busses don't have to
explicitly implement bus_bind_intr. A bus_bind_intr(9) wrapper routine
similar to bus_setup/teardown_intr() is added for device drivers to use.
Unbinding an interrupt is done by binding it to NOCPU. The IRQ resource
must be allocated, but it can happen in any order with respect to
bus_setup_intr(). Currently it is only supported on amd64 and i386 via
nexus(4) methods that simply call the intr_bind() routine.
emaste [Thu, 20 Mar 2008 20:33:48 +0000 (20:33 +0000)]
Restore creation of passthrough devices with newer controller firmware by
putting the correct size in the fib header. Presumably the older firmware
silently ignored a bad size field.
(This change tested with a 3805 controller. Passthrough devices were
created when running firmware build 12814, but not 15323 or later. With
this change they're created for both old and new firmware versions.)
emaste [Thu, 20 Mar 2008 17:59:19 +0000 (17:59 +0000)]
Add ioctls FSACTL_SEND_LARGE_FIB, FSACTL_SEND_RAW_SRB,
FSACTL_LNX_SEND_LARGE_FIB, and FSACTL_LNX_SEND_RAW_SRB, and correct size
checks on FIBs passed in from userspace. Both changes were obtained from
Adaptec's driver build 15317. Adaptec's commandline RAID tool arcconf uses
these ioctls when creating a RAID-10 array (and probably other operations
too).
rdivacky [Thu, 20 Mar 2008 17:03:55 +0000 (17:03 +0000)]
o Add stub support for some new futex operations,
so the annoying message is not printed.
o Don't warn about FUTEX_FD not being implemented
and return ENOSYS instead of 0 (eg. success).
o Clear FUTEX_PRIVATE_FLAG as we actually implement
only private futexes so there is no reason to
return ENOSYS when app asks for a private futex.
We don't reject shared futexes because they worked
just fine with our implementation so far.
sam [Thu, 20 Mar 2008 16:19:25 +0000 (16:19 +0000)]
Workaround design botch in usb: blindly mixing bus_dma with PIO does not
work on architectures with a write-back cache as the PIO writes end up
in the cache which the sync(BUS_DMASYNC_POSTREAD) in usb_transfer_complete
then discards; compensate in the xfer methods that do PIO by pushing the
writes out of the cache before usb_transfer_complete is called.
kib [Thu, 20 Mar 2008 16:08:42 +0000 (16:08 +0000)]
Do not dereference cdev->si_cdevsw, use the dev_refthread() to properly
obtain the reference. In particular, this fixes the panic reported in
the PR. Remove the comments stating that this needs to be done.
sam [Thu, 20 Mar 2008 16:04:13 +0000 (16:04 +0000)]
Correct cache handling for xfer requests marked URQ_REQUEST: many (if not
all uses) involve a read but usbd_start_transfer only does a PREWRITE; change
this to BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE as I'm not sure if any
users do write+read.
remko [Thu, 20 Mar 2008 12:56:49 +0000 (12:56 +0000)]
Alert properly when we have stale mounts left after interupting
a tinybsd build. If we do not do this, we can accidentally remove
critical files from directories like /lib (if mounted).
PR: misc/121763
Submitted by: Richard Arends < richard at unixguru dot nl >
MFC after: 3 days
des [Thu, 20 Mar 2008 10:15:45 +0000 (10:15 +0000)]
"track" is a script I've used for ages to track the progress of a build.
Unlike whereintheworld, it continuously monitors the log file; it also
produses less verbose output.
jeff [Thu, 20 Mar 2008 05:51:16 +0000 (05:51 +0000)]
- Restore runq to manipulating threads directly by putting runq links and
rqindex back in struct thread.
- Compile kern_switch.c independently again and stop #include'ing it from
schedulers.
- Remove the ts_thread backpointers and convert most code to go from
struct thread to struct td_sched.
- Cleanup the ts_flags #define garbage that was causing us to sometimes
do things that expanded to td->td_sched->ts_thread->td_flags in 4BSD.
- Export the kern.sched sysctl node in sysctl.h
kmacy [Thu, 20 Mar 2008 05:35:02 +0000 (05:35 +0000)]
Don't re-initialize the interface if it is already running.
This one line change makes the following code found in many ethernet device drivers
(at least em, igb, ixgbe, and cxgb) gratuitous
case SIOCSIFADDR:
if (ifa->ifa_addr->sa_family == AF_INET) {
/*
* XXX
* Since resetting hardware takes a very long time
* and results in link renegotiation we only
* initialize the hardware only when it is absolutely
* required.
*/
ifp->if_flags |= IFF_UP;
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
EM_CORE_LOCK(adapter);
em_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
}
arp_ifinit(ifp, ifa);
} else
error = ether_ioctl(ifp, command, data);
break;
jeff [Thu, 20 Mar 2008 03:09:15 +0000 (03:09 +0000)]
- Remove the unused and redundant sched_newproc() function.
- Remove the unused and redundant sched_newthread() which peaks into scheduler
private structures.
jeff [Thu, 20 Mar 2008 03:07:57 +0000 (03:07 +0000)]
- There is no sense in calling sched_newthread() at thread_init() and
thread_fini(). The schedulers initialize themselves properly during
sched_fork_thread() anyhow. fini is only called when we're returning
the memory to the allocator which surely doesn't care what state the
memory is in.
jeff [Thu, 20 Mar 2008 03:06:33 +0000 (03:06 +0000)]
- ULE and 4BSD share only one line of code from sched_newthread() so implement
the required pieces in sched_fork_thread(). The td_sched pointer is already
setup by thread_init anyway.
jeff [Thu, 20 Mar 2008 02:14:02 +0000 (02:14 +0000)]
- Move maybe_preempt() from kern_switch.c to sched_4bsd.c. This is function
is only used by 4bsd.
- Create a new runq_choose_fuzz() function rather than polluting runq_choose()
with 4BSD specific code.
- Move the fuzz sysctl into sched_4bsd.c
- Remove some dead code from kern_switch.c
obrien [Wed, 19 Mar 2008 15:18:03 +0000 (15:18 +0000)]
+ Make it clear this was taken from the CVS 1.11 branch on 10-March-2008.
+ Depend on $CVSDIR/configure also - so things get properly remade if we tweak.
obrien [Wed, 19 Mar 2008 15:10:20 +0000 (15:10 +0000)]
Actually our rev 1.21(change default from "rsh" to "ssh") tweaking is
moving to gnu/usr.bin/cvs/lib/config.h.proto. So the rev 1.21 no longer
is applicable here.
obrien [Wed, 19 Mar 2008 15:06:50 +0000 (15:06 +0000)]
Merge rev 1.28 (CAN-2005-0753 / FreeBSD-SA-05:05.cvs fixes),
rev 1.27 ("iso8601" option keyword) revs 1.12/1.10/1.5/1.4 ($CVSHeader$
support) rev 1.2 ($CVS_LOCAL_BRANCH_NUM support for local commit
feature of cvsup) into version 1.11-20080310.
obrien [Wed, 19 Mar 2008 15:05:27 +0000 (15:05 +0000)]
Merge rev 1.2 (extensions to the $CVSROOT/config syntax) and
rev 1.4 (1.12 CVSROOT/config keyword expansion forward compatability)
into version 1.11-20080310.
Note the vendor has also added some forward compatability support.
We should determine if we can live with just the vendor's method.
obrien [Wed, 19 Mar 2008 15:00:43 +0000 (15:00 +0000)]
Merge rev 1.25 ("iso8601" option keyword), rev 1.17 (environtmental var
"CVS_OPTIONS"), rev 1.14 ('-g' option to support shared-group access),
rev 1.7 ('-R' read-only repository mode), rev 1.6 (support for checking
out from a read-only repository), revs 1.4 & 1.5 ("tagexpand=")
into version 1.11-20080310. Note the vendor accepted my "blame" alias.
obrien [Wed, 19 Mar 2008 14:55:59 +0000 (14:55 +0000)]
Merge rev 1.3 (catch write-lock attempts immediately if running in
read-only mode) & rev 1.2 (check out from read-only repository support)
into version 1.11-20080310.
obrien [Wed, 19 Mar 2008 14:50:22 +0000 (14:50 +0000)]
Merge rev 1.21: change default from "rsh" to "ssh", rev 1.14: comprehensive
-T CVS/Template support, rev 1.9: new long flag that causes cvs to ignore
the CVSROOT/passwd file, rev 1.3: support for checking out from a read-only
repository, rev. 1.2: support for local $Id$ keyword into cvs 1.11-20080310.
obrien [Wed, 19 Mar 2008 14:49:14 +0000 (14:49 +0000)]
Merge rev 1.7: always upload new files, even if the timestamps match,
rev 1.2: fix a problem sometimes seen when doing checkouts from a local repo
and committing via remote cvs (a cvs -d override of the mismatched CVS/Root
files was missing) into cvs 1.11-20080310.
Note that rev 1.4 (default CVS_RSH to "ssh") will not be handled thru the
vendor's config.h.