]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoAdd the new athratestats tool.
adrian [Fri, 20 Jul 2012 07:17:24 +0000 (07:17 +0000)]
Add the new athratestats tool.

12 years agoTidy things up substantially:
adrian [Fri, 20 Jul 2012 06:11:26 +0000 (06:11 +0000)]
Tidy things up substantially:

* remove some debugging;
* introduce command line arguments;
* introduce support for non-ath0 interfaces.

12 years agoDon't forget to initialize return value.
davidxu [Fri, 20 Jul 2012 05:47:12 +0000 (05:47 +0000)]
Don't forget to initialize return value.

12 years agoSimplify code by replacing _thr_ref_add() with _thr_find_thread().
davidxu [Fri, 20 Jul 2012 03:37:19 +0000 (03:37 +0000)]
Simplify code by replacing _thr_ref_add() with _thr_find_thread().

12 years agoEliminate duplicated code.
davidxu [Fri, 20 Jul 2012 03:27:07 +0000 (03:27 +0000)]
Eliminate duplicated code.

12 years agoDon't assign same value.
davidxu [Fri, 20 Jul 2012 03:22:17 +0000 (03:22 +0000)]
Don't assign same value.

12 years agoEliminate duplicated code.
davidxu [Fri, 20 Jul 2012 03:16:52 +0000 (03:16 +0000)]
Eliminate duplicated code.

12 years agoEliminate duplicated code.
davidxu [Fri, 20 Jul 2012 03:00:41 +0000 (03:00 +0000)]
Eliminate duplicated code.

12 years agoUse the rate control table to display the rate rather than the rix,
adrian [Fri, 20 Jul 2012 02:18:47 +0000 (02:18 +0000)]
Use the rate control table to display the rate rather than the rix,
making the output of this program much more meaningful.

12 years agoIntroduce a rate table TLV so rate table statistics consumers
adrian [Fri, 20 Jul 2012 02:17:48 +0000 (02:17 +0000)]
Introduce a rate table TLV so rate table statistics consumers
know how to map rix -> rate code.

12 years agoDon't forget to release a thread reference count,
davidxu [Fri, 20 Jul 2012 01:56:14 +0000 (01:56 +0000)]
Don't forget to release a thread reference count,
replace _thr_ref_add() with _thr_find_thread(),
so reference count is no longer needed.

MFC after: 3 days

12 years agoBump this up to match what the HAL is at now.
adrian [Fri, 20 Jul 2012 01:41:18 +0000 (01:41 +0000)]
Bump this up to match what the HAL is at now.

12 years agoImplement a first cut of the 'sample' rate statistics userland utility.
adrian [Fri, 20 Jul 2012 01:38:03 +0000 (01:38 +0000)]
Implement a first cut of the 'sample' rate statistics userland utility.

This outputs almost exactly the same information as the kernel sysctl does,
however the rix -> rate mapping isn't yet available as a TLV.

12 years agoEnable the basic node-based rate control statistics via an ioctl().
adrian [Fri, 20 Jul 2012 01:36:46 +0000 (01:36 +0000)]
Enable the basic node-based rate control statistics via an ioctl().

12 years agoAdd a per-node rate control routine for each rate control module.
adrian [Fri, 20 Jul 2012 01:36:02 +0000 (01:36 +0000)]
Add a per-node rate control routine for each rate control module.

For now, the only module implement is 'sample', and that's only partially
implemented.  The main issue here with reusing this structure in userland
is that it uses 'rix' everywhere, which requires the userland code to
have access to the current HAL rate table.

For now, this is a very large work in progress.

Specific details:

* The rate control information is per-node at the moment and wrapped
  in a TLV, to ease parsing and backwards compatibility.
* .. but so I can be slack for now, the userland statistics are just
  a copy of the kernel-land sample node state.
* However, for now use a temporary copy and change the rix entries
  to dot11rate entries to make it slightly easier to eyeball.

Problems:

* The actual rate information table is unfortunately indexed by rix
  and it doesn't contain a rate code.  So the userland side of this
  currently has no way to extract out a mapping.

TODO:

* Add a TLV payload to dump out the rate control table mapping so
  'rix' can be turned into a dot11 / MCS rate.
* .. then remove the temporary copy.

12 years agoCreate an ioctl API for fetching the current rate control information.
adrian [Fri, 20 Jul 2012 01:27:20 +0000 (01:27 +0000)]
Create an ioctl API for fetching the current rate control information.

