]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 years agoThis commit was generated by cvs2svn to compensate for changes in r167802,
jkim [Thu, 22 Mar 2007 17:24:05 +0000 (17:24 +0000)]
This commit was generated by cvs2svn to compensate for changes in r167802,
which included commits to RCS files with non-trunk default branches.

17 years agoVendor import of Intel ACPI-CA 20070320
jkim [Thu, 22 Mar 2007 17:24:05 +0000 (17:24 +0000)]
Vendor import of Intel ACPI-CA 20070320

17 years ago- Simplify the #ifdef's for adaptive mutexes and rwlocks by conditionally
jhb [Thu, 22 Mar 2007 16:09:23 +0000 (16:09 +0000)]
- Simplify the #ifdef's for adaptive mutexes and rwlocks by conditionally
  defining a macro earlier in the file.
- Add NO_ADAPTIVE_RWLOCKS option to disable adaptive spinning for rwlocks.

17 years agoAdd missing \n.
pjd [Thu, 22 Mar 2007 15:42:13 +0000 (15:42 +0000)]
Add missing \n.

17 years agoMove the dom_dispose and pru_detach calls in sofree() earlier. Only after
glebius [Thu, 22 Mar 2007 13:21:24 +0000 (13:21 +0000)]
Move the dom_dispose and pru_detach calls in sofree() earlier. Only after
calling pru_detach we can be absolutely sure, that we don't have any
references to the socket in the stack.

This closes race between lockless sbdestroy() and data arriving on socket.

Reviewed by: rwatson

17 years agoWhen working on an RTM_CHANGE do the route editing in the following
glebius [Thu, 22 Mar 2007 10:51:03 +0000 (10:51 +0000)]
When working on an RTM_CHANGE do the route editing in the following
sequence. First, if rt_ifa is going to be changed, then call
ifa_rtrequest(RTM_DELETE). Second, if gateway is going to be changed,
then call rt_setgate(). Third, change rt_ifa.

With this change we are able to change a link level route to a
gateway one, that wasn't possible before:

# ifconfig em0 192.168.22.1/24
        # arp -s 192.168.22.99 00:11:22:33:44:55
        # route change 192.168.22.99 192.168.22.199
        # ping 192.168.22.99
db>

Reported by: avatar

17 years agoRemove global list of all llinfo_arp entries and use a callout per
glebius [Thu, 22 Mar 2007 10:37:53 +0000 (10:37 +0000)]
Remove global list of all llinfo_arp entries and use a callout per
instance expiry of the ARP entries. Since we no longer abuse the IPv4
radix head lock, we can now enter arp_rtrequest() with a lock held on
an arbitrary rt_entry.

Reviewed by: bms

17 years agoChange the order of lock reacquisition in vm_object_split() in order to
alc [Thu, 22 Mar 2007 07:02:43 +0000 (07:02 +0000)]
Change the order of lock reacquisition in vm_object_split() in order to
simplify the code slightly.  Add a comment concerning lock ordering.

17 years agoRename the cv_*wait*() functions to _cv_*wait*() and change their second
jhb [Wed, 21 Mar 2007 22:22:13 +0000 (22:22 +0000)]
Rename the cv_*wait*() functions to _cv_*wait*() and change their second
argument from a mutex to a lock_object.  Add cv_*wait*() wrapper macros
that accept either a mutex, rwlock, or sx lock as the second argument and
convert it to a lock_object and then call _cv_*wait*().  Basically, the
visible difference is that you can now use rwlocks and sx locks with
condition variables using the same API as with mutexes.

17 years agoMake use of 'lock_object' being the same field name in the witness_check*()
jhb [Wed, 21 Mar 2007 22:18:10 +0000 (22:18 +0000)]
Make use of 'lock_object' being the same field name in the witness_check*()
macros.
- witness_check() replaces witness_check_mtx() and
  witness_check_exclusive_sx() and checks for an exclusive acquire of
  either a mutex, rwlock, or sx lock.
- witness_check_shared() replaces witness_check_shared_sx() and checks for
  a shared acquire of either a rwlock or sx lock.

17 years agoRename the 'mtx_object', 'rw_object', and 'sx_object' members of mutexes,
jhb [Wed, 21 Mar 2007 21:20:51 +0000 (21:20 +0000)]
Rename the 'mtx_object', 'rw_object', and 'sx_object' members of mutexes,
rwlocks, and sx locks to 'lock_object'.

17 years agoDon't use cv_wait_unlock() to implement cv_wait(). Instead, implement
jhb [Wed, 21 Mar 2007 20:46:26 +0000 (20:46 +0000)]
Don't use cv_wait_unlock() to implement cv_wait().  Instead, implement
cv_wait() fully and add missing KTRACE context switch traces.

