]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoIn tac_get_av_value() empty attributes should be handled like 0-length
attilio [Wed, 25 Nov 2009 14:59:28 +0000 (14:59 +0000)]
In tac_get_av_value() empty attributes should be handled like 0-length
strings rather than unset strings.
Fix the present wrong behaviour.

Obtained from: Sandvine Incorporated
Reviewed by: emaste
Sponsored by: Sandvine Incorporated
MFC: 1 week

14 years agoFix a socket leak in ftp_request() after that a connection is established.
attilio [Wed, 25 Nov 2009 14:57:07 +0000 (14:57 +0000)]
Fix a socket leak in ftp_request() after that a connection is established.

Submitted by: Sandvine Incorporated
Reviewed by: des, emaste
Sponsored by: Sandvine Incorporated
MFC: 1 week

14 years agoFix small copu-paste bug.
mav [Wed, 25 Nov 2009 14:24:14 +0000 (14:24 +0000)]
Fix small copu-paste bug.

14 years agoFix comment typo.
rwatson [Wed, 25 Nov 2009 13:31:17 +0000 (13:31 +0000)]
Fix comment typo.

Submitted by: Marc Balmer <marc at msys.ch>
MFC after: 3 days

14 years agoStyle: use structure assignment rather than memcpy() to copy a
wollman [Wed, 25 Nov 2009 04:53:38 +0000 (04:53 +0000)]
Style: use structure assignment rather than memcpy() to copy a
structure.

14 years agoIn clnt_raw_create(), avoid minor race condition initializing the
wollman [Wed, 25 Nov 2009 04:52:12 +0000 (04:52 +0000)]
In clnt_raw_create(), avoid minor race condition initializing the
file-scope variable clntraw_private.

Found by: Clang static analyzer
MFC after: 7 days

14 years agoIn svc_raw_reply(), don't leave stat uninitialized if the MSG_ACCEPTED
wollman [Wed, 25 Nov 2009 04:49:41 +0000 (04:49 +0000)]
In svc_raw_reply(), don't leave stat uninitialized if the MSG_ACCEPTED
&& SUCCESS case succeeds.  The stack garbage might be zero.

Found by: Clang static analyzer
MFC after: 7 days

14 years agoEliminate more dead stores.
wollman [Wed, 25 Nov 2009 04:45:45 +0000 (04:45 +0000)]
Eliminate more dead stores.

Found by: Clang static analyzer
MFC after: 7 days

14 years agoMake all three if conditions look similar by always initializing nsec
wollman [Wed, 25 Nov 2009 04:35:54 +0000 (04:35 +0000)]
Make all three if conditions look similar by always initializing nsec
and moving the default initialization of prec into the else clause.
The clang static analyzer erroneously thought that nsec can be used
uninitialized here; it was not actually possible, but better to make
the code clearer.  (Clang can't know that sprintf() won't modify *pi
behind the scenes.)

14 years agoIn __mbsconv(), if prec was zero, nconv could have been used
wollman [Wed, 25 Nov 2009 04:27:55 +0000 (04:27 +0000)]
In __mbsconv(), if prec was zero, nconv could have been used
uninitialized.  Initialize it to a safe value so that there's no
chance of returning an error if stack garbage happens to be equal to
(size_t)-1 or (size_t)-2.

Found by: Clang static analyzer
MFC after: 7 days

14 years agoEliminate dead store.
wollman [Wed, 25 Nov 2009 04:21:42 +0000 (04:21 +0000)]
Eliminate dead store.

Found by: Clang static analyzer
MFC after: 7 days

14 years agoMake ``ifconfig -l ether'' only list interfaces that speak Ethernet.
will [Wed, 25 Nov 2009 00:00:57 +0000 (00:00 +0000)]
Make ``ifconfig -l ether'' only list interfaces that speak Ethernet.

PR: 118987
Approved by: ken (mentor)

14 years agoMake ULE process usage (%CPU) accounting usable again by keeping track
ivoras [Tue, 24 Nov 2009 19:57:41 +0000 (19:57 +0000)]
Make ULE process usage (%CPU) accounting usable again by keeping track
of the last tick we incremented on.

Submitted by: matthew.fleming/at/isilon.com, is/at/rambler-co.ru
Reviewed by: jeff (who thinks there should be a better way in the future)
Approved by: gnn (mentor)
MFC after: 3 weeks

14 years ago- fix a LOR between process lock and pmc thread mutex
fabient [Tue, 24 Nov 2009 19:26:53 +0000 (19:26 +0000)]
- fix a LOR between process lock and pmc thread mutex
- fix a system deadlock on process exit when the sample buffer
is full (pmclog_loop blocked in fo_write) and pmcstat exit.

