Nuno Antunes [Fri, 18 Jul 2014 14:12:52 +0000 (15:12 +0100)]
Use system's RT_ROUNDUP and RT_ADVANCE macros instead of local copies.
Reviewed-by: dillon
Nuno Antunes [Fri, 18 Jul 2014 10:16:10 +0000 (11:16 +0100)]
net/route.h: Expose the ROUNDUP and ADVANCE macros.
* These macros are replicated in multiple places on the tree. Give
them an RT_ prefix and centralize them in net/route.h in an effort
to reduce code duplication.
* Kernel and userland changes to use these macros will come in a
subsequent commit.
Taken-from: NetBSD
Reviewed-by: dillon
Nuno Antunes [Thu, 17 Jul 2014 06:51:24 +0000 (07:51 +0100)]
netgraph7: Assert the refcount is zero when freeing the item.
Matthew Dillon [Sat, 19 Jul 2014 17:23:41 +0000 (10:23 -0700)]
kernel - Revert "Fix buildworld."
* Fix PF in a different way, by conditionalizing the inclusion of
struct pf_state instead of conditionalizing all the use cases for
pfvar.h.
* This reverts commit
56e2aaa4d1de560d06f713866ab834747982f839.
* Reorders pfvar.h a bit and conditionalizes struct pf_state { }.
François Tigeot [Sat, 19 Jul 2014 10:02:00 +0000 (12:02 +0200)]
re(4): Use MPSAFE callout
The callout function was already protected by a serializer.
Imre Vadasz [Sat, 19 Jul 2014 09:54:27 +0000 (11:54 +0200)]
mii: Add RealTek RTL8251 phy found on an ASUS A88XM-Plus mainboard.
Taken-From: OpenBSD
François Tigeot [Sat, 19 Jul 2014 07:54:07 +0000 (09:54 +0200)]
drm(4): This device is MPSAFE
* And has always been since the initial import from FreeBSD 11 years ago.
* Tested with Radeon and i915 hardware for good measure.
Sascha Wildner [Fri, 18 Jul 2014 18:49:02 +0000 (20:49 +0200)]
kernel/sym: Remove an extra semicolon in a #define.
Sascha Wildner [Fri, 18 Jul 2014 17:32:57 +0000 (19:32 +0200)]
kernel: Switch to mrsas(4) as the default for 'Thunderbird' series cards.
Matthew Dillon [Fri, 18 Jul 2014 16:32:46 +0000 (09:32 -0700)]
kernel - Adjust ssb_space_prealloc() use cases
* Add two flags to the signalsockbuf ssb_flags field.
SSB_PREALLOC - Indicates that data preallocation tracking is being used
SSB_STOPSUPP - Indicates that SSB_STOP flow control is being used
* unix domain sockets set SSB_STOPSUPP, tcp and sctp sockets
set SSB_PREALLOC.
* sendfile() requires that either SSB_PREALLOC or SSB_STOPSUPP be specified.
* Code now conditionalizes the use of ssb_space() vs ssb_space_prealloc()
based on the presence of the SSB_PREALLOC flag.
Reported-by: sephe
Sepherosa Ziehau [Fri, 18 Jul 2014 12:00:24 +0000 (20:00 +0800)]
tcp: Set upper limit for the DupThresh generated by the NCR
The DupThresh could be pretty large due to large amount of outstanding
segments on the fast local area network. If the reception side really
lost some segments, the fast recovery would be delayed for a long time.
It would become even worse, if the reception side aggregated ACKs, i.e.
widely used LRO; it could even cause timeout retransmition, which is
highly unappreciated on the fast local area network. Put an upper
limit for the DupThresh, currently 16, so that fast recovery could take
over segment retransmittion in a timely fashion. The upper limit of
DupThresh could be controlled by sysctl net.inet.tcp.ncr_rxtthresh_max.
Matthew Dillon [Fri, 18 Jul 2014 06:52:54 +0000 (23:52 -0700)]
kernel - network adjustments (netisr, tcp, and socket buffer changes)
* Change sowakeup() to use an atomic fetch when testing WAIT/WAKEUP for
a quick return. It is now coded properly. Previous coding is not known
to have created any bugs.
* Change sowakeup() to use ssb_space_prealloc() instead of ssb_space()
when testing against the transmit low-water mark. This is a bug fix
which primarily effects very tiny write()'s. The prior code is not
known to have created any problems.
* Make the netisr packet counter before doing a rollup programmer and
change the default from 512 to 32 for the moment. This may be changed
back to 512 (or some number inbetween) after further testing.
The issue here is that interrupt/netisr pipelining can cause ack aggregation
to be delayed for too many packets.
* For TCP, when timestamps are not being used, pass the correct delta
to tcp_xmit_timer() in our fallback. The function expects N+1. This
should improve/fix incorrect rtt calculations when tcp timestamps are
not in use.
* Fix an edge case in tcp_xmit_bandwidth_limit() where the 'ticks' global
could change values out from under the code. Load the global into a local
variable.
* Change the inflight code to use (t_srtt + t_rttvar) instead of
(t_srtt + t_rttbest) / 2.
This needs fine-tuning, the buffer is still too big. Expect more commits
later.
* Call sowwakeup() when appending a mbuf to a stream. The append can call
sbcompress() and make a stream buffer that has hit its mbuf limit writable
again.
* Remove the ssb_notify() macro and collapse the sorwakeup() and sowwakeup()
macros. They now just call sowakeup() on the appropriate sockbuf. The
notify test is now done in sowakeup().
Matthew Dillon [Fri, 18 Jul 2014 04:33:32 +0000 (21:33 -0700)]
kernel - turn off auto-socket sizing
* Turn off automatic socket sizing for NFS sockets. Otherwise the socket
buffer might be reduced to the point where the mbuf interface refuses
to queue w/EMSGSIZE.
TODO: We need a better fix.
Matthew Dillon [Fri, 18 Jul 2014 03:54:42 +0000 (20:54 -0700)]
kernel - Fix two NFS crashes
* Fix a bug during unmount when sillyrenames are being terminated.
When doing a forced unmount, the sillyrename vnode(s) may be VBAD.
Do not attempt to flush the sillyrename in this case.
* Fix a bug for 'soft' mounts. Soft failures do not properly set the
error code which can lead to a NULL pointer dereference in the rpc
processing code.
Set the error code to EINTR for soft mounts whos retries have been
exceeded.
Matthew Dillon [Thu, 17 Jul 2014 23:03:13 +0000 (16:03 -0700)]
kernel - Move wakeup*() to ouside a spin lock
* Move the wakeup*() calls in the linux completion interface from inside
to outside the spinlock. It can't be safely called from inside the
spinlock.
Reported-by: me_
Zach Crownover [Thu, 17 Jul 2014 11:26:11 +0000 (04:26 -0700)]
Added support for rcreload
Updated the man page date and links to account for the new symlink to
rcrun as well as add it in to the rcrun.sh based on the restart entry.
Matthew Dillon [Thu, 17 Jul 2014 05:17:19 +0000 (22:17 -0700)]
kernel - minor cpu idle statistics adjustment
* Change the idlethread test from RQF_AST_LWKT_RESCHED to
RQF_IDLECHECK_WK_MASK (which includes the first flag and adds a few more)
to determine if the idle thread is actually idle or not.
* Should not materially change reported idle% as the original test handled
the most common idle-thread-skips-halt case.
Nuno Antunes [Thu, 17 Jul 2014 03:10:06 +0000 (04:10 +0100)]
msgport.9: lwkt_initport_spin now takes a fixed_cpuid argument.
François Tigeot [Wed, 16 Jul 2014 19:52:17 +0000 (21:52 +0200)]
drm/i915: Sync intel_sprite.c with Linux 3.8.13
Matthew Dillon [Wed, 16 Jul 2014 07:07:58 +0000 (00:07 -0700)]
kernel - Add feature to allow sendbuf_auto to decrease the buffer size
* sysctl net.inet.tcp.sendbuf_auto (defaults to 1) is now able to
decrease the tcp buffer size as well as increase it.
* Inflight bwnd data is used to determine how much to decrease the
buffer. Inflight is enabled by default. If you disable it
with (net.inet.tcp.inflight_enable=0), sendbuf_auto will not
be able to adjust buffer sizes down.
* Set net.inet.tcp.sendbuf_min (default 32768) to set the floor for
any downward adjustment.
* Set net.inet.tcp.sendbuf_auto=2 to disable the decrease feature.
Nuno Antunes [Tue, 15 Jul 2014 02:16:18 +0000 (03:16 +0100)]
netgraph7: Factor out and inline item reference counting code.
* Netgraph7 assumes that nodes synchronously consume the items passed to them,
i.e. either 1) immediatly drop the item or 2) immediatly pass the item to the
next node.
The previous assumption is not true for nodes that have their own internal
item queues and defer the processing of the item. Such nodes can use these
routines to prevent the items from being freed too early.
* Move the apply callback check into the item reference release code.
Matthew Dillon [Wed, 16 Jul 2014 03:27:51 +0000 (20:27 -0700)]
kernel - Improve TCP socket handling at high speeds
* Add M_SOLOCKED to mbuf->m_flags. This flag prevents sbcompress()
from collapsing more data into a mbuf.
* Rewrite sorecvtcp() (NOTE: soreceive() could use similar treatment).
Use M_SOLOCKED to freeze mbufs in the sockbuf with the rcvtok held,
then do the uiomove() loop WITHOUT the rcvtok held, then finalize
the disposal of the mbufs with rcvtok held.
This greatly reduces contention on rcvtok against the netisr threads
when reading large amounts of data at once and reduces cpu overhead
for netisr and user network threads.
* Change the default transmit ssb_lowat from ssb_hiwat / 2 to ssb_hiwat / 4.
The (previous) default maximum socket buffer size was 256KB. The default
lowat reduced the effective TCP transmit window to ~100KB. This can cause
severe buffering issues on GiGE links when multiple TCP streams are being
routed to the same cpu.
With this change the default max send buffer is ~180KB or so.
* Change the default kern.ipc.maxsockbuf from 256KB to 512KB. This
primarily effects auto-sizing of tcp buffers which in turn effects
most TCP connections.
This coupled with the hiwat fix greatly improves transmit throughput.
* Add more debugging info to the tcp inflight code.
François Tigeot [Tue, 15 Jul 2014 20:08:02 +0000 (22:08 +0200)]
drm/i915: Sync ringbuffer code with Linux 3.8.13
* Split hardware initialization and irq management to model-specific
functions
* Various little fixes and workarounds to compensate for hardware
bugs and irregular behavior
* Enable parity error interrupts
* Simplify flushing and request tracking
François Tigeot [Tue, 15 Jul 2014 20:02:10 +0000 (22:02 +0200)]
drm: Fix locking issues in drm_irq.c
* Some functions expected the drm lock to be used differently than what
gpu drivers really did, leading to crashes
* Sync them with Linux 3.8.13
Reported-by: Johannes Hofmann
Matthew Dillon [Tue, 15 Jul 2014 19:31:50 +0000 (12:31 -0700)]
kernel - Add safety for Intel SYSRET issue
* First, insofar as we can tell DragonFly was *NOT* vulnerable to the
Intel SYSRET issue. We have a RQF_QUICKRET flag that determines if SYSRET
can be used. Any heavy weight process switch, signal delivery, signal
return, or set_regs() call clears this flag and forces the system call to
return via IRET.
* However, the ptrace() path is a bit convoluted. Insofar as I can tell
it just won't allow %rip to be changed unless the target process is in
a SSTOPped state, meaning that a heavy weight context switch must occur
before the new %rip is used which means we should be safe.
Still, we are adding a safety to ptrace_set_pc() to cannonicalize the
%rip anyway, to ensure that this bug cannot bite us indirectly in the
future.
François Tigeot [Tue, 15 Jul 2014 16:20:56 +0000 (18:20 +0200)]
drm: Reorder functions in drm_irq.c
* Reducing differences with Linux 3.8.13
* No functional change
Sascha Wildner [Tue, 15 Jul 2014 09:15:47 +0000 (11:15 +0200)]
Update the pciconf(8) database.
July 14, 2014 snapshot from http://pciids.sourceforge.net/
Sascha Wildner [Tue, 15 Jul 2014 09:03:03 +0000 (11:03 +0200)]
<sys/protosw.h>: Use netmsg_t.
Sascha Wildner [Tue, 15 Jul 2014 08:42:17 +0000 (10:42 +0200)]
kernel/netgraph7: Use kprintf etc. directly instead of defining printf.
While here, remove some commented out code from dragonfly.h
In-discussion-with: nant
Sascha Wildner [Tue, 15 Jul 2014 08:09:00 +0000 (10:09 +0200)]
kernel/netgraph: Don't grab the tty_token around ldisc_{,de}register().
The functions already grab it themselves.
Pointed-out-by: nant
Sascha Wildner [Tue, 15 Jul 2014 07:03:41 +0000 (09:03 +0200)]
kernel/netgraph7: Remove unneeded CFLAGS.
Sascha Wildner [Tue, 15 Jul 2014 06:53:21 +0000 (08:53 +0200)]
kernel/netgraph7: Adjust SVN ID.
Imre Vadasz [Mon, 14 Jul 2014 19:32:27 +0000 (21:32 +0200)]
km(4): Also supports sensors in AMD Family 12h CPUs. Update manpage.
* AMD Family 12h CPUs use the same PCI device ID as Family 14h CPUs.
Sascha Wildner [Mon, 14 Jul 2014 18:54:56 +0000 (20:54 +0200)]
kernel/netgraph7: Sync ng_bt3c with current FreeBSD and port it over.
I can't test this hardware unfortunately since I don't own it.
Matthew Dillon [Mon, 14 Jul 2014 18:16:53 +0000 (11:16 -0700)]
powerd - Set to max performance if killed
* If the powerd daemon is killed it now sets the system to maximum
performance before exiting for consistency, instead of leaving it
in a potentially low-power state.
Matthew Dillon [Mon, 14 Jul 2014 17:47:22 +0000 (10:47 -0700)]
kernel - Fix stability issue with net.inet.tcp.inflight*
* net.inet.tcp.inflight_enable is (already) turned on by default. This
is necessary for network stability and to reduce excessive packet buffering
to make PF and other routing protocols on the network work better.
* There is a bug at very high bandwidths where the 'bw' calculation is
unstable and can lead to positive feedback instead of the desired negative
feedback, preventing the tcp buffer size from ramping up properly.
GigE links could sometimes run a tcp stream as slow as 7 MBytes/sec due
to the bug due to bwnd limiting the tcp buffer to ~30-50KB.
* Fix the bug by increasing the minimum delta ticks for calculating (bw)
from 1 to 2 and changing the stab parameter to scale bw instead of adding a
fixed number of tcp maxsegs to bwnd. This handles the high-speed issue.
Low speed stability issues are handled by also adding 2*maxseg to bwnd.
With this fix, GigE links stabilize better at the ~400-450KB needed to run
the stream at full speed.
* net.inet.tcp.inflight_stab now scales bw in 1/10% increments instead
of adding N*tcp_maxseg/10. The default value of 50 increases the 'bw'
calculation used to derive bwnd by 5%. This appears to be sufficient.
Reported-by: alexh, rob__
Alex Hornung [Mon, 14 Jul 2014 11:43:40 +0000 (12:43 +0100)]
rc.d/random: bring back rc.conf defaults, minor fixes
* Saving the entropy across reboots is good practice to
avoid having a lack of entropy after restarting the
machine. For some reason, it has been disabled by default
for ages now.
* This commit brings back the defaults in rc.conf to enable
saving entropy across reboots.
* Minor fixes to rc.d/random, such as not assuming
/var/db/entropy is a good place to put the entropy file,
last but not least because:
- that location is not checked on the start part of the script,
so it won't ever be used.
- /var/db/entropy is most of the time a directory, for the
cron-based entropy collection.
Alex Hornung [Mon, 14 Jul 2014 10:55:33 +0000 (11:55 +0100)]
random.4 - update for new CSPRNG status
Alex Hornung [Mon, 14 Jul 2014 07:53:06 +0000 (08:53 +0100)]
kern_nrandom, rnd drivers: update for new CSPRNG
* Identify each source of entropy with an identifier, so that
for example the Fortuna CSPRNG can manage the pool index
for each source.
* Add a new sysctl, kern.rand_mode, which can be used to select
which generator is used for /dev/random; valid values are:
- csprng (to use only the Fortuna-based CSPRNG)
- ibaa (to use only IBAA)
- mixed (to XOR both csprng and ibaa in the output stream
It defaults to "mixed".
Alex Hornung [Thu, 12 Jun 2014 14:32:27 +0000 (15:32 +0100)]
Add ChaCha and CSPRNG to conf/files
Alex Hornung [Thu, 12 Jun 2014 14:24:21 +0000 (15:24 +0100)]
kernel - add a fortuna-based CSPRNG
* This implements a Fortuna-based CSPRNG.
* All entropy pools are shared across all CPUs in the system.
* SHA256 is used instead of SHA256_d as cryptographical hash
function.
* ChaCha is used as stream cipher instead of AES in CTR mode.
Alex Hornung [Thu, 12 Jun 2014 14:22:32 +0000 (15:22 +0100)]
kernel - add ChaCha algorithm (djb's merged implementation)
Alex Hornung [Thu, 12 Jun 2014 14:23:05 +0000 (15:23 +0100)]
glxsb(4) - use add_buffer_randomness()
Sepherosa Ziehau [Mon, 14 Jul 2014 09:59:34 +0000 (10:59 +0100)]
igb: enable MSI-X for i354 on C2550 SoC
Matthew Dillon [Mon, 14 Jul 2014 05:15:52 +0000 (22:15 -0700)]
drm - Fix bug with ttm_tt_swapin()
* Fix deadlock due to improper handling of the vm_page PG_BUSY in
ttm_tt_swapin().
François Tigeot [Sun, 13 Jul 2014 09:00:12 +0000 (11:00 +0200)]
drm/ttm: Replace FreeBSD custom code by Linux workqueues
Imre Vadasz [Sun, 13 Jul 2014 11:02:00 +0000 (13:02 +0200)]
identcpu: Add AMD Features2 strings for bits 25 to 28
Matthew Dillon [Sun, 13 Jul 2014 23:00:39 +0000 (16:00 -0700)]
kgdb - Fix for new CPU_prvspace[]
* CPU_prvspace[] is now an array of pointers to struct privatespace and
not an array of struct privatespace.
Sascha Wildner [Sun, 13 Jul 2014 12:10:11 +0000 (14:10 +0200)]
kernel/netgraph: Remove useless Makefile.inc's.
Sascha Wildner [Sun, 13 Jul 2014 18:47:23 +0000 (20:47 +0200)]
kernel/netgraph7: Sync ubt and ubtbcmfw with current FreeBSD.
Also make them compile.
We need those drivers as of FreeBSD >=8 here since that's when
FreeBSD switched to usb4bsd.
Alex Hornung [Sun, 13 Jul 2014 11:33:56 +0000 (12:33 +0100)]
Revert "add load_kld to rc.subr"
This reverts commit
9b9814ddce54234e4b231ecb33b1de509a0a9bd5.
We don't really need load_kld, since ifconfig loads if_vlan on its own.
Alex Hornung [Sun, 13 Jul 2014 09:56:35 +0000 (10:56 +0100)]
rc.conf - Add support for FreeBSD-style vlan conf
Obtained-from: FreeBSD
Alex Hornung [Sun, 13 Jul 2014 09:45:44 +0000 (10:45 +0100)]
ifconfig - use correct name after cloning
* When running something like 'ifconfig vlan create vlandev foo vlan
99', the vlan would be created correctly, but SIOCSETVLAN would be
called on 'vlan' instead of the newly created vlan device.
* Work around this by updating ifr_name from name (which is updated by
the clone function) after doing the actual clone callback.
Alex Hornung [Sun, 13 Jul 2014 07:19:55 +0000 (08:19 +0100)]
network.subr - use get_if_var extensively
Alex Hornung [Sun, 13 Jul 2014 07:06:13 +0000 (08:06 +0100)]
add load_kld to rc.subr
Obtained-from: FreeBSD
Alex Hornung [Sun, 13 Jul 2014 06:59:27 +0000 (07:59 +0100)]
network.subr - move get_if_var here
Sascha Wildner [Sun, 13 Jul 2014 09:52:31 +0000 (11:52 +0200)]
kernel: Use NULL for pointers.
François Tigeot [Sun, 13 Jul 2014 06:40:12 +0000 (08:40 +0200)]
drm: Improve the BUG() macro
Nuno Antunes [Sat, 12 Jul 2014 15:37:52 +0000 (16:37 +0100)]
netgraph7: Fix a bug in the Makefile.
* The ng_mppc node should not be built if the NO_CRYPT make
variable is set.
Matthew Dillon [Sun, 13 Jul 2014 01:06:53 +0000 (18:06 -0700)]
build - allow ABIVERS to be overridden in Makefile.usr
* Allow ABIVERS to be overridden in Makefile.usr. (Defaults to uname -P).
Matthew Dillon [Sun, 13 Jul 2014 00:48:59 +0000 (17:48 -0700)]
kernel - More verbose boot de-spamming
* Try to fit common package siblings print lines into 80 columns.
Matthew Dillon [Sun, 13 Jul 2014 00:31:48 +0000 (17:31 -0700)]
kernel - Add two features to improve qemu emulation (64-bit only)
* Implement a tunable for machdep.cpu_idle_hlt, allowing it to be
set in /boot/loader.conf. For qemu the admin might want to set
the value to 4 (always use HLT) instead of the default 2.
* Implement a tunable and new sysctl, machdep.pmap_fast_kernel_cpusync,
which defaults to disabled (0). Setting this to 1 in /boot/loader.conf
or at anytime via sysctl tells the kernel to use a one-stage pmap
invalidation for kernel_pmap updates. User pmaps are not affected and
will still use two-stage invalidations.
One-stage pmap invalidations only have to spin on the originating cpu,
but all other cpus will not be quiesced when updating a kernel_map pmap
entry. This is untested as there might be situations where the kernel
pmap is updated without an interlock (though most should be interlocked
already).
This second sysctl/tunable, if enabled, greatly improves qemu performance
particularly when the number of qemu cpus is greater than the number of
real cpus. It probably improves real hardware system performance as well,
but is not recommended for production at this time.
Matthew Dillon [Sun, 13 Jul 2014 00:30:04 +0000 (17:30 -0700)]
kernel - Add lwkt_cpusync_quick()
* Add a quick one-stage cpusync function to complement our two-stage
interlock/deinterlock cpusync functions.
The one-stage version doesn't have to spin the target cpus, only the
originating cpu, but it can't quiesce the cpus either whereas the
two-stage version can.
Matthew Dillon [Sun, 13 Jul 2014 00:20:29 +0000 (17:20 -0700)]
kernel - Reduce console spam in verbose mode when printing cpu sets
* Add helper function kprint_cpuset().
* Print cpu ranges when printing out cpu sets.
* Print cpu ranges when generating topology output for sysctl
François Tigeot [Sat, 12 Jul 2014 19:22:33 +0000 (21:22 +0200)]
drm/i915: Fix flickering screen issues on some laptops
Reported-and-tested-by: luxh
Matthew Dillon [Sat, 12 Jul 2014 18:49:13 +0000 (11:49 -0700)]
kernel - Fix crypto boots and rescue boots
* The kernel text+data+bss is too big, the loader's 64MB heap can't fit
it plus modules plus the initrd image any more. Fix by reducing the
kernel's BSS.
* Reduce the BSS allocation for CPU_prvspace[] from 11MB (45056 x 256 cpus)
to ~45056 for the BSP and dynamically allocate the globaldata space for
the APs. Also saves ~11MB of ram or so on normal systems.
* Reduce the BSS allocation for cpu_map_entry_init[]. Only the BSP needs
MAXCPU+1 pre-cached vm_map_entry structures. The APs can make due with
8 or so before the VM system comes up sufficiently to dynamically allocate
these structures. This saves around ~6.5MB of ram on normal systems.
Imre Vadasz [Sat, 12 Jul 2014 15:40:31 +0000 (17:40 +0200)]
km(4): Support for sensors in AMDs Kaveri and Kabini APUs
* Add support for Family 15h Models 30h-3Fh (Kaveri) and for
Family 16h Models 00h-0Fh (Kabini).
Sascha Wildner [Fri, 11 Jul 2014 21:27:42 +0000 (23:27 +0200)]
Fix a couple of typos in a manpage and readme file.
Sascha Wildner [Fri, 11 Jul 2014 19:52:32 +0000 (21:52 +0200)]
kernel: Remove unused functions vop_panic() and vfs_std{,un}mount().
vop_panic()'s last usage was removed in 2009 (in
bdc5802715465c8)
while vfs_stdmount() and vfs_stdunmount() were inherited from FreeBSD
but never used at all.
Matthew Dillon [Fri, 11 Jul 2014 18:07:50 +0000 (11:07 -0700)]
kernel - Fix table problem w/IPV6 matching with PF
* Zero the sin6 structure before initializing it for passing to rn_match().
rn_match() is not structurally aware so pad space in the structure must
be zero'd.
* Fixes IPV6 table matching problem with PF.
Reported-by: ftigeot
Testing-by: ftigeot
Sascha Wildner [Fri, 11 Jul 2014 11:46:50 +0000 (13:46 +0200)]
libradius.3: Add missing include file in the manual page.
It has the prototype for *vendor* functions and rad_demangle_mppe_key().
Nuno Antunes [Fri, 20 Jun 2014 14:11:34 +0000 (15:11 +0100)]
netgraph7: Allow name and ID hashes to grow.
* Also, nodes can be renamed now.
Obtained-from: FreeBSD (with changes)
Nuno Antunes [Fri, 20 Jun 2014 14:04:37 +0000 (15:04 +0100)]
netgraph7: Plug item allocation leak in ng_socket.
* ng_connect_data() allocates a dummy item (which will not be sent) to
address the destination node and obtain reference on it. This item
needs to be freed before returning from this function, so use
ng_free_item() instead of the NOP NG_FREE_ITEM.
Nuno Antunes [Thu, 19 Jun 2014 02:25:54 +0000 (03:25 +0100)]
netgraph7: Use a shared token to protect typelist changes.
* Reduce differences with FreeBSD current.
Nuno Antunes [Wed, 18 Jun 2014 07:22:06 +0000 (08:22 +0100)]
netgraph7: Use a shared token to protect topology changes.
* FreeBSD current uses a reader/writer lock to protect topology changes.
Take the same approach except we use a shared token instead.
Nuno Antunes [Wed, 18 Jun 2014 06:37:16 +0000 (07:37 +0100)]
netgraph7: Remove unneeded critical sections.
* While here, fix some style nits.
* Also add a missing objcache_destroy() call.
Nuno Antunes [Wed, 18 Jun 2014 05:26:09 +0000 (06:26 +0100)]
netgraph7: Directly use objcache_* functions instead of a translation macro.
Nuno Antunes [Thu, 9 May 2013 21:59:47 +0000 (21:59 +0000)]
netgraph7: Major rework of netgraph7 internal mechanisms.
* Promote the netgraph taskqueue to a fully fledged per-CPU lwkt.
Currently all work is queued to cpu0 but the idea is to later distribute
work among the threads. I also explored the idea of using netisr threads
instead of our own dedicated threads but I think it would be a bad idea to
globaly block a netisr thread due to a netgraph token or other lock.
* Embed a struct lwkt_msg in netgraph items.
* Make ng_apply_item() accept only one argument.
* Remove the global worklist and per-node input queues and related routines.
* Always and only queue items coming from interrupt context.
Items are now always queued, except if they are already being sent from a
netgraph thread (depth > 1). The NG_QUEUE and HK_QUEUE flags become no-ops
but are kept for compatibility reasons.
* Replace the node reader/writer gate with a per-node lwkt shared
token.
* Remove some #if 0'd code
* netgraph7/ng_socket: Avoid blocking on netisr.
Previously, the ng_socket code used a sleep/wakeup mechanism to
prevent returning immediatly from the syscall. This caused
netisr_cpu 0 to block globaly until the item was processed,
which is very inneficient.
Instead, delay the lwkt_replymsg call in the normal case until the item
has been processed. This achieves the same requirement of not returning
from syscall until the item is processed but is much more elegant.
Because ngc_send() returns sooner now, we can't allocate the apply
info from the stack. Instead, dynamically allocate it from an
objcache.
* Zeroize an item before returning it to the objcache.
Objects must be in their initialized state before being returned
to the object cache. Do that for netgraph items.
The above exposed a use after free bug. An item must remain valid
until is applied. If an item has been queued with a registered apply
callback, free it only after the callback is made.
* Add a function to check and apply the callback in case the item has
one registered.
* Pass the apply callback error via lwkt_replymsg() directly, instead of
using a field in the apply_info structure.
* Make sure that ng_socket items don't have their apply callback called
twice which was causing a panic.
* Items are now only allowed to be freed by ng_apply_item(). NG_FREE_ITEM
is kept for compatibility reasons but now it simply marks the item for
deletion and asserts it was not marked already in order to detect
double frees.
Hold a reference on the item every time it is sent or forwarded. When the
recursion is finished we are finally allowed to free the item on
ng_apply_item(). Prior to freeing the item, check it for a registered
callback.
* Let recursion unwinding free the item, even in case of error.
* Go back to using a single item allocation pool, instead of separate data
and message/function pools. If there is a performance hit, we'll have to
deal with it later. Now, ng_realloc_item() simply changes the item type,
without allocating a new one from the objcache.
Dragonfly-bug: http://bugs.dragonflybsd.org/issues/2549
Nuno Antunes [Fri, 11 Jul 2014 08:13:28 +0000 (09:13 +0100)]
netgraph7/eiface: Remove KMODDEPS from Makefile.
Nuno Antunes [Mon, 13 May 2013 16:33:29 +0000 (17:33 +0100)]
netgraph7: Bring in ng_eiface.
François Tigeot [Thu, 10 Jul 2014 07:57:25 +0000 (09:57 +0200)]
drm: Replace some custom code by wait_event routines
François Tigeot [Thu, 10 Jul 2014 06:42:16 +0000 (08:42 +0200)]
drm: Add a linux/jiffies.h implementation
* timespec_to_jiffies() inspired by the OpenBSD implementation
* Other code from existing drm files
François Tigeot [Thu, 10 Jul 2014 06:10:41 +0000 (08:10 +0200)]
drm: Add a linux/time.h implementation
Move some code already present elsewhere to the new file.
Matthew Dillon [Tue, 8 Jul 2014 18:17:48 +0000 (11:17 -0700)]
kernel - (32 bit) fix MP boot problems
* Same bug fix for bootstrapping the idle thread as in other architectures.
Sascha Wildner [Tue, 8 Jul 2014 13:34:54 +0000 (15:34 +0200)]
kernel/vga: Fix register name in a comment.
Sascha Wildner [Tue, 8 Jul 2014 12:39:52 +0000 (14:39 +0200)]
kernel/vga: Fix a CRTC register setting which I botched back in 2008.
Sascha Wildner [Tue, 8 Jul 2014 03:10:10 +0000 (05:10 +0200)]
kernel/vga: Remove VGA_NO_BIOS and VGA_ALT_SEQACCESS options.
VGA_NO_BIOS and VGA_NO_MODE_CHANGE were overlapping 90% or more in
functionality, so remove the former (which is internal anyway) and
use VGA_NO_MODE_CHANGE there too.
Also remove VGA_ALT_SEQACCESS which provided some alternate way to
access the VGA sequencer. I've not heard of anyone needing this
option ever, so assume that it is no longer needed. It can be brought
back if it turns out to be important to anyone.
In-discussion-with: ivadasz
François Tigeot [Tue, 8 Jul 2014 06:26:55 +0000 (08:26 +0200)]
drm/i915: Add some missing locks
Obtained-from: Linux 3.8.13
François Tigeot [Tue, 8 Jul 2014 06:25:22 +0000 (08:25 +0200)]
drm/i915: Add i915_gem_object_sync()
Matthew Dillon [Tue, 8 Jul 2014 02:52:44 +0000 (19:52 -0700)]
vkernel - Fix systat -vm 1
* Make the 'dirtybufspace' symbol global in the kernel so systat -vm 1
run from userland under a vkernel can find it. For some reason, vkernel
builds lose static symbols that real-kernel builds don't have a problem
with.
Reminded-by: tuxillo
Sascha Wildner [Mon, 7 Jul 2014 09:44:51 +0000 (11:44 +0200)]
kernel/usb4bsd: Add the urndis(4) driver for Remote NDIS device support.
Aka USB tethering.
Taken-from: FreeBSD
Tested-by: Yellow Rabbit <yrabbit@sdf.lonestar.org>
Sascha Wildner [Mon, 7 Jul 2014 09:08:48 +0000 (11:08 +0200)]
acpica: Clean up the config header a bit.
Nuno Antunes [Tue, 24 Jun 2014 02:43:40 +0000 (03:43 +0100)]
paths.h: Add path to ifconfig.
François Tigeot [Mon, 7 Jul 2014 06:01:58 +0000 (08:01 +0200)]
drm/i915: Reduce ring code differences with Linux
* Factorize somme common code sequences to __wait_seqno()
* Change locking in get/put irq functions
Matthew Dillon [Mon, 7 Jul 2014 05:53:19 +0000 (22:53 -0700)]
vkernel64 - Make operational again after bootstrap changes
* vkernel64's need the same cpu_idle_restore() fix that x86-64 got to
properly handle pending migrations on the BSP at bootstrap time.
(this occurs due to the way initclocks_other() works now).
* Add a warning/reminder in param.h regarding increasing MAXCPU beyond 256.
Sascha Wildner [Mon, 7 Jul 2014 05:31:29 +0000 (07:31 +0200)]
rpc: Remove empty FreeBSD ID.
Matthew Dillon [Mon, 7 Jul 2014 05:16:51 +0000 (22:16 -0700)]
build - Fix vkernel64 build
* Fix build due to missing declaration from recent commit.
Justin C. Sherrill [Sun, 6 Jul 2014 23:10:44 +0000 (19:10 -0400)]
RPC: remove some extraneous $id$ lines.
hrs [Mon, 25 Nov 2013 19:04:36 +0000 (19:04 +0000)]
RPC: replace Sun license with 3-clause BSD license.
Original commit message:
"Replace Sun RPC license in TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009."
Taken-from: FreeBSD
Cherry-picked-from: http://svnweb.freebsd.org/base?view=revision&revision=258578
Matthew Dillon [Sun, 6 Jul 2014 19:49:22 +0000 (12:49 -0700)]
boot - Fix timecount issues with some BIOSes
* Some BIOSes do not correctly read RTC which means there is no timecount
at boot time. The system boots immediately without giving the user a
chance to choose a menu option. This patch gets rid of the annoying issue.
It has no effect on systems that work properly.
Reported-by: peeter bug #2696
Taken-from: FreeBSD