17 years agoANSIfy function declarations and remove register keywords for variables.
andre [Wed, 21 Mar 2007 19:37:55 +0000 (19:37 +0000)]
ANSIfy function declarations and remove register keywords for variables.
Consistently apply style to all function declarations.

17 years agoMatch up SYSCTL declarations in style.
andre [Wed, 21 Mar 2007 19:34:12 +0000 (19:34 +0000)]
Match up SYSCTL declarations in style.

17 years agoIf vn_open() fails during kern_open(), don't fdrop() the new file object
jhb [Wed, 21 Mar 2007 19:32:08 +0000 (19:32 +0000)]
If vn_open() fails during kern_open(), don't fdrop() the new file object
until after the call to fdclose().  This closes an obscure race that
could result in the later call to fdclose() actually closing a different
file descriptor if another thread close()'s the file descriptor being
opened before fdrop() is called, so the fdrop() in kern_open() frees the
file object, then the second thread (or a third) creates a new file
descriptor which reuses both the same index and the same file pointer
thus tricking fdclose() in the first thread into thinking that the
original file was still open.

MFC after: 1 week

17 years agoHandle the case when a thread is blocked on a lockmgr lock with LK_DRAIN
jhb [Wed, 21 Mar 2007 19:28:20 +0000 (19:28 +0000)]
Handle the case when a thread is blocked on a lockmgr lock with LK_DRAIN
in DDB's 'show sleepchain'.

MFC after: 3 days

17 years agoSubtract optlen in the maximum length check for TSO and finally avoid
andre [Wed, 21 Mar 2007 19:04:07 +0000 (19:04 +0000)]
Subtract optlen in the maximum length check for TSO and finally avoid
slightly oversized TSO mbuf chains.

Submitted by: kmacy

17 years agoTidy up IPFIREWALL_FORWARD sections and comments.
andre [Wed, 21 Mar 2007 18:56:03 +0000 (18:56 +0000)]
Tidy up IPFIREWALL_FORWARD sections and comments.

17 years agoUpdate and clarify comments in first section of tcp_input().
andre [Wed, 21 Mar 2007 18:52:58 +0000 (18:52 +0000)]
Update and clarify comments in first section of tcp_input().

17 years agoTidy up the ACCEPTCONN section of tcp_input(), ajust comments and remove
andre [Wed, 21 Mar 2007 18:49:43 +0000 (18:49 +0000)]
Tidy up the ACCEPTCONN section of tcp_input(), ajust comments and remove
old dead T/TCP code.

17 years agoFix an off-by-one error in iwi_init_fw_dma(). It didn't reuse the existing
jhb [Wed, 21 Mar 2007 18:40:31 +0000 (18:40 +0000)]
Fix an off-by-one error in iwi_init_fw_dma().  It didn't reuse the existing
DMA memory for a firmware load if it was the exact size needed, thus in the
common case the driver was constantly free'ing and reallocating the DMA
buffer and it would eventually begin to fail.  With this fix, iwi0 reuses
the same buffer the entire time and no longer fails to load the firmware
after the machine has been up for a while.

MFC after: 1 week

17 years agoTidy up tcp_log_in_vain and blackhole.
andre [Wed, 21 Mar 2007 18:36:49 +0000 (18:36 +0000)]
Tidy up tcp_log_in_vain and blackhole.

17 years agoMake TCP_DROP_SYNFIN a standard part of TCP. Disabled by default it
andre [Wed, 21 Mar 2007 18:25:28 +0000 (18:25 +0000)]
Make TCP_DROP_SYNFIN a standard part of TCP.  Disabled by default it
doesn't impede normal operation negatively and is only a few lines of
code.  It's close relatives blackhole and log_in_vain aren't options
either.

17 years agoMemory leak killing spree, mostly bus_dma(9) related.
ariff [Wed, 21 Mar 2007 18:17:03 +0000 (18:17 +0000)]
Memory leak killing spree, mostly bus_dma(9) related.

17 years agoRemove tcp_minmssoverload DoS detection logic. The problem it tried to
andre [Wed, 21 Mar 2007 18:05:54 +0000 (18:05 +0000)]
Remove tcp_minmssoverload DoS detection logic.  The problem it tried to
protect us from wasn't really there and it only bloats the code.  Should
the problem surface in the future we can simply resurrect it from cvs
history.

17 years agoanother missing change for recent crypto mods
sam [Wed, 21 Mar 2007 17:37:13 +0000 (17:37 +0000)]
another missing change for recent crypto mods

