]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoMake speaker a pseudo device driver instead of attaching to a PnP id.
phk [Wed, 26 Mar 2008 21:33:41 +0000 (21:33 +0000)]
Make speaker a pseudo device driver instead of attaching to a PnP id.

If somebody cleaned this code up to proper style(9), it could become
a great educational starting point for aspiring kernel hackers.

16 years agoAdd a comment explaining that we initialize the 'a' buffer for
rwatson [Wed, 26 Mar 2008 21:29:13 +0000 (21:29 +0000)]
Add a comment explaining that we initialize the 'a' buffer for
zero-copy to the store buffer position on the BPF descriptor,
and the 'b' buffer as the free buffer in order to fill them in
the order documented in bpf(4).

MFC after: 4 months
Suggested by: csjp

16 years agoSome minor code and math optimizations.
mav [Wed, 26 Mar 2008 21:19:03 +0000 (21:19 +0000)]
Some minor code and math optimizations.

16 years agoFix a nit with the 'nofoo' options where 'foo' is mapped to 'nonofoo'
jhb [Wed, 26 Mar 2008 20:48:07 +0000 (20:48 +0000)]
Fix a nit with the 'nofoo' options where 'foo' is mapped to 'nonofoo'
(such as 'atime' vs 'noatime').  The filesystems will always see either
'nofoo' or 'nonofoo', never plain 'foo'.  As such, their list of valid
mount options should include 'nofoo' instead of 'foo'.  With this fix,
you can do 'mount -u -o atime' on a FFS filesystem that isn't marked as
noatime without getting an error.  You can also update a noatime FFS
filesystem mounted via mount(2) (e.g. 6.x /sbin/mount binary) to 'atime'
using nmount(2) (e.g. 7.x /sbin/mount binary).

MFC after: 1 week
Reviewed by: crodig

16 years agoRemove two variables which are handled MI now.
phk [Wed, 26 Mar 2008 20:28:52 +0000 (20:28 +0000)]
Remove two variables which are handled MI now.

16 years agoEliminate unnecessary #includes
phk [Wed, 26 Mar 2008 20:26:12 +0000 (20:26 +0000)]
Eliminate unnecessary #includes

16 years agoThe "free-lance" timer in the i8254 is only used for the speaker
phk [Wed, 26 Mar 2008 20:09:21 +0000 (20:09 +0000)]
The "free-lance" timer in the i8254 is only used for the speaker
these days, so de-generalize the acquire_timer/release_timer api
to just deal with speakers.

The new (optional) MD functions are:
timer_spkr_acquire()
timer_spkr_release()
and
timer_spkr_setfreq()

the last of which configures the timer to generate a tone of a given
frequency, in Hz instead of 1/1193182th of seconds.

Drop entirely timer2 on pc98, it is not used anywhere at all.

Move sysbeep() to kern/tty_cons.c and use the timer_spkr*() if
they exist, and do nothing otherwise.

Remove prototypes and empty acquire-/release-timer() and sysbeep()
functions from the non-beeping archs.

This eliminate the need for the speaker driver to know about
i8254frequency at all.  In theory this makes the speaker driver MI,
contingent on the timer_spkr_*() functions existing but the driver
does not know this yet and still attaches to the ISA bus.

Syscons is more tricky, in one function, sc_tone(), it knows the hz
and things are just fine.

In the other function, sc_bell() it seems to get the period from
the KDMKTONE ioctl in terms if 1/1193182th second, so we hardcode
the 1193182 and leave it at that.  It's probably not important.

Change a few other sysbeep() uses which obviously knew that the
argument was in terms of i8254 frequency, and leave alone those
that look like people thought sysbeep() took frequency in hertz.

This eliminates the knowledge of i8254_freq from all but the actual
clock.c code and the prof_machdep.c on amd64 and i386, where I think
it would be smart to ask for help from the timecounters anyway [TBD].

16 years agoFix the __FreeBSD_version check.
dfr [Wed, 26 Mar 2008 15:42:22 +0000 (15:42 +0000)]
Fix the __FreeBSD_version check.

16 years agoBump __FreeBSD_version for the addition of 'l_sysid' to the flock structure.
dfr [Wed, 26 Mar 2008 15:41:00 +0000 (15:41 +0000)]
Bump __FreeBSD_version for the addition of 'l_sysid' to the flock structure.

16 years agoAdd some regression tests for posix record locks.
dfr [Wed, 26 Mar 2008 15:39:44 +0000 (15:39 +0000)]
Add some regression tests for posix record locks.

16 years agoAdd \n to the end of a printf string and remove it from panic strings.
emaste [Wed, 26 Mar 2008 15:28:56 +0000 (15:28 +0000)]
Add \n to the end of a printf string and remove it from panic strings.

16 years agoRegen.
dfr [Wed, 26 Mar 2008 15:24:02 +0000 (15:24 +0000)]
Regen.

16 years agoAdd the new kernel-mode NFS Lock Manager. To use it instead of the
dfr [Wed, 26 Mar 2008 15:23:12 +0000 (15:23 +0000)]
Add the new kernel-mode NFS Lock Manager. To use it instead of the
user-mode lock manager, build a kernel with the NFSLOCKD option and
add '-k' to 'rpc_lockd_flags' in rc.conf.

