]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMake setfacl(1) behave properly in situations like "setfacl -kd".
trasz [Tue, 4 Sep 2012 11:43:00 +0000 (11:43 +0000)]
Make setfacl(1) behave properly in situations like "setfacl -kd".

MFC after: 1 month

11 years agoRemove unneeded ipfw headers introduced in r213447 from Infiniband code.
melifaro [Tue, 4 Sep 2012 10:56:30 +0000 (10:56 +0000)]
Remove unneeded ipfw headers introduced in r213447 from Infiniband code.

MFC after:     2 weeks

11 years agoFree memory allocated by procstat_getfiles(), which may make difference
trociny [Tue, 4 Sep 2012 05:54:43 +0000 (05:54 +0000)]
Free memory allocated by procstat_getfiles(), which may make difference
when procstat(1) is run with -a option.

Submitted by: Daniel Dettlaff <dmilith gmail com>
MFC after: 1 week

11 years agoAdd __BEGIN_DECLS and __END_DECLS to make libprocstat more C++-friendly.
trociny [Tue, 4 Sep 2012 05:51:50 +0000 (05:51 +0000)]
Add __BEGIN_DECLS and __END_DECLS to make libprocstat more C++-friendly.

Submitted by: Daniel Dettlaff <dmilith gmail com>
MFC after: 1 week

11 years agoUpdate arcmsr(4) to vendor version 1.20.00.25.
delphij [Tue, 4 Sep 2012 05:15:54 +0000 (05:15 +0000)]
Update arcmsr(4) to vendor version 1.20.00.25.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: Ching-Lung Huang <ching2048 areca com tw>
MFC after: 2 weeks

11 years agoAdd required USB AUDIO v2.0 structure definitions.
hselasky [Mon, 3 Sep 2012 19:17:25 +0000 (19:17 +0000)]
Add required USB AUDIO v2.0 structure definitions.

PR: misc/171254

11 years agoFix 'distributeworld' target when WITHOUT_GAMES is set.
gjb [Mon, 3 Sep 2012 18:17:21 +0000 (18:17 +0000)]
Fix 'distributeworld' target when WITHOUT_GAMES is set.

Reviewed by: des
Approved by: des
MFC after: 3 days
X-MFC-To: 9-only

11 years agoFix compact form of "synchronize" permission in setfacl(1) manual page - it
trasz [Mon, 3 Sep 2012 17:26:20 +0000 (17:26 +0000)]
Fix compact form of "synchronize" permission in setfacl(1) manual page - it
should be "s", not "S".

PR: docs/162380
MFC after: 2 weeks

11 years agoUpgrade OpenSSH to 6.1p1.
des [Mon, 3 Sep 2012 16:51:41 +0000 (16:51 +0000)]
Upgrade OpenSSH to 6.1p1.

11 years agoAdd more DWC OTG register definitions.
hselasky [Mon, 3 Sep 2012 15:22:02 +0000 (15:22 +0000)]
Add more DWC OTG register definitions.

Submitted by: Nick Hudson

11 years agoProvide a sysctl switch that allows to install ARP entries
glebius [Mon, 3 Sep 2012 14:29:28 +0000 (14:29 +0000)]
Provide a sysctl switch that allows to install ARP entries
with multicast bit set. FreeBSD refuses to install such
entries since 9.0, and this broke installations running
Microsoft NLB, which are violating standards.

Tested by: Tarasov Oleg <oleg_tarasov sg-tea.com>

11 years agoExplicitly document all variables in the net.link.ether.inet MIB.
glebius [Mon, 3 Sep 2012 14:16:16 +0000 (14:16 +0000)]
Explicitly document all variables in the net.link.ether.inet MIB.

11 years agoChange bridge(4) to use if_transmit for forwarding packets to underlying
glebius [Mon, 3 Sep 2012 10:08:20 +0000 (10:08 +0000)]
Change bridge(4) to use if_transmit for forwarding packets to underlying
interfaces instead of queueing.

Tested by: ray

11 years agoAdd missing braces.
ray [Mon, 3 Sep 2012 09:46:46 +0000 (09:46 +0000)]
Add missing braces.

Approved by: bschmidt (while mentor offline)
Pointed by:     gcooper
Pointy hat to:  ray

11 years ago- After r240026 sgrowsiz should be used in a safer maner.
zont [Mon, 3 Sep 2012 09:34:46 +0000 (09:34 +0000)]
- After r240026 sgrowsiz should be used in a safer maner.

Approved by: kib (mentor)
MCF after: 1 week

11 years ago- Mark some sysctls with CTLFLAG_TUN flag instead of CTLFLAG_RDTUN.
zont [Mon, 3 Sep 2012 09:26:56 +0000 (09:26 +0000)]
- Mark some sysctls with CTLFLAG_TUN flag instead of CTLFLAG_RDTUN.

Pointed out by: avg
Approved by: kib (mentor)
MFC after: 1 week

