Commit Graph

101403 Commits

Author SHA1 Message Date
ian
cdce53b945 MFC r268836: Fix a typo in a gpio node name. 2014-11-08 04:18:33 +00:00
ian
ccec47a8b5 MFC r273703:
Remove the ARM_DEVICE_MULTIPASS option and make its effect be the default.
2014-11-08 03:42:19 +00:00
bryanv
8677516401 MFC r272844:
Add missing UDP multicast receive dtrace probes
2014-11-08 02:53:55 +00:00
bryanv
018ace964f MFC r272801:
Move the calls to u_tun_func() into udp6_append()

A similar cleanup for UDPv4 was performed in r220620.
2014-11-08 02:47:23 +00:00
bryanv
520007fcf4 MFC r272797:
Check for mbuf copy failure when there are multiple multicast sockets

This partitular case is the only path where the mbuf could be NULL.
udp_append() checked for a NULL mbuf only after invoking the tunneling
callback. Our only in tree tunneling callback - SCTP - assumed a non
NULL mbuf, and it is a bit odd to make the callbacks responsible for
checking this condition.

This also reduces the differences between the IPv4 and IPv6 code.
2014-11-08 02:40:00 +00:00
gnn
52c05ed231 MFC: 273279
Add new quirks for the latest Samsung SSD, model 850.

Submitted by:	sbruno
2014-11-08 00:47:16 +00:00
trasz
11e554c92e MFC r272931:
Add assertion to catch duplicated nodes.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:52:32 +00:00
trasz
44b7c0743b MFC r272836:
Remove remnants of some cleanup; no functional changes.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:50:40 +00:00
trasz
5217262cb3 MFC r272743:
Simplify; no functional changes.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:49:04 +00:00
trasz
a6df93e354 MFC r272512:
Make autofs use shared vnode locks.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:47:22 +00:00
trasz
f72fde1ec0 MFC r272471:
Fix autofs debug macros.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:45:34 +00:00
trasz
603b73d3cc MFC r272470:
Make autofs(4) use shared lock for lookups, instead of exclusive one.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:44:03 +00:00
trasz
c03d95d341 MFC r272405:
Call uma_zfree() outside of lock, and improve comment.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:42:11 +00:00
trasz
aba7b57a35 MFC r272403:
Make autofs timeout handling use timeout task instead of callout;
that's because the handler can sleep on sx lock.

Sponsored by:	The FreeBSD Foundation
2014-11-07 15:40:34 +00:00
ae
b0344a7d0f MFC r273855:
Fix mbuf leak in IPv6 multicast code.
  When multicast capable interface goes away, it leaves multicast groups,
  this leads to generate MLD reports, but MLD code does deffered send and
  MLD reports are queued in the in6_multi's in6m_scq ifq. The problem is
  that in6_multi structures are freed when interface leaves multicast groups
  and thread that does deffered send will not take these queued packets.

  PR:		194577

MFC r273857:
  Move ifq drain into in6m_purge().

  Suggested by:	bms

Sponsored by:	Yandex LLC
2014-11-06 09:16:52 +00:00
gjb
9bbd5a3136 Bump __FreeBSD_version after SA-14:23, SA-14:24,
SA-14:25.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-11-06 02:41:38 +00:00
markj
4520b8ad04 MFC r273342:
Fix a typo from r189544, which replaced unp_global_rwlock with unp_list_lock
and unp_link_rwlock.
2014-11-06 01:34:43 +00:00
markj
0413ac300f MFC r273236:
Use pmc_destroy_pmc_descriptor() to actually free the pmc, which is
consistent with pmc_destroy_owner_descriptor(). Also be sure to destroy
PMCs if a process exits or execs without explicitly releasing them.
2014-11-06 01:30:13 +00:00
rmacklem
1dc5bfe0b1 MFC: r273486
Clip the settings for the NFS rsize, wsize mount options
to a power of 2. For non-power of 2 settings, intermittent
page faults have been reported. Although the bug that causes
these page faults/crashes has not been identified, it does
not appear to occur when rsize, wsize is a power of 2.
2014-11-05 23:12:39 +00:00
lwhsu
7cb84aa335 MFC r271992
Reflect the chanages in sleepqueue.h and subr_sleepqueue.c
  - Priority argument is introduced to sleepq_*wait* in r177085
  - sleepq_calc_signal_retval is removed from implementation
  - sleepq_catch_signals is internal now

MFC r272475

  - Bump .Dd

Approved by:  kevlo
2014-11-05 16:24:57 +00:00
ae
6933957ccb MFC r266800 by vanhu:
IPv4-in-IPv6 and IPv6-in-IPv4 IPsec tunnels.
  For IPv6-in-IPv4, you may need to do the following command
  on the tunnel interface if it is configured as IPv4 only:
  ifconfig <interface> inet6 -ifdisabled

  Code logic inspired from NetBSD.
  PR: kern/169438

MC r266822 by bz:
  Use IPv4 statistics in ipsec4_process_packet() rather than the IPv6
  version.  This also unbreaks the NOINET6 builds after r266800.

MFC r268083 by zec:
  The assumption in ipsec4_process_packet() that the payload may be
  only IPv4 is wrong, so check the IP version before mangling the
  payload header.

MFC r272394:
  Do not strip outer header when operating in transport mode.
  Instead requeue mbuf back to IPv4 protocol handler. If there is one extra IP-IP
  encapsulation, it will be handled with tunneling interface. And thus proper
  interface will be exposed into mbuf's rcvif. Also, tcpdump that listens on tunneling
  interface will see packets in both directions.

PR:		194761
2014-11-05 09:23:29 +00:00
des
39bef15648 [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2).
[SA-14:26] Fix remote command execution in ftp(1).

Approved by:	so (des)
2014-11-04 23:29:57 +00:00
hselasky
fa183f0174 MFC r271946 and r272595:
Improve transmit sending offload, TSO, algorithm in general. This
change allows all HCAs from Mellanox Technologies to function properly
when TSO is enabled. See r271946 and r272595 for more details about
this commit.

Sponsored by:	Mellanox Technologies
2014-11-03 12:38:29 +00:00
nyan
8dd879bfaf MFC: r268474 and r268476 (by imp)
- Merge the clang support from i386.
  - Compile boot2 with clang on pc98.

MFC: r272250 (by nyan)
  - Reduce diffs against i386.
2014-11-03 12:07:04 +00:00
nyan
2b45887284 MFC: r268475 (by imp)
Make SERIAL support optional again. Enable it for i386 because a huge
  percentage of machines has a 16550. Disable it for pc98 since only a
  tiny fraction of them have one.
2014-11-03 11:58:32 +00:00
nyan
562d29cc36 MFC: r272258
- Cosmetic changes.
  - Reduce diffs against i386.

MFC: 272259
  MFi386: Enable QUOTA, PRINTF_BUFR_SIZE and puc.
2014-11-03 11:21:43 +00:00
nyan
027712baa4 MFC: r272256
Switch from lib/libstand to sys/boot/libstand32.
2014-11-03 11:08:00 +00:00
nyan
85b0a19937 MFC: r272255
Supress clang warning for FreeBSD printf %b and %D formats.
2014-11-03 11:01:12 +00:00
nyan
c2e8bf4779 MFC: r272252
Drop the 3rd clause from all 3 clause BSD licenses.
2014-11-03 10:38:03 +00:00
kib
2a026f5937 MFC r273728:
Add a method to iicbus to request IIC_M_NOSTOP behaviour for multibyte
transfers to be default.
2014-11-03 10:33:01 +00:00
kib
9b2eda21cd MFC r273727:
Original commit message was
Allow the vfs.nfsd knobs to be set from loader.conf (or using
kenv(8)).  This is useful when nfsd is loaded as module.

As I understand, automatic fetch from kenv does not work in stable/10.
Merge the change still, to reduce code difference.
2014-11-03 10:30:44 +00:00
nyan
70c10de0a9 MFC: r272248
- Cleanups pc98 code.
  - Remove unworked formats.
2014-11-03 10:26:29 +00:00
mav
edabf036a2 MFC r273809:
Implement better handling for ENOSPC error for both CTL and CAM.

This makes VMWare VAAI Thin Provisioning Stun primitive activate, pausing
the virtual machine, when backing storage (ZFS pool) is getting overflowed.
2014-11-03 03:45:41 +00:00
mav
131eff3491 MFC r273730, r273731:
Reduce code duplication around Write Exclusive persistent reservation.

While there, allow some more commands to pass persistent reservation.
2014-11-03 03:44:59 +00:00
mav
58bf349623 MFC r273711:
Allocate buffer for READ BUFFER/WRITE BUFFER commands on demand.

These commands are rare, but consume additional 256KB RAM per LUN.
2014-11-03 03:43:40 +00:00
rpaulo
ce9598bb33 MFC 273598 273602 273607 273613 273647:
Userland HPET support.
2014-11-03 03:17:58 +00:00
delphij
9a897ad843 MFC r273026:
Add a tunable for arc_shrink_shift (vfs.zfs.arc_shrink_shift) that
controls how much fraction, 1/2^arc_shrink_shift, should be reclaimed
when there is memory pressure.