Highlights include:

* Thread-safe kernel RPC client - many threads can use the same RPC
  client handle safely with replies being de-multiplexed at the socket
  upcall (typically driven directly by the NIC interrupt) and handed
  off to whichever thread matches the reply. For UDP sockets, many RPC
  clients can share the same socket. This allows the use of a single
  privileged UDP port number to talk to an arbitrary number of remote
  hosts.

* Single-threaded kernel RPC server. Adding support for multi-threaded
  server would be relatively straightforward and would follow
  approximately the Solaris KPI. A single thread should be sufficient
  for the NLM since it should rarely block in normal operation.

* Kernel mode NLM server supporting cancel requests and granted
  callbacks. I've tested the NLM server reasonably extensively - it
  passes both my own tests and the NFS Connectathon locking tests
  running on Solaris, Mac OS X and Ubuntu Linux.

* Userland NLM client supported. While the NLM server doesn't have
  support for the local NFS client's locking needs, it does have to
  field async replies and granted callbacks from remote NLMs that the
  local client has contacted. We relay these replies to the userland
  rpc.lockd over a local domain RPC socket.

* Robust deadlock detection for the local lock manager. In particular
  it will detect deadlocks caused by a lock request that covers more
  than one blocking request. As required by the NLM protocol, all
  deadlock detection happens synchronously - a user is guaranteed that
  if a lock request isn't rejected immediately, the lock will
  eventually be granted. The old system allowed for a 'deferred
  deadlock' condition where a blocked lock request could wake up and
  find that some other deadlock-causing lock owner had beaten them to
  the lock.

* Since both local and remote locks are managed by the same kernel
  locking code, local and remote processes can safely use file locks
  for mutual exclusion. Local processes have no fairness advantage
  compared to remote processes when contending to lock a region that
  has just been unlocked - the local lock manager enforces a strict
  first-come first-served model for both local and remote lockers.

Sponsored by: Isilon Systems
PR: 95247 107555 115524 116679
MFC after: 2 weeks

16 years agoRename timer0_max_count to i8254_max_count.
phk [Wed, 26 Mar 2008 15:03:24 +0000 (15:03 +0000)]
Rename timer0_max_count to i8254_max_count.
Rename timer0_real_max_count to i8254_real_max_count and make it static.
Rename timer_freq to i8254_freq and make it a loader tunable.

16 years agoThe RTC related pscnt and psdiv variables have no business being public.
phk [Wed, 26 Mar 2008 13:25:27 +0000 (13:25 +0000)]
The RTC related pscnt and psdiv variables have no business being public.

16 years agoRemove old sysctl stuff which is long gone in other arch's.
phk [Wed, 26 Mar 2008 13:03:51 +0000 (13:03 +0000)]
Remove old sysctl stuff which is long gone in other arch's.

16 years agoFix some "in in" typos in comments.
brueffer [Wed, 26 Mar 2008 07:32:08 +0000 (07:32 +0000)]
Fix some "in in" typos in comments.

PR: 121490
Submitted by: Anatoly Borodin <anatoly.borodin@gmail.com>
Approved by: rwatson (mentor), jkoshy
MFC after: 3 days

16 years agoDocument the removal data for usbdevs.h and usbdevs_data.h,
remko [Wed, 26 Mar 2008 06:45:28 +0000 (06:45 +0000)]
Document the removal data for usbdevs.h and usbdevs_data.h,
sort the entry into it's correct place (behind 200407XX before
200406XX because we have an explicit date here).

PR: misc/122098
Submitted by: "John Hein" <jhein@timing.com>
MFC after: 3 days

16 years agoEnable the automatic creation of superpage reservations.
alc [Wed, 26 Mar 2008 03:12:00 +0000 (03:12 +0000)]
Enable the automatic creation of superpage reservations.

16 years agosplit out tty create part of ucom_attach into ucom_attach_tty so
sam [Tue, 25 Mar 2008 23:46:24 +0000 (23:46 +0000)]
split out tty create part of ucom_attach into ucom_attach_tty so
derived drivers can use it

Submitted by: Jared Go
MFC after: 3 weeks

16 years agoadd some CDMA modems
sam [Tue, 25 Mar 2008 23:35:32 +0000 (23:35 +0000)]
add some CDMA modems

Submitted by: Jared Go
MFC after: 1 week

16 years agoImplement taskqueue_block() and taskqueue_unblock(). These functions allow
scottl [Tue, 25 Mar 2008 22:38:45 +0000 (22:38 +0000)]
Implement taskqueue_block() and taskqueue_unblock().  These functions allow
the owner of a queue to block and unblock execution of the tasks in the
queue while allowing tasks to continue to be added queue.  Combining this
with taskqueue_drain() allows a queue to be safely disabled.  The unblock
function may run (or schedule to run) the queue when it is called, just as
calling taskqueue_enqueue() would.

Reviewed by: jhb, sam

