]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMFhead @ r292618
ngie [Tue, 29 Dec 2015 19:56:26 +0000 (19:56 +0000)]
MFhead @ r292618

8 years agoWhen checking the inp_ip_minttl restriction for IPv6 packets, don't check
jtl [Tue, 29 Dec 2015 19:20:39 +0000 (19:20 +0000)]
When checking the inp_ip_minttl restriction for IPv6 packets, don't check
the IPv4 header.

CID: 1017920
Differential Revision: https://reviews.freebsd.org/D4727
Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Juniper Networks

8 years ago- Add entries for the more prominent members of the Digi International
marius [Tue, 29 Dec 2015 17:07:28 +0000 (17:07 +0000)]
- Add entries for the more prominent members of the Digi International
  Neo series, which are based on Exar PCI chips.
- Mark some unused parameters as such.
- Fix style

MFC after: 3 days

8 years agopax: prevent possible buffer overflow
pfg [Tue, 29 Dec 2015 16:31:28 +0000 (16:31 +0000)]
pax: prevent possible buffer overflow

Or at least quiet down some static analyzers about it.

CID: 978835
MFC after: 1 week
Obtained from: OpenBSD

8 years agoImprovements to BSD-licensed DTC.
theraven [Tue, 29 Dec 2015 16:29:42 +0000 (16:29 +0000)]
Improvements to BSD-licensed DTC.

- Added an expression parser so that expressions from headers are now working
- Fixed missing null terminators on cross references
- Disabled exceptions / RTTI in the build for smaller binaries
- Changed phandle order generation to be identical to GPL'd dtc

8 years ago- Sort ports-secteam
miwi [Tue, 29 Dec 2015 15:54:34 +0000 (15:54 +0000)]
- Sort ports-secteam

8 years agoext2: recognize ext4 INCOMPAT_RECOVER flag
pfg [Tue, 29 Dec 2015 15:51:52 +0000 (15:51 +0000)]
ext2: recognize ext4 INCOMPAT_RECOVER flag

This is a flag specific for journalling in ext4.
Add it to the list of ext4 features we ignore for
read-only purposes.

PR: 205668
MFC after: 1 week

8 years ago- Add myself to ports-secteam
miwi [Tue, 29 Dec 2015 15:36:46 +0000 (15:36 +0000)]
- Add myself to ports-secteam

Approved by: delphij (implicit)

8 years agoCorrect the code for sign-extending a 16 bit value. As near as I can tell
ian [Tue, 29 Dec 2015 15:23:03 +0000 (15:23 +0000)]
Correct the code for sign-extending a 16 bit value.  As near as I can tell
this is effectively a no-op -- the addend term in MOVT/MOVW relocations
always seems to be zero.  But this is correct and the old code wasn't.

8 years agoUpdate metadata for "tools/tools/bus_autoconf" after r292080. Use
hselasky [Tue, 29 Dec 2015 11:53:13 +0000 (11:53 +0000)]
Update metadata for "tools/tools/bus_autoconf" after r292080. Use
BYTE_ORDER instead of _BYTE_ORDER due to 3rd party USB software for
now.

8 years agoFix type mismatches for malloc(3) and Co.
uqs [Tue, 29 Dec 2015 11:24:41 +0000 (11:24 +0000)]
Fix type mismatches for malloc(3) and Co.

This is rather pedantic, as for most architectures it holds that
sizeof(type *) == sizeof(type **)

Found by: clang static analyzer
Reviewed by: ed
Differential Revision: https://reviews.freebsd.org/D4722

8 years agoFix type mismatches for malloc(3) and Co.
uqs [Tue, 29 Dec 2015 11:24:35 +0000 (11:24 +0000)]
Fix type mismatches for malloc(3) and Co.

Found by: clang static analyzer
Reviewed by: ed
Differential Revision: https://reviews.freebsd.org/D4722

8 years agohyperv: vmbus: run non-blocking message handlers in vmbus_msg_swintr()
delphij [Tue, 29 Dec 2015 08:19:43 +0000 (08:19 +0000)]
hyperv: vmbus: run non-blocking message handlers in vmbus_msg_swintr()

We'll remove the per-channel control_work_queue because it can't properly
do serialization of message handling, e.g., when there are 2 NIC devices,
vmbus_channel_on_offer() -> hv_queue_work_item() has a race condition:
for an SMP VM, vmbus_channel_process_offer() can run concurrently on
different CPUs and if the second NIC's
vmbus_channel_process_offer() -> hv_vmbus_child_device_register() runs
first, the second NIC's name will be hn0 and the first NIC's name will
be hn1!

We can fix the race condition by removing the per-channel control_work_queue
and run all the message handlers in the global
hv_vmbus_g_connection.work_queue -- we'll do this in the next patch.

