Commit Graph

16840 Commits

Author SHA1 Message Date
tls 05e1bf3ec9 MAXBSIZE->MAXPHYS -- this mysteriously broke all *kinds* of stuff when
MAXBSIZE had been reduced by the user (e.g. transfers from umass disks).
2004-03-22 14:55:42 +00:00
pk bfe932f43b sparc: OF_instance_to_package => prom_instance_to_package 2004-03-22 10:06:31 +00:00
martin a4ec3066f6 Adapt to promlib changes on sparc. 2004-03-22 08:36:28 +00:00
oster 43ccce7d13 Why start a timer, and then just ignore it? *punt* 2004-03-21 21:20:46 +00:00
oster 78d093eaf5 Yesterday's fix to rf_disks.c (rev 1.51) was necessary, but not
sufficient to clobber this nasty little bug.  The behaviour observed
was a panic when doing a 'raidctl -f' on a component when DAGs were
in flight for the given RAID set.  Unfortunatly, the faulty behaviour
was very intermittent, and it was difficult to not only reliably
reproduce the bug (nor determine when it was fixed!) but also to even
figure out what might be the cause of the problem.

The real issue was that ci_vp for the failed component was being
set to NULL in rf_FailDisk(), but with DAGs still in flight, some
of them were still expecting to use ci_vp to determine where to
read to/write from!

The fix is to call rf_SuspendNewRequestsAndWait() from rf_FailDisk()
to make sure the RAID set is quiet and all IOs have completed before
mucking with ci_vp and other data structures.  rf_ResumeNewRequests()
is then used to continue on as usual.
2004-03-21 21:08:08 +00:00
oster 3dd7f5503f Fix a nastly little bug that I've been chasing over the past 12 hours.
If raidPtr->numFailures isn't initialized properly, then all sorts of
whacky things can happen, including incorrect DAGs being generated.
(Triggering this problem is a little esoteric, which is why this bug has
been in hiding for so long -- I only saw it after rebooting with a
degraded RAID 5 set that was autoconfigured, rebuilding the failed
componennt, and then failing the component while IO was happening to
the RAID set.)
2004-03-21 06:32:03 +00:00
oster 492aa07868 Doesn't hurt much to zero this before we start mucking with it. 2004-03-21 06:16:49 +00:00
oster 01e44f9df5 Add in a couple of missed foo=foo->next's. 2004-03-21 03:22:08 +00:00
oster ac19c32ed5 Can't conditionalize cleanup on numStripeUnitsBailed -- have to
cleanup regardless.

More importantly, we can't free any of the AccessStripeMaps here!
2004-03-20 21:25:55 +00:00
christos e4b3e03b4c Remove extraneous ; from OpenBSD. 2004-03-20 21:16:55 +00:00
oster 06f16f554f NO_STRIPE_LOCKS is never set, so this code will always execute.
Remove conditionals, and left-shift code.
2004-03-20 17:30:40 +00:00
oster 1966e6afbb Cleanup function prototypes. 2004-03-20 16:48:05 +00:00
oster a7f8d0aef6 [bah.. specifying rf_dagutils.c twice on a checkin doesn't get you
rf_dagutils.h... missed this one from yesterday.  sorry folks :( ]

Change signature of rf_AllocBuffer() to take a dag_h and buffer size
instead of an PDA and an alloclist.  This lets us do the vple dance
inside of rf_AllocBuffer().

Cleanup usage of rf_AllocIOBuffer() and use rf_AllocBuffer() instead.

Fix all uses of rf_AllocBuffer() to conform to the new way of doing
things.
2004-03-20 15:56:21 +00:00
jdolecek 2151f6ca26 eliminate redundant aperture size printouts
reported in PR kern/24859 by Nicolas Joly
2004-03-20 14:00:40 +00:00
oster 9aa1b6b7c0 Change signature of rf_AllocBuffer() to take a dag_h and buffer size
instead of an PDA and an alloclist.  This lets us do the vple dance
inside of rf_AllocBuffer().

Cleanup usage of rf_AllocIOBuffer() and use rf_AllocBuffer() instead.

Fix all uses of rf_AllocBuffer() to conform to the new way of doing
things.
2004-03-20 05:21:53 +00:00
oster 0ff2145648 For each RAID set, pre-allocate a number of "emergency buffers" to be
used in the event that we can't malloc a buffer of the appropriate
size in the traditional way.  rf_AllocIOBuffer() and rf_FreeIOBuffer()
deal with allocating/freeing these structures.  These buffers are
stored in a list on the 'iobuf' list.  iobuf_count keeps track of how
many buffers are available, and numEmergencyBuffers is the effective
"high-water" mark for the freelist.  The buffers allocated by
rf_AllocIOBuffer() are stripe-unit sized, which is the maximum
size requested by any of the callers.

Add an iobufs entry to RF_DagHeader_s.  Use it for keeping track of
buffers that get allocated from the free-list.

Add a "generic list" pool (VoidPointerListElement Pool) for elements
used to maintain a list of allocated memory.  [It is somewhat less
than ideal to add another little pool to handle this...]

Teach rf_AllocBuffer() to use the new rf_AllocIOBuffer().  Modify
other Mallocs to use rf_AllocIOBuffer(), and to update dag_h->iobufs as
appropriate.

Update rf_FreeDAG() to handle cleanup of dag_h->iobufs.

While here, add some missing pool_destroy() calls for a number of pools.

With these changes, it should (in theory) be possible to swap on
RAID 5 sets again.  That said, I've not had any success there yet --
but the last issue I saw at least wasn't in RAIDframe. :-}

[There is room for this code to become a bit more consise, but I
wanted to do a checkpoint here with something known to work :) ]
2004-03-20 04:22:05 +00:00
jonathan b9aa680ef2 Add a table of Rx interrupt-threshold register values for mitigating
Rx interrupts, functions to post a request for new table entries, and
code to apply pending Rx-interrupt control values at the next hardware
interrupt.

