Commit Graph

193221 Commits

Author SHA1 Message Date
Ryan Stone
cf3c0c32d2 Ensure that ixl_flush() uses a defined register on VFs
In some code that is shared between the ixl(4) and ixlv(4) drivers,
a macro hard-coded a register offset that was not valid on ixlv devices.
Fix this by having each driver define a variable that contains the correct
offset.

Reviewed by:	Eric Joyner <ricera10 AT gmail.com>
MFC after:	3 days
Sponsored by:	Sandvine Inc
2014-09-29 17:51:39 +00:00
Ryan Stone
9daa89f3bb Fix integer truncation in affecting systat -ifstat
The "systat -ifstat" command was using a u_int to store byte counters.
With a 10Gbps or faster interface, this overflows within the default
5 second refresh period.  Switch to using a uint64_t across the board,
which matches the size used for all counters as of r263102.

PR:		182448
MFC after:	1 week
Sponsored by:	Sandvine Inc
2014-09-29 17:38:50 +00:00
Will Andrews
a0dec793d0 Search for the nearest PORTSDIR where Mk/bsd.ports.mk exists, from .CURDIR.
This will only take effect if PORTSDIR is not set, as previously supported.

Use .if exists(), for four specific possibilities relative to .CURDIR:
., .., ../.., and ../../..  The fourth possibility is primarily in case
ports ever grows a third level.  If none of these paths exist, fall back to
the old default of /usr/ports.

This removes the need to set PORTSDIR explicitly (or via wrapper script) if
one is running out of a ports tree that is not in /usr/ports, but in a
home directory.

Reviewed by:	bapt, bdrewery (older version)
CR:		D799
MFC after:	1 week
Sponsored by:	Spectra Logic
2014-09-29 15:05:23 +00:00
Bjoern A. Zeeb
5e24ef8793 Hopefully fix build breakage with gcc passing void * instead of char *
to "%s" format string after r272280.

PR:		83099 193927
MFC after:	3 days
X-MFC with:	r272280
2014-09-29 10:36:14 +00:00
Dag-Erling Smørgrav
4c37ae3065 Instead of failing when neither PAM_TTY nor PAM_RHOST are available, call
login_access() with "**unknown**" as the second argument.  This will allow
"ALL" rules to match.

Reported by:	Tim Daneliuk <tundra@tundraware.com>
Tested by:	dim@
PR:		83099 193927
MFC after:	3 days
2014-09-29 08:57:36 +00:00
Devin Teske
82ac9f2bf7 Use snprintf(3) in place of unbounded sprintf(3) (prevent buffer overflow).
Use adequately sized buffer for error(s) (512 -> PATH_MAX + 512).
Fix the following style(9) nits while here:
- distfetch.c uses PATH_MAX while distextract.c uses MAXPATHLEN;
  standardize on one (PATH_MAX)