With the coming next patch, we have to run the non-blocking handlers
directly in the kernel thread vmbus_msg_swintr(), because the special
handling of sub-channel: when a sub-channel (e.g., of the storvsc driver)
is received and being handled in vmbus_channel_on_offer() running on the
global hv_vmbus_g_connection.work_queue, vmbus_channel_process_offer()
invokes channel->sc_creation_callback, i.e., storvsc_handle_sc_creation,
and the callback will invoke hv_vmbus_channel_open() -> hv_vmbus_post_message
and expect a further reply from the host, but the handling of the further
messag can't be done because the current message's handling hasn't finished
yet; as result, hv_vmbus_channel_open() -> sema_timedwait() will time out
and th device can't work.

Also renamed the handler type from hv_pfn_channel_msg_handler to
vmbus_msg_handler: the 'pfn' and 'channel' in the old name make no sense.

Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by: royger
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4596

8 years agohyperv: vmbus: remove the per-channel control_work_queue
delphij [Tue, 29 Dec 2015 07:54:55 +0000 (07:54 +0000)]
hyperv: vmbus: remove the per-channel control_work_queue

Now vmbus_channel_on_offer() -> vmbus_channel_process_offer() can
safely run on the global hv_vmbus_g_connection.work_queue now.

We remove the per-channel control_work_queue to achieve the proper
serialization of the message handling.

I removed the bogus TODO in vmbus_channel_on_offer(): a vmbus offer
can only come from the parent partition, i.e., the host.

PR: kern/205156
Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by: Howard Su <howard0su gmail com>, delphij
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4597

8 years agoUpdate capabilities of e500mc, e5500, e6500.
jhibbits [Tue, 29 Dec 2015 03:31:06 +0000 (03:31 +0000)]
Update capabilities of e500mc, e5500, e6500.

8 years agoSimplify code for parsing extra groups
bapt [Tue, 29 Dec 2015 00:08:32 +0000 (00:08 +0000)]
Simplify code for parsing extra groups

8 years agoRemove useless assignement of linelen
bapt [Tue, 29 Dec 2015 00:02:08 +0000 (00:02 +0000)]
Remove useless assignement of linelen

8 years agoRestore dryrun support for pw groupmod
bapt [Mon, 28 Dec 2015 23:57:22 +0000 (23:57 +0000)]
Restore dryrun support for pw groupmod

8 years ago- Add an entry for the SIIG Cyber 2SP1 PCIe adapter, which is based
marius [Mon, 28 Dec 2015 20:24:08 +0000 (20:24 +0000)]
- Add an entry for the SIIG Cyber 2SP1 PCIe adapter, which is based
  on an Oxford Semiconductor OX16PCI954 but uses only two ports and
  a non-default clock rate.
- Fix style/whitespace

PR: 176407
MFC after: 3 days

8 years agoAdd interests/maintainerships + notes
dteske [Mon, 28 Dec 2015 19:29:05 +0000 (19:29 +0000)]
Add interests/maintainerships + notes

8 years agoAdd support for CQE zipping. CQE zipping reduces PCI overhead by
hselasky [Mon, 28 Dec 2015 18:50:18 +0000 (18:50 +0000)]
Add support for CQE zipping. CQE zipping reduces PCI overhead by
coalescing and zipping multiple CQEs into a single merged CQE. The
feature is enabled by default and can be disabled by a sysctl.

Implementing this feature mlx5_cqwq_pop() has been separated from
mlx5e_get_cqe().

MFC after: 1 week
Submitted by: Mark Bloch <markb@mellanox.com>
Differential Revision: https://reviews.freebsd.org/D4598
Sponsored by: Mellanox Technologies

8 years agoAdd support for sysctl tunables to 10-stable and older. Pushed through
hselasky [Mon, 28 Dec 2015 18:36:00 +0000 (18:36 +0000)]
Add support for sysctl tunables to 10-stable and older. Pushed through
head first to simplify driver maintenance.

MFC after: 1 week
Submitted by: Drew Gallatin <gallatin@freebsd.org>
Differential Revision: https://reviews.freebsd.org/D4552
Sponsored by: Mellanox Technologies

8 years agoin6_if2idlen: treat bridge(4) interfaces like other Ethernet interfaces
wollman [Mon, 28 Dec 2015 18:29:47 +0000 (18:29 +0000)]
in6_if2idlen: treat bridge(4) interfaces like other Ethernet interfaces

bridge(4) interfaces have an if_type of IFT_BRIDGE, rather than
IFT_ETHER, even though they only support Ethernet-style links.  This
caused in6_if2idlen to emit an "unknown link type (209)" warning to
the console every time it was called.  Add IFT_BRIDGE to the case
statement in the appropriate place, indicating that it uses the same
IPv6 address format as other Ethernet-like interfaces.

MFC after: 1 week

8 years agoMake the eeprom dump function more readable and rename variables for
hselasky [Mon, 28 Dec 2015 18:28:18 +0000 (18:28 +0000)]
Make the eeprom dump function more readable and rename variables for
better clarity.

MFC after: 1 week
Submitted by: Daria Genzel <dariaz@mellanox.com>
Differential Revision: https://reviews.freebsd.org/D4551
Sponsored by: Mellanox Technologies

