Commit Graph

205900 Commits

Author SHA1 Message Date
Conrad Meyer
55faae77fa in6_mc_get: Fix recursion on if_addr_lock on malloc failure
Analogously to r291040, in6_mc_get recurses on if_addr_lock if the
M_NOWAIT allocation fails.  The fix is the same.

Suggested by:	Andrey V. Elsukov
Reviewed by:	jhb (ip4 version)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4138 (ip4 version)
2015-11-19 00:27:26 +00:00
Craig Rodrigues
749f65e3e3 Use print as a function for Python 3 [PEP 3105]
Import print_function from the __future__ module
to activate this for Python 2.  This works as far back as Python 2.6.0a2:
   https://docs.python.org/2/library/__future__.html

[PEP 3105] https://www.python.org/dev/peps/pep-3105/
2015-11-19 00:01:52 +00:00
Conrad Meyer
3fbd30d495 in_getmulti: Fix recursion on if_addr_lock on malloc failure
When the M_NOWAIT allocation fails, we recurse the if_addr_lock trying
to clean up.  Reorder the cleanup after dropping the if_addr_lock.  The
obvious race is already possible between if_addmulti and IF_ADDR_WLOCK
above, so it must be ok.

Submitted by:	Ryan Libby <rlibby@gmail.com>
Reviewed by:	jhb
Found with:	M_NOWAIT failure injection testing
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4138
2015-11-18 23:53:13 +00:00
Enji Cooper
dc5c5b1da8 Do not print out errno if the call succeeded unexpectedly; this was a mistake
made in r290868

MFC after: 4 days
X-MFC with: r290563, r290868
Reported by: jilles
Sponsored by: EMC / Isilon Storage Division
2015-11-18 23:42:44 +00:00
Craig Rodrigues
aef675d879 Use 'in' instead of 'has_key()' for testing dictionary membership.
In PEP 0290, has_key() was deprecated in Python 2.2 and higher:
https://www.python.org/dev/peps/pep-0290/#testing-dictionary-membership
https://docs.python.org/2.2/whatsnew/node4.html

In Python 3, dict.has_key() was removed:
https://docs.python.org/3.0/whatsnew/3.0.html#builtins
2015-11-18 23:32:29 +00:00
Rick Macklem
69527b11bb The problem report was for a crash that happened when smbfs was
trying to do a mount. Given the backtrace,
it appears that the crash occurred when smb_vc_create() failed and then
called smb_vc_put() with vcp->vc_iod == NULL. smb_vc_put() subsequently
called smb_vc_disconnect() with vcp->vc_iod == NULL, causing the crash.
This patch adds a check for vcp->vc_iod != NULL in smb_vc_disconnect() to
avoid the crash. It also fixes the case in smb_vc_create() where
kproc_create() fails so that it destroys the mutexes and sets
vcp->vc_iod == NULL before free()'ing the iod structure.
The person who reported the PR tested the patch, but was not able
to reproduce the crash with or without the patch.

PR:		201912
Reviewed by:	jhb
MFC after:	2 weeks
2015-11-18 23:04:01 +00:00
Conrad Meyer
e90df06388 if_ntb: Reuse receive buffers correctly
Discard the unused rx_free_q.  Instead, reuse inputed packets by putting
them back on the *pend* queue after reinitialization.

If tx or rx handlers are unavailable, free mbufs rather than leaking
them.

With this change, if_ntb can receive more than 100
(NTB_QP_DEF_NUM_ENTRIES) packets.

Sponsored by:	EMC / Isilon Storage Division
2015-11-18 22:20:49 +00:00
Conrad Meyer
c95b032ec6 NTB: Expose 32-bit BAR limits to consumers
32-bit BARs can only address memory mapped in the low 32 bits of
physical RAM.  Expose this as a 'plimit' out parameter from
ntb_mw_get_range().

Fix if_ntb to allocate memory within this limit.

Sponsored by:	EMC / Isilon Storage Division
2015-11-18 22:20:40 +00:00
Conrad Meyer
4e1eea459a NTB: Mask off the low 12 bits of address/range registers
Sometimes they'll read spurious values (observed: 0xc on Broadwell-DE),
failing link negotiation.

Discussed with:	Dave Jiang, Allen Hubbe
Sponsored by:	EMC / Isilon Storage Division
2015-11-18 22:20:31 +00:00
Conrad Meyer
57ba792a67 ntb_hw: Add programmatic interface to enable/disable WC
Enable users to enable/disable WC on memory windows programmatically.