12 years agoImport an updated version of moduli(5) manual page from OpenBSD.
delphij [Fri, 20 Jul 2012 01:11:53 +0000 (01:11 +0000)]
Import an updated version of moduli(5) manual page from OpenBSD.

MFC after: 1 month

12 years agoPrepare for (re)using this header file in userland.
adrian [Fri, 20 Jul 2012 00:47:23 +0000 (00:47 +0000)]
Prepare for (re)using this header file in userland.

Remove the inlined code from the header file if it's compiled in userland.
It's not required and it shouldn't be there in the first place.

12 years agoRevert SVN r238628 (mistake).
dteske [Thu, 19 Jul 2012 22:41:00 +0000 (22:41 +0000)]
Revert SVN r238628 (mistake).

12 years agoFix syntax errors (s/:=/:-/).
dteske [Thu, 19 Jul 2012 22:33:13 +0000 (22:33 +0000)]
Fix syntax errors (s/:=/:-/).

Reviewed by: emaste (mentor)
Approved by: emaste (mentor)
MFC after: 3 days

12 years agoRemove line which was accidentally kept in r238614.
kib [Thu, 19 Jul 2012 20:38:03 +0000 (20:38 +0000)]
Remove line which was accidentally kept in r238614.

Submitted by: pjd
Pointy hat to: kib
MFC after: 1 week

12 years agoMerge more cosmetical changes from NetBSD's libedit.
pfg [Thu, 19 Jul 2012 19:15:47 +0000 (19:15 +0000)]
Merge more cosmetical changes from NetBSD's libedit.

makelist:
change tr '[a-z]' '[A-Z]' to tr '[:lower:]' '[:upper:]' so that POSIX
systems work proerly regardsless of environment variable settings.

tokenizer.c:
pass lint on _LP64

Obtained from: NetBSD
MFC after: 2 weeks

12 years agoIntroduce curpcb magic variable, similar to curthread, which is MD
kib [Thu, 19 Jul 2012 19:09:12 +0000 (19:09 +0000)]
Introduce curpcb magic variable, similar to curthread, which is MD
amd64.  It is implemented as __pure2 inline with non-volatile asm read
from pcpu, which allows a compiler to cache its results.

Convert most PCPU_GET(pcb) and curthread->td_pcb accesses into curpcb.

Note that __curthread() uses magic value 0 as an offsetof(struct pcpu,
pc_curthread). It seems to be done this way due to machine/pcpu.h
needs to be processed before sys/pcpu.h, because machine/pcpu.h
contributes machine-depended fields to the struct pcpu definition. As
result, machine/pcpu.h cannot use struct pcpu yet.

The __curpcb() also uses a magic constant instead of offsetof(struct
pcpu, pc_curpcb) for the same reason. The constants are now defined as
symbols and CTASSERTs are added to ensure that future KBI changes do
not break the code.

Requested and reviewed by: bde
MFC after:    3 weeks

12 years agoAllow to specify no source-address-selection policy
emax [Thu, 19 Jul 2012 15:36:36 +0000 (15:36 +0000)]
Allow to specify no source-address-selection policy

MFC after: 1 week

12 years agoRevert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for user
marius [Thu, 19 Jul 2012 14:43:46 +0000 (14:43 +0000)]
Revert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for user
data introduced in r236061. Using that flag doesn't make that much
sense on this case as the DMA maps using it are also created during
sym_pci_attach(). Moreover, due to the maxsegsz parameter used, doing
so may exhaust the bounce pages pool on architectures requiring
bounce pages. [1]
While at it, use a slightly more appropriate maxsegsz parameter.

PR: 169526
Submitted by: Mike Watters [1]
MFC after: 3 days

12 years agoAdd share/examples/libusb20 to the list of directories.
joerg [Thu, 19 Jul 2012 11:18:41 +0000 (11:18 +0000)]
Add share/examples/libusb20 to the list of directories.

12 years agoFix several reads beyond the mapped first page of the binary in the
kib [Thu, 19 Jul 2012 11:15:53 +0000 (11:15 +0000)]
Fix several reads beyond the mapped first page of the binary in the
ELF parser. Specifically, do not allow note reader and interpreter
path comparision in the brandelf code to read past end of the page.
This may happen if specially crafter ELF image is activated.

Submitted by: Lukasz Wojcik <lukasz.wojcik zoho com>
MFC after: 3 days

12 years agoDocument F_DUPFD_CLOEXEC. Also provide some wording changes for
kib [Thu, 19 Jul 2012 10:23:59 +0000 (10:23 +0000)]
Document F_DUPFD_CLOEXEC. Also provide some wording changes for
F_DUPFD to make it less confusing, at least for me.