8 years agoReduce memory consumption when allocating kobject strings in the
hselasky [Mon, 28 Dec 2015 18:20:05 +0000 (18:20 +0000)]
Reduce memory consumption when allocating kobject strings in the
LinuxKPI. Compute string length before allocating memory instead of
using fixed size allocations. Make kobject_set_name_vargs() global
instead of inline to save some bytes when compiling.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoExplicitly set permissions on entropy files
dteske [Mon, 28 Dec 2015 17:27:20 +0000 (17:27 +0000)]
Explicitly set permissions on entropy files

Differential Revision: https://reviews.freebsd.org/D3933
Submitted by: jmg
Reviewed by: delphij, markm
Approved by: secteam (delphij)
MFC after: 3 days
X-MFC-to: stable/10 stable/9

8 years agoAdd SFF-8024 Extended Specification Compliance
melifaro [Mon, 28 Dec 2015 09:26:07 +0000 (09:26 +0000)]
Add SFF-8024 Extended Specification Compliance

Submitted by: markb_mellanox.com
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4666

8 years agoEliminate unneeded includes.
delphij [Mon, 28 Dec 2015 08:53:31 +0000 (08:53 +0000)]
Eliminate unneeded includes.

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D4716

8 years agoThe sdp opens the database with PERM_SECURE mode and it is different than
araujo [Mon, 28 Dec 2015 05:48:22 +0000 (05:48 +0000)]
The sdp opens the database with PERM_SECURE mode and it is different than
dp that opens the database with PERM_INSECURE, so we need to check sdp->put
against sdp instead of use dp->put.

PR: bin/191720
Submitted by: Miles Ohlrich <turingsboy@yahoo.com>
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D4255

8 years agoRemove retval to fix a -Wunused-but-set-variable warning from gcc 4.9
ngie [Mon, 28 Dec 2015 02:36:57 +0000 (02:36 +0000)]
Remove retval to fix a -Wunused-but-set-variable warning from gcc 4.9

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years ago- Remove unused but set ssize in shutdown_send_sigpipe
ngie [Mon, 28 Dec 2015 02:34:59 +0000 (02:34 +0000)]
- Remove unused but set ssize in shutdown_send_sigpipe
- Add #ifdef TEST_SEQ_PACKET_SOURCE_ADDRESS` for untestable code
  because FreeBSD doesn't have a means to map source addresses for
  SEQ_PACKET AF_UNIX sockets (paraphrased). Put pathname variable
  under the #ifdef to mute another unused but set variable warning

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoClean trailing whitespace
ngie [Mon, 28 Dec 2015 02:28:12 +0000 (02:28 +0000)]
Clean trailing whitespace

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years ago- Fix an improperly sized buffer for `pathname` [1]
ngie [Mon, 28 Dec 2015 02:21:36 +0000 (02:21 +0000)]
- Fix an improperly sized buffer for `pathname` [1]
- Fix a -Wunused-but-set-variable warning [2]

MFC after: 1 week
Reported by: cppcheck [1], gcc 4.9 [2]
Sponsored by: EMC / Isilon Storage Division

8 years agoFix style(9) a bit and ensure that error from initializing kqueue(2) is
ngie [Mon, 28 Dec 2015 02:18:22 +0000 (02:18 +0000)]
Fix style(9) a bit and ensure that error from initializing kqueue(2) is
sane

- Push the kqueue(2) initialization down so the errno will correspond with
  the failure instead of potentially being stomped on by functions called
  by `PLAIN_REQUIRE_KERNEL_MODULE`
- Delete trailing whitespace
- Add spaces between braces for conditional and control blocks (for/if)
- Use err/errx instead of perror+printf+exit/printf+exit.
- Remove braces for single-line conditionals

Tested with and without -DDEBUG

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd on systat -vm the ability to display the physical and kernel memory
araujo [Mon, 28 Dec 2015 02:07:56 +0000 (02:07 +0000)]
Add on systat -vm the ability to display the physical and kernel memory
percent usage.

PR: bin/203917
Submitted by: ota <ota@j.email.ne.jp>
Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D4281

8 years agoPlace cancel and error under #ifdef DEBUG to mute
ngie [Mon, 28 Dec 2015 02:01:41 +0000 (02:01 +0000)]
Place cancel and error under #ifdef DEBUG to mute
-Wunused-but-set-variable warnings reported by gcc 4.9

Remove some trailing whitespace as well

Tested with and without -DDEBUG

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoStaticize several variables that are used exclusively in bsnmpd/main.c and
ngie [Mon, 28 Dec 2015 01:51:20 +0000 (01:51 +0000)]
Staticize several variables that are used exclusively in bsnmpd/main.c and
bsnmpd/trap.c

This fixes several -Wmissing-variable-declaration warnings noted by clang

Differential Revision: https://reviews.freebsd.org/D4718
MFC after: 1 week
Reported by: Jenkins
Reviewed by: araujo
Sponsored by: EMC / Isilon Storage Division

8 years ago- Explicitly initialize ch to 0
ngie [Mon, 28 Dec 2015 00:53:37 +0000 (00:53 +0000)]
- Explicitly initialize ch to 0
- Delete some spurious whitespace
- Use calloc instead of malloc in the last test to ensure that
  sendspace is properly zero'ed out

