Commit Graph

197427 Commits

Author SHA1 Message Date
Roger Pau Monné
f79cdf2998 xen: fix xenstore dev
Xenstore user-space device has two problems currently:
 - It does not correctly handle concurrent clients, because it's storing
   each client data in dev->si_drv1.
 - It does not correctly free this data when the client closes the device.

In order to solve both of this issues store the per-client data using
cdevpriv, which also comes with a hook in order to perform the necessary
cleanup on device close.

While there also make the device eternal.

Sponsored by: Citrix Systems R&D
Reported and Tested by: thompsa
MFC after: 2 weeks
2015-02-16 09:53:43 +00:00
Gleb Smirnoff
39a58828ef In the forwarding case refragment the reassembled packets with the same
size as they arrived in. This allows the sender to determine the optimal
fragment size by Path MTU Discovery.

Roughly based on the OpenBSD work by Alexander Bluhm.

Submitted by:		Kristof Provost
Differential Revision:	D1767
2015-02-16 07:01:02 +00:00
Gleb Smirnoff
6c269f6912 Factor out ip6_fragment() function, to be used in IPv6 stack and pf(4).
Submitted by:		Kristof Provost
Differential Revision:	D1766
2015-02-16 06:30:27 +00:00
Andrew Rybchenko
2cd617a883 sfxge: flush all Tx queues from if_qflush
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius
2015-02-16 06:16:38 +00:00
Kevin Lo
75a8079ded Xref the following in wlan(4):
- rsu(4)
- urtwn(4)
2015-02-16 06:12:55 +00:00
Andrew Rybchenko
0ff2378988 sfxge: style fixes
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-16 06:12:04 +00:00
Andrew Rybchenko
d67580d164 sfxge: SYSCTL_IN/OUT should not be called with non-sleepable lock held
The problem is found using WITNESS option enabled.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-16 06:10:17 +00:00
Andrew Rybchenko
0b28bbdca9 sfxge: remove inline specifiers
Now compiler does not need any help.
The patch does not change generated code.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius
2015-02-16 06:08:13 +00:00
Andrew Rybchenko
fd59fc3478 sfxge: remove used sfxge_tso_state member dma_seg_i
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-16 06:07:01 +00:00
Andrew Rybchenko
3f1e3499ed sfxge: remove full_packet_size from sfxge_tso_state
It makes sfxge_tso_state smaller and even makes tso_start_new_packet()
few bytes smaller. Data used to calculate packet size are used nearby,
so it should be no problems with cache etc.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius
2015-02-16 06:04:26 +00:00
Gleb Smirnoff
6004805208 Missed from r278831. 2015-02-16 06:02:46 +00:00
Andrew Rybchenko
c9795115dc sfxge: remove unused variable
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius
2015-02-16 06:00:43 +00:00
Gleb Smirnoff
e5ee706031 Move ip6_deletefraghdr() to frag6.c.
Suggested by:	bz
2015-02-16 05:58:32 +00:00
Gleb Smirnoff
f5ceb22b78 Update the pf fragment handling code to closer match recent OpenBSD.
That partially fixes IPv6 fragment handling. Thanks to Kristof for
working on that.

Submitted by:		Kristof Provost
Tested by:		peter
Differential Revision:	D1765
2015-02-16 03:38:27 +00:00
John-Mark Gurney
add9975cd1 install the man page...
Sponsored by:	FreeBSD Foundation
2015-02-16 02:20:11 +00:00
Adrian Chadd
0332e7d4d6 Remove this - I made it all work again a looong time ago. 2015-02-16 02:05:34 +00:00
Gleb Smirnoff
0b438b0fb8 Factor out ip6_deletefraghdr() function, to be shared between IPv6
stack and pf(4).

Submitted by:	Kristof Provost
Reviewed by:	ae
Differential Revision:	D1764
2015-02-16 01:12:20 +00:00
Sean Bruno
b8fc9a86a8 If no arguments are passed to a subcommand that requires arguments,
error out before we deref a null pointer in the check for max length.

Thanks to otis in IRC for the bug report.