Sponsored by:	EMC / Isilon Storage Division
2015-11-18 22:20:21 +00:00
Conrad Meyer
3062870897 ntb_hw: Add tunable to disable write-combining
The tunable 'hw.ntb.enable_writecombine' may be set to zero to
administratively disable write combining the mapped NTB region.

Sponsored by:	EMC / Isilon Storage Division
2015-11-18 22:20:13 +00:00
Conrad Meyer
552573e11c NTB: Fix 32-bit BAR size validation
Sponsored by:	EMC / Isilon Storage Division
2015-11-18 22:20:04 +00:00
Conrad Meyer
30994d9192 if_ntb: Diff reduce with Linux
Use bus_space_write instead of (non-volatile) C pointer writes via an
iowrite32() shim in the same places as the Dual BSD/GPL Linux driver.

Update some types to fixed 32-bit sizes.

Sponsored by:	EMC / Isilon Storage Division
2015-11-18 22:19:55 +00:00
Bryan Drewery
dbf5bd502a META MODE: Fix changing what "MACHINE=host" means when computing dirdeps for include/.
The _SKIP_BUILD is used while computing DIRDEPS.  If MACHINE=host is passed in
then this logic was replacing 'MACHINE' with a literal value of the host arch,
which then caused the dirdeps graph to be wrong since it no longer had the
literal 'host' for any of include's dependencies.

This is a NOP currently since include/ is not usually built with MACHINE=host.

Sponsored by:	EMC / Isilon Storage Division
2015-11-18 21:39:58 +00:00
Bryan Drewery
20f680588a Remove unneeded libmd from bootstrap-tools (reverting r246784).
The bootstrap-tools are supposed to be host tools, which in most cases, use
host headers and libraries.  As such, directly including the src tree's headers
for libmd here causes the need to link libmd in since it will be built with
the new symbols (which /usr/lib/libmd.so) won't have unless it is new enough.
During the target build in buildworld the target headers are staged into
WORLDTMP and used via --sysroot, allowing the target xinstall to be built with
the new/target libmd.

The .PATH here was also not doing anything since xinstall does not use libmd
source files.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	2 weeks
2015-11-18 21:37:46 +00:00
Jilles Tjoelker
a5cb58abc8 sh: Fix ""$@, which should not use the special case for "$@".
"$@" should expand to no words if there are no positional parameters, but
""$@ should always expand to at least an empty word.
2015-11-18 21:09:03 +00:00
Roger Pau Monné
1522652230 xen: fix dropping bitmap IPIs during resume
Current Xen resume code clears all pending bitmap IPIs on resume, which is
not correct. Instead re-inject bitmap IPI vectors on resume to all CPUs in
order to acknowledge any pending bitmap IPIs.

Sponsored by:		Citrix Systems R&D
MFC after:		2 weeks
2015-11-18 18:11:19 +00:00
Roger Pau Monné
ea64b86f94 xen/intr: properly dispose event channels on resume
All event channels are torn down when performing a migration on Xen, make
sure all handlers are also removed and the event channel structure is
properly disposed so it can be reused.

Sponsored by:		Citrix Systems R&D
MFC after:		2 weeks
2015-11-18 18:10:28 +00:00
Roger Pau Monné
531cfe55e2 x86/intr: allow mutex recursion in intr_remove_handler
This is needed so interrupt handlers can be removed while the PIC is
resuming, it was previously not possible due to intr_resume holding the
intr_table_lock and intr_remove_handler recursing on it.

Sponsored by:		Citrix Systems R&D
Reviewed by:		kib (previous version)
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D4114
2015-11-18 18:09:49 +00:00
Bryan Drewery
6f42d16f43 Convert to SUBDIR.yes format.
Reviewed by:	imp
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4182
2015-11-18 17:52:38 +00:00
Nathan Whitehorn
686d2f317a Extend r270123 to run the brand info's header_supported() routine for
branded as well as unbranded binaries. This will be required to add
support for the new ELFv2 ABI on powerpc64, which is distinguished from
ELFv1 by the contents of the ELF header's flags field.

Reviewed by:	imp
MFC after:	2 weeks
2015-11-18 17:03:22 +00:00
Baptiste Daroussin
1300d6f134 Recommend only to remove the content of /usr/share/locale/ and not the directory
Add a missing full stop
2015-11-18 16:52:19 +00:00
Michal Meloun
bb12cf0137 ARM: Fix dma_dcache_sync() for early allocated memory.
Drivers can request DMA to buffers that are not in memory represented
in the vm page arrays. Because of this, store KVA of already mapped
buffer to synclist and use it in dma_dcache_sync().