- Move $FreeBSD$ from comment to __FBSDID()
- Sort included headers (alphabetically, sys/* at top)
- Add missing header includes (e.g., <stdlib.h> for getenv(3),
  calloc(3)/malloc(3)/free(3), and atoi(3); <string.h> for strdup(3),
  strrchr(3), strsep(3), and strcmp(3); <ctype.h> for isspace(3); and
  <unistd.h> for chdir(2), etc.)
- Remove rogue newline at end of distfetch.c
- Don't declare variables in if-, while-, or other statement
NB: To prevent masking of prior declarations atop function
- Perform stack alignment for variable declarations
- Add missing function prototype for count_files() in distextract.c
- Break out single-line multivariable-declarations
NB: Aligning similarly-named variables with one-char difference(s)
NB: Minimizes diffs and makes future diffs more clear
- Use err(3) family of functions (requires s/int err;/int retval;/g)

Reviewed by:	nwhitehorn, julian
2014-09-29 00:35:12 +00:00
Allan Jude
1aec0f4f91 Change the /var dataset in the default ZFS layout to have the
ZFS property canmount=off so that /var/db/pkg and other such directories
are part of the / dataset, and only /var/mail, /var/log, and /var/crash
are excluded from the ZFS boot environment (beadm).

PR:		193971
Approved by:	jmg
MFC after:	ASAP
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
2014-09-28 21:44:23 +00:00
Pedro F. Giffuni
2e46558755 Add strptime(3) support for %U and %W (take 2)
Add support for the missing POSIX-2001 %U and %W features: the
existing FreeBSD strptime code recognizes both directives and
validates that the week number lies in the permitted range,
but then simply discards the value.

Initial support for the feature was written by Paul Green.
David Carlier added the initial handling of tm_wday/tm_yday.
Major credit goes to Andrey Chernov for detecting much of the
brokenness, and rewriting/cleaning most of the code, making it
much more robust.

Tested independently with the strptime test from the GNU C
library.

PR:		137307
MFC after:	1 month
Relnotes:	yes
2014-09-28 21:20:20 +00:00
Neel Natu
fbe602fb61 tty_rel_free() can be called more than once for the same tty so make sure
that the tty is dequeued from 'tty_list' only the first time.

The panic below was seen when a revoke(2) was issued on an nmdm device.
In this case there was also a thread that was blocked on a read(2) on the
device. The revoke(2) woke up the blocked thread which would typically
return an error to userspace. In this case the reader also held the last
reference on the file descriptor so fdrop() ended up calling tty_rel_free()
via ttydev_close().

tty_rel_free() then tried to dequeue 'tp' again which led to the panic.

panic: Bad link elm 0xfffff80042602400 prev->next != elm
cpuid = 1
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00f9c90460
kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00f9c90510
vpanic() at vpanic+0x189/frame 0xfffffe00f9c90590
panic() at panic+0x43/frame 0xfffffe00f9c905f0
tty_rel_free() at tty_rel_free+0x29b/frame 0xfffffe00f9c90640
ttydev_close() at ttydev_close+0x1f9/frame 0xfffffe00f9c90690
devfs_close() at devfs_close+0x298/frame 0xfffffe00f9c90720
VOP_CLOSE_APV() at VOP_CLOSE_APV+0x13c/frame 0xfffffe00f9c90770
vn_close() at vn_close+0x194/frame 0xfffffe00f9c90810
vn_closefile() at vn_closefile+0x48/frame 0xfffffe00f9c90890
devfs_close_f() at devfs_close_f+0x2c/frame 0xfffffe00f9c908c0
_fdrop() at _fdrop+0x29/frame 0xfffffe00f9c908e0
sys_read() at sys_read+0x63/frame 0xfffffe00f9c90980
amd64_syscall() at amd64_syscall+0x2b3/frame 0xfffffe00f9c90ab0
Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00f9c90ab0
--- syscall (3, FreeBSD ELF64, sys_read), rip = 0x800b78d8a, rsp = 0x7fffffbfdaf8, rbp = 0x7fffffbfdb30 ---

CR:		https://reviews.freebsd.org/D851
Reviewed by:	glebius, ed
Reported by:	Leon Dang
Sponsored by:	Nahanni Systems
MFC after:	1 week
2014-09-28 21:12:23 +00:00
Alexander V. Chernikov
c6682d5906 Convert most BPF_TAP users to BPF_MTAP.
MFC after:	2 weeks
2014-09-28 19:05:22 +00:00
Michael Tuexen
03f90784bf Checksum coverage values larger than 65535 for UDPLite are invalid.
Check for this when the user calls setsockopt using UDPLITE_{SEND,RECV}CSCOV.

Reviewed by: kevlo
MFC after: 3 days
2014-09-28 17:22:45 +00:00
Bjoern A. Zeeb
cbaac00901 Move the unconditional #include of net/ifq.h to the very end of file.
This seems to allow us to pass a universe with either clang or gcc
after r272244 (and r272260) and probably makes it easier to untabgle
these chained #includes in the future.
2014-09-28 17:09:40 +00:00
Bjoern A. Zeeb
0110795a35 Remove duplicate declaraton of the if_inc_counter() function after r272244.
if_var.h has the expected on and if_var.h include ifq.h and thus we get
duplicates.  It seems only one cavium ethernet file actually includes ifq.h
directly which might be another cleanup to be done but need to test first.
2014-09-28 15:38:21 +00:00
Yoshihiro Takahashi
c2a94678ae MFi386: Enable QUOTA, PRINTF_BUFR_SIZE and puc. 2014-09-28 14:39:11 +00:00
Yoshihiro Takahashi
b56dfcede2 - Cosmetic changes.
- Reduce diffs against i386.
2014-09-28 14:25:46 +00:00
Gleb Smirnoff
bd071d4d19 - Remove empty wrappers ether_poll_[de]register_drv(). [1]
- Move polling(9) declarations out of ifq.h back to if_var.h
  they are absolutely unrelated to queues.

Submitted by:	Mikhail <mp lenta.ru> [1]
2014-09-28 14:05:18 +00:00
Yoshihiro Takahashi
4ac1175e89 MFi386: r261567
Switch from lib/libstand to sys/boot/libstand32.
2014-09-28 13:34:43 +00:00
Yoshihiro Takahashi
2c4969da8d MFi386: r268974
Supress clang warning for FreeBSD printf %b and %D formats.
2014-09-28 13:13:18 +00:00
Hans Petter Selasky
8bf51ab563 Instead of creating the full range of possible ports, try to figure
out the actual number of so-called "embedded jacks" which are present
when a USB MIDI device is attaching.

MFC after:	3 days
2014-09-28 12:55:13 +00:00
Hans Petter Selasky
371b7a54c3 Regenerate usb.conf
MFC after:	3 days
2014-09-28 12:41:48 +00:00
Yoshihiro Takahashi
f40e4b0c6d MFi386: r261520
Drop the 3rd clause from all 3 clause BSD licenses.
2014-09-28 12:25:27 +00:00
Yoshihiro Takahashi
985b2f8cd1 Reduce diffs against i386. 2014-09-28 12:13:51 +00:00
Yoshihiro Takahashi
a580f768cf Remove extra '\'. 2014-09-28 12:12:54 +00:00
Yoshihiro Takahashi
2606213f89 - Cleanups pc98 code.
- Remove unworked formats.
2014-09-28 11:32:46 +00:00
Alexander Motin
3c21968c19 Do not transfer unneeded training zero bytes in INQUIRY response.
It is an addition to r269631.
2014-09-28 11:10:37 +00:00
Yoshihiro Takahashi
6d1ddf7734 Remove duplicate prog. 2014-09-28 08:59:38 +00:00
Gleb Smirnoff
112f50ffb2 Finally, convert counters in struct ifnet to counter(9).
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-09-28 08:57:07 +00:00
Yoshihiro Takahashi
3754eb026e Merged from r183296.
Add missing library dependencies.
2014-09-28 08:23:26 +00:00
Gleb Smirnoff
2357543753 Convert to if_inc_counter() last remnantes of bare access to struct ifnet
counters.
2014-09-28 07:43:38 +00:00
Gleb Smirnoff
fbc4ef4ca7 Provide ixgb_get_counter(). 2014-09-28 07:40:26 +00:00
Gleb Smirnoff
058a38660e Convert to if_get_counter(). 2014-09-28 07:29:45 +00:00
Adrian Chadd
08f06f0ace Fix the AR724x PCIe glue to correctly probe the BAR on AR7240 devices.
There's a bug in the AR7240 PCIe hardware where a correct BAR will end
up having the device disappear.

It turns out that for the device address it should be all 0's.

However, this meant that the PCI probe code would try writing 0xffffffff
in to see how big the window was, read back 0x0, and think the window
was 32 bits.  It then ended up calculating a resource size of 0 bytes,
failed to find anything via an rman call, and this would fail to attach.

I have quite absolutely no idea how in the various planes of existence
this particular bit of code and how it worked with the PCI bus code
ever worked.  But, well, it did.

Tested:

* Atheros AP93 - AR7240 + AR9280 reference board
2014-09-28 07:27:58 +00:00
Gleb Smirnoff
5fe12776aa Mechanically switch ixv(4) to if_inc_counter(). 2014-09-28 07:19:32 +00:00
Adrian Chadd
60d2f54e48 Fix the ar724x PCI config space register read.
It was doing incorrect things with masks.  This was fixed in the
AR71xx codebase but it wasn't yet fixed in the AR724x code.

This ended up having config space reads return larger/incorrect values
in some situations.

Tested:

* AR7240

TODO:

* test ar7241, AR7242, and AR934x.
2014-09-28 05:28:11 +00:00
Gleb Smirnoff
4b443922e0 Convert driver to if_get_counter method.
Submitted by:	rstone
Reviewed by:	Eric Joyner <ricera10 gmail.com>
2014-09-27 20:54:57 +00:00
Gleb Smirnoff
08c95c53d7 Mechanically convert to if_inc_counter(). 2014-09-27 20:43:01 +00:00
Gleb Smirnoff
a917ed7723 Mechanically convert to if_inc_counter(). 2014-09-27 20:39:24 +00:00
Alexander Motin
975c8d15c2 Fix page length reported for Block Limits VPD page. 2014-09-27 20:08:34 +00:00
Steven Hartland
6e9a599b27 Use a local STAILQ for unlocked done CCB processing in ahci direct mode
Previously it was possible for issues e.g. use after free, to result
from processing the done queue while not holding the channel lock.

While this should never happen in practice, unexpected code flows
which result in two threads processing from the same queue may
be possible.

We now use a local STAILQ to prevent this ever being an issue.

Sponsored by:	Multiplay
2014-09-27 19:14:22 +00:00
Navdeep Parhar
e26e6373c8 cxgb(4): implement if_get_counter. 2014-09-27 18:35:16 +00:00
Marcel Moolenaar
fb2f6c6c66 Update the usage message and the man page to account for the new long
options. Bump the version number to 20140927.
While here, use explicit fputc() calls to skip a line in the output.
This to avoid having to hunt for extra '\n' characters in the printf
format strings.

MFC after:	1 week
Relnotes:	yes
2014-09-27 17:58:03 +00:00
Bjoern A. Zeeb
4490a86891 Disable the makeoption with MFS_IMAGE= set as we don't ship that file
and it thus breaks the default build.   You can still use various other
ways (tools) to embedd the image after the kernel build.
2014-09-27 17:11:51 +00:00
Alexander Kabaev
1ade5ec79a Do not pass whole descriptor block size as align to fwdma_malloc_multiseg
Do not pass wrong alignment value to fwdma_malloc_multiseg and ultimately
to contigalloc. In addition to being wrong, this causes insta-panic in
certain cases due to safety assertion - the alignment is required to be
the power of two and the value we calculate here seldom is.

MFC after:  1 month
2014-09-27 16:50:24 +00:00
Alexander Kabaev
23667f089d Remove obsolete compatibility glue and improve firewire code readability.
Commit my version of style(9) pass over the firewire code. Now that
other people have started changing the code carrying this is as a
local patch is not longer a viable option.

MFC after:	1 month
2014-09-27 16:50:21 +00:00
Kevin Lo
b50afa88b0 Fix the definitioin of AT91SAM9G45_IRQ_PIOE and rename it to
AT91SAM9G45_IRQ_PIODE.  According to the data sheet, both PIOD and PIOE
use the same IRQ.

While here remove duplicate definitions.
2014-09-27 14:39:00 +00:00
Alexander V. Chernikov
7d6cc45c9b Use underlying ports counters to get lagg statistics instead of
per-packet accounting.
This introduce user-visible changes like aggregating error counters.

Reviewed by:	asomers (prev.version), glebius
CR:		D781
MFC after:	2 weeks
Sponsored by:	Yandex LLC
2014-09-27 13:57:48 +00:00
Sean Bruno
4007b77e37 Update factor for changes to types in primes, which is a dependency.
Fixes build-fail on mips32 introduced at 272207.
2014-09-27 10:57:34 +00:00
Andrew Turner
1af789ed11 Add machine/sysreg.h to simplify accessing the system control coprocessor
registers and use it in the ARMv7 CPU functions.

The sysreg.h file has been checked by hand, however it may contain errors
with the comments on when a register was first introduced. The ARMv7 cpu
functions have been checked by compiling both the previous and this version
and comparing the md5 of the object files.

Submitted by:	Svatopluk Kraus <onwahe at gmail.com>
Submitted by:	Michal Meloun <meloun at miracle.cz>
Reviewed by:	ian, rpaulo
Differential Revision: https://reviews.freebsd.org/D795
2014-09-27 09:57:34 +00:00
Xin LI
456a4e16a6 Revert r272189, the committed version was an old version and breaks build.
Pointy hat to:	delphij
2014-09-27 09:39:19 +00:00
Colin Percival
eb5ea45ba8 Switch primes(6) from using unsigned long to using uint64_t. This fixes
'limited range of type' warnings about comparisons on 32-bit systems, and
allows 32-bit systems to compute the full range of primes.
2014-09-27 09:00:38 +00:00