Differential Revision: https://reviews.freebsd.org/D689 (part of a larger diff)
MFC after: 1 week
Reviewed by: asomers, ngie
Submitted by: markj
Sponsored by: EMC / Isilon Storage Division

8 years agoCorrect __FreeBSD__ check.
cy [Mon, 28 Dec 2015 00:42:15 +0000 (00:42 +0000)]
Correct __FreeBSD__ check.

MFC after: 3 days

8 years agoUse a macro to create the names for the library path names. This will
imp [Sun, 27 Dec 2015 23:04:12 +0000 (23:04 +0000)]
Use a macro to create the names for the library path names. This will
allow later substitution at run time instead of compile time of the
environment variable name prefix.

Differential Review: https://reviews.freebsd.org/D2718

8 years agoThe FILE structure has a mbstate_t in it. This structure needs to be
imp [Sun, 27 Dec 2015 23:04:11 +0000 (23:04 +0000)]
The FILE structure has a mbstate_t in it. This structure needs to be
aligned on a int64_t boundary. However, when we allocate the array of
these structures, we use ALIGNBYTES which defaults to sizeof(int) on
arm, i386 and others. The i386 stuff can handle unaligned accesses
seemlessly. However, arm cannot. Take this into account when creating
the array of FILEs, and add some comments about why.

Differential Revision: https://reviews.freebsd.org/D4708

8 years agoThere's currently some issues with armv7-class of CPUs code generation
imp [Sun, 27 Dec 2015 23:04:10 +0000 (23:04 +0000)]
There's currently some issues with armv7-class of CPUs code generation
with our default toolchain. Turn it off here until that all gets
sorted out.

8 years agoAdd some additional GPT partition types
allanjude [Sun, 27 Dec 2015 18:12:13 +0000 (18:12 +0000)]
Add some additional GPT partition types

4 ChromeOS GPT types
2 Microsoft partition types
the new OpenBSD partition type

Approved by: marcel (mentor)
MFC after: 1 week
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3841

8 years agoReplace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
allanjude [Sun, 27 Dec 2015 17:33:59 +0000 (17:33 +0000)]
Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c

cperciva's libmd implementation is 5-30% faster

The same was done for SHA256 previously in r263218

cperciva's implementation was lacking SHA-384 which I implemented, validated against OpenSSL and the NIST documentation

Extend sbin/md5 to create sha384(1)

Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with sha512{c.c,.h}

Reviewed by: cperciva, des, delphij
Approved by: secteam, bapt (mentor)
MFC after: 2 weeks
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3929

8 years agoFix incorrect error message in geom map
allanjude [Sun, 27 Dec 2015 17:09:23 +0000 (17:09 +0000)]
Fix incorrect error message in geom map

If geom_map fails to find the end of a mapped partition based on a search, it would return the incorrect error message, stating it could not parse the START value

Reviewed by: adrian
Approved by: bapt (mentor)
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D4187

8 years agoVerify that tv_sec value specified in settimeofday() and clock_settime()
dchagin [Sun, 27 Dec 2015 15:37:07 +0000 (15:37 +0000)]
Verify that tv_sec value specified in settimeofday() and clock_settime()
(CLOCK_REALTIME case) system calls is non negative.
This commit hides a kernel panic in atrtc_settime() as the clock_ts_to_ct()
does not properly convert negative tv_sec.

ps. in my opinion clock_ts_to_ct() should be rewritten to properly handle
negative tv_sec values.

Differential Revision: https://reviews.freebsd.org/D4714
Reviewed by: kib

MFC after: 1 week

8 years agoAdd missed relpbuf() for a smallfs page-in.
kib [Sun, 27 Dec 2015 14:42:39 +0000 (14:42 +0000)]
Add missed relpbuf() for a smallfs page-in.

Reported by: Shawn Webb
Tested by: pho
Sponsored by: The FreeBSD Foundation

8 years agoReplace implementation of hsearch() by one that scales.
ed [Sun, 27 Dec 2015 07:50:11 +0000 (07:50 +0000)]
Replace implementation of hsearch() by one that scales.

Traditionally the hcreate() function creates a hash table that uses
chaining, using a fixed user-provided size. The problem with this
approach is that this often either wastes memory (table too big) or
yields bad performance (table too small). For applications it may not
always be easy to estimate the right hash table size. A fixed number
only increases performance compared to a linked list by a constant
factor.

This problem can be solved easily by dynamically resizing the hash
table. If the size of the hash table is at least doubled, this has no
negative on the running time complexity. If a dynamically sized hash
table is used, we can also switch to using open addressing instead of
chaining, which has the advantage of just using a single allocation for
the entire table, instead of allocating many small objects.

Finally, a problem with the existing implementation is that its
deterministic algorithm for hashing makes it possible to come up with
fixed patterns to trigger an excessive number of collisions. We can
easily solve this by using FNV-1a as a hashing algorithm in combination
with a randomly generated offset basis.