Reviewed by:	jah
Approved by:	kib (mentor)
Differential Revision: https://reviews.freebsd.org/D4120
2015-11-18 16:07:01 +00:00
Jonathan T. Looney
cc2ccfbe20 Fix the date on the pmcstat(8) man page from r291016.
Approved by:	gnn (mentor)
MFC after:	1 month
X-MFC with:	r291016
Pointy hat to:	jtl
2015-11-18 15:12:24 +00:00
Jonathan T. Looney
465dadb59b Support a wider history counter in pmcstat(8) gmon output
pmcstat(8) contains an option to output sampling data in a gmon format
compatible with gprof(1). Currently, it uses the default histcounter,
which is an (unsigned short). With large sets of sampling data, it
is possible to overflow the maximum value provided by an (unsigned
short).

This change adds the -e argument to pmcstat. If -e and -g are both
specified, pmcstat will use a histcounter type of uint64_t.

Differential Revision:	https://reviews.freebsd.org/D4151
Reviewed by:	jhb, bjk
Approved by:	gnn (mentor)
MFC after:	1 month
Sponsored by:	Juniper Networks
2015-11-18 14:52:01 +00:00
Craig Rodrigues
fa3d9adad2 Temporarily comment out the libcrypt tests.
They are emitting characters which are triggering
a kyua bug which causes kyua to emit invalid XML.
This invalid XML is causing false failures in Jenkins.

On a separate note, kyua needs to be fixed with this:
  https://github.com/jmmv/kyua/pull/148
or something similar.
2015-11-18 13:19:34 +00:00
Alexander Motin
c61fdcb93c Simplify fabric tasting code.
Except cosmetic changes this removes fabric ports from our port database.
It is always firmware duty to manage them, so driver don't need to worry.
2015-11-18 12:39:20 +00:00
Alexander Motin
c5fd36edc7 Remove some confusions between loopid and nphdl.
Modern cards in most cases operate abstract port handles, that have no
any relation to real loop IDs.  Leave loopid used only where it really
goes about local loop IDs.

While there, fix few more cases where LUNs were still printed in decimal.
2015-11-18 11:14:59 +00:00
Steven Hartland
ca94d06e45 Document loader(8) dumpdev option
Add an entry for dumpdev environment variable to loader(8).

MFC after:	1 week
Sponsored by:	Multiplay
2015-11-18 09:42:36 +00:00
Adrian Chadd
e69ad1c9b3 Add the QCA9533 base configuration file and an example configuration
for the AP143.

Wifi doesn't work on the QCA9533 board, but basic ethernet/ethernet
and ethernet switch support does work.

The AP143 has 32MB RAM and 4MB flash, so this was tested with a USB
rootfs.

Tested:

* QCA9533v2, AP143 reference design board.
2015-11-18 06:25:25 +00:00
Adrian Chadd
e0fe7c958f uart(4) - make the 8250 uart baudrate tolerance build time tweakable.
It turns out on a 16550 w/ a 25MHz SoC reference clock you get a little
over 3% error at 115200 baud, which causes this to fail.

Just .. cope. Things cope these days.

Default to 30 (3.0%) as before, but allow UART_DEV_TOLERANCE_PCT to be
set at build time to change that.
2015-11-18 06:24:21 +00:00
Justin Hibbits
23a91f4561 Physical addresses for e500mc/e5500 are 36-bits, e6500 is 40-bits.
Increase BUS_SPACE_MAXADDR to allow for this.

Sponsored by:	Alex Perez/Inertial Computing
2015-11-18 02:18:14 +00:00
Justin Hibbits
5d89896cbf Add support for new LAW registers in QorIQ SoCs.
QorIQ SoCs (e5500 core, P5 family) have 2 BARs for local access windows, while
MPC85XX, and P1/P2 families use only a single BAR register.

This also adds the QORIQ_DPAA option, mutually exclusive to MPC85XX, to handle
this difference.

Obtained from:	Semihalf
Sponsored by:	Alex Perez/Inertial Computing
2015-11-18 01:54:19 +00:00
Allan Jude
a065797aa4 Add a kernel config for the Onion Omega
Small $25 IoT device, 400mhz Atheros cpu, Atheros WiFi and Ethernet
18 GPIOs, and support for Relay, Servo, and OLED expansion
https://onion.io/omega/

Reviewed by:	adrian
Approved by:	bapt (mentor)
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D4188
2015-11-17 21:02:27 +00:00
Steven Hartland
86787e8d97 Fix early kernel dump via dumpdev env
Setting the dumpdev via env e.g. loader.conf provides the ability to
configure the kernel dump device during early boot. When using this
g_io_getattr was returning EPERM due to cp->acr == 0.

