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
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.
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.
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.
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.
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.
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.
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]
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().
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.
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.
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).
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.
jhb [Thu, 19 Nov 2009 22:04:02 +0000 (22:04 +0000)]
- Initialize callout before it is used in atestop() during attach.
- Reorder detach so that ether_ifdetach() is called first. This removes
the race that ATE_FLAG_DETACHING closed, so that flag can be removed.
- Trim a duplicate clearing of IFF_DRV_RUNNING.
yongari [Thu, 19 Nov 2009 20:57:35 +0000 (20:57 +0000)]
Remove complex macros that were used to compute bits values.
Although these macros may have its own strength, its complex
definition make hard to read the code.
jhb [Thu, 19 Nov 2009 19:35:15 +0000 (19:35 +0000)]
Several fixes to this driver:
- Overhaul the locking to avoid recursion and add missing locking in a few
places.
- Don't schedule a task to call vge_start() from contexts that are safe to
call vge_start() directly. Just invoke the routine directly instead
(this is what all of the other NIC drivers I am familiar with do). Note
that vge(4) does not use an interrupt filter handler which is the primary
reason some other drivers use tasks.
- Add a new private timer to drive the watchdog timer instead of using
if_watchdog and if_timer.
- Fixup detach by calling ether_ifdetach() before stopping the interface.
jhb [Thu, 19 Nov 2009 19:25:47 +0000 (19:25 +0000)]
Several fixes to these drivers. Note that these two drivers are actually
just two different attachments (EISA and PCI) to a single driver.
- Add real locking. Previously these drivers only acquired their lock
in their interrupt handler or in the ioctl routine (but too broadly in
the latter). No locking was used for the stack calling down into the
driver via if_init() or if_start(), for device shutdown or detach. Also,
the interrupt handler held the driver lock while calling if_input(). All
this stuff should be fixed in the locking changes.
- Really fix these drivers to handle if_alloc(). The front-end attachments
were using if_initname() before the ifnet was allocated. Fix this by
moving some of the duplicated logic from each driver into pdq_ifattach().
While here, make pdq_ifattach() return an error so that the driver just
fails to attach if if_alloc() fails rather than panic'ing. Also, defer
freeing the ifnet until the driver has stopped using it during detach.
- Add a new private timer to drive the watchdog timer.
- Pass the softc pointer to the interrupt handlers instead of the device_t
so we can avoid the use of device_get_softc() and to better match what
other drivers do.
jhb [Thu, 19 Nov 2009 18:43:43 +0000 (18:43 +0000)]
- This driver used the if_watchdog timer both as a watchdog on transmit and
auto-negotiation. To make this simpler and easier to understand I have
split this out into two separate timers. One just manages the auto-neg
side of things and one is a transmit watchdog. Neither uses if_watchdog.
- Call ether_ifdetach() at the start of detach.
jhb [Thu, 19 Nov 2009 18:37:55 +0000 (18:37 +0000)]
- Use callout_init_mtx() instead of callout_init(..., CALLOUT_MPSAFE).
- Add a missing callout_drain() to detach.
- Hook into the stats timer and use that to drive the transmit watchdog
instead of using if_watchdog.
- Run the stats timer every second to match other drivers instead of every
other second.
- Remove dubious callout handling that stopped the timer only to start it
again while holding the driver lock without dropping it in between the
stop and the start.
jhb [Thu, 19 Nov 2009 18:21:51 +0000 (18:21 +0000)]
This driver has two modes, a netgraph mode and an ifnet mode. In the
netgraph mode it used a private timer to drive the transmit watchdog. In
the ifnet mode it used if_watchdog. Now it always uses the private timer.
bms [Thu, 19 Nov 2009 13:33:23 +0000 (13:33 +0000)]
Adapt r197135 to IPv6 stack:
Don't allow joins w/o source on an existing group.
This is almost always pilot error.
We don't need to check for group filter UNDEFINED state at t1,
because we only ever allocate filters with their groups, so we
unconditionally reject such calls with EINVAL.
Trying to change the active filter mode w/o going through IPV6_MSFILTER
is also disallowed.
bms [Thu, 19 Nov 2009 13:30:06 +0000 (13:30 +0000)]
Adapt r197132 to IPv6 stack:
Tighten input checking in in6p_join_group():
* Don't try to use the source address, when its family is unspecified.
* If we get a join without a source, on an existing inclusive
mode group, this is an error, as it would change the filter mode.
Fix a problem with the handling of in6_mfilter for new memberships:
* Do not rely on im6f being NULL; it is explicitly initialized to a
non-NULL pointer when constructing a membership.
* Explicitly initialize *im6f to EX mode when the source address
is unspecified.
This fixes a problem with in_mfilter slot recycling in the join path.
bms [Thu, 19 Nov 2009 12:18:30 +0000 (12:18 +0000)]
Adapt r197130 to IPv6 stack:
Fix an obvious logic error in the IPv4 multicast leave processing,
where the filter mode vector was not updated correctly after the leave.
jkim [Wed, 18 Nov 2009 23:40:19 +0000 (23:40 +0000)]
- Change internal function bpf_jit_compile() to return allocated size of
the generated binary and remove page size limitation for userland.
- Use contigmalloc(9)/contigfree(9) instead of malloc(9)/free(9) to make
sure the generated binary aligns properly and make it physically contiguous.
jkim [Wed, 18 Nov 2009 19:26:17 +0000 (19:26 +0000)]
- Make BPF JIT compiler working again in userland. We are limiting size of
generated native binary to page size for now.
- Update copyright date and fix some style nits.
alc [Wed, 18 Nov 2009 18:05:54 +0000 (18:05 +0000)]
Simplify both the invocation and the implementation of vm_fault() for wiring
pages.
(Note: Claims made in the comments about the handling of breakpoints in
wired pages have been false for roughly a decade. This and another bug
involving breakpoints will be fixed in coming changes.)
gonzo [Tue, 17 Nov 2009 21:56:12 +0000 (21:56 +0000)]
- Unbreak build with KLD_DEBUG defined
- Add debug.kld_debug sysctl to control KLD debugging level
- Print information about KLD dependencies with debug enabled
marius [Tue, 17 Nov 2009 21:08:10 +0000 (21:08 +0000)]
Unroll copying of the registers in {g,s}et_mcontext() and limit it
to the set actually restored by tl0_ret() instead of using the whole
trapframe. Additionally skip %g7 as that register is used as the
userland TLS pointer.
yongari [Tue, 17 Nov 2009 18:19:45 +0000 (18:19 +0000)]
It seems generation of link state change of e1000phy(4) is not
reliable on some Marvell PHYs. If msk(4) know it still does not
have established link check whether msk(4) missed the link state
change by looking into polled link state.
Reported by: Mel Flynn < mel.flynn+fbsd.current <> mailing.thruhere dot net >,
Gleb Kurtsou <gleb.kurtsou <> gmail dot com >
Tested by: Gleb Kurtsou <gleb.kurtsou <> gmail dot com >
jhb [Tue, 17 Nov 2009 16:43:02 +0000 (16:43 +0000)]
Always use a private timer instead of if_watchdog and if_timer to drive
the transmit watchdog. These drivers already used a private timer when
compiled to use Netgraph. This change just makes them always use the
private timer. Note that these drivers do not compile and are disconnected
from the build due to TTY changes.
obrien [Tue, 17 Nov 2009 16:29:39 +0000 (16:29 +0000)]
Catch up with r130332 which changed the default timezone from GMT to UTC.
Otherwise the tzload() (when called by gmtload()) fails to locate the UTC
file and loads the posixrules.
jhb [Tue, 17 Nov 2009 14:23:09 +0000 (14:23 +0000)]
Use a private callout timer to drive the transmit watchdog instead of using
if_watchdog and if_timer. The driver already contained an optional stats
timer that individual attachments could use to provide a 'tick' event. The
stats timer only ran if the tick function pointer was non-NULL and the
attachment's tick routine had to call callout_reset(), etc. Now the driver
always schedules a stat timer and manages the callout_reset() internally.
This timer is used to drive the watchdog and will also call the attachment's
'tick' handler if one is provided.