16 years agofix botched merge of syslog support to the vendor branch; these files
sam [Tue, 25 Mar 2008 21:47:03 +0000 (21:47 +0000)]
fix botched merge of syslog support to the vendor branch; these files
were off the branch so we need to pull the changes back up

16 years agoAdd 64-bit array support for RAIDs > 2TB. This corresponds to ~ Adaptec
emaste [Tue, 25 Mar 2008 21:39:06 +0000 (21:39 +0000)]
Add 64-bit array support for RAIDs > 2TB.  This corresponds to ~ Adaptec
driver build 15317.

Tested on:
Adaptec 2230S, Firmware 4.2-0 (8205)
ICP ICP5085BL, Firmware 5.2-0 (12814)

Submitted by: Adaptec

16 years agoadd __noinline
sam [Tue, 25 Mar 2008 21:30:01 +0000 (21:30 +0000)]
add __noinline

Submitted by: imp
Reviewed by: kan (long ago)
MFC after: 3 weeks

16 years agoexpose if_purgemaddrs, it will be used by the vap code unless someone
sam [Tue, 25 Mar 2008 21:23:32 +0000 (21:23 +0000)]
expose if_purgemaddrs, it will be used by the vap code unless someone
redesigns the mcast support code in the next few weeks

MFC after: 3 weeks

16 years agoIFM_IEEE80211_IBSSMASTER hasn't been used in many years; replace it
sam [Tue, 25 Mar 2008 21:22:43 +0000 (21:22 +0000)]
IFM_IEEE80211_IBSSMASTER hasn't been used in many years; replace it
with IFM_IEEE80211_WDS which will be used by the forthcoming vap code

MFC after: 3 weeks

16 years agoenable dynamic addition of "show all" commands
sam [Tue, 25 Mar 2008 20:36:32 +0000 (20:36 +0000)]
enable dynamic addition of "show all" commands

MFC after: 3 weeks

16 years agoBring this manpage more in line with other wlan driver manpages.
brueffer [Tue, 25 Mar 2008 20:32:19 +0000 (20:32 +0000)]
Bring this manpage more in line with other wlan driver manpages.

16 years agoRegen.
jhb [Tue, 25 Mar 2008 19:35:34 +0000 (19:35 +0000)]
Regen.

16 years agoAdd entries for the cpuset-related system calls. The existing system calls
jhb [Tue, 25 Mar 2008 19:34:47 +0000 (19:34 +0000)]
Add entries for the cpuset-related system calls.  The existing system calls
can be used on little endian systems.

Pointy hat to: jeff

16 years agoCorrect data direction flags in aac_bio_command() in the
emaste [Tue, 25 Mar 2008 18:34:04 +0000 (18:34 +0000)]
Correct data direction flags in aac_bio_command() in the
!AAC_FLAGS_RAW_IO && AAC_FLAGS_SG_64BIT case.

Submitted by:   Adaptec

16 years agoAdd code that should catch the most common case when date/time is
ru [Tue, 25 Mar 2008 15:47:22 +0000 (15:47 +0000)]
Add code that should catch the most common case when date/time is
set incorrectly.

16 years agos/M_TRYWAIT/M_WAIT/
ru [Tue, 25 Mar 2008 15:44:49 +0000 (15:44 +0000)]
s/M_TRYWAIT/M_WAIT/

16 years agoCompile libthr with warnings.
ru [Tue, 25 Mar 2008 15:33:00 +0000 (15:33 +0000)]
Compile libthr with warnings.

(Somehow this file sneaked from initial commit.)

16 years agoAdd a missing ;.
remko [Tue, 25 Mar 2008 15:16:19 +0000 (15:16 +0000)]
Add a missing ;.

PR: misc/122069
Submitted by: taku@tekipaki.jp
MFC after: 3 days
Approved by: imp (mentor, implicit trivial change).

16 years agoCompile libthr with warnings.
ru [Tue, 25 Mar 2008 13:28:12 +0000 (13:28 +0000)]
Compile libthr with warnings.

16 years agoFix build.
ru [Tue, 25 Mar 2008 13:20:52 +0000 (13:20 +0000)]
Fix build.

Reported by: ache, tinderbox

16 years agoAdd /boot/device.hints to the list of files which will have local
cperciva [Tue, 25 Mar 2008 12:13:12 +0000 (12:13 +0000)]
Add /boot/device.hints to the list of files which will have local
modifications merged.  I had initially expected that people would
put any local changes into /boot/loader.conf, but it turns out that
editing /boot/device.hints is something many people do.

Suggested by: Jaakko Heinonen
MFC after: 1 week

16 years agoAdjust recognize-shared-libraries regex to avoid matching symlinks to
cperciva [Tue, 25 Mar 2008 11:31:16 +0000 (11:31 +0000)]
Adjust recognize-shared-libraries regex to avoid matching symlinks to
shared libraries.

This fixes a problem which resulted in 6.x->7.x upgrades having the
/usr/lib/libpthread.so -> libthr.so symlink missing; what happened was
that the old libpthread.so symlink pointed to /lib/libpthread.so.2 --
which matched the "/lib/*\.so\.[0-9]+" regex -- but the new symlink
didn't, so FreeBSD Update got confused and deleted the symlink as part
of its "remove old shared libraries" step.

