Commit Graph

208963 Commits

Author SHA1 Message Date
Sepherosa Ziehau
77394b18ab hyperv/channel: Add debug sysctl nodes for channel indices
It would serve as a debug tool, if the shared buffer ring's indices
stopped updating.

Submitted by:	HongJiang Zhang <honzhan microsoft com>
Reviewed by:	sephe, Jun Su <junsu microsoft com>
Modified by:	sephe
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5402
2016-02-29 05:24:29 +00:00
Sepherosa Ziehau
5fa2e9dd39 hyperv: Use proper fence function to keep store-load order for msgs
sfence only makes sure about the store-store order, which is not
sufficient here.  Use atomic_thread_fence_seq_cst() as suggested
jhb and kib (a locked op in the nutshell, which should have the

Reviewed by:	jhb, kib, Jun Su <junsu microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5436
2016-02-29 04:58:40 +00:00
Phil Shafer
f487b23214 Add entries for Phil Shafer (phil@)
Differential Revision: https://reviews.freebsd.org/D5246
Approved by: sjg (mentor)
2016-02-29 04:50:24 +00:00
Sepherosa Ziehau
1321c5029e buf_ring/drbr: Add buf_ring_peek_clear_sc and use it in drbr_peek
Unlike buf_ring_peek, it only supports single consumer mode, and it
clears the cons_head if DEBUG_BUFRING/INVARIANTS is defined.

The normal use case of drbr_peek for network drivers is:

m = drbr_peek(br);
err = hw_spec_encap(&m); /* could m_defrag/m_collapse */
(*)
if (err) {
    if (m == NULL)
        drbr_advance(br);
    else
        drbr_putback(br, m);
    /* break the loop */
}
drbr_advance(br);

The race is:
If hw_spec_encap() m_defrag or m_collapse the mbuf, i.e. the old mbuf
was freed, or like the Hyper-V's network driver, that transmission-
done does not even require the TX lock; then on the other CPU at the
(*) time, the freed mbuf could be recycled and being drbr_enqueue even
before the current CPU had the chance to call drbr_{advance,putback}.
This triggers a panic in drbr_enqueue duplicated element check, if
DEBUG_BUFRING/INVARIANTS is defined.

Use buf_ring_peek_clear_sc() in drbr_peek() to fix the above race.

This change is a NO-OP, if neither DEBUG_BUFRING nor INVARIANTS are
defined.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5416
2016-02-29 03:54:51 +00:00
Justin Hibbits
0aeed3e993 Add support for the Freescale dTSEC DPAA-based ethernet controller.
Freescale's QorIQ line includes a new ethernet controller, based on their
Datapath Acceleration Architecture (DPAA).  This uses a combination of a Frame
manager, Buffer manager, and Queue manager to improve performance across all
interfaces by being able to pass data directly between hardware acceleration
interfaces.

As part of this import, Freescale's Netcomm Software (ncsw) driver is imported.
This was an attempt by Freescale to create an OS-agnostic sub-driver for
managing the hardware, using shims to interface to the OS-specific APIs.  This
work was abandoned, and Freescale's primary work is in the Linux driver (dual
BSD/GPL license).  Hence, this was imported directly to sys/contrib, rather than
going through the vendor area.  Going forward, FreeBSD-specific changes may be
made to the ncsw code, diverging from the upstream in potentially incompatible
ways.  An alternative could be to import the Linux driver itself, using the
linuxKPI layer, as that would maintain parity with the vendor-maintained driver.
However, the Linux driver has not been evaluated for reliability yet, and may
have issues with the import, whereas the ncsw-based driver in this commit was
completed by Semihalf 4 years ago, and is very stable.

Other SoC modules based on DPAA, which could be added in the future:
* Security and Encryption engine (SEC4.x, SEC5.x)
* RAID engine

Additional work to be done:
* Implement polling mode
* Test vlan support
* Add support for the Pattern Matching Engine, which can do regular expression
  matching on packets.

This driver has been tested on the P5020 QorIQ SoC.  Others listed in the
dtsec(4) manual page are expected to work as the same DPAA engine is included in
all.