11 years agoAdd kern.hintmode sysctl variable to show current state of hints:
ray [Mon, 3 Sep 2012 08:52:05 +0000 (08:52 +0000)]
Add kern.hintmode sysctl variable to show current state of hints:
0 - loader hints in environment only;
1 - static hints only
2 - fallback mode (Dynamic KENV with fallback to kernel environment)
Add kern.hintmode write handler, accept only value 2. That will switch
static KENV to dynamic. So it will be possible to change device hints.

Approved by: adrian (mentor)

11 years agoCorrect an error in gxemul_disk_write(). It was issuing the command to
alc [Mon, 3 Sep 2012 02:32:00 +0000 (02:32 +0000)]
Correct an error in gxemul_disk_write().  It was issuing the command to
read from rather than write to the emulated disk.

Reviewed by: jmallett

11 years agoAdd myself to copyright sections, per CDDL license.
gjb [Mon, 3 Sep 2012 00:05:21 +0000 (00:05 +0000)]
Add myself to copyright sections, per CDDL license.

Requested by: mm

11 years agoRevert r240060: (Partial)
pfg [Sun, 2 Sep 2012 22:23:23 +0000 (22:23 +0000)]
Revert r240060: (Partial)

__BEGIN_DECLS and __END_DECLS in cdefs.h take care of the
__cplusplus mangling issues so most of the definitions
were redundant.

In the few places where they were not redundant we should
use BSD style instead of the guards used upstream.

Reported by: Yuri Pankov

11 years agoFix RPC headers for C++
pfg [Sun, 2 Sep 2012 21:04:40 +0000 (21:04 +0000)]
Fix RPC headers for C++

C++ mangling will cause trouble with variables like __rpc_xdr
in xdr.h so rename this to XDR.
While here add proper C++ guards to RPC headers.

PR: 137443
MFC after: 2 weeks

11 years agoMake sure we visit both symbol sections even if one of them doesn't
rpaulo [Sun, 2 Sep 2012 18:14:01 +0000 (18:14 +0000)]
Make sure we visit both symbol sections even if one of them doesn't
exist. This makes it possible to dtrace some C++ programs like devd.

11 years ago- Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern.maxssiz
zont [Sun, 2 Sep 2012 17:39:02 +0000 (17:39 +0000)]
- Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern.maxssiz
  and kern.sgrowsiz sysctls writable.

Approved by: kib (mentor)

11 years agoPartially revert r239959, after actually fixing most of the clang
dim [Sun, 2 Sep 2012 14:46:18 +0000 (14:46 +0000)]
Partially revert r239959, after actually fixing most of the clang
warnings in sys/gnu/fs/xfs.  The only warnings that still need to be
suppressed are those about array bound overruns of flexible array
members in xfs_dir2_{block,sf}.c, which are too expensive (in terms of
cascading code changes) to fix.

MFC after: 1 week
X-MFC-With: r239959

11 years agoFix a typo which results in RTT to be off by a factor of 10, if the RTT is
tuexen [Sun, 2 Sep 2012 12:37:30 +0000 (12:37 +0000)]
Fix a typo which results in RTT to be off by a factor of 10, if the RTT is
larger than 1 second.

MFC after: 3 days

11 years ago- Style(9) cleanup.
zont [Sun, 2 Sep 2012 11:03:18 +0000 (11:03 +0000)]
- Style(9) cleanup.

Approved by: kib (mentor)

11 years agoIn soreceive_generic() remove the optimization for the case when
trociny [Sun, 2 Sep 2012 07:33:52 +0000 (07:33 +0000)]
In soreceive_generic() remove the optimization for the case when
MSG_WAITALL is set, and it is possible to do the entire receive
operation at once if we block (resid <= hiwat). Actually it might make
the recv(2) with MSG_WAITALL flag get stuck when there is enough space
in the receiver buffer to satisfy the request but not enough to open
the window closed previously due to the buffer being full.

The issue can be reproduced using the following scenario:

On the sender side do 2 send(2) requests:

1) data of size much smaller than SOBUF_SIZE (e.g. SOBUF_SIZE / 10);
2) data of size equal to SOBUF_SIZE.

On the receiver side do 2 recv(2) requests with MSG_WAITALL flag set:

1) recv() data of SOBUF_SIZE / 10 size;
2) recv() data of SOBUF_SIZE size;

We totally fill the receiver buffer with one SOBUF_SIZE/10 size request
and partial SOBUF_SIZE request. When the first request is processed we
get SOBUF_SIZE/10 free space. It is just enough to receive the rest of
bytes for the second request, and soreceive_generic() blocks in the
part that is a subject of this change waiting for the rest. But the
window was closed when the buffer was filled and to avoid silly window
syndrome it opens only when available space is larger than sb_hiwat/4
or maxseg. So it is stuck and pending data is only sent via TCP window
probes.

Discussed with: kib (long ago)
MFC after: 2 weeks