Measurements have shown that this implementation is about 20-25% faster
than the existing implementation (even if the existing implementation is
given an excessive number of buckets). Though it allocates more memory
through malloc() than the old implementation (between 4-8 pointers per
used entry instead of 3), process memory use is similar to the old
implementation as if the estimated size was underestimated by a factor
10. This is due to the fact that malloc() needs to perform less
bookkeeping.

Reviewed by: jilles, pfg
Obtained from: https://github.com/NuxiNL/cloudlibc
Differential Revision: https://reviews.freebsd.org/D4644

8 years agoFix missing path conversion from the previous commit to shuffle mdio around.
adrian [Sun, 27 Dec 2015 07:39:44 +0000 (07:39 +0000)]
Fix missing path conversion from the previous commit to shuffle mdio around.

It turns out the recent work to cut down the number of atheros kernels built
didnt include one with ARGE_MDIO defined..

8 years agoAllocate separate scratch space for scanner purposes.
mav [Sun, 27 Dec 2015 06:28:31 +0000 (06:28 +0000)]
Allocate separate scratch space for scanner purposes.

This space does not require DMA syncing. It reduces lock scope of the DMA
scratch space.  It allows whole DMA scratch space to be used to I/O, so now
we can fetch up to ~1000 ports from SNS.

Due to the last fact, increase maximal number of ports from 256 to 1024.

8 years agoSplit DMA buffers for request, response and ATIO queues.
mav [Sun, 27 Dec 2015 06:16:02 +0000 (06:16 +0000)]
Split DMA buffers for request, response and ATIO queues.

8 years agoTypo.
kib [Sun, 27 Dec 2015 01:14:42 +0000 (01:14 +0000)]
Typo.

8 years agoLet old-style (shell-based) jail configuration handle jail names that
jamie [Sat, 26 Dec 2015 23:01:34 +0000 (23:01 +0000)]
Let old-style (shell-based) jail configuration handle jail names that
contain characters not allowed in a shell variable (such as "-").
These will be replaced by an underscore in jail config variables,
e.g. for jail "foo-bar" you would set "jail_foo_bar_hostname".

This is separate from the current code that changes the jail names
if they contain "." or "/".  It also doesn't apply to jails defined
in a jail.conf file.

PR: 191181
MFC after: 5 days

8 years agosh: Add tests for #/##/%/%% on $* and $@.
jilles [Sat, 26 Dec 2015 22:27:48 +0000 (22:27 +0000)]
sh: Add tests for #/##/%/%% on $* and $@.