Submitted by:	Richard Kojedzinszky <krichy at tvnetwork.hu>
2014-11-02 19:16:41 +00:00
delphij
78541e1020 MFC r273267:
Add tunable vfs.zfs.space_map_blksz for space map's maximum block size.
2014-11-02 19:09:34 +00:00
mav
9252414b60 MFC r273708: Fix support for LUN flat space addressing. 2014-11-02 17:31:45 +00:00
mav
9e735a2fb2 MFC r273693: Fix printing non-terminated strings in devlist XML. 2014-11-02 17:31:10 +00:00
mav
c9979422b8 MFC r273687:
Add "rpm" and "formfactor" LUN options to match istgt functionality.
2014-11-02 17:30:30 +00:00
mav
522da768bb MFC r273640: Add support for 12/16-byte EUI and 16-byte NAA IDs. 2014-11-02 17:29:48 +00:00
mav
db924e4c03 MFC r273075: Remove couple Copan's vendor-specific mode pages.
Those pages are highly system-/hardware-specific, the code is incomplete,
and so they hardly can be useful for anybody else.
2014-11-02 17:28:44 +00:00
mav
9ac81dc0af MFC r273073: Some groundwork for later Informational Exceptions support.
This includes support for:
 - Read-Write Error Recovery mode page;
 - Informational Exceptions Control mode page;
 - Logical Block Provisioning mode page;
 - LOG SENSE command.

No real Informational Exceptions features yet. This is only a placeholder.
2014-11-02 17:28:08 +00:00
mav
13d0c695a0 MFC r272409:
Use REPORT LUNS command for SPC-2 devices with LUN 0 disconnected.

SPC-2 tells REPORT LUNS shall be supported by devices supporting LUNs other
then LUN 0.  If we see LUN 0 disconnected, guess there may be others, and
so REPORT LUNS shall be supported.
2014-11-02 17:26:13 +00:00
mav
5c2f41bdb0 MFC r272406:
Make disconnected LUN 0 don't remain in half-configured state if there are
no LUNs on SPC-3 target after we tried REPORT LUNS.
2014-11-02 17:25:03 +00:00
mav
3f2b3e757a MFC r272401, r272402: Rework the logic of sequential SCSI LUN scanner.
Previous logic was not differentiating disconnected LUNs and absent targets.
That made it to stop scan if LUN 0 was not found for any reason.  That made
problematic, for example, using iSCSI targets declaring SPC-2 compliance and
having no LUN 0 configured.

The new logic continues sequential LUN scan if:
 -- we have more configured LUNs that need recheck;
 -- this LUN is connected and its SCSI version allows more LUNs;
 -- this LUN is disconnected, its SCSI version allows more LUNs and we
    guess they may be connected (we haven't scanned first 8 LUNs yet or
    kern.cam.cam_srch_hi sysctl is set to scan more).
2014-11-02 17:23:44 +00:00
rpaulo
4ca13eed64 MFC r273551:
puc(4): add an entry for the Oxford Semiconductor OXPCIe952 1S1P
  card.

  Submitted by:	Alex Burlyga <alex.burlyga.ietf at gmail.com>
2014-11-01 05:45:05 +00:00
dumbbell
272ad10c66 vt(4): Add PIO_VFONT_DEFAULT ioctl to restore the default builtin font
To restore the default font using vidcontrol(1), use the "-f" flag
without an argument:
    vidcontrol -f < /dev/ttyv0

PR:		193910
Differential Revision:	https://reviews.freebsd.org/D971
Submitted by:	Marcin Cieslak <saper@saper.info>
Reviewed by:	ray@, emaste@
Approved by:	ray@
MFC of:		r273544
2014-10-31 23:10:58 +00:00
hselasky
a916deff5e MFC 258028:
Unbreak build of RSU module.
Use the real product name for Edimax rsu(4) id.
2014-10-31 10:07:56 +00:00
hselasky
67fc427da2 MFC r264801, r264802, r264934, r273181, r273216 and r273252:
Add more USB IDs.
2014-10-31 07:55:42 +00:00
hselasky
6154f3f498 MFC r269575, r269576 and r269578:
- Add a second Huawei SCSI eject command as USB mode switch config files
sometimes use one or the other. Maybe newer Huawei modems switched.
- Return USB_ERR_INVAL if the eject method is not known.

PR:		145319
2014-10-31 07:51:05 +00:00
hselasky
5c349cb3d1 MFC r264923:
Remove device type from the uftdi_devs table, enhance the jtag-skip feature.
2014-10-31 07:41:28 +00:00
hselasky
8118b15cf0 MFC r269569:
Remove unused defines.
Fix some device_printf's that were missing '\n' at the end or had
spelling errors.

PR:		145319
2014-10-31 07:38:49 +00:00
hselasky
07b5c0c04d MFC r271159, r271168 and r271680:
Add USB LED driver for the Dream Cheeky WebMail Notifier.
2014-10-31 07:33:56 +00:00
hselasky
d720a46ad0 MFC r273867:
Fix compile warning by removing unused variable.

Sponsored by:	Mellanox Technologies
2014-10-31 07:08:32 +00:00
hselasky
b52afefda4 MFC r273593:
Update the network interface baudrate integer according to the actual
line rate.

Sponsored by:	Mellanox Technologies
2014-10-31 07:04:25 +00:00
araujo
7081823e48 MFC r273159:
Add two sysctl(8) to enable/disable NFSv4 server to check when setting
user nobody and/or setting group nogroup as owner of a file or directory.
Usually at the client side, if there is an username that is not in the
client's passwd database, some clients will send 'nobody@<your.dns.domain>'
in the wire and the NFSv4 server will treat it as an ERROR.
However, if you have a valid user nobody in your passwd database,
the NFSv4 server will treat it as a NFSERR_BADOWNER as its believes the
client doesn't has the username mapped.

Submitted by:	Loic Blot <loic.blot@unix-experience.fr>
Reviewed by:	rmacklem
Approved by:	rmacklem
Sponsored by:	QNAP Systems Inc.
2014-10-31 04:01:10 +00:00
ae
33d2961d9a MFC r272770:
When tunneling interface is going to insert mbuf into netisr queue after stripping
  outer header, consider it as new packet and clear the protocols flags.

  This fixes problems when IPSEC traffic goes through various tunnels and router
  doesn't send ICMP/ICMPv6 errors.

PR:		174602
Sponsored by:	Yandex LLC
2014-10-30 13:53:57 +00:00
hselasky
1d17f744c7 MFC r273733, r273740 and r273773:
The SYSCTL data pointers can come from userspace and must not be
directly accessed. Although this will work on some platforms, it can
throw an exception if the pointer is invalid and then panic the kernel.

Add a missing SYSCTL_IN() of "SCTP_BASE_STATS" structure.

Sponsored by:	Mellanox Technologies
2014-10-30 08:04:48 +00:00
jilles
2b4fb09304 MFC r266842: netinet/in.h: Expose htonl(), htons(), ntohl() and ntohs() in
strict POSIX mode.

Put the htonl(), htons(), ntohl() and ntohs() declarations under
__POSIX_VISIBLE >= 200112. POSIX.1-2001 and newer require these to be
exposed from <netinet/in.h> (as well as <arpa/inet.h>).

Note that it may be unnecessary to check __POSIX_VISIBLE >= 200112 because
older versions of POSIX and the C standard do not define this header.
However, other places in the same file already perform the check.

PR:		188316
Submitted by:	Christian Neukirchen
2014-10-29 23:10:48 +00:00
jilles
971ac59143 MFC r264628: fcntl.h: Make visible various POSIX.1-2008 features.
Also, remove #if __BSD_VISIBLE where it is redundant. When __BSD_VISIBLE is
defined to 1, __POSIX_VISIBLE, __XSI_VISIBLE and __ISO_C_VISIBLE are also
defined to the newest supported version.

PR:		188173
2014-10-29 22:55:16 +00:00
sbruno
47c62aa0b0 MFC r272720, 273061, 273062, 273063, 273064
Implement PLPMTUD blackhole detection (RFC 4821), inspired by code
from xnu sources.  If we encounter a network where ICMP is blocked
the Needs Frag indicator may not propagate back to us.  Attempt to
downshift the mss once to a preconfigured value.

Note, this is turned off by default.
2014-10-29 22:17:45 +00:00
andrew
9f5da66af7 MFC r273288:
Allow the armv6 kernel to be build with PHYSADDR undefined. The kernel
 will now find the virtual to physical mapping for libkvm to use at
 runtime. This makes PHYSADDR redundant, however keep it around to give
 everyone a chance to update their libkvm.
2014-10-29 16:41:20 +00:00
andrew
1bb14d2219 MFC r273287:
Only build the ARM tranpoline when KERNPHYSADDR is defined as it is
 otherwise unneeded in armv6 kernels.
2014-10-29 16:38:13 +00:00
andrew
ce556e3257 MFC r273284:
Allow libkvm to get the kernel va to pa delta without the need for
 physaddr. This should allow for a kernel where PHYSADDR and KERNPHYSADDR
 are both undefined.

 For now libkvm will use the old method of reading physaddr and kernaddr
 to allow it to work with old kernels. This could be removed in the future
 when enough time has passed.