Reviewed by: jkoshy
MFC after: 3 weeks

14 years agoUse a single private timer to drive the transmit watchdog rather than using
jhb [Tue, 24 Nov 2009 18:34:47 +0000 (18:34 +0000)]
Use a single private timer to drive the transmit watchdog rather than using
if_watchdog and if_timer from the first port.

Reviewed by: gonzo

14 years agoBGE_FLAG_40BIT_BUG should be set before creating DMA tags.
yongari [Tue, 24 Nov 2009 17:46:58 +0000 (17:46 +0000)]
BGE_FLAG_40BIT_BUG should be set before creating DMA tags.

Pointy hat to:  yongari

14 years ago- For 350 chips, don't set various INTR bits in TX control word; turning INTR
jhb [Tue, 24 Nov 2009 16:57:35 +0000 (16:57 +0000)]
- For 350 chips, don't set various INTR bits in TX control word; turning INTR
  bits on seems to confuse hardware TX engine.
- For 350 chips, set TX desc's buffer physical address before turning on the
  TX desc valid bit.

Submitted by: Jeremy O'Brien  obrien654j | gmail, sephe
Obtained from: DragonFly BSD

14 years agoUse bus_*() rather than bus_space_*().
jhb [Tue, 24 Nov 2009 16:54:54 +0000 (16:54 +0000)]
Use bus_*() rather than bus_space_*().

14 years agoUse only lower byte of sectors_intr IDENTIFY word as sector count.
mav [Tue, 24 Nov 2009 14:06:15 +0000 (14:06 +0000)]
Use only lower byte of sectors_intr IDENTIFY word as sector count.
This fixes SET_MULTI error during boot on devices supporting less then
16 sectors per interrupt.

14 years agoGrammar and mdoc improvements.
brueffer [Tue, 24 Nov 2009 13:44:53 +0000 (13:44 +0000)]
Grammar and mdoc improvements.

MFC after: 3 days

14 years agoMFp4:
mav [Tue, 24 Nov 2009 12:47:58 +0000 (12:47 +0000)]
MFp4:
- Extend XPT-SIM transfer settings control API. Now it allows to report to
SATA SIM number of tags supported by each device, implement ATA mode and
SATA revision negotiation for both SATA and PATA SIMs.
- Make ahci(4) and siis(4) to use submitted maximum tag number, when
scheduling requests. It allows to support NCQ on devices with lower tags
count then controller supports.
- Make PMP driver to report attached devices connection speeds.
- Implement ATA mode negotiation between user settings, device and
controller capabilities.

14 years agoLSI MegaRAID 9260 works, sort the hardware list while here.
brueffer [Tue, 24 Nov 2009 08:14:22 +0000 (08:14 +0000)]
LSI MegaRAID 9260 works, sort the hardware list while here.

Submitted by: Jason <jhelfman@e-e.com>
MFC after: 3 days

14 years agoremove annoying printf that cripples kdb on PV guests
kmacy [Tue, 24 Nov 2009 07:18:38 +0000 (07:18 +0000)]
remove annoying printf that cripples kdb on PV guests

14 years agofixup kernel core dumps on paravirtual guests
kmacy [Tue, 24 Nov 2009 07:17:51 +0000 (07:17 +0000)]
fixup kernel core dumps on paravirtual guests

14 years agoImprove upon revision 196196 by removing the newly added comment
marcel [Tue, 24 Nov 2009 01:35:21 +0000 (01:35 +0000)]
Improve upon revision 196196 by removing the newly added comment
in the wrong place and instead add a KASSERT in the right place.

14 years agoDon't make MJUMPAGESIZE equal to PAGE_SIZE unconditionally.
marcel [Mon, 23 Nov 2009 23:23:05 +0000 (23:23 +0000)]
Don't make MJUMPAGESIZE equal to PAGE_SIZE unconditionally.
When PAGE_SIZE is 16K, MJUMPAGESIZE equals MJUM16BYTES and
causes build breakages.
For PAGE_SIZE < 2K, define MJUMPAGESIZE as MCLBYTES.
For PAGE_SIZE > 8K, define MJUMPAGESIZE as 8K.
Everywhere inbetween, define MJUMPAGESIZE as PAGE_SIZE.

Thus MCLBYTES <= MJUMPAGESIZE <= 8KB.

14 years agoMake this test case little bit more interesting.
jkim [Mon, 23 Nov 2009 22:28:15 +0000 (22:28 +0000)]
Make this test case little bit more interesting.