Fix this by calling g_access to ensure we're a read consumer prior
to calling g_dev_setdumpdev.

MFC after:	2 weeks
Sponsored by:	Multiplay
2015-11-17 20:55:50 +00:00
Jung-uk Kim
fa4593b5c7 Simplify man-makefile-update target. 2015-11-17 20:47:16 +00:00
Baptiste Daroussin
3e8918911e mpsutil/mprutil: add flash subcommand
the flash subcommand allows to save/update firmware and bios for LSI Fusion-MPT
2/3 controllers (mps(4) and mpr(4))

Tested by:	allanjude
Reviewed by:	wblock (manpage)
Relnotes:	yes
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D4026
2015-11-17 20:42:59 +00:00
Bryan Drewery
7143303723 Fix dynamic IPv6 rules showing junk for non-specified address masks.
For example:
  00002      0         0 (19s) PARENT 1 tcp 10.10.0.5 0 <-> 0.0.0.0 0
  00002      4       412 (1s) LIMIT tcp 10.10.0.5 25848 <-> 10.10.0.7 22
  00002     10       777 (1s) LIMIT tcp 2001:894:5a24:653::503:1 52023 <-> 2001:894:5a24:653:ca0a:a9ff:fe04:3978 22
  00002      0         0 (17s) PARENT 1 tcp 2001:894:5a24:653::503:1 0 <-> 80f3:70d:23fe:ffff:1005:: 0

Fix this by zeroing the unused address, as is done for IPv4:
  00002     0         0 (18s) PARENT 1 tcp 10.10.0.5 0 <-> 0.0.0.0 0
  00002    36     14952 (1s) LIMIT tcp 10.10.0.5 25848 <-> 10.10.0.7 22
  00002     0         0 (0s) PARENT 1 tcp 2001:894:5a24:653::503:1 0 <-> :: 0
  00002     4       345 (274s) LIMIT tcp 2001:894:5a24:653::503:1 34131 <-> 2001:470:1f11:262:ca0a:a9ff:fe04:3978 22

MFC after:	2 weeks
2015-11-17 20:42:08 +00:00
Alexander Motin
92056a05e5 Register our FC4 Features in SNS. 2015-11-17 19:57:49 +00:00
Eitan Adler
02dcb6e0dd Fix two spelling errors 2015-11-17 19:43:40 +00:00
Baptiste Daroussin
10b5202edd Fix typo
Submitted by:	ngie
2015-11-17 19:40:48 +00:00
John Baldwin
40e2cc24b9 Move recently added entry above the "old" line. 2015-11-17 19:03:55 +00:00
Ulrich Spörlein
722fe0fcd9 Fix 'make depend' 2015-11-17 18:28:56 +00:00
Alexander Motin
955d53eedc Cosmetic addition to r290993. 2015-11-17 16:46:05 +00:00
Alexander Motin
b6bd5f7fc1 Unify and cleanup FC ports scan. 2015-11-17 16:33:46 +00:00
Nathan Whitehorn
4a38fe54fa Make native page table access endian-safe. Even on CPUs running in
little-endian mode, the hardware page table is big-endian. This is a
no-op on all currently supported systems.

MFC after:	1 month
2015-11-17 16:09:26 +00:00
Nathan Whitehorn
509142e189 Where appropriate, use the endian-flipping OF_getencprop() instead of
OF_getprop() to get encode-int encoded values from the OF tree. This is
a no-op at present, since all existing PowerPC ports are big-endian, but
it is a correctness improvement and will be required if we have a
little-endian kernel at some future point.

Where it is totally impossible for the code ever to be used on a
little-endian system (much of powerpc/powermac, for instance), I have not
necessarily made the appropriate changes.

MFC after:	1 month
2015-11-17 16:07:43 +00:00
Fabien Thomas
d6d3f24890 Implement the sadb_x_policy_priority field as it is done in Linux:
lower priority policies are inserted first.

Submitted by:	Emeric Poupon <emeric.poupon@stormshield.eu>
Reviewed by:	ae
Sponsored by:	Stormshield
2015-11-17 14:39:33 +00:00
Alexander Motin
6955aeb2c3 Off-by-one correctiont to r290980. 2015-11-17 14:22:56 +00:00
Alexander Motin
53c0eee354 Make firmware handle virtual ports SNS logins for us. 2015-11-17 14:13:55 +00:00