11 years agoIn soreceive_generic() when checking if the type of mbuf has changed
trociny [Sun, 2 Sep 2012 07:29:37 +0000 (07:29 +0000)]
In soreceive_generic() when checking if the type of mbuf has changed
check it for MT_CONTROL type too, otherwise the assertion
"m->m_type == MT_DATA" below may be triggered by the following scenario:

- the sender sends some data (MT_DATA) and then a file descriptor
  (MT_CONTROL);
- the receiver calls recv(2) with a MSG_WAITALL asking for data larger
  than the receive buffer (uio_resid > hiwat).

MFC after: 2 week

11 years agoDisable strong signal diversity when enabling radar pulse detection
adrian [Sun, 2 Sep 2012 05:01:10 +0000 (05:01 +0000)]
Disable strong signal diversity when enabling radar pulse detection
for the AR5212 era NICs.

11 years agoAR5212 radar pulse fixes.
adrian [Sun, 2 Sep 2012 04:56:29 +0000 (04:56 +0000)]
AR5212 radar pulse fixes.

Fix the strong signal diversity capability setting - I had totally
messed up the indentation.

Set the default values to match what's in the .ini for now, rather than
what values I had previously gleaned from places.  This seems to work
quite well for the early AR5212 NICs I have.  Of course, later NICs
have different PHYs and the radar configuration is very card/board
dependent..

Tested:

 * ath1: AR5212 mac 5.3 RF5111 phy 4.1
   ath1: 2GHz radio: 0x0023; 5GHz radio: 0x0017

This detects 1, 5, 25, 50, 75, 100uS pulses reliably (with no interference.)

However, 10uS pulses don't detect reliably. That may be around the
transition between short and long pulses so some further tuning may
improve things.

11 years agoCalculate the new PTE value in pmap_enter() before acquiring any locks.
alc [Sun, 2 Sep 2012 04:39:07 +0000 (04:39 +0000)]
Calculate the new PTE value in pmap_enter() before acquiring any locks.

Move an assertion to the beginning of pmap_enter().

11 years agoFix a logic inversion in an assert to allow us to use dts files that
andrew [Sun, 2 Sep 2012 01:48:47 +0000 (01:48 +0000)]
Fix a logic inversion in an assert to allow us to use dts files that
include other files.

11 years ago Mark the ipfw interface type as not being ether. This fixes an issue
eadler [Sat, 1 Sep 2012 23:33:49 +0000 (23:33 +0000)]
Mark the ipfw interface type as not being ether. This fixes an issue
    where uuidgen tried to obtain a ipfw device's mac address which was
    always zero.

    PR: 170460
    Submitted by: wxs
    Reviewed by: bdrewery
    Reviewed by: delphij
    Approved by: cperciva
    MFC after: 1 week

11 years agoRework all non-contributed files that use `struct timezone'.
ed [Sat, 1 Sep 2012 14:45:15 +0000 (14:45 +0000)]
Rework all non-contributed files that use `struct timezone'.

This structure is not part of POSIX. According to POSIX, gettimeofday()
has the following prototype:

int gettimeofday(struct timeval *restrict tp, void *restrict tzp);

Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is
not used). Remove dead error handling code. Also use NULL for a
nul-pointer instead of integer 0.

While there, change all pieces of code that only use tv_sec to use
time(3), as this provides less overhead.

11 years agoImprove description for "rctl -l".
trasz [Sat, 1 Sep 2012 11:24:02 +0000 (11:24 +0000)]
Improve description for "rctl -l".

MFC after: 2 weeks

11 years agoFix panic in procdesc that can be triggered in the following scenario:
pjd [Sat, 1 Sep 2012 11:21:56 +0000 (11:21 +0000)]
Fix panic in procdesc that can be triggered in the following scenario:

1. Process A pdfork(2)s process B.
2. Process A passes process descriptor of B to unrelated process C.
3. Hit CTRL+C to terminate process A. Process B is also terminated
   with SIGINT.
4. init(8) collects status of process B.
5. Process C closes process descriptor associated with process B.

When we have such order of events, init(8), by collecting status of
process B, will call procdesc_reap(). This function sets pd_proc to NULL.

Now when process C calls close on this process descriptor,
procdesc_close() is called. Unfortunately procdesc_close() assumes that
pd_proc points at a valid proc structure, but it was set to NULL earlier,
so the kernel panics.

The patch also adds setting 'p->p_procdesc' to NULL in procdesc_reap(),
which I think should be done.

MFC after: 1 week

11 years agoRework time handling.
ed [Sat, 1 Sep 2012 10:56:15 +0000 (10:56 +0000)]
Rework time handling.

After I made the previous commit, I noticed the code does some things it
shouldn't. It casts a struct timeval to a time_t, assuming tv_sec is the
first member. Also, we are not interested in microseconds, so it is
better to just call time(NULL).

MFC after: 1 month

11 years agoAllow to pass providers with /dev/ prefix to g_provider_by_name().
pjd [Sat, 1 Sep 2012 10:52:19 +0000 (10:52 +0000)]
Allow to pass providers with /dev/ prefix to g_provider_by_name().

