Commit Graph

84618 Commits

Author SHA1 Message Date
jmmv
042827a010 Randomly initialize the node's generation to make file handles less
predictable.  This solves a problem that may appear when serving a tmpfs
over NFS: if the server reboots, newly allocated files should have
different file handles; otherwise the remote clients could access files
they were not supposed to touch.
2006-11-05 19:40:31 +00:00
jmmv
1a3e8c3caa Protect the dircookie stuff with _KERNEL. Fixes build problems of
mount_tmpfs as reported by Hisashi T Fujinaka in private mail.
2006-11-05 19:36:07 +00:00
jmmv
2a3293d093 Exporting tmpfs file systems through NFS now works. Sure, file handles are
not persistent across reboots but neither are those of MFS, which we are
trying to replace.  We should probably warn the user somehow, but not
prevent him doing this if he really wants to.

While here add a "reply" to the code-style change item.
2006-11-05 18:03:21 +00:00
jmmv
b2603104c2 Truncate directory cookies to 31 bits to avoid problems exposed in Linux
binaries which cast the returned values to 64-bits and fail due to sign
expansion.  More details are provided in the big comment in tmpfs.h that
describes how the new tmpfs_dircookie works.

This is a rather ugly hack that shall be fixed with a cleaner solution,
but this resolves the problem in an effective way.

Fixes kern PR/32034.
2006-11-05 16:59:18 +00:00
tsutsui
a6058d8988 Rename prefixes of re(4) specific macro and structure members
from RTK_ or rtk_ to RE_ or re_ for maintainability of these sources.
Eventually we should split these files (and struct rtk_softc) into
three elements, rtk(4) specific one, re(4) specific one, and a common
(register definitions, eeprom and multicast functions etc) part.

While here, add a couple of comments around weird definitions.
2006-11-05 16:52:10 +00:00
tsutsui
7274f167d2 - make TX threshold macro more generic
- no need to bother to initialize sc_txthresh in rtk_attach()
  since it's done in rtk_init()
2006-11-05 15:49:41 +00:00
christos
9573aa20e8 - call the initialization routine for arc4randbytes.
- knf (add continues)
2006-11-05 14:13:56 +00:00
tsutsui
527c7a697a Use uintNN_t. 2006-11-05 13:05:18 +00:00
jld
e973fa550e If the timestamp is/becomes stale when computing the current system_time,
obviously shadow_system_time will need to be reread as well.
2006-11-05 10:11:55 +00:00
jdolecek
d5f5129729 add one code style and one knote-related item 2006-11-05 09:40:26 +00:00
yamt
0f0ac5fba9 vmapbuf: don't try to modify non-lvalue. 2006-11-05 08:04:55 +00:00
itohy
bb94735ed0 Restart transmitter, not reset the entire chip, on transmission errors
like Tx underrun.
This should improve performance on such errors.

Handle fifo threshold properly --- actually it did not handled at all.
Note that the Tx Complete interrupts occur only on errors, and ex_txstat()
is not good place to increment sc->tx_succ_ok.  Increase the sc->tx_succ_ok
count from 100 to 256, since the ex(4) does busmastering and underruns
should rarely happen in normal operations.