17 years agomove call to t3_prep_adapter earlier in attach before msi-x setup occurs
kmacy [Wed, 21 Mar 2007 16:40:37 +0000 (16:40 +0000)]
move call to t3_prep_adapter earlier in attach before msi-x setup occurs

this works around the fact that pci_config_{save,restore} doesn't adequately
restore state for msi-x

MFC after: 3 days

17 years agoChange acpi's handling of suballocating system resources to be a little
jhb [Wed, 21 Mar 2007 15:39:11 +0000 (15:39 +0000)]
Change acpi's handling of suballocating system resources to be a little
simpler.  It now can just use rman_is_region_manager() during
acpi_release_resource() to see if the the resource is suballocated from
a system resource.  Also, the driver no longer needs MD knowledge about
how to setup bus space tags and handles when doing a suballocation, but
can simply rely on bus_activate_resource() in the parent setting all that
up.

17 years agoChange the amd64, i386, and ia64 nexus drivers to setup bus space tags and
jhb [Wed, 21 Mar 2007 15:36:38 +0000 (15:36 +0000)]
Change the amd64, i386, and ia64 nexus drivers to setup bus space tags and
handles when activating a resource via bus_activate_resource() rather than
doing some of the work in bus_alloc_resource() and some of it in
bus_activate_resource().

One note is that when using isa_alloc_resourcev() on PC-98, drivers now
need to just use bus_release_resource() without explicitly calling
bus_deactivate_resource() first.  nyan@ has already fixed all of the PC-98
drivers.

17 years agocatchup w/ crypto changes
sam [Wed, 21 Mar 2007 14:39:39 +0000 (14:39 +0000)]
catchup w/ crypto changes

17 years agoAdd a test for IPv6 and IPsec which is similar to the one for IPv4.
gnn [Wed, 21 Mar 2007 09:39:51 +0000 (09:39 +0000)]
Add a test for IPv6 and IPsec which is similar to the one for IPv4.
Add comments to the test for IPv4 with IPsec.
MFC after: 1 week

17 years agoallocate 9 messages in all cases
kmacy [Wed, 21 Mar 2007 09:16:10 +0000 (09:16 +0000)]
allocate 9 messages in all cases

17 years agoFix a comment
kevlo [Wed, 21 Mar 2007 07:49:56 +0000 (07:49 +0000)]
Fix a comment

17 years agomake MSI-X the default and allocate up to mp_ncpus queues per port
kmacy [Wed, 21 Mar 2007 07:25:40 +0000 (07:25 +0000)]
make MSI-X the default and allocate up to mp_ncpus queues per port

MFC after: 3 days

17 years agoLet people in on the magic of INET[6]_ADDRSTRLEN which comes quite handy in
mlaier [Wed, 21 Mar 2007 05:46:18 +0000 (05:46 +0000)]
Let people in on the magic of INET[6]_ADDRSTRLEN which comes quite handy in
combination with inet_ntop().

Reviewed by: trhodes "works for me"

17 years agoadd missing file from last commit that overhauls crypto/driver api's
sam [Wed, 21 Mar 2007 03:43:33 +0000 (03:43 +0000)]
add missing file from last commit that overhauls crypto/driver api's

17 years agoOverhaul driver/subsystem api's:
sam [Wed, 21 Mar 2007 03:42:51 +0000 (03:42 +0000)]
Overhaul driver/subsystem api's:
o make all crypto drivers have a device_t; pseudo drivers like the s/w
  crypto driver synthesize one
o change the api between the crypto subsystem and drivers to use kobj;
  cryptodev_if.m defines this api
o use the fact that all crypto drivers now have a device_t to add support
  for specifying which of several potential devices to use when doing
  crypto operations
o add new ioctls that allow user apps to select a specific crypto device
  to use (previous ioctls maintained for compatibility)
o overhaul crypto subsystem code to eliminate lots of cruft and hide
  implementation details from drivers
o bring in numerous fixes from Michale Richardson/hifn; mostly for
  795x parts
o add an optional mechanism for mmap'ing the hifn 795x public key h/w
  to user space for use by openssl (not enabled by default)
o update crypto test tools to use new ioctl's and add cmd line options
  to specify a device to use for tests

These changes will also enable much future work on improving the core
crypto subsystem; including proper load balancing and interposing code
between the core and drivers to dispatch small operations to the s/w
driver as appropriate.

These changes were instigated by the work of Michael Richardson.

Reviewed by: pjd
Approved by: re

17 years agoDon't call bus_deactivate_resource() explicitly before calling
nyan [Wed, 21 Mar 2007 03:38:37 +0000 (03:38 +0000)]
Don't call bus_deactivate_resource() explicitly before calling
bus_release_resource().  This is needed for pc98 by upcoming nexus related
change.

