zec [Thu, 11 Jun 2009 17:03:15 +0000 (17:03 +0000)]
In struct thread, fields td_vnet and td_vnet_lpush may only be accessed
via curthread (via appropriate macros), so update the comment indicating
the protection model for those two fields.
zec [Thu, 11 Jun 2009 16:50:49 +0000 (16:50 +0000)]
Introduce a mechanism for detecting calls from outbound path of the
network stack when reentering the inbound path from netgraph, and
force queueing of mbufs at the outbound netgraph node.
The mechanism relies on two components. First, in netgraph nodes
where outbound path of the network stack calls into netgraph, the
current thread has to be appropriately marked using the new
NG_OUTBOUND_THREAD_REF() macro before proceeding to call further
into the netgraph topology, and unmarked using the
NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller.
Second, netgraph nodes which can potentially reenter the network
stack in the inbound path have to mark their inbound hooks using
NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will then
detect when there is a danger of a call graph looping back from
outbound to inbound path via netgraph, and defer handing off the
mbufs to the "inbound" node to a worker thread with a clean stack.
In this first pass only the most obvious netgraph nodes have been
updated to ensure no outbound to inbound calls can occur. Nodes
such as ng_ipfw, ng_gif etc. should be further examined whether a
potential for outbound to inbound call looping exists.
This commit changes the layout of struct thread, but due to
__FreeBSD_version number shortage a version bump has been omitted
at this time, nevertheless kernel and modules have to be rebuilt.
avg [Thu, 11 Jun 2009 15:07:02 +0000 (15:07 +0000)]
syslog.conf: pop up from logging only ppp messages at the end of file
This allows to append custom rules at the end of the file without
risk of confusion that can result when one misses default !ppp line
and doesn't add another program specification and thus subsequent
selector(s) would belong to ppp program block.
ed [Thu, 11 Jun 2009 13:59:51 +0000 (13:59 +0000)]
Use the documented machine constraint for SSE registers.
The amd64-specific bits of msun use an undocumented constraint, which is
less likely to be supported by other compilers (such as Clang). Change
the code to use a more common machine constraint.
bz [Thu, 11 Jun 2009 12:56:14 +0000 (12:56 +0000)]
All these Ethernet NICs depend on INET, mostly for unconditional
cksum related function calls, sometimes related to offload features
from what I could see.xi
It would be good if the offload functionality would be properly
#ifdefed but the other calls to cksum related functions are a more
general problem also elswhere in the network stack.
bz [Thu, 11 Jun 2009 12:21:41 +0000 (12:21 +0000)]
As sys/kern/uipc_accf.c depends on inet, all three accf_*
implementations do as well for accept_filt_generic_mod_event().
In addition accf_http also needs inet for the sysctl mib path.
bz [Thu, 11 Jun 2009 12:17:57 +0000 (12:17 +0000)]
ng_ipfw depends on inet and ipfirewall as well.
ng_nat depends on inet and libalias and
most of libalias depends on inet.
Update dependencies to porperly reflect this.
bz [Thu, 11 Jun 2009 10:26:38 +0000 (10:26 +0000)]
carp(4) allows people to share a set of IP addresses and can only
use IPv4/v6 for inter-node communication (according to my reading).
Properly wrap the carp callouts in INET || INET6 and refelect this
in sys/conf/files as well. While in theory this should be ok,
it might be a bit optimistic to think that carp could build with
inet6 only[1].
luigi [Thu, 11 Jun 2009 09:55:26 +0000 (09:55 +0000)]
As discussed in the devsummit, introduce two fields in the
struct bio to store classification information, and a hook
for classifier functions that can be called by g_io_request().
This code is from Fabio Checconi as part of his GSOC work.
ariff [Thu, 11 Jun 2009 09:06:09 +0000 (09:06 +0000)]
Remove custom KOBJMETHOD(), CHANNEL_DECLARE() and MIXER_DECLARE()
(enabled with SND_DEBUG) that was intended to provoke build failure
due to inconsistencies.
des [Thu, 11 Jun 2009 07:50:36 +0000 (07:50 +0000)]
As of sam's r175206, arp builds cleanly at WARNS level 6, but the Makefile
was never updated. Also, clean up the macro that caused the warning in the
first place (no functional changes, just wrapped and reindented).
sam [Thu, 11 Jun 2009 04:43:42 +0000 (04:43 +0000)]
When associating to an AP we don't know if HT is negotiated until
we receive the AssocResp, so we can only set ni_txparms properly
at that point. To make this possible make node_setuptxparms public
as ieee80211_node_setuptxparms.
jkim [Wed, 10 Jun 2009 22:54:20 +0000 (22:54 +0000)]
Catch up with r193750 (OsdSynch.c locking changes):
- Preallocate some memory for ACPI tasks early enough. We cannot use
malloc(9) any more because spin mutex may be held here. The reserved
memory can be tuned via debug.acpi.max_tasks tunable or ACPI_MAX_TASKS
in kernel configuration. The default is 32 tasks.
- Implement a custom taskqueue_fast to wrap the new memory allocation.
This implementation is not the fastest in the world but we are being
conservative here.
edwin [Wed, 10 Jun 2009 21:55:38 +0000 (21:55 +0000)]
Croatian locale support for hr_HR.ISO8859-2
Without this patch /usr/share/locale/hr_HR.ISO8859-2/LC_COLLATE
is a link to the ../la_LN.ISO8859-2/LC_COLLATE. It means
that there is no support for Croatian locale.
bz [Wed, 10 Jun 2009 21:51:05 +0000 (21:51 +0000)]
pflog, pfsync depend on pf and pf depends on inet.
Actually it could/should be inet|inet6 but the code is not there
and as long as our inet6 depends on inet this is fine.
bz [Wed, 10 Jun 2009 21:31:57 +0000 (21:31 +0000)]
Unfortunately fs/nfsserver depends on INET at the moment. It seems to
be nfs_nfsdport.c and nfs_nfsdcache.c are the problem only but we need
to mark all or we will run into problems at link time.
One is because of calling an INET specific function, the other is
because of VIMAGE putting all tcp* into struct vnet_inet.
Both are general problems throughout the entire stack and not a fault
of the NFS implementation and will need to be addressed in the future.
bz [Wed, 10 Jun 2009 21:18:21 +0000 (21:18 +0000)]
if_gre.c insists on INET:
#error "Huh? if_gre without inet?"
According to my reading we still only support encapsulating datagrams
into IPv4 and not IPv6 so there is no optional | gre inet6 yet.
rmacklem [Wed, 10 Jun 2009 21:16:39 +0000 (21:16 +0000)]
This commit is analagous to r193952, but for the experimental nfs
subsystem. Add a test for VI_DOOMED just after ncl_upgrade_vnlock() in
ncl_bioread_check_cons(). This is required since it is possible
for the vnode to be vgonel()'d while in ncl_upgrade_vnlock() when
a forced dismount is in progress. Also, move the check for VI_DOOMED
in ncl_vinvalbuf() down to after ncl_upgrade_vnlock() and replace the
out of date comment for it.
rmacklem [Wed, 10 Jun 2009 21:03:57 +0000 (21:03 +0000)]
Add a test for VI_DOOMED just after nfs_upgrade_vnlock() in
nfs_bioread_check_cons(). This is required since it is possible
for the vnode to be vgonel()'d while in nfs_upgrade_vnlock() when
a forced dismount is in progress. Also, move the check for VI_DOOMED
in nfs_vinvalbuf() down to after nfs_upgrade_vnlock() and replace the
out of date comment for it.
kib [Wed, 10 Jun 2009 20:59:32 +0000 (20:59 +0000)]
Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use
vnode interlock to protect the knote fields [1]. The locking assumes
that shared vnode lock is held, thus we get exclusive access to knote
either by exclusive vnode lock protection, or by shared vnode lock +
vnode interlock.
Do not use kl_locked() method to assert either lock ownership or the
fact that curthread does not own the lock. For shared locks, ownership
is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared
lock not owned by curthread, causing false positives in kqueue subsystem
assertions about knlist lock.
Remove kl_locked method from knlist lock vector, and add two separate
assertion methods kl_assert_locked and kl_assert_unlocked, that are
supposed to use proper asserts. Change knlist_init accordingly.
Add convenience function knlist_init_mtx to reduce number of arguments
for typical knlist initialization.
bz [Wed, 10 Jun 2009 20:57:06 +0000 (20:57 +0000)]
ip_divert.c requires both INET and IPFIREWALL to be present:
#error "IPDIVERT requires INET."
#error "IPDIVERT requires IPFIREWALL"
so properly track those depencies here.
bz [Wed, 10 Jun 2009 20:44:13 +0000 (20:44 +0000)]
IPsec depends on either IPv4 (inet) or IPv6 (inet6) so properly
track dependencies and automatically disable building ipsec if
neither of the two is in the kernel config.
rmacklem [Wed, 10 Jun 2009 19:02:09 +0000 (19:02 +0000)]
For the case where another thread was doing a connect and that
connect failed, the thread would be left stuck in msleep()
indefinitely, since it would call msleep() again for the case
where rc_client == NULL. Change the loop criteria and the if just
after the loop, so that this case is handled correctly.
jhb [Wed, 10 Jun 2009 18:27:15 +0000 (18:27 +0000)]
Change a few members of tcpcb that store cached copies of ticks to be ints
instead of unsigned longs. This fixes a few overflow edge cases on 64-bit
platforms. Specifically, if an idle connection receives a packet shortly
before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep
alive timer fires after 2^31 clock ticks, the keep alive timer will think
that the connection has been idle for a very long time and will immediately
drop the connection instead of sending a keep alive probe.
bz [Wed, 10 Jun 2009 14:36:59 +0000 (14:36 +0000)]
SCTP needs either IPv4 or IPv6 as lower layer[1].
So properly hide the already #ifdef SCTP code with
#if defined(INET) || defined(INET6) as well to get us
closer to a non-INET/INET6 kernel.
kib [Wed, 10 Jun 2009 13:57:36 +0000 (13:57 +0000)]
VOP_IOCTL takes unlocked vnode as an argument. Due to this, v_data may
be NULL or derefenced memory may become free at arbitrary moment.
Lock the vnode in cd9660, devfs and pseudofs implementation of VOP_IOCTL
to prevent reclaim; check whether the vnode was already reclaimed after
the lock is granted.
Reported by: georg at dts su
Reviewed by: des (pseudofs)
MFC after: 2 weeks
jhb [Wed, 10 Jun 2009 13:56:42 +0000 (13:56 +0000)]
Preallocate the four BARs in ALI SATA controllers during the chipinit
routine and save the resources using a chipset-data structure. Use these
preallocated resources to setup resources for the SATA channels to avoid
asking the PCI bus to allocate the same BAR multiple times.
grehan [Wed, 10 Jun 2009 12:47:54 +0000 (12:47 +0000)]
Get the gdb/psim emulator functioning again.
aim/machdep.c:
- the RI status register bit needs to be set when doing the mtmsrd 64-bit
instruction test
- psim doesn't implement the dcbz instruction so the run-time cacheline
test fails. Set the cachline size to 32 to avoid infinite loops in
future calls to __syncicache()
aim/platform_chrp.c:
- if after iterating through / and a name property of "cpus" still isn't
found, just search directly for '/cpus'.
- psim doesn't put a "reg" property on it's cpu nodes, so assume 0
since it is uniprocessor-only at this point
powerpc/openpic.c
- the number of CPUs reported is 1 too many on psim's openpic
bz [Wed, 10 Jun 2009 10:39:41 +0000 (10:39 +0000)]
Remove the "The option TCPDEBUG requires option INET." requirement.
In case of !INET we will not have a timestamp on the trace for now
but that might only affect spx debugging as long as INET6 requires
INET.
luigi [Wed, 10 Jun 2009 10:34:59 +0000 (10:34 +0000)]
small simplifications to the code in charge of reaping deleted rules:
- clear the head pointer immediately before using it, so there is
no chance of mistakes;
- call reap_rules() unconditionally. The function can handle a NULL
argument just fine, and the cost of the extra call is hardly
significant given that we do it rarely and outside the lock.
yongari [Wed, 10 Jun 2009 02:07:58 +0000 (02:07 +0000)]
Add alc(4), a driver for Atheros AR8131/AR8132 PCIe ethernet
controller. These controllers are also known as L1C(AR8131) and
L2C(AR8132) respectively. These controllers resembles the first
generation controller L1 but usage of different descriptor format
and new register mappings over L1 register space requires a new
driver. There are a couple of registers I still don't understand
but the driver seems to have no critical issues for performance and
stability. Currently alc(4) supports the following hardware
features.
o MSI
o TCP Segmentation offload
o Hardware VLAN tag insertion/stripping
o Tx/Rx interrupt moderation
o Hardware statistics counters(dev.alc.%d.stats)
o Jumbo frame
o WOL
AR8131/AR8132 also supports Tx checksum offloading but I disabled
it due to stability issues. I'm not sure this comes from broken
sample boards or hardware bugs. If you know your controller works
without problems you can still enable it. The controller has a
silicon bug for Rx checksum offloading, so the feature was not
implemented.
I'd like to say big thanks to Atheros. Atheros kindly sent sample
boards to me and answered several questions I had.
kmacy [Wed, 10 Jun 2009 01:21:32 +0000 (01:21 +0000)]
As far as I can tell systems that have less than 4GB are more often hurt
by prefetched than helped. On i386 systems and systems with less than 4GB,
prefetch is now disabled by default. I've added a prefetch enable tunable, to
enable prefetching for those systems. The prefetch disable tunable will continue
to unconditionally disable prefetching.
yongari [Wed, 10 Jun 2009 01:15:30 +0000 (01:15 +0000)]
Controller will dma SCB command status for a given command and
driver should read updated status back after issuing a SCB command.
To send a command to controller and read updated status back,
driver should synchronize both memory read and write operations
with device. Fix bus_dmamap_sync operation specifier used in
fxp_dma_wait() by adding both memory read and memory write
operations.