]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMerge new libc++ into head.
David Chisnall [Thu, 29 Nov 2012 13:35:44 +0000 (13:35 +0000)]
Merge new libc++ into head.

11 years agoImport new libc++. This contains some fixes for code compiled in c++98 / c++03
David Chisnall [Thu, 29 Nov 2012 13:28:56 +0000 (13:28 +0000)]
Import new libc++.  This contains some fixes for code compiled in c++98 / c++03
mode.

11 years agoGeneralize make.conf man page: use "cc" instead of "gcc"
Eitan Adler [Thu, 29 Nov 2012 12:51:10 +0000 (12:51 +0000)]
Generalize make.conf man page: use "cc" instead of "gcc"

PR: misc/173604
Submitted by: Dan McGregor <dan.mcgregor@usask.ca>
Approved by: bcr (mentor)
MFC after: 3 days

11 years ago- Use more appropriate loop (do { } while()) when generating ethernet address
Pawel Jakub Dawidek [Thu, 29 Nov 2012 08:06:23 +0000 (08:06 +0000)]
- Use more appropriate loop (do { } while()) when generating ethernet address
  for bridge interface.
- If we found a collision we can break the loop - only one collision is
  possible and one is exactly enough to need to renegerate.

Obtained from: WHEEL Systems
MFC after: 1 week

11 years agoUsing a long is the wrong type to represent the realmem and maxmbufmem
Andre Oppermann [Thu, 29 Nov 2012 07:30:42 +0000 (07:30 +0000)]
Using a long is the wrong type to represent the realmem and maxmbufmem
variable as they may overflow on i386/PAE and i386 with > 2GB RAM.

Use 64bit quad_t instead.  It has broader kernel infrastructure support
with TUNABLE_QUAD_FETCH() and qmin/qmax() than other available types.

Pointed out by: alc, bde

11 years agoFix hardcoded bpp value
Oleksandr Tymoshenko [Thu, 29 Nov 2012 05:46:46 +0000 (05:46 +0000)]
Fix hardcoded bpp value

11 years agoMark non-returning function as such
Eitan Adler [Thu, 29 Nov 2012 05:16:50 +0000 (05:16 +0000)]
Mark non-returning function as such

PR: bin/172978
Approved by: cperciva
MFC after: 3 days

11 years agoFix LINT build for arm: NOTES defines LDFLAGS by way of a make option
Marcel Moolenaar [Thu, 29 Nov 2012 03:48:39 +0000 (03:48 +0000)]
Fix LINT build for arm: NOTES defines LDFLAGS by way of a make option
but LDFLAGS is not (yet) passed on to the linker (via SYSTEM_LD et al).
Do so now. As such, any kernel configuration can now define linker
flags by setting LDFLAGS as normal and not have to revert to hacks
like setting DEBUG for flags that do not relate to debugging (see
sys/powerpc/conf/MPC85XX).

11 years agoAdd support for AT&T Sierra Wireless USB 3G adapter
Eitan Adler [Thu, 29 Nov 2012 00:32:03 +0000 (00:32 +0000)]
Add support for AT&T Sierra Wireless USB 3G adapter

PR: kern/173982
Submitted by: Eric Camachat <eric@camachat.org>
Approved by: cperciva (implicit)
MFC after: 1 week

11 years ago- Update organization.dot to reflect that attilio resigned from core
Gabor Pali [Wed, 28 Nov 2012 22:04:18 +0000 (22:04 +0000)]
- Update organization.dot to reflect that attilio resigned from core

Approved by: core (implicit)

11 years agoRegenerate usb.conf
Hans Petter Selasky [Wed, 28 Nov 2012 18:37:20 +0000 (18:37 +0000)]
Regenerate usb.conf

MFC after: 1 week

11 years agoDiscussed at-length on -arch.
Devin Teske [Wed, 28 Nov 2012 18:35:46 +0000 (18:35 +0000)]
Discussed at-length on -arch.

Make the following interface changes to my beastie boot menu:
+ Move boot options to a submenu
+ Add a new "Boot Single" menu item
+ Make "Boot" item and new "Boot Single" item reverse when boot_single is set
+ Add new "Load Defaults" item (in new "Boot Options" submenu) for overridding
  loader.conf(5) provided values with system defaults.

Reviewed by: adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoAdd support for the (relatively) new object type OBJT_MGTDEVICE to
Alan Cox [Wed, 28 Nov 2012 18:29:34 +0000 (18:29 +0000)]
Add support for the (relatively) new object type OBJT_MGTDEVICE to
vm_object_set_memattr().  Also, add a "safety belt" so that
vm_object_set_memattr() doesn't silently modify undefined object types.

Reviewed by: kib
MFC after: 10 days

11 years agoUpdate some definitions or make them match NetBSD's headers.
Pedro F. Giffuni [Wed, 28 Nov 2012 15:48:32 +0000 (15:48 +0000)]
Update some definitions or make them match NetBSD's headers.

Bring several definitions required for newer ext4 features.

Rename EXT2F_COMPAT_HTREE to EXT2F_COMPAT_DIRHASHINDEX since it
is not being used yet and the new name is more compatible with
NetBSD and Linux.

This change is purely cosmetic and has no effect on the real
code.

Obtained from: NetBSD
MFC after: 3 days

11 years agocyrus-sasl 2.1.26 was released. In this version, the type of callback
Hajimu UMEMOTO [Wed, 28 Nov 2012 11:47:47 +0000 (11:47 +0000)]
cyrus-sasl 2.1.26 was released.  In this version, the type of callback
functions was changed from "unsigned long" to "size_t".