14 years ago- Add more aggressive BPF JIT optimization. This is in more favor of i386
jkim [Mon, 23 Nov 2009 22:23:19 +0000 (22:23 +0000)]
- Add more aggressive BPF JIT optimization.  This is in more favor of i386
while the previous commit was more amd64-centric.
- Use calloc(3) instead of malloc(3)/memset(3) in user land[1].

Submitted by: ed[1]

14 years agoRevert previous commit. The problem was not related to overrunning
marcel [Mon, 23 Nov 2009 21:09:23 +0000 (21:09 +0000)]
Revert previous commit. The problem was not related to overrunning
the kernel stack at all. The new USB stack simply caused a change
in timing that triggered a firmware bug more often. The addition
of PRINTF_BUFR_SIZE apparently triggered the same firmware bug
even more reliably.

But even with KSTACK_PAGES=5, one instance of the firmware bug
remained: booting with a CD inserted. This problem was run into
by accident after installing Debian and having to boot FreeBSD
to fixup the GPT partitioning (Thanks... not). After bumping
KSTACK_PAGES to 5, it was pretty unbelievable that the stack was
still being too small.

After updating the firmware we could boot with a CD inserted and
KSTACK_PAGES could be lowered back to 4 pages without problems.

Note: It is believed to be a timing related firmware bug, because
the machine check information showed access to the serial console
on one CPU and access to the EHCI HCD on the other CPU. Since
both are devices on the management unit and thus virtualized in
some way, any execution trace that does not include concurrent
access to the BMC from both CPUs is fine.

Note also that it's not understood exactly how increasing the
kernel stack avoided hitting the firmware bug. A change in page
faults does change timing, but it's not known if that's what's
happening here.

In any case: the problem is being monitored. Reverting back to
4 pages for the kernel stack is preferred, because it makes it
easier to switch to 16K pages (double the page size) without
wasting too much memory by not being able to half the number of
pages...

14 years agoActually disable interrupts in ehci_detach().
thompsa [Mon, 23 Nov 2009 18:12:09 +0000 (18:12 +0000)]
Actually disable interrupts in ehci_detach().

Reviewed by: HPS

14 years agoDo not attach JMicrons with single PCI function. They are not working as
mav [Mon, 23 Nov 2009 18:07:28 +0000 (18:07 +0000)]
Do not attach JMicrons with single PCI function. They are not working as
AHCI for some reason, even when declaring so. Let atajmicron configure
them for us and provide PATA support.

14 years agoModify the experimental nfs server so that it falls back to
rmacklem [Mon, 23 Nov 2009 16:08:15 +0000 (16:08 +0000)]
Modify the experimental nfs server so that it falls back to
using VOP_LOOKUP() when VFS_VGET() returns EOPNOTSUPP in the
ReaddirPlus RPC. This patch is based upon one by pjd@ for the
regular nfs server which has not yet been committed. It is needed
when a ZFS volume is exported and ReaddirPlus (which almost
always happens for NFSv4) is performed by a client. The patch
also simplifies vnode lock handling somewhat.

MFC after: 2 weeks

14 years agoCreate a seperate ZFS enabled loader.
rnoland [Mon, 23 Nov 2009 16:00:16 +0000 (16:00 +0000)]
Create a seperate ZFS enabled loader.

This adds zfsloader which will be called by zfsboot/gptzfsboot code rather
than the tradional loader.  This eliminates the need to set the
LOADER_ZFS_SUPPORT variable in order to get a ZFS enabled loader.

Note however, that you must reinstall your bootcode (zfsboot/gptzfsboot)
in order for the boot process to use the new loader.

New installations will no longer be required to build a ZFS enabled
loader for a working ZFS boot system.  Installing zfsboot/gptzfsboot is
sufficient for acknowledging the use of CDDL code and therefore the ZFS
enabled loader.

Based on a previous patch from jhb@

Reviewed by: jhb@
MFC after: 2 weeks

14 years agoRefer more recently added Marvell chips.
mav [Mon, 23 Nov 2009 09:02:08 +0000 (09:02 +0000)]
Refer more recently added Marvell chips.

14 years agoMake the mode setting transfer asynchronous.
thompsa [Sun, 22 Nov 2009 21:53:09 +0000 (21:53 +0000)]
Make the mode setting transfer asynchronous.

Submitted by: Rohit Grover

14 years agoReduce status block size DMAed by controller. bge(4) uses single
yongari [Sun, 22 Nov 2009 21:45:55 +0000 (21:45 +0000)]
Reduce status block size DMAed by controller. bge(4) uses single
Tx/Rx/Rx return ring such that large part of status block was not
used at all. All bge(4) controllers except BCM5700 AX/BX has a
feature to control the size of status block. So use minimum status
block size allowed in controller. This reduces number of DMAed
status block size to 32 bytes from 80 bytes.