Possibly improve some situation for the hang-on-heavy-load problems,
such as kern/11450 and kern/27096.
2006-11-05 07:59:21 +00:00
itohy
4be0089972 Add definition for Tx Reclaim status (TXS_RECLAIM). 2006-11-05 05:57:53 +00:00
elad
a996c89fcf forward decl struct vnode 2006-11-04 21:24:20 +00:00
jmmv
9d877d347c Use size_t in a couple of places as it makes more sense WRT the places
where the variables are later used.  From PR kern/25277 by Jeff Ito.
2006-11-04 20:51:32 +00:00
pooka
78e8aceaac adapt to mnt_vnodelist being TAILQ 2006-11-04 20:33:17 +00:00
pooka
88134b62a2 add mountdump, prints mount point information a little like mount(8) 2006-11-04 20:29:30 +00:00
elad
03a082e7aa Oops, forgot to do this one in previous commit.
Pointed out by mjf@, thanks!
2006-11-04 15:36:37 +00:00
yamt
3aef238dc0 - define some macros and use them.
- fix an off-by-one in testcode.
2006-11-04 13:26:22 +00:00
yamt
e1b6afe136 todo. 2006-11-04 13:25:52 +00:00
jmmv
d4cb7c851a Fix matching of options with common prefixes (e.g. console and console_speed).
While here remove an useless assignment and bind a variable to a loop.
2006-11-04 11:37:12 +00:00
elad
9477ac30bc Add "@uid" keyword translation, to translate effective user-id of the
process.
2006-11-04 10:14:00 +00:00
elad
63d078b99e Use KASSERT() as requested by yamt@. 2006-11-04 09:56:59 +00:00
elad
fe9e2303fd Change KAUTH_SYSTEM_RAWIO to KAUTH_DEVICE_RAWIO_SPEC (moving the raw i/o
requests to the device scope) and add KAUTH_DEVICE_RAWIO_PASSTHRU.

Expose iskmemdev() through sys/conf.h.

okay yamt@
2006-11-04 09:30:00 +00:00
dyoung
0787046d01 Change lengthy ((struct sockaddr_in *)x) to satosin(x). 2006-11-04 07:13:19 +00:00
dyoung
f6cb813915 Remove unused variables. 2006-11-04 06:41:48 +00:00
dyoung
cce119d20c Expand the comment concerning gre_kick().
Shorten the code in gre_compute_route() that flips the least
significant bit of the tunnel address.  No functional change.
2006-11-04 06:38:05 +00:00
tsutsui
fb1f06475c Remove vtophys (in comment). 2006-11-04 05:54:53 +00:00
tsutsui
c5bcc82dd7 Preserve m_pkthdr.csum_flags in TX packets because
it could be lost if bus_dmamap_load_mbuf(9) returns EFBIG.
(though I've never seen the "too mamy segments" message
 which indicates the packet has more than 32 fragments)
2006-11-04 05:18:26 +00:00
tsutsui
f2a3a089d1 Rather than copying m_pkthdr.csum_flags in m_defrag() (which was
committed in rev 1.22), save it before calling m_defrag().

I haven't confirmed whether the m_pkthdr.csum_flags is preserved during
m_defrag(), but the previous way sometimes makes vge(4) chip mad...
2006-11-04 05:07:16 +00:00
tsutsui
5a460391d7 Return a proper error from vge_encap() if m_defrag() fails. 2006-11-04 04:40:00 +00:00
ad
5bfcdd68c1 - ltsleep(): for now, stay at splsched() when releasing sched_lock, or we
may allow wakeup() to occur before switching away.  PR/32962.
- mi_switch(): don't inspect p->p_cred or send signals without holding the
  kernel lock.
2006-11-03 20:46:00 +00:00
ad
1cffc415cb - issignal(): acquire the kernel lock before inspecting signal state
- lwp_exit2(): don't drop the kernel lock until after doing wakeup()
2006-11-03 19:46:03 +00:00
tsutsui
da98d43bd0 Pull another 8139C+ fix from FreeBSD if_re.c rev 1.68:
Perform hardware diagnostic only on the original RTL8169,
which was the only device that really needed it.
(i.e. a possible hardware bug when the NIC was put on a 64bit PCI slot)

Tested with on-board 8139C+ by Brian A. Seklecki.

Note this change might also fix PR kern/34952
(because re_diag() is no longer called on 8169S/8110S),
but I'm not sure if the re(4) chip was properly initialized in such case.
2006-11-03 17:51:47 +00:00
tsutsui
445d5743e4 Pull a 8139C+ fix from FreeBSD if_re.c rev 1.73:
Ignore BMCR_LOOP and BMCR_ISO bits which have different meanings on 8139C+.