Obtained from:	Semihalf
Relnotes:	Yes
Sponsored by:	Alex Perez/Inertial Computing
2016-02-29 03:38:00 +00:00
Adrian Chadd
b258556759 Fix up the ath(4) device names for QCA chipsets.
Submitted by:	Tobias Kortkamp <t@tobik.me>
2016-02-29 02:40:58 +00:00
Pedro F. Giffuni
e81f248547 MFV r296159
Sync our libedit with NetBSD's libedit 2016-02-27.

Obtained from:	NetBSD
2016-02-29 00:15:25 +00:00
Andriy Voskoboinyk
067a92f8f4 urtwn: do not filter beacon frames in HOSTAP mode while scanning
urtwn_set_rx_bssid_all() will allow to receive beacons only
when they are not denied by filter.

Revealed by D5474.

Tested with RTL8188CUS, HOSTAP mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5477
2016-02-29 00:05:37 +00:00
Andriy Voskoboinyk
b6a21c5c8e etc/defaults/rc.conf: fix a typo (wlanddebug -> wlandebug)
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5480
2016-02-28 23:57:26 +00:00
Andriy Voskoboinyk
f10bbaa78c net80211: fix a comment for TX lock
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5476
2016-02-28 23:52:33 +00:00
Andriy Voskoboinyk
c6427be92b net80211: remove redundant locking.
All callers of ieee80211_promisc()/ieee80211_allmulti()
(ieee80211_vap_detach(), ieee80211_ioctl(), ap_start() and ap_end())
already hold the com_lock while calling them.

Tested with RTL8188EU, STA mode.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5475
2016-02-28 23:48:34 +00:00
Andriy Voskoboinyk
60d75eb64c net80211: fix 'taskqueue_drain with non-sleepable locks held' warning
Do not run ieee80211_waitfor_parent() when it's not needed.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5446
2016-02-28 23:35:03 +00:00
Jason Helfman
6cf621e08c - address obsolete Kerberos options
PR:		205168
Submitted by:	kevin@bostoncrypto.com
Reviewed by:	bjk
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D5430
2016-02-28 21:04:04 +00:00
Oleksandr Tymoshenko
d28956b489 Fix typo in device description
Spotted by: jmcneill
2016-02-28 19:39:00 +00:00
Konstantin Belousov
1bdbd70599 Implement process-shared locks support for libthr.so.3, without
breaking the ABI.  Special value is stored in the lock pointer to
indicate shared lock, and offline page in the shared memory is
allocated to store the actual lock.

Reviewed by:	vangyzen (previous version)
Discussed with:	deischen, emaste, jhb, rwatson,
	Martin Simmons <martin@lispworks.com>
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
2016-02-28 17:52:33 +00:00
Jared McNeill
3f3af790f9 Add Allwinner A10/A20 RTC driver.
Submitted by:		Vladimir Belian <fate10@gmail.com>
Reviewed by:		andrew, imp, jmcneill
Approved by:		gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D5414
2016-02-28 17:42:27 +00:00
Pedro F. Giffuni
4593a7cde5 Import libedit 2016-02-27
Obtained from:	NetBSD
2016-02-28 15:57:37 +00:00
Andrew Turner
a19c0b37e9 Add SMP support to the ARM PLATFORM code. This will allow us to have
different methods to start the secondary cores in a kernel built for
multiple SoCs, e.g. with the Allwinner A20 and A31.

Sponsored by:	ABT systems Ltd
Differential Revision:	https://reviews.freebsd.org/D5466
2016-02-28 13:43:58 +00:00
Edward Tomasz Napierala
0fc124ccdd Fix .Xr - autofs(5) is section 5, not 8.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-28 10:40:09 +00:00
Edward Tomasz Napierala
75e5511214 Add speed limit to dd(1). This is useful for testing RCTL disk io limits
(when they actually get committed, that is), and might also come in handy
in other situations.

Reviewed by:	wblock@ (man page)
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-02-28 10:27:12 +00:00
Andrew Turner
8d88b09320 Build ofw_cpu.c on all ARM configs using FDT. As we mve towards using the
Linux dts files these are more likely to have cpu nodes we can attach to.

