Commit Graph

199396 Commits

Author SHA1 Message Date
Alexander Motin
f2c58daab8 Report link as up only if we managed to open tap device.
It would be cool to report tap device status, but it has no such API.

MFC after:	2 weeks
2015-04-20 14:23:18 +00:00
Alexander Motin
7144875388 Activate write-only optimization if bpf device opened with O_WRONLY.
dhclient opens bpf as write-only to send packets. It never reads received
packets from that descriptor, but processing them in kernel takes time.
Especially much time takes packet timestamping on systems with expensive
timecounter, such as bhyve guest, where network speed dropped in half.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2015-04-20 10:44:46 +00:00
Alexander Motin
d9a6698393 Disable RX/TX queues notifications when not needed.
This reduces CPU load and doubles iperf throughput, reaching 2-3Gbit/s.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2015-04-20 10:29:42 +00:00
Konstantin Belousov
a22fc06636 Remove code to support the top of the stack layout for FreeBSD 1.x/2.x
kernel, but keep explanation of the old ps_strings structure to make
it clear what sanity check tries to accomplish.

Noted by:	Oliver Pinter <oliver.pinter@hardenedbsd.org>
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-04-20 09:07:12 +00:00
Konstantin Belousov
19b5b56d7f Remove duplicate definitions of MWAIT_CX hints. Identical defines in
specialreg.h are enough.

Discussed with:	mav
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-04-20 08:25:55 +00:00
Simon J. Gerraty
023e89e5ef Import bmake-20150418 2015-04-20 03:45:54 +00:00
Eitan Adler
6f9b387301 find.1: Add missing whitespace:
Obtained from:	Dragonfly (dee38d02d51cc8316f82b0263158d2546f2398bc)
2015-04-20 02:23:00 +00:00
Eitan Adler
7d00295b1b ed(1): Fix [-Werror=logical-not-parentheses]
/usr/src/bin/ed/glbl.c:64:36: error: logical not is only applied to
	theleft hand side of comparison [-Werror=logical-not-parentheses]

Obtained from:	Dragonfly (1fff89cbaeaa43af720a1f23d9c466b756dd8a58)
MFC After:	1 month
2015-04-20 02:07:57 +00:00
Pedro F. Giffuni
a3a4b110da nfsrpc_createv4: fix double free.
Reported by:	Oliver Pinter, clang static checker
Obtained from:	HardenedBSD (commit 63cac77c42c0c3fc67da62f97d5ab651d52ae707)
Reviewed by:	rmacklem
MFC after:	5 days
2015-04-19 23:55:59 +00:00
Marius Strobl
7420755437 Make a comment reflect reality. 2015-04-19 20:20:52 +00:00
Marius Strobl
62def911bd Refine the workaround for Intel HSD131 [1] added in r269052:
- Use the full mask described by the erratum as with a sufficiently high
  number of these false-positives, the overflow bit (bit 62) additionally
  gets set [7].
- HSD131 has been brought into several other Haswell-derived CPUs including
  to the next generation, i. e. Intel Broadwell. Thus, also skip reporting of
  these benign errors by default on CPU models affected by HSM142, HSW131 and
  BDM48 [2 - 5], describing the HSD131 silicon bug for additional models.
  Also, Celeron 2955U with a CPU ID of 0x45 have been reported to be covered
  by this fault [6], with the specification update concerned with HSM142 [2]
  only referring to 0x3c and 0x46.

Submitted by:	David Froehlich [7]
MFC after:	3 days

http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-desktop-specification-update.pdf [1]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-mobile-specification-update.pdf [2]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/5th-gen-core-family-spec-update.pdf [3]
http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/core-m-processor-family-spec-update.pdf [4]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e3-1200v3-spec-update.pdf [5]
https://lists.freebsd.org/pipermail/freebsd-hackers/2015-January/046878.html [6]
2015-04-19 20:15:57 +00:00
Adrian Chadd
5d18c60a93 Refactor out the _PXM -> VM domain lookup done in ACPI, in preparation for
its use in upcoming code.

This is inspired by something in jhb's NUMA IRQ allocation patchset.

However, the tricky bit here is that the PXM lookup for a node may
fail, requiring a lookup on the parent node.  So if it doesn't
exist, don't fail - just go up to the parent.  Only error out of the
lookup is the ACPI lookup returns an error.

