Commit Graph

214713 Commits

Author SHA1 Message Date
ngie
a51ea2d92e Integrate contrib/netbsd-tests/lib/libc/rpc into the FreeBSD test suite
as lib/libc/rpc

This testcase requires rpcbind be up in running; otherwise the testcases
will time out and be skipped

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-10-30 03:28:00 +00:00
gonzo
b222411003 Fix BULK read transfer if destination buffer is not cache line-aligned.
We can't use copyout because destination memory is userland address
in another process but we have reference to respective page so map
the page into kernel address space and copy fragments there
2015-10-30 01:19:04 +00:00
np
949e84b266 cxgbe/tom: decide whether to shove segments or not only if there is
payload to transmit.

MFC after:	1 week
2015-10-30 01:18:07 +00:00
delphij
2e85b00467 In pw_userlock, set 'name' to NULL when we encounter an all number string
because it is also used as an indicator of whether a name or an UID is
being used and we may have undefined results as 'name' may contain
uninitialized stack contents.

MFC after:	2 weeks
2015-10-30 00:46:52 +00:00
delphij
870b3ee349 Use strlcpy().
MFC after:	2 weeks
2015-10-30 00:33:03 +00:00
gonzo
9c5daacfac Fix framebuffer compatibility with new RPi firmware. Framebuffer driver
receives video memory address from VideoCore through property mailbox
channel. Older versions of firmware (and the one that is currently part
of sysutils/u-boot-rpi and sysutils/u-boot-rpi2) returned real physical
address, newer one returns VideoCore bus address, so we need to convert
it to actual physical address. this version works with both older and
newer interface.
2015-10-30 00:24:37 +00:00
bdrewery
3d9be43e02 Remove unneeded NULL as this is initialized with M_ZERO.
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-10-29 23:56:34 +00:00
bdrewery
cfb3b1e0f6 Use memmove(3) to avoid overlapping copy.
Reported by:	valgrind
MFC after:	2 weeks
X-MFC-With:	r290168
2015-10-29 23:06:33 +00:00
bdrewery
78af08e72a Fix several memory leaks, and crashes, in iconvlist(3).
- Both curitem and curitem (via the names list) was always leaked.
- malloc(3) failures lead to some leaks.
- __bsd___iconv_get_list() failure lead to a crash since its error was not
  handles and __bsd___iconv_free_list() is not NULL-safe.

I have slightly refactored this to avoid extra malloc and free logic in cases
of malloc(3) failing.

There are still bad assumptions here that I did not deal with.  One of which is
that the data will always have a '/' so the strchr(3) will not return NULL.

Coverity CID:	1130055 1130054 1130053
2015-10-29 23:02:34 +00:00
gonzo
caa2a6f36a Fix LEAVE_HYP macro: spsr is not guaranteed to contain valid value at this
point, e.g. on RaspberryPi 2 when control is passed from loader to kernel
it contains garbage. So we use cpsr as a base for new cpsr value: if we
have reached this point it means current value is OK

Reviewed by:	andrew
2015-10-29 22:12:03 +00:00
skra
9278a0880b Install myself as src committer.
Approved by:	kib (mentor)
2015-10-29 21:40:32 +00:00
gnn
a09f127051 Set the proper direction to check for policies in this one case.
Pointed out by: eri
Sponsored by:	Rubicon Communications (Netgate)
2015-10-29 21:26:32 +00:00
jhb
727afb6dcd Use movw instead of movl (or plain mov) when moving segment registers
into memory.  This is a nop on clang's assembler, but some assemblers
complain if the size suffix is incorrect.

Submitted by:	bde
2015-10-29 21:25:46 +00:00
dteske
56c8c3d4b3 Ignore per-mdN settings in mdconfig[2] startup
PR:		base/189696
Submitted by:	ganael.laplanche@martymac.org
MFC after:	3 days
X-MFC-to:	stable/10 stable/9
2015-10-29 21:12:57 +00:00
jtl
9a078d19e1 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
kp
0c3b0b48ba pf: Fix IPv6 checksums with route-to.
When using route-to (or reply-to) pf sends the packet directly to the output
interface. If that interface doesn't support checksum offloading the checksum
has to be calculated in software.
That was already done in the IPv4 case, but not for the IPv6 case. As a result
we'd emit packets with pseudo-header checksums (i.e. incorrect checksums).

This issue was exposed by the changes in r289316 when pf stopped performing full
checksum calculations for all packets.

