Commit Graph

17170 Commits

Author SHA1 Message Date
Bryan Drewery
2fd6394d34 Rework unknown LIBADD assertion to be more clear and to not suggest adding
DPADD/LDADD_<foo> variables that are a special case.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:24 +00:00
Bryan Drewery
3530922240 Support all of the CDDL/ZFS libraries for LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:21 +00:00
Bryan Drewery
7aab86d59d For INTERNALLIB always add in the corresponding _DP_ and use LIBADD in
the real build file.

This lessens the need to define DPADD_<lib> and LDADD_<lib> to just very
special cases.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:17 +00:00
Bryan Drewery
a9f9ec2435 Replace ln -s calls with INSTALL_SYMLINK
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:14 +00:00
Bryan Drewery
568f2ee158 Don't create a Makefile.depend in share/mk.
This would cause it to be included everywhere in the build since it is
the MAKESYSPATH.  This leads to including dirdeps.mk more times than
desired.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:10 +00:00
Bryan Drewery
249f51a492 DIRDEPS_BUILD: Install new Makefile.depend files atomically.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:07 +00:00
Bryan Drewery
bd1944cacc DIRDEPS_BUILD: For the bootstrapped LIBADD from DPADD, resolve paths to RELDIR.
This allows the LIBDEPS/DPADD for the clang build to not have
../../../lib/clang/* in DIRDEPS.

Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:04 +00:00
Bryan Drewery
d6b837de97 Revert r288966 as it is redundant and not right.
bsd.prog.mk and bsd.lib.mk already make OBJS depend on headers when there is
not .OBJDIR/.depend file, which is still true for the initial meta mode builds.
If there was something to benefit the meta mode build here then it should be
extended to the non-meta mode build as well.

Some of the problems here were just DPSRCS being hooked up wrongly, fixed in
r291330.

The logic itself is flawed as 'buildfiles' is in a different part of the
dependency tree than the objects and headers are, so the objects will still be
built independent from 'buildfiles'.  'buildfiles' is not ordered in the build
before objects.

Sponsored by:	EMC / Isilon Storage Division
2015-12-03 22:39:42 +00:00
Kenneth D. Merry
a9934668aa Add asynchronous command support to the pass(4) driver, and the new
camdd(8) utility.

CCBs may be queued to the driver via the new CAMIOQUEUE ioctl, and
completed CCBs may be retrieved via the CAMIOGET ioctl.  User
processes can use poll(2) or kevent(2) to get notification when
I/O has completed.

While the existing CAMIOCOMMAND blocking ioctl interface only
supports user virtual data pointers in a CCB (generally only
one per CCB), the new CAMIOQUEUE ioctl supports user virtual and
physical address pointers, as well as user virtual and physical
scatter/gather lists.  This allows user applications to have more
flexibility in their data handling operations.

Kernel memory for data transferred via the queued interface is
allocated from the zone allocator in MAXPHYS sized chunks, and user
data is copied in and out.  This is likely faster than the
vmapbuf()/vunmapbuf() method used by the CAMIOCOMMAND ioctl in
configurations with many processors (there are more TLB shootdowns
caused by the mapping/unmapping operation) but may not be as fast
as running with unmapped I/O.

The new memory handling model for user requests also allows
applications to send CCBs with request sizes that are larger than
MAXPHYS.  The pass(4) driver now limits queued requests to the I/O
size listed by the SIM driver in the maxio field in the Path
Inquiry (XPT_PATH_INQ) CCB.

There are some things things would be good to add:

1. Come up with a way to do unmapped I/O on multiple buffers.
   Currently the unmapped I/O interface operates on a struct bio,
   which includes only one address and length.  It would be nice
   to be able to send an unmapped scatter/gather list down to
   busdma.  This would allow eliminating the copy we currently do
   for data.

2. Add an ioctl to list currently outstanding CCBs in the various
   queues.

3. Add an ioctl to cancel a request, or use the XPT_ABORT CCB to do
   that.

4. Test physical address support.  Virtual pointers and scatter
   gather lists have been tested, but I have not yet tested
   physical addresses or scatter/gather lists.

5. Investigate multiple queue support.  At the moment there is one
   queue of commands per pass(4) device.  If multiple processes
   open the device, they will submit I/O into the same queue and
   get events for the same completions.  This is probably the right
   model for most applications, but it is something that could be
   changed later on.

Also, add a new utility, camdd(8) that uses the asynchronous pass(4)
driver interface.

This utility is intended to be a basic data transfer/copy utility,
a simple benchmark utility, and an example of how to use the
asynchronous pass(4) interface.

It can copy data to and from pass(4) devices using any target queue
depth, starting offset and blocksize for the input and ouptut devices.
It currently only supports SCSI devices, but could be easily extended
to support ATA devices.

It can also copy data to and from regular files, block devices, tape
devices, pipes, stdin, and stdout.  It does not support queueing
multiple commands to any of those targets, since it uses the standard
read(2)/write(2)/writev(2)/readv(2) system calls.

The I/O is done by two threads, one for the reader and one for the
writer.  The reader thread sends completed read requests to the
writer thread in strictly sequential order, even if they complete
out of order.  That could be modified later on for random I/O patterns
or slightly out of order I/O.

camdd(8) uses kqueue(2)/kevent(2) to get I/O completion events from
the pass(4) driver and also to send request notifications internally.

For pass(4) devcies, camdd(8) uses a single buffer (CAM_DATA_VADDR)
per CAM CCB on the reading side, and a scatter/gather list
(CAM_DATA_SG) on the writing side.  In addition to testing both
interfaces, this makes any potential reblocking of I/O easier.  No
data is copied between the reader and the writer, but rather the
reader's buffers are split into multiple I/O requests or combined
into a single I/O request depending on the input and output blocksize.

For the file I/O path, camdd(8) also uses a single buffer (read(2),
write(2), pread(2) or pwrite(2)) on reads, and a scatter/gather list
(readv(2), writev(2), preadv(2), pwritev(2)) on writes.

Things that would be nice to do for camdd(8) eventually:

1.  Add support for I/O pattern generation.  Patterns like all
    zeros, all ones, LBA-based patterns, random patterns, etc. Right
    Now you can always use /dev/zero, /dev/random, etc.

2.  Add support for a "sink" mode, so we do only reads with no
    writes.  Right now, you can use /dev/null.

3.  Add support for automatic queue depth probing, so that we can
    figure out the right queue depth on the input and output side
    for maximum throughput.  At the moment it defaults to 6.

4.  Add support for SATA device passthrough I/O.

5.  Add support for random LBAs and/or lengths on the input and
    output sides.

6.  Track average per-I/O latency and busy time.  The busy time
    and latency could also feed in to the automatic queue depth
    determination.

sys/cam/scsi/scsi_pass.h:
	Define two new ioctls, CAMIOQUEUE and CAMIOGET, that queue
	and fetch asynchronous CAM CCBs respectively.

	Although these ioctls do not have a declared argument, they
	both take a union ccb pointer.  If we declare a size here,
	the ioctl code in sys/kern/sys_generic.c will malloc and free
	a buffer for either the CCB or the CCB pointer (depending on
	how it is declared).  Since we have to keep a copy of the
	CCB (which is fairly large) anyway, having the ioctl malloc
	and free a CCB for each call is wasteful.

sys/cam/scsi/scsi_pass.c:
	Add asynchronous CCB support.

	Add two new ioctls, CAMIOQUEUE and CAMIOGET.

	CAMIOQUEUE adds a CCB to the incoming queue.  The CCB is
	executed immediately (and moved to the active queue) if it
	is an immediate CCB, but otherwise it will be executed
	in passstart() when a CCB is available from the transport layer.

	When CCBs are completed (because they are immediate or
	passdone() if they are queued), they are put on the done
	queue.

	If we get the final close on the device before all pending
	I/O is complete, all active I/O is moved to the abandoned
	queue and we increment the peripheral reference count so
	that the peripheral driver instance doesn't go away before
	all pending I/O is done.

	The new passcreatezone() function is called on the first
	call to the CAMIOQUEUE ioctl on a given device to allocate
	the UMA zones for I/O requests and S/G list buffers.  This
	may be good to move off to a taskqueue at some point.
	The new passmemsetup() function allocates memory and
	scatter/gather lists to hold the user's data, and copies
	in any data that needs to be written.  For virtual pointers
	(CAM_DATA_VADDR), the kernel buffer is malloced from the
	new pass(4) driver malloc bucket.  For virtual
	scatter/gather lists (CAM_DATA_SG), buffers are allocated
	from a new per-pass(9) UMA zone in MAXPHYS-sized chunks.
	Physical pointers are passed in unchanged.  We have support
	for up to 16 scatter/gather segments (for the user and
	kernel S/G lists) in the default struct pass_io_req, so
	requests with longer S/G lists require an extra kernel malloc.

	The new passcopysglist() function copies a user scatter/gather
	list to a kernel scatter/gather list.  The number of elements
	in each list may be different, but (obviously) the amount of data
	stored has to be identical.

	The new passmemdone() function copies data out for the
	CAM_DATA_VADDR and CAM_DATA_SG cases.

	The new passiocleanup() function restores data pointers in
	user CCBs and frees memory.

	Add new functions to support kqueue(2)/kevent(2):

	passreadfilt() tells kevent whether or not the done
	queue is empty.

	passkqfilter() adds a knote to our list.

	passreadfiltdetach() removes a knote from our list.

	Add a new function, passpoll(), for poll(2)/select(2)
	to use.

	Add devstat(9) support for the queued CCB path.

sys/cam/ata/ata_da.c:
	Add support for the BIO_VLIST bio type.

sys/cam/cam_ccb.h:
	Add a new enumeration for the xflags field in the CCB header.
	(This doesn't change the CCB header, just adds an enumeration to
	use.)

sys/cam/cam_xpt.c:
	Add a new function, xpt_setup_ccb_flags(), that allows specifying
	CCB flags.

sys/cam/cam_xpt.h:
	Add a prototype for xpt_setup_ccb_flags().

sys/cam/scsi/scsi_da.c:
	Add support for BIO_VLIST.

sys/dev/md/md.c:
	Add BIO_VLIST support to md(4).

sys/geom/geom_disk.c:
	Add BIO_VLIST support to the GEOM disk class.  Re-factor the I/O size
	limiting code in g_disk_start() a bit.

sys/kern/subr_bus_dma.c:
	Change _bus_dmamap_load_vlist() to take a starting offset and
	length.

	Add a new function, _bus_dmamap_load_pages(), that will load a list
	of physical pages starting at an offset.

	Update _bus_dmamap_load_bio() to allow loading BIO_VLIST bios.
	Allow unmapped I/O to start at an offset.

sys/kern/subr_uio.c:
	Add two new functions, physcopyin_vlist() and physcopyout_vlist().

sys/pc98/include/bus.h:
	Guard kernel-only parts of the pc98 machine/bus.h header with
	#ifdef _KERNEL.

	This allows userland programs to include <machine/bus.h> to get the
	definition of bus_addr_t and bus_size_t.

sys/sys/bio.h:
	Add a new bio flag, BIO_VLIST.

sys/sys/uio.h:
	Add prototypes for physcopyin_vlist() and physcopyout_vlist().

share/man/man4/pass.4:
	Document the CAMIOQUEUE and CAMIOGET ioctls.

usr.sbin/Makefile:
	Add camdd.

usr.sbin/camdd/Makefile:
	Add a makefile for camdd(8).

usr.sbin/camdd/camdd.8:
	Man page for camdd(8).

usr.sbin/camdd/camdd.c:
	The new camdd(8) utility.

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-12-03 20:54:55 +00:00
Hans Petter Selasky
5b6a9ce8b3 Update the mlx5en(4) manual page.
MFC after:	1 week
Submitted by:	Mark Bloch <markb@mellanox.com>
Sponsored by:	Mellanox Technologies
Differential Revision:	https://reviews.freebsd.org/D4348
2015-12-03 10:17:01 +00:00
Enji Cooper
1c4ced8fe8 Fix a typo in a comment (spacial -> special)
Sponsored by: EMC / Isilon Storage Division
2015-12-03 07:42:00 +00:00
John Baldwin
fe2ebb7644 Add support for configuring additional virtual interfaces (VIs) on a port.
Each virtual interface has its own MAC address, queues, and statistics.
The dedicated netmap interfaces (ncxgbeX / ncxlX) were already implemented
as additional VIs on each port.  This change allows additional non-netmap
interfaces to be configured on each port.  Additional virtual interfaces
use the naming scheme vcxgbeX or vcxlX.

Additional VIs are enabled by setting the hw.cxgbe.num_vis tunable to a
value greater than 1 before loading the cxgbe(4) or cxl(4) driver.
NB: The first VI on each port is the "main" interface (cxgbeX or cxlX).

T4/T5 NICs provide a limited number of MAC addresses for each physical port.
As a result, a maximum of six VIs can be configured on each port (including
the "main" interface and the netmap interface when netmap is enabled).

One user-visible result is that when netmap is enabled, packets received
or transmitted via the netmap interface are no longer counted in the stats
for the "main" interface, but are not accounted to the netmap interface.

The netmap interfaces now also have a new-bus device and export various
information sysctl nodes via dev.n(cxgbe|cxl).X.

The cxgbetool 'clearstats' command clears the stats for all VIs on the
specified port along with the port's stats.  There is currently no way to
clear the stats of an individual VI.

Reviewed by:	np
MFC after:	1 month
Sponsored by:	Chelsio
2015-12-03 00:02:01 +00:00
John Baldwin
8d7e0f5889 The cdevpriv_dtr_t typedef was not able to be used in a function prototype
like the various d_*_t typedefs since it declared a function pointer rather
than a function.  Add a new d_priv_dtor_t typedef that declares the function
and can be used as a function prototype.  The previous typedef wasn't
useful outside of the cdevpriv implementation, so retire it.

The name d_priv_dtor_t was chosen to be more consistent with cdev methods
since it is commonly used in place of d_close_t even though it is not a
direct pointer in struct cdevsw.

Reviewed by:	kib, imp
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D4340
2015-12-02 18:27:30 +00:00
Bryan Drewery
4b9378e3ba Add LIBNANDFS.
Sponsored by:	EMC / Isilon Storage Division
2015-12-02 05:23:12 +00:00
Bryan Drewery
03173d2ff0 bsd.subdir.mk: Only recurse on called targets, rather than dependencies.
This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.

This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.

This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.

This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'.  This avoids
various issues such as the one fixed in r289462.  As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.

Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438.  This is so users do not get a probably broken build if they
run 'make all' from the top-level.  Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion.  Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.

This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331.  This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel.  The logic is still in bsd.subdir.mk
for now.

I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack.  If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.

Discussed on:	arch@
MFC after:	never
Sponsored by:	EMC / Isilon Storage Division
2015-12-02 01:50:22 +00:00
Bryan Drewery
70d3d39e78 Revert r291633. Some files were missed. 2015-12-02 01:49:22 +00:00
Bryan Drewery
2cdf1c99f0 bsd.subdir.mk: Only recurse on called targets, rather than dependencies.
This is to fix 'make all' causing it to recurse on both 'all' and 'buildconfig'
due to 'buildconfig' being in ALL_SUBDIR_TARGETS and being a dependency of
'all'.

This now adds all of the '*includes', '*files' targets as subdir targets,
allowing them to recurse.

This also removes the need for some 'realinstall' hacks in bsd.subdir.mk since
it no longer recurses; only 'install' will recurse and call the proper
'beforeinstall', 'realinstall', and 'afterinstall' in each sub-directory.

This fixes 'make includes' and 'make files' to not be a rerolled ${MAKE}
sub-shell but to rather just recurse on 'inclues' and 'files'.  This avoids
various issues such as the one fixed in r289462.  As such revert Makefile.inc1
back to using 'includes' which avoids an extra tree walk and parallelizes
the includes phases better.

Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR_PARALLEL,
added in r289438.  This is so users do not get a probably broken build if they
run 'make all' from the top-level.  Before the change in this commit, the
workaround for 'make everything' was 'par-all' which would depend on 'all' and
cause a proper parallel recursion.  Now that will not work so a new
_PARALLEL_SUBUDIR_OK is used to allow it.

This is still part of an effort to combine bsd.(files|incs|confs).mk and move
some of its logic out of bsd.subdir.mk, as attempted in r289282 and reverted in
r289331.  This commit fixes the problems found there which was mostly double
recursing during 'includes' which would recurse on itself and 'buildincludes'
and 'installincludes', all in parallel.  The logic is still in bsd.subdir.mk
for now.

I've been cautious about this commit but have experienced no breakage on the
tree except for the 'par-all' case which was already a hack.  If something foo
is depending on something bar that should recurse, it is very likely that the
foo target is being recursed on already meaning that bar will still effectively
recurse once sub-directories call foo.

Discussed on:	arch@
MFC after:	never
Sponsored by:	EMC / Isilon Storage Division
2015-12-02 01:47:27 +00:00
Bryan Drewery
5afa19725e Add assertions that capture invalid configurations for new libraries.
Fix current findings, which should fix cases of NO_SHARED not building
properly.

Given libfoo:
 - Ensure that a LIBFOO is set.  For INTERNALLIBS advise setting this in
   src.libnames.mk, otherwise bsd.libnames.mk.
 - Ensure that a LIBFOODIR is properly set.
 - Ensure that _DP_foo is set and matches the LIBADD in the build of foo's own
   Makefile

Sponsored by:	EMC / Isilon Storage Division
2015-12-02 01:24:31 +00:00
Bryan Drewery
eaab62402b Don't overlink pthread to kerberos library consumers.
I'm not sure why this was here, none of these use pthread themselves and
none of the consumers are broken with removing this.

Sponsored by:	EMC / Isilon Storage Division
2015-12-02 01:23:16 +00:00
Bryan Drewery
7bce873919 Don't overlink pthread to libsqlite3 consumers.
At least usr.bin/mandoc was overlink.

Sponsored by:	EMC / Isilon Storage Division
2015-12-02 01:17:09 +00:00
Bryan Drewery
3d07982db6 Fix truncation of _DP_proc and add missing libelf.
Sponsored by:	EMC / Isilon Storage Division
2015-12-02 00:54:05 +00:00
Bryan Drewery
60648601bf Reduce overlinking of libdtrace consumers with libctf, libelf, libproc.
The proper place for this list is _DP_dtrace.

Due to removing the LDADD_dtrace, more LIBADD are needed in
cddl/usr.sbin/dtrace to prevent underlinking.

This fixes overlinking in cddl/usr.sbin/lockstat and
cddl/usr.sbin/plockstat.

Sponsored by:	EMC / Isilon Storage Division
2015-12-02 00:49:49 +00:00
Bryan Drewery
ed8addefb2 Don't overlink libmt consumers with libsbuf.
This change came in r281332 which was reducing overlinking in mt(1) but
currently mt(1) is linked with sbuf when it does not need it due to the
LDADD_mt+=${LDADD_sbuf}.  Only libmt needs sbuf.

Add sbuf to _DP_mt so static linkage of libmt picks it up.

Sponsored by:	EMC / Isilon Storage Division
2015-12-02 00:49:42 +00:00
Bryan Drewery
70b19675cd libssh uses libz even without MK_LDNS
Sponsored by:	EMC / Isilon Storage Division
2015-12-02 00:49:39 +00:00
Bryan Drewery
87a2755dee Revert incomplete r291623. 2015-12-02 00:17:13 +00:00
Bryan Drewery
eaa435e794 Add assertions that capture invalid configurations for new libraries.
Fix current findings.

Given libfoo:
 - Ensure that a LIBFOO is set.  For INTERNALLIBS advise setting this in
   src.libnames.mk, otherwise bsd.libnames.mk.
 - Ensure that a LIBFOODIR is properly set.
 - Ensure that _DP_foo is set and matches the LIBADD in the build of foo's own
   Makefile

Sponsored by:	EMC / Isilon Storage Division
2015-12-02 00:01:09 +00:00
Bryan Drewery
de52e5bdca Define a LIB*SRCDIR for all known _LIBRARIES.
This is a follow-up to r291327 which added a LIB*DIR for all known
_LIBRARIES.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 22:19:17 +00:00
Bryan Drewery
945ceaafbc Only include src.conf if _WITHOUT_SRCCONF not defined.
This does not really fix anything currently since _WITHOUT_SRCCONF must be
defined in the environment or local.sys.*.mk, but is proper and needed for
downstream fixes.  I am working towards reworking src.conf inclusion still.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 20:56:16 +00:00
Bryan Drewery
f3dd2bc756 Support LOCAL_LIBRARIES for LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-01 20:50:14 +00:00
Bryan Drewery
4910373ca8 Add missing LIB80211 entry for DPADD needs.
Sponsored by:	EMC / Isilon Storage Division
2015-12-01 18:09:40 +00:00
Bryan Drewery
3a42764af7 Fix underlinking in lib80211 and define static dependencies in src.libnames.mk
so NO_SHARED works properly.

Reported by:	Manfred Antar <null@pozo.com>
Sponsored by:	EMC / Isilon Storage Division
2015-12-01 17:38:52 +00:00
Bryan Drewery
6feede08e1 FAST_DEPEND: Actually use -MP from DEPEND_MP, completing r291554.
X-MFC-With:	r291554
MFC after:	1 week
Pointyhat to:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2015-12-01 15:50:35 +00:00
Bryan Drewery
4902050fa5 META MODE: Add some basic bootstrapping support for no Makefile.depend.
This will not work for bootstrapping dependencies, it will only
bootstrap the top-level build directory.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:29:30 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Bryan Drewery
3bed45ab81 META MODE: Rework [bootstrapped] tools PATH support.
- Support more of the toolchain from TOOLSDIR.
- This also improves 'make bootstrap-tools' to pass, for example,
  AS=/usr/bin/as to Makefile.inc1, which will tell cross-tools to use
  external toolchain support and avoid building things we won't be using
  in the build.
- Always set the PATH to contain the staged TOOLSDIR directories when
  not building the bootstrap targets.

  The previous version was only setting this at MAKE.LEVEL==0 and if the
  TOOLSDIR existed.  Both of these prevented using staged tools that were
  built during the build though as DIRDEPS with .host dependencies, such
  as the fix for needing usr.bin/localedef.host in r291311.
  This is not a common tool so we must build and use it during the build,
  and need to be prepared to change PATH as soon as it appears.

  This should also fix the issue of host dependencies disappearing from
  Makefile.depend and then reappearing due to the start of the fresh build not
  having the directory yet, resulting in the tools that were built not actually
  being used.
- Only use LEGACY_TOOLS while building in Makefile.inc1.  After r291317
  and r291546 there is no need to add LEGACY_TOOLS into the PATH for
  the pseudo/targets/toolchain build.
- Because the pseudo/targets/toolchain will now build its own
  [clang-]tblgen, the special logic in clang.build.mk is no longer needed.
- LEGACY_TOOLS is no longer used outside of targets/pseudo/bootstrap-tools
  so is no longer passed into the environment in its build.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:19:02 +00:00
Bryan Drewery
3c42abd89d META MODE: Don't trim out lib/clang/include dependency.
Doing this causes more trouble than it is worth regarding cyclic
dependencies.  It should not be needed after cleaning up MACHINE=host
builds in r291324.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:18:55 +00:00
Kevin Lo
e1b74f21f5 Add initial support for RTL8152 USB Fast Ethernet. RTL8152 supports
IPv4/IPv6 checksum offloading and VLAN tag insertion/stripping.

Since uether doesn't provide a way to announce driver specific offload
capabilities to upper stack, checksum offloading support needs more work
and will be done in the future.

Special thanks to Hayes Wang from RealTek who gave input.
2015-12-01 05:12:13 +00:00
Bryan Drewery
b6725ecdb2 FAST_DEPEND: Workaround hacks in the wild that have '..' or '/' in OBJS.
This is mostly working around the converts/iconv port having '../ces/file.o'
in its OBJS list which resulted in '.depend../ces/file.o'.  Now it will have
'.depend.._ces_file.o'.

Other implementations have :T which would result in '.depend.file.o' here, but
that could lead to collisions.

X-MFC-With:	r291554
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-12-01 03:09:54 +00:00
Bryan Drewery
593e465913 FAST_DEPEND: Allow not using -MP by setting DEPEND_MP blank.
-MP creates empty targets for all dependency files, which can be useful when a
dependency is deleted from the file system.  This would otherwise cause an
error for "don't know how to build FOO" since the .depend file is included
with the dependency registered.

This is mostly a workaround for the misc/dahdi-kmod port using '::' for one of
its dependencies, while -MP uses just ':'.  This results in an 'Inconsistent
operator for' error.

X-MFC-With:	r290433
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-12-01 03:00:10 +00:00
Bryan Drewery
c7f8dda118 META MODE: Always define HOST_*, even if not using them.
Sponsored by:	EMC / Isilon Storage Division
2015-12-01 00:53:17 +00:00
Alexander Motin
aeef6b689a Use SPI name for parallel SCSI. 2015-11-30 22:09:55 +00:00
Adrian Chadd
5c15e5d044 Add missing lib declaration. 2015-11-30 06:56:25 +00:00
Hajimu UMEMOTO
26b79d5b83 Regen src.conf.5 for recent option changes. 2015-11-28 00:55:49 +00:00
John Baldwin
7f911abe54 Add support to libkvm for reading vmcores from other architectures.
- Add a kvaddr_type to represent kernel virtual addresses instead of
  unsigned long.
- Add a struct kvm_nlist which is a stripped down version of struct nlist
  that uses kvaddr_t for n_value.
- Add a kvm_native() routine that returns true if an open kvm descriptor
  is for a native kernel and memory image.
- Add a kvm_open2() function similar to kvm_openfiles().  It drops the
  unused 'swapfile' argument and adds a new function pointer argument for
  a symbol resolving function.  Native kernels still use _fdnlist() from
  libc to resolve symbols if a resolver function is not supplied, but cross
  kernels require a resolver.
- Add a kvm_nlist2() function similar to kvm_nlist() except that it uses
  struct kvm_nlist instead of struct nlist.
- Add a kvm_read2() function similar to kvm_read() except that it uses
  kvaddr_t instead of unsigned long for the kernel virtual address.
- Add a new kvm_arch switch of routines needed by a vmcore backend.
  Each backend is responsible for implementing kvm_read2() for a given
  vmcore format.
- Use libelf to read headers from ELF kernels and cores (except for
  powerpc cores).
- Add internal helper routines for the common page offset hash table used
  by the minidump backends.
- Port all of the existing kvm backends to implement a kvm_arch switch and
  to be cross-friendly by using private constants instead of ones that
  vary by platform (e.g. PAGE_SIZE).  Static assertions are present when
  a given backend is compiled natively to ensure the private constants
  match the real ones.
- Enable all of the existing vmcore backends on all platforms.  This means
  that libkvm on any platform should be able to perform KVA translation
  and read data from a vmcore of any platform.

Tested on:	amd64, i386, sparc64 (marius)
Differential Revision:	https://reviews.freebsd.org/D3341
2015-11-27 18:58:26 +00:00
Bryan Drewery
11ffa20fa0 Standardize on OBJTOP in and outside of META MODE.
Sponsored by:	EMC / Isilon Storage Division
2015-11-26 01:47:56 +00:00
Bryan Drewery
93e779a26c META MODE: These need object directories to handle staging.
Sponsored by:	EMC / Isilon Storage Division
2015-11-26 01:14:27 +00:00
George V. Neville-Neil
1576e8f871 Replace the retval.sh shell script with a native DTrace script.
Suggested by: markj
2015-11-26 00:53:39 +00:00
George V. Neville-Neil
669f9224ec Summary: A simple script to print the return value of any function,
with or without wild cards.
2015-11-25 22:59:41 +00:00
Bryan Drewery
8ffe95d60f Follow-up r291338 to handle .d, .y and .l files better as well.
X-MFC-With:	r291338
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 22:40:14 +00:00
Bryan Drewery
c3d4829ed1 Fix the "common object" handling to not depend on ".o" if SRCS only contains
headers.

This resulted in 'don't know how to make .o.' errors after the changes in
r289286.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 22:32:16 +00:00
Bryan Drewery
ebf076dfa5 Define a LIB<NAME>DIR for every library that LIBADD provides.
This is going to be used to allow DIRDEPS to be bootstrapped off of
LIBADD/DPADD.  It currently works for internal libraries which have a
DIR defined for them but also use the .a library from a src-mapped obj
directory.  It can also be useful for using -L without a --sysroot per
LIBADD to use the OBJDIR version of the libraries.

I didn't review every LIBADD, so it is possible this is missing some.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:49:55 +00:00
Bryan Drewery
2802302e64 META MODE: Fix MACHINE=host builds.
We need to not use -nostdinc since it breaks building of clang itself.  Use
-isystem rather than -I/usr/include and -nostdinc which gets us using
the stage include directory before searching the real host headers.
This allows removing more of the -I hacks to get host headers since the
headers are no longer excluded.  The -B seemed unneeded.

This fixes building of secure/lib/libcrypto which was looking at the
/usr/include/openssl/asn1.h header rather than the staged one.

This fixes building of clang which wants to find its own internal
headers in the STAGEDIR/usr/lib/clang/* path.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:45:01 +00:00
Bryan Drewery
cf10dd450d Stop looking up the same id(1) results in sub-makes.
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:58 +00:00
Bryan Drewery
4aa63711a7 META MODE: Fix 'make bootstrap-tools'.
The main problem was bitrot after elftoolchain being swapped in for the
GNU toolchain.

This also reworks how the list of 'host allowed' libraries is determined
to only allow INTERNALLIBs, which is needed for libelftc to come in.

For usr.bin/readelf use the same hack, as libelf and libdward, to bring in
the needed sys/ headers for host builds.  This has not yet been a problem due
to readelf not being built as a host tool in buildworld.  This is possible
in the meta build though when building the toolchain.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:51 +00:00
Bryan Drewery
b791fbe630 META MODE: Don't create .meta files when symlinking sources into the obj directory.
Tracking these leads to situations where meta mode will consider the
file to be out of date if /bin/sh or /bin/ln are newer than the source
file.  There's no reason for meta mode to do this as make is already
handling the rebuild dependency fine.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:43 +00:00
Bryan Drewery
80dfd0d4a2 META MODE: Show PATH on errors.
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:31 +00:00
Bryan Drewery
08b20c637c META MODE: Don't add staged DPADDs to DIRDEPS when bootstrapping gendirdeps.
This was finding libraries that were installed into DESTDIR/usr/lib,
where DESTDIR is the stage directory, and then adding in usr/lib to
DIRDEPS.  Just exclude the STAGE_ROOT if defined.

Discussed with:	sjg
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:13:45 +00:00
Bryan Drewery
5e2f7161d7 META MODE: Define variables this file uses that were defined elsewhere.
Discussed with:	sjg
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:13:42 +00:00
Bryan Drewery
02d37cd3e4 META MODE: Don't truncate DIRDEPS for bootstrapping during gendirdeps.
Reviewed by:	sjg
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:13:39 +00:00
Bryan Drewery
bb8cd0c6f0 META MODE: Revert r287879 so that 'make -V' still uses AUTO_OBJ.
This has caused much confusion for myself as there are quite a lot of
variables that depend on having a proper ${.OBJDIR}.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:13:32 +00:00
Bryan Drewery
393608176b META MODE: Fix 'make the-lot' with recent locale changes
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:13:28 +00:00
Bryan Drewery
7b3ea376a2 META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.
This both avoids some dependencies on xinstall.host and allows
bootstrapping on older releases to work due to lack of at least 'install -l'
support.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:10:28 +00:00
Kevin Lo
ff6b30b9fa Add dependency to uether.
Reviewed by:	hselasky
2015-11-24 08:34:48 +00:00
Bryan Drewery
440ffb7e1e There seems to be no reason to duplicate CANONICALOBJDIR logic from bsd.obj.mk,
which is included for crunchgen builds.

No change in build output occurred with this change.

Sponsored by:	EMC / Isilon Storage Division
2015-11-23 23:04:52 +00:00
Alexander Motin
e3a0bc583b Remove "disable" hint, which duplicates system-wide "disabled". 2015-11-23 20:44:49 +00:00
Enji Cooper
ba23388ab8 Revert r291170
The mlx5* driver(s) are built [*]/installed separate from the OFED stack thanks
to recent refactoring done in the linuxkpi(4) module.

Always install the manpages instead of conditionally installing them if
MK_OFED != no

* Further refactoring of sys/ofed and linuxkpi(4) is pending to fully divorce
  mlx5* from ofed headers

MFC after: never
Requested by: hps
2015-11-23 19:44:39 +00:00
Alexander Motin
a4ccb5d682 Fix target mode support for Qlogic 2200 FC adapters.
Now target mode works for all supported FC adapters except ancient 2100,
which is not tested.
2015-11-23 15:49:50 +00:00
Dag-Erling Smørgrav
1765946ba9 Retire the NONE cipher option. 2015-11-23 12:48:13 +00:00
Alexander Motin
3e6deb330e Rip off target mode support for parallel SCSI QLogic adapters.
Hacks to enable target mode there complicated code, while didn't really
work.  And for outdated hardware fixing it is not really interesting.

Initiator mode tested with Qlogic 1080 adapter is still working fine.
2015-11-23 10:06:19 +00:00
Enji Cooper
c80e2a5d2b Install mce(4) and mlx5en(4) if MK_OFED != no
MFC after: 1 week
2015-11-23 00:43:23 +00:00
Enji Cooper
0c55686cd0 Bump .Dd 2015-11-23 00:40:08 +00:00
Enji Cooper
62d309bb84 - Fix bad double space between HW and LRO
- Fix improperly capitalized `interface`

MFC after: 1 week
2015-11-23 00:39:48 +00:00
Enji Cooper
6c4edcb26a Bump .Dd 2015-11-22 23:16:15 +00:00
Enji Cooper
d1241b1501 Recommend cc -Wall instead of gcc -Wall
MFC after: 1 week
2015-11-22 23:15:44 +00:00
Alexander Motin
6d2a1fbf23 Add API to obtain primary enclosure name and ID for /dev/sesX devices.
sesX device number may change between reboots, so to properly identify
the instance we need more data.  Name and ID reported here may mach ones
reported by SCSI device, but that is not really required by specs.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2015-11-21 10:22:01 +00:00
Brad Davis
59dad225f1 Remove a link to the now defunct "Release Engineering of Third Party Packages".
PR:		202803
Submitted by:	Tobias Kortkamp <tobias.kortkamp@gmail.com>
MFC after:	1 week
2015-11-21 00:35:40 +00:00
Warner Losh
dbd69b0dc4 Add aarch64 support to CPUTYPE 2015-11-20 21:49:49 +00:00
Ravi Pokala
e38d647a53 Add myself (rpokala) and my mentor (jhb)
Approved by:	jhb (mentor)
Differential Revision:	https://reviews.freebsd.org/D4231
2015-11-20 21:03:04 +00:00
Bryan Drewery
1da1353262 META MODE: Don't stage INTERNALPROGs.
This is only for sys/boot.  INTERNALPROG is not a build tool, it is just a way
to generate OBJS from a list of SRCS and use those objects elsewhere.

Sponsored by:	EMC / Isilon Storage Division
2015-11-20 00:22:55 +00:00
Bryan Drewery
86dd299005 Remove unsupported ia64.
Sponsored by:	EMC / Isilon Storage Division
2015-11-19 22:54:37 +00:00
Warner Losh
828b0885d9 Add arm CPUTYPE values typically used on FreeBSD. 2015-11-19 17:06:12 +00:00
Jonathan T. Looney
1067a2ba68 Consistently enforce the restriction against calling malloc/free when in a
critical section.

uma_zalloc_arg()/uma_zalloc_free() may acquire a sleepable lock on the
zone. The malloc() family of functions may call uma_zalloc_arg() or
uma_zalloc_free().

The malloc(9) man page currently claims that free() will never sleep.
It also implies that the malloc() family of functions will not sleep
when called with M_NOWAIT. However, it is more correct to say that
these functions will not sleep indefinitely. Indeed, they may acquire
a sleepable lock. However, a developer may overlook this restriction
because the WITNESS check that catches attempts to call the malloc()
family of functions within a critical section is inconsistenly
applied.

This change clarifies the language of the malloc(9) man page to clarify
the restriction against calling the malloc() family of functions
while in a critical section or holding a spin lock. It also adds
KASSERTs at appropriate points to make the enforcement of this
restriction more consistent.

PR:		204633
Differential Revision:	https://reviews.freebsd.org/D4197
Reviewed by:	markj
Approved by:	gnn (mentor)
Sponsored by:	Juniper Networks
2015-11-19 14:04:53 +00:00
Hans Petter Selasky
22f2c49ab1 Add the mlx5 and mlx5en modules to the i386 and amd64 kernel builds by
default and add a manual page for mlx5en. The mlx5 module contains
shared code for both infiniband and ethernet. The mlx5en module
contains specific code for ethernet functionality only. A mlx5ib
module is in the works for infiniband support.

Supported hardware:
- ConnectX-4: 10/20/25/40/50/56/100Gb/s speeds.
- ConnectX-4 LX: 10/25/40/50Gb/s speeds (low power consumption)

Refer to the mlx5en(4) manual page for a comprehensive list.

The team porting the mlx5 driver(s) to FreeBSD:
- Hans Petter Selasky <hselasky@freebsd.org>
- Oded Shanoon <odeds@mellanox.com>
- Meny Yossefi <menyy@mellanox.com>
- Shany Michaely <shanim@mellanox.com>
- Shahar Klein <shahark@mellanox.com>
- Daria Genzel <dariaz@mellanox.com>
- Mark Bloch <markb@mellanox.com>

Differential Revision:	https://reviews.freebsd.org/D4163
Submitted by:	Mark Block <markb@mellanox.com>
Sponsored by:	Mellanox Technologies
Reviewed by:	gnn @
MFC after:	3 days
2015-11-19 12:55:43 +00:00
Mark Johnston
1b9254f885 Add support for a configurable output channel to witness(4).
This is useful in environments where system configuration is performed by
automated interaction with the system console, since unexpected witness
output makes such automation difficult. With this change, the new
debug.witness.output_channel sysctl allows one to specify that witness
output is to be printed to the kernel log (using log(9)) rather than the
console.

Reviewed by:	cem, jhb
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4183
2015-11-19 05:56:59 +00:00
Mark Johnston
07713dde22 Add vlog(9).
Reviewed by:	cem, jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D4183
2015-11-19 05:50:22 +00:00
Warner Losh
17f6dfcca0 Fix missing endif. 2015-11-19 03:55:44 +00:00
Warner Losh
129898e521 Fix mips CPUTYPE so that we can pass it through to gcc.
Keep old CPUTYPEs around for compatibility. Also include
a list of typical values for FreeBSD.

# Split out from other changes in D4155

Differential Revision: https://reviews.freebsd.org/D4155
2015-11-19 03:11:20 +00:00
Bryan Drewery
f35c8b65a6 FAST_DEPEND: Similar to r290629, do always depend on headers if 'make depend'
has not ran yet.

This fixes building objects directly, or skipping 'make depend', not generating
required headers first.  This case did work without FAST_DEPEND so there's no
reason it should not work here as well.

An example of this can be seen building in gnu/usr.bin/binutils/libbfd
without running 'make depend' first to generate config.h.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	3 weeks
X-MFC-With:	r290433
2015-11-19 00:45:36 +00:00
Simon J. Gerraty
dba62d8dcf Default MK_META_MODE from MK_DIRDEPS_BUILD
This allows most of the build to simply consider MK_META_MODE

Update to latest dirdeps.mk so we can do:

make -f dirdeps.mk bin/cat.i386

Reviewed by:	bdrewery
2015-11-16 22:50:23 +00:00
Baptiste Daroussin
1d211085ac Bring back a couple of ISO8859-15 locales:
- af_ZA.ISO8859-15
- en_AU.ISO8859-15
- en_CA.ISO8859-15
- en_NZ.ISO8859-15
- en_US.ISO8859-15
- fr_CA.ISO8859-15
2015-11-16 12:58:47 +00:00
Baptiste Daroussin
fdce42be6c Add missing alias for zh_CN.UTF-8 2015-11-16 09:48:09 +00:00
Craig Rodrigues
950e4fbd37 Fix path for symlinks.
Reviewed by:	ngie
2015-11-16 04:02:24 +00:00
Enji Cooper
6c40e2d68c Add NO_WERROR and WARNS to PROG_OVERRIDE_VARS for bsd.prog.mk compatibility
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-15 18:51:48 +00:00
Baptiste Daroussin
c1c9ab6707 Regenerate locales after readding ISO8859-1 for locales that have ISO8859-15
Requested by:	arche
2015-11-15 14:51:10 +00:00
Baptiste Daroussin
71463bf550 Simplify a bit the aliases generation 2015-11-15 13:09:08 +00:00
Baptiste Daroussin
a2d97cfaf4 Rework locale-links to not make symlinks on directories but symlinks on files
The goal here is to make the upgrade seamless for users
Add aliases for zh_HK
Remove bad symlinks created by previous bad upgrade procedure.
Complete ObsoleteFiles.inc with more locales that have been removed
2015-11-15 12:44:31 +00:00
Warner Losh
f894f17244 Fix URL for powerpc cpu options. Remove reference to ia64 options as
no longer relevant.
2015-11-14 06:18:50 +00:00
Simon J. Gerraty
32b5dc9a48 Regen src.conf.5 2015-11-14 04:50:28 +00:00
Simon J. Gerraty
948f327ee4 Rename META_MODE option to DIRDEPS_BUILD
This allows META_FILES option to be renamed META_MODE.
Also add META_COOKIE_TOUCH for use in targets that can benefit
from a cookie when in meta mode.

Differential Revision:	https://reviews.freebsd.org/D4153
Reviewed by:	bdrewery
2015-11-14 03:24:48 +00:00
Randall Stewart
7c4676ddee This fixes several places where callout_stops return is examined. The
new return codes of -1 were mistakenly being considered "true". Callout_stop
now returns -1 to indicate the callout had either already completed or
was not running and 0 to indicate it could not be stopped.  Also update
the manual page to make it more consistent no non-zero in the callout_stop
or callout_reset descriptions.

MFC after:	1 Month with associated callout change.
2015-11-13 22:51:35 +00:00
Bryan Drewery
2224fae179 META MODE: Don't double stage SYMLINKS for shared libraries.
This also fixes truncating the path that the links were installed to, which
was most likely going to be the same directory the library was in anyhow.

Let bsd.sys.mk handle SYMLINKS via stage_symlinks.  stage_libs continues to
handle the SHLIB_LINK though since it is not a SYMLINKS.

This fixes a race, seen easily in lib/libthr, where libpthread_p.a is created
by both stage_libs and stage_symlinks resulting in 'ln: File exists'.

Sponsored by:	EMC / Isilon Storage Division
Discussed with:	sjg
2015-11-13 22:27:24 +00:00
Bryan Drewery
c04d716b55 Revert r290740.
Discussing with sjg@, we agree the better fix is to be done in meta.stage.mk.

This also broke staging of SYMLINKS for non-shared libraries, such as for
lib/libcompiler_rt, which results in all Makefile.depend removing it.

Sponsored by:	EMC / Isilon Storage Division
2015-11-13 20:25:30 +00:00
Bryan Drewery
08682b1bdf bsd.doc.mk: Similar to r289391, make installing to a missing directory an error.
This avoids the problems fixed in r290772.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	2 weeks
2015-11-13 17:27:23 +00:00
Bryan Drewery
e13d8c1244 META MODE: Don't double stage SYMLINKS for libraries.
meta.stage.mk is handling ${SYMLINKS:T} for stage_libs already.  The logic in
bsd.sys.mk to handle ${SYMLINKS} was brought in r247817 when it was moved out
of bsd.prog.mk and bsd.lib.mk into bsd.sys.mk.  The logic previously was
limited to bsd.prog.mk.

This fixes a race, seen easily in lib/libthr, where libpthread_p.a is created
by both stage_libs and stage_symlinks resulting in 'ln: File exists'.

Sponsored by:	EMC / Isilon Storage Division
2015-11-13 01:47:56 +00:00
Conrad Meyer
1d63d4c8c5 kern_testfrwk.9: Clean up manual page style
Igor has many less complaints now.  I think the two remaining are bogus, but I
am also not sure why Igor is producing them.

The page still needs more work.

Sponsored by:	EMC / Isilon Storage Division
2015-11-12 18:42:06 +00:00
Warner Losh
1f66462968 NO_CPU_OPTFLAGS doesn't exist, so don't document it. 2015-11-12 17:23:31 +00:00
Randall Stewart
f5206d3f71 Some basic documentation (a man page) on kern_testfrwk 2015-11-12 11:42:01 +00:00
Bryan Drewery
00bd6d0f08 Move META MODE's HOST_CC/CXX/CPP setting to local.meta.sys.mk, which
centralizes the handling of CC and HOST_CC.

This fixes a bug with WITH_CCACHE_BUILD when using MACHINE=host since
CC is overridden in local.init.mk via src.opts.mk long before bsd.compiler.mk
is included.

Originally the ccache implementation was placed in local.init.mk but moved
to bsd.compiler.mk as it seemed more proper and avoided other ordering
issues.

Sponsored by:	EMC / Isilon Storage Division
2015-11-11 23:52:08 +00:00
Randall Stewart
96eacdfdc2 Add the MLINK for async_drain Thanks Edward for the pointer.
MFC after:	1 month
2015-11-11 23:10:09 +00:00
Bryan Drewery
d4ea5890a8 Use explicit filename when creating locale symlinks to avoid creating a
directory symlink when the target directory does not exist.  This will
cause an error instead of a broken setup.

Sponsored by:	EMC / Isilon Storage Division
2015-11-11 18:45:48 +00:00
Randall Stewart
18b4fd62e0 Add new async_drain to the callout system. This is so-far not used but
should be used by TCP for sure in its cleanup of the IN-PCB (will be coming shortly).

Sponsored by:	Netflix Inc.
Differential Revision:	https://reviews.freebsd.org/D4076
2015-11-10 14:49:32 +00:00
Enji Cooper
7c357fe0ee Move the MK_BLUETOOTH block down below the architecture specific sections by the
other generic options

MFC after: 3 days
X-MFC with: r290659
PR: 193260
Sponsored by: EMC / Isilon Storage Divisions
2015-11-10 13:32:05 +00:00
Enji Cooper
44642b54ec - Move ng_bluetooth.4 under MK_BLUETOOTH != no
- Move all section 5 bluetooth manpages under MK_BLUETOOTH != no

MFC after: 3 days
PR: 193260
Reported by: Philippe Michel <philippe.michel7@sfr.fr>
Sponsored by: EMC / Isilon Storage Division
2015-11-10 13:28:41 +00:00
Bryan Drewery
b03ca5c3ec FAST_DEPEND: Fix building of wrong source files in some cases.
Similar to the original reason for these dependency hints to be added,
in r124637, the missing-dependency file case can lead to building of the
wrong source.

A clear example of this is in gnu/lib/libstdc++ where the .PATH contains
both contrib/gcc and contrib/libstdc++/src.

  contrib/gcc has a debug.c.
  contrib/libstdc++/src has a debug.cc.

  When building for the objects of debug.o, debug.So, and debug.po, it is
  ambiguous for which src file to use due to the suffix transformation
  rules, even though the proper one is listed first in .PATH.

  This was normally avoided due to these dependency hints for the initial
  build, and then mkdep would add an explicit 'debug.o: debug.cc'
  dependency into the .depend file.  WITH_FAST_DEPEND does not generate
  the .depend file with these, but puts them into .depend.debug.o instead.

Rather than extending the exists() check to each object's .depend.*
file, just enable the hint when when using WITH_FAST_DEPEND.  It fixes
the problem and seems to be safe enough to use since it is mapping SRCS
back to OBJS, rather than letting make make assumptions from OBJS to
SRCS.

A similar check mapping objects to headers is present in some mk files
but was not extended here for FAST_DEPEND since it has not yet been
found to be a problem.

X-MFC-With:	r290433
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-11-09 23:37:04 +00:00
Baptiste Daroussin
50c7c757a4 Regenerate timedef now that the tools pad CJK correctly 2015-11-09 22:09:38 +00:00
Mark Johnston
635458bc06 Add a manual page for PHOLD() and friends.
MFC after:	1 week
2015-11-08 01:41:44 +00:00
Bryan Drewery
1c01e4f876 Regen after r290526 for WITH_CCACHE_BUILD. 2015-11-08 00:54:41 +00:00
Bryan Drewery
9160419c7a Add built-in ccache build support via WITH_CCACHE_BUILD option.
ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not
used to achieve a safe pseudo-incremental build.  This is explained in
more detail upstream [1] [2].  It incurs about a 20%-28% hit to populate the
cache, but with a full cache saves 30-50% in build times.  When combined with
the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the
resulting dependency file, which it does not do when using mkdep(1)/'CC
-E'.  Stats are provided at the end of this message.

This removes the need to modify /etc/make.conf with the CC:= and CXX:=
lines which conflicted with external compiler support [3] (causing the
bootstrap compiler to not be built which lead to obscure failures [4]),
incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid
Clang errors with parenthesis, and did not work with META_MODE.

The option name was picked to match the existing option in ports.  This
feature is available for both in-src and out-of-src builds that use
/usr/share/mk.

Linking, assembly compiles, and pre-processing avoid using ccache since it is
only overhead.  ccache does nothing special in these modes, although there is
no harm in calling it for them.

CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap
compiler to hash the content of the compiler binary to determine if it
should be a cache miss.  For external compilers the 'mtime' option is used
as it is more efficient and likely to be correct.  Future work may optimize the
'content' check using the same checks as whether a bootstrap compiler is needed
to be built.

The CCACHE_CPP2 pessimization is currently default in our devel/ccache
port due to Clang requiring it.  Clang's -Wparentheses-equality,
-Wtautological-compare, and -Wself-assign warnings do not mix well with
compiling already-pre-processed code that may have expanded macros that
trigger the warnings.  GCC has so far not had this issue so it is allowed to
disable the CCACHE_CPP2 default in our port.

Sharing a cache between multiple checkouts, or systems, is explained in
the ccache manual.  Sharing a cache over NFS would likely not be worth
it, but syncing cache directories between systems may be useful for an
organization.  There is also a memcached backend available [5].  Due to using
an object directory outside of the source directory though you will need to
ensure that both are in the same prefix and all users use the same layout.  A
possible working layout is as follows:
  Source: /some/prefix/src1
  Source: /some/prefix/src2
  Source: /some/prefix/src3
  Objdir: /some/prefix/obj
  Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj'
This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace
all absolute paths to be relative.  Using something like this is required due
to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache
adds into its hash for the object without CCACHE_BASEDIR.

distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc.
I have not personally tested this and assume it will not mix well with
using the bootstrap compiler.

The cache from buildworld can be reused in a subdir by first running
'make buildenv' (from r290424).

Note that the cache is currently different depending on whether -j is
used or not due to ccache enabling -fdiagnostics-color automatically if
stderr is a TTY, which bmake only does if not using -j.

The system I used for testing was:
  WITNESS
  Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes
  DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
        The arc was fully populated with src tree files and ccache objects.
  RAM: 76GiB
  CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
       2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16

The WITH_FAST_DEPEND feature was used for comparison here as well to show
the dramatic time savings with a full cache.

buildworld:
  x buildworld-before
  + buildworld-ccache-empty
  * buildworld-ccache-full
  % buildworld-ccache-full-fastdep
  # buildworld-fastdep
  +-------------------------------------------------------------------------------+
  |%            *                               #                                +|
  |%            *                               #                                +|
  |%            *                               #             xxx                +|
  |                                                           |A                  |
  |                                                                              A|
  |             A                                                                 |
  |A                                                                              |
  |                                             A                                 |
  +-------------------------------------------------------------------------------+
      N           Min           Max        Median           Avg        Stddev
  x   3       3744.13       3794.31       3752.25     3763.5633     26.935139
  +   3          4519       4525.04       4520.73       4521.59     3.1104823
  Difference at 95.0% confidence
          758.027 +/- 43.4565
          20.1412% +/- 1.15466%
          (Student's t, pooled s = 19.1726)
  *   3       1823.08        1827.2       1825.62        1825.3     2.0785572
  Difference at 95.0% confidence
          -1938.26 +/- 43.298
          -51.5007% +/- 1.15045%
          (Student's t, pooled s = 19.1026)
  %   3       1266.96       1279.37       1270.47     1272.2667     6.3971113
  Difference at 95.0% confidence
          -2491.3 +/- 44.3704
          -66.1952% +/- 1.17895%
          (Student's t, pooled s = 19.5758)
  #   3       3153.34       3155.16        3154.2     3154.2333    0.91045776
  Difference at 95.0% confidence
          -609.33 +/- 43.1943
          -16.1902% +/- 1.1477%
          (Student's t, pooled s = 19.0569)

buildkernel:
  x buildkernel-before
  + buildkernel-ccache-empty
  * buildkernel-ccache-empty-fastdep
  % buildkernel-ccache-full
  # buildkernel-ccache-full-fastdep
  @ buildkernel-fastdep
  +-------------------------------------------------------------------------------+
  |#                        @   %                  *                              |
  |#                        @   %                  *     x                      + |
  |#                        @   %                  *     xx                     ++|
  |                                                      MA                       |
  |                                                                             MA|
  |                                                A                              |
  |                             A                                                 |
  |A                                                                              |
  |                         A                                                     |
  +-------------------------------------------------------------------------------+
      N           Min           Max        Median           Avg        Stddev
  x   3        571.57        573.94        571.79     572.43333     1.3094401
  +   3        727.97        731.91        728.06     729.31333     2.2492295
  Difference at 95.0% confidence
          156.88 +/- 4.17129
          27.4058% +/- 0.728695%
          (Student's t, pooled s = 1.84034)
  *   3         527.1        528.29        528.08     527.82333    0.63516402
  Difference at 95.0% confidence
          -44.61 +/- 2.33254
          -7.79305% +/- 0.407478%
          (Student's t, pooled s = 1.02909)
  %   3         400.4        401.05        400.62        400.69     0.3306055
  Difference at 95.0% confidence
          -171.743 +/- 2.16453
          -30.0023% +/- 0.378128%
          (Student's t, pooled s = 0.954969)
  #   3        201.94        203.34        202.28        202.52    0.73020545
  Difference at 95.0% confidence
          -369.913 +/- 2.40293
          -64.6212% +/- 0.419774%
          (Student's t, pooled s = 1.06015)
  @   3        369.12        370.57         369.3     369.66333    0.79033748
  Difference at 95.0% confidence
          -202.77 +/- 2.45131
          -35.4225% +/- 0.428227%
          (Student's t, pooled s = 1.0815)

[1] https://ccache.samba.org/performance.html
[2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html
[3] https://reviews.freebsd.org/D3484
[5] https://github.com/jrosdahl/ccache/pull/30

PR:		182944 [4]
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
Relnotes:	yes
2015-11-08 00:50:18 +00:00
Bryan Drewery
dbced32af5 FAST_DEPEND: Don't enable when .MAKE.MODE=meta.
This is because the .meta files generated from filemon already contain a
list of all files read to generate the object.

X-MFC-With:	r290433
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-11-08 00:50:13 +00:00
Bryan Drewery
3cccdc9d58 FAST_DEPEND: Don't include depend files when using 'make -V'.
This is especially noticeable in the kernel obj directory since it
includes so many files.

X-MFC-With:	r290433
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-11-08 00:50:09 +00:00
Hajimu UMEMOTO
ce8fe66f49 Fix alignment of the short month names for CJK locales,
as far as I could edit them.
2015-11-07 23:54:14 +00:00
Baptiste Daroussin
f2687dd117 Readd LOCALEDIR definition removed by accident 2015-11-07 11:26:14 +00:00
Baptiste Daroussin
3e4f384ed2 Merge from head r290483 2015-11-07 11:02:33 +00:00
Conrad Meyer
457e3a6875 Another follow-up to r290475: Bump .Dd in sysctl_add_oid.9
Sponsored by:	EMC / Isilon Storage Division
2015-11-07 01:58:17 +00:00
Conrad Meyer
be87839e56 Round out SYSCTL macros to the full set of fixed-width types
Add S8, S16, S32, and U32 types;  add SYSCTL*() macros for them, as well
as for the existing 64-bit types.  (While SYSCTL*QUAD and UQUAD macros
already exist, they do not take the same sort of 'val' parameter that
the other macros do.)

Clean up the documented "types" in the sysctl.9 document.  (These are
macros and thus not real types, but the manual page documents intent.)

The sysctl_add_oid(9) arg2 has been bumped from intptr_t to intmax_t to
accommodate 64-bit types on 32-bit pointer architectures.

This is just the kernel support piece; the userspace sysctl(1) support
will follow in a later patch.

Submitted by:	Ravi Pokala <rpokala@panasas.com>
Reviewed by:	cem
Relnotes:	no
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D4091
2015-11-07 01:43:01 +00:00
Bryan Drewery
8260928dfd The 'buildenv' target can safely be ran with '+'. 2015-11-06 21:49:17 +00:00
Steven Hartland
c1be893c44 Add sysctl to control LACP strict compliance default
Add net.link.lagg.lacp.default_strict_mode which defines
the default value for LACP strict compliance for created
lagg devices.

Also:
* Add lacp_strict option to ifconfig(8).
* Fix lagg(4) creation examples.
* Minor style(9) fix.

MFC after:	1 week
2015-11-06 15:33:27 +00:00
Bryan Drewery
e85d791ca2 Regenerate for WITH_FAST_DEPEND in r290433. 2015-11-06 05:32:18 +00:00
Bryan Drewery
cf1eeb33be Add a FAST_DEPEND option, off by default, which speeds up the build significantly.
This speeds up buildworld by 16% on my system and buildkernel by 35%.

Rather than calling mkdep(1), which is just a wrapper around 'cc -E',
use the modern -MD -MT -MF flags to gather and generate dependencies during
compilation.  This flag was introduced in GCC "a long time ago", in GCC 3.0,
and is also supported by Clang.  (It appears that ICC also supports this but I
do not have access to test it).  This avoids running the preprocessor *twice*
for every build, in both 'make depend' and 'make all'.  This is especially
noticeable when using ccache since it does not cache preprocessor results from
mkdep(1) / 'cc -E', but still speeds up compilation with the -MD flags.

For 'make depend' a tree-walk is still done to ensure that all DPSRCS
are generated when expected, and that beforedepend/afterdepend and
_EXTRADEPEND are all still respected.  In time this may change but for now
I've been conservative.  The time for a tree-walk with -j combined with
SUBDIR_PARALLEL is not significant.  For example, it takes about 9 seconds
with -j15 to walk all of src/ for 'make depend' now on my system.

A .depend file is still generated with the various rules that apply to
the final target, or custom rules.  Otherwise there are now
per-built-object-file .depend files, such as .depend.filename.o.  These
are included directly by make rather than populating .depend with a loop
and .depend lines, which only added overhead to the now almost-NOP 'make
depend' phase.

Before this I experimented with having mkdep(1) called in parallel per-file.
While this improved the kernel and lib/libc 'make depend' phase, it resulted
in slower build times overall.

The -M flags are removed from CFLAGS when linking since they have no effect.

Enabling this by default, for src or out-of-src, can be done once more testing
has been done, such as a ports exp-run, and with more compilers.

The system I used for testing was:
  WITNESS
  Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_FAST_DEPEND=yes
  DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
        The arc was fully populated with src tree files.
  RAM: 76GiB
  CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
       2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16

buildworld:
  x buildworld-before
  + buildworld-fastdep
  +-------------------------------------------------------------------------------+
  |+                                                                              |
  |+                                                                              |
  |+                                                                       xx    x|
  |                                                                       |_MA___||
  |A                                                                              |
  +-------------------------------------------------------------------------------+
      N           Min           Max        Median           Avg        Stddev
  x   3       3744.13       3794.31       3752.25     3763.5633     26.935139
  +   3       3153.34       3155.16        3154.2     3154.2333    0.91045776
  Difference at 95.0% confidence
          -609.33 +/- 43.1943
          -16.1902% +/- 1.1477%
          (Student's t, pooled s = 19.0569)

buildkernel:
  x buildkernel-before
  + buildkernel-fastdep
  +-------------------------------------------------------------------------------+
  |+                                                                            x |
  |++                                                                           xx|
  |                                                                             A||
  |A|                                                                             |
  +-------------------------------------------------------------------------------+
      N           Min           Max        Median           Avg        Stddev
  x   3        571.57        573.94        571.79     572.43333     1.3094401
  +   3        369.12        370.57         369.3     369.66333    0.79033748
  Difference at 95.0% confidence
          -202.77 +/- 2.45131
          -35.4225% +/- 0.428227%
          (Student's t, pooled s = 1.0815)

Sponsored by:	EMC / Isilon Storage Division
MFC after:	3 weeks
Relnotes:	yes
2015-11-06 04:45:29 +00:00
John Baldwin
db41d262d3 When dumping an rman in DDB, include the RID of each resource.
Submitted by:	Ravi Pokala (rpokala@panasas.com)
Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D4086
2015-11-05 23:12:23 +00:00
Adrian Chadd
791b3571a2 remove \, it confuses things. 2015-11-05 22:50:21 +00:00
Bryan Drewery
0e9c4ca8b1 Correct a comment which appears to be mistakingly mechanically changed in r265420.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-05 22:42:40 +00:00
Bryan Drewery
208f108362 Allow 'make buildenv' to work anywhere in the src tree.
Sponsored by:	EMC / Isilon Storage Division
2015-11-05 22:28:31 +00:00
John Baldwin
87dd2f95d2 Add a new helper function for PCI devices to locate the upstream
PCI-express root port of a given PCI device.

Reviewed by:	kib, imp
MFC after:	1 week
Sponsored by:	Chelsio
Differential Revision:	https://reviews.freebsd.org/D4089
2015-11-05 21:27:25 +00:00
John Baldwin
ec603c7297 Add helper routines for PCI device drivers to read, write, and modify
PCI-Express capability registers (that is, PCI config registers in the
standard PCI config space belonging to the PCI-Express capability
register set).

Note that all of the current PCI-e registers are either 16 or 32-bits,
so only widths of 2 or 4 bytes are supported.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Chelsio
Differential Revision:	https://reviews.freebsd.org/D4088
2015-11-05 21:26:06 +00:00
Alan Somers
5608c7687f Update authors' contact info and fix grammar bugs.
MFC after:	2 weeks
Sponsored by:	Spectra Logic
2015-11-05 17:04:18 +00:00
Craig Rodrigues
a36eca08bb Rename libohash to libopenbsd.
libopenbsd is an internal library which
to bring in compatibility stuff from OpenBSD.
This will allow us to bring in more
OpenBSD utilities into the FreeBSD base system.

We similarly use libnetbsd for bringing in stuff from NetBSD.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D4078
2015-11-04 07:20:55 +00:00
Baptiste Daroussin
5f3d3dac66 Remove short versions of locales totally for now
They were never supported, and the encoding they should use is somehow
controversial, they could be added later if we really need them and once
one has decided which encoding they should use
2015-11-03 22:24:02 +00:00
Baptiste Daroussin
777f99d802 On FreeBSD users have the habbit of ja_JP.eucJP there is no point in added
a lowercase alias
2015-11-03 22:06:24 +00:00
Baptiste Daroussin
bbf9b32c55 There is no point in providing en_US.ISO-8859-1 and en_US.ISO8859-1 let's be
consistent with other locale and only provide en_US.ISO8859-1
2015-11-03 22:02:34 +00:00
Baptiste Daroussin
e8e2eb220a Use ${SHAREDIR} instead of hardcoding /usr/share 2015-11-03 21:58:32 +00:00
Baptiste Daroussin
ba697617ff Make all new shortname locales point use the UTF-8 encoding 2015-11-03 21:57:58 +00:00
Baptiste Daroussin
314a40cd33 locales: Remove symlinks UTF8 => UTF-8
In retrospect, having an alias for UTF-8 does not bring any real benefits
and it can cause confusion.  Let's remove this *.UTF8 locale symlinks
which is closer to the convention of the other BSDs.

GCC testsuite is also removing utf8 and UTF8 locales for portability
with BSD.

Submitted by:	marino
Obtained from:	DragonflyBSD
2015-11-02 23:04:49 +00:00
Enji Cooper
55972acf7f Conditionally install (if_)?(otus|rsu).4, otusfw.4, rsufw.4, and urtwn.4 if
MK_USB != no

Add the manpages to OptionalObsoleteFiles.inc

As a side-effect, this also fixes installworld with MK_USB == no

X-MFC with: r290128
Sponsored by: EMC / Isilon Storage Division
2015-11-02 00:39:28 +00:00
Baptiste Daroussin
2e4863a601 Fix symlink for zh_TW.Big5 locale 2015-11-01 23:48:16 +00:00
Baptiste Daroussin
3c3feed41a Merge from head 2015-11-01 21:17:38 +00:00
Michal Meloun
11113be653 Install myself as src committer.
Approved by:	kib (mentor)
2015-11-01 16:54:55 +00:00
Conrad Meyer
faefad9c12 ioat: Handle channel-fatal HW errors safely
Certain invalid operations trigger hardware error conditions.  Error
conditions that only halt one channel can be detected and recovered by
resetting the channel.  Error conditions that halt the whole device are
generally not recoverable.

Add a sysctl to inject channel-fatal HW errors,
'dev.ioat.<N>.force_hw_error=1'.

When a halt due to a channel error is detected, ioat(4) blocks new
operations from being queued on the channel, completes any outstanding
operations with an error status, and resets the channel before allowing
new operations to be queued again.

Update ioat.4 to document error recovery;  document blockfill introduced
in r290021 while we are here;  document ioat_put_dmaengine() added in
r289907;  document DMA_NO_WAIT added in r289982.

Sponsored by:	EMC / Isilon Storage Division
2015-10-31 20:38:06 +00:00
Bryan Drewery
4e461ce12d Don't hide stderr when checking ${CC} --version.
This can have important debugging information such as 'cc: not found' or
'ccache: error: Could not find compiler "cc" in PATH'.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-31 02:07:30 +00:00
Enji Cooper
d04fda6cc4 Unbreak bsd.progs.mk with PROGS (but not PROGS_CXX) and when invoking the
"one of many" targets, e.g. `make hello_world`, where hello_world is a C
program

Tested with: PROGS and PROGS_CXX
MFC after: 1 week
X-MFC with: r289289
Sponsored by: EMC / Isilon Storage Division
2015-10-30 06:07:41 +00:00
Svatopluk Kraus
4547d42225 Install myself as src committer.
Approved by:	kib (mentor)
2015-10-29 21:40:32 +00:00
Jonathan T. Looney
df1475e542 Add myself (jtl) and my mentor to the committers-src.dot file.
Approved by:	gnn (mentor)
Differential Revision:	https://reviews.freebsd.org/D4029
2015-10-29 21:00:11 +00:00
Alexander Motin
043fd51a74 Some minor additions to r290138, 2015-10-29 10:31:44 +00:00
Alexander Motin
0fd0e797e8 Some updates to isp(4) manual page. 2015-10-29 09:50:48 +00:00
Kevin Lo
52eab858c0 Add MLINKS for if_otus(4), if_rsu(4) and if_urtwn(4). 2015-10-29 03:28:28 +00:00
Kevin Lo
5909575ebf Xref otus(4). 2015-10-29 03:22:27 +00:00
Bryan Drewery
0edd283235 Fix regression from using .USEBEFORE in _SUBDIR in r289705.
Using .USEBEFORE had the unintended side-effect of changing the directory for
the real target ran in the current directory.  For example this meant that
the 'make clean' would run in one of the SUBDIR.

Sponsored by:	EMC / Isilon Storage Division
Pointyhat to:	bdrewery
2015-10-29 00:41:03 +00:00
Warner Losh
c64c9b8e46 BUS_ADD_CHILD calls device_add_child. device_add_child does not call
BUS_ADD_CHILD. Make it explicit since it follows the command paradigm
rather than the callback paradigm. Add other clarifying notes as well.
2015-10-28 19:11:06 +00:00
Bryan Drewery
523e46d486 Use proper CONFDIR after r289148 2015-10-27 23:49:32 +00:00
Bryan Drewery
7d8f797b72 Use more appropriate ${SHAREDIR} rather than /usr/share.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-27 23:35:02 +00:00
Hiren Panchasara
356c7958a4 Add sysctl tunable net.inet.tcp.initcwnd_segments to specify initial congestion
window in number of segments on fly. It is set to 10 segments by default.

Remove net.inet.tcp.experimental.initcwnd10 which is now redundant. Also remove
the parent node net.inet.tcp.experimental as it's not needed anymore and also
because it was not well thought out.

Differential Revision:	https://reviews.freebsd.org/D3858
In collaboration with:	lstewart
Reviewed by:		gnn (prev version), rwatson, allanjude, wblock (man page)
MFC after:		2 weeks
Relnotes:		yes
Sponsored by:		Limelight Networks
2015-10-27 09:43:05 +00:00
Kurt Lidl
4faa71f113 Add myself and my mentors to the committers-src.dot file.
Approved by:	rpaulo (mentor)
Differential Revision:	https://reviews.freebsd.org/D4006
2015-10-27 03:48:42 +00:00
Bryan Drewery
222c700312 Spell CONFGROUPS properly. 2015-10-27 02:04:21 +00:00
Bryan Drewery
99330d7a24 META MODE: Fix after addition of bsd.confs.mk: Stage in "files" set.
The "files" staging name is not the same as "bsd.files.mk" but seems to just be
a group of extra files that are not the essential includes or libraries, which
include .

Sponsored by:	EMC / Isilon Storage Division
2015-10-27 01:29:38 +00:00
Bryan Drewery
b0be2b128f META MODE: Fix FILESNAME not being respected sans other FILES_group overrides.
This was fixed in bsd.incs.mk in r242801 already.

Sponsored by:	EMC / Isilon Storage Division
2015-10-26 23:28:35 +00:00
Bryan Drewery
7847b2337e META MODE: bsd.files.mk and bsd.confs.mk don't handle symlinks so there is no
need to set STAGE_SYMLINKS_DIR.${STAGE_SET}.

Sponsored by:	EMC / Isilon Storage Division
2015-10-26 22:31:57 +00:00
Enji Cooper
d53226d715 Use 't' (bit-field) not 'b' (bit-sized integral type) for describing MRIE (aka
"Method of Reporting Informational Exceptions") in the SCSI mode database.
T10/04-371 revision 2 (revision 4; page 2, table 1) describes it as a
bit-field of 4 bits wide.

1. http://www.t10.org/ftp/t10/document.04/04-371r2.pdf

This a recommit of head@r289913 to fix the original commit message, in
particular:
- I incorrectly claimed that unit change was 'i' -> 't'.
- The spec I reference in this commit is 2 decades newer than the one noted in
  r289913. The fields in the SCSI mode database are more complete in the newer
  spec, so it'll be easier for someone to decipher this commit if need be
  later.
- I screwed up the bug entry in the previous commit message

Pointyhat to: ngie (for botching up r289913)
PR: 200619
Reported by: Michael Baptist
Submitted by: Lars Skodje
Sponsored by: EMC / Isilon Storage Divisionf
2015-10-25 04:04:25 +00:00
Enji Cooper
e54187eb89 Revert r289913 -- I botched up the commit message by accident
Will redo the commit shortly
2015-10-25 03:22:21 +00:00
Enji Cooper
93709850e0 Use 't' (bits) not 'i' (bytes) for describing MRIE (aka
"Method of Reporting Informational Exceptions") in the SCSI mode database as
the field described in X3T10/94-190 (revision 4; page 2, table 1) [1.] is
4 bits wide, not 4 bytes wide

1. http://ftp.t10.org/ftp/t10/document.94/94-190r4.pdf

Bug 200619
MFC after: 1 week
Reported by: Michael Baptist <mbaptist@isilon.com>
Submitted by: Lars Skodje <lskodje@isilon.com>
Sponsored by: EMC / Isilon Storage Division
2015-10-25 03:16:08 +00:00
Bryan Drewery
8870ad3609 Sort properly.
MFC after:	1 week
X-MFC-With:	r289870
2015-10-24 05:00:20 +00:00
Bryan Drewery
ce3c9a36c5 Add bsd.crunchgen.mk to bsd.README.
MFC after:	1 week
2015-10-24 04:55:17 +00:00
Bryan Drewery
8758abd5b3 Slightly rework the comments and logic for default Clang/GCC.
This is because the previous version was very obscure about the fact
that despite having Clang "on by default" for architectures such as powerpc, it
does not actually build due to the GCC it uses not having C++11 support.
Using an external compiler that supports C++11 does allow this to work.
This whole block should be rethought more given "on by default" is not
really default without extra work which could actually be surprising for
why Clang is showing up when using a newer GCC.

Sponsored by:	EMC / Isilon Storage Division
2015-10-24 04:03:32 +00:00
Bryan Drewery
de606f83e0 Configs should not be under MK_INCLUDES control.
'buildconfig' is connected to 'all', but 'installconfig' is only called
manually.  There is not much need to conditionalize this file right
now due to how it is hooked up and its impact on various build phases.

Sponsored by:	EMC / Isilon Storage Division
2015-10-24 04:03:29 +00:00
Bryan Drewery
ccfb12d63a Rework r289778 to always parallelize known targets, without ordering.
- Rather than allow 'make clean*' to ignore dependencies, make a static
  list of targets in STANDALONE_SUBDIR_TARGETS that are known to be safe.
  This allows a user to override them if needed and avoids adding this feature
  to user-defined targets that are in ${SUBDIR_TARGETS}. [1]
- This now also allows to force SUBDIR_PARALLEL when calling these
  targets, since no dependencies are needed.

Reported by:	ian [1]
Sponsored by:	EMC / Isilon Storage Division
MFC after:	3 weeks
X-MFC-With:	r289778
2015-10-23 21:30:27 +00:00
Bryan Drewery
0d2a1539d1 Fix regression from r289734 that caused crunchgen "subdirs" to not be
properly recursed.

The .for loop was defining a ${__dir} variable that was being set at a
different evaluation time than the target itself, so every 'cd ${__dir}'
became the last value that was in ${__dir}.  This resulted in 'make obj'
not properly being ran in the tree that would leave .depend files
scattered around when 'make all' was ran in rescue/.

To fix this, define a CRUNCH_SRCDIR_* for every prog if it does not
already have one and then use that variable in every relevant place.
This allows simplifying some logic as well.

Reported by:	emaste
X-MFC-With:	r289734
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-23 19:41:58 +00:00
Conrad Meyer
fb61390c99 sysctl(9): Document U8/U16 types from r289773
Suggested by:	ngie
Sponsored by:	EMC / Isilon Storage Division
2015-10-23 15:08:16 +00:00
Bryan Drewery
2e35a44ce5 For SUBDIR_PARALLEL, when doing 'make clean*' or 'make obj' there is no need to
respect SUBDIR_DEPEND_* or .WAIT.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 23:41:56 +00:00
Bryan Drewery
c22afe52f4 Fix installation of manpages with WITHOUT_COMPRESS broken since r284685.
This partially reverts r284685.  An attempt was made in r285295 to fix this
but was not enough.  There were still $${} vars in the code that should have
been using the ${_page} and ${_sect} vars, but the bigger problem was that
.for cannot be used on .ALLSRC as it is not defined when the .for is evaluated.

Using ${MAN} here in a .for loop doesn't work either as the paths are not
expanded right for lib/libc/ subdirs despite having a .PATH set for all
of them.

Add some comments around long .else and .endif as well.

Sponsored by:	EMC / Isilon Storage Division
2015-10-22 22:29:25 +00:00
Conrad Meyer
9f2eb74093 getenv.9: Document behavior of freeenv(NULL)
Fix a couple igor(1)-indicated spelling issues while here.

Suggested by:	jhb
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 16:46:30 +00:00
Ed Schouten
2ff069a7bc Add support for CloudABI on ARM64.
It turns out that it is pretty easy to make CloudABI work on ARM64. We
essentially only need to copy over the sysvec from AMD64 and ensure that
we use ARM64 specific registers.

As there is an overlap between function argument and return registers,
we do need to extend cloudabi64_schedtail() to only set its values if
we're actually forking. Not when we're creating a new thread.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D3917
2015-10-22 11:09:25 +00:00
Bryan Drewery
cc104c812d Fix incorrect defined() usage from style clean up in r289735.
Submitted by:	ngie
MFC after:	2 weeks
X-MFC-With:	r289735
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 04:52:37 +00:00
Bryan Drewery
37bfb9b3bf Document that we use {} for variable expansion.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 04:50:52 +00:00
Bryan Drewery
d4f564c588 Fix style. Namely use {} rather than ().
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 04:47:52 +00:00
Bryan Drewery
5583e49be6 Rewrite crunchgen target handling for progs so that it can be parallelized.
This covers 'clean', 'cleandepend', 'cleandir', 'obj', 'objlink' and
'build-tools'.

This uses the same method as bsd.subdir.mk.

MFC after:	2 weeks
X-MFC-With:	r289731
Sponsored by:	EMC / Isilon Storage Division
2015-10-22 04:42:17 +00:00
Bryan Drewery
01d591d45b Clean up some bsd.crunchgen.mk issues.
- Remove handling of 'make -P' since that is for fmake only.
- Add '+' where appropriate for sub-make calls.
- Pass MK_TESTS=no to all of the sub-makes to prevent recursing into test
  directories for targets such as 'obj', 'clean', 'depend', etc.

Sponsored by:	EMC / Isilon Storage Division
2015-10-22 04:28:22 +00:00
Bryan Drewery
7f1636b75e Let SUBDIR_OVERRIDE with 'make buildworld' be more useful.
Now it can be used to effectively "build in a subdir".  It will use the
'cross-tools', 'libraries', and 'includes' phases of 'buildworld' to properly
setup a WORLDTMP to use.  Then it will build 'everything' only in the
listed SUBDIR_OVERRIDE directories.  It is still required to list custom
library directories in LOCAL_LIB_DIRS if SUBDIR_OVERRIDE is something
that contains libraries outside of the normal area (such as
SUBDIR_OVERRIDE=contrib/ofed needing LOCAL_LIB_DIRS=contrib/ofed/usr.lib)

Without these changes, SUBDIR_OVERRIDE with buildworld was broken or hit
obscure failures due to missing libraries, includes, or cross compiler.

SUBDIR_OVERRIDE with 'make <target that is not buildworld>' will continue to
work as it did before although its usefulness is questionable.

With a fully populated WORLDTMP, building with a SUBDIR_OVERRIDE with
-DNO_CLEAN only takes a few minutes to start building the target
directories.  This is still much better than building unneeded things via
'everything' when testing small subset changes.  A BUILDFAST or
SKIPWORLDTMP might make sense for this as well.

- Add in '_worldtmp' as we still need to create WORLDTMP as later targets,
  such as '_libraries' and '_includes' use it.  This probably was avoiding
  calling '_worldtmp' to not remove WORLDTMP for debugging purposes, but
  -DNO_CLEAN can be used for that.

- '_legacy' must be included since '_build-tools' uses -legacy.
  The SUBDIR_OVERRIDE change came in r95509, while -legacy being part
  of build-tools came in r113136.

- 'bootstrap-tools' is still skipped as this feature is not for
   upgrades.

- Fix buildworld combined with SUBDIR_OVERRIDE not installing all includes.

  The original change for SUBDIR_OVERRIDE in r95509 kept '_includes'
  and '_libraries' as building everything possible as the SUBDIR_OVERRIDE
  could need anything from them.  However in r96462 the real 'includes'
  target was changed from manual sub-makes to just recursing 'includes'
  on SUBDIR, thus not all includes have been installed into WORLDTMP since then
  when combined with 'buildworld'.

  This is not done unless calling 'make buildworld' as it would be
  unexpected to have it go into all directories when doing 'make
  SUBDIR_OVERRIDE=mydir includes'.

- Also need to build the cross-compiler so it is used with --sysroot.
  If this is burdensome then telling the build to use the local compiler
  as an external compiler (thus using a proper --sysroot to WORLDTMP) is
  possible by setting CC=/usr/bin/cc, CXX=/usr/bin/c++, etc.

- Don't build the lib32 distribution with SUBDIR_OVERRIDE in buildworld
  since it won't contain anything related to SUBDIR_OVERRIDE.  Testing
  of the lib32 build can be done with 'make build32'.

- Document these changes in build.7

Sponsored by:	EMC / Isilon Storage Division
MFC after:	2 weeks
2015-10-22 00:07:48 +00:00
Andriy Voskoboinyk
b4244a2779 Add myself (avos) to committers-src.dot
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3941
2015-10-21 22:31:17 +00:00
Bryan Drewery
7f5f4b449d Remove indirection of _sub target for using _SUBDIR.
This reverts r266473 as the need for it, working around .MAKE and '+'
issues, is no longer needed after r289460.  This avoids extra log
output in -j builds of '-- _sub.TARGET --' that are redundant with the
'-- TARGET --' and '-- TARGET_subdir_DIR --' entries already showing.

r266473 also made a subtle change in the ordering of _SUBDIR handling.  Before
the change, SUBDIRS were recursed into after building the TARGET due to the
.USE of _SUBDIR *appending* the commands onto the TARGET.  After the change
though the indirection caused TARGET to depend on _sub.TARGET which had the
_SUBDIR handling in it.  This TARGET would run after recursing.  However, the
SUBDIR_PARALLEL handling from r263778 has this ordering as well.  Since
this has so far not been a problem, for now make this behavior for
non-SUBDIR_PARALLEL use of _SUBDIR explicit by using .USEBEFORE.
Further research may change this back to .USE as well as the
SUBDIR_PARALLEL handling and bsd.progs.mk recursing.

Sponsored by:	EMC / Isilon Storage Division
2015-10-21 16:24:44 +00:00
Bryan Drewery
5d6be39a4b Fix building in a directory with SUBDIRs and SUBDIR_PARALLEL.
The SUBDIR_PARALLEL feature uses a .for dir in ${SUBDIR} loop.  The old code
here for recursing was setting SUBDIR= as a make *argument*.  The SUBDIR=
replacement was not actually handled until after the .for loop was unrolled.
This could be seen with a '.info ${SUBDIR} ${dir}' inside of the loop which
showed an empty ${SUBDIR} and a set ${dir}.  Setting NO_SUBIDR= before calling
${MAKE} as an *environment* variable handles the case fine and is a more
proper mechanism for disabling subdir handling.

This could be seen with 'make -C tests/sys/kern -j15 SUBDIR_PARALLEL=yes'.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-21 00:25:18 +00:00
Conrad Meyer
8b584e9d74 cpuset.9: Link to/from the new page
A follow-up to r289667.

Sponsored by:	EMC / Isilon Storage Division
2015-10-20 23:52:37 +00:00
Conrad Meyer
5546be25d6 Document cpuset(9)
A follow-up to r289467.

Coerced by:	jhb
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 23:48:14 +00:00
Bryan Drewery
13569c0ae5 Improve safety of caching from r289659 by only importing of none of the
variables are already set.  This should cover odd cases such as the
COMPILER_TYPE override in lib/csu/powerpc64.

X-MFC-With:	r289659
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 20:37:00 +00:00
Bryan Drewery
16a5c008cc Pass COMPILER_TYPE and COMPILER_VERSION to sub-makes to avoid redundant
lookups.

This uses a special variable name based on a hash of ${CC}, ${PATH}, and
${MACHINE} to ensure that a cached value is not used if any of these
values changes to use a new compiler.

Before this there were 34,620 fork/exec from bsd.compiler.mk during a buildworld.
After this there are 608.  More improvement is needed to cache a value from
the top-level before descending into subdirs in the various build phases.

Reviewed by:	brooks (earlier version)
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3898
2015-10-20 20:15:25 +00:00
Sergey Kandaurov
d712e17c96 o NetBSD 7.0, OpenBSD 5.8, FreeBSD 10.2, OS X 10.11 added. 2015-10-20 11:37:16 +00:00
Bryan Drewery
65d88005ef Replace all of the duplicated logic for recursing into a subdir with one
implementation.  It is duplicated at run-time but is more easily
maintainable now.

Sponsored by:	EMC / Isilon Storage Division
2015-10-19 23:34:35 +00:00
Bryan Drewery
e92818f2e6 Add missing .PHONY for parallel subdir target.
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-10-19 22:27:32 +00:00
Baptiste Daroussin
031c294c1d Merge from head 2015-10-19 11:51:10 +00:00
Enji Cooper
550d2b80ec Make libxo depend on libutil because it uses humanize_number after r287111
Remove overlinking in lib/libxo/tests, sbin/savecore, and
usr.bin/{iscsictl,wc,xo}

PR: 203673
Sponsored by: EMC / Isilon Storage Division
2015-10-18 07:30:50 +00:00
Enji Cooper
a52bef9c99 Only enable -fstack-protector-strong on gcc 4.9+ and default to -fstack-protector
when -fstack-protector-strong is not available, like it was implicitly before
r288669

As noted by antoine@, devel/gcc (which is 4.8.5) lacks -fstack-protector-strong
support, whereas 4.8.4i (devel/gcc48) has the support.

Until a version is available which has -fstack-protector-strong support, be
conservative and only enable support with 4.9+.

Reviewed by: pfg
X-MFC with: r288669, r289465
Differential Revision: https://reviews.freebsd.org/D3924
2015-10-18 04:07:40 +00:00
Conrad Meyer
7ebf41220c Document bitset(9) 2015-10-17 19:55:58 +00:00