To recreate the symlink (which I understand is necessary for ports like
KDE to build) on a 7.x system which FreeBSD Update upgraded from 6.x:
# ln -s libthr.so /usr/lib/libpthread.so

Reported by: Dmitry RCL Rekman
Help diagnosing bug from: kris
MFC after: 7 days

16 years agoFixed mis-implementation of pthread_mutex_get{spin,yield}loops_np().
ru [Tue, 25 Mar 2008 09:48:10 +0000 (09:48 +0000)]
Fixed mis-implementation of pthread_mutex_get{spin,yield}loops_np().

Reviewed by: davidxu

16 years agoReplaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
ru [Tue, 25 Mar 2008 09:39:02 +0000 (09:39 +0000)]
Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true
since the advent of MBUMA.

Reviewed by: arch

There are ongoing disputes as to whether we want to switch to directly using
UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.

16 years agoRegen after changing prototypes of cpuset_{get,set}affinity().
ru [Tue, 25 Mar 2008 09:14:17 +0000 (09:14 +0000)]
Regen after changing prototypes of  cpuset_{get,set}affinity().

16 years agoFixed type of the fourth argument of cpuset_{get,set}affinity(2) to be size_t.
ru [Tue, 25 Mar 2008 09:11:53 +0000 (09:11 +0000)]
Fixed type of the fourth argument of cpuset_{get,set}affinity(2) to be size_t.

Prodded by: davidxu

16 years agoCheck for a NULL free buffer pointer in BPF before invoking
rwatson [Tue, 25 Mar 2008 07:41:33 +0000 (07:41 +0000)]
Check for a NULL free buffer pointer in BPF before invoking
bpf_canfreebuf() in order to avoid potentially calling a non-inlinable
but trivial function in zero-copy buffer mode for every packet
received when we couldn't free the buffer anyway.

MFC after: 4 months

16 years agoAdd support for Marvell Libertas 88W8335 based PCI network adapters.
weongyo [Tue, 25 Mar 2008 06:32:33 +0000 (06:32 +0000)]
Add support for Marvell Libertas 88W8335 based PCI network adapters.

Reviewed by: sam, many wireless people
Approved by: thompsa (mentor)

16 years agoFix double patch on this file.
edwin [Tue, 25 Mar 2008 03:04:54 +0000 (03:04 +0000)]
Fix double patch on this file.

16 years agoMFV of tzdata2008a
edwin [Tue, 25 Mar 2008 02:56:25 +0000 (02:56 +0000)]
MFV of tzdata2008a

Changes:
- Calcutta -> Kolkata
- Iraq DST changes
- Syria DST changes
- Saigon -> Ho_Chi_Minh
- Cuba DST changes
- New area America/Argentina/San_Luis

Approved by: grog@ (mentor)

16 years agoSpell "blackhole" correctly and fix one grammar nit.
ru [Mon, 24 Mar 2008 22:57:55 +0000 (22:57 +0000)]
Spell "blackhole" correctly and fix one grammar nit.

16 years agoRewrite node to support multiple hooks, alike to ng_l2tp, to use one pair
mav [Mon, 24 Mar 2008 22:55:22 +0000 (22:55 +0000)]
Rewrite node to support multiple hooks, alike to ng_l2tp, to use one pair
of pptpgre and ksocket nodes for all calls between two peers. This patch
modifies node's API by adding new "session_%04x" hook names support, while
keeping backward compatibility.

Together with appropriate user-level support (by latest mpd5) it gives
huge performance benefits for case of multiple active calls between
two peers because of avoiding data duplication and extra socket processing.
On my benchmarks I have got more then 10 times speedup for the 200
simultaneous PPTP calls between two peers.
In conclusion, it allows now to build effective "clients <=> PAC <=> PNS"
setups.

16 years agoBelatedly add BPF_JITTER in NOTES for supported architectures.
jkim [Mon, 24 Mar 2008 22:23:22 +0000 (22:23 +0000)]
Belatedly add BPF_JITTER in NOTES for supported architectures.

16 years agoFix build with option BPF_JITTER.
jkim [Mon, 24 Mar 2008 22:21:32 +0000 (22:21 +0000)]
Fix build with option BPF_JITTER.

16 years agoRemove redundant inclusions of net/bpfdesc.h.
jkim [Mon, 24 Mar 2008 22:16:46 +0000 (22:16 +0000)]
Remove redundant inclusions of net/bpfdesc.h.

16 years agoThis commit was generated by cvs2svn to compensate for changes in r177580,
sam [Mon, 24 Mar 2008 21:20:35 +0000 (21:20 +0000)]
This commit was generated by cvs2svn to compensate for changes in r177580,
which included commits to RCS files with non-trunk default branches.

16 years agoadd support for driver-based RADIUS ACL's (committed on vendor branch as it's
sam [Mon, 24 Mar 2008 21:20:35 +0000 (21:20 +0000)]
add support for driver-based RADIUS ACL's (committed on vendor branch as it's
been sent upstream)