Sponsored by:	ABT Systems Ltd
2016-02-28 09:35:37 +00:00
Adrian Chadd
f0ea23b254 Migrate athregs over to use the new stats API. 2016-02-28 06:30:39 +00:00
Adrian Chadd
4f0edd39f8 Migrate athstats to use the new stats API. 2016-02-28 06:29:25 +00:00
Adrian Chadd
05ec4b5267 Begin abstracting out the access method for ath(4) ioctls.
Each of the ath* commands do their own direct socket/ioctl calls,
which makes it difficult to forklift upgrade things.

So, this is the beginning of abstracting out the stats API calls
in the hope that I can migrate things to use a /dev/athX file for
ioctls and use a more general interface.

Tested:

* QCA9565 NIC, STA mode
2016-02-28 06:29:07 +00:00
Ed Maste
9a5ed09660 Sort subdirectories in BSD.debug.dist 2016-02-28 00:24:13 +00:00
Jason Unovitch
3b2a0d99af - Add myself to ports-secteam
Approved by:    delphij, miwi, feld
2016-02-27 23:39:59 +00:00
Jared McNeill
ce6507d3d9 Fix PIO mode on A31 and later SoCs.
Newer Allwinner MMC implementations use a different FIFO register offset
(0x200 instead of 0x100). Since the FDT uses the same compat string for
both cases, base the decision on which FIFO offset to use on the Allwinner
SoC family.

Reviewed by:		Emmanuel Vadot <manu@bidouilliste.com>
Approved by:		gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D5468
2016-02-27 22:26:05 +00:00
Bryan Drewery
5b83ad4bb4 Remove old compatibility checks.
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-02-27 21:08:27 +00:00
Justin Hibbits
0f7aeab0e7 Implement pmap_change_attr() for PowerPC (Book-E only for now)
Summary:
Some drivers need special memory requirements.  X86 solves this with a
pmap_change_attr() API, which DRM uses for changing the mapping of the GART and
other memory regions.  Implement the same function for PowerPC.  AIM currently
does not need this, but will in the future for DRM, so a default is added for
that, for business as usual.  Book-E has some drivers coming down that do
require non-default memory coherency.  In this case, the Datapath Acceleration
Architecture (DPAA) based ethernet controller has 2 regions for the buffer
portals: cache-inhibited, and cache-enabled.  By default, device memory is
cache-inhibited.  If the cache-enabled memory regions are mapped
cache-inhibited, an alignment exception is thrown on access.

Test Plan:
Tested with a new driver to be added after this (DPAA dTSEC ethernet driver).
No alignment exceptions thrown, driver works as expected with this.

Reviewed By:	nwhitehorn
Sponsored by:	Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D5471
2016-02-27 20:39:36 +00:00
Justin Hibbits
f7dc5935d3 Move another range check to use RMAN_IS_DEFAULT_RANGE(). 2016-02-27 16:27:48 +00:00
Mariusz Zaborski
90bae55a77 Remove reaming files of the Casper daemon.
Reported by:    emaste
Approved by:	pjd (mentor)
2016-02-27 14:45:32 +00:00
Ed Maste
de463b29b2 Correct date on ELF Tool Chain UPDATING entry
Reported by:	dhw
2016-02-27 12:34:51 +00:00
Svatopluk Kraus
5b70c08cdf Move IPI related parts back to (ARM) machine specific file now, when
the interrupt framework is also going to be used by another (MIPS)
architecture. IPI implementations may vary much across different
architectures.

An IPI implementation should still define INTR_IPI_COUNT and use
intr_ipi_setup_counters() to setup IPI counters which are inside of
intrcnt[] and intrnames[] arrays. Those are used for sysctl and ddb.
Then, intr_ipi_increment_count() should be used to increment obtained
counter.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D5459
2016-02-27 12:03:07 +00:00
Justin Hibbits
c47476d7e6 Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().
Most calls to bus_alloc_resource() use "anywhere" as the range, with a given
count.  Migrate these to use the new bus_alloc_resource_anywhere() API.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D5370
2016-02-27 03:38:01 +00:00
Justin Hibbits
ac6c1372f4 Add the bus_alloc_resource_anywhere() convenience function.
Summary:
Many instances of bus_alloc_resource() simply use 0 and ~0 for start and end to
denote 'anywhere' with a given count.  To clean this up, introduce a
bus_alloc_resource_anywhere() convenience function.