Sponsored by:	Norse Corp, Inc.
2015-04-19 17:15:55 +00:00
Adrian Chadd
56717743f2 Update pkt-gen to optionally use randomised source/destination
IPv4 addresses/ports.

When doing traffic testing of actual code that /does/ things to the
packet (rather than say, 'bridge.c'), it's typically a good idea to
use a variety of cache-busting and flow-tracking-busting packet
spreads.  The pkt-gen method of testing an IP range was to walk
it linearly - which is fine, but not useful enough.

This can be used to completely randomize the source/destination
addresses (eg to test out flow-tracking-busting) and to keep the
destination fixed whilst randomising the source (eg to test out
what a DDoS may look like.)

Tested:

* Intel ixgbe 10G (82599) netmap

Differential Revision:	https://reviews.freebsd.org/D2309
MFC after:	2 weeks
Sponsored by:	Norse Corp, Inc.
2015-04-19 17:07:51 +00:00
Kevin Lo
8aa853d5c1 Add new USB ID.
PR:	199522
2015-04-19 15:53:58 +00:00
Alexander V. Chernikov
0577d6e0d5 Fix use-after-free.
Reported by:	Coverity Scan, pfg
CID:		1245747
2015-04-19 12:49:30 +00:00
Alexander Motin
afdfc9a40d Change wcommitsize default from one empirical value to another.
The new value is more predictable with growing RAM size:

        hibufspace maxvnodes      old      new
i386:
  256MB   32980992     15800  2198732  2097152
    2GB   94027776    107677   878764  4194304
amd64:
  256MB   32980992     15800  2198732  2097152
    1GB  114114560     68062  1678155  4194304
    4GB  217055232    111807  1955452  4194304
   16GB 1717846016    337308  5097465 16777216
   64GB 1734918144   1164427  1490479 16777216
  256GB 1734918144   4426453   391983 16777216

Reviewed by:	rmacklem
MFC after:	2 weeks
2015-04-19 11:34:41 +00:00
Eitan Adler
d5792866b0 identd: restore memcpy
I should not be committing at 2:30am....

Reported by:	pluknet
2015-04-19 09:35:46 +00:00
Eitan Adler
7ebd5ed4d4 identd: also zero se_rpc_highvers
Reported by:	pluknet
2015-04-19 09:27:47 +00:00
Eitan Adler
af5f5a398f identd: remove redundant zeroing
se_rpc_lowvers was set to 0 twice, so remove one of them
	I can not find any other variable which they may have been a typo of.

Reported by:	gcc5.1
2015-04-19 09:07:57 +00:00
Eitan Adler
b1abc63706 tzsetup: remove set but unused variable
- leave a comment explaining which variable it used to be