Submitted by: Chris Zimmermann

16 years agoresolve merge conflicts
sam [Mon, 24 Mar 2008 21:08:25 +0000 (21:08 +0000)]
resolve merge conflicts

MFC after: 3 weeks

16 years agoImport of hostapd 0.5.10
sam [Mon, 24 Mar 2008 21:06:16 +0000 (21:06 +0000)]
Import of hostapd 0.5.10

16 years agoThis commit was generated by cvs2svn to compensate for changes in r177576,
sam [Mon, 24 Mar 2008 21:06:16 +0000 (21:06 +0000)]
This commit was generated by cvs2svn to compensate for changes in r177576,
which included commits to RCS files with non-trunk default branches.

16 years agochange inp_wlock_assert to inp_lock_assert
kmacy [Mon, 24 Mar 2008 20:24:04 +0000 (20:24 +0000)]
change inp_wlock_assert to inp_lock_assert

16 years agoenable syslog support and add -s option to the man page
sam [Mon, 24 Mar 2008 20:19:20 +0000 (20:19 +0000)]
enable syslog support and add -s option to the man page

MFC after: 3 weeks

16 years agoThis commit was generated by cvs2svn to compensate for changes in r177572,
sam [Mon, 24 Mar 2008 20:13:41 +0000 (20:13 +0000)]
This commit was generated by cvs2svn to compensate for changes in r177572,
which included commits to RCS files with non-trunk default branches.