Submitted by:	Luoqi Chen
MFC after:	1 week
2015-10-29 20:45:53 +00:00
mav
db507b23f5 Remove some unneeded code. 2015-10-29 20:43:13 +00:00
mav
299c4c1e5d Remove reset delays for which I see neither explanation nor need. 2015-10-29 20:34:01 +00:00
cem
c76e236063 ntb: Revert r290130 now that r290156 has landed
Nagged by:	vangyzen
Sponsored by:	EMC / Isilon Storage Division
2015-10-29 19:35:01 +00:00
bdrewery
1cd45a8b51 Check archive_entry_new() result.
Coverity CID:	1331341
2015-10-29 19:28:21 +00:00
cem
dffa7f0590 pmap_change_attr: Only fixup DMAP for DMAPed ranges
pmap_change_attr must change the memory type of both the requested KVA
and the corresponding DMAP mappings (if such mappings exist), to satisfy
an Intel requirement that two or more mappings to the same physical
pages must have the same memory type.

However, not all kernel mapped pages have corresponding DMAP mappings --
for example, 64-bit BARs.  Skip fixing up the DMAP for out-of-bounds
addresses.

Submitted by:	Steve Wahl <steve_wahl@dell.com>
Reviewed by:	alc, jhb
Sponsored by:	Dell Compellent
Differential Revision:	https://reviews.freebsd.org/D4030
2015-10-29 19:07:00 +00:00
bdrewery
7d7f09674b getnewbuf: Initialize bp to avoid uninitialized pointer dereference and brelse().
This came in recently in r289279.

Coverity CID:	1331561
2015-10-29 19:02:24 +00:00
bdrewery
722eb97ab8 Avoid passing an uninitialized 'i'. Currently nothing was depending on it
anyhow.

Coverity CID:	1331562
2015-10-29 18:58:18 +00:00
bdrewery
ef07697d65 Fix unlikely memory leak.
It is unlikely since the first check in the function is that dir[0] is '/',
but later code changes may make it real.

Coverity CID:	1332104
2015-10-29 18:29:28 +00:00
imp
3d8826f0c9 PC Card and Cardbus are now in extended maintenance mode. No need to
have them cluttering up MAINTAINERS.
2015-10-29 16:50:28 +00:00
mav
c844b56ea5 Fix and improve error masking and reporting. 2015-10-29 16:48:12 +00:00
jhb
9ee931e10a Update for LINUX32 rename. The assembler didn't complain about undefined
symbols but just used 0 after the rename.
2015-10-29 15:20:47 +00:00
jhb
617f6c60b6 Fix build with DEBUG defined.
Reported by:	hselasky
2015-10-29 15:16:47 +00:00
hselasky
881f337ccc Add missing NULL check in physio().
When destroying a character device the si_devsw field is set to NULL
before all references are gone, to indicate the character device is
going away. This can cause a NULL-dereference fault inside physio().

The callers of physio() should own a thread reference on the cdev and
if si_devsw is seen as non-NULL, it is usable during the execution of
the function. Else an ENXIO error code is returned.

Reviewed by:	kib
MFC after:	2 weeks
2015-10-29 13:53:37 +00:00
mav
603bc9566a Some minor additions to r290138, 2015-10-29 10:31:44 +00:00
mav
3ac7a1ed11 Some updates to isp(4) manual page. 2015-10-29 09:50:48 +00:00
hselasky
6fb5bfe3ef Add myself to MAINTAINERS. 2015-10-29 08:45:56 +00:00
hselasky
97b71ce545 Finish process of moving the LinuxKPI module into the default kernel build.
- Move all files related to the LinuxKPI into sys/compat/linuxkpi and
  its subfolders.
- Update sys/conf/files and some Makefiles to use new file locations.
- Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn
  adds the LinuxKPI to all LINT builds.
- The LinuxKPI can be added to the kernel by setting the
  COMPAT_LINUXKPI option. The OFED kernel option no longer builds the
  LinuxKPI into the kernel. This was done to keep the build rules for
  the LinuxKPI in sys/conf/files simple.
- Extend the LinuxKPI module to include support for USB by moving the
  Linux USB compat from usb.ko to linuxkpi.ko.
- Bump the FreeBSD_version.
- A universe kernel build has been done.