14 years agoAdd missed register change in r199676.
thompsa [Sun, 22 Nov 2009 21:31:31 +0000 (21:31 +0000)]
Add missed register change in r199676.

Submitted by: Hans Petter Selasky

14 years agoadd support for MIDI devices without audio control stream.
thompsa [Sun, 22 Nov 2009 21:26:27 +0000 (21:26 +0000)]
add support for MIDI devices without audio control stream.

Submitted by: Hans Petter Selasky

14 years agoCorrect register access for USB device side operation on the musb controller.
thompsa [Sun, 22 Nov 2009 21:24:38 +0000 (21:24 +0000)]
Correct register access for USB device side operation on the musb controller.

Submitted by: Hans Petter Selasky

14 years agoProvide tunables for some of the usb sysctls that affect boot behaviour.
thompsa [Sun, 22 Nov 2009 21:21:22 +0000 (21:21 +0000)]
Provide tunables for some of the usb sysctls that affect boot behaviour.

Submitted by: Andriy Gapon

14 years agoAdd missing function prototype in r199671.
yongari [Sun, 22 Nov 2009 21:20:26 +0000 (21:20 +0000)]
Add missing function prototype in r199671.

14 years agoInitialise variable before use.
thompsa [Sun, 22 Nov 2009 21:19:01 +0000 (21:19 +0000)]
Initialise variable before use.

Submitted by: Hans Petter Selasky

14 years agoImprove High Speed slot allocation mechanism by moving the computation to the
thompsa [Sun, 22 Nov 2009 21:16:43 +0000 (21:16 +0000)]
Improve High Speed slot allocation mechanism by moving the computation to the
endpoint rather than per xfer and provide functions around get/free of resources.

Submitted by: Hans Petter Selasky

14 years agoImplement TSO for BCM5755 or newer controllers. Some controllers
yongari [Sun, 22 Nov 2009 21:16:30 +0000 (21:16 +0000)]
Implement TSO for BCM5755 or newer controllers. Some controllers
seem to require a special firmware to use TSO. But the firmware is
not available to FreeBSD and Linux claims that the TSO performed by
the firmware is slower than hardware based TSO. Moreover the
firmware based TSO has one known bug which can't handle TSO if
ethernet header + IP/TCP header is greater than 80 bytes. The
workaround for the TSO bug exist but it seems it's too expensive
than not using TSO at all. Some hardwares also have the TSO bug so
limit the TSO to the controllers that are not affected TSO issues
(e.g. 5755 or higher).
While I'm here set VLAN tag bit to all descriptors that belengs to
a frame instead of the first descriptor of a frame. The datasheet
is not clear how to handle VLAN tag bit but it worked either way in
my testing. This makes it simplify TSO configuration a little bit.

Big thanks to davidch@ who sent me detailed TSO information.
Without this I was not able to implement it.

Tested by: current

14 years agoFix two long standing bugs on bge(4). Most pre BCM5755 controllers
yongari [Sun, 22 Nov 2009 20:50:27 +0000 (20:50 +0000)]
Fix two long standing bugs on bge(4). Most pre BCM5755 controllers
have a DMA bug when buffer address crosses a multiple of the 4GB
boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within
4GB address for these controllers. The second DMA bug limits DMA
address to be within 40bit address space. This bug applies to
BCM5714 and BCM5715 and 5708(bce(4) controller). This is not
actually a MAC controller bug but an issue with the embedded PCIe
to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers
also limit the DMA address to be within 40bit address space.
Special thanks to davidch@ who gave me detailed errata information.
I think this change will fix long standing bge(4) instability
issues on systems with more than 4GB memory.

Reviewed by: davidch

14 years agoGarbage collect some code that was never compiled in to handle Altivec
nwhitehorn [Sun, 22 Nov 2009 20:45:15 +0000 (20:45 +0000)]
Garbage collect some code that was never compiled in to handle Altivec
during traps. It predates actual Altivec support and was never used.

14 years agoFor MSI case, interrupt is not shared and we don't need to force
yongari [Sun, 22 Nov 2009 20:31:40 +0000 (20:31 +0000)]
For MSI case, interrupt is not shared and we don't need to force
PCI flush to get correct status block update. Add an optimized
interrupt handler that is activated for MSI case. Actual interrupt
handling is done by taskqueue such that the handler does not
require driver lock for Rx path. The MSI capable bge(4) controllers
automatically disables further interrupt once it enters interrupt
state so we don't need PIO access to disable interrupt in interrupt
handler.