As used in a third-party proprietary tree since at least March 2003.
As discussed on tech-kern/tech-net in January 2004 (in the context of
NetBSD for packet capture, bpf, and FreeBSD-sylte IFF_POLL), and as
posted to tech-net for comments in mid-March 2004.

Still missing sysctl or other knobs to acutally change the config-time
values, due to my ignorance of any accepted per-device sysctl namespace.
2004-03-20 02:04:07 +00:00
jonathan 73e79089ee Possibloe fix for some bge chip revisions taking a long time to reset
(e.g., polling for a half-second or more at splnet(), blocking most
interrupts, durin an ifconfig down/ifconfig up).

Appears to help for a 5704C rev A3, which is the only chip I've
ever seen that had even a mild version of the reported problem.
2004-03-20 01:58:51 +00:00
matt bcc199a19c Add gt_dma_bus_mem_to_phys and gt_dma_phys_to_bus_mem. 2004-03-20 01:55:00 +00:00
jonathan 426b3e3a08 Check for BGE_PCI_PCISTATE register failing to revert on reset.
if it occurs, print a message indicating why the reset took so long.
2004-03-20 01:42:21 +00:00
oster 29c6e63ebb dag_node_pool never did get used here. Turf. 2004-03-19 17:04:35 +00:00
oster 1a3e20d5d9 Introduce a dual-purpose pool for providing pointer and param "caches"
for RF_DagNode_t's.  Scale the structure size based on RF_MAXCOL.
Use the new allocation method in InitNode().  Note that we can't get
rid of the mallocs in there until we can prove that this new
allocation method is a strict upper bound.  Unless someone tries
running a RAID set with 40 components, the mallocs here shouldn't
shouldn't be an issue.  (and if someone does make a set with 40 components
they will run into other issues with other constants long before
then)
2004-03-19 17:01:26 +00:00
pk fb4c6462e1 fb_is_console/SUN4U: fbnode => prom_stdout_node. 2004-03-19 16:05:25 +00:00
oster b2c52e1175 Take care of six more mallocs:
- Pull rf_FreePhysDiskAddr() out from under a #ifdef, since we're now
going to use it.

- Add a pda_cleanup_list into the DAG header.  Use it in rf_FreeDAG() to
cleanup any PDA's that get allocated but have no "easy" way of being
located and freed when the DAG completes.

