Commit Graph

197544 Commits

Author SHA1 Message Date
Gleb Smirnoff
26d50672d6 The last userland piece of in_var.h is now 'struct in_aliasreq'. Move
it to the top of the file, and ifdef _KERNEL the rest.
2015-02-19 23:59:27 +00:00
Gleb Smirnoff
e072c794ad Now that all users of _WANT_IFADDR are fixed, remove this crutch and
hide ifaddr, in_ifaddr and in6_ifaddr under _KERNEL.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-02-19 23:16:10 +00:00
Gleb Smirnoff
b0af3a5363 The ipftest(1) is a program that emulates ipf(4) operation and tests packets
against rules.  It definitely doesn't need to know about kernel internals,
such as 'struct ifaddr'.  What it does with ifaddr, is that it only takes
ifa_addr member of it, and treats it as sockaddr, while it is only a pointer
to sockaddr.  Fortunately, sizeof(struct ifaddr) > sizeof(struct sockaddr_in6),
so no problems arise.

Fix that declaring a private struct ifaddr in ipftest(1) and stop including
if_var.h.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-02-19 23:14:35 +00:00
Gleb Smirnoff
b1499feb9e Now that IGMP and MLD sysctls provide a clean API structures that do not
leak kernel internal stuff, reconnect ifmcstat(1) back to build.  However,
disable kvm(3) support in it, since it requires uncovering tons of _KERNEL
defined declarations, which can be achieved either uncovering them globally
or providing dirty hacks such as _WANT_IFADDR.  If anyone demands an
ifmcstat-like kvm-based tool, please take the code out of usr.sbin/ifmstat
and create a tool in src/tools/tools.
2015-02-19 22:42:33 +00:00
Gleb Smirnoff
9e62a5a379 - Rename 'struct mld_ifinfo' into 'struct mld_ifsoftc', since it really
represents a context.
- Preserve name 'struct mld_ifinfo' for a new structure, that will be stable
  API between userland and kernel.
- Make sysctl_mld_ifinfo() return the new 'struct mld_ifinfo', instead of
  old one, which had a bunch of internal kernel structures in it.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-02-19 22:37:01 +00:00
Gleb Smirnoff
0d159406b6 - Rename 'struct igmp_ifinfo' into 'struct igmp_ifsoftc', since it really
represents a context.
- Preserve name 'struct igmp_ifinfo' for a new structure, that will be stable
  API between userland and kernel.
- Make sysctl_igmp_ifinfo() return the new 'struct igmp_ifinfo', instead of
  old one, which had a bunch of internal kernel structures in it.
- Move all above declarations from in_var.h to igmp_var.h, since they are
  private to IGMP code.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-02-19 22:35:23 +00:00
Bjoern Heidotting
66a14ee8fc Add myself to committers-doc.dot
Approved by:	bcr (mentor)
2015-02-19 21:47:31 +00:00
Warner Losh
b4d7059828 Only disable gvn on clang 3.5 and newer. 2015-02-19 20:22:30 +00:00
Gleb Smirnoff
de5ef1dfee Burn bridges to FreeBSD 7.x IGMP stats. 2015-02-19 19:36:54 +00:00
Ed Schouten
0f0d5f6e45 Make syslogd work in case shutdown() is POSIX-ly correct.
On POSIX conformant systems, shutdown() should return ENOTCONN when not
connected. We attempted to fix this once (kern/84761), but this change
got backed out because it 'breaks code' (r150155).

I just reapplied the patch and indeed, syslogd fails on startup. Make it
easier to re-enable this change in the future by paching up syslogd to
do the right thing.

MFC after:	3 weeks
Sponsored by:	Nuxi
2015-02-19 18:56:39 +00:00
Gleb Smirnoff
6740ed378b Use KTR_COMPILE=(KTR_ALL) for LINTs, to get more code coverage. 2015-02-19 17:03:13 +00:00
Andrew Turner
16a1c0a829 Adda function to iterate over the cpu nodes in the OFW or FDT data. This
will be used with arm64 to find which cpus to enable, and could also be
used with 32-bit arm and mips for the same purpose.

Differential Revision:	https://reviews.freebsd.org/D1825
Sponsored by:	The FreeBSD Foundation
2015-02-19 16:34:48 +00:00
Konstantin Belousov
0c6dcac369 Fix build with KTR after r278978. 2015-02-19 15:41:23 +00:00
Andrew Turner
deb7728379 Add support to get the cpu ID from its device driver in a generic way.
This will be needed by arm64 to find the value to pass to the psci (Power
State Coordination Interface) driver, among other things, used to enable
cores.

Differential Revision:	https://reviews.freebsd.org/D1824
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2015-02-19 12:47:48 +00:00
Andrew Turner
aeca5b8bc9 Use the ARM unwinder with dtrace to extract the stack when asked. With this
dtrace is able to display a stack trace similar to the one below.