Reviewed by: gshapiro
MFC after: 3 days

11 years agoCall if_free() with the correct vnet context if and only if ifp_vnet
Adrian Chadd [Wed, 28 Nov 2012 07:12:08 +0000 (07:12 +0000)]
Call if_free() with the correct vnet context if and only if ifp_vnet
isn't NULL.

If the attach fails prematurely and there's no if_vnet context, calling
CURVNET_SET(ifp->if_vnet) is going to dereference a NULL pointer.

11 years agoUntil I figure out what to do here, remind myself that this needs some
Adrian Chadd [Wed, 28 Nov 2012 06:55:34 +0000 (06:55 +0000)]
Until I figure out what to do here, remind myself that this needs some
rate control 'adjustment' when NOACK is set.

11 years agoDon't allow minthreads > maxthreads.
Alfred Perlstein [Wed, 28 Nov 2012 02:47:31 +0000 (02:47 +0000)]
Don't allow minthreads > maxthreads.

Suggested by: rmacklem

11 years agoFix typo.
Alfred Perlstein [Wed, 28 Nov 2012 02:23:59 +0000 (02:23 +0000)]
Fix typo.

Pointed out by: marck

11 years agoPull out the debugging code from the critical path and make sure it
Adrian Chadd [Wed, 28 Nov 2012 01:55:22 +0000 (01:55 +0000)]
Pull out the debugging code from the critical path and make sure it
happens _after_ all of the time delta calculations.

11 years agoPartially bring r242520 to ext2fs.
Pedro F. Giffuni [Wed, 28 Nov 2012 00:36:40 +0000 (00:36 +0000)]
Partially bring r242520 to ext2fs.

When a file is first being written, the dynamic block reallocation
(implemented by ext2_reallocblks) relocates the file's blocks
so as to cluster them together into a contiguous set of blocks on
the disk.

When the cluster crosses the boundary into the first indirect block,
the first indirect block is initially allocated in a position
immediately following the last direct block.  Block reallocation
would usually destroy locality by moving the indirect block out of
the way to keep the data blocks contiguous.

The issue was diagnosed long ago by Bruce Evans on ffs and surfaced
on ext2fs when block reallocaton was ported. This is only a partial
solution based on the similarities with FFS. We still require more
review of the allocation details that vary in ext2fs.

Reported by: bde
MFC after: 1 week

11 years agoComplete r243631 by applying the remainder of kern_mbuf.c that got
Andre Oppermann [Tue, 27 Nov 2012 23:16:56 +0000 (23:16 +0000)]
Complete r243631 by applying the remainder of kern_mbuf.c that got
lost while merging into the commit tree.

MFC after: 1 month
X-MFC-with: r243631

11 years agoFix r243627 by testing against the head socket instead of the socket
Andre Oppermann [Tue, 27 Nov 2012 22:35:48 +0000 (22:35 +0000)]
Fix r243627 by testing against the head socket instead of the socket
just created.

MFC after: 1 week
X-MFC-with: r243627

11 years agoAutoconfigure nfsd threads based on ncpu.
Alfred Perlstein [Tue, 27 Nov 2012 22:34:46 +0000 (22:34 +0000)]
Autoconfigure nfsd threads based on ncpu.

Rick Macklem and I discussed the default number of nfsd threads and
concluded that it is too low to perform adiquitely on today's hardware.

We decided to auto tune the number of nfsds based on the number of cpus
in the system.

While I'm here I've also added:

1) ability to set the minthreads/maxthreads from userland.
2) ability to run nfsd in debug mode via the cli.

Reviewed by: rmacklem
MFC after: 2 weeks

11 years agoAllow setting of NULL titles with f_dialog_[back]title().
Devin Teske [Tue, 27 Nov 2012 22:14:22 +0000 (22:14 +0000)]
Allow setting of NULL titles with f_dialog_[back]title().

Approved by: adrian (co-mentor) (implicit)

11 years agoChange self-initialization to occur when loaded versus the previous behavior
Devin Teske [Tue, 27 Nov 2012 22:11:53 +0000 (22:11 +0000)]
Change self-initialization to occur when loaded versus the previous behavior
which was to self-initialize during the first function-call. This didn't work
so well because the first call was may or may-not be within a sub-shell
(which prevented proper setup of the pass-thru file descriptor, resulting in
dialogs that would not display).

Approved by: adrian (co-mentor) (implicit)

11 years agoComments.
Devin Teske [Tue, 27 Nov 2012 22:05:01 +0000 (22:05 +0000)]
Comments.

Approved by: adrian (co-mentor) (implicit)

11 years agoBase the mbuf related limits on the available physical memory or
Andre Oppermann [Tue, 27 Nov 2012 21:19:58 +0000 (21:19 +0000)]
Base the mbuf related limits on the available physical memory or
kernel memory, whichever is lower.  The overall mbuf related memory
limit must be set so that mbufs (and clusters of various sizes)
can't exhaust physical RAM or KVM.

The limit is set to half of the physical RAM or KVM (whichever is
lower) as the baseline.  In any normal scenario we want to leave
at least half of the physmem/kvm for other kernel functions and
userspace to prevent it from swapping too easily.  Via a tunable
kern.maxmbufmem the limit can be upped to at most 3/4 of physmem/kvm.

At the same time divorce maxfiles from maxusers and set maxfiles to
physpages / 8 with a floor based on maxusers.  This way busy servers
can make use of the significantly increased mbuf limits with a much
larger number of open sockets.