2014-10-29 16:36:08 +00:00
andrew
f0629d0f08 MFC r269956:
From https://sourceware.org/ml/newlib/2014/msg00113.html
 By Richard Earnshaw at ARM
 >
 >GCC has for a number of years provides a set of pre-defined macros for
 >use with determining the ISA and features of the target during
 >pre-processing.  However, the design was always somewhat cumbersome in
 >that each new architecture revision created a new define and then
 >removed the previous one.  This meant that it was necessary to keep
 >updating the support code simply to recognise a new architecture being
 >added.
 >
 >The ACLE specification (ARM C Language Extentions)
 >(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.swdev/index.html)
 >provides a much more suitable interface and GCC has supported this
 >since gcc-4.8.
 >
 >This patch makes use of the ACLE pre-defines to map to the internal
 >feature definitions.  To support older versions of GCC a compatibility
 >header is provided that maps the traditional pre-defines onto the new
 >ACLE ones.

 Stop using __FreeBSD_ARCH_armv6__ and switch to __ARM_ARCH >= 6 in the
 couple of places in tree. clang already implements ACLE. Add a define
 that says we implement version 1.1, even though the implementation
 isn't quite complete.
2014-10-29 16:24:02 +00:00
ae
456c95b69d MFC r272746:
Add an ability to set dumpdev via loader(8) tunable.

MFC r272747:
  Revert r156046. We support setting dumpdev via loader tunable again.
  Also change default disk name to ada.
2014-10-29 11:07:40 +00:00
smh
93face2ccb MFC: r273704
Fix CF ERASE breakage caused by 268205.

Sponsored by:	Multiplay
2014-10-29 09:27:24 +00:00
neel
9221e1200a MFC r273666.
Don't pass the 'error' return from an I/O port handler directly to vm_run().
2014-10-29 01:54:37 +00:00
mav
928386888b MFC r273638:
Revert somewhat hackish geom_disk optimization, committed as part of r256880,
and the following r273143 commit, supposed to workaround introduced issue by
quite innocent-looking change.

While there is no clear understanding why, but r273143 is accused in data
corruption in some environments with high I/O load.  I personally don't see
any problem in that commit, and possibly it is just a trigger to some other
bug somewhere, but better safe then sorry for now.

Requested by:	scottl@
2014-10-28 08:00:28 +00:00
yongari
5b786ca5f9 MFC r273359:
It seems multicast filtering of RTL8168F does not work.  Workaround
  the silicon bug by accepting any multicast packets.

  PR:	193488
2014-10-28 00:43:00 +00:00
hselasky
1f41d295fb MFC r263710, r273377, r273378, r273423 and r273455:
- De-vnet hash sizes and hash masks.
- Fix multiple issues related to arguments passed to SYSCTL macros.

Sponsored by:	Mellanox Technologies
2014-10-27 14:38:00 +00:00
loos
a3704ff4d4 MFC: r266336, r270230 and r273263
r266336:
Allow us to compile the Ti iic driver for both OMAP4 and AM335x.

r270230:
Rewrite of ti_i2c based on gonzo's patch, fix the following bugs/problems:

  . interrupt storm detected on "intr70:"; throttling interrupt source;

  . Added access serialization on iicbus_transfer(), previously there was
    no such protection and a new transfer could easily confuse the
    controller;

  . Add error checkings (i.e. stop the transfer when a error is detected
    and do _not_ overwrite the previous error);

  . On command done interrupt do not assume that the transfer was finished
    sucessfully as we will receive the command done interrupt even after
    errors;

  . Simplify the FIFO handling;

  . Reset the FIFO between the transfers as the FIFO may contain data from
    the last (failed) transfer;

  . Fix the iicbus speed for AM335x, which in turn will make better use of
    the I2C noise filter (set to one internal clock cycle);

  . Move the read and write handler to ithread instead of notifying the
    requesting thread with wakeup(9);

  . Fix the comments based on OMAP4 TRM.

The above changes allows me to read the EDID from my HDMI monitor on BBB
with gonzo's patches to support TDA19988 (which does 128 bytes reads) and
repeatedly scan the iicbus (with a modified i2c(8)) without lock up the bus.

r273263:
Fix the chan address for mtx_sleep() on bus wait.  Without this fix the
threads waiting for the bus would never wake.
2014-10-27 12:18:07 +00:00
hselasky
14fa4d63cd MFC r272733, r272807 and r272822:
Add support for disabling USB enumeration or USB port power
in general or on selected USB HUBs.
2014-10-27 09:07:30 +00:00
mav
9fbf4aa76f MFC r273328: Add another PCI ID for JMB368 PATA controller. 2014-10-27 07:20:39 +00:00
ian
8f1520bd13 MFC r262626, r262626, r264979, r265154, r265162, r265163, r267319, r270863,
r270991, r271045:

  Enhancements related to compiling FDT data...

 - Use proper include path for dtc as well as cpp.
 - Call cpp with -P to avoid printing line markings.
 - Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a
   kernel config file.
 - Add the dts include directory to the -I list when doing arm builds.
 - Invoke make_dtb with MACHINE defined for cross building friendliness.
 - Allow the make_dtb script to work outside of a "make buildkernel"
   context by setting MACHINE from uname -m if it's not set already.
 - Use sh -c '...' to launch the dtb build scripts with env prepended,
   otherwise it tries to treat the env var stuff as a script file name.
2014-10-27 00:47:55 +00:00
ian
348b464642 MFC r271143, r271151: Reimport dts from vendor branch after proper trim. 2014-10-26 23:45:33 +00:00
ian
b39020f586 MFC 271140:
Delete old arm dts tree. This was created by cherry picking from a
  full vendor tree. This worked great until it was time to update, but
  now it is time to update. Hit the rest button by removing this branch
  and re-adding it by a full copy of whatever is in the vendor tree.
2014-10-26 23:39:15 +00:00
ian
f145f92958 MFC r262606, r262607, r262608, r262609, r262610, r269528, r269609, r271133:
- Move imported dts source from sys/contrib/dts/ to sys/gnu/dts.
 - Fix some missing properties.
 - Import dts-related header files.
 - Update everything to latest vendor branch representing 3.17-rc2
   level of Linux DTS API.
2014-10-26 23:37:24 +00:00
ian
42ed59292e MFC r272528: Make kevent(2) periodic timer events more reliably periodic. 2014-10-26 18:46:03 +00:00
ian
c7723e1e69 MFC r273590: Accept documented compatible string for PL310 cache controller/ 2014-10-26 16:09:59 +00:00
ian
4666b07fe9 MFC r273561:
Install a temporary workaround to avoid problems in fdt data with linux's
  workaround for an imx6 chip erratum by using gpio1_6 as an interrupt.
2014-10-26 16:02:35 +00:00
rpaulo
33a82acb89 MFC r273281:
Style changes as pointed out by stas@.
2014-10-26 07:07:54 +00:00
ian
34e0375805 MFC r273353, r273514:
Attach the imx6 CCM driver during BUS_PASS_CPU.

  Unconditionally enable the clocks for all imx6 devices that we have drivers
  for, or that are required to run the chip (such as busses).
2014-10-26 04:17:20 +00:00
ian
aec69e1f98 MFC r273352: Ask for the fastest available clock for the GTP timecounter. 2014-10-26 04:15:27 +00:00
ian
46597f7cad MFC r273298:
The U-Boot README says fdt_addr_r is the right env var for fdt data
  loaded into ram, but vendors also use fdtaddr and fdt_addr.  Check the
  recommended variable first and fall back to the others.
2014-10-26 04:13:08 +00:00
ian
449c80cb11 MFC r273283:
Attach this driver during BUS_PASS_BUS and move the cpu init code to a
  bus_new_pass() handler so it doesn't happen until BUS_PASS_CPU.  This allows
  the anatop driver to outbid the generic simplebus driver (which the FDT
  data describes as compatible).
2014-10-26 04:11:32 +00:00
ian
d16952c51d MFC r273282: Fail to probe on simplebus nodes that lack a "ranges" property. 2014-10-26 04:10:17 +00:00
ian
81b5013966 MFC r272334, r273004:
Return the actual baud rate programmed in the hardware rather than 115200.
  This allows the "3wire" entry in /etc/ttys (with no speed specified) to work.

  Use the FIFOs in the imx5/imx6 uart hardware instead of interrupting on
  each byte sent or received.
2014-10-26 04:08:34 +00:00
ian
afbd2ea226 MFC r272333: Honor exclusion flags when building the memory lists. 2014-10-26 04:06:29 +00:00
ian
8526d66c63 MFC r272109, r272181:
Replace multiple nearly-identical copies of code to walk through an FDT
  node's interrupts=<...> property creating resource list entries with a
  single common implementation.  This change makes ofw_bus_intr_to_rl() the
  one true copy of that code and removes the copies of it from other places.

  This also adds handling of the interrupts-extended property.