MFC after: 1 week

12 years agoImplement F_DUPFD_CLOEXEC command for fcntl(2), specified by SUSv4.
kib [Thu, 19 Jul 2012 10:22:54 +0000 (10:22 +0000)]
Implement F_DUPFD_CLOEXEC command for fcntl(2), specified by SUSv4.

PR:   standards/169962
Submitted by: Jukka A. Ukkonen <jau iki fi>
MFC after: 1 week

12 years agoUpdate my e-mail to my FreeBSD one.
zeising [Thu, 19 Jul 2012 08:56:30 +0000 (08:56 +0000)]
Update my e-mail to my FreeBSD one.

Approved by: joel (mentor)

12 years agoDon't unnecessarily set PGA_REFERENCED in pmap_enter().
alc [Thu, 19 Jul 2012 05:34:19 +0000 (05:34 +0000)]
Don't unnecessarily set PGA_REFERENCED in pmap_enter().

12 years agoConvert the TX path to use the new HAL methods for accessing the
adrian [Thu, 19 Jul 2012 03:51:16 +0000 (03:51 +0000)]
Convert the TX path to use the new HAL methods for accessing the
TX descriptor link pointers.

This is required for the AR93xx and later chipsets.

The RX path is slightly different - the legacy RX path directly
accesses ath_desc->ds_link for now, however this isn't at all done
for EDMA (FIFO) RX.

Now, for those performing a little software archeology here:

This is all a bit sub-optimal. "struct ath_desc" is only really relevant
for the pre-AR93xx NICs - where ds_link and ds_data is always in the
same location.

The AR93xx and later NICs have different descriptor layouts altogether.

Now, for AR93xx and later NICs, you should never directly reference
ds_link and ds_data, as:

* the RX descriptors don't have either - the data is _after_ the RX
  descriptor.  They're just one large buffer.  There's also no need for
  a per-descriptor RX buffer size as they're all fixed sizes.

* the TX descriptors have 4 buffer and 4 length fields _and_ a link
  pointer.  Each frame takes up one TX FIFO pointer, but it can contain
  multiple subframes (either multiple frames in a buffer, and/or
  multiple frames in an aggregate/RIFS burst.)

* .. so, when TX frames are queued to a hardware queue, the link
  pointer is ONLY for buffers in that frame/aggregate.  The next frame
  starts in a new FIFO pointer.

* Finally, descriptor completion status is in a different ring.
  I'll write something up about that when its time to do so.

This was inspired by Linux ath9k and the reference driver but is a
reimplementation.

Obtained from: Linux ath9k, Qualcomm Atheros

12 years agoUse HAL_NUM_RX_QUEUES rather than a magic constant.
adrian [Thu, 19 Jul 2012 03:18:15 +0000 (03:18 +0000)]
Use HAL_NUM_RX_QUEUES rather than a magic constant.

12 years agoBreak out the TX descriptor link field into HAL methods.
adrian [Thu, 19 Jul 2012 02:25:14 +0000 (02:25 +0000)]
Break out the TX descriptor link field into HAL methods.

The DMA FIFO chips (AR93xx and later) differ slightly to th elegacy
chips:

* The RX DMA descriptors don't have a ds_link field;
* The TX DMA descriptors have a ds_link field however at a different
  offset.

This is a reimplementation based on what the reference driver and ath9k
does.

A subsequent commit will enable it in the TX and beacon paths.

Obtained from: Linux ath9k, Qualcomm Atheros

12 years agoXref mwl(4) and rum(4) in hostapd(8).
gjb [Wed, 18 Jul 2012 23:32:12 +0000 (23:32 +0000)]
Xref mwl(4) and rum(4) in hostapd(8).

MFC after: 3 days

12 years agoMove -n ${_jail} before ${_flags} so that any -n options in ${_flags}
des [Wed, 18 Jul 2012 23:01:23 +0000 (23:01 +0000)]
Move -n ${_jail} before ${_flags} so that any -n options in ${_flags}
will override ours instead of the other way around.

12 years agoDo not restart scan of the inactive queue when non-inactive page is
kib [Wed, 18 Jul 2012 21:47:50 +0000 (21:47 +0000)]
Do not restart scan of the inactive queue when non-inactive page is
found. Rather, we shall not find such pages on inactive queue at all.

Requested and reviewed by: alc
MFC after:    2 weeks

12 years agoAdd some examples about how to use FreeBSD's libusb20 in your own
joerg [Wed, 18 Jul 2012 21:30:17 +0000 (21:30 +0000)]
Add some examples about how to use FreeBSD's libusb20 in your own
code.