Tidy up ordering in init_param2() and check up on some users of
those values calculated here.

Out of the overall mbuf memory limit 2K clusters and 4K (page size)
clusters to get 1/4 each because these are the most heavily used mbuf
sizes.  2K clusters are used for MTU 1500 ethernet inbound packets.
4K clusters are used whenever possible for sends on sockets and thus
outbound packets.  The larger cluster sizes of 9K and 16K are limited
to 1/6 of the overall mbuf memory limit.  When jumbo MTU's are used
these large clusters will end up only on the inbound path.  They are
not used on outbound, there it's still 4K.  Yes, that will stay that
way because otherwise we run into lots of complications in the
stack.  And it really isn't a problem, so don't make a scene.

Normal mbufs (256B) weren't limited at all previously.  This was
problematic as there are certain places in the kernel that on
allocation failure of clusters try to piece together their packet
from smaller mbufs.

The mbuf limit is the number of all other mbuf sizes together plus
some more to allow for standalone mbufs (ACK for example) and to
send off a copy of a cluster.  Unfortunately there isn't a way to
set an overall limit for all mbuf memory together as UMA doesn't
support such a limiting.

NB: Every cluster also has an mbuf associated with it.

Two examples on the revised mbuf sizing limits:

1GB KVM:
 512MB limit for mbufs
 419,430 mbufs
  65,536 2K mbuf clusters
  32,768 4K mbuf clusters
   9,709 9K mbuf clusters
   5,461 16K mbuf clusters

16GB RAM:
 8GB limit for mbufs
 33,554,432 mbufs
  1,048,576 2K mbuf clusters
    524,288 4K mbuf clusters
    155,344 9K mbuf clusters
     87,381 16K mbuf clusters

These defaults should be sufficient for even the most demanding
network loads.

MFC after: 1 month

11 years agoUpdate comment to prefer M_NOWAIT over M_DONTWAIT and
Andre Oppermann [Tue, 27 Nov 2012 20:16:01 +0000 (20:16 +0000)]
Update comment to prefer M_NOWAIT over M_DONTWAIT and
M_WAITOK over M_WAIT.

MFC after: 1 week

11 years agoFix a race on listen socket teardown where while draining the
Andre Oppermann [Tue, 27 Nov 2012 20:04:52 +0000 (20:04 +0000)]
Fix a race on listen socket teardown where while draining the
accept queues a new socket/connection may be added to the queue
due to a race on the ACCEPT_LOCK.

The submitted patch is slightly changed in comments, teardown
and locking order and extended with KASSERT's.

Submitted by: Vijay Singh <vijju.singh-at-gmail-dot-com>
Found by: His team.
MFC after: 1 week

11 years agoRemove unused and unnecessary CSUM_IP_FRAGS checksumming capability.
Andre Oppermann [Tue, 27 Nov 2012 19:31:49 +0000 (19:31 +0000)]
Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability.
Checksumming the IP header of fragments is no different from doing
normal IP headers.

Discussed with: yongari
MFC after: 1 week

11 years agofix a panic resulting from a stray '&'
Bernhard Schmidt [Tue, 27 Nov 2012 19:09:36 +0000 (19:09 +0000)]
fix a panic resulting from a stray '&'

MFC after: 1 week

11 years agoAdd DELACK to list of timers.
Andre Oppermann [Tue, 27 Nov 2012 19:07:28 +0000 (19:07 +0000)]
Add DELACK to list of timers.

MFC after: 1 week

11 years agoRespect NO_FSCHG and don't set 'schg' flag on passwd/yppasswd is defined.
Pawel Jakub Dawidek [Tue, 27 Nov 2012 16:23:12 +0000 (16:23 +0000)]
Respect NO_FSCHG and don't set 'schg' flag on passwd/yppasswd is defined.

MFC after: 2 weeks

11 years agoPass allocated unit number to make_dev, otherwise kernel panics later while
David Xu [Tue, 27 Nov 2012 12:23:57 +0000 (12:23 +0000)]
Pass allocated unit number to make_dev, otherwise kernel panics later while
cloning second tap.

Reviewed by: kevlo,ed

11 years ago* Fix another culprit of my "committed from the wrong directory" nonsense;
Adrian Chadd [Tue, 27 Nov 2012 11:30:39 +0000 (11:30 +0000)]
* Fix another culprit of my "committed from the wrong directory" nonsense;
  now this works for non-debug and debug builds.

* Add a comment reminding me (or someone) to audit all of the relevant
  math to ensure there's no weird wrapping issues still lurking about.

But yes, this does seem to be mostly working.

Pointy-hat-to: adrian, yet again

11 years agoAdd kern.capmode_coredump sysctl/tunable to allow processes in capability mode
Pawel Jakub Dawidek [Tue, 27 Nov 2012 10:38:11 +0000 (10:38 +0000)]
Add kern.capmode_coredump sysctl/tunable to allow processes in capability mode
to dump core.

Reviewed by: rwatson
Obtained from: WHEEL Systems
MFC after: 2 weeks

11 years ago- Add NOCAPCHECK flag to namei that allows lookup to work even if the process
Pawel Jakub Dawidek [Tue, 27 Nov 2012 10:32:35 +0000 (10:32 +0000)]
- Add NOCAPCHECK flag to namei that allows lookup to work even if the process
  is in capability mode.
- Add VN_OPEN_NOCAPCHECK flag for vn_open_cred() to will ne converted into
  NOCAPCHECK namei flag.