14 years agoCache Rx producer/Tx consumer index as soon as we know status block
yongari [Sun, 22 Nov 2009 20:02:13 +0000 (20:02 +0000)]
Cache Rx producer/Tx consumer index as soon as we know status block
update and then clear status block. Previously it used to access
these index without synchronization which may cause problems when
bounce buffers are used. Also add missing bus_dmamap_sync(9) in
polling handler. Since we now update status block in driver, adjust
bus_dmamap_sync(9) for status block.

14 years agoRearrange bge_start_locked to see we can send more frames by
yongari [Sun, 22 Nov 2009 19:44:11 +0000 (19:44 +0000)]
Rearrange bge_start_locked to see we can send more frames by
checking IFF_DRV_RUNNING and IFF_DRV_OACTIVE flags. Also if we
have less than 16 free send BDs set IFF_DRV_OACTIVE and try it
later. Previously bge(4) used to reserve 16 free send BDs after
loading dma maps but hardware just need one reserved send BD. If
prouder index has the same value of consumer index it means the Tx
queue is empty.
While I'm here check IFQ_DRV_IS_EMPTY first to save one lock
operation.

14 years agoController does not write Rx descriptors, remove BUS_DMASYNC_PREREAD.
yongari [Sun, 22 Nov 2009 19:17:32 +0000 (19:17 +0000)]
Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD.

14 years agoUse capability pointer to access PCIe registers rather than
yongari [Sun, 22 Nov 2009 19:11:34 +0000 (19:11 +0000)]
Use capability pointer to access PCIe registers rather than
directly access them at fixed address. While I'm here don't touch
other bits of PCIe device control register except max payload size.

Reviewed by: marius

14 years agoDue to newly added PCIe capabilities fallback code for finding the
yongari [Sun, 22 Nov 2009 18:47:56 +0000 (18:47 +0000)]
Due to newly added PCIe capabilities fallback code for finding the
PCIe capability did not work right on recent controllers. Remove
FreeBSD 6.x support code.

Reviewed by: marius

14 years agoFix typo introduced in r199011.
yongari [Sun, 22 Nov 2009 18:34:15 +0000 (18:34 +0000)]
Fix typo introduced in r199011.

Pointed out by: marius

14 years agoRemove extra white space.
yongari [Sun, 22 Nov 2009 18:30:19 +0000 (18:30 +0000)]
Remove extra white space.

14 years agoFix various things about SIGINT handling:
jilles [Sun, 22 Nov 2009 18:23:30 +0000 (18:23 +0000)]
Fix various things about SIGINT handling:
* exception handlers are now run with interrupts disabled, which avoids
  many race conditions
* fix some cases where SIGINT only aborts one command and continues the
  script, in particular if a SIGINT causes an EINTR error which trumped the
  interrupt.

Example:
  sh -c 'echo < /some/fifo; echo This should not be printed'
The fifo should not have writers. When pressing ctrl+c to abort the open,
the shell used to continue with the next command.

Example:
  sh -c '/bin/echo < /some/fifo; echo This should not be printed'
Similar. Note, however, that this particular case did not and does not work
in interactive mode with job control enabled.

14 years agoWhen -n is specified, attempt to turn hostnames found in utmp into IP
ume [Sun, 22 Nov 2009 16:51:44 +0000 (16:51 +0000)]
When -n is specified, attempt to turn hostnames found in utmp into IP
addresses, again.  However, change a hostname into an IP address, only
when a host has just one A/AAAA RR.

Requested by: candy__at__kgc.co.jp
MFC after: 2 weeks

14 years agosh: Ensure the same command input file is on top after executing a builtin.
jilles [Sun, 22 Nov 2009 14:04:20 +0000 (14:04 +0000)]
sh: Ensure the same command input file is on top after executing a builtin.

This avoids weirdness when 'fc -e vi' or the like is done and there is a
syntax error in the file. Formerly an interactive shell tried to execute
stuff after the syntax error and exited.

This should also avoid similar issues with 'command eval' and 'command .'
when 'command' is implemented properly as in NetBSD sh.

Special builtins did not have this problem since errors in them cause the
shell to exit or to reset various state such as the current command input
file.

14 years agoRelease over-agressive WDMA0 mode timings as close to spec as chip can.
mav [Sun, 22 Nov 2009 12:19:50 +0000 (12:19 +0000)]
Release over-agressive WDMA0 mode timings as close to spec as chip can.

