Commit Graph

56034 Commits

Author SHA1 Message Date
Robert Watson
64a266f9e8 Change format string for u_int64_t to %ju from %llu, in order to use the
correct format string on 64-bit systems.

Pointed out by:	pjd
2005-10-20 21:28:31 +00:00
Ruslan Ermilov
f3f9e7ae9b Remove duplicate entry. 2005-10-20 20:51:30 +00:00
Olivier Houchard
b1e157f0e6 Cleanup. 2005-10-20 20:30:51 +00:00
Bill Paul
1e956d87e1 Use sched_bind() to make sure the DPC threads are bound to the correct
processor, to insure DPC thread 0 runs on CPU0, DPC thread 1 runs on
CPU1, and so on.

Elevate the priority of the workitem threads, though don't use as
high a priority as the DPC threads.
2005-10-20 17:45:58 +00:00
Robert Watson
909ed16c2b Add a "show malloc" command to DDB, which prints out the current stats for
available kernel malloc types.  Quite useful for post-mortem debugging of
memory leaks without a dump device configured on a panicked box.

MFC after:	2 weeks
2005-10-20 17:41:47 +00:00
Robert Watson
48c5777e3d Add a "show uma" command to DDB, which prints out the current stats for
available UMA zones.  Quite useful for post-mortem debugging of memory
leaks without a dump device configured on a panicked box.

MFC after:	2 weeks
2005-10-20 16:39:33 +00:00
John Baldwin
2a2b58faa4 Add entry for the spin mutex used by the hptmv(4) driver.
MFC after: 	1 day
Tested by:	Philip Kizer pckizer at nostrum dot com
2005-10-20 14:49:59 +00:00
Marius Strobl
89189a9d8e Use an ihandle_t to store the instance handle of an opened device
instead of a phandle_t (package handle). Since both are typedefed
to unsigned int, this is more or less cosmetic.
2005-10-20 11:14:34 +00:00
Marius Strobl
e3ad728cf2 Remove unused variables. 2005-10-20 10:39:09 +00:00
Gleb Smirnoff
6bec9a1eff Some more minor cleanups of em(4) driver:
- Destroy mutex in case of attach failure. [1]
  - Lock properly em_watchdog(). [1]
  - Lock properly em_sysctl_int_delay(). [1]
  - Remove unused global adapter linked list.
  - Remove unused dma_size field from struct em_dma_alloc.
  - Do not touch interface statistics, that must be edited
    only by upper layers. [1]

Submitted by:	yongari [1]
2005-10-20 09:55:49 +00:00
Gleb Smirnoff
5422f907d4 Revamp interrupt handling in em(4) driver:
o Do not mask the RX overrun interrupt.

o Rewrite em_intr():
  - Axe EM_MAX_INTR.
  - Cycle acknowledging interrupts and processing
    packets until zero interrupt cause register is
    read.
  - If RX overrun comes in log this fact. [ NetBSD also
    resets adapter in this case, but my tests showed that
    this is not needed and only pessimizes behavior under
    heavy load. ]
  - Since almost all functions is rewritten, style the
    remaining lines.

This fixes em(4) interfaces wedging under high load.

In collaboration with:	wpaul, cognet
Obtained from:		NetBSD
2005-10-20 08:46:43 +00:00
John Polstra
135c43dc52 Fix a bug in the kernel module runtime linker that made it impossible
to unload the usb.ko module after boot if it was originally preloaded
from "/boot/loader.conf".  When processing preloaded modules, the
linker erroneously added self-dependencies the each module's reference
count.  That prevented usb.ko's reference count from ever going to 0,
so it could not be unloaded.

Sponsored by Isilon Systems.