This functionality will be used to enable core dumps for sandboxed processes.

Reviewed by: rwatson
Obtained from: WHEEL Systems
MFC after: 2 weeks

11 years agoRegenerate after r243610.
Pawel Jakub Dawidek [Tue, 27 Nov 2012 10:25:03 +0000 (10:25 +0000)]
Regenerate after r243610.

11 years agoAllow to use kill(2) in capability mode, but process can send a signal only
Pawel Jakub Dawidek [Tue, 27 Nov 2012 10:22:40 +0000 (10:22 +0000)]
Allow to use kill(2) in capability mode, but process can send a signal only
to himself. For example abort(3) at first tries to do kill(getpid(), SIGABRT)
which was failing in capability mode, so the code was failing back to exit(1).

Reviewed by: rwatson
Obtained from: WHEEL Systems
MFC after: 2 weeks

11 years agoAllow to modify kern.sugid_coredump and kern.corefile from loader.conf.
Pawel Jakub Dawidek [Tue, 27 Nov 2012 10:16:48 +0000 (10:16 +0000)]
Allow to modify kern.sugid_coredump and kern.corefile from loader.conf.

Obtained from: WHEEL Systems

11 years agoMore style fixes.
Pawel Jakub Dawidek [Tue, 27 Nov 2012 10:15:58 +0000 (10:15 +0000)]
More style fixes.

11 years agoStyle fixes (mostly whitespaces).
Pawel Jakub Dawidek [Tue, 27 Nov 2012 10:11:54 +0000 (10:11 +0000)]
Style fixes (mostly whitespaces).

11 years agoCorrect some debugging output.
Adrian Chadd [Tue, 27 Nov 2012 08:40:48 +0000 (08:40 +0000)]
Correct some debugging output.

11 years agoMake sure that tcp_timer_activate() correctly sees TCP_OFFLOAD (or not).
Navdeep Parhar [Tue, 27 Nov 2012 06:42:44 +0000 (06:42 +0000)]
Make sure that tcp_timer_activate() correctly sees TCP_OFFLOAD (or not).

11 years agoDo not enable data cache until later in kernel init. Stale bits in
Oleksandr Tymoshenko [Tue, 27 Nov 2012 06:39:32 +0000 (06:39 +0000)]
Do not enable data cache until later in kernel init. Stale bits in
cache might cause erroneus behavior on early stage.

Submitted by: Ian Lepore
Tested on: Atmel, Marvell, and Eyxnos

11 years ago Better safe than sorry: reinitialize eh after ng_ether(4) and
Gleb Smirnoff [Tue, 27 Nov 2012 06:35:26 +0000 (06:35 +0000)]
  Better safe than sorry: reinitialize eh after ng_ether(4) and
if_bridge(4) processing, since mbuf may be modified there.

Submitted by: youngari

11 years agoTake first active vnode correctly.
David Xu [Tue, 27 Nov 2012 06:07:58 +0000 (06:07 +0000)]
Take first active vnode correctly.

Reviewed by: kib
MFC after: 3 days

11 years agoFix build
Adrian Chadd [Tue, 27 Nov 2012 05:52:08 +0000 (05:52 +0000)]
Fix build

11 years agoAuto size the tcbhashsize structure based on max sockets.
Alfred Perlstein [Tue, 27 Nov 2012 03:04:24 +0000 (03:04 +0000)]
Auto size the tcbhashsize structure based on max sockets.

While here, also make the code that enforces power-of-two more
forgiving, instead of just resetting to 512, graciously round-down
to the next lower power of two.

11 years agoAdd in a totally hacked up copy of the AR5416 descriptor decoding stuff,
Adrian Chadd [Tue, 27 Nov 2012 02:28:42 +0000 (02:28 +0000)]
Add in a totally hacked up copy of the AR5416 descriptor decoding stuff,
as well as TDMA related things.

I used this to debug TDMA related issues in -HEAD.

11 years agoImprove the TDMA debugging:
Adrian Chadd [Tue, 27 Nov 2012 02:27:30 +0000 (02:27 +0000)]
Improve the TDMA debugging:

* add some further debugging prints, which are quite nice to have
* add in ALQ hooks (optional!) to allow for the TDMA information to be
  logged in-line with the TX and RX descriptor information.

11 years agoAdd in specific TDMA logging types.
Adrian Chadd [Tue, 27 Nov 2012 02:24:05 +0000 (02:24 +0000)]
Add in specific TDMA logging types.

11 years agoFix the TDMA nexttbtt programming for 802.11n chips.
Adrian Chadd [Tue, 27 Nov 2012 02:23:45 +0000 (02:23 +0000)]
Fix the TDMA nexttbtt programming for 802.11n chips.

The existing logic wrapped programming nexttbtt at 65535 TU.
This is not good enough for the 11n chips, whose nexttbtt register
(GENERIC_TIMER_0) has an initial value from 0..2^31-1 TSF.
So converting the TU to TSF had the counter wrap at (65535 << 10) TSF.

Once this wrap occured, the nexttbtt value was very very low, much
lower than the current TSF value.  At this point, the nexttbtt timer
would constantly fire, leading to the TX queue being constantly gated
open.. and when this occured, the sender was not correctly transmitting
in its slot but just able to continuously transmit.  The master would
then delay transmitting its beacon until after the air became free
(which I guess would be after the burst interval, before the next burst
interval would quickly follow) and that big delta in master beacon TX
would start causing big swings in the slot timing adjustment.