Bump __FreeBSD_version for the new API.

Reviewed By: jhb
Differential Revision: https://reviews.freebsd.org/D5370
2016-02-27 03:35:28 +00:00
Justin Hibbits
eff83876b6 Replace several bus_alloc_resource() calls with bus_alloc_resource_any()
Most of these are BARs, and we allocate them in their entirety.  The one outlier
in this is amdsbwd, which calls bus_set_resource() prior.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D5370 (partial)
2016-02-27 03:34:01 +00:00
Pedro F. Giffuni
7ae7c1932b Missing tab.
Pointed out by:	bapt
2016-02-27 02:11:00 +00:00
Pedro F. Giffuni
283970e873 RPC: update the getrpcbyname() definition to include a const qualifier.
Add const qualifier making getrpcbyname() and getrpcbyname_r()
prototypes match those used in latest Sun RPC code (TI-RPC 2.3).

Obtained from:	NetBSD
2016-02-26 23:25:21 +00:00
Pedro F. Giffuni
733191a56c pciconf: Silence a GCC warning.
Fix the build on sparc64 and powerpc.

Taken from:	wma
2016-02-26 23:12:59 +00:00
Ed Maste
f35fbc2982 Restore lib/casper debug directory, reverting r296130
Reported by:	bdrewery
Pointy hat to:	emaste
2016-02-26 22:25:35 +00:00
Ed Maste
0210fa8f75 Remove libexec/casper debug directory missed in r296047 2016-02-26 22:19:39 +00:00
Bryan Drewery
d48a2d2303 Remove WARNS inherited fine by ../Makefile.inc.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:23 +00:00
Bryan Drewery
ffc534f75b Make it clear that the "size" argument is for the dst string.
The rest of the manpage already referenced 'dstsize' but did not rename
the variable in the prototype in r257646.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:19 +00:00
Bryan Drewery
3055a28d44 Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:15 +00:00
Bryan Drewery
e6f17963a8 Remove unneeded lines.
- WARNS can be inherited from lib/Makefile.inc
- CFLAGS referred to a non-existent directory and this shouldn't be needed
  anyhow due to the build picking up includes from WORLDTMP.

Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:08 +00:00
Bryan Drewery
88ad7d508a These can build in parallel.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:04 +00:00
Bryan Drewery
aae63957af Import bsd.clang-analyze.mk based on NetBSD's version.
This allows 'make analyze' or 'make OBJ.clang-analyzer' to run the
Clang static analyzer and present results on stdout.

Obtained from:	NetBSD (CVS Rev. 1.3)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5449
2016-02-26 22:14:00 +00:00
Bryan Drewery
b29980a63f META_MODE: Default to the silent build.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:56 +00:00
Bryan Drewery
342863e712 Move PROGS logic to proper place and remove redundant and unneeded logic.
- bsd.progs.mk is safe to include regardless of PROGS/PROGS_CXX/SCRIPTS
  being set.
- bsd.progs.mk includes bsd.prog.mk always and will bring in
  bsd.files.mk and bsd.obj.mk.
- DIRDEPS_BUILD: There's no need for _SKIP_BUILD or _SKIP_STAGING as the
  PROGS were implicitly being built by the staging dependency anyway.  This
  was also preventing other objects from building if they were not part of
  the staging sets.
- DIRDEPS_BUILD: This fixes PROGS without bsd.test.mk not staging.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:52 +00:00
Bryan Drewery
db74470bff DIRDEPS_BUILD: Fix some things building in MAKELEVEL0.
For PROGS this was recursing twice since MAKELEVEL0 is for 'dirdeps'
which then really builds in a sub-make.

Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:13:48 +00:00