Reviewed by:	pjd, peter
MFC after:	1 week
2005-10-19 20:40:30 +00:00
SUZUKI Shinsuke
7aa5949375 sync with KAME (nuked unused code, use NULL to denote a NULL pointer)
Obtained from: KAME
Reviewed by: ume, gnn
2005-10-19 17:18:49 +00:00
SUZUKI Shinsuke
c1a049ac20 sync with KAME (removed a unnecesary non-standard macro)
Obtained from: KAME
Reviewd by: ume, gnn
2005-10-19 16:53:24 +00:00
SUZUKI Shinsuke
d28bde669a sync with KAME regarding the following clarification in RFC3542:
- disable IPv6 operation if DAD fails for some EUI-64 link-local addresses.
 - export get_hw_ifid() (and rename it) as a subroutine for this process.

Obtained from: KAME
Reviewd by: ume, gnn
MFC after: 2 week
2005-10-19 16:43:57 +00:00
SUZUKI Shinsuke
a22adbc68c sync with KAME (don't respond to NI_QTYPE_IPV4ADDR)
Obtained from: KAME
Reviewed by: ume, gnn
2005-10-19 16:27:33 +00:00
SUZUKI Shinsuke
5b27b04579 supported an ndp command suboption to disable IPv6 in the given interface
Obtained from: KAME
Reviewd by: ume, gnn
MFC after: 2 week
2005-10-19 16:20:18 +00:00
SUZUKI Shinsuke
b9204379a1 added an ioctl option in kernel so that ndp/rtadvd can change some NDP-related kernel variables based on their configurations (RFC2461 p.43 6.2.1 mandates this for IPv6 routers)
Obtained from: KAME
Reviewd by: ume, gnn
MFC after: 2 weeks
2005-10-19 15:05:42 +00:00
Robert Watson
273ae68f43 Use svr4_si_{addr,code,errno,signo,trap} in preference to si_{...}.
Fix a debugging printf to printf after a variable is first assigned,
not before.

These are purely build fixes, and need inspection to make sure they
were what the original author of the previous changes intended.
2005-10-19 14:59:54 +00:00
Gleb Smirnoff
a7c54158fc In the em_process_receive_interrupts() cycle check the IFF_DRV_RUNNING
flag. This fixes panic, when 'ifconfig em0 down' was called and it calls
em_stop() while the em_process_receive_interrupts() has temporarily
dropped the lock.
2005-10-19 13:34:48 +00:00
SUZUKI Shinsuke
2ce62dce17 sync with KAME in the following points:
- fixed typos
- improved some comment descriptions
- use NULL, instead of 0, to denote a NULL pointer
- avoid embedding a magic number in the code
- use nd6log() instead of log() to record NDP-specific logs
- nuked an unnecessay white space

Obtained from: KAME
MFC after:  1 day
2005-10-19 10:09:19 +00:00
Robert Watson
a65e12b09d Convert if (tp->t_state == TCPS_LISTEN) panic() into a KASSERT.
MFC after:	2 weeks
2005-10-19 09:37:52 +00:00
David Xu
3e1c732ffa Fix compiling problem by adding prefix name svr4 to si_xxx macro, the
si_xxx macro should not be used in compat headers, as these are standard
member names or only can be used in our native header file signal.h.
2005-10-19 09:33:15 +00:00
Bill Paul
baa6396dc1 Correct the size used to allocate ndis_txarray. It should be
NDIS_TXPKTS now, not ndis_maxpkts.
2005-10-19 03:14:11 +00:00
SUZUKI Shinsuke
4350fcab1b Raw IPv6 checksum must use the protocol number of the last header, instead of the first next-header value.
Obtained from: KAME
MFC after: 1 day
2005-10-19 01:21:49 +00:00
Warner Losh
02341dd12e Set the name of the chipset found 2005-10-19 00:25:39 +00:00
Warner Losh
d9efa52e17 Make sure we set bst and bsh in the softc.
This gets us probing, but not attaching to, ISA cards.  More work
needed since the ISA attach routine is return ENXIO right now :-)
2005-10-19 00:18:11 +00:00
Ariff Abdullah
d45d1f2077 Fix vchan speed for hardware with discrete (non-continuous)
sampling rate:
- Improve vchan chn_setspeed() strategy. Try to avoid FEEDER_RATE
  on parent channel if the requested value is not supported
  by the hardware.
