Andre Oppermann [Mon, 26 Sep 2005 20:25:16 +0000 (20:25 +0000)]
Implement IP_DONTFRAG IP socket option enabling the Don't Fragment
flag on IP packets. Currently this option is only repected on udp
and raw ip sockets. On tcp sockets the DF flag is controlled by the
path MTU discovery option.
Sending a packet larger than the MTU size of the egress interface
returns an EMSGSIZE error.
John Baldwin [Mon, 26 Sep 2005 18:42:27 +0000 (18:42 +0000)]
Small fixes to sis(4):
- Remove sis_unit and use device_printf() and if_printf() instead.
- Use callout_init_mtx() for the callout.
- Remove spls.
- Fix locking for ifmedia to happen in the ifmedia handlers rather than in
sis_ioctl().
- Log an error message if we fail to allocate any resources. Perform
cleanup if we fail to allocate any resources so that we don't leave
a mutex hanging around.
Tested by: Jason Tsai jason dot tsai at newcyberian dot com (1-4)
MFC after: 3 days
Warner Losh [Mon, 26 Sep 2005 18:27:13 +0000 (18:27 +0000)]
Emit a warning when a card matches multiple entries in our table. A
number of cards have been discovered to be matching on the strings of
the cis rather than manufacturer/product id for cards we already had a
prod id for. This is a result of getting the list from the NetBSD
driver which also includes the OID for the cards where such a
distinction mattered (since it was tested against the MAC address we
got from the card). Since we do not try to match OIDs, we do not need
the extra entries and they just waste space.
I'm guessing that some of the dlink entires (DE-660, DE-660+) and many
of the corega cards may fall into this boat and can safely be removed.
Warner Losh [Mon, 26 Sep 2005 18:22:24 +0000 (18:22 +0000)]
Go ahead and detach our children in our detach routine. I'm undecided
if we should delete them also or not, but have decided not to do so
for the moment.
Robert Watson [Mon, 26 Sep 2005 16:55:11 +0000 (16:55 +0000)]
Add "show allpcpu" to DDB, which prints the current CPU id followed by
the per-cpu data for all CPUs. This is easier to ask users to do than
"figure out how many CPUs you have, now run show pcpu, then run it
once for each CPU you have".
Robert Watson [Mon, 26 Sep 2005 08:02:24 +0000 (08:02 +0000)]
Acquire Giant in uprintf() and tprintf() rather than asserting it. In
the vast majority of cases, these functions are called without mutexes
held, meaning that in all but two cases, there will be no ordering
issues with doing this, and it will eliminate the need for changes in
the caller. In two cases, mutexes are held, so Giant must be acquired
before those mutexes such that uprintf() and tprintf() recurse Giant
rather than generating a lock order reversal.
Warner Losh [Sun, 25 Sep 2005 21:29:32 +0000 (21:29 +0000)]
Remove the kernel portion of OLDCARD. I'm working on a replacement
for pccardc dumpcis, but until I'm done with that, I'm leaving pccardc
in place. As such, I'm leaving the .h files in place for the moment.
Robert Watson [Sun, 25 Sep 2005 19:52:09 +0000 (19:52 +0000)]
Lock the read socket receive buffer when frobbing the sb_state flag on
that socket during open, not the write socket receive buffer. This
might explain clearing of the sb_state SB_LOCK flag seen occasionally
in soreceive() on fifos.
Scott Long [Sun, 25 Sep 2005 17:12:41 +0000 (17:12 +0000)]
Overhaul error handling in the IPS driver. Don't use a magic value for
driver-induced errors, instead be better about propagating error status
upwards. Add more error definitions, courtesy of the linux driver. Fix
a command leak in the ioctl handler. Re-arrange some of the command handlers
to localize error handling.
Implement new world order in VFS locking for extended attributes. This will
remove the unconditional acquisition of Giant for extended attribute related
operations. If the file system is set as being MP safe and debug.mpsafevfs is
1, do not pickup Giant.
Mark the following system calls as being MP safe so we no longer pickup Giant
in the system call handler:
o extattrctl
o extattr_set_file
o extattr_get_file
o extattr_delete_file
o extattr_set_fd
o extattr_get_fd
o extattr_delete_fd
o extattr_set_link
o extattr_get_link
o extattr_delete_link
o extattr_list_file
o extattr_list_link
o extattr_list_fd
-Pass MPSAFE flags to namei(9) lookup and introduce vfslocked variable which
will keep track of any Giant acquisitions.
-Wrap any fd operations which manipulate vnodes in VFS_{UN}LOCK_GIANT
-Drop VFS_ASSERT_GIANT into function which operate on vnodes to ensure that
we are sufficiently protected.
I've tested these changes with various TrustedBSD MAC policies which use
extended attribute a lot on SMP and UP systems (thanks to Scott Long for
making some SMP hardware available to me for testing).
Split struct resource in an external and internal part.
The external part is still called 'struct resource' but the contents
is now visible to drivers etc. This makes it part of the device
driver ABI so it not be changed lightly. A comment to this effect
is in place.
The internal part is called 'struct resource_i' and contain its external
counterpart as one field.
Move the bus_space tag+handle into the external struct resource, this
removes the need for device drivers to even know about these fields
in order to use bus_space to access hardware. (More in following commit).
Add two convenience functions for device drivers: bus_alloc_resources()
and bus_free_resources(). These functions take a list of resources
and handle them all in one go. A flag makes it possible to mark
a resource as optional.
A typical device driver can save 10-30 lines of code by using these.
Warner Losh [Sat, 24 Sep 2005 17:36:43 +0000 (17:36 +0000)]
I have confirmed with my Epson EEN10B that it needs to look at the
attribute memory at 0xff0 to find its MAC address. This is another
instance of the IBM ethercard II from all apperances (short of popping
the lid). Update the entry to document which cards we support
actually need this functionality.
Try to avoid crashes during kernel startup by limiting the # of EISA
slots to probe. Problems have been reported in this area, lets hope this
bandaid helps.
!! Owners of EISA-equipped Alpha machines are requested to at least
!! boot-test a 6-BETA build and report back to the Alpha list. Thanks!
This part of the struct isn't needed on FreeBSD:
---snip---
FYI this bit isn't needed for FreeBSD - I think it came from either
OpenBSD or NetBSD where arc4random() wasn't available during cold
boot.
---snip---
Make it possible to set the NANO_TOOLS variable to a directory outside
of $NANO_SRC, which can e.g. be used if the nanobsd scripts are not in
the source tree being built.
Brian Somers [Sat, 24 Sep 2005 01:19:53 +0000 (01:19 +0000)]
Modify the code path of the ifdef NOTYET part of _kse_single_thread():
o Don't reinitialise the atfork() handler list in the child. We
are meant to call the child handler, and on subsequent fork()s
should call all three functions as normal.
o Don't reinitialise the thread specific keyed data in the
child after a fork. Applications may require this for context.
o Reinitialise curthread->tlflags after removing ourselves from
(and reinitialising) the various internal thread lists.
o Reinitialise __malloc_lock in the child after fork() (to balance
our explicitly taking the lock prior to the fork()).
With these changes, it is possible to enable the NOTYET code in
thr_kern.c to allow the use of non-async-safe functions after
fork()ing from a threaded program.
Reviewed by: Daniel Eischen <deischen@freebsd.org>
[_malloc_lock reinitialisation has since been moved to avoid polluting the
!NOTYET code]
Add '-q' option, which (when used with '-m' option) just tells if the given
module is loaded or compiled into the kernel.
This is useful mostly in startup scripts, when module should be loaded only
if it wasn't compiled into the kernel nor already loaded, eg.:
Xin LI [Fri, 23 Sep 2005 20:49:57 +0000 (20:49 +0000)]
Restore a historical ufs_inactive behavior that has been changed
in rev. 1.40 of ufs_inode.c, which allows an inode being truncated
even when the filesystem itself is marked RDONLY. A subsequent
call of UFS_TRUNCATE (ffs_truncate) would panic the system as it
asserts that it can only be called when the filesystem is mounted
read-write (same changeset, rev. 1.74 of sys/ufs/ffs/ffs_inode.c).
Because ffs_mount() already takes care of sync'ing the filesystem
to disk before being downgraded to readonly, it appears to be more
desirable that we should not permit this sort of writes to disk.
This change would fix a panic that occours when read-only mounted
a corrupted filesystem and doing some file operations.
If we're not installing OpenSSH in the base, don't install its startup
file either. This clears the way for third-party SSH ports to install
an RCng startup script.
Robert Watson [Fri, 23 Sep 2005 12:39:51 +0000 (12:39 +0000)]
For reasons of consistency (and necessity), assert an exclusive vnode
lock on the fifo vnode in fifo_open(): we rely on the vnode lock to
serialize access to v_fifoinfo.
Stephan Uphoff [Thu, 22 Sep 2005 15:34:15 +0000 (15:34 +0000)]
Don't pretend to be thread0 when calling sync().
It confuses the lock manager since in some places thread0 is
then used for vnode locking while curthread is used for vnode unlocking.
Found by: Yahoo!
Reviewed by: ps@,jhb@
MFC after: 3 days
Ruslan Ermilov [Thu, 22 Sep 2005 15:14:13 +0000 (15:14 +0000)]
Cause all flags passed by boot2 to set the respective loader(8)
boot_* variable. The end effect is that all flags from boot2
are now passed to the kernel.
Since special interface types get their own subsections
(not in mdoc(7) sense yet) in ifconfig(8) manpage, create such
subsections for gif(4) and vlan(4) so that their specific
options are not mixed up with general options.
Robert Watson [Thu, 22 Sep 2005 10:51:12 +0000 (10:51 +0000)]
Add fi_sx, an sx lock to serialize I/O operations on the socket pair
underlying the POSIX fifo implementation. In 6.x/7.x, fifo access is
moved from the VFS layer, where it was serialized using the vnode
lock, to the file descriptor layer, where access is protected by a
reference count but not serialized. This exposed socket buffer
locking to high levels of parallelism in specific fifo workloads, such
as make -j 32, which expose as yet unresolved socket buffer bugs.
fi_sx re-adds serialization about the read and write routines,
although not paths that simply test socket buffer mbuf queue state,
such as the poll and kqueue methods. This restores the extra locking
cost previously present in some cases, but is an effective workaround
for the instability that has been experienced. This workaround should
be removed once the bug in socket buffer handling has been fixed.
Reported by: kris, jhb, Julien Gabel <jpeg at thilelli dot net>,
Peter Holm <peter at holm dot cc>, others
MFC after: 3 days
Use the AHC_DISABLE_PCI_PERR flag to silence parity error reporting on
chips where setting the FAILDIS bit is not effective. While here,
try again to make it clear that reported parity errors indicate
a failure of some PCI device *other than* the aic7xxx controller.
Correct bug that caused the completed "recovery" scb to have its
timer reset rather than the timer of an SCB still pending on the
controller after recovery completed. This should correct timeout
loops seen in the field.
Remove the OPTIONS section, since it only documents FE_DEBUG and wrongly
so. If the full list of fe(4) options is documented we can revive the
entire section.