- numStripeUnitsAccessed is a per-stripe value, and has a maximum
value equal to the number of colums (thus limited by RF_MAXCOL).
Use this knowledge to set a high-bound on overlappingPDAs, and stuff
it on the stack instead of malloc'ing it all the time!  This costs us
a whopping 40 bytes on the stack, but saves a malloc() and a free().
2004-03-19 15:16:18 +00:00
petrov 42615e3301 Add sun display types. 2004-03-19 09:00:38 +00:00
oster 5ac8fbad7f Add a comment. Will hopefully save time next time someone tries
to figure out where the allocated memory is freed.
2004-03-19 02:57:34 +00:00
oster d3810da59b Add a few comments to explain what some of these new structures are, and
where they are used.
2004-03-19 02:34:30 +00:00
oster 208b461a96 Introduce 3 more pools and 6 functions to handle allocating/freeing
elements from the pools.

Re-work rf_SelectAlgorithm() to get rid of all the 8 malloc's, and to
use the new functions to get/put these 'support structures'.  I'm not
overly happy with some of the variable names, but them's the breaks.

In the process of changing things, fix a bug:
 - in the case where we can't create a dag, free asmh_b and blockFuncs
too!!

[if you were able to look at the source code related to these changes,
and comprehend what was going on without having your eyes bleed or
getting dizzy, please contact me...  I'm sure I'll have more code
which would benefit by you having a look at it before I commit it :) ]
2004-03-19 02:27:44 +00:00
oster 997983060e Re-work rf_State_Quiesce() so that we don't have to hold a lock
while doing a pool_get().
2004-03-19 01:56:03 +00:00
he 2c34d70afa Adapt to the removal of NE2000_USE_WORD() macro, now replaced
by a field in ne2000_softc.
2004-03-18 23:38:17 +00:00
bouyer 4f04c7872f Use the bus_space_*_stream_* methods to access the chip's registers.
As we turn the chip to big-endian mode on big-endian systems, we should
never byte-swap the data read/written from/to registers. Tested on sparc64.
Finally fix kern/13341 by Jason R. Thorpe (really, the hard work of putting
bus_dmamap_sync() calls at the right places has been done my Jason mid-2001 :)
2004-03-18 23:20:32 +00:00
bouyer 6e20098871 cur_rx->ti_vlan_tag holds the 802.1q VLAN tag and the 802.1p priority.
Trimm the priority, as the upper layers won't do it and will drop the packet
if priority is not 0.
While there, print the revision in the "unsupported chip revision" printf.
2004-03-18 22:45:35 +00:00
bjh21 39d9753ed9 ANSIfy, un-__P(), and generally KNF. 2004-03-18 21:05:19 +00:00
oster b69e81af97 Remove a debugging line that was accidentally left in. 2004-03-18 17:46:22 +00:00
oster ba5bdf0048 Use rf_AllocDAGNode() to get new DAG nodes. 2004-03-18 17:26:36 +00:00
oster 1051cc745f Re-work the locking mechanisms for reconstruct and PSS structures
such that we don't actually hold a simplelock while we are doing
a pool_get(), but that we still effectively protecting critical code.

This should fix all of the outstanding LOCKDEBUG warnings related to
rebuilding RAID sets.
2004-03-18 16:54:54 +00:00
oster d4fe1a2103 - Introduce a 'dagnode' pool. Initialize it and allow for cleanup.
Provide rf_AllocDAGNode() and rf_FreeDAGNode() to handle
allocation/freeing.

- Introduce a "nodes" linked list of RF_DagNode_t's into the DAG header.
Initialize nodes in InitHdrNode().  Arrange for nodes cleanup in rf_FreeDAG().

- Add a "list_next" to RF_DagNode_t to keep track of nodes on the
above "nodes" list.  (This is distinct from the "next" field of
RF_DagNode_t, which keeps track of the firing order of nodes.)
"list_next" gets used in the cleanup routines, and in traversing
through a set of nodes that belong to a particular set of nodes
(e.g. those belonging to xorNodes for a given DAG).

- use rf_AllocDAGNode() instead of mallocs of variable-sized arrays of
RF_DagNode_t's.  Mostly mechanical changes to convert the DAG construction
from "access nodes via an array index" to "access nodes via a 'nextnode'
pointer".

- rework a couple of tricky spots where assumptions about the node order
was being abused.

- performance remains consistent with performance before these changes.