17 years agoRemove __P
kevlo [Wed, 21 Mar 2007 03:28:16 +0000 (03:28 +0000)]
Remove __P

17 years agoRemove firmware version flags
kmacy [Wed, 21 Mar 2007 00:54:23 +0000 (00:54 +0000)]
Remove firmware version flags

MFC after: 3 days

17 years agoAdd a new apic0 psuedo-device to claim memory resources for the memory
jhb [Tue, 20 Mar 2007 21:53:31 +0000 (21:53 +0000)]
Add a new apic0 psuedo-device to claim memory resources for the memory
address ranges used by local and I/O APICs in the system.  Some systems
also reserve these ranges as system resources via either PnPBIOS or
ACPI, so this device currently attaches after acpi0 and legacy0 so that
the system resources are given precedence.

17 years agoSynchronize with version 1.0.071 of Chelsio's common code
kmacy [Tue, 20 Mar 2007 21:43:32 +0000 (21:43 +0000)]
Synchronize with version 1.0.071 of Chelsio's common code
 (with the notable exception of improvements for using multiple TX queues)

This adds support for the T3B2 ASIC rev

Obtained from: Chelsio
MFC after: 3 days

17 years agoAdd a new ram0 pseudo-device that claims memory resouces for physical
jhb [Tue, 20 Mar 2007 21:08:39 +0000 (21:08 +0000)]
Add a new ram0 pseudo-device that claims memory resouces for physical
addresses corresponding to system RAM.  On amd64 ram0 uses the SMAP
and claims all the type 1 SMAP regions.  On i386 ram0 uses the
dump_avail[] array.  Note that on i386 we have to ignore regions above
4G in PAE kernels since bus resources use longs.

17 years ago- Add macros for newly added CPUID bits in the corresponding header files.
jkim [Tue, 20 Mar 2007 20:22:45 +0000 (20:22 +0000)]
- Add macros for newly added CPUID bits in the corresponding header files.
- Use correct capticalization in xTPR as Intel uses in their documents.
- Use proper description instead of vendor code name in comment.

17 years agoTweak the probe/attach order of devices on the x86 nexus devices.
jhb [Tue, 20 Mar 2007 20:21:44 +0000 (20:21 +0000)]
Tweak the probe/attach order of devices on the x86 nexus devices.
Various BIOS-related psuedo-devices are added at an order of 5.  acpi0 is
added at an order of 10, and legacy0 is added at an order of 11.

17 years agoMFi386 1.173: Display two new Intel feature bits.
jhb [Tue, 20 Mar 2007 18:48:04 +0000 (18:48 +0000)]
MFi386 1.173: Display two new Intel feature bits.

17 years agoMake the m_pullup() diagnostic message compile-time conditional on DIAGNOSTIC.
bms [Tue, 20 Mar 2007 14:29:54 +0000 (14:29 +0000)]
Make the m_pullup() diagnostic message compile-time conditional on DIAGNOSTIC.

Requested by: glebius

17 years agoIncrease default size of raw IP send and receive buffers to the same as
bms [Tue, 20 Mar 2007 13:15:20 +0000 (13:15 +0000)]
Increase default size of raw IP send and receive buffers to the same as
udp_sendspace, to avoid a situation where jumbograms (datagrams > 9KB)
are unnecessarily fragmented.

A common use case for this is OSPF link-state database synchronization
during adjacency bringup on a high speed network with a large MTU.

It is not possible to auto-tune this setting until a socket is bound to
a given interface, and because the laddr part of the inpcb tuple may be
overridden, it makes no sense to do so. Applications may request a larger
socket buffer size by using the SO_SENDBUF and SO_RECVBUF socket options.

Certain applications such as Quagga ospfd do not probe for interface MTU
and therefore do not increase SO_SENDBUF in this use case.
XORP is not affected by this problem as it preemptively uses SO_SENDBUF
and SO_RECVBUF to account for any possible additional latency in XRL IPC.

PR: kern/108375
Requested by: Vladimir Ivanov
MFC after: 1 week