With this change, the nexttbtt value is allowed to go all the way up
to the maximum value permissable by the 32 bit representation.
I haven't yet tested it to that point; I really should.  The AR5212
HAL now filters out values above 65535 TU for the beacon configuration
(and the relevant legal values for SWBA, DBA and NEXTATIM) and the
AR5416 HAL just dutifully programs in what it should.

With this, TDMA is now useful on the 802.11n chips.

Tested:

* AR5416, AR9280 TDMA slave
* AR5413 TDMA slave

11 years agoAdd a note about the magic values here; don't change them.
Adrian Chadd [Tue, 27 Nov 2012 02:19:35 +0000 (02:19 +0000)]
Add a note about the magic values here; don't change them.

11 years agoWhen programming the beacon timer configuration, be very explicit about
Adrian Chadd [Tue, 27 Nov 2012 02:18:41 +0000 (02:18 +0000)]
When programming the beacon timer configuration, be very explicit about
what the maximum legal values are.

The current beacon timer configuration from TDMA wraps things at
HAL_BEACON_PERIOD-1 TU.  For the 11a chips this is fine, but for
the 11n chips it's not enough resolution.  Since the 11a chips have a
limit on what's "valid", just enforce this so when I do write larger
values in, they get suitably wrapped before programming.

Tested:

* AR5413, TDMA slave

Todo:

* Run it for a (lot) longer on a clear channel, ensure that no strange
  slippages occur.
* Re-validate this on STA configurations, just to be sure.

11 years agoAllow this file to build on FreeBSD.
Juli Mallett [Tue, 27 Nov 2012 02:03:41 +0000 (02:03 +0000)]
Allow this file to build on FreeBSD.

11 years agoAdd NOTES and Makefile in order to generate LINT. NOTES contains pretty
Marcel Moolenaar [Tue, 27 Nov 2012 01:17:50 +0000 (01:17 +0000)]
Add NOTES and Makefile in order to generate LINT. NOTES contains pretty
much all the union of all the kernel configuration files, including all
the CPU types, Marvell SOC types and at91 board types. Any device not
supported (read: does not compile) has been removed, which is a fairly
small set actually. As such, LINT gives us very good coverage without
having to build a zillion kernels.

11 years agoAllow building LINT by defining both SAMPLE_AT_RESET on the one hand
Marcel Moolenaar [Tue, 27 Nov 2012 01:10:58 +0000 (01:10 +0000)]
Allow building LINT by defining both SAMPLE_AT_RESET on the one hand
and SAMPLE_AT_RESET_{LO|HI} on the other. It doesn't matter which
values they take, as long as they are defined.

11 years agoDon't include arm/xscale/i8134x/i81342reg.h when we're compiling LINT.
Marcel Moolenaar [Tue, 27 Nov 2012 01:08:05 +0000 (01:08 +0000)]
Don't include arm/xscale/i8134x/i81342reg.h when we're compiling LINT.
The definitions in i81342reg.h clash with those in i80321reg.h.

11 years agoRemove print_kernel_section_addr(). All statements in that function
Marcel Moolenaar [Tue, 27 Nov 2012 01:05:07 +0000 (01:05 +0000)]
Remove print_kernel_section_addr(). All statements in that function
expand to uncompilable code when the kernel configuration contains
"options DEBUG", such as it is for LINT. The toolchain is often a
better approach to figure this out, as it doesn't require one to
boot the kernel.

11 years agoDon't define intr_disable and intr_restore as macros. The macros
Marcel Moolenaar [Tue, 27 Nov 2012 00:41:39 +0000 (00:41 +0000)]
Don't define intr_disable and intr_restore as macros. The macros
interfere with structure fields of the same name in drivers, like
the intr_disable function pointer in struct cphy_ops in cxgb(4).
Instead define intr_disable and intr_restore as inline functions.

With intr_disable() an inline function, the I32_bit and F32_bit
macros now need to be visible in MI code and given the rather
poor names, this is not at all good. Define ARM_CPSR_F32 and
ARM_CPSR_I32 and use that instead of F32_bit and I32_bit (resp)
for now.

11 years agoUnbreak building a kernel with EHCI: there's no ehci_atmelarm.c.
Marcel Moolenaar [Mon, 26 Nov 2012 23:30:47 +0000 (23:30 +0000)]
Unbreak building a kernel with EHCI: there's no ehci_atmelarm.c.

11 years agoPull in r168610 from upstream libc++:
Dimitry Andric [Mon, 26 Nov 2012 21:32:31 +0000 (21:32 +0000)]
Pull in r168610 from upstream libc++:

  When using libc++ headers on FreeBSD, in combination with -std=c++98,
  -ansi or -std=c++03, the long long type is not supported.  So in this
  case, several functions and types, like lldiv_t, strtoll(), are not
  declared.

This should make it possible to use the libc++ headers in c++98 mode.

Note: libc++ is originally designed as a c++0x or higher library, so you
should still take care when using it with c++98 or c++03.

Noted by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>
MFC after: 1 week

11 years agoFix problem with the Samsung 840 PRO series SSD detection.
Alexander Motin [Mon, 26 Nov 2012 20:07:10 +0000 (20:07 +0000)]
Fix problem with the Samsung 840 PRO series SSD detection.
The device reports support for SATA Asynchronous Notification in its
IDENTIFY data, but returns error on attempt to enable that feature.
Make SATA XPT of CAM only report these errors, but not fail the device.

MFC after: 1 week