16 years agoadd syslog support (committed on vendor branch as it's been sent upstream)
sam [Mon, 24 Mar 2008 20:13:41 +0000 (20:13 +0000)]
add syslog support (committed on vendor branch as it's been sent upstream)

PR: bin/116190

16 years agoupdate for 0.5.10
sam [Mon, 24 Mar 2008 19:59:12 +0000 (19:59 +0000)]
update for 0.5.10

16 years agoresolve merge conflicts
sam [Mon, 24 Mar 2008 19:57:51 +0000 (19:57 +0000)]
resolve merge conflicts

MFC after: 3 weeks

16 years agoImport of WPA supplicant 0.5.10
sam [Mon, 24 Mar 2008 19:46:53 +0000 (19:46 +0000)]
Import of WPA supplicant 0.5.10

16 years agoThis commit was generated by cvs2svn to compensate for changes in r177568,
sam [Mon, 24 Mar 2008 19:46:53 +0000 (19:46 +0000)]
This commit was generated by cvs2svn to compensate for changes in r177568,
which included commits to RCS files with non-trunk default branches.

16 years agoDiff reduction to Adaptec's driver (around build 15317): catch up with a
emaste [Mon, 24 Mar 2008 19:23:33 +0000 (19:23 +0000)]
Diff reduction to Adaptec's driver (around build 15317): catch up with a
change in debugging routines.

The fwprintf macro in the AAC_DEBUG case (mapping to printf) isn't from the
Adaptec driver.

16 years agoo add M_PROTO[678]; they'll be needed by net80211 vap code
sam [Mon, 24 Mar 2008 19:01:29 +0000 (19:01 +0000)]
o add M_PROTO[678]; they'll be needed by net80211 vap code
o sort mbuf flags together and extend values to 32 bits
o write M_COPYFLAGS in terms of M_PROTOFLAGS
o move M_COPYFLAGS and M_PROTOFLAGS up to be together with flag defs

Reviewed by: rwatson
MFC after: 3 weeks

16 years ago- Const'ify the bus_stream_asi and bus_type_asi arrays.
marius [Mon, 24 Mar 2008 17:57:01 +0000 (17:57 +0000)]
- Const'ify the bus_stream_asi and bus_type_asi arrays.
- Replace hard-coded functions names missed in bus_machdep.c rev. 1.44
  with __func__.
- Break some long lines.

MFC after: 1 month

16 years ago- Take advantage of bus_dmamap_load_mbuf_sg(9).
marius [Mon, 24 Mar 2008 17:49:06 +0000 (17:49 +0000)]
- Take advantage of bus_dmamap_load_mbuf_sg(9).
- Take advantage of m_collapse(9).
- Sync with other NIC drivers and prepend a TX mbuf if the first attempt
  to load it fails with an error other than EFBIG and stop trying instead
  of freeing it and keeping on trying to enqueue more mbufs. Also ensure
  the driver queue isn't empty before trying to enqueue mbufs in order to
  reduce locking operations.
- In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1]
- Const'ify the xl_devs array.
- Remove an outdated comment.

PR: 113406 [1]
MFC after: 1 month

16 years ago- Const'ify the dc_devs array.
marius [Mon, 24 Mar 2008 17:38:24 +0000 (17:38 +0000)]
- Const'ify the dc_devs array.
- Correct the maxsize parameter when creating the mbufs busdma tag to
  reflect the actual requirement of dc(4).
- Move the KASSERT in dc_newbuf() to the right spot.
- Also convert the TX side to take advantage of bus_dmamap_load_mbuf_sg(9).
- Move the comment regarding dc_start_locked() to the right spot.

MFC after: 2 weeks

16 years agoSplit the registers into two halves in preparation for SBus support.
marius [Mon, 24 Mar 2008 17:23:53 +0000 (17:23 +0000)]
Split the registers into two halves in preparation for SBus support.

Obtained from: NetBSD (loosely)
MFC after: 2 weeks

16 years agoDiff reduction to Adaptec driver build 15317 (refactoring and code shuffling):
emaste [Mon, 24 Mar 2008 16:38:47 +0000 (16:38 +0000)]
Diff reduction to Adaptec driver build 15317 (refactoring and code shuffling):

- Resource allocation in aac_alloc (moved from from aac_init)
- Interrupt setup in aac_setup_intr (from aac_attach)
- Container probing in aac_get_container_info (from aac_startup and
  aac_handle_aif)
- Firmware status check moved to aac_check_firmware from aac_init

16 years agoFix a bug that when getting/dumping the soft lifetime we reported
bz [Mon, 24 Mar 2008 15:01:20 +0000 (15:01 +0000)]
Fix a bug that when getting/dumping the soft lifetime we reported
the hard lifetime instead.

MFC after: 3 days

16 years agoImport change from KAME, rev. 1.362 kame/kame/sys/netkey/key.c
bz [Mon, 24 Mar 2008 14:55:09 +0000 (14:55 +0000)]
Import change from KAME, rev. 1.362 kame/kame/sys/netkey/key.c

In case of "new SA", we must check the hard lifetime of the old SA
to find out if it is not permanent and we can delete it.

Submitted by: sakane via gnn
MFC after: 3 days

16 years agoDon't remove usr/include/fs/nwfs and usr/include/netncp, as they are always
antoine [Mon, 24 Mar 2008 14:46:40 +0000 (14:46 +0000)]
Don't remove usr/include/fs/nwfs and usr/include/netncp, as they are always
recreated during installworld (they are in BSD.include.dist).

Reported by: Pawel Worach
Approved by: rwatson (mentor)
X-MFC: with revision 1.13

16 years agoBump the FreeBSD version for zerocopy bpf buffers and changes to the
csjp [Mon, 24 Mar 2008 14:30:01 +0000 (14:30 +0000)]
Bump the FreeBSD version for zerocopy bpf buffers and changes to the
bpf(4) monitoring ABI/structures.

16 years agoCatch netstat up for the new bpf stats structures. Print 64 bit values
csjp [Mon, 24 Mar 2008 13:50:39 +0000 (13:50 +0000)]
Catch netstat up for the new bpf stats structures.  Print 64 bit values
properly.

Sponsored by: Seccuris Inc
MFC after: 4 months

16 years agoIntroduce support for zero-copy BPF buffering, which reduces the
csjp [Mon, 24 Mar 2008 13:49:17 +0000 (13:49 +0000)]
Introduce support for zero-copy BPF buffering, which reduces the
overhead of packet capture by allowing a user process to directly "loan"
buffer memory to the kernel rather than using read(2) to explicitly copy
data from kernel address space.

The user process will issue new BPF ioctls to set the shared memory
buffer mode and provide pointers to buffers and their size. The kernel
then wires and maps the pages into kernel address space using sf_buf(9),
which on supporting architectures will use the direct map region. The
current "buffered" access mode remains the default, and support for
zero-copy buffers must, for the time being, be explicitly enabled using
a sysctl for the kernel to accept requests to use it.

The kernel and user process synchronize use of the buffers with atomic
operations, avoiding the need for system calls under load; the user
process may use select()/poll()/kqueue() to manage blocking while
waiting for network data if the user process is able to consume data
faster than the kernel generates it. Patchs to libpcap are available
to allow libpcap applications to transparently take advantage of this
support. Detailed information on the new API may be found in bpf(4),
including specific atomic operations and memory barriers required to
synchronize buffer use safely.

These changes modify the base BPF implementation to (roughly) abstrac
the current buffer model, allowing the new shared memory model to be
added, and add new monitoring statistics for netstat to print. The
implementation, with the exception of some monitoring hanges that break
the netstat monitoring ABI for BPF, will be MFC'd.

Zerocopy bpf buffers are still considered experimental are disabled
by default. To experiment with this new facility, adjust the
net.bpf.zerocopy_enable sysctl variable to 1.

Changes to libpcap will be made available as a patch for the time being,
and further refinements to the implementation are expected.

Sponsored by: Seccuris Inc.
In collaboration with: rwatson
Tested by: pwood, gallatin
MFC after: 4 months [1]

[1] Certain portions will probably not be MFCed, specifically things
    that can break the monitoring ABI.

16 years agoFix splitting into words of the .for expression to allow for
ru [Mon, 24 Mar 2008 12:33:28 +0000 (12:33 +0000)]
Fix splitting into words of the .for expression to allow for
spaces in values.  Without this change, the following valid
call broke due to parsing of .MAKEFLAGS in bsd.symver.mk:

cd /usr/src/lib/libc && make -n DEBUG_FLAGS="-DFOO -DBAR"

Spotted by: Igor Sysoev
Submitted by: Maxim Dounin, ru
MFC after: 1 week

16 years agoFix bugs in the previous revision.
ru [Mon, 24 Mar 2008 09:47:44 +0000 (09:47 +0000)]
Fix bugs in the previous revision.

16 years agoremove unneccessary tcbinfo lock acquisitions - set tp to null affter calling enter_t...
kmacy [Mon, 24 Mar 2008 05:21:10 +0000 (05:21 +0000)]
remove unneccessary tcbinfo lock acquisitions - set tp to null affter calling enter_timewait as we no longer own the inpcb

16 years ago - Greatly simplify vget() by removing the guarantee that any new
jeff [Mon, 24 Mar 2008 04:22:58 +0000 (04:22 +0000)]
 - Greatly simplify vget() by removing the guarantee that any new
   references to a vnode with VI_OWEINACT set will force the vinactive()
   call.  The kernel makes no guarantees about which reference was the
   last to close a file or when the actual inactive processing will
   happen.  The previous code was designed to preserve existing semantics
   in the face of shared locks, however, this was unnecessary.

Discussed with: mckusick

16 years ago - Don't acquire the vnode interlock in _vn_lock() unless no lock type
jeff [Mon, 24 Mar 2008 04:17:35 +0000 (04:17 +0000)]
 - Don't acquire the vnode interlock in _vn_lock() unless no lock type
   is requested.  Handle this case specially before the while loop.
 - Use the held vnode lock to check for VI_DOOMED.  The vnode lock and
   interlock must both be held to set VI_DOOMED so either one held, even
   shared, is sufficient to check it.

No objection by: kib

16 years ago - Remove an old comment; vnodes have been working without Giant for
jeff [Mon, 24 Mar 2008 04:11:40 +0000 (04:11 +0000)]
 - Remove an old comment; vnodes have been working without Giant for
   years now.
 - Clarify the locking required for VI_DOOMED in preparation for
   simplifications to vget() and vn_lock().

16 years agoLabel inp as unused in the non-INVARIANTS case
kmacy [Mon, 24 Mar 2008 00:29:01 +0000 (00:29 +0000)]
Label inp as unused in the non-INVARIANTS case

16 years agoFirst pass at (possibly futile) microoptimizing of cpu_switch. Results
peter [Sun, 23 Mar 2008 23:09:06 +0000 (23:09 +0000)]
First pass at (possibly futile) microoptimizing of cpu_switch.  Results
are mixed.  Some pure context switch microbenchmarks show up to 29%
improvement.  Pipe based context switch microbenchmarks show up to 7%
improvement.  Real world tests are far less impressive as they are
dominated more by actual work than switch overheads, but depending on
the machine in question, workload, kernel options, phase of moon, etc, a
few percent gain might be seen.

Summary of changes:
- don't reload MSR_[FG]SBASE registers when context switching between
  non-threaded userland apps.  These typically cost 120 clock cycles each
  on an AMD cpu (less on Barcelona/Phenom).  Intel cores are probably no
  faster on this.
- The above change only helps unthreaded userland apps that tend to use
  the same value for gsbase.  Threaded apps will get no benefit from this.
- reorder things like accessing the pcb to be in memory order, to give
  prefetching a better chance of working.  Operations are now in increasing
  memory address order, rather than reverse or random.
- Push some lesser used code out of the main code paths.  Hopefully
  allowing better code density in cache lines.  This is probably futile.
- (part 2 of previous item) Reorder code so that branches have a more
  realistic static branch prediction hint.  Both Intel and AMD cpus
  default to predicting branches to lower memory addresses as being
  taken, and to higher memory addresses as not being taken.  This is
  overridden by the limited dynamic branch prediction subsystem.  A trip
  through userland might overflow this.
- Futule attempt at spreading the use of the results of previous operations
  in new operations.  Hopefully this will allow the cpus to execute in
  parallel better.
- stop wasting 16 bytes at the top of kernel stack, below the PCB.
- Never load the userland fs/gsbase registers for kthreads, but preserve
  curpcb->pcb_[fg]sbase as caches for the cpu. (Thanks Jeff!)

Microbenchmarking this code seems to be really sensitive to things like
scheduling luck, timing, cache behavior, tlb behavior, kernel options,
other random code changes, etc.

While it doesn't help heavy userland workloads much, it does help high
context switch loads a little, and should help those that involve
switching via kthreads a bit more.

A special thanks to Kris for the testing and reality checks, and Jeff for
tormenting me into doing this. :)