Although POSIX leaves things like ${*#X} unspecified, it occasionally occurs
in practice. Add some tests that seem to work sensibly.

8 years agoFix includes in usr.sbin/fstyp/zfs.c
allanjude [Sat, 26 Dec 2015 19:48:36 +0000 (19:48 +0000)]
Fix includes in usr.sbin/fstyp/zfs.c

Approved by: bapt (mentor)
MFC after: 1 week
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D4710

8 years agoDisable the firwmare licence check for rsu and urtwn.
adrian [Sat, 26 Dec 2015 19:14:24 +0000 (19:14 +0000)]
Disable the firwmare licence check for rsu and urtwn.

The licence grant says something exactly the same as the atheros patent
grant, which is "As long as you use this firmware on our chips, everything
is totally okay."  Now, I'm pretty sure if that we /have/ to have this,
we're going to have to have it for every other firmware for every other
device in the tree.

So, I'll flip this off in -HEAD for now so people stop asking about
why rsu/urtwn don't work out of the box, and I'll kick off a larger
discussion about this in the new year.

8 years agoEnhance rc.d/netwait script to wait for late-attaching interfaces such as
ian [Sat, 26 Dec 2015 18:21:32 +0000 (18:21 +0000)]
Enhance rc.d/netwait script to wait for late-attaching interfaces such as
USB NICs.

USB network hardware may not be enumerated and available when the rc.d
networking scripts run. Eventually the USB attachment completes and devd
events cause the network initialization to happen, but by then other rc.d
scripts have already failed, because services which depend on NETWORKING
(such as mountcritremote) may end up running before the network is actually
ready.

There is an existing netwait script, but because it is dependent on
NETWORKING it runs too late to prevent failure of some other rc
scripts. This change flips the order so that NETWORKING depends on netwait,
and netwait now depends on devd and routing (the former is needed to make
interfaces appear, and the latter is needed to run the ping tests in
netwait).

The netwait script used to be oriented primarily towards "as soon as any
host is reachable the network is fully functional", so you gave it a list of
IPs to try and you could optionally name an interface and it would wait for
carrier on that interface. That functionality still works the same, but now
you can provide a list of interfaces to wait for and it waits until each one
of them is available. The ping logic still completes as soon as the first IP
on the list responds.

These changes were submitted by Brenden Molloy <brendan+freebsd@bbqsrc.net>
in PR 205186, and lightly modified by me to allow a list of interfaces
instead of just one.

PR: 205186
Differential Revision: https://reviews.freebsd.org/D4608 (timeout w/o review)

8 years agoAdd missing #ifdef INET after r292674 to allow NOIP and NOINET kernels
bz [Sat, 26 Dec 2015 17:27:48 +0000 (17:27 +0000)]
Add missing #ifdef INET after r292674 to allow NOIP and NOINET kernels
to build.

8 years ago[mdio] Add MDIO support for "extended" registers as defined by IEEE 802.3 Clause 45.
adrian [Sat, 26 Dec 2015 17:22:02 +0000 (17:22 +0000)]
[mdio] Add MDIO support for "extended" registers as defined by IEEE 802.3 Clause 45.

IEEE 802.3 Clause 45 added backwards-compatible support for 2^16 PHY registers
through the addition of an additional device address frame.

Clause 45 addressing is used in 10Gbe PHYs, 802.3az EEE registers, etc. It may
make sense to provide a similar extension to the miibus interface, but I've
refrained from unilaterally doing so here.

Submitted by: Landon Fuller <landon@landonf.org>
Differential Revision: https://reviews.freebsd.org/D4607

8 years agoDo not substitute interpeter if the brand interpreter path is
kib [Sat, 26 Dec 2015 15:40:12 +0000 (15:40 +0000)]
Do not substitute interpeter if the brand interpreter path is
different from the interpreter path requested by the binary.

Before this change, it is impossible to activate non-default
interpreter for 32bit image on amd64, when /libexec/ld-elf32.so.1 file
exists.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoprocfs(5) is not required by ps(1) and w(1) anymore
bapt [Sat, 26 Dec 2015 14:23:35 +0000 (14:23 +0000)]
procfs(5) is not required by ps(1) and w(1) anymore

Remove references of those tools in procfs(5)

8 years agoUse single DMA tag for scratch areas of all virtual ports.
mav [Sat, 26 Dec 2015 09:16:05 +0000 (09:16 +0000)]
Use single DMA tag for scratch areas of all virtual ports.

8 years agoReturn EINVAL in case of incorrect sigev_signo value specified instead of panicing.
dchagin [Sat, 26 Dec 2015 09:09:49 +0000 (09:09 +0000)]
Return EINVAL in case of incorrect sigev_signo value specified instead of panicing.

8 years agoDo not allow access to emuldata for non Linux processes.
dchagin [Sat, 26 Dec 2015 09:04:47 +0000 (09:04 +0000)]
Do not allow access to emuldata for non Linux processes.

Pointed out by: mjg@
Security: https://admbugs.freebsd.org/show_bug.cgi?id=679

8 years agoMake port logins asynchronous, following r292739 logic.
mav [Sat, 26 Dec 2015 06:13:01 +0000 (06:13 +0000)]
Make port logins asynchronous, following r292739 logic.

This is even more important since it involves more network operations and
more prone to delays and timeouts.

8 years agocxgbei: Hardware accelerated iSCSI target and initiator for TOE capable
np [Sat, 26 Dec 2015 06:05:21 +0000 (06:05 +0000)]
cxgbei: Hardware accelerated iSCSI target and initiator for TOE capable
cards supported by cxgbe(4).

On the host side this driver interfaces with the storage stack via the
ICL (iSCSI Common Layer) in the kernel.  On the wire the traffic is
standard iSCSI (SCSI over TCP as per RFC 3720/7143 etc.) that
interoperates with all other standards compliant implementations.  The
driver is layered on top of the TOE driver (t4_tom) and promotes
connections being handled by t4_tom to iSCSI ULP (Upper Layer Protocol)
mode.  Hardware assistance in this mode includes:

- Full TCP processing.
- iSCSI PDU identification and recovery within the TCP stream.
- Header and/or data digest insertion (tx) and verification (rx).
- Zero copy (both tx and rx).

Man page will follow in a separate commit in a couple of weeks.

Relnotes: Yes
Sponsored by: Chelsio Communications

8 years agoMake virtual ports control asynchronous.
mav [Sat, 26 Dec 2015 04:26:32 +0000 (04:26 +0000)]
Make virtual ports control asynchronous.

Before this change virtual ports control IOCBs were executed synchronously
via Execute IOCB mailbox command.  It required exclusive use of scratch
space of driver and mailbox registers of the hardware.  Because of that
shared resources use this code could not really sleep, having to spin for
completion, blocking any other operation.

This change introduces new asynchronous design, sending the IOCBs directly
on request queue and gracefully waiting for their return on response queue.
Returned IOCBs are identified with unified handle space from r292725.

8 years ago[mdio] migrate mdiobus out of etherswitch and into a top-level device of its own.
adrian [Sat, 26 Dec 2015 02:31:39 +0000 (02:31 +0000)]
[mdio] migrate mdiobus out of etherswitch and into a top-level device of its own.

The mdio driver interface is generally useful for devices that require
MDIO without the full MII bus interface. This lifts the driver/interface
out of etherswitch(4), and adds a mdio(4) man page.

Submitted by: Landon Fuller <landon@landonf.org>
Differential Revision: https://reviews.freebsd.org/D4606

8 years agocxgbe(4): Updates to the base NIC driver and t4_tom to support the iSCSI
np [Sat, 26 Dec 2015 00:26:02 +0000 (00:26 +0000)]
cxgbe(4): Updates to the base NIC driver and t4_tom to support the iSCSI
offload driver.  These changes come from projects/cxl_iscsi.

8 years agoUpgrade our copies of clang and llvm to 3.7.1 release. This is a
dim [Fri, 25 Dec 2015 21:39:45 +0000 (21:39 +0000)]
Upgrade our copies of clang and llvm to 3.7.1 release.  This is a
bugfix-only release, with no new features.

Please note that from 3.5.0 onwards, clang and llvm require C++11
support to build; see UPDATING for more information.

8 years agoDon't implicitly terminate a user message when moving it to the
tuexen [Fri, 25 Dec 2015 18:11:40 +0000 (18:11 +0000)]
Don't implicitly terminate a user message when moving it to the
send_queue and the socket is closed. This results in strange
race conditions for the application.
While there, remove a stray character.

MFC after: 3 days

8 years agoMerge bmake-20151220
sjg [Fri, 25 Dec 2015 16:19:21 +0000 (16:19 +0000)]
Merge bmake-20151220

Fixed clearing suffixes impact on null suffix

8 years agoFix typo (s/harware/hardware/)
kevlo [Fri, 25 Dec 2015 14:51:36 +0000 (14:51 +0000)]
Fix typo (s/harware/hardware/)

8 years agoUnify handles allocation for initiator and target IOCBs.
mav [Fri, 25 Dec 2015 13:03:18 +0000 (13:03 +0000)]
Unify handles allocation for initiator and target IOCBs.

I am not sure why this was split long ago, but I see no reason for it.
At this point this unification just slightly reduces memory usage, but
as next step I plan to reuse shared handle space for other IOCB types.

8 years agoMake libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, as
cperciva [Fri, 25 Dec 2015 11:29:18 +0000 (11:29 +0000)]
Make libxnet.so a symlink to libc.so.  This makes `-lxnet` a no-op, as
POSIX requires for the c99 compiler.

(In fact, our c99(1) already ignores -lxnet; but our make(1) doesn't set
${CC} correctly, and our cc(1) treats xnet like any other library.)

Reviewed by: kib

8 years agoRemove _gethostbynisname() and _gethostbynisaddr(). These functions
ume [Fri, 25 Dec 2015 10:49:40 +0000 (10:49 +0000)]
Remove _gethostbynisname() and _gethostbynisaddr().  These functions
used to be called from getipnodebyname().

MFC after: 1 week

8 years agoDocument that make's .POSIX: handling is broken. In fact, it has been
cperciva [Fri, 25 Dec 2015 10:08:42 +0000 (10:08 +0000)]
Document that make's .POSIX: handling is broken.  In fact, it has been
broken ever since it was added in November 1996.

8 years agoClear virtual port's port database when disabling it.
mav [Fri, 25 Dec 2015 03:44:29 +0000 (03:44 +0000)]
Clear virtual port's port database when disabling it.

Previously it was done only on full chip reinit, that caused old ports
resurrect in case of virtual port reenabling.

8 years agoAdd initial configuration files for the MT7620 and RT5350 SoCs.
adrian [Fri, 25 Dec 2015 00:58:41 +0000 (00:58 +0000)]
Add initial configuration files for the MT7620 and RT5350 SoCs.

These are all works in progress.  Notably - no wifi support just yet!

I've booted the MT7620 on a TP-Link Archer C2 via tftpboot.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoAdd missing device rename.
adrian [Thu, 24 Dec 2015 22:27:00 +0000 (22:27 +0000)]
Add missing device rename.

8 years agoRemove unused function `act_getkernstring`
ngie [Thu, 24 Dec 2015 22:22:02 +0000 (22:22 +0000)]
Remove unused function `act_getkernstring`

This fixes a clang -Wunused warning

Differential Revision: https://reviews.freebsd.org/D4697
MFC after: 1 week
Reported by: Jenkins
Reviewed by: araujo, bapt
Sponsored by: EMC / Isilon Storage Division

8 years agoDo not compile ARMv6 instructions on ARMv4/v5. Although clang is fine
kib [Thu, 24 Dec 2015 22:13:52 +0000 (22:13 +0000)]
Do not compile ARMv6 instructions on ARMv4/v5.  Although clang is fine
with mrrc, gcc is not.  The disabled code is not executed on ARMv4
anyway.

Reported and reviewed by: ian
Sponsored by: The FreeBSD Foundation

8 years agoImplementation of server-side TCP Fast Open (TFO) [RFC7413].
pkelsey [Thu, 24 Dec 2015 19:09:48 +0000 (19:09 +0000)]
Implementation of server-side TCP Fast Open (TFO) [RFC7413].

TFO is disabled by default in the kernel build.  See the top comment
in sys/netinet/tcp_fastopen.c for implementation particulars.

Reviewed by: gnn, jch, stas
MFC after: 3 days
Sponsored by: Verisign, Inc.
Differential Revision: https://reviews.freebsd.org/D4350

8 years agortld: remove old XXX comment missed in r35529
emaste [Thu, 24 Dec 2015 18:53:17 +0000 (18:53 +0000)]
rtld: remove old XXX comment missed in r35529

Sponsored by: The FreeBSD Foundation

8 years ago[rt] add support for the RT5350 and MT7620 SoCs.
adrian [Thu, 24 Dec 2015 18:41:16 +0000 (18:41 +0000)]
[rt] add support for the RT5350 and MT7620 SoCs.

This is a work in progress; bringing the interface down stops further
use.  It only happens on RT5350/MT7620.

This is based on work by Alexander A. Mityaev <sansan@adm.ua>.

Submitted by: Stanislav Galabov <galabov@gmail.com>

8 years ago[rt305x] Add initial RT5350 and MT7620 glue.
adrian [Thu, 24 Dec 2015 18:40:10 +0000 (18:40 +0000)]
[rt305x] Add initial RT5350 and MT7620 glue.

* Add in chipset awareness to the obio bus layout (ie, which devices are
  where);
* Add in some USB OTG changes to be aware of the newer stuff;
* Add in a configurable primary console - some chips use the normal UART,
  some use UARTLITE.

Tested (by Stanislav);

* RT3050 (NFS)
* RT5350 (NFS, MFS)
* MT7620 (USB)

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years ago[MT7620] add ehci/ohci USB support.
adrian [Thu, 24 Dec 2015 18:36:08 +0000 (18:36 +0000)]
[MT7620] add ehci/ohci USB support.

The newer chips don't use OTG; they're more traditional USB.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years ago[MT7620] add SPI device support.
adrian [Thu, 24 Dec 2015 18:34:46 +0000 (18:34 +0000)]
[MT7620] add SPI device support.

Submitted by: Alexander A. Mityaev <sansan@adm.ua>

8 years ago[rt305x] add PCI bus / resource allocation code for the MT7620.
adrian [Thu, 24 Dec 2015 18:33:08 +0000 (18:33 +0000)]
[rt305x] add PCI bus / resource allocation code for the MT7620.

This is based on the sys/arm/mv/ pci resource/allocation code.

Submitted by: Stanislav Galabov <galabov@gmail.com>

8 years ago[rt305x] add register space definitions for later generation chips.
adrian [Thu, 24 Dec 2015 18:31:55 +0000 (18:31 +0000)]
[rt305x] add register space definitions for later generation chips.

This adds definitions for the MT5350 and MT7620 SoCs.

Submitted by: Stanislav Galabov <galabov@gmail.com>

8 years ago[rt305x] Prepare for the upcoming regime change - add RT305x options.
adrian [Thu, 24 Dec 2015 18:30:04 +0000 (18:30 +0000)]
[rt305x] Prepare for the upcoming regime change - add RT305x options.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoFix NO INET6 build broken at svn r292674
sbruno [Thu, 24 Dec 2015 17:05:25 +0000 (17:05 +0000)]
Fix NO INET6 build broken at svn r292674

Reported by: ohartman@zedat.fu-berlin.de

8 years agoUpdate mentors for brnrd
brnrd [Thu, 24 Dec 2015 16:51:03 +0000 (16:51 +0000)]
Update mentors for brnrd

  - Remove vsevolod as mentor for brnrd
  - Add feld as mentor for brnrd

Reviewed by: koobs (mentor), vsevolod (mentor p.t.), feld (mentor h.t.)
Approved by: koobs (mentor)
Differential Revision: https://reviews.freebsd.org/D4702

8 years agoReplace all whitespaces between port name and number with tabs,
jlh [Thu, 24 Dec 2015 16:35:28 +0000 (16:35 +0000)]
Replace all whitespaces between port name and number with tabs,

8 years agoFlesh out some build time configuration options for the realtek/mediatek
adrian [Thu, 24 Dec 2015 15:58:33 +0000 (15:58 +0000)]
Flesh out some build time configuration options for the realtek/mediatek
ports.

The sys/mips/rt305x/ code currently has these hard-coded with a comment
to make them configurable; this is the first step towards that.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoBegin the initial support for the mips1004kc core.
adrian [Thu, 24 Dec 2015 15:52:21 +0000 (15:52 +0000)]
Begin the initial support for the mips1004kc core.

* add build option;
* add initial coherence manager config register bits;
* use the right hazard instruction (ehb);
* add page attributes.

Tested:

* MT7621A SoC (not yet in-tree)

Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoAdd support for RISC-V architecture.
br [Thu, 24 Dec 2015 15:47:51 +0000 (15:47 +0000)]
Add support for RISC-V architecture.

Reviewed by: andrew, kib
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D4679

8 years agoSome polishing for command timeouts handling.
mav [Thu, 24 Dec 2015 14:53:29 +0000 (14:53 +0000)]
Some polishing for command timeouts handling.

8 years agoFixed comment placement.
pluknet [Thu, 24 Dec 2015 13:57:43 +0000 (13:57 +0000)]
Fixed comment placement.

Before r12296, this comment described the udp_recvspace default value.

Spotted by: ru
Sponsored by: Nginx, Inc.

8 years agoReduce zfs utilities overlinking
bapt [Thu, 24 Dec 2015 11:56:37 +0000 (11:56 +0000)]
Reduce zfs utilities overlinking