11 years ago drbr_enqueue() awlays consumes mbuf, no matter did it
Gleb Smirnoff [Mon, 26 Nov 2012 20:03:57 +0000 (20:03 +0000)]
  drbr_enqueue() awlays consumes mbuf, no matter did it
fail or not. The mbuf pointer is no longer valid, so
can't be reused after.

  Fix igb_mq_start() where mbuf pointer was used after
drbr_enqueue().

  This eventually leads us to all invocations of
igb_mq_start_locked() called with third argument as NULL.
This allows us to simplify this function.

Submitted by: Karim Fodil-Lemelin <fodillemlinkarim gmail.com>
Reviewed by: jfv

11 years agoRe-initialize eh pointer after m_adj()
Gleb Smirnoff [Mon, 26 Nov 2012 19:45:01 +0000 (19:45 +0000)]
Re-initialize eh pointer after m_adj()

Submitted by: Kohji Okuno <okuno.kohji jp.panasonic.com>
Reviewed by: yongari

11 years agoFix typo in weekly line which made it to rotated after reaching > 1 Kb.
Gleb Smirnoff [Mon, 26 Nov 2012 19:42:38 +0000 (19:42 +0000)]
Fix typo in weekly line which made it to rotated after reaching > 1 Kb.

PR: conf/173857
Submitted by: Matt Smith <matt xtaz.co.uk>

11 years agoAdd support for sctp_peeloff() also in the front states of the
Michael Tuexen [Mon, 26 Nov 2012 16:44:03 +0000 (16:44 +0000)]
Add support for sctp_peeloff() also in the front states of the
association.

MFC after: 3 days

11 years agoFind the endpoint for an incoming packet also if the endpoint
Michael Tuexen [Mon, 26 Nov 2012 16:43:32 +0000 (16:43 +0000)]
Find the endpoint for an incoming packet also if the endpoint
comes from sctp_peeloff().

MFC after: 3 days

11 years agoUpdate manpage dates in zfs.8 and zpool.8
Martin Matuska [Mon, 26 Nov 2012 13:16:55 +0000 (13:16 +0000)]
Update manpage dates in zfs.8 and zpool.8

MFC after: 2 weeks

11 years agoMFV r243395:
Martin Matuska [Mon, 26 Nov 2012 12:24:39 +0000 (12:24 +0000)]
MFV r243395:

Introduce a new dataset aclmode setting "restricted" to protect ACL's
being destroyed or corrupted by a drive-by chmod.

illumos-gate 13889:a67716f16746
3254 add support in zfs for aclmode=restricted

References:
https://www.illumos.org/issues/3254

MFC after: 2 weeks

11 years agoAllow shutdown() to be used on fds returned from sctp_peeloff().
Michael Tuexen [Mon, 26 Nov 2012 08:50:00 +0000 (08:50 +0000)]
Allow shutdown() to be used on fds returned from sctp_peeloff().

MFC after: 3 days

11 years agoProvide an option to users to shoot themselves in the foot.
Eitan Adler [Mon, 26 Nov 2012 05:11:07 +0000 (05:11 +0000)]
Provide an option to users to shoot themselves in the foot.

Reviewed by: bapt
Approved by: cperciva
MFC after: 1 month

11 years agoUse modern license instead of being consistent with the other pkg_ tools
Eitan Adler [Mon, 26 Nov 2012 05:11:03 +0000 (05:11 +0000)]
Use modern license instead of being consistent with the other pkg_ tools
Use a more informative message
Fix some style(9) nits.
Bump version number
In pkg_add only warn users after the chroot is performed.

Submitted by: gavin, jilles
Reviewed by: beat, bapt
Approved by: cperciva
MFC after: 1 month

11 years ago- smbfs_rename() might return an error value without correctly upgrading
Davide Italiano [Mon, 26 Nov 2012 04:29:47 +0000 (04:29 +0000)]
- smbfs_rename() might return an error value without correctly upgrading
the vnode use count, and this might cause the kernel to panic if compiled
with WITNESS enable.
- Be sure to put the '\0' terminator to the rpath string.

Sponsored by: iXsystems inc.

11 years agoFix uninitialized variable reported by gcc, but not clang.
Alexander Motin [Mon, 26 Nov 2012 02:04:11 +0000 (02:04 +0000)]
Fix uninitialized variable reported by gcc, but not clang.

11 years agoRemove extra sbuf_trim() copy/pasted into r243530.
Alexander Motin [Mon, 26 Nov 2012 01:54:00 +0000 (01:54 +0000)]
Remove extra sbuf_trim() copy/pasted into r243530.

11 years agoAdd a primitive to check if a lock is not owned.
Adrian Chadd [Mon, 26 Nov 2012 00:06:55 +0000 (00:06 +0000)]
Add a primitive to check if a lock is not owned.

11 years agoAdd my mentor relationships to committers-ports.dot
Barbara Guida [Sun, 25 Nov 2012 21:32:13 +0000 (21:32 +0000)]
Add my mentor relationships to committers-ports.dot

Approved by: flo (mentor)

11 years agoOn multiple requests, compact HDA driver verbose output by hiding CODEC's
Alexander Motin [Sun, 25 Nov 2012 20:06:01 +0000 (20:06 +0000)]
On multiple requests, compact HDA driver verbose output by hiding CODEC's
detailed information under the sound debug.  To make it easier accessible,
export that information through the set of sysctls like dev.hdaa.X.nidY.
Also tune some output to make it both more compact and informative.