This is still work-in-progress.

16 years agoCorrect an error in pmap_mincore() when applied to a 2MB page mapping:
alc [Sun, 23 Mar 2008 23:04:09 +0000 (23:04 +0000)]
Correct an error in pmap_mincore() when applied to a 2MB page mapping:
Use PG_PS_FRAME, not PG_FRAME, to obtain the physical address of the
2MB physical page from the PDE.

16 years agoExport TDP_KTHREAD to asm files.
peter [Sun, 23 Mar 2008 22:46:37 +0000 (22:46 +0000)]
Export TDP_KTHREAD to asm files.

16 years agoMove pcb_flags to make trivially better use of cache lines.
peter [Sun, 23 Mar 2008 22:45:51 +0000 (22:45 +0000)]
Move pcb_flags to make trivially better use of cache lines.

16 years agoProtect the setting of the fsbase/gsbase MSR registers and the
peter [Sun, 23 Mar 2008 22:44:56 +0000 (22:44 +0000)]
Protect the setting of the fsbase/gsbase MSR registers and the
pcb_[fg]sbase values with a critical section, like the rest of the kernel.

16 years agoInsulate inpcb consumers outside the stack from the lock type and offset within the...
kmacy [Sun, 23 Mar 2008 22:34:16 +0000 (22:34 +0000)]
Insulate inpcb consumers outside the stack from the lock type and offset within the pcb by adding accessor functions.