[Thanks to Simon Burge (simonb at you.know.where) for looking over
the mechanical changes to make sure I didn't biff anything.]
2004-03-18 16:40:05 +00:00
dan b912bfcc09 Fix a longstanding bug in key-handling for the blowfish cipher.
This is an incompatible change, and will break all existing cgd images
encrypted with blowfish. Users will need to dump their data before
booting a kernel with this change, and recreate cgd's and restore data
afterwards.

I believe this affects a very small number of users other than myself;
indeed after several alert mails in an attempt to find them, only 2
such users have come forward. They have both agreed the requirement
for backwards compatibility does not warrant the effort nor the mess
in the code.  This code does exist, if it should later prove to be
needed, but will not be in the tree.

Further, by the nature of the issue, I have strong reasons to believe
that, even if they missed these mails, there would be few other users
of blowfish who update their systems with any regularity; any such
users would have tripped over the problem in the same way I did when
it was first found over a year ago.

The problem stems from two issues with the underlying blowfish
encryption routines used by cgd:
 - they take key length arguments counted in bytes, rather than bits
   like all the opther ciphers.
 - they silently truncate any keys longer than an internal limit,
   rather than returning an error (which would have exposed the
   previous discrepancy immediately).

As a result, the kernel reads too much data as the key from cgdconfig,
and then truncates most of it. This can easily be demonstrated/tested.
Currently, Blowfish users will find that if they mis-enter the cgd
passphrase on the first attempt, when validation fails and cgdconfig
prompts for the passphrase again, the cgd will not correctly configure
even when given a correct passphrase.
2004-03-18 10:42:08 +00:00
sekiya d1ae192917 Add console type for SGI GR2 family. 2004-03-18 08:30:58 +00:00
uwe 0e524a56a1 Scandinavian keyboard layout for Jornada 680/690. 2004-03-18 01:11:58 +00:00
mycroft 2d3bb76a10 A random patch that's been in my source tree...
Figure out whether the shared memory region is word-accessible in the same
place we figure out its size, and store this in the softc, rather than using a
series of comparisons later.
2004-03-17 23:47:16 +00:00
scw 6946234e5e Use PRIu64 and PRIx64 in place of %llu and %llx format strings for
printing variables of type u_int64_t.
2004-03-17 20:27:57 +00:00
dyoung 9ef4dd42f2 Prevent a buffer overflow that's been seen in the wild. The firmware
will sometimes return 0; subtracting 1 from that yields a too-big
buffer length.
2004-03-17 17:19:13 +00:00
pk ea53363e84 Rename PROM_getprop*() => prom_getprop*(). 2004-03-17 17:04:58 +00:00
dyoung 73a618d5f3 In wi(4), wi_choose_rate used to contain device-independent code.
I have pulled that code into the function ieee80211_rssadapt_choose
so that I can re-use it in ath(4), atw(4), and in other drivers.

In rssadapt(9), I have also created a struct ieee80211_rssadapt_expavgctl
that contains parameters for rate adaptation. When IEEE80211_RSSADAPT_DEBUG
is enabled, I will using sysctl to expose an ieee80211_rssadapt_expavgctl
for each wireless device.

Also in rssadapt(9), I have introduced an interpolate() macro which
makes the exponential-averaging code more compact.
2004-03-17 17:00:34 +00:00
pk c188a40b85 Update previous change: set defaults properly. 2004-03-17 14:00:46 +00:00
martin fde39f7603 For sparc*: myetheraddr is no more 2004-03-17 13:54:09 +00:00
martin ac3bee274a Fix hme for pci based sparcs (krups). 2004-03-17 08:58:23 +00:00
uwe dd45c4817c Comment change only. Add a reminder that if you add new entry to
hpckbd_keymap_table, you must make sure that pckbd_keydesctab[] in
sys/dev/pckbport/wskbdmap_mfii.c has a placeholder KB_MACHDEP entry
for the base ht_layout that you refer.

I've stepped on this rakes two times already, with DE and FR keymaps,
so I gather, I'd better add this reminder, if only for myself. :)
2004-03-17 04:34:25 +00:00
uwe 5b0626de75 The platid for Jornada 680/690 with European English (ABB) keyboard is
now properly renamed to have the EU suffix.

Enable Jornada 680/690 French (ABF) keymap now that we have a platid
for it (requires updated hpcboot.exe to use).
2004-03-17 04:24:16 +00:00