Commit graph

192597 commits

Author SHA1 Message Date
Ian Lepore 05e3ac86bf Rename new to newval in inline asm code, to avoid clashes with C++ new.
Also rename cmp to cmpval just to keep the asm variable names similar to
the C variable names.
2014-09-09 13:50:21 +00:00
Alexander Motin 55551d0542 Improve cache control support, including DPO/FUA flags and the mode page.
At this moment it works only for files and ZVOLs in device mode since BIOs
have no respective respective cache control flags (DPO/FUA).

MFC after:	1 month
Sponsored by:	iXsystems, Inc.
2014-09-09 11:38:29 +00:00
Alexander Motin ee9534ed96 Make ZVOL writes in device mode support IO_SYNC flag.
MFC after:	1 month
2014-09-09 11:29:55 +00:00
Andrey V. Elsukov 5dbfa43f65 Add the ability to set `prefer_source' flag to an IPv6 address.
It affects the IPv6 source address selection algorithm (RFC 6724)
and allows override the last rule ("longest matching prefix") for
choosing among equivalent addresses. The address with `prefer_source'
will be preferred source address.

Obtained from:	Yandex LLC
MFC after:	1 month
Sponsored by:	Yandex LLC
2014-09-09 10:52:50 +00:00
Kevin Lo 141aa3b93a Drop frames that have larger than MCLBYTES. 2014-09-09 05:21:31 +00:00
Adrian Chadd a4d98bf442 Add basic RSS awareness for the UDPv6 send path.
This doesn't include the same kind of userland overriding that the IPv4
path has; nor does it yet know about 2-tuple versus 4-tuple hashing.
That'll come later.

Differential Revision:	https://reviews.freebsd.org/D527
Reviewed by:	grehan
2014-09-09 04:20:53 +00:00
Adrian Chadd 8ad1a83b48 Calculate the RSS hash for outbound UDPv4 frames.
Differential Revision:	https://reviews.freebsd.org/D527
Reviewed by:	grehan
2014-09-09 04:19:36 +00:00
Adrian Chadd b8bc95cd49 Update the IPv4 input path to handle reassembled frames and incoming frames
with no RSS hash.

When doing RSS:

* Create a new IPv4 netisr which expects the frames to have been verified;
  it just directly dispatches to the IPv4 input path.
* Once IPv4 reassembly is done, re-calculate the RSS hash with the new
  IP and L3 header; then reinject it as appropriate.
* Update the IPv4 netisr to be a CPU affinity netisr with the RSS hash
  function (rss_soft_m2cpuid) - this will do a software hash if the
  hardware doesn't provide one.

NICs that don't implement hardware RSS hashing will now benefit from RSS
distribution - it'll inject into the correct destination netisr.

Note: the netisr distribution doesn't work out of the box - netisr doesn't
query RSS for how many CPUs and the affinity setup.  Yes, netisr likely
shouldn't really be doing CPU stuff anymore and should be "some kind of
'thing' that is a workqueue that may or may not have any CPU affinity";
that's for a later commit.