12 years agoAdd -g (gigabyte) flag to complement -k (kilobyte) and -m (megabyte).
des [Wed, 18 Jul 2012 19:28:22 +0000 (19:28 +0000)]
Add -g (gigabyte) flag to complement -k (kilobyte) and -m (megabyte).

MFC after: 1 week

12 years agoOn BIO_ERROR, set bio_resid to stop losing data in the error case.
sbruno [Wed, 18 Jul 2012 18:10:27 +0000 (18:10 +0000)]
On BIO_ERROR, set bio_resid to stop losing data in the error case.

Submitted by: Mark Johnston <markjdb@gmail.com>
Reviewed by: scottl@freebsd.org
MFC after: 2 weeks

12 years agoReturn zero from get_addrselectpolicy() when no source-address-selection
emax [Wed, 18 Jul 2012 15:52:09 +0000 (15:52 +0000)]
Return zero from get_addrselectpolicy() when no source-address-selection
policy is installed.

MFC after: 1 week

12 years agoOn AMD64, provide siginfo.si_code for floating point errors when error
kib [Wed, 18 Jul 2012 15:43:47 +0000 (15:43 +0000)]
On AMD64, provide siginfo.si_code for floating point errors when error
occurs using the SSE math processor.  Update comments describing the
handling of the exception status bits in coprocessors control words.

Remove GET_FPU_CW and GET_FPU_SW macros which were used only once.
Prefer to use curpcb to access pcb_save over the longer path of
referencing pcb through the thread structure.

Based on the submission by: Ed Alley <wea llnl gov>
PR:   amd64/169927
Reviewed by: bde
MFC after: 3 weeks

12 years agoAdd stmxcsr.
kib [Wed, 18 Jul 2012 15:36:03 +0000 (15:36 +0000)]
Add stmxcsr.

Submitted by: Ed Alley <wea llnl gov>
PR:   amd64/169927
MFC after: 3 weeks

12 years agoFix some typos in r238595.
mav [Wed, 18 Jul 2012 12:41:09 +0000 (12:41 +0000)]
Fix some typos in r238595.

Reported by: brueffer

12 years agoAdd bunch of new ASC/ASCQ values from T10 site.
mav [Wed, 18 Jul 2012 12:23:45 +0000 (12:23 +0000)]
Add bunch of new ASC/ASCQ values from T10 site.

12 years agoFix a small memory leak in mpssas_get_sata_identify(). The change has been
brueffer [Wed, 18 Jul 2012 09:06:07 +0000 (09:06 +0000)]
Fix a small memory leak in mpssas_get_sata_identify().  The change has been
submitted upstream as well.

Reviewed by: ken, scottl
Obtained from: DragonFly BSD (change df8658e030226dd015cff9749452666d8fe1e87b)
MFC after: 5 days

12 years agoPlug a reference leak: before doing 'goto again' we need to unref
glebius [Wed, 18 Jul 2012 08:58:30 +0000 (08:58 +0000)]
Plug a reference leak: before doing 'goto again' we need to unref
ia->ia_ifa if there is any.

Submitted by: Andrey Zonov <andrey zonov.org>

12 years agoWhen traversing global in_ifaddr list in the IFP_TO_IA() macro, we need
glebius [Wed, 18 Jul 2012 08:41:00 +0000 (08:41 +0000)]
When traversing global in_ifaddr list in the IFP_TO_IA() macro, we need
to obtain IN_IFADDR_RLOCK().

12 years agoAdd missing free.
trasz [Wed, 18 Jul 2012 07:26:20 +0000 (07:26 +0000)]
Add missing free.

12 years agoSort per the comment.
obrien [Wed, 18 Jul 2012 07:07:54 +0000 (07:07 +0000)]
Sort per the comment.

12 years agoa ";" tells make we want the shell to be used
obrien [Wed, 18 Jul 2012 05:57:42 +0000 (05:57 +0000)]
a ";" tells make we want the shell to be used

Submitted by: Simon Gerraty <sjg@juniper.net>

12 years agoRemoving bsd{ar,ranlib} found on my ancient installation.
avatar [Wed, 18 Jul 2012 05:50:40 +0000 (05:50 +0000)]
Removing bsd{ar,ranlib} found on my ancient installation.

MFC after: 3 weeks

12 years agoMove what remains of vm/vm_contig.c into vm/vm_pageout.c, where similar
alc [Wed, 18 Jul 2012 05:21:34 +0000 (05:21 +0000)]
Move what remains of vm/vm_contig.c into vm/vm_pageout.c, where similar
code resides.  Rename vm_contig_grow_cache() to vm_pageout_grow_cache().