MFC after: 3 days

11 years agoRemove unneeded struct timezone.
ed [Sat, 1 Sep 2012 10:48:38 +0000 (10:48 +0000)]
Remove unneeded struct timezone.

We're only interested in a timestamp -- not the timezone.

11 years agoWhile there, remove an unneeded blank line.
ed [Sat, 1 Sep 2012 08:45:58 +0000 (08:45 +0000)]
While there, remove an unneeded blank line.

MFC after: 1 month

11 years agoFix whitespace.
ed [Sat, 1 Sep 2012 08:45:19 +0000 (08:45 +0000)]
Fix whitespace.

MFC after: 1 month

11 years agoFinish porting execsnoop to FreeBSD. This includes replacing the zonename
rpaulo [Sat, 1 Sep 2012 08:14:21 +0000 (08:14 +0000)]
Finish porting execsnoop to FreeBSD. This includes replacing the zonename
with a jail ID and removing the project ID from the list of options.

11 years agoThe dtnfsclient module dependency should only be added if the old NFS
rpaulo [Sat, 1 Sep 2012 07:35:16 +0000 (07:35 +0000)]
The dtnfsclient module dependency should only be added if the old NFS
client support was compiled in.

11 years agoMinor mdoc fix.
joel [Sat, 1 Sep 2012 07:11:25 +0000 (07:11 +0000)]
Minor mdoc fix.

11 years agoRemove trailing whitespace.
joel [Sat, 1 Sep 2012 06:23:13 +0000 (06:23 +0000)]
Remove trailing whitespace.

11 years agoRemove trailing whitespace.
joel [Sat, 1 Sep 2012 06:12:14 +0000 (06:12 +0000)]
Remove trailing whitespace.

11 years agoMdoc fixes.
joel [Sat, 1 Sep 2012 06:07:27 +0000 (06:07 +0000)]
Mdoc fixes.

11 years agoFix the PHY / CRC error bug in the AR5212 HAL, which apparently also pops
adrian [Sat, 1 Sep 2012 05:43:30 +0000 (05:43 +0000)]
Fix the PHY / CRC error bug in the AR5212 HAL, which apparently also pops
up on (at least) the AR5413.

The 30 second summary - if a CRC error frame comes in during PHY error
processing, that CRC bit will be set for all subsequent frames until
a non-CRC error frame is processed.

So to allow for accurate PHY error processing (Radar, and ANI on the AR5212
HAL chips) just tag the frame as being both CRC and PHY - let the driver
decide what to do with it.

PR: kern/169362

11 years agoIntroduce a new software PTE flag that indicates whether the mapping is
alc [Sat, 1 Sep 2012 03:46:28 +0000 (03:46 +0000)]
Introduce a new software PTE flag that indicates whether the mapping is
for a managed page.

Tested by: jchandra

11 years agoBring some changes from Bull's NFSv4 libtirpc implementation.
pfg [Sat, 1 Sep 2012 02:56:17 +0000 (02:56 +0000)]
Bring some changes from Bull's NFSv4 libtirpc implementation.

We especifically ignored the glibc compatibility changes
but this should help interaction with Solaris and Linux.
____

Fixed infinite loop in svc_run()
author Steve Dickson
Tue, 10 Jun 2008 12:35:52 -0500 (13:35 -0400)
Fixed infinite loop in svc_run()
____

__rpc_taddr2uaddr_af() assumes the netbuf to always have a
non-zero data. This is a bad assumption and can lead to a
seg-fault. This patch adds a check for zero length and returns
NULL when found.
author Steve Dickson
Mon, 27 Oct 2008 11:46:54 -0500 (12:46 -0400)
____

Changed clnt_spcreateerror() to return clearer
and more concise error messages.
author Steve Dickson
Thu, 20 Nov 2008 08:55:31 -0500 (08:55 -0500)
____

Converted all uid and gid variables of the type uid_t and gid_t.
author Steve Dickson
Wed, 28 Jan 2009 12:44:46 -0500 (12:44 -0500)
____

libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed

These fields in the rpcbind GETADDR call are being passed uninitialized
to CLNT_CALL. In the case of x86_64 at least, this usually leads to a
segfault. On x86, it sometimes causes segfaults and other times causes
garbage to be sent on the wire.

rpcbind generally ignores the r_owner field for calls that come in over
the wire, so it really doesn't matter what we send in that slot. We just
need to send something. The reference implementation from Sun seems to
send a blank string. Have ours follow suit.
author Jeff Layton
Fri, 13 Mar 2009 11:44:16 -0500 (12:44 -0400)
____

libtirpc: be sure to free cl_netid and cl_tp

When creating a client with clnt_tli_create, it uses strdup to copy
strings for these fields if nconf is passed in. clnt_dg_destroy frees
these strings already. Make sure clnt_vc_destroy frees them in the same
way.

