Commit Graph

73162 Commits

Author SHA1 Message Date
Paul Saab
a03fb243dc Stop asserting on exclusive locks in fsync since it can now support
shared vnode locking on ZFS.

Reviewed by:	jhb
2009-06-11 17:06:45 +00:00
Andriy Gapon
ebb6aed490 strict kobj signatures: fix legacy i386 pcib_write_config impl
Reviewed by:	imp, current@
Approved by:	jhb (mentor)
2009-06-11 17:06:31 +00:00
Andriy Gapon
446188d1e6 strict kobj signatures: fixes in agp driver
offset parameter has vm_offset_t type in calling code and in kobj method

Reviewed by:	imp, rnoland, lulf, current@
Approved by:	jhb (mentor)
2009-06-11 17:06:07 +00:00
Andriy Gapon
e76f11f441 strict kobj signatures: linker_if fixes
in symtab_get method symtab parameter is made constant as this reflects
actual intention and usage of the method

Reviewed by:	imp, current@
Approved by:	jhb (mentor)
2009-06-11 17:05:45 +00:00
Andriy Gapon
08d43f8e62 strict kobj signatures: number of fixes for arm architecture
no functional changes should result

Reviewed by:	imp, current@
Approved by:	jhb (mentor)
2009-06-11 17:05:13 +00:00
Marko Zec
c3ea428a25 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.
2009-06-11 17:03:15 +00:00
Marko Zec
f089869fa5 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.

Reviewed by:	julian, rwatson, bz
Approved by:	julian (mentor)
2009-06-11 16:50:49 +00:00
Jung-uk Kim
5d1540edf3 - Remove unnecessary read memory barriers from atomic operations[1].
- Define a macro to make my intention more clearer.