2014-10-26 04:01:57 +00:00
ian
2008cd3c3f MFC r271906:
Make the ARM MPCore Timer driver work with published standard FDT bindings.
2014-10-26 03:55:09 +00:00
ian
839e78bb76 MFC r271595, r271601, r271607, r271630:
Add compat strings for all the flavors of GIC this driver should support.
  Also allow the driver to attach to ofwbus as well as simplebus, some FDT
  data puts the root interrupt controller on the root bus.

  Add a common routine for parsing FDT data describing an ARM GIC interrupt.

  Use gic_decode_fdt() rather than a local routine to parse fdt interrupt
  properties.  Move fdt_pic_table and fdt_fixup_table into imx6_machdep.c,
  which means imx6 doesn't need imx_common.c anymore.

  The private peripheral interrupts start at offset 16, not 0.  Also, use
  names rather than inline mystery constants for these offsets.
2014-10-26 03:52:45 +00:00
ian
1ede59bf75 MFC r271594:
Fix an undefined variable that was accidentally not causing an error.
2014-10-26 03:48:12 +00:00
ian
552dafa953 MFC r271550, r271591:
Replace the imx5 and imx6 iomux drivers with a single common driver that
  uses the new fdt_pinctrl interface.
2014-10-26 03:44:19 +00:00
ian
dfd00b89e1 MFC 271546:
Create an interface and support routines for drivers that handle IO pin
  multiplexing and configuration based on FDT data.
2014-10-26 03:41:27 +00:00
ian
b6219df7b3 MFC r271535:
Make inclusion of fdt clock support conditional on fdt_clock, not just fdt.
2014-10-26 03:29:06 +00:00
ian
9e4d760d5e MFC r271310:
Rename new to newval in inline asm code, to avoid clashes with C++ new.
2014-10-26 03:13:19 +00:00
ian
3eae765afa MFC r271285:
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).
2014-10-26 02:53:23 +00:00
ian
6bda1023a0 MFC r271097, r271100, r271101, r271102, r271124:
- Add a basic iomux driver for imx6.
 - Implement the same public interface in imx51 and imx6 iomux
 - The iomux driver is no longer optional, remove it from kernel configs.
 - Implement the imx_iomux_get/set_gpr() interface for imx6.
 - Stop setting the iomux device status to disabled, now that we have a driver.
2014-10-26 02:44:41 +00:00
ian
caa088c379 MFC r268973, r268977: Rename i.MX I2C driver file, enable it on imx6. 2014-10-26 02:40:34 +00:00
ian
bb76782ad5 MFC r268834, r268835:
o Enable GPIO device driver for i.MX6.
   It was originally written for i.MX5 and compatible with newer chip.
 o Extend device tree information
 o style(9) fixes
 o Rename gpio driver file.
2014-10-26 02:37:42 +00:00
ian
c691dc79ec MFC r271055, r271084, r271094:
Add a function to get the frequency of the AHB bus.  Another stopgap
  function until we have full clock support for imx6.

  The imx5x and imx6 chips have an onboard IOMUX device which also contains a
  few "general purpose registers" whose values control chip behavior in ways
  that have nothing to do with IO pin mux control.  Define a simple API that
  other soc-specific code can use to read and write the registers, and provide
  the imx51 implementation of them.

  Fix a typo.
2014-10-26 02:25:34 +00:00
ian
a50392e671 MFC r271054:
When built with FDT support, add /boot/dtb to the list of search directories.
2014-10-26 02:21:54 +00:00
ian
d41355d9bf MFC r270957, r270959:
Create an interface for drivers to enable or disable their clocks as listed
  in the clocks=<...> properties of their FDT data.
2014-10-26 02:19:03 +00:00
ian
04b1fcec06 MFC r270955,r270956: make the imx6 octop and anatop drivers early attachers. 2014-10-26 02:09:58 +00:00
ian
af8e847649 MFC r270953, r270958, r270960, r271190, r271199, r271202:
Create a mechanism for looking up a device_t associated with an ofw/fdt
  xref handle, and for registering that association.  Also use the same data
  for faster translations between node and xref handles.

  Add OF_xref_from_device() so that there's no need to have an intermediate
  call to ofw_bus_get_node() to lookup info that's already in the xreflist.

  When registering an association between a device and an xref phandle, create
  an entry in the xref list if one doesn't already exist for the given handle.
2014-10-26 01:58:18 +00:00
ian
1c8cde378e MFC r270945:
Rename OF_xref_phandle() to OF_node_from_xref() and add a new function
that provides the inverse translation, OF_xref_from_node().
2014-10-26 01:30:46 +00:00
ian
520f9702ad MFC r270025:
Implement the FDT static pinctl/pinmux spec for Atmel.
2014-10-26 01:26:53 +00:00
ian
f2e6118a3c MFC r257200, r259121, r261410, r265853:
- Remove #include <machine/frame.h>.
 - Add gpio parse routines according to sys/boot/fdt/dts/bindings-gpio.txt.
 - Follow r261352 by updating all drivers which are children of simplebus
   to check the status property in their probe routines.
 - Rename platform_gpio_init to be SoC specific, and make it static as it's
   only called from this file.

This is mostly catching up on some old MFCs that were done before this file
existed in the 10 branch.
2014-10-26 01:15:16 +00:00
ian
682138b2b9 MFC r268633, r271046:
Fixes and enhancements for the if_cgem driver...

  - miibus fixes as suggested by Yonghyeon Pyun.
  - enable VLAN MTU support.
  - fix a few WITNESS complaints in cgem_attach().
  - have cgem_attach() properly init the ifnet struct before calling
    mii_attach() to fix panic when using e1000phy.
  - fix ethernet address changing.
  - fix transmit queue overflow handling.
  - tweak receive queue handling to reduce receive overflows.
  - bring out MAC statistic counters to sysctls.
  - add e1000phy to config file.
  - implement receive hang work-around described in reference guide.
  - change device name from if_cgem to cgem to be consistent with other
    interfaces.

  Fix the Zedboard/Zynq ethernet driver to handle media speed changes so
  that it can connect to switches at speeds other than 1gb.
2014-10-25 20:34:10 +00:00
kevlo
0817d1234e MFC r273448:
Fix the kernel panic in hostap mode.
rvp->beacon_mbuf was NULL in run_update_beacon().

PR:	189405
Submitted by:	Gabor Simon <gabor.simon75 at gmail.com>
2014-10-25 15:06:09 +00:00
rpaulo
6e4e970c3a MFC r273261:
Remove an unused mutex.
2014-10-25 02:08:02 +00:00
rpaulo
22c57adcd5 MFC r273258:
Make the ti_mbox and ti_pruss drivers optional.
2014-10-25 02:06:40 +00:00
rpaulo
f85f42f997 MFC r273257:
Add a driver for the TI watchdog.

 The TI watchdog timer is present on BeagleBone's.  Since 2014, U-Boot
 has been booting the BeagleBone with the watchdog enabled.  We need
 to
 disable it on boot to avoid a spurious reset.
 The timer isn't exactly precise, but it will do as a watchdog.  This
 is also a reflection of the watchdog(9) API.

 In the future, we could handle interrupts, but the watchdog(9) API
 needs to be a bit smarter before that can happen.
2014-10-25 02:05:21 +00:00
rpaulo
dce313ba3c MFC r273256:
AM335X FDT: use the omap3-wdt string for compatibility with Linux.
2014-10-25 02:02:20 +00:00
rpaulo
709bb13e76 MFC r273248:
AM335x FDT: add an entry for the watchdog.
2014-10-25 02:00:32 +00:00
delphij
2455e6b607 MFC r273577:
Return BUS_PROBE_DEFAULT instead of BUS_PROBE_VENDOR or 0 for in-tree
driver.  This change was verified by Microsoft.

Instant MFC approved by:	re (kib)
2014-10-24 07:06:01 +00:00
neel
295105e2bd MFC r273356:
Fix a race in pmap_emulate_accessed_dirty() that could trigger a EPT
misconfiguration VM-exit.
2014-10-24 03:48:54 +00:00
dumbbell
5cd9154e6b vt(4): Refuse to load a font if hw.vga.textmode is selected
Before, the font was loaded and the window size recalculated, giving an
unusable terminal, even if the actual font didn't change.

Reported by:	beeessdee@ruggedinbox.com
MFC of:		r273330
2014-10-23 13:32:01 +00:00
mav
9d96d4ad45 MFC r273259:
Make VPD 80h (Serial Number) transfer length match serial number length.
2014-10-23 07:37:48 +00:00
mav
b118502c8f MFC r273163: Implement more functional CTL debug logging.
Setting bits in kern.cam.ctl.debug allows to log errors, commands and some
commands data respectively.
2014-10-23 07:36:33 +00:00
delphij
29bd84c81d MFC r272810: FV r272804:
Refactor the code and stop restore_object from creating two transactions.

Illumos issue:
    3693 restore_object uses at least two transactions to restore an object
2014-10-23 01:47:09 +00:00
delphij
7b171ea876 MFC r272809: MFV r272803:
Illumos issue:
    5175 implement dmu_read_uio_dbuf() to improve cached read performance