author Jeff Layton
Fri, 13 Mar 2009 11:47:36 -0500 (12:47 -0400)

Obtained from: Bull GNU/Linux NFSv4 Project
MFC after: 3 weeks

11 years agoFix a twelve year old bug in readelf: when process_dynamic_segment()
dim [Fri, 31 Aug 2012 23:28:41 +0000 (23:28 +0000)]
Fix a twelve year old bug in readelf: when process_dynamic_segment()
encounters a DT_RUNPATH entry, the global dynamic_info[] array is
overrun, causing some other global variable to be overwritten.

In my testcase, this was the section_headers variable, leading to
segfaults or jemalloc assertions when it was freed later on.

Thanks to Koop Mast for providing samples of a few "bad" .so files.

MFC after: 1 week

11 years agoAlso relicense the ac(8) man page.
ed [Fri, 31 Aug 2012 22:37:08 +0000 (22:37 +0000)]
Also relicense the ac(8) man page.

MFC after: 1 month
Discussed with: Simon Gerraty and Chris Demetriou

11 years agoProperly enable Clang-style atomics when available.
ed [Fri, 31 Aug 2012 22:22:14 +0000 (22:22 +0000)]
Properly enable Clang-style atomics when available.

In addition to testing against cxx_atomic, we must check c_atomic. The
former is only set when building C++ code. Also use __has_extension
instead of __has_feature. This allows us to use the atomics outside of
C11.

Reported by: Ariane van der Steldt <ariane stack nl>
PR: threads/170073

11 years agoWork around several warnings from clang in the xfs filesystem, when
dim [Fri, 31 Aug 2012 21:45:49 +0000 (21:45 +0000)]
Work around several warnings from clang in the xfs filesystem, when
linking it statically into the kernel.  With our gcc in base there are
no warnings, so also remove the WERROR= from the module makefile.

Noted by: Eir Nym <eirnym@gmail.com>
MFC after: 1 week

11 years agoMinor mdoc fixes.
joel [Fri, 31 Aug 2012 21:44:12 +0000 (21:44 +0000)]
Minor mdoc fixes.

11 years agoSimilar to how r171350 fixed linking of kernel modules containing
jhb [Fri, 31 Aug 2012 21:27:23 +0000 (21:27 +0000)]
Similar to how r171350 fixed linking of kernel modules containing
firmware objects by adding --no-warn-mismatch to the linker flags,
add --no-warn-mismatch when linking firmware objects (*.fwo) as
well as to the link of the main kernel file.  This permits firmware
modules to be statically linked into an ia64 kernel.

11 years agoThe implied source variable (.IMPSRC) didn't actually work in my previous
jhb [Fri, 31 Aug 2012 21:10:38 +0000 (21:10 +0000)]
The implied source variable (.IMPSRC) didn't actually work in my previous
commit.  Change this to use .ALLSRC instead, but be careful to only use
the .fw file for NORMAL_FWO to ignore opt_global.h.