17 years agoPut a temporary bandaid to set/reset uncacheable DMA region (affected
ariff [Tue, 20 Mar 2007 11:24:29 +0000 (11:24 +0000)]
Put a temporary bandaid to set/reset uncacheable DMA region (affected
on amd64 and i386) until we gain proper BUS_DMA_NOCACHE support.
(in progress).

Tested by: rafan, infofarmer, Nguyen Tam Chinh <unixvn@gmail.com>
Tested on: amd64, i386

17 years agoMark UFS as being MP-Safe in "options QUOTA" case too. Remove no more
kib [Tue, 20 Mar 2007 10:51:45 +0000 (10:51 +0000)]
Mark UFS as being MP-Safe in "options QUOTA" case too. Remove no more
neccessary Giant acquisions in softdepend processing code.

Tested by: Peter Holm
Reviewed by: tegge
Approved by: re (kensmith)

17 years ago- window update sacks sent incorrectly after
rrs [Tue, 20 Mar 2007 10:23:11 +0000 (10:23 +0000)]
- window update sacks sent incorrectly after
  shutdown which caused extra abort from peer.
- RTT time calculation was not being done in
  express sack handling since it refered to an unused
  variable (rto_pending). Removed variable.
- socket buffer high water access macro-ized.

17 years agoAdds missing flight size logging option for SCTP.
rrs [Tue, 20 Mar 2007 10:19:09 +0000 (10:19 +0000)]
Adds missing flight size logging option for SCTP.

17 years agocxgb_stop is only called from cxgb_ioctl so:
kmacy [Tue, 20 Mar 2007 06:21:47 +0000 (06:21 +0000)]
cxgb_stop is only called from cxgb_ioctl so:
- don't acquire port lock, already held in ioctl
- rename to cxgb_stop_locked
- switch callout_drain to callout_stop to avoid a hang from having the port lock held

17 years agoAvoid using vsnprintf(3) unless MALLOC_STATS is defined, in order to
jasone [Tue, 20 Mar 2007 03:44:10 +0000 (03:44 +0000)]
Avoid using vsnprintf(3) unless MALLOC_STATS is defined, in order to
avoid substantial potential bloat for static binaries that do not
otherwise use any printf(3)-family functions. [1]

Rearrange arena_run_t so that the region bitmask can be minimally sized
according to constraints related to each bin's size class.  Previously,
the region bitmask was the same size for all run headers, which wasted
a measurable amount of memory.

Rather than making runs for small objects as large as possible, make
runs as small as possible such that header overhead stays below a
certain bound.  There are two exceptions that override the header
overhead bound:

1) If the bound is impossible to honor, it is relaxed on a
   per-size-class basis.  Since there is one bit of header
   overhead per object (plus a constant), it is impossible to
   achieve a header overhead less than or equal to 1/(# of bits
   per object).  For the current setting of maximum 0.5% header
   overhead, this relaxation comes into play for {2, 4, 8,
   16}-byte objects, for which header overhead is (on 64-bit
   systems) {7.1, 4.3, 2.2, 1.2}%, respectively.

2) There is still a cap on small run size, still set to 64kB.
   This comes into play for {1024, 2048}-byte objects, for which
   header overhead is {1.6, 3.1}%, respectively.

In practice, this reduces the run sizes, which makes worst case
low-water memory usage due to fragmentation less bad.  It also reduces
worst case high-water run fragmentation due to non-full runs, but this
is only a constant improvement (most important to small short-lived
processes).

Reduce the default chunk size from 2MB to 1MB.  Benchmarks indicate that
the external fragmentation reduction makes 1MB the new sweet spot (as
small as possible without adversely affecting performance).

Reported by: [1] kientzle

17 years agoFix tinderbox; ng_ether needs to see if_findmulti().
bms [Tue, 20 Mar 2007 03:15:43 +0000 (03:15 +0000)]
Fix tinderbox; ng_ether needs to see if_findmulti().

17 years agoUse -M and -N for core and kernel image respectively.
bms [Tue, 20 Mar 2007 02:08:28 +0000 (02:08 +0000)]
Use -M and -N for core and kernel image respectively.

17 years agoIf we got an OBE/IBF event, we failed to re-enable the GPE. This would
njl [Tue, 20 Mar 2007 00:58:19 +0000 (00:58 +0000)]
If we got an OBE/IBF event, we failed to re-enable the GPE.  This would
cause the EC to stop handling future events because the GPE stayed masked.
Set a flag when queueing a GPE handler since it will ultimately re-enable
the GPE.  In all other cases, re-enable it ourselves.  I reworked the
patch from the submitter.

Submitted by: Rong-en Fan <grafan@gmail.com>

17 years agoImplement reference counting for ifmultiaddr, in_multi, and in6_multi
bms [Tue, 20 Mar 2007 00:36:10 +0000 (00:36 +0000)]
Implement reference counting for ifmultiaddr, in_multi, and in6_multi
structures. Detect when ifnet instances are detached from the network
stack and perform appropriate cleanup to prevent memory leaks.