14 years agoFix Intel PATA UDMA timings setting, affecting write performance.
mav [Sun, 22 Nov 2009 11:17:31 +0000 (11:17 +0000)]
Fix Intel PATA UDMA timings setting, affecting write performance.
Binary divider value 10 specified in datasheet is not a hex 0x10.
UDMA2 should be 33/2 instead of 66/4, which is documented as reverved,
UDMA4 should be 66/2 instead of 66/4, which is definitely wrong.

14 years agoAdd some missing WDMA/UDMA modes.
mav [Sun, 22 Nov 2009 10:53:26 +0000 (10:53 +0000)]
Add some missing WDMA/UDMA modes.

14 years agoThe output of perror(1) is now showing local messages for locales
edwin [Sun, 22 Nov 2009 05:17:22 +0000 (05:17 +0000)]
The output of perror(1) is now showing local messages for locales
supported by libc/nls

PR: bin/140499
Approved by: gnn@

14 years agotrap: do not consider a bad signal name a fatal error.
jilles [Sat, 21 Nov 2009 20:44:34 +0000 (20:44 +0000)]
trap: do not consider a bad signal name a fatal error.
POSIX explicitly prescribes this.
Continue processing any other signals and return status 1.

14 years agoAdd a test for r199631.
stefanf [Sat, 21 Nov 2009 14:54:35 +0000 (14:54 +0000)]
Add a test for r199631.

14 years agoHandle current work directories of arbitrary length. The argument to cd
stefanf [Sat, 21 Nov 2009 14:53:22 +0000 (14:53 +0000)]
Handle current work directories of arbitrary length.  The argument to cd
continues to be limited by PATH_MAX (1024).

Obtained from: NetBSD
PR: 104456

14 years agosh: Some changes to stderr flushing:
jilles [Sat, 21 Nov 2009 14:28:32 +0000 (14:28 +0000)]
sh: Some changes to stderr flushing:
* increase buffer size from 100 to 256 bytes
* remove implied flush from out2str(), in particular this avoids unnecessary
  flushing in the middle of a -x tracing line
* rename dprintf() to out2fmt_flush(), make it flush out2 and use this
  function in various places where flushing is desired after an error
  message

14 years agoAdd a few very basic tests for cd -{L,P} and pwd -{L,P}.
stefanf [Sat, 21 Nov 2009 14:12:51 +0000 (14:12 +0000)]
Add a few very basic tests for cd -{L,P} and pwd -{L,P}.

14 years agoFix minor resource leak in a function.
netchild [Sat, 21 Nov 2009 10:46:49 +0000 (10:46 +0000)]
Fix minor resource leak in a function.

Reviewed by: luigi
MFC after: 1 week

14 years agoAdd a note that wpa_supplicant(8) may require a full world build to
dougb [Sat, 21 Nov 2009 01:43:22 +0000 (01:43 +0000)]
Add a note that wpa_supplicant(8) may require a full world build to
sync up with 20091109.

14 years agoAdd an experimental and rudimentary JIT optimizer to reduce unncessary
jkim [Sat, 21 Nov 2009 00:19:09 +0000 (00:19 +0000)]
Add an experimental and rudimentary JIT optimizer to reduce unncessary
overhead from short BPF filter programs such as "get the first 96 bytes".

14 years agoOn the return path from F_RDAHEAD and F_READAHEAD fcntls, do not
kib [Fri, 20 Nov 2009 22:22:53 +0000 (22:22 +0000)]
On the return path from F_RDAHEAD and F_READAHEAD fcntls, do not
unlock Giant twice.

While there, bring conditions in the do/while loops closer to style,
that also makes the lines fit into 80 columns.

Reported and tested by: dougb

14 years agoPatch the experimental NFS server is a manner analagous to
rmacklem [Fri, 20 Nov 2009 21:21:13 +0000 (21:21 +0000)]
Patch the experimental NFS server is a manner analagous to
r197525, so that the creation verifier is handled correctly
in va_atime for 64bit architectures. There were two problems.
One was that the code incorrectly assumed that
sizeof (struct timespec) == 8 and the other was that the tv_sec
field needs to be assigned from a signed 32bit integer, so that
sign extension occurs on 64bit architectures. This is required
for correct operation when exporting ZFS volumes.

Reviewed by: pjd
MFC after: 2 weeks

14 years agoGeneral style cleanup, no functional change.
jkim [Fri, 20 Nov 2009 21:12:40 +0000 (21:12 +0000)]
General style cleanup, no functional change.

14 years agoRevert the previous change to pthread_once() stub in libc. It is actually
jhb [Fri, 20 Nov 2009 20:43:34 +0000 (20:43 +0000)]
Revert the previous change to pthread_once() stub in libc.  It is actually
a feature that libstdc++ depends on to simulate the behavior of libc's
internal '__isthreaded' variable.  One benefit of this is that _libc_once()
is now private to _once_stub.c.