11 years agoMake a few small changes to vm_map_pmap_enter():
Alan Cox [Sun, 25 Nov 2012 19:42:36 +0000 (19:42 +0000)]
Make a few small changes to vm_map_pmap_enter():

Add detail to the comment describing this function.  In particular,
describe what MAP_PREFAULT_PARTIAL does.

Eliminate the abrupt change in behavior when the specified address range
grows from MAX_INIT_PT pages to MAX_INIT_PT plus one pages.  Instead of
doing nothing, i.e., preloading no mappings whatsoever, map any resident
pages that fall within the start of the specified address range, i.e.,
[addr, addr + ulmin(size, ptoa(MAX_INIT_PT))).

Long ago, the vm object's list of resident pages was not ordered, so
this function had to choose between probing the global hash table of
all resident pages and iterating over the vm object's unordered list of
resident pages.  Now, the list is ordered, so there is no reason for
MAP_PREFAULT_PARTIAL to be concerned with the vm object's count of
resident changes.

MFC after: 14 days

11 years agoLook for zombie process only if we were given process id.
Pawel Jakub Dawidek [Sun, 25 Nov 2012 19:31:42 +0000 (19:31 +0000)]
Look for zombie process only if we were given process id.

Reviewed by: kib
MFC after: 2 weeks
X-MFC-after-or-with: 243142

11 years agoPrint kernel args when booting the kernel.
Tim Kientzle [Sun, 25 Nov 2012 18:22:53 +0000 (18:22 +0000)]
Print kernel args when booting the kernel.

11 years agoAdd loader(8) tunable to enable/disable nopwrite functionality:
Martin Matuska [Sun, 25 Nov 2012 16:54:43 +0000 (16:54 +0000)]
Add loader(8) tunable to enable/disable nopwrite functionality:
vfs.zfs.nopwrite_enabled

MFC after: 2 weeks

11 years agoMFV r243013 and r243267:
Martin Matuska [Sun, 25 Nov 2012 16:32:07 +0000 (16:32 +0000)]
MFV r243013 and r243267:

Import the zio nop-write improvement from Illumos. To reduce I/O,
nop-write omits overwriting data if the checksum (cryptographically
secure) of new data matches the checksum of existing data.
It also saves space if snapshots are in use.

It currently works only on datasets with enabled compression, disabled
deduplication and sha256 checksums.

IllumOS 13887:196932ec9e6a and 13888:7204b3392a58
3236 zio nop-write

References:
https://www.illumos.org/issues/3236

MFC after: 2 weeks

11 years agoFix spelling.
Tim Kientzle [Sun, 25 Nov 2012 16:19:12 +0000 (16:19 +0000)]
Fix spelling.

11 years agozfs_freebsd_reclaim: remove a stray variable
Andriy Gapon [Sun, 25 Nov 2012 15:46:29 +0000 (15:46 +0000)]
zfs_freebsd_reclaim: remove a stray variable

... which leaked from a subsequent local change.
Unfortunately I noticed that only after commit.

MFC after: 5 weeks
X-MFC with: r243520

11 years agozfs: overhaul zfs-vfs glue for vnode life-cycle management
Andriy Gapon [Sun, 25 Nov 2012 15:33:26 +0000 (15:33 +0000)]
zfs: overhaul zfs-vfs glue for vnode life-cycle management

* There is no need for the delayed destruction of znodes via taskqueue,
now that we do not need to fear recursion from getnewvnode into
zfs_inactive and zfs_freebsd_reclaim, thus making znode/vnode state
machine a bit simpler.

* More complete porting of zfs_inactive from Solaris VFS model to FreeBSD
vop_inactive and vop_reclaim model.  All destructive actions are done
in zfs_freebsd_reclaim.
This allows to simplify zfs_zget logic.

* Allow zfs_zget to return a doomed vnode if the current thread already
has an exclusive lock on the vnode.

* Clean up Solaris-isms like bailing out of reclaim/inactive on certain
values of v_usecount (aka v_count) or directly messing with this counter.

* Do not clear z_vnode while znode is still accessible.
z_vnode should be cleared only after zfs_znode_dmu_fini.
Otherwise zfs_zget may get an effectively half-deconstructed znode.
This allows to simplify zfs_zget logic further.

The above changes fix at least two known/reported problems:

o An indefinite wait in the following code path:
vgone -> VOP_RECLAIM -> zfs_freebsd_reclaim -> vnode_destroy_vobject ->
put_pages -> zfs_write -> zil_commit -> zfs_zget
This happened because vgone marks a vnode as VI_DOOMED before calling
VOP_RECLAIM, but zfs_zget would not return a doomed vnode under any
circumstances.
The fix in this change is not complete as it won't fix a deadlock between
two threads doing VOP_RECLAIM where one thread is in zil_commit trying to
zfs_zget a znode/vnode being reclaimed by the other thread, which would be
blocked trying to enter zil_commit.  This type of deadlock has not been
reported as of now.

o An indefinite wait in the unmount path caused by a znode "falling through
the cracks" in inactive+reclaim.  This would happen if the znode is unlinked
while its vnode is still active.

To Do: pass locking flags parameter to zfs_zget, so that the zfs-vfs
glue code doesn't have to re-lock a vnode but could ask for proper locking
from the very start.  This would also allow for the higher level code to
obtain a doomed vnode when it is expected/requested.  Or to avoid blocking
when it is not allowed (see zil_commit example above).

ffs_vgetf seems like a good source of inspiration.