Reviewed by: kib

12 years agoAdd back spare fields consumed in r237545. It seems that these should only
ken [Tue, 17 Jul 2012 22:16:10 +0000 (22:16 +0000)]
Add back spare fields consumed in r237545.  It seems that these should only
be consumed to maintain backward compatibility in stable, but should not be
consumed in head.

Submitted by: trasz, attilio (indirectly)

12 years agoDtrace: improve handling of library paths.
pfg [Tue, 17 Jul 2012 19:57:34 +0000 (19:57 +0000)]
Dtrace: improve handling of library paths.

Merge changes from illumos

906 dtrace depends_on pragma should search all library paths, not just the
current one

949 dtrace should only include the first instance of a library found on
its library path

Illumos Revisions: 13353:936a1e45726c
13354:2b2c36a81512

Reference:
https://www.illumos.org/issues/906
https://www.illumos.org/issues/949

Tested by: Fabian Keil
Obtained from: Illumos
MFC after: 3 weeks

12 years agoChange UL to ULL since time is 32 bits.
gnn [Tue, 17 Jul 2012 14:36:40 +0000 (14:36 +0000)]
Change UL to ULL since time is 32 bits.

Pointed out by: avg@
MFC after: 2 weeks

12 years agoFor Intel Panther/Lynx Point USB 3.0 xHCI controllers enable SuperSpeed USB
mav [Tue, 17 Jul 2012 14:03:04 +0000 (14:03 +0000)]
For Intel Panther/Lynx Point USB 3.0 xHCI controllers enable SuperSpeed USB
capability and reroute USB 2.0 ports to the xHCI controller.

Reviewed by: hselasky

12 years agoFix a refcount bug when freeing an association.
tuexen [Tue, 17 Jul 2012 13:03:47 +0000 (13:03 +0000)]
Fix a refcount bug when freeing an association.
While there: Change code to be consistent.
Discussed with rrs@.
MFC after: 3 days

12 years agoMake sure that arraysz is initialized to a value larger than zero.
jh [Tue, 17 Jul 2012 09:34:52 +0000 (09:34 +0000)]
Make sure that arraysz is initialized to a value larger than zero.
arraysz could get initialized to zero on ZFS because ZFS reports
directory sizes differently compared to UFS.

PR: bin/169493
Tested by: swills
MFC after: 2 weeks

12 years agoRemove trailing whitespace.
jh [Tue, 17 Jul 2012 09:31:05 +0000 (09:31 +0000)]
Remove trailing whitespace.

MFC after: 2 weeks

12 years agoMove unmask IRQ function call up to nexus device level.
gonzo [Tue, 17 Jul 2012 03:18:12 +0000 (03:18 +0000)]
Move unmask IRQ function call up to nexus device level.

FDT-enabled targets were broken after r238043 that relies
on device up the hierarchy to properly setup interrupt.
nexus device for ARM platforms did job only partially:
setting handler but not unmasking interrupt. Unmasking
was performed by platform code.

Reviewed by: andrew@

12 years agoCorrect vm_page_alloc_contig()'s implementation of VM_ALLOC_NODUMP.
alc [Tue, 17 Jul 2012 02:36:59 +0000 (02:36 +0000)]
Correct vm_page_alloc_contig()'s implementation of VM_ALLOC_NODUMP.

12 years agoPut parenthesis around sizeof args.
kevlo [Tue, 17 Jul 2012 02:05:39 +0000 (02:05 +0000)]
Put parenthesis around sizeof args.

12 years agoIn ipfw(8), make the text about dynamic rules consistent.
issyl0 [Mon, 16 Jul 2012 22:15:30 +0000 (22:15 +0000)]
In ipfw(8), make the text about dynamic rules consistent.

PR: docs/120539
Approved by: gabor (mentor)
MFC after: 5 days

12 years agoSimply error handling by moving the allocation of np down to where it is
brueffer [Mon, 16 Jul 2012 22:07:29 +0000 (22:07 +0000)]
Simply error handling by moving the allocation of np down to where it is
actually used.  While here, improve style a little.

Submitted by: mjg
MFC after: 2 weeks

12 years agoMetaflush on/off values don't need quotes.
trociny [Mon, 16 Jul 2012 20:43:28 +0000 (20:43 +0000)]
Metaflush on/off values don't need quotes.

Reviewed by: pjd
MFC after: 3 days