Requested by: kan

14 years agoOnly Tx checksum offloading is supported now. Remove experimental
yongari [Fri, 20 Nov 2009 20:43:16 +0000 (20:43 +0000)]
Only Tx checksum offloading is supported now. Remove experimental
code sneaked in r199611.

14 years agoAdd __FBSDID.
yongari [Fri, 20 Nov 2009 20:40:34 +0000 (20:40 +0000)]
Add __FBSDID.

14 years agoAdd IPv4/TCP/UDP Tx checksum offloading support. It seems the
yongari [Fri, 20 Nov 2009 20:33:59 +0000 (20:33 +0000)]
Add IPv4/TCP/UDP Tx checksum offloading support. It seems the
controller also has support for IP/TCP checksum offloading for Rx
path. But I failed to find to way to enable Rx MAC to compute the
checksum of received frames.

14 years agoBecause we know received bytes including CRC there is no reason to
yongari [Fri, 20 Nov 2009 20:25:21 +0000 (20:25 +0000)]
Because we know received bytes including CRC there is no reason to
call m_adj(9). The controller also seems to have a capability to
strip CRC bytes but I failed to activate this feature except for
loopback traffic.

14 years agoAdd initial endianness support. It seems the controller supports
yongari [Fri, 20 Nov 2009 20:18:53 +0000 (20:18 +0000)]
Add initial endianness support. It seems the controller supports
both big-endian and little-endian format in descriptors for Rx path
but I couldn't find equivalent feature in Tx path. So just stick to
little-endian for now.

14 years agoRemove unnecessary structure packing.
yongari [Fri, 20 Nov 2009 20:12:37 +0000 (20:12 +0000)]
Remove unnecessary structure packing.

14 years agoReplace gmt_is_set and the gmt_mutex lock with a pthread_once_t variable and
jhb [Fri, 20 Nov 2009 19:21:33 +0000 (19:21 +0000)]
Replace gmt_is_set and the gmt_mutex lock with a pthread_once_t variable and
an init routine run on the first invocation via _once().

MFC after: 1 week

14 years agoAdd an internal _once() method. This works identical to pthread_once(3)
jhb [Fri, 20 Nov 2009 19:19:51 +0000 (19:19 +0000)]
Add an internal _once() method.  This works identical to pthread_once(3)
with the additional property that it is safe for routines in libc to use
in both single-threaded and multi-threaded processes.  Multi-threaded
processes use the pthread_once() implementation from the threading library
while single-threaded processes use a simplified "stub" version internal
to libc.  The libc stub-version of pthread_once() now also uses the
simplified "stub" version as well instead of being a nop.

Reviewed by: deischen, Matthew Fleming @ Isilon
Suggested by: alc
MFC after: 1 week

14 years agoCorrect copyright date in the BPF regression test.
jkim [Fri, 20 Nov 2009 19:01:09 +0000 (19:01 +0000)]
Correct copyright date in the BPF regression test.

14 years agoAdjust BPF JIT compiler regression tests to catch up with r199603.
jkim [Fri, 20 Nov 2009 18:53:38 +0000 (18:53 +0000)]
Adjust BPF JIT compiler regression tests to catch up with r199603.

14 years ago- Allocate scratch memory on stack instead of pre-allocating it with
jkim [Fri, 20 Nov 2009 18:49:20 +0000 (18:49 +0000)]
- Allocate scratch memory on stack instead of pre-allocating it with
the filter as we do from bpf_filter()[1].
- Revert experimental use of contigmalloc(9)/contigfree(9).  It has no
performance benefit over malloc(9)/free(9)[2].

Requested by: rwatson[1]
Pointed out by: rwatson, jhb, alc[2]

14 years agoAlways allocate PCI/ISA interrupts as shareable so that shared
marcel [Fri, 20 Nov 2009 17:59:50 +0000 (17:59 +0000)]
Always allocate PCI/ISA interrupts as shareable so that shared
interrupts don't cause driver attach failures.

14 years agoFix minor memory leak in a function.
netchild [Fri, 20 Nov 2009 15:28:38 +0000 (15:28 +0000)]
Fix minor memory leak in a function.

MFC after: 1 week

14 years agoFix minor resource leak in a function which was introduced by changing an
netchild [Fri, 20 Nov 2009 15:27:00 +0000 (15:27 +0000)]
Fix minor resource leak in a function which was introduced by changing an
err() to a return in r106254.

MFC after: 1 week