This has been implemented in such a way as to be backwards ABI compatible.
Kernel consumers are changed to use if_delmulti_ifma(); in_delmulti()
is unable to detect interface removal by design, as it performs searches
on structures which are removed with the interface.

With this architectural change, the panics FreeBSD users have experienced
with carp and pfsync should be resolved.

Obtained from: p4 branch bms_netdev
Reviewed by: andre
Sponsored by: Garance A Drosehn
Idea from: NetBSD
MFC after: 1 month

17 years agoRevert couple of changes from 1.51 and 1.52. Reading link status with BMSR
jkim [Mon, 19 Mar 2007 23:17:39 +0000 (23:17 +0000)]
Revert couple of changes from 1.51 and 1.52.  Reading link status with BMSR
is okay for most of the chipsets but BCM5701 PHY does not seem to like it.
Set media to IFM_NONE if link is not up instead of the previous value.

Reported by: Goran Lowkrantz (goran dot lowkrantz at ismobile dot com)

17 years agoetherbroadcastaddr is now unused.
thompsa [Mon, 19 Mar 2007 19:20:35 +0000 (19:20 +0000)]
etherbroadcastaddr is now unused.

17 years agoM_BCAST & M_MCAST are now set by ether_input before passing to the bridge.
thompsa [Mon, 19 Mar 2007 19:13:02 +0000 (19:13 +0000)]
M_BCAST & M_MCAST are now set by ether_input before passing to the bridge.

17 years agoMatch up SYSCTL declaration style.
andre [Mon, 19 Mar 2007 19:00:51 +0000 (19:00 +0000)]
Match up SYSCTL declaration style.

17 years agoWhen we write extended attributes, assert that the inode hasn't
brian [Mon, 19 Mar 2007 18:51:02 +0000 (18:51 +0000)]
When we write extended attributes, assert that the inode hasn't
already been deleted.  The assertion is important to show that
we won't end up accounting for extended attribute blocks (using
fs_pendingblocks) in our subsequent call to fs_alloc().

Agreed verbally by: mckusick

MFC after: 3 weeks

17 years agoMatch up SYSCTL_INT declarations in style.
andre [Mon, 19 Mar 2007 18:42:27 +0000 (18:42 +0000)]
Match up SYSCTL_INT declarations in style.

17 years agoSpace to tab in SB_* defines to match with rest of file.
andre [Mon, 19 Mar 2007 18:40:31 +0000 (18:40 +0000)]
Space to tab in SB_* defines to match with rest of file.

17 years agoClean up the ether_input() path by using the M_PROMISC flag.
bms [Mon, 19 Mar 2007 18:39:36 +0000 (18:39 +0000)]
Clean up the ether_input() path by using the M_PROMISC flag.

Main points of this change:
 * Drop frames immediately if the interface is not marked IFF_UP.
 * Always trim off the frame checksum if present.
 * Always use M_VLANTAG in preference to passing 802.1Q frames
   to consumers.
 * Use __func__ consistently for KASSERT().
 * Use the M_PROMISC flag to detect situations where ether_input()
   may reenter itself on the same call graph with the same mbuf which
   was promiscuously received on behalf of subsystems such as
   netgraph, carp, and vlan.
 * 802.1P frames (that is, VLAN frames with an ID of 0) will now be
   passed to layer 3 input paths.
 * Deal with the special case for CARP in a sane way.

This is a significant rewrite of code on the critical path. Please report
any issues to me if they arise. Frames will now only pass through dummynet
if M_PROMISC is cleared, to avoid problems with re-entry.

The handling of CARP needs to be revisited architecturally. The M_PROMISC
flag may potentially be demoted to a link-layer flag only as it is in
NetBSD, where the idea originated.

Discussed on: net
Idea from: NetBSD
Reviewed by: yar
MFC after: 1 month

17 years agoMaintain a pointer and offset pair into the socket buffer mbuf chain to
andre [Mon, 19 Mar 2007 18:35:13 +0000 (18:35 +0000)]
Maintain a pointer and offset pair into the socket buffer mbuf chain to
avoid traversal of the entire socket buffer for larger offsets on stream
sockets.

Adjust tcp_output() make use of it.

Tested by: gallatin

17 years agoDocument net.link.tap.up_on_open.
bms [Mon, 19 Mar 2007 18:27:00 +0000 (18:27 +0000)]
Document net.link.tap.up_on_open.

PR: 110383
Submitted by: Frank Behrens
MFC after: 2 weeks

17 years agoAdd a sysctl net.link.tap.up_on_open which defaults to zero; when it
bms [Mon, 19 Mar 2007 18:17:31 +0000 (18:17 +0000)]
Add a sysctl net.link.tap.up_on_open which defaults to zero; when it
is non-zero, tap(4) instances will be marked IFF_UP on attach.