Differential Revision:	https://reviews.freebsd.org/D527
Reviewed by:	grehan
2014-09-09 04:18:20 +00:00
Peter Grehan e18f344b9b Add a callback to be notified about negotiated features.
Submitted by:	luigi
Obtained from:	Vincenzo Maffione, Universita` di Pisa
MFC after:	3 days
2014-09-09 04:11:54 +00:00
Adrian Chadd 72d33245f5 Implement IPv4 RSS software hash functions to use during packet ingress
and egress.

* rss_mbuf_software_hash_v4 - look at the IPv4 mbuf to fetch the IPv4 details
  + direction to calculate a hash.
* rss_proto_software_hash_v4 - hash the given source/destination IPv4 address,
  port and direction.
* rss_soft_m2cpuid - map the given mbuf to an RSS CPU ("bucket" for now)

These functions are intended to be used by the stack to support
the following:

* Not all NICs do RSS hashing, so we should support some way of doing
  a hash in software;
* The NIC / driver may not hash frames the way we want (eg UDP 4-tuple
  hashing when the stack is only doing 2-tuple hashing for UDP); so we
  may need to re-hash frames;
* .. same with IPv4 fragments - they will need to be re-hashed after
  reassembly;
* .. and same with things like IP tunneling and such;
* The transmit path for things like UDP, RAW and ICMP don't currently
  have any RSS information attached to them - so they'll need an
  RSS calculation performed before transmit.

TODO:

* Counters! Everywhere!
* Add a debug mode that software hashes received frames and compares them
  to the hardware hash provided by the hardware to ensure they match.

The IPv6 part of this is missing - I'm going to do some re-juggling of
where various parts of the RSS framework live before I add the IPv6
code (read: the IPv6 code is going to go into netinet6/in6_rss.[ch],
rather than living here.)

Note: This API is still fluid.  Please keep that in mind.

Differential Revision:	https://reviews.freebsd.org/D527
Reviewed by:	grehan
2014-09-09 03:10:21 +00:00
Enji Cooper 8a3fd30740 Be ANSI-C compliant when defining CX_LIMITED_RANGE #pragma
This mutes warnings with clang

Approved by: rpaulo (mentor)
Reviewed by: das, kargl (both as part of a larger patch)
Phabric: D742
Sponsored by: EMC / Isilon Storage Division
2014-09-09 02:58:58 +00:00
Adrian Chadd 9d3ddf4384 Add support for receiving and setting flowtype, flowid and RSS bucket
information as part of recvmsg().

This is primarily used for debugging/verification of the various
processing paths in the IP, PCB and driver layers.

Unfortunately the current implementation of the control message path
results in a ~10% or so drop in UDP frame throughput when it's used.

Differential Revision:	https://reviews.freebsd.org/D527
Reviewed by:	grehan
2014-09-09 01:45:39 +00:00
Adrian Chadd b174de323a Add IP_NODEFAULTFLOWID awareness to ip6_output().
Differential Revision:	https://reviews.freebsd.org/D527
2014-09-09 00:21:21 +00:00
Adrian Chadd 061a4b4c36 Add a flag to ip_output() - IP_NODEFAULTFLOWID - which prevents it from
overriding an existing flowid/flowtype field in the outbound mbuf with
the inp_flowid/inp_flowtype details.

The upcoming RSS UDP support calculates a valid RSS value for outbound
mbufs and since it may change per send, it doesn't cache it in the inpcb.
So overriding it here would be wrong.

Differential Revision:	https://reviews.freebsd.org/D527
Reviewed by:	grehan
2014-09-09 00:19:02 +00:00
Brooks Davis ac25e23856 Merge from NetBSD:
PR/49185: Conrad Meyer: strvisx: Handle zero-length input strings
gracefully.  (don't abuse 0 to mean compute string length internally)

PR:		193447
Submitted by:	Conrad Meyer <conrad.meyer@isilon.com>
MFC after:	1 month
2014-09-08 19:26:21 +00:00
Christian Brueffer 380064c8dc Use the right constants in comparisons. This is currently a nop, as
MIN_RXD == MIN_TXD and MAX_RXD == MAX_TXD.

Reviewed by:	Eric Joyner @ Intel
MFC after:	1 week
2014-09-08 19:24:25 +00:00
Ian Lepore 6966304042 Add a 'ubenv import' command to import environment variables from the
u-boot env into the loader(8) env (which also gets them into the kernel
env).  You can import selected variables or the whole environment.  Each
u-boot var=value becomes uboot.var=value in the loader env.  You can also
use 'ubenv show' to display uboot vars without importing them.
2014-09-08 19:19:10 +00:00
Glen Barber 28c80a7dd8 Include the gssapi_krb5 library in KRB5_LDFLAGS.
PR:		156245
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2014-09-08 19:00:13 +00:00
Ed Maste 35583f5196 Add clang patch for r271282
Note that r271282 contains only the src change from Clang rev 200797.
This patch file includes two follow-on changes to the test case, which
do not apply to the copy in the FreeBSD tree.

Upstream Clang revisions:

200797:

    Debug info: fix a crasher when when emitting debug info for
    not-yet-completed templated types. getTypeSize() needs a complete type.

    rdar://problem/15931354

200798:

    Simplify testcase from r200797 some more.

200805:

    Further simplify r200797 and add an explanatory comment.

PR:		193347
MFC after:	3 days
Sponsored by:	DARPA, AFRL
2014-09-08 18:48:54 +00:00
Ed Maste 2c123ad8b3 Merge Clang debug info crash fix rev 200797:
Debug info: fix a crasher when when emitting debug info for
    not-yet-completed templated types. getTypeSize() needs a complete type.

    rdar://problem/15931354

PR:		193347
MFC after:	3 days
Sponsored by:	DARPA, AFRL
2014-09-08 18:43:33 +00:00
Brooks Davis 2110fd8ff6 Vendor import of NetBSD's (un)vis(3) at 2014-09-08 2014-09-08 18:09:19 +00:00
Bryan Drewery a9ff4acab2 Avoid rs(1) hitting LINE_MAX with custom trees that have large dependencies. 2014-09-08 17:01:30 +00:00
Dag-Erling Smørgrav 29be5943e8 Revert r271257 after several issues were pointed out. An updated patch
will be committed at a later date.
2014-09-08 12:26:52 +00:00
Alexander Motin fcd7f38fb0 Bunch of microoptimizations to reduce dereferences and cache collisions. 2014-09-08 12:11:49 +00:00
Edward Tomasz Napierala 0dcfb96fbc Make it possible to use empty user name ("-U ''") for mount_smbfs(8).
It's just like "-U guest", except that it actually works, at least
with Samba 4, which seems to return authentication failure for "-U guest".

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2014-09-08 11:01:57 +00:00
Edward Tomasz Napierala afe21afeba Make mount_smbfs(8) preserve the "automounted" mount flag.
The issue here is that we have to pass this flag as a string,
in iov, because it doesn't fit in mntflags, which is an int.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-09-08 10:57:43 +00:00
Dag-Erling Smørgrav e1d9a028f6 Use the correct idiom for default values, and ensure that the script
works correctly if the user overrides them.

PR:		193255
Submitted by:	hrs@
MFC after:	3 days
2014-09-08 09:33:43 +00:00
Dag-Erling Smørgrav 067268edfc Fail rather than segfault if neither PAM_TTY nor PAM_RHOST is set.
PR:		83099
MFC after:	3 days
2014-09-08 09:19:01 +00:00
Dag-Erling Smørgrav 24de4f90fa Fix support for IPv6 nameservers.
PR:		188931
Submitted by:	Takefu <takefu@airport.fm>
MFC after:	3 days
2014-09-08 09:16:07 +00:00
Hiroki Sato 714266373c - Make hhook_run_socket() vnet-aware instead of adding CURVNET_SET() around
the function calls.
- Fix a memory leak and stats in the case that hhook_run_socket() fails
  in soalloc().

PR:	193265
2014-09-08 09:04:22 +00:00
Jean-Sébastien Pédron ffea80b445 pause_sbt(): Take the cold path (ie. use DELAY()) if KDB is active
This fixes a panic in the i915 driver when one uses debug.kdb.enter=1
under vt(4).

PR:		193269
Reported by:	emaste@
Submitted by:	avg@
MFC after:	3 days
2014-09-08 08:44:50 +00:00
Bjoern A. Zeeb afa0a6efe0 Use __DECONST to avoid compiler warnings (and thus build failures)
with gcc on sparc64, mips, and powerpc after r271173.
2014-09-08 08:12:09 +00:00
Jean-Sébastien Pédron 313ef9368f vt(4): Change the terminal and buffer sizes, even without a font
This fixes a bug where scroll lock would not work for tty #0 when using
vt_vga's textmode. The reason was that this window is created with a
static 256x100 buffer, larger than the real size of 80x25.

Now, in vt_change_font() and vt_compute_drawable_area(), we still
perform operations even of the window has no font loaded (this is the
case in textmode here vw->vw_font == NULL). One of these operation
resizes the buffer accordingly.

In vt_compute_drawable_area(), we take the terminal size as is (ie.
80x25) for the drawable area.

The font argument to vt_set_border() is removed (it was never used) and
the code now uses the computed drawable area instead of re-doing its own
calculation.

Reported by:	Harald Schmalzbauer <h.schmalzbauer_omnilan.de>
Tested by:	Harald Schmalzbauer <h.schmalzbauer_omnilan.de>
MFC after:	3 days
2014-09-08 07:37:03 +00:00
Adrian Chadd 9dd099b274 Implement htprotmode handling.
This is separate to 11g protection - the default is to RTS protect
11n frames, including A-MPDU frames.

Tested:

* Intel 5100, STA mode
2014-09-08 07:16:00 +00:00
Peter Wemm 78389e87b2 Temporarily remove the warning added r270781 - it prints the warning
regardless of whether the usage is correct or not and this generates a
LOT of noise, even when you have specified a mask.
2014-09-08 05:14:58 +00:00
Adrian Chadd 339503ab41 (more) correctly account TX completion status for A-MPDU session frames.
The rules turn out to be:

* for non-aggregation session TX queues - it's either sent or not sent.
* for aggregation session TX queues - if nframes=1, then the status reflects
  the completed transmission.
* however, for nframes > 1, then this is just a status reflecting what
  the initial transmission did.  The compressed BA (immediate or delayed)
  may not have yet been received, so the actual frame status is in the
  compressed BA updates.

Whilst here, I fiddled with debugging and formatting a bit.

There's also RTS attempts (what the atheros chips call "short retries")
which weren't being logged and they aren't yet being used in the rate
control statistics updates.  For now, at least log them.

TODO:

* This still isn't 100% correct! So I have to tinker with this some more.
  (The failures aren't always failures..)
* Extend the rate control API in net80211 so it can take both short and
  long retry counts.

Tested:

* Intel 5100, STA mode
2014-09-08 03:16:28 +00:00
Adrian Chadd f7efe7e999 Bring over some more status codes from the Linux iwlwifi driver.
The (eventual) intention is to create MIB counters for transmitted
frame completion to count how many packets with each status are
transmitted.

Note the difference between A-MPDU and non A-MPDU status.

Obtained from:	Linux iwlwifi/dvm driver
2014-09-08 03:12:42 +00:00
Glen Barber 1bba7a88fc Silence a bmake(1) warning in the gif(4) module build
when built with WITHOUT_INET6.

LGTM: 		sbruno
Sponsored by:	The FreeBSD Foundation
2014-09-08 02:37:45 +00:00
Alan Cox 0afcd3af8b Oops. vm_map_simplify_entry() is used by mac_proc_vm_revoke_recurse(), so
it can't be static.
2014-09-08 02:25:01 +00:00
Alan Cox 077ec27cd6 Make two functions static and eliminate an unused #define. 2014-09-08 00:19:03 +00:00
Enji Cooper 1f771f4603 Include src.opts.mk after SHLIBDIR has been defined so libnv is installed to
/lib , not /usr/lib

MFC after: 3 days
Approved by: rpaulo (mentor)
Submitted by: antoine
Pointyhat to: me
Phabric: D739
2014-09-07 22:56:57 +00:00
Andrew Turner 89fd02846e When entering the kernel with the MMU off assume we are running from a
va == pa map.

I'm not sure the code would work if we are not running from the identity
map as the ARM core may attempt to read the next instruction from an
invalid memory location.
2014-09-07 21:46:54 +00:00
Sean Bruno 082afa63f6 Remove redundant kern conf entries that are inherited via include
Move cfg to spi1 as that's where it is located from the factory
2014-09-07 20:27:48 +00:00
Andrew Turner d5294df7d0 Remove Lvirtaddr and Lphysaddr, these don't appear to be used. 2014-09-07 19:33:38 +00:00
Andrew Turner d26c7c862b Generalise the va to pa code and use it when starting secondary cores
Reviewed by:	ian@, rpaulo@
Differential Revision: https://reviews.freebsd.org/D736
2014-09-07 18:32:42 +00:00
Michael Tuexen ad234e3c3d Address warnings generated by the clang analyzer.
MFC after: 1 week
2014-09-07 18:05:37 +00:00
Michael Tuexen 23602b60fb Address another warnings reported by Patrick Laimbock when compiling
in userspace. While there, improve consistency.

MFC after: 1 week
2014-09-07 17:07:19 +00:00
Xin LI 36d45b79de MFV r271225:
Iterate through all the children instead of returning error when we hit
the first error.  This makes the error message give more information
rather than just the first device that causes problem.

Illumos issue:
    5118 When verifying or creating a storage pool, error messages only
	 show one device

MFC after:	2 weeks
2014-09-07 13:22:14 +00:00
Xin LI 817d804595 MFV r271223:
In dnode_sync(), do dnode_increase_indirection() before processing
the dn_next_nblkptr.

Illumos issue:
    5117 space map reallocation can cause corruption

MFC after:	3 days
2014-09-07 13:13:42 +00:00
Xin LI 0a0bd9b9b8 5118 When verifying or creating a storage pool, error messages only show one device
Reviewed by: Adam Leventhal <adam.leventhal@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Boris Protopopov <boris.protopopov@me.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Basil Crow <basil.crow@delphix.com>

illumos/illumos-gate@75fbdf9b9f
2014-09-07 12:18:12 +00:00