MFC after:	3 days
2015-02-15 23:58:57 +00:00
Jilles Tjoelker
7034d8df04 sh: Various cleanups to expand.c:
* Remove some gotos.
* Remove unused parameter.
* Remove duplicate code.
2015-02-15 22:38:00 +00:00
Hans Petter Selasky
a63352afc0 Add new device ID. 2015-02-15 22:06:28 +00:00
Hans Petter Selasky
b161d69825 Bugfixes. Check if a framebuffer is present before using it. Dequeue
element from correct head structure. No need to multiply framebuffer
offset by two. It is already given in bytes.
2015-02-15 22:05:30 +00:00
Jilles Tjoelker
781bfb5a53 sh: Prefer "" to nullstr where possible. 2015-02-15 21:47:43 +00:00
Brad Davis
cec1a873d7 Really fix the pw_usernext tests.
PR:		197612
Approved by:	will
2015-02-15 21:42:10 +00:00
Jilles Tjoelker
a4652c280b sh: Add stsavestr(), like savestr() but allocates using stalloc(). 2015-02-15 21:41:29 +00:00
Jilles Tjoelker
51492908f9 touch: Fix some subtle bugs related to NULL times fallback:
* Do not subvert vfs.timestamp_precision by reading the time and passing
  that to utimensat(). Instead, pass UTIME_NOW. A fallback to a NULL times
  pointer is no longer used.

* Do not ignore -a/-m if the user has write access but does not own the
  file. Leave timestamps unchanged using UTIME_OMIT and do not fall back to
  a NULL times pointer (which would set both timestamps) if that fails.

Reviewed by:	bde
2015-02-15 21:28:00 +00:00
Adrian Chadd
b8871f0823 Add initial support to the AR9300 HAL to support FreeBSD's intmit API.
I don't like having it in this function; I may migrate it to ar9300_freebsd.c
at some point to keep the HAL code pollution down.

This allows ANI to be disabled via a sysctl.

Tested:

* AR9331, STA/TDMA modes
2015-02-15 21:15:09 +00:00
Pedro F. Giffuni
78a452c36e Replace strcpy() with strlcpy()
The risk of an overrun here is very low but check the
length, JIC.

CID:	1019039
2015-02-15 21:11:07 +00:00
Pedro F. Giffuni
1a4161a15d Reverse one of the initializations from r278804.
It does no harm but this is not needed after the
correction in r278805 and I prefer to keep this
code very similar to it's original state.
2015-02-15 21:03:49 +00:00
Ed Maste
b0aa0c6e1b timeout: handle zombie grandchildren
timeout previously collected only one child status with wait(2). If this
was one of the grandchildren timeout would return to sigsuspend and wait
until the timeout expired. Instead, loop for all children.

PR:		kern/197608
Reviewed by:	bapt, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-02-15 20:10:53 +00:00
Adrian Chadd
caa918bd3b Add ath_hal_setbeacontimers() to the AR9300 HAL.
This is a custom FreeBSD HAL method that is used by the TDMA code
to program the beacon timers directly without any guesswork/assumptions
by the HAL.

This brings up basic TDMA master/slave support on the AR9380 HAL,
however there are other issues preventing it from being stable.
(I'm seeing beacon interval instability, which may be due to
busy 2GHz air, but also may be due to some HAL configuration
issues with regards to ANI, or hardware timer programming, etc.)

Tested:

* AR9331 (Carambola2), STA, AP, adhoc and TDMA master mode.
2015-02-15 19:56:31 +00:00
Jilles Tjoelker
8c6cc7dad5 sh: Add simple tests for globbing/splitting command substitution. 2015-02-15 19:48:29 +00:00
Pedro F. Giffuni
b78ceb0a58 Mismatch in r278804. 2015-02-15 18:02:05 +00:00
Pedro F. Giffuni
09cc2762fa More tidy-ups on uninitialized scalar variable
As a followup to r278363, there is one more case where
stayopen can be accessed uninitialized, but even after
swapping arguments, access is possible in some other
cases so prevent it completely by initializing stayopen.

CID:	1018729
CID:	1018732
2015-02-15 16:50:21 +00:00
Pedro F. Giffuni
e291429c5b ulimit(3): Fix broken check.
The existing implementation had a broken comparison that could
overflow and return confusing values.  Replace this with a check
that avoids the overflow before it happens.

Consistently return a maximum value also on the case of negative
arguments since negative is considered an overflow and means
infinity for our current setrlimit().

New revamped version is credited to Bruce Evans.

CID:		1199295
MFC after:	1 week
2015-02-15 14:31:50 +00:00
Pedro F. Giffuni
e5c356b2a2 ext2fs: Plug small memory leak
free() e2fs_contigdirs upon error.
Undo zeroing of e2fs_gd as this was actually a false positive.

X-MFC with:	278790
2015-02-15 14:25:00 +00:00
Hans Petter Selasky
0867995ca0 Import USB display link driver from OpenBSD. Support for compression
has been removed and the driver has been greatly simplified and
optimised for FreeBSD. The driver is currently not built by default.