PR: 110383
Requested by: Frank Behrens
MFC after: 2 weeks

17 years agoMake clean for !INET6.
bms [Mon, 19 Mar 2007 18:13:02 +0000 (18:13 +0000)]
Make clean for !INET6.
Remove non-FreeBSD code.
Sort includes.

17 years agoNow <net/if_arp.h> is unused here.
yar [Mon, 19 Mar 2007 18:01:39 +0000 (18:01 +0000)]
Now <net/if_arp.h> is unused here.

17 years agoTeach pfsync(4) that its member interfaces may go away.
bms [Mon, 19 Mar 2007 17:52:15 +0000 (17:52 +0000)]
Teach pfsync(4) that its member interfaces may go away.

This change partially resolves the issue in the PR. Further architectural
fixes, in the form of reference counting, are needed.

PR: 86848
Reviewed by: yar
MFC after: 1 month

17 years agoif_vlan no more depends on INET.
yar [Mon, 19 Mar 2007 17:34:31 +0000 (17:34 +0000)]
if_vlan no more depends on INET.

17 years agoFix a nameless constant: 6 -> ETHER_ADDR_LEN
yar [Mon, 19 Mar 2007 16:58:07 +0000 (16:58 +0000)]
Fix a nameless constant: 6 -> ETHER_ADDR_LEN

Tested with: md5(1)

17 years agoMerge latest ifmcstat (with changes for FreeBSD).
bms [Mon, 19 Mar 2007 16:45:06 +0000 (16:45 +0000)]
Merge latest ifmcstat (with changes for FreeBSD).
Possibly merge or split with netstat -g.

TODO: Make !defined(INET6) clean.
TODO: Add -M/-N instead of -k.
TODO: Use sysctls instead of kvm.

Obtained from: KAME
MFC after: 2 weeks

17 years agoOne more s/ethernet/Ethernet/ I missed in the previous revision.
brueffer [Mon, 19 Mar 2007 16:36:34 +0000 (16:36 +0000)]
One more s/ethernet/Ethernet/ I missed in the previous revision.

17 years agoNow that this driver uses ether_ioctl(), it no longer needs
yar [Mon, 19 Mar 2007 16:31:28 +0000 (16:31 +0000)]
Now that this driver uses ether_ioctl(), it no longer needs
the INET related include files.

17 years agoDestroy channel DMA tag during resource cleanup.
ariff [Mon, 19 Mar 2007 16:06:26 +0000 (16:06 +0000)]
Destroy channel DMA tag during resource cleanup.

17 years agoImprove previous commit by using setusercontext(3) and removing the group
trhodes [Mon, 19 Mar 2007 12:12:53 +0000 (12:12 +0000)]
Improve previous commit by using setusercontext(3) and removing the group
option.  Bump doc date for manual page changes.

Reviewed by: rwatson, ru, will (older version)

17 years agolibarchive.so.3 was turned to libarchive.so.4 by
delphij [Mon, 19 Mar 2007 11:15:53 +0000 (11:15 +0000)]
libarchive.so.3 was turned to libarchive.so.4 by
the src/lib/libarchive/Makefile,v 1.59 change, so
reflect this.

17 years agoAdds a hash table to speed local address lookup
rrs [Mon, 19 Mar 2007 11:11:16 +0000 (11:11 +0000)]
Adds a hash table to speed local address lookup
on a per VRF basis (BSD has only one VRF currently).
Hash table is sized to 16 but may need to be adjusted
for machines with large numbers of addresses.
Reviewed by: gnn

17 years ago - Remove an unneeded comma
delphij [Mon, 19 Mar 2007 07:49:11 +0000 (07:49 +0000)]
 - Remove an unneeded comma
 - Remove a redundant .Xc
 - Spell "Largely" as it should.

17 years ago- errno -> becomes error in sctp_output.c and sctputil.c
rrs [Mon, 19 Mar 2007 06:53:02 +0000 (06:53 +0000)]
- errno -> becomes error in sctp_output.c and sctputil.c
- SB_CLEAR macro defined and used for sb clearing.
- Fix for CMT express_sack_handling did not do proper
  pseudo-cumack updates.
- Get rid of extraneous function that was never used ip_2_ip6_hdr()
- Fixed source address selection bug (initialization problem).
- Source address selection debug added.

17 years agodisplay two new Intel feature bits
sam [Mon, 19 Mar 2007 05:23:42 +0000 (05:23 +0000)]
display two new Intel feature bits

Submitted by: "Rui Paulo" <rpaulo@gmail.com>
MFC after: 2 weeks

