jhb [Mon, 12 Feb 2007 19:08:29 +0000 (19:08 +0000)]
MFC: Do not set B_NOCACHE on buffers when releasing them in flushbuflist().
If B_NOCACHE is set the pages of vm backed buffers will be invalidated.
However clean buffers can be backed by dirty VM pages so invalidating them
can lead to data loss.
Add support for flush dirty page in the data invalidation function
of some network file systems.
This fixes data losses during vnode recycling (and other code paths
using invalbuf(*,V_SAVE,*,*)) for data written using an mmaped file.
jhb [Mon, 12 Feb 2007 17:57:14 +0000 (17:57 +0000)]
MFC: Sync up bus_dma(9) to rev 1.39 (except for rev 1.37 since 6.x doesn't
have a real bus_get_dma_tag()) and add MLINK for bus_dmamap_load_mbuf_sg().
Prompted by a user who noticed the bus_dmamap_sync ops stuff was still
wrong in 6.x.
Reported by: Jason Harmening <jason.harmening at gmail>
marius [Sun, 11 Feb 2007 18:10:58 +0000 (18:10 +0000)]
MFC: 1.24, 1.26
- In rlphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- In rlphy_status() just use if_dname instead of determining the name
of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits and remove commented out code that just can't
be used with RealTek PHYs.
marius [Sun, 11 Feb 2007 18:05:42 +0000 (18:05 +0000)]
MFC: 1.17
- In qsphy_service() for the MII_TICK case don't bother to check whether
the currently selected media is of type IFM_AUTO as auto-negotiation
doesn't need to be kicked anyway.
- Don't set MIIF_NOISOLATE so qsphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
QS6612 per se nor in combination with the NICs they're used with.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
marius [Sun, 11 Feb 2007 18:03:22 +0000 (18:03 +0000)]
MFC: 1.26, 1.28
- Don't add IFM_NONE when used in combination with pcn(4) as for MII
loopback to work PCnet chips additionally need to be placed into
external loopback mode which pcn(4) doesn't do so far.
- In nsphy_service() just use if_dname instead of determining the name
of the parent NIC via device_get_name(device_get_parent(sc->mii_dev)).
- Don't set MIIF_NOISOLATE, except for when used in combination with a
NIC that wedges when isolating the PHYs, so nsphy(4) can be used in
configurations with multiple PHYs.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia() (requires the MIIF_FORCEANEG
added in sys/dev/mii/mii_physubr.c 1.22.2.3, sys/dev/mii/miivar.h
1.15.14.2).
- Implement a separate nsphy_reset(). There are two reasons for this:
1) This PHY can take an inordinate amount of time to reset if media
is attached; under fairly normal circumstances up to nearly one
second. This is because it appears to go through an implicit auto-
negotiation cycle as part of the reset.
2) During reset and auto-negotiation, the BMCR will clear the reset
bit before the process is complete. It will return 0 until the
process is complete and it's safe to access the PHY again.
This is the first of two changes required to make the combination of
Am79c971 and DP83840A found on certain HP cards and on-board in IBM
machines work.
- Fix some whitespace nits.
Based on: NetBSD (except for the first and second item)
- Fix obsolete comment.
- Extend references to lnc(4) by references to le(4) as the constraint
described in the comment applies to the latter as well.
- Don't bother to include IDs of PCnet chips which are not supported
by this driver and largely are not even PCI devices in pcn_chipid.
- Use device_printf(9)/if_printf(9) rather than implementing their
functionality with printf(9).
- Sprinkle some const.
marius [Sun, 11 Feb 2007 16:09:11 +0000 (16:09 +0000)]
MFC: 1.17, 1.19
- Don't set MIIF_NOISOLATE so lxtphy(4) can be used in configurations
with multiple PHYs. There doesn't seem to be a problem with isolating
LXT970 per se nor in combination with the NICs they're used with and
lxtphy(4) was already adding IFM_NONE anyway.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- Take advantage of mii_phy_setmedia().
- Fix some whitespace nits.
Analogous to mii_add_media(), factor out the code for checking whether
the BMSR contains any media at all to mii_phy_add_media(). The majority
of the drivers currently using mii_phy_add_media() were missing such a
check anyway though.
marius [Sun, 11 Feb 2007 15:09:50 +0000 (15:09 +0000)]
MFC: mii_physubr.c 1.26, miivar.h 1.19
- Add a MIIF_FORCEANEG flag which forces an auto-negotiation to always
take place if IFM_AUTO is selected. This allows drivers like nsphy(4),
which need to force writing the ANAR according to the BMSR, to take
advantage of mii_phy_setmedia(). [1]
- In mii_phy_reset() once the current media is set don't isolate the PHY
corresponding to the instance of the currently selected media rather
than unconditionally not isolating the PHY corresponding to instance 0.
This saves a isolation-unisolation-cycle of the PHY corresponding to
the currently selected media for the case were it isn't instance 0.
- Fix some whitespace nits. [1]
mohans [Sun, 11 Feb 2007 03:31:19 +0000 (03:31 +0000)]
MFC:
Fix for problems that occur when all mbuf clusters migrate to the mbuf packet
zone. Cluster allocations fail when this happens. Also processes that may have
blocked on cluster allocations will never be woken up. Thanks to rwatson for
an overview of the issue and pointers to the mbuma paper and his tool to dump
out UMA zones.
mohans [Sun, 11 Feb 2007 03:13:54 +0000 (03:13 +0000)]
MFC :
Fix for a bug where only one process (of multiple) blocked on
maxpages on a zone is woken up, with the rest never being woken up as
a result of the ZFLAG_FULL flag being cleared. Wakeup all such blocked
procsses instead. This change introduces a thundering herd, but since
this should be relatively infrequent, optimizing this (by introducing
a count of blocked processes, for example) may be premature.
mohans [Sun, 11 Feb 2007 03:07:46 +0000 (03:07 +0000)]
MFC:
Fixes up the handling of shared vnode lock lookups in the NFS client,
adds a FS type specific flag indicating that the FS supports shared
vnode lock lookups, adds some logic in vfs_lookup.c to test this flag
and set lock flags appropriately.
This change fixes the general problem of cascading vnode locks when an
NFS server goes down.
Ideally, we wouldn't need these changes, as enabling shared vnode lock
lookups globally would work. Unfortunately, UFS, for example isn't
ready for shared vnode lock lookups, crashing pretty quickly.
This change is the result of discussions with Stephan Uphoff (ups@).
Thanks to Kris for shaking out several bugs in NFS with shared vnode
lock lookups in current. MFC'ed per Kris' request.
brooks [Fri, 9 Feb 2007 03:11:32 +0000 (03:11 +0000)]
Sync dhclient and supporting code with CURRENT. In particular:
- Introduce per-interface dhclient_flags_<ifn> and
background_dhclient_<ifn> rc.conf variables.
- Default to sending a client identifer.
- When an invalid host name option is sent, delete it and accept the
lease.
- Fix usage, the call to getopt, and a typo in rc.d/dhclient.
ade [Wed, 7 Feb 2007 09:15:04 +0000 (09:15 +0000)]
MFC: rev 1.71/1.72
Remove hard-coded limit (200) on maximum number of packages that can be
added with a single invocation of pkg_add, replacing it with something
rather more dynamic.
rodrigc [Tue, 6 Feb 2007 02:37:42 +0000 (02:37 +0000)]
MFC: 1.142
Check the actual sector size of the underlying media before mounting.
Prevents a kernel panic if you try to "mount_cd9660 /dev/acd0 /mnt" while
an audio CD is in the CD-ROM drive.
bms [Mon, 5 Feb 2007 12:39:53 +0000 (12:39 +0000)]
MFC rev 1.133:
Be explicit in examples about the correct grammar for 'alias' and
'-alias', and that 'add' and 'delete are in fact synonyms for these
in the ifconfig(8) grammar.
Use network prefixes explicitly specified in IETF RFCs for
documentation purposes. (bz)
ariff [Sun, 4 Feb 2007 06:17:48 +0000 (06:17 +0000)]
Partial MFC (buffer.h 1.14, buffer.c 1.30)
Fix huge memory leak within sound buffer (during channel destruction,
buffer resizing, etc.) that was here since eon. Free all (unmanaged)
allocated buffer through sndbuf_destroy() in case we forgot to call
sndbuf_free(). For a managed buffer (mostly hw specific managed buffer),
either provide CHANNEL_FREE() method with appropriate return value to
invoke semi-automatic sndbuf_free() or simply do it on their own. If
everything is failed, sndbuf_destroy() will come to the rescue as a
final measure.
flz [Sat, 3 Feb 2007 20:01:54 +0000 (20:01 +0000)]
MFC: Merge from DRM upstream:
- Add support for Intel 965 Express chipsets.
- Add support for R200 vertex programs, along with minor bugfixes.
- Add support for vblank synchronization to pipe B of Intel hardware
(laptop screens).
pjd [Sat, 3 Feb 2007 16:09:10 +0000 (16:09 +0000)]
MFC: sbin/geom/class/eli/geom_eli.c 1.19
When the following conditions are meet:
- First configured key is based only on keyfile (no passphrase).
- Device is attached.
- User changes first key (setkey) from keyfile to passphrase and doesn't
specify number of iterations (with -i option).
...geli(8) won't store calculated number of iterations in metadata.
This result in device beeing unaccesable after detach.
One can recover from this situation by guessing number of iterations
generated, storing it in metadata and trying to attach device.
Recovery procedure isn't nice, but one's data is not lost.
yongari [Wed, 31 Jan 2007 00:24:11 +0000 (00:24 +0000)]
MFC if_re.c rev 1.83 to RELENG_6.
It seems that enabling Tx and Rx before setting descriptor DMA
addresses shall access invalid descriptor DMA addresses on PCIe
hardwares and then panicked the system.
To fix it set descriptor DMA addresses before enabling Tx and Rx
such that hardware can see valid descriptor DMA addresses. Also
set RL_EARLY_TX_THRESH before starting Tx and Rx.
marius [Tue, 30 Jan 2007 14:16:24 +0000 (14:16 +0000)]
MFC: if_re.c 1.82, if_rlreg.h 1.64
o In re_newbuf() and re_encap() if re_dma_map_desc() aborts the mapping
operation as it ran out of free descriptors or if there are too many
segments in the first place, call bus_dmamap_unload() in order to
unload the already loaded segments.
For trying to map the defragmented mbuf (chain) in re_encap() this
introduces re_dma_map_desc() setting arg.rl_maxsegs to 0 as a new
failure mode. Previously we just ignored this case, corrupting our
view of the TX ring.
o In re_txeof():
- Don't clear IFF_DRV_OACTIVE unless there are at least 4 free TX
descriptors. Further down the road re_encap() will bail if there
aren't at least 4 free TX descriptors, causing re_start() to
abort and prepend the dequeued mbuf again so it makes no sense
to pretend we could process mbufs again when in fact we won't.
While at it replace this magic 4 with a macro RL_TX_DESC_THLD
throughout this driver.
- Don't cancel the watchdog timeout as soon as there's at least one
free TX descriptor but instead only if all descriptors have been
handled. It's perfectly normal, especially in the DEVICE_POLLING
case, that re_txeof() is called when only a part of the enqueued
TX descriptors have been handled, causing the watchdog to be
disarmed prematurely.
o In re_encap():
- If m_defrag() fails just drop the packet like other NIC drivers
do. This should only happen when there's a mbuf shortage, in which
case it was possible to end up with an IFQ full of packets which
couldn't be processed as they couldn't be defragmented as they
were taking up all the mbufs themselves. This includes adjusting
re_start() to not trying to prepend the mbuf (chain) if re_encap()
has freed it.
- Remove dupe initialization of members of struct rl_dmaload_arg to
values that didn't change since trying to process the fragmented
mbuf chain.
While at it remove an unused member from struct rl_dmaload_arg.
o In re_start() remove a abandoned, banal comment. The corresponding
code was moved to re_attach() some time ago.
marius [Tue, 30 Jan 2007 14:00:59 +0000 (14:00 +0000)]
MFC: if_re.c 1.80, if_rlreg.h 1.63
- Use the re_tick() callout instead of if_slowtimo() for driving
re_watchdog() in order to avoid races accessing if_timer.
- Use bus_get_dma_tag() so re(4) works on platforms requiring it;
though for RELENG_6 this is a NOOP so far and just MFC'ed for diff
reduction.
- Remove invalid BUS_DMA_ALLOCNOW when creating the parent DMA tag
and the tags that are used for static memory allocations.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.
- Remove an unused variable in re_intr().
mlaier [Tue, 30 Jan 2007 12:46:05 +0000 (12:46 +0000)]
MFC, subr_firmware.c 1.7:
In case we are supplied with an imagename that matches a module, but not a
firmware in that module (eventhough this is a programming error) - drop
the reference to the module again.
marius [Tue, 30 Jan 2007 10:55:32 +0000 (10:55 +0000)]
MFC: 1.70 (partial), 1.74
- Sync descriptions of RL_HWREV_8168_SPIN{1,2} with HEAD (merge botch
of rev. 1.70 in rev. 1.46.2.17).
- Consistently use if_printf() only in interface methods: if_start(),
if_watchdog, etc., or in functions used only in these methods.
In all other functions in the driver use device_printf().
csjp [Mon, 29 Jan 2007 17:48:33 +0000 (17:48 +0000)]
MFC the AUDIT_SYSCALL_{EXIT|ENTER} macros. This unbreaks auditing for
amd64 by allocating and committing audit records for syscalls. It should
be noted that the submission of userspace records are not affected by
this bug.