Requested by:	Bruce Simpson <bms@fastmail.net>
2015-02-15 12:02:17 +00:00
Hans Petter Selasky
0761549550 Import videomode code from NetBSD which is needed by USB display link drivers. 2015-02-15 11:37:40 +00:00
Andrew Turner
88cb7e2852 Add the structures needed to get/set the power state. These can be used
when, for example, we boot without U-Boot and wish to enable USB, or to
suspend an unneeded device.

MFC after:	1 week
2015-02-15 11:23:27 +00:00
Konstantin Belousov
45f1ade79b Reparenting done by debugger attach can leave reaper without direct
children.  Handle the situation instead asserting that it is
impossible.

Reported and tested by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2015-02-15 08:44:30 +00:00
Konstantin Belousov
4b685a2862 Return with the process locked, caller expects p still locked after
the call.

Reported and tested by:	bapt
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2015-02-15 08:43:19 +00:00
Pedro F. Giffuni
6be4cf2244 Reuse value of cursize instead of recalculating.
Reported by:	Clang static checker
MFC after:	1 week
2015-02-15 01:34:00 +00:00
Pedro F. Giffuni
f3ee91ed2b Initialize the allocation of variables related to the ext2 allocator.
The e2fs_gd struct was not being initialized and garbage was
being used for hinting the ext2 allocator variant.
Use malloc to clear the values and also initialize e2fs_contigdirs
during allocation to keep consistency.

While here clean up small style issues.

Reported by:	Clang static analyser
MFC after:	1 week
2015-02-15 01:12:15 +00:00
Michael Gmelin
6c176113bb Quirk based support of Chromebook keyboard found in Acer C720
This probably supports other devices based on SeaBIOS, which need
to be added to the smbios based quirks table.

The functionality has been ported from DragonFlyBSD and adapted
to FreeBSD's more general purpose environment.

Devices not covered by a quirk shouldn't be affected at all. Thanks
to jhb and kostikbel for reviewing the code.

Reviewed by:	kostikbel, jhb
Approved by:	jhb, kostikbel
Differential Revision: https://reviews.freebsd.org/D1802
2015-02-14 22:12:17 +00:00
Davide Italiano
a76d4388e1 Don't access sockbuf fields directly, use accessor functions instead.
It is safe to move the call to socantsendmore_locked() after
sbdrop_locked() as long as we hold the sockbuf lock across the two
calls.

CR:	D1805
Reviewed by:	adrian, kmacy, julian, rwatson
2015-02-14 20:00:57 +00:00
Enji Cooper
bacc28cea1 Refactor pkill-j_test to reflect the relevant changes done to pgrep-j_test
r278742:

Simplify jail_name_to_jid and try to be more fault tolerant when scanning for
the jail ID (poll up to 10 times for the jail IDs to become available)

If the scan fails, the code will fall through and fail as it does with Jenkins
today

r278636:

Parameterize out the amount of sleep done in each test

Set the value in each test to a different amount to avoid potential
side-effects with other instances of the test (or lingering processes) still
being present on the system

r278633:

Refactor the tests

1. `id -u` -> 0 is now only checked once; the entire test script is now skipped
   if this assertion is violated
2. De-dent whitespace, based on 1.
3. Only setup the symlink for $sleep once at the top of the script, and tear it
   down once at the bottom of the script
2015-02-14 19:21:04 +00:00
Luigi Rizzo
6641c68bcd two minor changes from the master netmap version:
1. handle errors from nm_config(), if any (none of the FreeBSD drivers
   currently returns an error on this function, so this change
   is a no-op at this time
2. use a full memory barrier on ioctls
2015-02-14 19:03:11 +00:00
Luigi Rizzo
c929ca72c9 whitespace change:
clarify the role of MAKEDEV_ETERNAL_KLD, and remove an old
#ifdef __FreeBSD__ since the code is valid on all platforms.
2015-02-14 18:59:31 +00:00
Ian Lepore
8e6dd301f0 Add logic for handling new-style ARM cpu ID info.
Submitted by:	Michal Meloun <meloun@miracle.cz>
2015-02-14 18:54:52 +00:00
Brad Davis
270d667cd2 Remove an extra curly bracket that was causing intermittent failures.
PR:		197612
Submitted by:	Robert O'Niel <oneil.rs@gmail.com>
Approved by:	will
2015-02-14 18:22:31 +00:00
Hiroki Sato
25792b116f Fix a panic when tearing down a vnet on a VIMAGE-enabled kernel.
There was a race that bridge_ifdetach() could be called via
ifnet_departure event handler after vnet_bridge_uninit().

PR:		195859
Reported by:	Danilo Egea Gondolfo
2015-02-14 18:15:14 +00:00