12 years agoAdd support for walltimestamp in DTrace.
gnn [Mon, 16 Jul 2012 20:17:19 +0000 (20:17 +0000)]
Add support for walltimestamp in DTrace.

Submitted by: Fabian Keil
MFC after: 2 weeks

12 years agoVarious improvements to vm_contig_grow_cache(). Most notably, even when
alc [Mon, 16 Jul 2012 18:13:43 +0000 (18:13 +0000)]
Various improvements to vm_contig_grow_cache().  Most notably, even when
it can't sleep, it can still move clean pages from the inactive queue to
the cache.  Also, when a page is cached, there is no need to restart the
scan.  The "next" page pointer held by vm_contig_launder() is still
valid.  Finally, add a comment summarizing what vm_contig_grow_cache()
does based upon the value of "tries".

MFC after: 3 weeks

12 years agoAdd a script that traces NFS attribute cache accesses.
gnn [Mon, 16 Jul 2012 17:48:43 +0000 (17:48 +0000)]
Add a script that traces NFS attribute cache accesses.

Submitted by: rwatson
MFC after: 2 weeks

12 years agoThe resize GEOM event has no references, thus cannot be canceled.
trasz [Mon, 16 Jul 2012 17:41:38 +0000 (17:41 +0000)]
The resize GEOM event has no references, thus cannot be canceled.

12 years agoAdd back spare fields reused in r238213. According to Attilio, the rule
trasz [Mon, 16 Jul 2012 16:50:28 +0000 (16:50 +0000)]
Add back spare fields reused in r238213.  According to Attilio, the rule
is to use reuse spares only when MFC-ing, not in CURRENT.

12 years agoAdd new USB device ID.
hselasky [Mon, 16 Jul 2012 10:12:07 +0000 (10:12 +0000)]
Add new USB device ID.

PR: usb/169789
Submitted by: Ruslan Bukin
MFC after: 1 week

12 years ago- Add support for displaying process stack memory regions.
pgj [Mon, 16 Jul 2012 09:38:19 +0000 (09:38 +0000)]
- Add support for displaying process stack memory regions.

Approved by: rwatson
MFC after: 3 days

12 years agoAdd new USB device ID.
hselasky [Mon, 16 Jul 2012 09:35:47 +0000 (09:35 +0000)]
Add new USB device ID.

PR: usb/169789
MFC after: 1 week

12 years agoIf ip_output() returns EMSGSIZE to tcp_output(), then the latter calls
glebius [Mon, 16 Jul 2012 07:08:34 +0000 (07:08 +0000)]
If ip_output() returns EMSGSIZE to tcp_output(), then the latter calls
tcp_mtudisc(), which in its turn may call tcp_output(). Under certain
conditions (must admit they are very special) an infinite recursion can
happen.

To avoid recursion we can pass struct route to ip_output() and obtain
correct mtu. This allows us not to use tcp_mtudisc() but call tcp_mss_update()
directly.

PR: kern/155585
Submitted by: Andrey Zonov <andrey zonov.org> (original version of patch)

12 years agoAllow netstat to be build if INET is not defined in the kernel.
tuexen [Mon, 16 Jul 2012 06:43:04 +0000 (06:43 +0000)]
Allow netstat to be build if INET is not defined in the kernel.
Thanks to Garrett Cooper for reporting the issue.

MFC after: 3 days
X-MFC: 238501

12 years agoCorrect an off-by-one error in vm_reserv_alloc_contig() that resulted in
alc [Sun, 15 Jul 2012 21:46:19 +0000 (21:46 +0000)]
Correct an off-by-one error in vm_reserv_alloc_contig() that resulted in
the last reservation of a multi-reservation allocation not being
initialized.

12 years agoUse libc's strndup() instead of Dtrace's reimplementation.
pfg [Sun, 15 Jul 2012 21:20:31 +0000 (21:20 +0000)]
Use libc's strndup() instead of Dtrace's reimplementation.

Corresponds partially to OpenSolaris change:
PSARC 2010/299 GNU/Linux/BSD compatibility functions
6901783 strndup would be nice

MFC after: 2 weeks

12 years agostty: Mark usage() __dead2.
jilles [Sun, 15 Jul 2012 21:12:22 +0000 (21:12 +0000)]
stty: Mark usage() __dead2.

This reduces code size a little and should fix a scan-build warning.

12 years agoHandle RX Keymiss events.
adrian [Sun, 15 Jul 2012 20:51:41 +0000 (20:51 +0000)]
Handle RX Keymiss events.

The AR9003 series NICs implement a separate RX error to signal that a
Keycache miss occured.  The earlier NICs would not set the key index
valid bit.