Tested by: Willem Jan Withagen <wjw@digiware.nl>
MFC after: 6 weeks

11 years agozfs_fhtovp: there is no reason to amend lock flags with LK_RETRY here
Andriy Gapon [Sun, 25 Nov 2012 15:07:27 +0000 (15:07 +0000)]
zfs_fhtovp: there is no reason to amend lock flags with LK_RETRY here

MFC after: 12 days

11 years agoadd zfs_bmap to aid vnode_pager_haspage
Andriy Gapon [Sun, 25 Nov 2012 15:01:12 +0000 (15:01 +0000)]
add zfs_bmap to aid vnode_pager_haspage

... otherwise zfs_getpages would mostly be called with one page at a time.

It is expected that ZFS VOP_BMAP is only called from vnode_pager_haspage.
Since ZFS files can have variable block sizes and also because we don't
really know if any given blocks are consecutive, we can not really report
any additional blocks behind or ahead of a given block.  Since physical
block numbers do not make sense for ZFS, we do not do any real translation
and thus pass back blk = lblk.  The net effect is that vnode_pager_haspage
knows that the block exists and that the pages backed by the block can be
accessed.  vnode_pager_haspage may be wrong about the exact count of the
pages backed by the block, because of a variable block size, which
vnode_pager_haspage doesn't really know - it only knows max block size in
a filesystem.  So pages from multiple blocks can be passed to zfs_getpages,
but that is expected and correctly handled.

vnode_pager should not call zfs_bmap for any other reason, because ZFS
implements VOP_PUTPAGES and thus vnode_pager_generic_getpages is not used.

vfs_cluster code vfs_bio code should not be called for ZFS, because ZFS does
not use buffer cache layer.

Also, ZFS does not use vn_bmap_seekhole, it has its prviate mechanism for
working with holes.

The above list should cover all the current calls to VOP_BMAP.

Reviewed by: kib
MFC after: 6 weeks

11 years agozfs_getpages: optimize for large block sizes
Andriy Gapon [Sun, 25 Nov 2012 14:53:26 +0000 (14:53 +0000)]
zfs_getpages: optimize for large block sizes

MFC after: 6 weeks

11 years agoRemove unused function.
Michael Tuexen [Sun, 25 Nov 2012 14:25:08 +0000 (14:25 +0000)]
Remove unused function.

MFC after: 1 week

11 years agoremove stop_scheduler_on_panic knob
Andriy Gapon [Sun, 25 Nov 2012 14:22:08 +0000 (14:22 +0000)]
remove stop_scheduler_on_panic knob

There has not been any complaints about the default behavior, so there
is no need to keep a knob that enables the worse alternative.

Now that the hard-stopping of other CPUs is the only behavior, the panic_cpu
spinlock-like logic can be dropped, because only a single CPU is
supposed to win stop_cpus_hard(other_cpus) race and proceed past that
call.

MFC after: 1 month

11 years agozfs sha256 checksum is missing in zfs.8 manpage
Martin Matuska [Sun, 25 Nov 2012 11:26:36 +0000 (11:26 +0000)]
zfs sha256 checksum is missing in zfs.8 manpage

MFC after: 3 days

11 years agoMFV r243012:
Martin Matuska [Sun, 25 Nov 2012 10:53:42 +0000 (10:53 +0000)]
MFV r243012:

Illumos 13886:e3261d03efbf

3349 zpool upgrade -V bumps the on disk version number, but leaves
     the in core version

References:
https://www.illumos.org/issues/3349

MFC after: 1 week

11 years agoSplit IP address validation routines and improve error detection for dotted-
Devin Teske [Sun, 25 Nov 2012 10:37:10 +0000 (10:37 +0000)]
Split IP address validation routines and improve error detection for dotted-
quad notation in IPv6 addresses.

Approved by: adrian (co-mentor) (implicit)

11 years agoMFV r242735:
Martin Matuska [Sun, 25 Nov 2012 09:06:32 +0000 (09:06 +0000)]
MFV r242735:

Illumos 13879:4eac7a87eff2:
3329 spa_sync() spends 10-20% of its time in spa_free_sync_cb()
3330 space_seg_t should have its own kmem_cache
3331 deferred frees should happen after sync_pass 1
3335 make SYNC_PASS_* constants tunable

New loader-only tunables:
vfs.zfs.sync_pass_deferred_free
vfs.zfs.sync_pass_dont_compress
vfs.zfs.sync_pass_rewrite

References:
https://www.illumos.org/issues/3329
https://www.illumos.org/issues/3330
https://www.illumos.org/issues/3331
https://www.illumos.org/issues/3335

MFC after: 2 weeks

11 years agozfs roopool: add support for multi-vdev configurations
Andriy Gapon [Sat, 24 Nov 2012 13:23:15 +0000 (13:23 +0000)]
zfs roopool: add support for multi-vdev configurations

Tested by: madpilot
MFC after: 10 days

11 years agospa_import_rootpool: initialize ub_version before calling spa_config_parse
Andriy Gapon [Sat, 24 Nov 2012 13:16:49 +0000 (13:16 +0000)]
spa_import_rootpool: initialize ub_version before calling spa_config_parse

... because the latter makes some decision based on the version.
This is especially important for raidz vdevs.
This is similar to what spa_load does.

This is not an issue for upstream because they do not seem to support
using raidz as a root pool.

Reported by: Andrei Lavreniyuk <andy.lavr@gmail.com>
Tested by: Andrei Lavreniyuk <andy.lavr@gmail.com>
MFC after: 6 days