2014-10-23 01:40:31 +00:00
kib
eb3582e16f MFC r273132:
Style changes for deadfs.
2014-10-22 09:12:20 +00:00
kib
dc7923c136 MFC r273131:
When vnode bypass cannot be performed on the cdev file descriptor for
read/write/poll/ioctl, call standard vnode filedescriptor fop.
2014-10-22 09:09:41 +00:00
kib
6809e3fc35 MFC r273130:
Change the deadfs poll VOP to return POLLIN|POLLRDNORM if the caller
is interested in i/o state.  Return POLLNVAL for invalid bits, similar
to poll_no_poll().
2014-10-22 09:06:36 +00:00
kib
a9088c78cb MFC r273129:
Implement FIODTYPE for master ptys.
2014-10-22 09:04:56 +00:00
bryanv
0895e1be7f MFC r272573:
Change the UMA mutex into a rwlock

  Acquire the lock in read mode when just needed to ensure the stability
  of the keg list. The UMA lock may be held for a long time (relatively
  speaking) in uma_reclaim() on machines with lots of zones/kegs. If the
  uma_timeout() would fire during that period, subsequent callouts on that
  CPU may be significantly delayed.
2014-10-22 04:09:47 +00:00
bryanv
137a650c11 MFC r272796:
Add M_FLOWID to M_COPYFLAGS

The M_FLOWID flag should be propagated to the new mbuf pkthdr in
m_move_pkthdr() and m_dup_pkthdr(). The new mbuf already got the
existing flowid value, but would be ignored since the flag was
not set.
2014-10-22 04:01:27 +00:00
gjb
628635adcd Bump __FreeBSD_version to track SA-14:20, SA-14:21, SA-14:22,
SA-14:23

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-10-21 21:37:53 +00:00
gjb
9ec3090c92 MFC r273402:
Fix an issue where a FreeBSD virtual machine provisioned in
  the Microsoft Azure service does not recognize the second
  attached disk on the system.

PR:		194376
Insta-MFC OK:	re (rodrigc)
Sponsored by:	The FreeBSD Foundation
2014-10-21 21:27:13 +00:00
delphij
86df2c268f Fix rtsold(8) remote buffer overflow vulnerability. [SA-14:20]
Fix memory leak in sandboxed namei lookup. [SA-14:22]
2014-10-21 20:20:07 +00:00
brueffer
7fce188e08 MFC: r273034
Add one more AMD Kaveri APU device ID.

Submitted by:	Remy Nonnenmacher <remy.nonnenmacher@activnetworks.com>
2014-10-21 13:07:36 +00:00
hselasky
2e713a4fa0 MFC r272683:
- Fix compile warning when compiling with GCC.
- Add missed chunk in previous driver code MFC.

Sponsored by:	Mellanox Technologies
2014-10-21 08:24:12 +00:00
yongari
7595869074 MFC r272730,273018:
Add support for QAC AR816x/AR817x Gigabit/Fast Ethernet controllers.
  These controllers seem to have the same feature of AR813x/AR815x and
  improved RSS support(4 TX queues and 8 RX queues).  alc(4) supports
  all hardware features except RSS.  I didn't implement RX checksum
  offloading for AR816x/AR817x just because I couldn't get
  confirmation from the Vendor whether AR816x/AR817x corrected its
  predecessor's RX checksum offloading bug on fragmented packets.
  This change adds supports for the following controllers.
   o AR8161 PCIe Gigabit Ethernet controller
   o AR8162 PCIe Fast Ethernet controller
   o AR8171 PCIe Gigabit Ethernet controller
   o AR8172 PCIe Fast Ethernet controller
   o Killer E2200 Gigabit Ethernet controller

  Relnotes:	yes
2014-10-21 04:48:49 +00:00
yongari
b882f9e15f MFC r272729,272732:
Add new quirk PCI_QUIRK_MSI_INTX_BUG to pci(4).
  QAC AR816x/E2200 controller has a silicon bug that MSI interrupt
  does not assert if PCIM_CMD_INTxDIS bit of command register is set.
2014-10-21 01:48:19 +00:00
yongari
b037cdf3ed MFC r272721:
Fix a long standing bug in MAC statistics register access.  One
  additional register was erroneously added in the MAC register set
  such that 7 TX statistics counters were wrong.
2014-10-21 01:14:56 +00:00
delphij
b12ccdd7ac MFC r272601: MFV r272591:
Use loaned ARC buffer for zfs receive to avoid copy.

Illumos issue:
    5162 zfs recv should use loaned arc buffer to avoid copy
2014-10-20 22:22:39 +00:00
delphij
e02ec23db8 MFC r272598: MFV r272585:
Split the godfather zio into CPU number's to reduce lock
contention.

Illumos issue:
    5176 lock contention on godfather zio
2014-10-20 22:13:50 +00:00
delphij
6bc23f0b46 MFC r272584: MFV r272501:
Illumos issue:
    5177 remove dead code from dsl_scan.c
2014-10-20 22:09:30 +00:00
delphij
5e5e0768f2 MFC r272511: MFV r272499:
Illumos issue:
    5174 add sdt probe for blocked read in dbuf_read()
2014-10-20 22:04:49 +00:00
delphij
cc4935ee8d MFC r272510: MFV r272498:
Add a new sysctl, vfs.zfs.vol.unmap_enabled, which allows the system
administrator to toggle whether ZFS should ignore UNMAP requests.

Illumos issue:
    5149 zvols need a way to ignore DKIOCFREE
2014-10-20 21:59:11 +00:00
delphij
ac9149e73f MFC r272507: MFV r272496:
Add tunable for number of metaslabs per vdev
(vfs.zfs.vdev.metaslabs_per_vdev).  The default remains
at 200.

Illumos issue:
    5161 add tunable for number of metaslabs per vdev
2014-10-20 21:53:51 +00:00
delphij
c02aa9ff18 MFC r272504: MFV r272494:
Make space_map_truncate() always do space_map_reallocate().  Without
this, setting space_map_max_blksz would cause panic for existing pool,
as dmu_objset_set_blocksize would fail if the object have multiple blocks.

Illumos issues:
   5164 space_map_max_blksz causes panic, does not work
   5165 zdb fails assertion when run on pool with recently-enabled
	spacemap_histogram feature
2014-10-20 18:58:45 +00:00
mav
173113fe4e MFC r273072: Add LBPERE mode bit definition. 2014-10-20 08:09:36 +00:00
mav
ad16b79ee7 MFC r273046:
Don't confuse frontend with zero length data moves, just return immediately.
2014-10-20 08:08:43 +00:00
mav
7cb7c8f153 MFC r273038: Add support for READ DEFECT DATA (10/12) commands.
SPC-4 r2 allows to return empty defect list if the list is not supported.
We don't reallu support defect data lists, but this suppresses some errors.
2014-10-20 08:07:29 +00:00
mav
9281ac4831 MFC r273029:
Report physical block size for file-backed LUNs, using vattr.va_blocksize.
2014-10-20 08:06:17 +00:00
mav
d6db3716e1 MFC r273008: Remove stale comments. 2014-10-20 08:04:46 +00:00
mav
d8647fe277 MFC r272978: Improve and document ctladm portlist subcommand.
Make this subcommand less FC-specific, reporting target and port addresses
in more generic way.  Also make it report list of connected initiators in
unified way, working for both FC and iSCSI, and potentially others.
2014-10-20 08:03:23 +00:00
mav
deb98691d8 MFC r272947: Give physical and virtual ports numbers some more meaning. 2014-10-20 07:59:29 +00:00
mav
d9f8df105f MFC r272939: Shorten frontend name. 2014-10-20 07:58:01 +00:00
mav
e2ad56a41d MFC r272938: Filter out duplicate AC_PATH_REGISTERED async events.
Queued async events handling in CAM opened race, that may lead to duplicate
AC_PATH_REGISTERED events delivery during boot.  That was not happening
before r272935 because the driver was initialized later.  After that change
it started create duplicate ports in CTL.
2014-10-20 07:57:07 +00:00
mav
a0796a04ee MFC r272935: Mark CTL frontend's CAM driver as CAM_PERIPH_DRV_EARLY.
Target mode operation does not depend on the initiator mode scan process.
This change allows the target driver to attach earlier and receive some
async events (like AC_CONTRACT) that could be lost otherwise.
2014-10-20 07:52:48 +00:00
mav
b61a1b5706 MFC r272911:
Make ctld start even if some LUNs are unable to open backing storage.

Such LUNs will be visible to initiators, but return "not ready" status
on media access commands.  If backing storage become available later,
`ctladm modify ...` or `service ctld reload` can trigger its reopen.
2014-10-20 07:41:37 +00:00
mav
db78e6d004 MFC r272893:
Store persistent reservation keys as uint64_t instead of uint8_t[8].

This allows to simplify the code and save 512KB of RAM per LUN (8%)
by removing no longer needed "registered" keys flags.
2014-10-20 07:38:36 +00:00
mav
5889805f1c MFC r272812: Make iSCSI connection close somewhat less aggressive.
It allows to push out some final data from the send queue to the socket
before its close.  In particular, it increases chances for logout response
to be delivered to the initiator.
2014-10-20 07:35:46 +00:00
mav
cc6cca3f1e MFC r272748:
Implement software (mode page) and hardware (config) write protection.
2014-10-20 07:34:37 +00:00
mav
29253fce18 MFC r272734:
Add support for WRITE ATOMIC (16) command and report SBC-4 compliance.