I'll dig into the difference between "no key index bit set" and "keycache
miss".

12 years agoLog the number of handled decsriptors and valid descriptors when
adrian [Sun, 15 Jul 2012 20:48:21 +0000 (20:48 +0000)]
Log the number of handled decsriptors and valid descriptors when
hitting RXEOL.

12 years agolibc: Remove some unused strings from getaddrinfo().
jilles [Sun, 15 Jul 2012 20:39:21 +0000 (20:39 +0000)]
libc: Remove some unused strings from getaddrinfo().

12 years agoFix a bug with memguard(9) on 32-bit architectures without a
mdf [Sun, 15 Jul 2012 20:29:48 +0000 (20:29 +0000)]
Fix a bug with memguard(9) on 32-bit architectures without a
VM_KMEM_MAX_SIZE.

The code was not taking into account the size of the kernel_map, which
the kmem_map is allocated from, so it could produce a sub-map size too
large to fit.  The simplest solution is to ignore VM_KMEM_MAX entirely
and base the memguard map's size off the kernel_map's size, since this
is always relevant and always smaller.

Found by: Justin Hibbits

12 years agoChanges which improve compilation if neither INET nor INET6 is defined.
tuexen [Sun, 15 Jul 2012 20:16:17 +0000 (20:16 +0000)]
Changes which improve compilation if neither INET nor INET6 is defined.

MFC after: 3 days

12 years agoUse M_NOWAIT while holding the pf giant lock.
glebius [Sun, 15 Jul 2012 19:10:00 +0000 (19:10 +0000)]
Use M_NOWAIT while holding the pf giant lock.

12 years agoAdd new USB device ID.
hselasky [Sun, 15 Jul 2012 18:12:09 +0000 (18:12 +0000)]
Add new USB device ID.

PR: usb/169789
MFC after: 1 week

12 years agoPermit changing MTU in 6to4 relay.
melifaro [Sun, 15 Jul 2012 17:44:27 +0000 (17:44 +0000)]
Permit changing MTU in 6to4 relay.

This behavior is recommended by RFC 4213 clause 3.2.

Sometimes fragmentation is the least evil.
For example, some Linux IPVS kernels forwards
ICMPv6 checksums to real servers incorrectly.

Reviewed by:      hrs(previous version)
Approved by:      kib(mentor)
MFC after:        1 week

12 years agoSave a bzero() by using M_ZERO.
brueffer [Sun, 15 Jul 2012 15:50:12 +0000 (15:50 +0000)]
Save a bzero() by using M_ZERO.

Obtained from: Dragonfly BSD (change 4faaf07c3d7ddd120deed007370aaf4d90b72ebb)
MFC after: 2 weeks

12 years agops: Fix memory leak when showing start/lstart for swapped-out process.
jilles [Sun, 15 Jul 2012 15:22:13 +0000 (15:22 +0000)]
ps: Fix memory leak when showing start/lstart for swapped-out process.

Spotted by: scan-build (uqs)

12 years agoFix typo in a message.
brueffer [Sun, 15 Jul 2012 14:40:49 +0000 (14:40 +0000)]
Fix typo in a message.

Obtained from: DragonFly BSD (change 7a817ab191e4898404a9037c55850e47d177308c)
MFC after: 3 days

12 years agoJump to the failed label instead of doing cleanup ourselves.
brueffer [Sun, 15 Jul 2012 11:52:24 +0000 (11:52 +0000)]
Jump to the failed label instead of doing cleanup ourselves.

Obtained from: DragonFly BSD
MFC after: 2 weeks

12 years agosh: Reset pendingsigs before checking pending traps, not after.
jilles [Sun, 15 Jul 2012 11:18:52 +0000 (11:18 +0000)]
sh: Reset pendingsigs before checking pending traps, not after.

Otherwise, a signal arriving at exactly the right moment might not be
processed until another signal arrived.

12 years ago#ifdef INET and INET6 consistently. This also fixes a bug, where
tuexen [Sun, 15 Jul 2012 11:04:49 +0000 (11:04 +0000)]
#ifdef INET and INET6 consistently. This also fixes a bug, where
it was done wrong.

MFC after: 3 days

12 years agoPass --enable-new-dtags to the linker invocation by default. If
kib [Sun, 15 Jul 2012 10:54:10 +0000 (10:54 +0000)]
Pass --enable-new-dtags to the linker invocation by default. If
desired, one can turn off the generation of post-ELF standard dtags by
overriding it with --disable-new-dtags after the default switch.