- Fix vchan default speed calculation. In any case, vchan should
  rely on parent bufsoft speed instead of bufhard since it is
  possible that the entire feeder chain might involve FEEDER_RATE.
  This is possible under extreme, rare condition if the above
  chn_setspeed() strategy failed.

Approved by:	netchild (mentor)
2005-10-18 21:33:51 +00:00
Ariff Abdullah
3f3c2c43b0 Added missing comma. This fixes compilation if we need to enable
RATE_ASSERT debug macro.

Approved by:	netchild (mentor)
2005-10-18 21:18:47 +00:00
Poul-Henning Kamp
3b72f38b5e Use correct cirteria for determining which directory entries we can
purge right away and which we merely can hide.

Beaten into my skull by:	kris
2005-10-18 20:21:25 +00:00
Jung-uk Kim
529bc4bf80 Export processor socket information. New environment variables are:
smbios.socket.enabled:		number of enabled sockets
smbios.socket.populated:	number of populated sockets
2005-10-18 20:03:31 +00:00
Bill Paul
a3ced67adf Another round of cleanups and fixes:
- Change ndis_return() from a DPC to a workitem so that it doesn't
  run at DISPATCH_LEVEL (with the dispatcher lock held).

- In if_ndis.c, submit packets to the stack via (*ifp->if_input)() in
  a workitem instead of doing it directly in ndis_rxeof(), because
  ndis_rxeof() runs in a DPC, and hence at DISPATCH_LEVEL. This
  implies that the 'dispatch level' mutex for the current CPU is
  being held, and we don't want to call if_input while holding
  any locks.

- Reimplement IoConnectInterrupt()/IoDisconnectInterrupt(). The original
  approach I used to track down the interrupt resource (by scanning
  the device tree starting at the nexus) is prone to problems when
  two devices share an interrupt. (E.g removing ndis1 might disable
  interrupts for ndis0.) The new approach is to multiplex all the
  NDIS interrupts through a common internal dispatcher (ntoskrnl_intr())
  and allow IoConnectInterrupt()/IoDisconnectInterrupt() to add or
  remove interrupts from the dispatch list.

- Implement KeAcquireInterruptSpinLock() and KeReleaseInterruptSpinLock().

- Change the DPC and workitem threads to use the KeXXXSpinLock
  API instead of mtx_lock_spin()/mtx_unlock_spin().

- Simplify the NdisXXXPacket routines by creating an actual
  packet pool structure and using the InterlockedSList routines
  to manage the packet queue.

- Only honor the value returned by OID_GEN_MAXIMUM_SEND_PACKETS
  for serialized drivers. For deserialized drivers, we now create
  a packet array of 64 entries. (The Microsoft DDK documentation
  says that for deserialized miniports, OID_GEN_MAXIMUM_SEND_PACKETS
  is ignored, and the driver for the Marvell 8335 chip, which is
  a deserialized miniport, returns 1 when queried.)

- Clean up timer handling in subr_ntoskrnl.

- Add the following conditional debugging code:
	NTOSKRNL_DEBUG_TIMERS - add debugging and stats for timers
	NDIS_DEBUG_PACKETS - add extra sanity checking for NdisXXXPacket API
	NTOSKRNL_DEBUG_SPINLOCKS - add test for spinning too long

- In kern_ndis.c, always start the HAL first and shut it down last,
  since Windows spinlocks depend on it. Ntoskrnl should similarly be
  started second and shut down next to last.
2005-10-18 19:52:15 +00:00
John Baldwin
8c4b6380c7 Move the initialization of the devmtx into the mutex_init() function
called during early init before cninit().