Reported by:	gcc5.1
2015-04-19 08:45:37 +00:00
Eitan Adler
68c45bf852 config: remove set but unchecked variable
reported by: gcc5.1
2015-04-19 08:30:13 +00:00
Edward Tomasz Napierala
565716e60e Add back fdrop() missed in r281726.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-04-19 07:35:18 +00:00
Eitan Adler
94ec856683 README: changes and fixups
Two orthogonal goals:
	- try to make README look a little nicer on phabricator by using
	  Remarkup syntax for commands (using `` instead of using a closing ')
	- try to make README look a little nicer on github.

	- Don't encourage `make world` when the handbook specifies otherwise
	- Change language around documentation to be a bit clearer

MFC After:	2 weeks
2015-04-19 07:16:44 +00:00
Edward Tomasz Napierala
92f7441328 Optimize the O_NOCTTY handling hack in linux_common_open().
Differential Revision:	https://reviews.freebsd.org/D2323
Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-04-19 07:12:16 +00:00
Edward Tomasz Napierala
50a220c699 Replace "new NFS" with just "NFS" in some sysctl description strings.
Sponsored by:	The FreeBSD Foundation
2015-04-19 06:18:41 +00:00
Eitan Adler
ba6663d9a1 rpcgen: fix use use of strcmp
strcmp only guarantee that it will return at least 1 if the string B
	is greater than that of string A.
2015-04-19 04:53:28 +00:00
Eitan Adler
e4c6d6e268 calendar: remove useless check
lineline checked for 0 in the while loop condition.  There is no need to
	check for it additionally in the body.

CID:	1288959
MFC After:	1 week
2015-04-19 04:27:50 +00:00
Justin Hibbits
942fe63f7b Fix the build. Commit the last part of e500 PMC.
Pointy hat to:	jhibbits
2015-04-19 00:33:21 +00:00
Alan Cox
74f944344b Eliminate an unused variable.
MFC after:	1 week
2015-04-19 00:29:02 +00:00
Eitan Adler
e6743d31d3 bin/ed: use correct type in multiplication
The result is line_t** so the multiplication should be size *
	sizeof(line_t*)

MFC After:	1 month
2015-04-18 23:56:04 +00:00
Bryan Drewery
a59f817491 sh: Fix the trap builtin to be POSIX-compliant for 'trap exit SIG' and 'trap n n...'.
The parser considered 'trap exit INT' to reset the default for both EXIT and
INT. This beahvior is not POSIX compliant. This was avoided if a value was
specified for 'exit', but then disallows exiting with the signal received. A
possible workaround is using ' exit'.

However POSIX does allow this type of behavior if the parameters are all
integers. Fix the handling for this and clarify its support in the manpage
since it is specifically allowed by POSIX.

Differential Revision:	https://reviews.freebsd.org/D2325
Reviewed by:	jilles
MFC after:	2 weeks
2015-04-18 23:49:57 +00:00
Konstantin Belousov
4c5ccd08a3 Regen. 2015-04-18 21:54:00 +00:00
Konstantin Belousov
8103a8f608 Regen. 2015-04-18 21:50:53 +00:00
Konstantin Belousov
0538aafc41 The lseek(2), mmap(2), truncate(2), ftruncate(2), pread(2), and
pwrite(2) syscalls are wrapped to provide compatibility with pre-7.x
kernels which required padding before the off_t parameter.  The
fcntl(2) contains compatibility code to handle kernels before the
struct flock was changed during the 8.x CURRENT development.  The
shims were reasonable to allow easier revert to the older kernel at
that time.

Now, two or three major releases later, shims do not serve any
purpose.  Such old kernels cannot handle current libc, so revert the
compatibility code.

Make padded syscalls support conditional under the COMPAT6 config
option.  For COMPAT32, the syscalls were under COMPAT6 already.

Remove WITHOUT_SYSCALL_COMPAT build option, which only purpose was to
(partially) disable the removed shims.

Reviewed by:	jhb, imp (previous versions)
Discussed with:	peter
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-04-18 21:50:13 +00:00
Justin Hibbits
a745246822 Implement hwpmc(4) for Freescale e500 core.
This supports e500v1, e500v2, and e500mc. Tested only on e500v2, but the
performance counters are identical across all, with e500mc having some
additional events.

Relnotes:	Yes
2015-04-18 21:39:17 +00:00
Konstantin Belousov
3d0045bb2b Make wait6(2), waitid(3) and ppoll(2) cancellation points. The
waitid() function is required to be cancellable by the standard.  The
wait6() and ppoll() follow the other syscalls in their groups.

Reviewed by:	jhb, jilles (previous versions)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-04-18 21:35:41 +00:00
Konstantin Belousov
9dda94167d Revert unrelated chunk from the r281707.
MFC after:	2 weeks
2015-04-18 21:27:28 +00:00
Konstantin Belousov
1c8e7232b4 Remove lazy pmap switch code from i386. Naive benchmark with md(4)
shows no difference with the code removed.

On both amd64 and i386, assert that a released pmap is not active.

Proposed and reviewed by:	alc
Discussed with:	Svatopluk Kraus <onwahe@gmail.com>, peter
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-04-18 21:23:16 +00:00
Mark Johnston
b9d64941fb Add manual pages for the io, ip, proc, sched, tcp and udp DTrace providers.
The format of these pages is somewhat experimental, so they may be subject
to further tweaking.

Differential Revision:	https://reviews.freebsd.org/D2170
Reviewed by:	bcr, rpaulo
MFC after:	2 weeks
2015-04-18 21:00:36 +00:00
Rui Paulo
1321d68db0 Synaptics: don't report the middle button when clickPad is used.
On trackpads that had support for both, we were sending two button
events when the trackpad was pressed.

Tested by:	Jakob Alvermark <jakob at alvermark.net>
MFC after:	1 week
2015-04-18 20:55:55 +00:00
Konstantin Belousov
9963b4504c Complete r281670, unlist removed files.
Sponsored by:	The FreeBSD Foundation
2015-04-18 20:55:33 +00:00
Mark Johnston
38563f7c92 Remove unimplemented sched provider probes.
They were added for compatibility with the sched provider in Solaris and
illumos, but our sched provider is already incompatible since it uses native
types, so there isn't much point in keeping them around.

Differential Revision:	https://reviews.freebsd.org/D2167
Reviewed by:	rpaulo
2015-04-18 20:36:58 +00:00
Mark Johnston
30ed58c1cf SDT(9): add a section on SDT providers, mentioning the "sdt" provider.
Add examples demonstrating how one can list available providers and the
DTrace probes provided by a provider.

Differential Revision:	https://reviews.freebsd.org/D2166
Reviewed by:	rpaulo
MFC after:	2 weeks
2015-04-18 20:31:59 +00:00
Alexander Motin
bb1524af0c Workaround bhyve virtual disks operation on top of GEOM providers.
GEOM does not support scatter/gather lists in its I/Os.  Such requests
are cut in pieces by physio(), that may be problematic, if those pieces
are not multiple of provider's sector size.  If such case is detected,
move the data through temporary sequential buffer.

MFC after:	2 weeks
2015-04-18 20:10:19 +00:00
Simon J. Gerraty
2ef26470c5 No need to delete export from filesystems which are not exported. 2015-04-18 19:52:39 +00:00
Alexander Motin
18c5ed7145 Do not report stripe size if it is equal to sector size.
MFC after:	1 week
2015-04-18 19:37:37 +00:00
Takanori Watanabe
4cae2db2a8 To ensure j formatting string valid, cast uint64_t values to uintmax_t. 2015-04-18 17:41:09 +00:00
Konstantin Belousov
ad8b1d857d Initialize td_sel in the thread_init(). Struct thread is not zeroed
on the initial allocation, but seltdinit() assumes that td_sel is NULL
or a valid pointer.  Note that thread_fini()/seltdfini() also relies
on this, but correctly resets td_sel to NULL.

Submitted by:	luke.tw@gmail.com
PR:	199518
MFC after:	1 week
2015-04-18 17:21:12 +00:00
Andrey V. Elsukov
962ac6c727 Change ipsec_address() and ipsec_logsastr() functions to take two
additional arguments - buffer and size of this buffer.

ipsec_address() is used to convert sockaddr structure to presentation
format. The IPv6 part of this function returns pointer to the on-stack
buffer and at the moment when it will be used by caller, it becames
invalid. IPv4 version uses 4 static buffers and returns pointer to
new buffer each time when it called. But anyway it is still possible
to get corrupted data when several threads will use this function.

ipsec_logsastr() is used to format string about SA entry. It also
uses static buffer and has the same problem with concurrent threads.

To fix these problems add the buffer pointer and size of this
buffer to arguments. Now each caller will pass buffer and its size
to these functions. Also convert all places where these functions
are used (except disabled code).

And now ipsec_address() uses inet_ntop() function from libkern.

PR:		185996
Differential Revision:	https://reviews.freebsd.org/D2321
Reviewed by:	gnn
Sponsored by:	Yandex LLC
2015-04-18 16:58:33 +00:00
Andrey V. Elsukov
1d3b268c04 Requeue mbuf via netisr when we use IPSec tunnel mode and IPv6.
ipsec6_common_input_cb() uses partial copy of ip6_input() to parse
headers. But this isn't correct, when we use tunnel mode IPSec.

When we stripped outer IPv6 header from the decrypted packet, it
can become IPv4 packet and should be handled by ip_input. Also when
we use tunnel mode IPSec with IPv6 traffic, we should pass decrypted
packet with inner IPv6 header to ip6_input, it will correctly handle
it and also can decide to forward it.

The "skip" variable points to offset where payload starts. In tunnel
mode we reset it to zero after stripping the outer header. So, when
it is zero, we should requeue mbuf via netisr.

Differential Revision:	https://reviews.freebsd.org/D2306
Reviewed by:	adrian, gnn
Sponsored by:	Yandex LLC
2015-04-18 16:51:24 +00:00