Atomic writes are only supported for ZVOLs in "dev" mode.  In other cases
atomicity can not be guarantied and so the command is blocked.
2014-10-20 07:33:41 +00:00
mav
f7c3270824 MFC r272613:
Add support for MaxBurstLength and Expected Data transfer Length parameters.

Before this change target could send R2T request for write transfer of any
size, that could violate iSCSI RFC, which allows initiator to limit maximum
R2T size by negotiating MaxBurstLength connection parameter.

Also report an error in case of write underflow, when initiator provides
less data than initiator expects.  Previously in such case our target
sent R2T request for non-existing data, violating the RFC, and confusing
some initiators.  SCSI specs don't explicitly define how write underflows
should be handled and there are different oppinions, but reporting error
is hopefully better then violating iSCSI RFC with unpredictable results.
2014-10-20 07:32:33 +00:00
mav
5b5dd1452a MFC r272597: Fix length of Extended INQUIRY Data VPD page. 2014-10-20 07:31:23 +00:00
mav
df2c4c17fc MFC r271718 (by bdrewery): Correct a comment 2014-10-20 07:29:43 +00:00
mav
072d9b12ca MFC r271395 (by trasz):
Make sure we handle less than zero timeouts in iSCSI initiator and target
in a reasonable way.

Sponsored by:	The FreeBSD Foundation
2014-10-20 07:28:18 +00:00
yongari
7aaab4b0ed MFC r271073:
Do not blindly announce 1000baseT half-duplex capability in
  autonegotiation.  Some controllers like cgem(4) do not support
  half-duplex at gigabit speeds.
2014-10-20 07:25:57 +00:00
rpaulo
1a4e934f15 MFC r271975:
Improvements to asmc(4):

 1. changed the code so that 2**16 keys are supported
 2. changed the number of possible fans in a system from 2 to 6
 3. added write support for some fan sysctls
 4. added a new sysctl which shows the ID of the fan
 5. added four more apple models with their temperature keys
 6. changed the maxnumber of temperature keys from 36 to 80
 7. replaced several fixed buf sizes to sizeof buf

 Obtained from:	     Denis Ahrens denis at h3q.com
2014-10-20 04:42:28 +00:00
emaste
ae8c60e6aa MFC r273219: Do nothing in vt_upgrade if there is no vt driver
Previously, if no drivers attached at boot we would panic with
  "vtbuf_fill_locked begin.tp_row 0 must be < screen height 0".

PR:		192248
2014-10-20 01:01:55 +00:00
tuexen
84b9f624de MFC 273168:
Fix the reported streams in a SCTP_STREAM_RESET_EVENT, if a
sent incoming stream reset request was responded with failed
or denied.
Thanks to Peter Bostroem from Google for reporting the issue.
2014-10-19 11:31:23 +00:00
mav
7f2e56c17d MFC r273143: Remove setting BIO_DONE flag for BIOs that have done() method.
This fixes use-after-free, caused by geom_disk, completing same BIO twice
to save extra allocation, and getting BIO_DONE set after the first.
2014-10-19 08:47:27 +00:00
pfg
f2b9523abe MFC r272958, r273006:
ddb: space/tab fixes and ANSI-fy function declarations.

No functional change.
2014-10-18 19:22:59 +00:00
kib
fafa0f4166 MFC r272952:
Do not set IN_ACCESS flag for read-only mounts.
2014-10-18 15:31:53 +00:00
kib
08803fec5e MFC r272534:
Add IO_RANGELOCKED flag for vn_rdwr(9), which specifies that vnode is
not locked, but range is.
2014-10-18 15:28:01 +00:00
hselasky
09684679cf MFC r273135:
Update the OFED Linux compatibility layer and
Mellanox hardware driver(s):

- Properly name an inclusion guard
- Fix compile warnings regarding unsigned enums
- Add two new sysctl nodes
- Remove all empty linux header files
- Make an error printout more verbose
- Use "mod_delayed_work()" instead of
  cancelling and starting a timeout.
- Implement more Linux scatterlist
  functions.

Sponsored by:	Mellanox Technologies
2014-10-18 07:07:34 +00:00
adrian
31d0e366f3 MFC r273112: Set the DROP_EN bit before the RX queue is brought up and active.
He noticed issues setting this bit in SRRCTL after the queue was up,
so doing it from the sysctl handler isn't enough and may not actually
work correctly.

This commit doesn't remove the sysctl path or try to change its
behaviour.  I'll talk with others about how to finish fixing that
before I tackle that.

PR:           kern/194311
Submitted by: luigi
MFC after:    3 days
Sponsored by: Norse Corp, Inc
2014-10-18 01:02:30 +00:00
jhb
c8f54eb474 MFC 272449:
Require p_cansched() for changing a process' protection status via
procctl() rather than p_cansee().
2014-10-17 19:28:21 +00:00
jhb
b183e8b3c4 MFC 272182:
Don't panic if a resource is allocated twice.  Instead, print a warning and
fail the allocation request.  Allocations of "reserved" resources such as
PCI BARs already fail the request instead of panic'ing in this case.
2014-10-17 15:29:47 +00:00
delphij
4b803d9674 MFC r272583: MFV r272500:
Don't inherit flags other than DS_FLAG_CI_DATASET and DS_FLAG_INCONSISTENT
when cloning.  This prevents DS_FLAG_DEFER_DESTROY being inherited from a
clone that is marked for deferred destroy, which causes snapshots of the
clone being destroyed when getting a hold or clone.

Illumos issue:
    5150 zfs clone of a defer_destroy snapshot causes strangeness
2014-10-16 22:44:30 +00:00
delphij
0615551739 MFC r272527:
Don't make nested definition for range_seg_cache.

Reported by:	ian
2014-10-16 22:40:22 +00:00
delphij
6fe321f152 MFC r272506: MFV r272495:
In arc_kmem_reap_now(), reap range_seg_cache too to reclaim memory in
response of memory pressure.

Illumos issue:
    5163 arc should reap range_seg_cache
2014-10-16 22:33:09 +00:00
delphij
9f9b89ac40 MFV r273060:
Use write_psize instead of write_asize when doing vdev_space_update.
Without this change the accounting of L2ARC usage would be wrong and
give 16EB free space because the number became negative and overflows.