17 years agoCorrect a typo.
jkoshy [Mon, 19 Mar 2007 03:52:20 +0000 (03:52 +0000)]
Correct a typo.

Submitted by:  Kai Wang <kaiw27 at gmail dot com>

17 years agoPoll only while interrupt is disabled.
simokawa [Mon, 19 Mar 2007 03:41:27 +0000 (03:41 +0000)]
Poll only while interrupt is disabled.

MFC: 3 days after

17 years agoWait SCLK to be stable after LPS enabled.
simokawa [Mon, 19 Mar 2007 03:35:45 +0000 (03:35 +0000)]
Wait SCLK to be stable after LPS enabled.
This should fix NMI problem in fwphy_rddata().

PR: kern/94146 kern/100356
MFC: after 3 days

17 years agoBump __FreeBSD_version after changes to how insmntque(), getnewvnode(), and
kensmith [Mon, 19 Mar 2007 00:19:35 +0000 (00:19 +0000)]
Bump __FreeBSD_version after changes to how insmntque(), getnewvnode(), and
vfs_hash_insert() work.

17 years agoGive a chance for packet to appear with a correct input interfaces
rik [Sun, 18 Mar 2007 23:28:53 +0000 (23:28 +0000)]
Give a chance for packet to appear with a correct input interfaces
in case of multiple interfaces with the same MAC in the same bridge.
This commit do not solve the entire problem. Only case where packet
arrived from such interface.

PR:     kern/109815
MFC after:      7 days
Submitted by:   Eygene Ryabinkin and rik@
Discussed with: bms@, thompsa@, yar@

17 years agoIn IPv4 fast forwarding path, send ICMP unreachable messages for
bms [Sun, 18 Mar 2007 23:05:20 +0000 (23:05 +0000)]
In IPv4 fast forwarding path, send ICMP unreachable messages for
routes which have RTF_REJECT set *and* a zero expiry timer.

PR: kern/109246
MFC after: 10 days
Submitted by: Ingo Flaschberger

17 years agoMore corrections, this time from Wojciech Koszek
julian [Sun, 18 Mar 2007 19:28:44 +0000 (19:28 +0000)]
More corrections, this time from Wojciech Koszek

17 years agoSpelling and whitespace fixes from Dunne Whitty
julian [Sun, 18 Mar 2007 18:57:38 +0000 (18:57 +0000)]
Spelling and whitespace fixes from Dunne Whitty

17 years agoEnforce sample size alignment on first direct-copy channel.
ariff [Sun, 18 Mar 2007 18:26:40 +0000 (18:26 +0000)]
Enforce sample size alignment on first direct-copy channel.

17 years agoPrefer more traditional spellings of some words in comments.
rwatson [Sun, 18 Mar 2007 16:49:50 +0000 (16:49 +0000)]
Prefer more traditional spellings of some words in comments.

17 years agoPoint out that PIM is the way to go.
bms [Sun, 18 Mar 2007 15:34:57 +0000 (15:34 +0000)]
Point out that PIM is the way to go.

MFC after: 3 days

17 years agoDocument a major IGMP related annoyance.
bms [Sun, 18 Mar 2007 15:31:06 +0000 (15:31 +0000)]
Document a major IGMP related annoyance.
Add comments about IGMP bits which will go when we take SSM.
Xref multicast(4).

MFC after: 3 days

17 years agoMFi386: revision 1.650
nyan [Sun, 18 Mar 2007 03:25:40 +0000 (03:25 +0000)]
MFi386: revision 1.650

  Eliminate an unused parameter.

17 years agoDon't deny unmounting file systems for jailed processes immediately, allow
pjd [Sun, 18 Mar 2007 02:39:19 +0000 (02:39 +0000)]
Don't deny unmounting file systems for jailed processes immediately, allow
prison_priv_check() to decide what to do.

This change is suppose not to change current (security) behaviour
in any way.

This change is simlar to the change of PRIV_VFS_MOUNT in previous revision.

17 years agoDisable burst mode by default. Testing has shown that while it works on
njl [Sun, 18 Mar 2007 01:03:03 +0000 (01:03 +0000)]
Disable burst mode by default.  Testing has shown that while it works on
most systems, it causes the EC not to respond for some Acer and Compaq/HP
laptops.  This is the default value for Linux also.  For systems that need
it, burst mode can be enabled via the tunable/sysctl:
debug.acpi.ec.burst="1"

17 years agoExplain more about the "C" qualifier for Celsius.
njl [Sun, 18 Mar 2007 00:57:07 +0000 (00:57 +0000)]
Explain more about the "C" qualifier for Celsius.

MFC after: 3 days