Immediate effect of the change is that -rpath path is now stored both
in DT_RPATH and DT_RUNPATH tags, which is the right way to provide
rpath for dynamic linker supporting DT_RUNPATH per specification.

Reviewed by: kan
MFC after: 1 month

12 years agoImport the DragonFly BSD commit 4f0bc915b65fcf5a23214f6d221d65c80be68ad4
kib [Sun, 15 Jul 2012 10:53:48 +0000 (10:53 +0000)]
Import the DragonFly BSD commit 4f0bc915b65fcf5a23214f6d221d65c80be68ad4
by John Marino <draco@marino.st>, with the following (edited) commit
message
Date: Sat, 24 Mar 2012 06:40:50 +0100
Subject: [PATCH 1/1] rtld: Implement DT_RUNPATH and -z nodefaultlib

DT_RUNPATH is incorrectly being considered as an alias of DT_RPATH.  The
purpose of DT_RUNPATH is to have two different types of rpath: one that
can be overridden by the environment variable LD_LIBRARY_PATH and one that
can't.  With the currently implementation, LD_LIBRARY_PATH will always
trump any embedded rpath or runpath tags.

Current path search order by rtld:
==================================
LD_LIBRARY_PATH
DT_RPATH / DT_RUNPATH (always the same)
ldconfig hints file (default: /var/run/ld-elf.so.hints)
/usr/lib

New path search order by rtld:
==============================
DT_RPATH of the calling object if no DT_RUNPATH
DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj
LD_LIBRARY_PATH
DT_RUNPATH
ldconfig hints file
/usr/lib

The new path search matches how the linux runtime loader works.  The other
major added feature is support for linker flag "-z nodefaultlib".  When
this flag is passed to the linker, rtld will skip all references to the
standard library search path ("/usr/lib" in this case but it could handle
more color delimited paths) except in DT_RPATH and DT_RUNPATH.

New path search order by rtld with -z nodefaultlib flag set:
============================================================
DT_RPATH of the calling object if no DT_RUNPATH
DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj
LD_LIBRARY_PATH
DT_RUNPATH
ldconfig hints file (skips all references to /usr/lib)

FreeBSD notes:
- we fixed some bugs which were submitted to DragonFly and merged there
  as commit 1ff8a2bd3eb6e5587174c6a983303ea3a79e0002;
- we added LD_LIBRARY_PATH_RPATH environment variable to switch to
  the previous behaviour of considering DT_RPATH a synonym for DT_RUNPATH;
- the FreeBSD default search path is /lib:/usr/lib and not /usr/lib.

Reviewed by:   kan
MFC after:     1 month
MFC note:      flip the ld_library_path_rpath default value for stable/9

12 years agosh: Remove unused variable in_dowait.
jilles [Sun, 15 Jul 2012 10:49:16 +0000 (10:49 +0000)]
sh: Remove unused variable in_dowait.

12 years agosh: Add a simple test for the "local" builtin.
jilles [Sun, 15 Jul 2012 10:22:13 +0000 (10:22 +0000)]
sh: Add a simple test for the "local" builtin.

12 years agosh: Expand assignment-like words specially for export/readonly/local.
jilles [Sun, 15 Jul 2012 10:19:43 +0000 (10:19 +0000)]
sh: Expand assignment-like words specially for export/readonly/local.

Examples:
  export x=~
now expands the tilde
  local y=$1
is now safe, even if $1 contains IFS characters or metacharacters.

For a word to "look like an assignment", it must start with a name followed
by an equals sign, none of which may be quoted.

The special treatment applies when the first word (potentially after
"command") is "export", "readonly" or "local". There may be quoting
characters but no expansions. If "local" is overridden with a function there
is no special treatment ("export" and "readonly" cannot be overridden with a
function).

If things like
  local arr=(1 2 3)
are ever allowed in the future, they cannot call a "local" function. This
would either be a run-time error or it would call the builtin.

This matches Austin Group bug #351, planned for the next issue of POSIX.1.

PR: bin/166771

12 years agoThese were never used, remove them.
imp [Sun, 15 Jul 2012 06:08:11 +0000 (06:08 +0000)]
These were never used, remove them.

12 years agoThe JP1082 device doesn't respond to the MII_BMSR command and it turns
rpaulo [Sun, 15 Jul 2012 05:49:02 +0000 (05:49 +0000)]
The JP1082 device doesn't respond to the MII_BMSR command and it turns
out that it has an unusable PHY. It still works, although very slowly,
without a PHY, so I implemented non-PHY support in the udav driver.