Obtained from:  FreeNAS (issue #6239)
2014-10-16 22:12:23 +00:00
glebius
9ea3e68626 Merge r272385 by melifaro from head:
Free radix mask entries on main radix destroy.
  This is temporary commit to be merged to 10.
  Other approach (like hash table) should be used
  to store different masks.

PR:             194078
2014-10-16 20:46:02 +00:00
glebius
86f98e492e Merge r272358 from head:
Use rn_detachhead() instead of direct free(9) for radix tables.
2014-10-16 20:43:12 +00:00
smh
d66b9a9949 MFC r273158:
Prevent ZFS leaking pool free space

Early MFC approved by re@

Approved by:	re@ (glebius)
Sponsored by:	Multiplay
2014-10-16 08:33:11 +00:00
jkim
d37b3c75ad MFC: r272718
Make kern.nswbuf tunable from loader.
2014-10-15 20:04:21 +00:00
kib
92c5a45b89 MFC r272761:
Add an argument to the x86 pmap_invalidate_cache_range() to request
forced invalidation of the cache range regardless of the presence of
self-snoop feature.

MFC r272943:
MFi386 r272761.
2014-10-15 14:07:24 +00:00
mav
3c28f63ca3 MFC r272756: Properly report 12Gbps connection rate.
Reviewed by:	kadesai, slm
2014-10-15 08:03:12 +00:00
ae
1dfece27ff MFC r272749:
Fix comment.
2014-10-15 04:34:07 +00:00
pfg
ca6df600d4 MFC r267851:
Continue the crusade towards a dev_clone()-free kernel, removing its
usage from dtrace. The dtrace code already uses cdevpriv(9) since FreeBSD
8, so this change is quite harmless.

Originally by:	davide
Reviewed by:	markj
2014-10-14 23:16:52 +00:00
mjg
6eb4db1c33 MFC r269023,r272503,r272505,r272523,r272567,r272569,r272574
Prepare fget_unlocked for reading fd table only once.

Some capsicum functions accept fdp + fd and lookup fde based on that.
Add variants which accept fde.

===============================

Add sequence counters with memory barriers.

Current implementation is somewhat simplistic and hackish,
will be improved later after possible memory barrier overhaul.

===============================

Plug capability races.

fp and appropriate capability lookups were not atomic, which could result in
improper capabilities being checked.

This could result either in protection bypass or in a spurious ENOTCAPABLE.

Make fp + capability check atomic with the help of sequence counters.

===============================

Put and #ifdef _KERNEL around the #include for opt_capsicum.h to
hopefully allow the build to finish after r272505.

===============================

filedesc: fix up breakage introduced in 272505

Include sequence counter supports incoditionally [1]. This fixes reprted build
problems with e.g. nvidia driver due to missing opt_capsicum.h.

Replace fishy looking sizeof with offsetof. Make fde_seq the last member in
order to simplify calculations.

===============================

Keep struct filedescent comments within 80-char limit.

===============================

seq_t needs to be visible to userspace
2014-10-14 21:19:23 +00:00
mav
2cb46b9c51 MFC r271588: Update CAM CCB accounting for the new status quo.
devq_openings counter lost its meaning after allocation queues has gone.
held counter is still meaningful, but problematic to update due to separate
locking of CCB allocation and queuing.

To fix that replace devq_openings counter with allocated counter.  held is
now calculated on request as difference between number of allocated, queued
and active CCBs.
2014-10-14 12:13:01 +00:00
delphij
02d8987f8d Fix a missed merge introduced in r272883. 2014-10-13 18:46:30 +00:00
kib
9a0f569181 MFC r272907:
Make MAP_NOSYNC handling in the vm_fault() read-locked object path
compatible with write-locked path.
2014-10-13 15:58:03 +00:00
dumbbell
b366d41790 vt(4): Don't recalculate buffer size if we don't know screen size
(MFC of r272537)

When the screen size is unknown, it's set to 0x0. We can't use that as
the buffer size, otherwise, functions such as vtbuf_fill() will fail.

This fixes a panic on RaspberryPi, where there's no vt(4) backend
configured early in boot.

PR:		193981
Tested by:	danilo@
2014-10-13 14:40:00 +00:00
dumbbell
6981999a42 vt(4): Save/restore keyboard mode & LED states when switching window
(MFC of r272416)

Add new functions to manipulate these mode & state, instead of calling
kbdd_ioctl() everyhere.

This fixes at least two bugs:

    1. The state of the Scroll Lock LED and the state of scroll mode
       could be out-of-sync. For instance, if one enables scroll mode on
       window #1 and switches to window #2, the LED would remain on, but
       the window wouldn't be in scroll mode.

       Similarily, when switching between a console and an X.Org
       session, the LED states could be inconsistent with the real
       state.

    2. When exiting from an X.Org session, the user could be unable to
       type anything. The workaround was to switch to another console
       window and come back.

Differential Revision:	https://reviews.freebsd.org/D821
Reviewed by:	ray@
Approved by:	ray@
Tested by:	kwm@
2014-10-13 13:50:51 +00:00
tuexen
ed67dea7a4 MFC r272841:
Ensure that the flags field of sctp_tmit_chunks is initialized.
Thanks to Peter Bostroem from Google for reporting the issue.
2014-10-12 17:45:22 +00:00
tuexen
b0912548c1 MFC r272751:
Ensure that the list of streams sent in a stream reset parameter fits
in an mbuf-cluster.
Thanks to Peter Bostroem for drawing my attention to this part of the code.
2014-10-12 17:42:32 +00:00
tuexen
85569fa02c MFC r272750:
Ensure that the number of stream reported in srs_number_streams is
consistent with the amount of data provided in the SCTP_RESET_STREAMS
socket option.
Thanks to Peter Bostroem from Google for drawing my attention to
this part of the code.
2014-10-12 17:39:37 +00:00
tuexen
4f377875d1 MFC r272571:
Remove unused MC_ALIGN macro as suggested by Robert.
2014-10-12 17:36:41 +00:00
cy
b41a810b86 MFC r272555
ipfilter bug #537 NAT rules with sticky have incorrect hostmap IP address.
This fixes when an IP address mapping is put in the hostmap table for
sticky NAT rules, it ends up having the wrong byte order.

Obtained from:	ipfilter CVS repo (r1.102), NetBSD CVS repo (r1.12)
2014-10-12 17:21:15 +00:00
cy
a223c6d9ec MFC r272554
ipfilter bug #534 destination list hashing not endian neutral

Obtained from:	ipfilter CVS repo (r1.26), NetBSD CVS repo (r1.8)
2014-10-12 17:19:11 +00:00
cy
159eb60806 MFC r272553
ipfilter bug #538 ipf_p_dns_del should return void

Obtained from:	ipfilter cvs repo (r1.8)
2014-10-12 17:17:19 +00:00
cy
647905f29a MFC r272552
ipfilter bug #554 Determining why a ipf rule matches is hard -- replace
ipfilter rule compare with new ipf_rule_compare() function.

Obtained from:	ipfilter CVS rep (r1.129)
2014-10-12 17:15:20 +00:00
cy
fea983df78 MFC r272551
ipfiler bug #550 filter rule list corrupted with inserted rules

Obtained from:	ipfilter CVS repo (r1.128); NetBSD CVS repo (r1.15)
2014-10-12 17:13:14 +00:00
cy
d487341bd7 MFC r272052
ipfilter bug #558 add in some missing frag table function comments.

Obtained from:	ipfilter CVS repo (r1.36)
2014-10-12 17:10:44 +00:00
cy
c5a5359e13 MFC r271980
Check for NULL before de-refencing; in particular sel is assigned to NULL,
in the default case, and then couple of lines down we do sel->

Obtained from:	NetBSD CVS repo (r1.5)
2014-10-12 17:08:44 +00:00
mav
a45382b275 Use proper variable when looping through periphs with CAM_PERIPH_FREE.
PR:		194256
Submitted by:	Scott M. Ferris <smferris@gmail.com>
Sponsored by:	EMC/Isilon Storage Division
2014-10-12 06:14:50 +00:00
adrian
7f559d779a MFC r271784 - Fix the handling of EOP in status descriptors for if_igb(4)
and don't double-free mbufs.

Like ixgbe(4) chipsets, EOP is only set on the final descriptor
in a chain of descriptors.  So, to free the whole list of descriptors,
we should free the current slot _and_ the assembled list of descriptors
that make up the fragment list.

The existing code was setting discard once it saw EOP + an error status;
it then freed all the subsequent descriptors until the next EOP. That's
totally the wrong order.
2014-10-11 22:13:24 +00:00
adrian
5995ee9a98 MFC r271645 - Set DROP_EN on each RX queue if transmit flow-control is disabled.
This allows the NIC to drop frames on the receive queue and not
cause the MAC to block on receiving to _any_ queue.

Tested:

igb0@pci0:5:0:0:        class=0x020000 card=0x152115d9 chip=0x15218086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'I350 Gigabit Network Connection'
    class      = network
    subclass   = ethernet

Discussed with: Eric Joyner <eric.joyner@intel.com>
MFC after:    1 week
Sponsored by: Norse Corp, Inc.
2014-10-11 22:12:24 +00:00
adrian
d090f32bd0 MFC r271649 - Disable flow-director support until it's been debugged
and verified.

The flowdirector feature shares on-chip memory with other things
such as the RX buffers.  In theory it should be configured in a way
that doesn't interfere with the rest of operation.  In practice,
the RX buffer calculation didn't take the flow-director allocation
into account and there'd be overlap.  This lead to various garbage
frames being received containing what looks like internal NIC state.

What _I_ saw was traffic ending up in the wrong RX queues.
If I was doing a UDP traffic test with only one NIC ring receiving
traffic, everything is fine.  If I fired up a second UDP stream
which came in on another ring, there'd be a few percent of traffic
from both rings ending up in the wrong ring.  Ie, the RSS hash would
indicate it was supposed to come in ring X, but it'd come in ring Y.

However, when the allocation was fixed up, the developers at Verisign
still saw traffic stalls.

The flowdirector feature ends up fiddling with the NIC to do various
attempts at load balancing connections by populating flow table rules
based on sampled traffic.  It's likely that all of that has to be
carefully reviewed and made less "magic".

So for now the flow director feature is disabled (which fixes both
what I was seeing and what they were seeing) until it's all much
more debugged and verified.

Tested:

* (me) 82599EB 2x10G NIC, RSS UDP testing.
* (verisign) not sure on the NIC (but likely 82599), 100k-200k/sec TCP
  transaction tests.

Submitted by: Marc De La Gueronniere <mdelagueronniere@verisign.com>
Sponsored by: Verisign, Inc.
2014-10-11 22:10:39 +00:00
adrian
d927fae9b7 MFC r271648 - The error bits are not valid with EOP=0; so intermediary
fragments should not be discarded.

Submitted by: Marc De La Gueronniere <mdelagueronniere@verisign.com>
Sponsored by: Verisign, Inc.
2014-10-11 22:09:46 +00:00
adrian
8128ee7851 Merge r271647 - Fix a double-free of mbufs in rx_ixgbe_discard().
fmp->buf at the free point is already part of the chain being freed,
  so double-freeing is counter-productive.

Submitted by:	Marc De La Gueronniere <mdelagueronniere@verisign.com>
Sponsored by:	Verisign, Inc.
2014-10-11 22:08:53 +00:00
kib
82d8b580fd MFC r272538:
Slightly reword comment.  Move code, which is described by the
comment, after it.
2014-10-11 18:01:09 +00:00
kib
149982a012 MFC r272536:
Add kernel option KSTACK_USAGE_PROF.
2014-10-11 17:49:51 +00:00
gjb
d9503cbf77 Switch stable/10 back to -PRERELEASE now that releng/10.1 is
branched.

Sponsored by:	The FreeBSD Foundation
2014-10-11 16:16:05 +00:00
ae
cd29b4a4d0 MFC r272487:
Add UUID of FreeBSD slice to GPT scheme.
2014-10-11 06:04:44 +00:00
jhb
5595ee4003 MFC 270828,271487,271495:
Add sysctls to export the BIOS SMAP and EFI memory maps along with
handlers in the sysctl(8) binary to format them.
2014-10-10 20:47:23 +00:00
bz
42c3399b29 MFC r272713:
Since introducing the extra mapping in r250103 (head) for architectural performance
 events we have actually counted 'Branch Instruction Retired' when people
 asked for 'Unhalted core cycles' using the 'unhalted-core-cycles' event mask
 mnemonic.

 Reviewed by:		jimharris
 Discussed with:	gnn, rwatson
Sponsored by:		DARPA/AFRL
2014-10-10 12:02:34 +00:00
smh
4347b3c38b MFC r272474:
Fix various issues with zvols

Sponsored by:	Multiplay
2014-10-10 01:01:04 +00:00
smh
303356caa9 MFC r271589:
Added missing ZFS sysctls

This also includes small additional direct changes as it still uses the old
way of handling tunables.

Sponsored by:	Multiplay
2014-10-10 00:51:23 +00:00
smh
b231fd93a0 MFC r271754:
Remove unused ZFS ARC functions

Sponsored by:	Multiplay
2014-10-10 00:28:19 +00:00
smh
7e6d3acc4d MFC r271802:
Add dtrace probe support for zfs SET_ERROR(..)

MFC r271873:
Fix static kernel build with options ZFS

MFC r271819:
Remove sys/types.h include as per style (9)

Sponsored by:	Multiplay
2014-10-10 00:26:00 +00:00
smh
227e064147 MFC r270759:
Refactor ZFS ARC reclaim logic to be more VM cooperative

MFC r270861:
Ensure that ZFS ARC free memory checks include cached pages

MFC r272483:
Refactor ZFS ARC reclaim checks and limits

Sponsored by:	Multiplay
2014-10-10 00:12:16 +00:00
hrs
fcd622891b MFC r271628:
Use generic SYSCTL_* macro instead of deprecated SYSCTL_VNET_*.
2014-10-09 23:46:17 +00:00
hrs
39888f6b56 MFC r271545, 271610:
Make net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, and
  net.inet.ip.process_options vnet-aware.
2014-10-09 23:45:26 +00:00
hrs
fee8b9f992 MFC r269054:
Fix EtherIP.  TOS field must be initialized when the inner protocol is
  PF_LINK, and multicast/broadcast flag should always be dropped because
  the outer protocol uses unicast even when the inner address is not for
  unicast.  It had been broken since r236951 when gif_output() started to
  use IFQ_HANDOFF().
2014-10-09 23:29:44 +00:00
hrs
ca07cfe57d MFC r266248:
Cancel DAD for an ifa when the ifp has ND6_IFF_IFDISABLED as early as
  possible and do not clear IN6_IFF_TENTATIVE.  If IFDISABLED was accidentally
  set after a DAD started, TENTATIVE could be cleared because no NA was
  received due to IFDISABLED, and as a result it could prevent DAD when
  manually clearing IFDISABLED after that.
2014-10-09 23:25:57 +00:00
hrs
30afda21ea MFC r266857:
- Add rwlock to struct dadq.  A panic could occur when a large number of
    addresses performed DAD at the same time.
2014-10-09 22:56:38 +00:00
mav
70056e5be9 MFC r272650: Set CAM_SIM_QUEUED flag before calling ctl_queue() to avoid race.
PR:		194128
Submitted by:	Scott M. Ferris <smferris@gmail.com>
Sponsored by:	EMC/Isilon Storage Division
2014-10-09 05:28:11 +00:00
ae
142c064467 MFC r271307:
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.
2014-10-09 02:49:33 +00:00
tuexen
5c61a9046a MFC r272706:
Fix a bug introduced in
https://svnweb.freebsd.org/base?view=revision&revision=272347
2014-10-08 15:45:15 +00:00
neel
a70300211f MFC r272270:
tty_rel_free() can be called more than once for the same tty so make sure
that the tty is dequeued from 'tty_list' only the first time.
2014-10-08 04:35:09 +00:00
bryanv
69c5e8194e MFC 272550:
Remove stray uma_mtx lock/unlock in zone_drain_wait()

  Callers of zone_drain_wait(M_WAITOK) do not need to hold (and were not)
  the uma_mtx, but we would attempt to unlock and relock the mutex if we
  had to sleep because the zone was already draining. The M_NOWAIT callers
  may hold the uma_mtx, but we do not sleep in that case.
2014-10-08 04:07:07 +00:00
avg
56f2d33977 MFC r271609: add gptzfsboot.8, zfsboot.8 and zfsloader.8 manual pages 2014-10-07 13:35:34 +00:00
ae
f7ad542948 MFC r272176:
Keep list of lagg ports sorted by if_index.
2014-10-07 07:52:47 +00:00
araujo
6b6a0e5b05 Make external NFS clients know when files have their attributes changed and
avoid cache the file's state indefinitely. The va_filerev is what is sent
to the client as the "change" attribute, the client is periodically fetching
the attributes and without this option the attribute remains as some garbage
value.

Phabric:	D905
Reported by:	Kevin Buhr <buhr@asaurus.net>
Reviewed by:	rmacklem, delphij
Approved by:	delphij
Obtained from:	r272467
Sponsored by:	QNAP Systems Inc.
2014-10-07 06:00:09 +00:00
asomers
f906790c87 MFC r265232
Fix a panic caused by doing "ifconfig -am" while a lagg is being destroyed.
The thread that is destroying the lagg has already set sc->sc_psc=NULL when
the "ifconfig -am" thread gets to lacp_req().  It tries to dereference
sc->sc_psc and panics.  The solution is for lacp_req() to check the value of
sc->sc_psc.  If NULL, harmlessly return an lacp_opreq structure full of
zeros.  Full details in GNATS.

PR:	189003
2014-10-06 23:17:01 +00:00
delphij
b754ead530 MFC r271532: MFV r271515:
Add a new tunable/sysctl, vfs.zfs.free_max_blocks, which can be used to
limit how many blocks can be free'ed before a new transaction group is
created.  The default is no limit (infinite), but we should probably have
a lower default, e.g. 100,000.

With this limit, we can guard against the case where ZFS could run out of
memory when destroying large numbers of blocks in a single transaction
group, as the entire DDT needs to be brought into memory.

Illumos issue:
    5138 add tunable for maximum number of blocks freed in one txg
2014-10-06 17:27:49 +00:00
tuexen
dcccd3d8ca MFC r272469:
UDP/IPv6 and UDPLite/IPv6 require a checksum. So check for it.
2014-10-06 17:14:31 +00:00
tuexen
ec9e40767d MFC r272408:
Check for UDP/IPv6 packets that the length in the UDP header is at least
the minimum. Make the check similar to the one for UDPLite/IPv6.
2014-10-06 17:12:03 +00:00
tuexen
01f551f619 MFC r272404:
Fix the checksum computation for UDPLite/IPv6. This requires the
usage of a function computing the checksum only over a part of the function.
Therefore introduce in6_cksum_partial() and implement in6_cksum() based
on that.
While there, ensure that the UDPLite packet contains at least enough bytes
to contain the header.
2014-10-06 17:08:19 +00:00
tuexen
88124f9e02 MFC r272347:
The default for UDPLITE_RECV_CSCOV is zero. RFC 3828 recommend
that this means full checksum coverage for received packets.
If an application is willing to accept packets with partial
coverage, it is expected to use the socket option and provide
the minimum coverage it accepts.
2014-10-06 17:04:26 +00:00
tuexen
ce3a76b52f MFC r272326:
UDPLite requires a checksum. Therefore, discard a received packet if
the checksum is 0.
2014-10-06 16:59:25 +00:00
mav
7da2f7e9ed MFC r269472: Do not retry on set of non-transient XCOPY errors. 2014-10-06 15:24:04 +00:00
mav
fd1b7bf16c MFC r269469: Do not retry token errors.
They are not going to disappear by themselves.
2014-10-06 15:23:12 +00:00
mav
6cd0342073 MFC r272308: Fix old iSCSI initiator to work with new CAM locking.
This switches code to using xpt_rescan() routine, irrelevant to locking.
Using xpt_action() directly requires knowledge about higher level locks,
that SIM does not need to have.

This code is obsolete, but that is not a reason to crash.
2014-10-06 15:11:08 +00:00
luigi
7db7c41fe7 MFC r272108: add missing file for building netmap as a module 2014-10-06 14:39:45 +00:00
mav
3d422a235e MFC r272355: Fix couple issues with ROD tokens content. 2014-10-06 13:34:12 +00:00
mav
65c4d40e1d MFC r272247:
Do not transfer unneeded training zero bytes in INQUIRY response.

It is an addition to r269631.
2014-10-06 13:33:22 +00:00
tuexen
952b4cb5f7 MFC r272323:
If the checksum coverage field in the UDPLITE header is the length
of the complete UDPLITE packet, the packet has full checksum coverage.
So fix the condition.
2014-10-06 13:32:30 +00:00