14 years agotsec: Use IFQ_DRV macros for managing interface packet queue.
raj [Fri, 20 Nov 2009 13:28:06 +0000 (13:28 +0000)]
tsec: Use IFQ_DRV macros for managing interface packet queue.

This lets tsec(4) work with ALTQ.

Submitted by: Marcin Ligenza
MFC after: 1 week

14 years agoAlways use 64-bit LBAs for disk addresses in zfsboot and gptzfsboot to
jhb [Fri, 20 Nov 2009 12:48:35 +0000 (12:48 +0000)]
Always use 64-bit LBAs for disk addresses in zfsboot and gptzfsboot to
fully support booting from large volumes.

Tested by: Emil Smolenski  ambsd of raisa.eu.org
Submitted by: Matt Reimer  mattjreimer of gmail (most of the C bits)
MFC after: 1 week

14 years agoremove volume alignment (was previously not correctly implemented)
thompsa [Fri, 20 Nov 2009 09:00:38 +0000 (09:00 +0000)]
remove volume alignment (was previously not correctly implemented)

Submitted by: HPS
Reported by: Jaakko Heinonen

14 years agoSync to P4
thompsa [Fri, 20 Nov 2009 08:57:25 +0000 (08:57 +0000)]
Sync to P4
 - fix a transfer cancelling bug/segfault [1]
 - correct a return code in the transfer cancel function.
 - add new API function, libusb20_tr_bulk_intr_sync().

Submitted by: HPS
Reported by: Robert Jenssen [1]

14 years agoNo need to include opt_kstack_pages.h, because KSTACK_PAGES is
marcel [Fri, 20 Nov 2009 07:40:02 +0000 (07:40 +0000)]
No need to include opt_kstack_pages.h, because KSTACK_PAGES is
already defined through genassym.c

14 years agoAdd a seatbelt to the Nested TLB Fault handler to give us a chance
marcel [Fri, 20 Nov 2009 03:14:54 +0000 (03:14 +0000)]
Add a seatbelt to the Nested TLB Fault handler to give us a chance
to panic when we have an unexpected TLB fault while interrupt
collection is disabled. Use a token rather than the actual address
of the restart point to avoid the need for the movl instruction.
The token is arbitrary. For the drummers: it's based on a single
paradiddle.

14 years agoMove interface reinitialization down after disabling WOL in resume
yongari [Thu, 19 Nov 2009 23:14:40 +0000 (23:14 +0000)]
Move interface reinitialization down after disabling WOL in resume
path.

14 years agoMinimize interface reinitialization by checking IFF_DRV_RUNNING
yongari [Thu, 19 Nov 2009 23:12:44 +0000 (23:12 +0000)]
Minimize interface reinitialization by checking IFF_DRV_RUNNING
flag. This fixes unnecessary interface UP/DOWNs during getting an
IP address via DHCP.

Tested by: Warren Block ( wblock<> wonkity dot com )

14 years agoFix copy & paste error and remove extra space before colon.
yongari [Thu, 19 Nov 2009 22:59:52 +0000 (22:59 +0000)]
Fix copy & paste error and remove extra space before colon.

Pointed out by: danfe

14 years agoUse capability pointer to access PCIe registers rather than
yongari [Thu, 19 Nov 2009 22:53:41 +0000 (22:53 +0000)]
Use capability pointer to access PCIe registers rather than
directly access them at fixed address. Frequently the register
offset could be changed if additional PCI capabilities are added to
controller.
One odd thing is ET_PCIR_L0S_L1_LATENCY register. I think it's PCIe
link capabilities register but the location of the register does
not match with PCIe capability pointer + offset. I'm not sure it's
shadow register of PCIe link capabilities register.

14 years ago- Hook into the existing stat timer to drive the transmit watchdog instead
jhb [Thu, 19 Nov 2009 22:14:23 +0000 (22:14 +0000)]
- Hook into the existing stat timer to drive the transmit watchdog instead
  of using if_watchdog and if_timer.
- Reorder detach to call ether_ifdetach() before anything else in tl(4)
  and wb(4).

14 years ago- Add a private timer to drive the transmit watchdog instead of using
jhb [Thu, 19 Nov 2009 22:06:40 +0000 (22:06 +0000)]
- Add a private timer to drive the transmit watchdog instead of using
  if_watchdog and if_timer.
- Fix some issues in detach for sn(4), ste(4), and ti(4).  Primarily this
  means calling ether_ifdetach() before anything else.

14 years agoUse bus_{read,write}_4 rather than bus_space_{read,write}_4.
yongari [Thu, 19 Nov 2009 22:06:19 +0000 (22:06 +0000)]
Use bus_{read,write}_4 rather than bus_space_{read,write}_4.