Reviewed by:	np @ (cxgb and cxgbe related changes only)
Sponsored by:	Mellanox Technologies
2015-10-29 08:28:39 +00:00
kevlo
41bbd8a7cb Remove the static function declaration. 2015-10-29 04:51:27 +00:00
kevlo
c31770a40f - Add a missing prototype
- Fix typos
2015-10-29 04:21:34 +00:00
cem
53fac20993 ioat_test: Handled forced hardware resets gracefully
Sponsored by:	EMC / Isilon Storage Division
2015-10-29 04:16:52 +00:00
cem
159d29dfc4 ioat: Drain/quiesce the device less racily
On detach and during a forced HW reset.

Sponsored by:	EMC / Isilon Storage Division
2015-10-29 04:16:39 +00:00
cem
433d01eb04 ntb: Do not attempt to set write-combining on MWs
AMD64 pmap assumes ranges will be in the DMAP, which isn't necessarily
true for NTB memory windows (especially 64-bit BARs).

Suggested by:	pmap_change_attr_locked -> kassert_panic
Sponsored by:	EMC / Isilon Storage Division
2015-10-29 04:16:28 +00:00
cem
15f623b49e ioatcontrol(8): Add and document "raw" testing mode
Allows DMA from/to arbitrary KVA or physical address.  /dev/ioat_test
must be enabled by root and is only R/W root, so this is approximately
as dangerous as /dev/mem and /dev/kmem.

Sponsored by:	EMC / Isilon Storage Division
2015-10-29 04:16:16 +00:00
kevlo
6862e5ea8e Add MLINKS for if_otus(4), if_rsu(4) and if_urtwn(4). 2015-10-29 03:28:28 +00:00
kevlo
af3d6f47ce Xref otus(4). 2015-10-29 03:22:27 +00:00
bdrewery
394a144c00 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
adrian
48944f6b39 Oops - use the wrong array offset. 2015-10-28 23:39:33 +00:00
hiren
d3c29dd43f Calculate the correct amount of bytes that are in-flight for a connection as
suggested by RFC 6675.

Currently differnt places in the stack tries to guess this in suboptimal ways.
The main problem is that current calculations don't take sacked bytes into
account. Sacked bytes are the bytes receiver acked via SACK option. This is
suboptimal because it assumes that network has more outstanding (unacked) bytes
than the actual value and thus sends less data by setting congestion window
lower than what's possible which in turn may cause slower recovery from losses.

As an example, one of the current calculations looks something like this:
snd_nxt - snd_fack + sackhint.sack_bytes_rexmit
New proposal from RFC 6675 is:
snd_max - snd_una - sackhint.sacked_bytes + sackhint.sack_bytes_rexmit
which takes sacked bytes into account which is a new addition to the sackhint
struct. Only thing we are missing from RFC 6675 is isLost() i.e. segment being
considered lost and thus adjusting pipe based on that which makes this
calculation a bit on conservative side.

The approach is very simple. We already process each ack with sack info in
tcp_sack_doack() and extract sack blocks/holes out of it. We'd now also track
this new variable sacked_bytes which keeps track of total sacked bytes reported.

One downside to this approach is that we may get incorrect count of sacked_bytes
if the other end decides to drop sack info in the ack because of memory pressure
or some other reasons. But in this (not very likely) case also the pipe
calculation would be conservative which is okay as opposed to being aggressive
in sending packets into the network.

Next step is to use this more accurate pipe estimation to drive congestion
window adjustments.

In collaboration with:	rrs
Reviewed by:		jason_eggnet dot com, rrs
MFC after:		2 weeks
Sponsored by:		Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D3971
2015-10-28 22:57:51 +00:00
jkim
4515ede9ab Define endianness for non-x86 platforms.
MFC after:	3 days
2015-10-28 22:49:37 +00:00
jah
9454cab093 Retire pmap_dmap_iscurrent(). It is only a wrapper around pmap_is_current(), and is no longer called. 2015-10-28 21:17:38 +00:00
imp
35a45e42cd 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
mav
cd70a0a54f Change the way how target mode is enabled on 23xx chips.
Without docs I am not completely sure about this, but on my tests new
method works better then previous, at least with our latest firmware.
2015-10-28 19:08:51 +00:00
imp
20050b3d3c Add a note to the effect that BUS_ADD_CHILD calls
device_add_child_ordered to add the child. device_add_child_ordered
doesn't call BUS_ADD_CHILD.
2015-10-28 18:53:18 +00:00
ae
f27a843176 Check the size of data available in mbuf, before using them.
PR:		202667
MFC after:	1 week
2015-10-28 17:55:37 +00:00