Submitted by:	jhb [1]
2009-06-11 16:48:59 +00:00
John Baldwin
a13c655c64 Correct printf format type mismatches. 2009-06-11 14:37:18 +00:00
John Baldwin
1a0e7cfc42 Trim extra ()'s.
Submitted by:	bde
2009-06-11 14:36:13 +00:00
Bjoern A. Zeeb
be7def1fe3 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.
2009-06-11 12:56:14 +00:00
Bjoern A. Zeeb
47f01ed872 if_igb.c as well as ixgbe.c uncondtionally depend on INET specific
functions, especially but not solely tcp_lro_*.
2009-06-11 12:44:13 +00:00
Bjoern A. Zeeb
ad44ffaa70 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.
2009-06-11 12:21:41 +00:00
Bjoern A. Zeeb
3cba5bde9e 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.
2009-06-11 12:17:57 +00:00
Bjoern A. Zeeb
e2ad9ba28d ip_dummynet.c depends on INET.
Note: this may be more because of improper #ifdefs these days.
2009-06-11 12:06:37 +00:00
Bjoern A. Zeeb
db4fe37e71 netinet/if_ether.c (doing ARP) depends on INET as well. 2009-06-11 12:01:14 +00:00
Bjoern A. Zeeb
313e8db56c if_enc(4) is only useful with ipsec and either inet or inet6. 2009-06-11 11:17:16 +00:00
Bjoern A. Zeeb
00e1d68223 stf(4) supports `6to4' IPv6 in IPv4 encapsulation accroding to RFC3056.
It thus needs both INET and INET6 to do its duty.
2009-06-11 11:13:35 +00:00
Bjoern A. Zeeb
044348b7b9 if_bridge(4) unfortunately is missing a lot of #ifdef INETs and
thus INET is a mandatory dependency at the moment.
2009-06-11 10:40:43 +00:00
Bjoern A. Zeeb
259d2d5431 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].

Discussed with:		mlaier [1]
2009-06-11 10:26:38 +00:00
Luigi Rizzo
6231f75bcf 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.
2009-06-11 09:55:26 +00:00
Kip Macy
e4e5e663e0 check against prefetch_enable 2009-06-11 09:51:21 +00:00
Ariff Abdullah
5870e3c990 Remove custom KOBJMETHOD(), CHANNEL_DECLARE() and MIXER_DECLARE()
(enabled with SND_DEBUG) that was intended to provoke build failure
due to inconsistencies.
2009-06-11 09:06:09 +00:00
Sam Leffler
d77148fbca 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.
2009-06-11 04:43:42 +00:00
Jung-uk Kim
3ff9febde6 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.
2009-06-10 22:54:20 +00:00
Bjoern A. Zeeb
b40b9cf1be 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.
2009-06-10 21:51:05 +00:00
Bjoern A. Zeeb
c02ec1028b Update vnet_net size guard values after r193951. 2009-06-10 21:48:13 +00:00
Bjoern A. Zeeb
d697089697 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.
2009-06-10 21:31:57 +00:00
Bjoern A. Zeeb
1aeaec56b5 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.
2009-06-10 21:18:21 +00:00
Rick Macklem
934a309971 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.

Approved by:	kib (mentor)
2009-06-10 21:16:39 +00:00
Bjoern A. Zeeb
a6c4d99869 ipfirewall insists on INET:
#error IPFIREWALL requires INET.
Track it here to not build ipfirewall with no INET in the kernel.
2009-06-10 21:06:07 +00:00
Kip Macy
3fa5485637 use default policy for enabling prefetching unless the TUNABLE is set 2009-06-10 21:05:37 +00:00
Rick Macklem
5081c8c757 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.

Submitted by:	jhb
Tested by:	pho
Approved by:	kib (mentor)
MFC after:	1 month
2009-06-10 21:03:57 +00:00
Konstantin Belousov
d8b0556c6d 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.

Submitted by:	jhb [1]
Noted by:	jhb [2]
Reviewed by:	jhb
Tested by:	rnoland
2009-06-10 20:59:32 +00:00
Bjoern A. Zeeb
5591364265 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.
2009-06-10 20:57:06 +00:00
Bjoern A. Zeeb
ba58b7afe1 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.
2009-06-10 20:44:13 +00:00
Bjoern A. Zeeb
fc228fbf49 Properly hide IPv4 only variables and functions under #ifdef INET. 2009-06-10 19:25:46 +00:00
Rick Macklem
dce35fe0ff 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.

Reviewed by:	dfr
Approved by:	kib (mentor)
2009-06-10 19:02:09 +00:00
John Baldwin
0e8cc7e748 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.

Reviewed by:	silby, gnn, lstewart
MFC after:	1 week
2009-06-10 18:27:15 +00:00
Ed Schouten
e8857e9cd4 Make the demo/stress tools build again, after my changes to param(). 2009-06-10 18:26:02 +00:00
Warner Losh
f61c07e12d These are no longer referenced in the tree, so can be safely removed.
Reviewed by:	bms@
2009-06-10 18:12:15 +00:00
Coleman Kane
badff0e4d8 Fix an LOR
Submitted by:	Paul B. Mahol <onemda@gmail.com>
MFC after:	1 week
2009-06-10 18:00:10 +00:00
Warner Losh
f3a36f8193 Move from using devclass_find_free_unit(cfi_diskclass, 0) to -1, since
they have the same basic behavior.
2009-06-10 17:41:24 +00:00
Warner Losh
70472b848c Move from using devclass_find_free_unit(ata_devclass, 0) to -1 for the
unit number.  Basically they are the same...
2009-06-10 17:40:18 +00:00
Warner Losh
61deeba0ff Eliminate devclass_find_free_unit call here, since -1 gives the same
net behavior.
2009-06-10 17:39:19 +00:00
Konstantin Belousov
5dd6aaba88 Do not leak the state->ls_lock after VI_DOOMED check introduced
in the r192683.

Reported by:	pho
Submitted by:	jhb
2009-06-10 16:17:38 +00:00
Konstantin Belousov
93bc76dc3e For cd9660_ioctl, check for recycled vnode after locking it.
Noted by:	Jaakko Heinonen <jh saunalahti fi>
MFC after:	2 weeks
2009-06-10 15:48:34 +00:00
Bjoern A. Zeeb
c03528b663 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.

Discussed with:	tuexen [1]
2009-06-10 14:36:59 +00:00
George V. Neville-Neil
74b0900f05 Add a missing error statistic, the number of FCS errors on receive.
Reviewed by:	jhb
MFC after:	1 day
2009-06-10 14:34:56 +00:00
Konstantin Belousov
d6da640860 Fix r193923 by noting that type of a_fp is struct file *, not int.
It was assumed that r193923 was trivial change that cannot be done
wrong.

MFC after:	2 weeks
2009-06-10 14:24:31 +00:00