Tested on:	i386, alpha, sparc64
Reviewed by:	phk, imp
Reported by:	Divacky Roman xdivac02 at stud dot fit dot vutbr dot cz
MFC after:	1 week
2005-10-18 18:27:44 +00:00
Dag-Erling Smørgrav
a92fef8afc Implement the full range of ISO9660 number conversion routines in iso.h.
MFC after:	2 weeks
2005-10-18 13:35:08 +00:00
Stefan Farfeleder
dbe16e65dc Regenerate. 2005-10-18 11:49:14 +00:00
Stefan Farfeleder
d60e86c86e Const-qualify ksem_timedwait's parameter abstime as it's only passed in. 2005-10-18 11:46:24 +00:00
Yaroslav Tykhiy
e462145e3b In this case, disable wrapping of fake opt_*.h targets in
"if defined(KERNBUILDDIR)" for now since the new way of
building modules with the kernel can't handle dynamic SRCS
depending on build options yet.
2005-10-18 07:54:02 +00:00
Warner Losh
b77df65876 Don't build dc-only pseudo phy devices with mii.ko anymore 2005-10-18 06:39:30 +00:00
Yaroslav Tykhiy
3423126960 Spotted a call to a cdev-related function not wrapped
in "#ifdef KBD_INSTALL_CDEV".

Noticed by:	glebius
Uncovered by:	recent change to modules' Makefiles
2005-10-18 06:38:14 +00:00
Warner Losh
d0f68000b1 Move dc sources from pci and dev/mii into dev/dc. 2005-10-18 06:11:59 +00:00
Warner Losh
657048ce6a Move dc sources from pci to dev/dc. 2005-10-18 06:11:08 +00:00
Warner Losh
409b80f9d1 Remove dc-only pseudo phy devices after repo copy to dev/dc 2005-10-18 06:10:46 +00:00
Warner Losh
349920b201 Remove dc after repo copy. 2005-10-18 06:10:03 +00:00
Warner Losh
6a3033a8b4 Make dc compile after repo-copy. 2005-10-18 06:09:42 +00:00
Olivier Houchard
60d41c425b - Use BUS_DMASYNC_PREWRITE in em_get_buf(), as the adapter is about to read
the descriptors set.
- In em_process_receive_interrupts(), call bus_dmamap_sync() for the
descriptors set each time we modify one descriptor, instead of doing it only
at the function exit, to make sure the adapters know he can re-use the
descriptor.
This helps on arm with write-back data cache (and possibly on other arches
with bounce pages, I don't know) under heavy network load. Without this,
if we attempt to process more than num_rx_desc descriptors, the adapter
would just stop processing rx interrupts.
2005-10-18 00:42:10 +00:00
Jung-uk Kim
7c799f4520 Redo physical/logical CPU count.
Suggested by:	jhb
2005-10-17 23:23:20 +00:00
Peter Wemm
1a330eb01d Add support for kernel modules with a single PT_LOAD section.
While here, support up to four sections because it was trivial to do
and cheap. (One pointer per section).

For amd64 with "-fpic -shared" format .ko files, using a single PT_LOAD
section is important to avoid wasting about 1MB of KVM and physical ram
for the 'gap' between the two PT_LOAD sections.  amd64 normally uses
.o format kld files and isn't affected normally.  But -fpic -shared modules
are actually possible to produce and load...  (And with a bugfix to
binutils, we can build and use plain -shared .ko files without -fpic)

i386 only wastes 4K per .ko file, so that isn't such a big deal there.
2005-10-17 23:21:55 +00:00
David Xu
9313eb5537 Micro optimization for context switch. Eliminate code for saving gs.base
and fs.base. We always update pcb.pcb_gsbase and pcb.pcb_fsbase
when user wants to set them, in context switch routine, we only need to
write them into registers, we never have to read them out from registers
when thread is switched away. Since rdmsr is a serialization instruction,
micro benchmark shows it is worthy to do.

Reviewed by: peter, jhb
2005-10-17 23:10:31 +00:00
John Baldwin
05490142bb Another bit of sx(4) removal. 2005-10-17 18:35:57 +00:00
Olivier Houchard
f33ffa4a6c Strip the $a, $t and $d symbols if we're using DDB. There are useless and
confusing in a backtrace.
2005-10-17 18:31:37 +00:00