11 years agoAdd common rules for building firmware object files (NORMAL_FW to run
jhb [Fri, 31 Aug 2012 20:54:30 +0000 (20:54 +0000)]
Add common rules for building firmware object files (NORMAL_FW to run
uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those
instead of explicit ld/uudecode invocations in sys/conf/files.  Apart from
increasing readability, this makes it possible to adjust the flags used for
firmware objects in one place.

MFC after: 2 weeks

11 years agoRelicense ac(8).
ed [Fri, 31 Aug 2012 18:26:39 +0000 (18:26 +0000)]
Relicense ac(8).

Though the license of the original ac(8) source code provides many
liberties, we are already somewhat violating it. The license requires us
to clearly comment any modifications to the source code, as the original
authors of course do not want to get bug reports for modified versions
of ac(8). This is something we have not done consistently.

The need for such a license clause has become less over time. It is very
unlikely that end users will contact the original authors, as the
copyright is from 1994. I contacted both the copyright holders. They
responded in a timely fashion and were more than willing to relicense it
to a 2-clause BSD license. To address any concerns about bug reports
going to the original authors instead of me, add my own name and email
address to the copyright statements as well.

MFC after: 1 month
Special thanks to: Christopher Demetriou and Simon Gerraty

11 years agoMdoc fixes.
joel [Fri, 31 Aug 2012 17:18:41 +0000 (17:18 +0000)]
Mdoc fixes.

11 years agoRemove trailing whitespace.
joel [Fri, 31 Aug 2012 16:57:16 +0000 (16:57 +0000)]
Remove trailing whitespace.

11 years agoAdd a -h flag similar to the -h flag for ln to force mv(1) to treat a
jhb [Fri, 31 Aug 2012 14:35:01 +0000 (14:35 +0000)]
Add a -h flag similar to the -h flag for ln to force mv(1) to treat a
symbolic link to a directory for the target as a symbolic link instead of
a directory.  This makes it possible to atomically update a symbolic
link using rename().

Reviewed by: gj
MFC after: 2 weeks

11 years agoAdd a global MD macro for the VIS block size instead of duplicating
marius [Fri, 31 Aug 2012 11:15:01 +0000 (11:15 +0000)]
Add a global MD macro for the VIS block size instead of duplicating
it and using magic values all over the place.

MFC after: 1 week

11 years agoHeavily optimize the case of small RX packets of 160 bytes or less. For
scottl [Fri, 31 Aug 2012 10:07:38 +0000 (10:07 +0000)]
Heavily optimize the case of small RX packets of 160 bytes or less.  For
this case, allocate a plain mbuf and copy the frame into it, then send the
copy up the stack, leaving the original mbuf+cluster in place in the
receive ring for immediate re-use.  This saves a trip through 2 of the
3 zones of the compound mbuf allocator, a trip through busdma, and a trip
through the 1 of the 3 mbuf destructors.  For our load at Netflix, this can
lower CPU consumption by as much as 20%.  The copy algorithm is based on
investigative work from Luigi Rizzo earlier in the year.

Reviewed by: jfv
Obtained from: Netflix

11 years agoEssentially revert r239912. The amr_periodic function hadn't been armed in
scottl [Fri, 31 Aug 2012 09:42:46 +0000 (09:42 +0000)]
Essentially revert r239912.  The amr_periodic function hadn't been armed in
over 10 years and was dead code; the previous revision exposed it as such to
CLANG.  The solution is to cull the whole thing.

11 years agoUse better variable naming.
ed [Fri, 31 Aug 2012 08:48:53 +0000 (08:48 +0000)]
Use better variable naming.

MFC after: 1 month

11 years agoReplace all uses of the vm page queues lock by a r/w lock that is private
alc [Fri, 31 Aug 2012 02:59:44 +0000 (02:59 +0000)]
Replace all uses of the vm page queues lock by a r/w lock that is private
to this pmap.

Tested by: Ian Lepore

11 years agoThe error syntax has changed.
des [Thu, 30 Aug 2012 22:56:32 +0000 (22:56 +0000)]
The error syntax has changed.

11 years agoPost r222812 KTR_CPUMASK started being initialized only as a tunable
attilio [Thu, 30 Aug 2012 21:22:47 +0000 (21:22 +0000)]
Post r222812 KTR_CPUMASK started being initialized only as a tunable
handler and not more statically.

Unfortunately, it seems that this is not ideal for new platform bringup
and boot low level development (which needs ktr_cpumask to be effective
before tunables can be setup).

Because of this, add a way to statically initialize cpusets, by passing
an list of initializers, divided by commas. Also, provide a way to enforce
an all-set mask, for above mentioned initializers.

This imposes some differences on how KTR_CPUMASK is setup now as a
kernel option, and in particular this makes the words specifications
backward wrt. what is currently in -CURRENT. In order to avoid mismatches
between KTR_CPUMASK definition and other way to setup the mask
(tunable, sysctl) and to print it, change the ordering how
cpusetobj_print() and cpusetobj_scan() acquire the words belonging
to the set.
Please give a look to sys/conf/NOTES in order to understand how the
new format is supposed to work.

Also, ktr manpages will be updated shortly by gjb which volountereed
for this.

This patch won't be merged because it changes a POLA (at least
from the theoretical standpoint) and this is however a patch that
proves to be effective only in development environments.

Requested by: rpaulo
Reviewed by: jeff, rpaulo

11 years agoAdd barebone Raspberry Pi port. Supported parts:
gonzo [Thu, 30 Aug 2012 20:59:37 +0000 (20:59 +0000)]
Add barebone Raspberry Pi port. Supported parts:
  - Interrupts controller
  - Watchdog
  - System timer
  - Framebuffer (hardcoded resolution/bpp)

11 years agoAdd PrimeCell UART (PL011) driver
gonzo [Thu, 30 Aug 2012 20:31:53 +0000 (20:31 +0000)]
Add PrimeCell UART (PL011) driver

Obtained from: Semihalf

11 years agoAttach interrupt handlers during attach instead of during the first time
jhb [Thu, 30 Aug 2012 17:47:39 +0000 (17:47 +0000)]
Attach interrupt handlers during attach instead of during the first time
the interface is brought up.  Without this, the boot time interrupt
round-robin assignment does not think the allocated interrupt resources
are active and leaves them assigned to CPU 0.

While here, add descriptive tags to each interrupt handler when MSI-X
is used.

Reviewed by: np
MFC after: 1 week

11 years agoUse callout(9) rather than timeout(9). Note that the periodic timer in
jhb [Thu, 30 Aug 2012 17:37:01 +0000 (17:37 +0000)]
Use callout(9) rather than timeout(9).  Note that the periodic timer in
amr(4) is never started, so this should be even more of a NOP than
normal.

11 years agoThe DIR-825 cal data is in an odd spot. I don't know why it's here.
adrian [Thu, 30 Aug 2012 17:35:12 +0000 (17:35 +0000)]
The DIR-825 cal data is in an odd spot. I don't know why it's here.

(This works on my board because I wrote new caldata into this spot;
but this obviously won't work for stock DIR-825 units out there.)

11 years agoMassively refactor ac(8).
ed [Thu, 30 Aug 2012 16:45:27 +0000 (16:45 +0000)]
Massively refactor ac(8).

- Use queue(3) -- not some homegrown implementation of linked lists.
- Rename structures to _entry, as they are entries in the linked list --
  not the lists themselves.
- Don't store entire copies of struct utmpx in utmpx_entry, but only the
  members we're interested in. Large fields such as hostnames are not
  needed during the execution of the program.
- Give structure members useful names, instead of `name'.
- While there, use struct timevals instead of time_t's internally. This
  is not strictly useful, but while we're at it...
- Mark stuff static.
- Add missing const keywords.
- Remove unneeded prototypes.
- Remove workaround for sparc64-specific utmp problems. These don't
  apply to utmpx.
- Don't discard entries when timestamps are not monotone. This shouldn't
  ever happen with utmpx, but discarding them is a bit too harsh.
- Remove debug code. We nowadays have `getent utmpx', which can be used
  to analyze logfiles in depth.
- Use proper uppercasing/periods in comments.
- Print output of `ac -p' sorted alphabetically, instead of first
  occurrence.
- Properly check against pts/* instead of tty[PQRSpqrs]* to determine
  whether a TTY is a pseudo-terminal.

MFC after: 1 month

11 years agoPreparations for adding USB HOST mode to the DWC OTG driver.
hselasky [Thu, 30 Aug 2012 16:19:05 +0000 (16:19 +0000)]
Preparations for adding USB HOST mode to the DWC OTG driver.
Merge register file with external one and put all register
definitions in a separate file.

Submitted by: ray @

11 years agoAdd bunch of ATI HDMI HDA controller IDs.
mav [Thu, 30 Aug 2012 15:47:20 +0000 (15:47 +0000)]
Add bunch of ATI HDMI HDA controller IDs.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week

11 years agoAdd IDs for JMicron JMB360/JMB362 AHCI SATA controllers.
mav [Thu, 30 Aug 2012 15:23:59 +0000 (15:23 +0000)]
Add IDs for JMicron JMB360/JMB362 AHCI SATA controllers.

MFC after: 1 week

11 years agoClarify that bus_dma does not stall future load requests once a load is
jhb [Thu, 30 Aug 2012 14:44:30 +0000 (14:44 +0000)]
Clarify that bus_dma does not stall future load requests once a load is
deferred.  The caller is required to enforce that if that is desired.

MFC after: 2 weeks

11 years agoIn ifc_alloc_unit():
glebius [Thu, 30 Aug 2012 12:18:45 +0000 (12:18 +0000)]
In ifc_alloc_unit():
- In the !wildcard case, return ENOSPC instead of confusing EEXIST
  in case if ifc->ifc_maxunit reached.
- Fix unit leak, that I've introduced in previous revision.

Submitted by: Daan Vreeken <Daan vitsch.nl>

11 years agoRemove a duplicated "thread".
pluknet [Thu, 30 Aug 2012 11:52:26 +0000 (11:52 +0000)]
Remove a duplicated "thread".

11 years ago- Remove unused variables.
zont [Thu, 30 Aug 2012 08:54:13 +0000 (08:54 +0000)]
- Remove unused variables.
- Fix warnings about comparing signed and unsigned ints.

Approved by: kib (mentor)

11 years ago- It's also need to lock current memory.
zont [Thu, 30 Aug 2012 08:07:37 +0000 (08:07 +0000)]
- It's also need to lock current memory.

Approved by: kib (mentor)
MFC after: 1 week

11 years ago- Remove accounting of locked memory from vsunlock(9) that I missed in r239818.
zont [Thu, 30 Aug 2012 08:03:33 +0000 (08:03 +0000)]
- Remove accounting of locked memory from vsunlock(9) that I missed in r239818.

Approved by: kib (mentor)

11 years agoMigrate the AR9285 diversity configuration LNA configuration to use
adrian [Thu, 30 Aug 2012 06:55:47 +0000 (06:55 +0000)]
Migrate the AR9285 diversity configuration LNA configuration to use
some HAL definitions rather than local definitions.

The original source (ath9k) pulled this stuff from the QCA driver and
removed the HAL_* prefix.  I'm just restoring the correct order of things.

Obtained from: Qualcomm Atheros

11 years agoDo not call sati_check_data_io() for SATI_UNMAP sequences.
jimharris [Thu, 30 Aug 2012 00:43:14 +0000 (00:43 +0000)]
Do not call sati_check_data_io() for SATI_UNMAP sequences.

This routine is intended only for commands such as INQUIRY where
the controller may fill out a smaller amount of data than allocated
by the host.

The end result of this bug was that isci(4) would report non-zero
resid for successful SCSI_UNMAP commands.

Sponsored by: Intel
MFC after: 3 days

11 years agoMore attempts at space saving.
adrian [Wed, 29 Aug 2012 22:58:52 +0000 (22:58 +0000)]
More attempts at space saving.

* add cam as a module to build - but build in scbus/da for now, as
  "cam" as a module includes all cam devices. Hardly space saving.
* Don't build FFS snapshot support.

11 years agoDo a bunch of fixing and refactoring.
adrian [Wed, 29 Aug 2012 22:55:50 +0000 (22:55 +0000)]
Do a bunch of fixing and refactoring.

Fix up gzip to crunch right.

Add kenv, although I'm not yet sure why it isn't working on my MIPS
boards (reading kenv always returns blank.)

11 years agoDisable fsck_ffs for now, 4MB target size issues.
adrian [Wed, 29 Aug 2012 22:54:39 +0000 (22:54 +0000)]
Disable fsck_ffs for now, 4MB target size issues.

11 years agoDisable building textproc for now, it doesn't fit on my 4MB flash
adrian [Wed, 29 Aug 2012 22:54:27 +0000 (22:54 +0000)]
Disable building textproc for now, it doesn't fit on my 4MB flash
partition.

Add -lcrypt as a dynamic target.

11 years agoFor now, disable building wpa_supplicant.
adrian [Wed, 29 Aug 2012 22:53:54 +0000 (22:53 +0000)]
For now, disable building wpa_supplicant.

My 4MB flash builds can't handle the bloat.

11 years agoAvoid passing uninitialized stack to addelem() if called with an empty arg.
emaste [Wed, 29 Aug 2012 21:38:34 +0000 (21:38 +0000)]
Avoid passing uninitialized stack to addelem() if called with an empty arg.

PR: bin/171174

11 years agoAfter r239868, also remove the comment about the workaround for
dim [Wed, 29 Aug 2012 18:58:03 +0000 (18:58 +0000)]
After r239868, also remove the comment about the workaround for
ah_eeprom_9287.c.

11 years agoTeach libdwarf about the DW_FORM_flag_present dwarf attribute, so
dim [Wed, 29 Aug 2012 18:49:41 +0000 (18:49 +0000)]
Teach libdwarf about the DW_FORM_flag_present dwarf attribute, so
programs using libdwarf (such as ctfconvert) don't error out on files
containing the attribute.

MFC after: 2 weeks

11 years agoTeach gdb about the DW_FORM_flag_present dwarf attribute, so it doesn't
dim [Wed, 29 Aug 2012 18:37:10 +0000 (18:37 +0000)]
Teach gdb about the DW_FORM_flag_present dwarf attribute, so it doesn't
error out on files that contain it.  (This attribute can be emitted by
newer versions of clang.)

MFC after: 2 weeks

11 years agoRemove the argument-less .align directive in sys/i386/bios/smapi_bios.S.
dim [Wed, 29 Aug 2012 18:22:52 +0000 (18:22 +0000)]
Remove the argument-less .align directive in sys/i386/bios/smapi_bios.S.
Specifying no argument is undocumented in the gas manual, and clang's
integrated assembler refuses to parse it.  Also, removing it causes no
change at all in the resulting object file.

MFC after: 1 week

11 years agoRemove workaround for the clang 3.2 warning in ah_eeprom_9287.c, since
dim [Wed, 29 Aug 2012 18:14:20 +0000 (18:14 +0000)]
Remove workaround for the clang 3.2 warning in ah_eeprom_9287.c, since
the fix has been applied now.

11 years agoThere's no nede to allocate a DMA map just before calling bus_dmamem_alloc().
adrian [Wed, 29 Aug 2012 16:58:51 +0000 (16:58 +0000)]
There's no nede to allocate a DMA map just before calling bus_dmamem_alloc().

In fact, bus_dmamem_alloc() happily NULLs the dmat pointer passed in,
before replacing it with its own.

This fixes a MIPS crash when kldload'ing if_ath/if_ath_pci -
bus_dmamap_destroy() was passed in a NULL dmat pointer and was doing
all kinds of very bad things.

Reviewed by: scottl

11 years ago- Unlike cache invalidation and TLB demapping IPIs, reading registers from
marius [Wed, 29 Aug 2012 16:56:50 +0000 (16:56 +0000)]
- Unlike cache invalidation and TLB demapping IPIs, reading registers from
  other CPUs doesn't require locking so get rid of it. As the latter is used
  for the timecounter on certain machine models, using a spin lock in this
  case can lead to a deadlock with the upcoming callout(9) rework.
- Merge r134227/r167250 from x86:
  Avoid cross-IPI SMP deadlock by using the smp_ipi_mtx spin lock not only
  for smp_rendezvous_cpus() but also for the MD cache invalidation and TLB
  demapping IPIs.
- Mark some unused function arguments as such.

MFC after: 1 week

11 years agoFix whitespace.
ed [Wed, 29 Aug 2012 16:15:22 +0000 (16:15 +0000)]
Fix whitespace.