# dtrace -p 603 -n 'tcp:kernel::receive { stack(); }'
  0     70                         :receive
              kernel`ip_input+0x140
              kernel`netisr_dispatch_src+0xb8
              kernel`ether_demux+0x1c4
              kernel`ether_nh_input+0x3a8
              kernel`netisr_dispatch_src+0xb8
              kernel`ether_input+0x60
              kernel`cpsw_intr_rx+0xac
              kernel`intr_event_execute_handlers+0x128
              kernel`ithread_loop+0xb4
              kernel`fork_exit+0x84
              kernel`swi_exit
              kernel`swi_exit

Tested by:	gnn
Sponsored by:	ABT Systems Ltd
2015-02-19 12:20:21 +00:00
Andrew Turner
1b23f9b9c3 Allow the ARM unwinder to work through modules. This will be used to add
support for unwinding from dtrace.

Tested by:	gnn (with dtrace)
Sponsored by:	ABT Systems Ltd
2015-02-19 12:06:57 +00:00
Bjoern A. Zeeb
daa99f441e Try to unbreak NOIP and NOINET6 LINT builds after r278886
by placing appropriate #ifdefs around otherwise unused variables
or sections with functions called which are not available without
IPv6 support in the kernel.
2015-02-19 11:48:00 +00:00
Enji Cooper
57e8e48f53 Unbreak freshly installed worlds by properly "commenting" out ifmcstat
Pointyhat to: glebius
2015-02-19 11:17:36 +00:00
Gleb Smirnoff
53d3d92f4b Temporarily disconnect ifmcstat(8) from build, to make world buildable
ifmcstat(8) noses in kernel memory too much, and thus is very tentative
to any changes in kernel.

I will rewrite it to use some API instead of libkvm(3) and connect back
to build.
2015-02-19 06:27:14 +00:00
Gleb Smirnoff
fd1b2a7c57 Widen _KERNEL ifdef to hide more kernel network stack structures from userland. 2015-02-19 06:24:27 +00:00
Glen Barber
3a25555c6a Fix a grammar nit.
Sponsored by:	The FreeBSD Foundation
2015-02-19 05:20:59 +00:00
Mark Johnston
ce47682c6c Remove unnecessary checks for a return value of NULL from M_WAITOK
allocations.

MFC after:	3 days
2015-02-19 03:32:48 +00:00
Mark Johnston
250246706f Free the zlib stream after expanding a compressed CTF section.
Note that this memory would only be leaked once, since CTF info for a kld
file is cached after the first access.

MFC after:	3 days
2015-02-19 03:29:46 +00:00
John-Mark Gurney
b759b8aa44 fix spelling, add comma and remove BUGS section.. it provided no useful
information, and is not really bugs, but limitations for other reasons...
2015-02-19 01:51:17 +00:00
Gleb Smirnoff
a99c84d4e6 Use new struct mbufq instead of struct ifqueue to manage packet queues in
IPv6 multicast code.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-02-19 01:21:23 +00:00
Gleb Smirnoff
058e08bea9 Use new struct mbufq instead of struct ifqueue to manage packet queues in
IPv4 multicast code.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-02-19 01:21:02 +00:00
Gleb Smirnoff
c578b6aca0 Provide a set of inline functions to manage simple mbuf(9) queues, based
on queue(3)'s STAILQ.  Utilize them in cxgb(4) and Xen, deleting home
grown implementations.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-02-19 01:19:42 +00:00
John Baldwin
8935302fe1 Ensure that the supplied data length is large enough to hold the base
FPU state to avoid passing a negative length to fpusetregs() / npxsetregs().

Differential Revision:	https://reviews.freebsd.org/D1861
Reviewed by:	kib, emaste
2015-02-18 23:34:03 +00:00
Jung-uk Kim
9c633deb70 Fix bootstrap on systems with old yacc with small MAXTABLE. 2015-02-18 23:10:15 +00:00
Jung-uk Kim
1c0e1b6da9 Merge ACPICA 20141107 and 20150204. 2015-02-18 20:33:00 +00:00
Peter Grehan
784b6cd5e9 Restore the ability to use clang as an external compiler. This was
inadvertently removed when support for external GCC was added.

Deprecate XFLAGS in favour of the newer XCFLAGS/XCXXFLAGS.

Tested with:	make universe, make CROSS_COMPILER_PREFIX=/usr/bin/ buildworld
Reviewed by:	imp, bapt
2015-02-18 19:27:51 +00:00
Kenneth D. Merry
e8577fb489 Make sure that the flags for the XPT_DEV_ADVINFO CCB are initialized
properly.

If there is garbage in the flags field, it can sometimes include a
set CDAI_FLAG_STORE flag, which may cause either an error or
perhaps result in overwriting the field that was intended to be
read.

sys/cam/cam_ccb.h:
	Add a new flag to the XPT_DEV_ADVINFO CCB, CDAI_FLAG_NONE,
	that callers can use to set the flags field when no store
	is desired.

sys/cam/scsi/scsi_enc_ses.c:
	In ses_setphyspath_callback(), explicitly set the
	XPT_DEV_ADVINFO flags to CDAI_FLAG_NONE when fetching the
	physical path information.  Instead of ORing in the
	CDAI_FLAG_STORE flag when storing the physical path, set
	the flags field to CDAI_FLAG_STORE.