Tested by Brian A. Seklecki.
2006-11-03 17:16:58 +00:00
tsutsui
ff1bacae2e Make rlphy also match if parent MII is re(4) for RTL8139C+ case.
Tested by Brian A. Seklecki.
2006-11-03 17:05:16 +00:00
tsutsui
304b305c9e Minor cleanups:
- move some driver specific definitions from rtl81x9reg.h to rtl81x9var.h
- move several macro where related structures are declared
- remove unused macro
- fix some comments
- unwrap some lines
2006-11-03 17:01:54 +00:00
tsutsui
a8d1516f11 Use #define<space>, which seems consistent in these files. 2006-11-03 14:41:40 +00:00
abs
34133821e3 Regenerate after adding Broadcom BCM5754 (0x167a) 2006-11-03 13:00:09 +00:00
abs
f9237faff1 Add Broadcom BCM5754 (0x167a) 2006-11-03 12:59:47 +00:00
yamt
0ae566badc fix deadlocks due to ksiginfo_pool spl problems. 2006-11-03 12:18:41 +00:00
jld
9253e28032 Ensure that the timestamp we use in get_tsc_offset_ns remains valid
until after we do the rdtsc; since Xen3 dynamically adjusts its idea of
the clock frequency, this is important.  (Linux and FreeBSD both do this.)
2006-11-03 12:09:46 +00:00
yamt
1cd3142c15 make siginfo_pool and ksiginfo_pool static. 2006-11-03 11:41:07 +00:00
jld
f566d2017b "static volatile", not "volatile static". 2006-11-03 09:16:13 +00:00
tsutsui
690e60f366 Pull several fixes which improve TX error handling
from FreeBSD's if_vr.c rev 1.52:
- check more error status in TX descriptor and restart TX module
  appropriately in vr_txeof()
- check more error interrupt status in vr_intr()

I can't confirm whether these changes actually fix TX stalls because
I can't reproduce the problem I had about seven years ago (I guess
it might be caused by excessive collisions on a dumb hub), but at least
they don't seem to have bad side effects on normal operations on my macppc.
2006-11-03 08:41:05 +00:00
tsutsui
57a0051fe5 - no need to scan zsc units in zshard(), just use passed one
- call zsc_intr_soft() directly on softintr and remove zssoft()
  (no need spltty() since it should be done in each MD handler)
2006-11-03 03:04:53 +00:00
jld
2d61afc3e7 Recycle old buffers into new rx requests when their number reaches half of
those not tied up in active mbufs, rather than half of the total number.

(Or, to more literally translate the C, when there are at least as
many buffers waiting to be reused as outstanding rx requests.)

This prevents us from dropping off the network for a while when more
than 128 of the 256 buffers are in use by mbufs, which might not be
freed for an arbitrarily long time; the remaining buffers would stack up
on the free list but not be reclaimed until enough mbufs were eventually
freed, leaving the interface unable to receive packets until then.
2006-11-03 03:03:32 +00:00
tsutsui
23c5e05646 Remove a function declaration of zssoft() which was
inside #ifndef __HAVE_GENERIC_SOFT_INTERRUPTS.
2006-11-02 20:43:30 +00:00
tsutsui
ce97c50f55 Pass zsc_softc to zshard() directly rather than searching it in zshard().
Checking all zsc units in zshard() is efficient only on ports
which share one interrupt among all zsc units, like sparc or sun3.
On such ports, zshard() is established as a handler only once.

XXX1: more other MD zs drivers should be fixed similarly.
XXX2: zsc on macppc has independent interrupts for channel A and B,
      but MI z8530sc can't handle such configuration.
2006-11-02 20:05:04 +00:00
tsutsui
5e4ac42c65 macppc always defines __HAVE_GENERIC_SOFT_INTERRUPTS,
so remove #ifdef/#ifndefs against it.
2006-11-02 19:41:34 +00:00