Reviewed by: rwatson
MFC after: 3 weeks

16 years agoTo date, we have assumed that the TLB will only set the PG_M bit in a
alc [Sun, 23 Mar 2008 20:38:01 +0000 (20:38 +0000)]
To date, we have assumed that the TLB will only set the PG_M bit in a
PTE if that PTE has the PG_RW bit set.  However, this assumption does
not hold on recent processors from Intel.  For example, consider a PTE
that has the PG_RW bit set but the PG_M bit clear.  Suppose this PTE
is cached in the TLB and later the PG_RW bit is cleared in the PTE,
but the corresponding TLB entry is not (yet) invalidated.
Historically, upon a write access using this (stale) TLB entry, the
TLB would observe that the PG_RW bit had been cleared and initiate a
page fault, aborting the setting of the PG_M bit in the PTE.  Now,
however, P4- and Core2-family processors will set the PG_M bit before
observing that the PG_RW bit is clear and initiating a page fault.  In
other words, the write does not occur but the PG_M bit is still set.

The real impact of this difference is not that great.  Specifically,
we should no longer assert that any PTE with the PG_M bit set must
also have the PG_RW bit set, and we should ignore the state of the
PG_M bit unless the PG_RW bit is set.  However, these changes enable
me to remove a work-around from pmap_promote_pde(), the superpage
promotion procedure.

(Note: The AMD processors that we have tested, including the latest,
the Phenom, still exhibit the historical behavior.)

Acknowledgments: After I observed the problem, Stephan (ups) was
instrumental in characterizing the exact behavior of Intel's recent
TLBs.

Tested by: Peter Holm

16 years agoYield the cpu in the kernel while iterating the list of the
kib [Sun, 23 Mar 2008 13:45:24 +0000 (13:45 +0000)]
Yield the cpu in the kernel while iterating the list of the
vnodes belonging to the mountpoint. Also, yield when in the
softdep_process_worklist() even when we are not going to sleep due to
buffer drain.

It is believed that the ULE fixed the problem [1], but the yielding
seems to be needed at least for the 4BSD case.

Discussed: on stable@, with bde
Reviewed by: tegge, jeff [1]
MFC after: 2 weeks

16 years agoWhen updating the install list for files which have had local changes
cperciva [Sun, 23 Mar 2008 13:41:54 +0000 (13:41 +0000)]
When updating the install list for files which have had local changes
merged with upgrade changes, don't try to compute the SHA256 hash of
files which don't exist.

Reported by: Jaakko Heinonen
MFC after: 1 week

16 years ago - Restore kse.h in this directory so other tools don't find it by mistake.
jeff [Sun, 23 Mar 2008 09:38:11 +0000 (09:38 +0000)]
 - Restore kse.h in this directory so other tools don't find it by mistake.
 - Restore the ability to debug kse coredumps in 8.0.

Suggested by: marcel

16 years agoPrevent the overflow in the calculation of the next page directory.
kib [Sun, 23 Mar 2008 07:07:27 +0000 (07:07 +0000)]
Prevent the overflow in the calculation of the next page directory.
The overflow causes the wraparound with consequent corruption of the
(almost) whole address space mapping.

As Alan noted, pmap_copy() does not require the wrap-around checks
because it cannot be applied to the kernel's pmap. The checks there are
included for consistency.

Reported and tested by: kris (i386/pmap.c:pmap_remove() part)
Reviewed by: alc
MFC after: 1 week

16 years agoMSI handling on some RealTek chips are broken so disable it by
yongari [Sun, 23 Mar 2008 05:35:18 +0000 (05:35 +0000)]
MSI handling on some RealTek chips are broken so disable it by
default.

Reported by: Giulio Ferro ( auryn AT zirakzigil DOT org )
Tested by: Giulio Ferro ( auryn AT zirakzigil DOT org )

16 years agoFor MSI capable hardwares, enable MSI enable bit in RL_CFG2
yongari [Sun, 23 Mar 2008 05:31:35 +0000 (05:31 +0000)]
For MSI capable hardwares, enable MSI enable bit in RL_CFG2
register.  If MSI was disabled by hw.re.msi_disable tunable
expliclty clear the MSI enable bit.

16 years agoSome RealTek chips are known to be buggy on DAC handling, so
yongari [Sun, 23 Mar 2008 05:13:45 +0000 (05:13 +0000)]
Some RealTek chips are known to be buggy on DAC handling, so
disable DAC by default.