sys/cam/scsi/scsi_sa.c:
	Set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE when
	fetching extended inquiry information.

sys/cam/scsi/scsi_da.c:
	When storing extended READ CAPACITY information, set the
	XPT_DEV_ADVINFO flags field to CDAI_FLAG_STORE instead of
	ORing it into a field that isn't initialized.

sys/dev/mpr/mpr_sas.c,
sys/dev/mps/mps_sas.c:
	When fetching extended READ CAPACITY information, set the
	XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of
	setting it to 0.

sbin/camcontrol/camcontrol.c:
	When fetching a device ID, set the XPT_DEV_ADVINFO flags
	field to CDAI_FLAG_NONE instead of 0.

sys/sys/param.h:
	Bump __FreeBSD_version to 1100061 for the new XPT_DEV_ADVINFO
	CCB flag, CDAI_FLAG_NONE.

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-02-18 18:30:19 +00:00
Konstantin Belousov
1395226703 If malloc() sleeps, Giant is dropped. Recheck for another thread
doing our work.

Remove unneeded check for failed M_WAITOK allocation.

Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-02-18 18:12:06 +00:00
Marcel Moolenaar
cf9b923f48 Add LIBXO. 2015-02-18 17:28:55 +00:00
Warner Losh
5ec3257602 Clean up a bit of the INET/INET6 mess wrt options. 2015-02-18 15:25:25 +00:00
Warner Losh
88030a5eb0 Cleanup the way we include some files (in this case EISA) based on
kernel config. Also tidy up the ed options.
2015-02-18 15:25:22 +00:00
Warner Losh
35c4406d4c Populate new KERN_OPTS from all the opt_*.h files in
KERNBUILDDIR. Come up with some sensible defaults (though listing them
in kmod.mk may be unwise -- we have no easy way to know what are the
best sensible defaults for everything so we just catch the big stuff).
Append SRCS.${opt} for each option in KERN_OPTS to SRCS to allow easy
conditional compilation. Append any notion of KERN_OPTS_EXTRA to the
list of kernel opts.

Differential Revision:    https://reviews.freebsd.org/D1530
2015-02-18 15:25:19 +00:00
Warner Losh
46b39c90f4 Add copyright statement I should have had on these files in 2006,
based on the spibus_if.m file.
2015-02-18 14:33:33 +00:00
Mateusz Guzik
8fbda7f00b filedesc: obtain a stable copy of credentials in fget_unlocked
This was broken in r278930.

While here tidy up fget_mmap to use fdp from local var instead of obtaining
the same pointer from td.
2015-02-18 13:37:28 +00:00
Konstantin Belousov
117c6e7cf2 Fix UP build.
Sponsored by:	The FreeBSD Foundation
MFC after:	2 months
2015-02-18 10:51:48 +00:00
Xin LI
19442b85b1 Bump revision again after my Fortuna change. 2015-02-18 08:24:00 +00:00
Xin LI
8d45c8ab96 - fortuna.c: catch up with r278927 and fix a buffer overflow by using the
temporary buffer when remaining space is not enough to hold
	      a whole block.
 - yarrow.c:  add a comment that we intend to change the code and remove
	      memcpy's in the future. (*)

Requested by:	markm (*)
Reviewed by:	markm
Approved by:	so (self)
2015-02-18 08:21:51 +00:00
Justin Hibbits
9fdc5d59f3 Match the right backlight driver.
Some ATI-based PowerBooks use the string 'mnca' in the backlight controller
device tree entry, so account for this and don't use nVidia when it's not an
nVidia device.

MFC after:	3 weeks
2015-02-18 07:34:32 +00:00
Justin Hibbits
5f41b3c1da Don't set the write bit if we're just reading.
Also fix a couple typos.

MFC after:	3 weeks
2015-02-18 06:53:40 +00:00
Andrew Rybchenko
d8574f4f45 sfxge: fix broken MCDI_EV_FIELD() macro
Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:26:07 +00:00
Andrew Rybchenko
1f69766845 sfxge: support variable-length response to MCDI GET_BOARD_CFG
Allocate the minimum or maximum response length for GET_BOARD_CFG as
appropriate.  When looking up firmware subtypes by partition ID,
check the ID against the actual response length.

Merge of the patch made by Ben Hutchings in 2011.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:23:16 +00:00
Andrew Rybchenko
097de6f518 sfxge: add driver context member with number of event queues
Mainly to unify with similar member for transmit and receive queues.
It will be used in the future for resources allocation processing.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:21:59 +00:00
Andrew Rybchenko
133366a6e5 sfxge: add driver context member with number of receive queues
Mainly to unify with similar member for transmit queues.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:20:59 +00:00
Andrew Rybchenko
e2b05fe21c sfxge: add driver context member with number of transmit queues
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:19:35 +00:00
Andrew Rybchenko
d0f7387777 sfxge: add TCP segment size to sfxge_tso_state
It avoids access to m_pkthdr when TSO packet is started and also makes
tso_start_new_packet() function smaller.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
2015-02-18 06:18:51 +00:00