marius [Wed, 11 Jun 2008 19:49:10 +0000 (19:49 +0000)]
MFC: r178470
o Disable HMEDEBUG by default.
o Add CTASSERTs ensuring that HME_NRXDESC and HME_NTXDESC are set to
legal values.
o Use appropriate maxsize, nsegments and maxsegsize parameters when
creating DMA tags and correct some comments related to them.
o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite
some time now so collapse calls accordingly.
o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in
hme_rint() and hme_start_locked().
o Keep state of the link state and use it to enable or disable the MAC
in hme_mii_statchg() accordingly as well as to return early from
hme_start_locked() in case the link is down.
o Introduce a sc_flags and use it to replace individual members like
sc_pci.
o Add bus_barrier(9) calls to hme_mac_bitflip(), hme_mii_readreg(),
hme_mii_writereg() and hme_stop() to ensure the respective bit
has been written before we starting polling on it and for the right
bits to change.
o Rather just returning in case hme_mac_bitflip() fails and leaving us
in an undefined state report the problem and move on; chances are
the requested configuration will become active shortly after.
o Don't call hme_start_locked() in hme_init_locked() unconditionally
but only after calls to hme_init_locked() when it's appropriate, i.e.
in hme_watchdog().
o Add a KASSERT which asserts nsegs is valid also to hme_load_txmbuf().
o In hme_load_txmbuf():
- use a maximum of the newly introduced HME_NTXSEGS segments instead
of the incorrect HME_NTXQ, which reflects the maximum TX queue
length, for loading the mbufs and put the DMA segments back onto
the stack instead of the softc as 16 should be ok there.
- use the common errno(2) return values instead of homegrown ones,
- given that hme_load_txmbuf() is allowed to fail resulting in a
packet drop for quite some time now implement the functionality of
hme_txcksum() by means of m_pullup(9), which de-obfuscates the code
and allows to always retrieve the correct length of the IP header, [1]
- also add a KASSERT which asserts nsegs is valid,
- take advantage of m_collapse(9) instead of m_defrag(9) for
performance reasons.
o Don't bother to check whether the interface is running or whether its
queue is empty before calling hme_start_locked() in hme_tint(), the
former will check these anyway.
o In hme_intr() call hme_rint() before hme_tint() as gem_tint() may
take quite a while to return when it calls hme_start_locked().
o Get rid of sc_debug and just check if_flags for IFF_DEBUG directly.
o Add a shadow sc_ifflags so we don't reset the chip when unnecessary.
o Handle IFF_ALLMULTI correctly. [2]
o Use PCIR_BAR instead of a homegrown macro.
o Replace sc_enaddr[6] with sc_enaddr[ETHER_ADDR_LEN].
o Use the maximum of 256 TX descriptors for better performance as using
all of them has no additional static cost rather than using just half
of them.
dwmalone [Mon, 9 Jun 2008 07:53:16 +0000 (07:53 +0000)]
MFC: Sync restore with the version in -current.
Fix remaining nits from PR bin/39905.
Check for write failure while building temp files.
Correctly set file group when restore is run by a user other than root.
Use safer string handling.
Fixes the "getfile: lost data" panic when restoring older dumps.
Fix spurious "Header with wrong dumpdate" message.
Add -D for degraded mode, which tries harder to read corrupted backups.
Remove a diagnostic message from man page that is no longer printed.
thompsa [Fri, 6 Jun 2008 21:57:28 +0000 (21:57 +0000)]
MFC r174749, r175396, r175419, r175432
- Simplify the error handling
- Nuke licence clause 3 & 4
- Drop frames to any of the reserved multicast addresses
- Remove duplicated code for testing local packets.
dougb [Tue, 3 Jun 2008 21:26:37 +0000 (21:26 +0000)]
This file should define HAVE_MEMMOVE and HAVE_MEMCHR, but for some
reason configure did not pick it up. Add them here in the same way
that it's done when running configure for the port. All of the
other generated files are functionally equivalent to how they
look when generated by the port.
jhb [Tue, 3 Jun 2008 18:51:53 +0000 (18:51 +0000)]
Restore the global cp_time[] array that was removed when the per-CPU stats
were MFC'd. This restores the ABI and allows some tools like vmstat to
work on crash dumps again.
dougb [Tue, 3 Jun 2008 05:38:10 +0000 (05:38 +0000)]
Update to version 9.3.5. It contains the latest bug fixes, updates
to root server addresses, and a fix for the vulnerability mentioned
here: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0122
Users of BIND 9.3.x are strongly encouraged to upgrade to this
version. Also, the 9.3.x branch is now in maintenance-only mode.
Users are encouraged to investigate BIND 9.4.x or perhaps 9.5.x.
dougb [Mon, 2 Jun 2008 20:54:45 +0000 (20:54 +0000)]
Add proper mime-types for files that they are relevant for.
This is useful for things like *.pdf files that svn needs
to know about, and will probably be useful down the road
for other things.
- Remove unused members related to bus addresses in struct sym_hcb.
- sym(4) takes care of allocating an instance of struct sym_hcb
itself so don't let newbus allocate it as an unused softc also.
- Const'ify firmware and lookup-tables.
- Obsolete redundant inst_name and unit members of struct sym_hcb.
- Fix three more NULL vs. 0 confusions.
- Use device_set_softc(9) to tell the bus layer that this driver
allocates a instance of struct sym_hcb itself.
marius [Fri, 30 May 2008 19:59:38 +0000 (19:59 +0000)]
MFC: 1.56; 1.57; 1.58; 1.63; 1.66; 1.68
- Fix -Wundef.
- FreeBSD has had endian conversion macros for a long time. Axe the custom
macros in this driver.
- Fix typo in comment.
- Fix various compilation warnings for gcc-4.2.
- Use NULL instead of 0 for pointers.
- Remove superfluous returns in functions returning void.
- In sym_alloc_lcb_tags() return directly instead of jumping
to a label which just returns.
- Fix some spelling in comments.
- Remove trailing whitespace.
emax [Fri, 30 May 2008 00:42:50 +0000 (00:42 +0000)]
MFC:
Bluetooth SIG is being difficult and keep moving specification
documents away from being public accessible. Replace link to
the Bluetooth specification document with the document name.
Pointed out by: SoftLover < slserg at uic dot tula dot ru >
antoine [Tue, 27 May 2008 18:33:17 +0000 (18:33 +0000)]
MFC to RELENG_6:
Move "1000baseT" from IFM_SUBTYPE_ETHERNET_DESCRIPTIONS to
IFM_SUBTYPE_ETHERNET_ALIASES: there is already "1000baseTX" in
IFM_SUBTYPE_ETHERNET_DESCRIPTIONS. This doesn't change ifconfig
behaviour.
mckusick [Fri, 23 May 2008 18:08:32 +0000 (18:08 +0000)]
MFC of an update to the dump program to save extended attributes
and an update to the restore program to restore all dumped extended
attributes. The affected files and the version being MFC'ed:
Note that this code will not compile until these header
files have been updated: <protocols/dumprestore.h> and
<sys/extattr.h>. This should happen in the course of doing
a normal `buildworld'.
dwmalone [Tue, 20 May 2008 11:32:03 +0000 (11:32 +0000)]
MFC:
Dummynet has a limit of 100 slots queue size (or 1MB, if you give
the limit in bytes) hard coded into both the kernel and userland.
Make both these limits a sysctl, so it is easy to change the limit.
dwmalone [Tue, 20 May 2008 11:17:51 +0000 (11:17 +0000)]
MFC:
If we are walking the IPv6 header chain and we hit an IPPROTO_NONE
header, then don't try to pullup anything, because there is no next
header if we hit IPPROTO_NONE. Set ulp to a non-NULL value so the
search for an upper layer header terinates.
philip [Tue, 20 May 2008 10:53:58 +0000 (10:53 +0000)]
MFC: moused.c rev 1.84
moused.8 rev 1.62
Improve the virtual scrolling mechanism to make middle clicking less
difficult. Add a -L option (yet another option, indeed!) which changes
the speed of scrolling and change -U to only affect the scroll threshold.
This should make middle-clicking a much more pleasant experience.
dwmalone [Tue, 20 May 2008 10:51:27 +0000 (10:51 +0000)]
Sync with -current:
- ability to traceroute with packets with no upper layer header.
- clean __P use.
- place each router entry on its own line.
- get ipsec.h from netipsec directory.
- Use the name returned by device_get_nameunit(9) for the name of the
counter-timer timecounter so the associated SYSCTL nodes don't clash on
machines having multiple U2P and U2S bridges as well as establishing a
clear mapping between these bridges and their timecounter device.
- Don't bother setting up a "nice" name for the IOMMU, just use the name
returned by device_get_nameunit(9), too.
- Correct a typo in sbus_alloc_resource() which caused (pass-through)
allocations to only work down to the grandchildren of the bus, which
wasn't a real problem so far as we don't support any devices which are
great-grandchildren or greater of a U2S bridge, yet.
- Fix some minor style(9) bugs.
- Use __FBSDID in counter.c and iommu.c.
emax [Mon, 19 May 2008 16:46:42 +0000 (16:46 +0000)]
MFC:
Make -t <tty> optional in server mode. If not specified use stdin/stdout.
Document this. Do not require channel number in server mode. If not
specified - bind to ''wildcard'' channel zero. Real channel number will
be obtained automatically and registered with local sdpd(8). While I'm
here fix serial port service registration.
Submitted by: luigi
Tested by: Helge Oldach <freebsd-bluetooth at oldach dot net>
kib [Mon, 19 May 2008 11:50:48 +0000 (11:50 +0000)]
MFC
rev. 1.15 of lib/libc/gen/readdir.c
rev. 1.11 of lib/libc/gen/telldir.c
rev. 1.3 of lib/libc/gen/telldir.h
Do not read away the target directory entry when encountering deleted
files after a seekdir().
The seekdir shall set the position for the next readdir operation.
When the _readdir_unlocked() encounters deleted entry, dd_loc is
already advanced. Continuing the loop leads to premature read of
the target entry.
Submitted by: Marc Balmer <mbalmer at openbsd org>
Obtained from: OpenBSD
flz [Mon, 19 May 2008 09:21:24 +0000 (09:21 +0000)]
MFC: Don't require a configuration file. Ntpd will be perfectly happy if there's
none or if the file doesn't exist (there's no ntp.conf in the base install).
kib [Sat, 17 May 2008 12:46:24 +0000 (12:46 +0000)]
MFC the MPSAFE quotas.
kern/vfs_syscalls.c rev. 1.433:
Busy filesystem around call of VFS_QUOTACTL() vfs op.
ufs/ffs/ffs_softdep.c remaining parts of the rev. 1.206 after 1.181.2.24:
Replace unconditional acquision of Giant when QUOTAS are defined with
VFS_LOCK_GIANT(NULL) call.
ufs/ffs/ffs_vfsops.c rev. 1.327, 1.328
rev. 1.327: Implement fine-grained locking for UFS quotas.
rev. 1.328: Mark UFS as being MP-Safe in "options QUOTA" case too.
ufs/ufs/quota.h remaining parts of the rev. 1.30 after 1.27.2.3:
Implement fine-grained locking for UFS quotas.
ufs/ufs/ufs_lookup.c rev. 1.83:
Call getinoquota() before allocating new block for the directory to properly
account for block allocation.
ufs/ufs/ufs_quota.c rev. 1.93:
Implement fine-grained locking for UFS quotas.
ufs/ufs/ufs_vnops.c rev. 1.289:
Remove unneeded getinoquota() call in the ufs_access().
mav [Sat, 17 May 2008 08:45:58 +0000 (08:45 +0000)]
MFC rev. 1.158
Use separate UMA zone for data items allocation. It is a partial
rev. 1.149 rework.
It allows to save several percents of CPU time on SMP by using UMA's
internal per-CPU allocation limits instead of own global variable
each time updated with atomics.
Also it restores NG_WAITOK flag processing.
remko [Sat, 17 May 2008 01:29:44 +0000 (01:29 +0000)]
MFC rev 1.32 and rev 1.33 termios.4
The first of thirteen patches by Ed that resolves a documentation
issue in termios.4, ttydefaults.h does not exist in /usr/include
but in /usr/include/sys.
MFC after: 3 days
Submitted by: Ed Schouten (ed at 80386 dot nl)
kib [Fri, 16 May 2008 11:41:50 +0000 (11:41 +0000)]
MFC part of the rev. 1.210, and the rev. 1.211.
In the giant_XXX wrappers for the device methods of the D_NEEDGIANT
drivers, do not dereference the cdev->si_devsw. It is racing with
the destroy_devl() clearing of the si_devsw. Instead, use the
dev_refthread() and return ENXIO for the destroyed device.
kib [Fri, 16 May 2008 10:35:16 +0000 (10:35 +0000)]
MFC rev. 1.24 of the sys/fs/devfs/devfs_rule.c,
rev. 1.218 of the sys/vm/vm_mmap.c
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.
kib [Fri, 16 May 2008 10:32:52 +0000 (10:32 +0000)]
MFC rev. 1.320:
The wakeup() line from the rev. 1.319 is wrong and reintroduces
a panic race on module unload. The wakeup() is internal to
kproc_exit/kthread_exit. The correct fix is to fix the msleep() in
detach to sleep on fdc->fdc_thread instead of &fdc->fdc_thread.
MFC rev. 1.319:
Wakeup the thread doing the fdc_detach() when the fdc worker thread exits [1].
Write access to the write-protected floppy shall call device_unbusy() to
pair the device_busy() in the fd_access() [2].
brooks [Thu, 15 May 2008 01:59:20 +0000 (01:59 +0000)]
MFC rev 1.8: When sending packets directly to the DHCP server, use a socket
and send directly rather than bogusly sending it out as a link layer
broadcast (which fails to be received on some networks).
brooks [Thu, 15 May 2008 01:53:46 +0000 (01:53 +0000)]
MFC: Add very limited support for the isc-dhclient. It will almostly certaintly
only work if there's just one interface doing dhcp. This version implements
the same logic as the version in the PR, but uses pgrep to be less verbose.
marius [Wed, 14 May 2008 21:22:17 +0000 (21:22 +0000)]
MFC: 1.206 (partial)
Use more appropriate maxsize, nsegments and maxsegsize parameters
when creating the parent bus DMA tag. While at it correct the style
and a nearby comment.
mtm [Mon, 12 May 2008 07:37:40 +0000 (07:37 +0000)]
MFC:
o Change the warning dialog for the 'W' command in both the label
and partition editors to reflect the fact that this is a stand-alone
application, not sysinstall(8).
o Change an instance of sade(8) refering to itself as sysinstall(8) in
a confirmation dialog.
dfr [Sun, 11 May 2008 08:53:55 +0000 (08:53 +0000)]
MFC kern_lockf.c revision 1.64:
When blocking on an F_FLOCK style lock request which is upgrading a
shared lock to exclusive, drop the shared lock before deadlock
detection.
jhb [Fri, 9 May 2008 18:47:10 +0000 (18:47 +0000)]
MFC: Rework how kgdb manages kernel and vmcore files to be a bit more
gdb-ish. Specifically, you can now use the 'file' and 'core' commands.
Also, the kernel module stuff now works for remote targets.
mtm [Tue, 6 May 2008 09:45:40 +0000 (09:45 +0000)]
MFC rev. 1.328:
date: 2008/03/06 14:01:10; author: mtm; state: Exp; lines: +1 -1
The rarpd(8) daemon must be instructed to start on all interfaces or a
specific one. Instruct it to listen on all interfaces so that enabling
it in rc.conf(5) works "out of the box."
MFC:
Have the man page catch up with the namespace pollution cleanup that
occurred between 2001-2003. Thanks to bde for the history lesson[1]
concerning sys/types.h and the many system calls that at one time
(pre-2001) were required by POSIX to include it.
Delay the global registration of the struct ifnet in if_alloc() until after
we're certain the allocation will entierly succeed. This fixes a leak in a
fairly unlikely case.
Reported by: vijay singh <vijjus at rocketmail dot com>
- Fix bugs where the value of arithmetic expansion$((...)) was trucated
to type int.
- Change the type used for arithmetic expansion to intmax_t (ie. 64 bit on all
currently supported FreeBSD architectures). SUSv3 requires at least type
long but allows for larger types. Other shells (eg. bash, zsh, NetBSD's sh)
do that too.
PR: 122659
Submitted by: Jaakko Heinonen (minor modifications by me)
- style(9) cleanup.
- dummynet_io() declaration has changed.
- Alter packet flow inside dummynet and introduce 'fast' mode of dummynet
operation: allow certain packets to bypass dummynet scheduler. Benefits are:
-- lower latency: if packet flow does not exceed pipe bandwidth, packets
will not be (up to tick) delayed (due to dummynet's scheduler granularity).
-- lower overhead: if packet avoids dummynet scheduler it shouldn't reenter
ip stack later. Such packets can be fastforwarded.
-- recursion (which can lead to kernel stack exhaution) eliminated. This fix
long existed panic, which can be triggered this way:
kldload dummynet
sysctl net.inet.ip.fw.one_pass=0
ipfw pipe 1 config bw 0
for i in `jot 30`; do ipfw add 1 pipe 1 icmp from any to any; done
ping -c 1 localhost
- New sysctl nodes:
net.inet.ip.dummynet.io_fast - enables 'fast' dummynet io
net.inet.ip.dummynet.io_pkt - packets passed to dummynet
net.inet.ip.dummynet.io_pkt_fast - packets avoided dummynet scheduler
net.inet.ip.dummynet.io_pkt_drop - packets dropped by dummynet
- Workaround p->numbytes overflow, which can result in infinite loop inside
dummynet module (prerequisite is using queues with "fat" pipe).