dragonfly.git
9 years agokernel/acpi: Sync acpi_battery and acpi_cmbat with FreeBSD.
Sascha Wildner [Fri, 12 Sep 2014 22:42:14 +0000 (00:42 +0200)]
kernel/acpi: Sync acpi_battery and acpi_cmbat with FreeBSD.

9 years agorc.d/localdaemons: Redirect rcorder's stderr output rather than tr's.
Sascha Wildner [Fri, 12 Sep 2014 22:18:17 +0000 (00:18 +0200)]
rc.d/localdaemons: Redirect rcorder's stderr output rather than tr's.

This silences the warnings it outputs about unknown BEFOREs and
REQUIREs.

9 years agodivert: All processing should only happens in netisr0
Sepherosa Ziehau [Thu, 11 Sep 2014 13:29:26 +0000 (21:29 +0800)]
divert: All processing should only happens in netisr0

Add assertions about it and remove unnecessary token.

9 years agobmake(1): Add missing DPADD.
Sascha Wildner [Wed, 10 Sep 2014 19:35:32 +0000 (21:35 +0200)]
bmake(1): Add missing DPADD.

9 years agodfregress(8): Fix typos in DPADDs.
Sascha Wildner [Wed, 10 Sep 2014 19:34:57 +0000 (21:34 +0200)]
dfregress(8): Fix typos in DPADDs.

9 years agosplit(1): Remove wrong semicolon in the Makefile.
Sascha Wildner [Wed, 10 Sep 2014 19:27:48 +0000 (21:27 +0200)]
split(1): Remove wrong semicolon in the Makefile.

9 years agodrm/i915: Add the I915_REG_READ IOCTL
François Tigeot [Tue, 9 Sep 2014 13:45:37 +0000 (15:45 +0200)]
drm/i915: Add the I915_REG_READ IOCTL

This driver now supports the same set of ioctls as its Linux 3.8.13
version.

9 years agoicmp6.4: Fix typo.
Sascha Wildner [Wed, 10 Sep 2014 12:23:23 +0000 (14:23 +0200)]
icmp6.4: Fix typo.

9 years agonetrate/accept_connect: Switch to err(3)
Sepherosa Ziehau [Tue, 9 Sep 2014 14:40:39 +0000 (22:40 +0800)]
netrate/accept_connect: Switch to err(3)

9 years agoroute/inet: Dispatch in_rtqdrain to netisrs to run
Sepherosa Ziehau [Tue, 9 Sep 2014 13:38:42 +0000 (21:38 +0800)]
route/inet: Dispatch in_rtqdrain to netisrs to run

9 years agosyncache: Remove syncache_null_rport; use netisr_adone_rport instead
Sepherosa Ziehau [Tue, 9 Sep 2014 13:12:48 +0000 (21:12 +0800)]
syncache: Remove syncache_null_rport; use netisr_adone_rport instead

9 years agosys/dev/disk/sdhci: Adapt manpage
Markus Pfeiffer [Tue, 9 Sep 2014 22:03:09 +0000 (22:03 +0000)]
sys/dev/disk/sdhci: Adapt manpage

9 years agosys/dev/disk/sdhci: Make it possible to build as a module
Markus Pfeiffer [Tue, 9 Sep 2014 19:55:10 +0000 (19:55 +0000)]
sys/dev/disk/sdhci: Make it possible to build as a module

9 years agosys/dev/disk/sdhci: update to FreeBSD r270885
Markus Pfeiffer [Tue, 9 Sep 2014 19:08:42 +0000 (20:08 +0100)]
sys/dev/disk/sdhci: update to FreeBSD r270885

9 years agolibc/nmalloc: fix a mistake in previous commit
Joris Giovannangeli [Tue, 9 Sep 2014 13:15:20 +0000 (15:15 +0200)]
libc/nmalloc: fix a mistake in previous commit

9 years agosyncache: Prioritize timeout netmsgs
Sepherosa Ziehau [Mon, 8 Sep 2014 12:36:55 +0000 (20:36 +0800)]
syncache: Prioritize timeout netmsgs

9 years agoarp: Prioritize timeout netmsgs
Sepherosa Ziehau [Mon, 8 Sep 2014 12:30:48 +0000 (20:30 +0800)]
arp: Prioritize timeout netmsgs

9 years agoroute/inet: Prioritize timeout netmsgs
Sepherosa Ziehau [Mon, 8 Sep 2014 12:26:47 +0000 (20:26 +0800)]
route/inet: Prioritize timeout netmsgs

9 years agoigmp: Prioritize fast and slow timeout netmsgs
Sepherosa Ziehau [Mon, 8 Sep 2014 12:11:22 +0000 (20:11 +0800)]
igmp: Prioritize fast and slow timeout netmsgs

9 years agoipflow: Prioritize timeout netmsgs
Sepherosa Ziehau [Mon, 8 Sep 2014 12:07:11 +0000 (20:07 +0800)]
ipflow: Prioritize timeout netmsgs

9 years agoip: Prioritize drain and timeout netmsgs
Sepherosa Ziehau [Mon, 8 Sep 2014 12:01:54 +0000 (20:01 +0800)]
ip: Prioritize drain and timeout netmsgs

9 years agotcp: Dispatch tcp_drain to netisrs to run
Sepherosa Ziehau [Mon, 8 Sep 2014 11:46:28 +0000 (19:46 +0800)]
tcp: Dispatch tcp_drain to netisrs to run

- Avoid two extra M_WAITOK mallocs
- Simplify drain logic, since inpcb marker is no longer needed

9 years agolibc/nmalloc: add an integer overflow check to calloc
Joris Giovannangeli [Sun, 7 Sep 2014 22:24:18 +0000 (00:24 +0200)]
libc/nmalloc: add an integer overflow check to calloc

9 years agokernel/i386: In the RAM driver, don't include regions above 4GB.
Sascha Wildner [Sun, 7 Sep 2014 21:46:49 +0000 (23:46 +0200)]
kernel/i386: In the RAM driver, don't include regions above 4GB.

Taken-from: FreeBSD

9 years agokernel/i386: Add RAM driver for i386.
Sascha Wildner [Sun, 7 Sep 2014 18:11:05 +0000 (20:11 +0200)]
kernel/i386: Add RAM driver for i386.

9 years agonexus/x86_64: Add a description to the RAM driver but quiet it.
Sascha Wildner [Sun, 7 Sep 2014 18:09:45 +0000 (20:09 +0200)]
nexus/x86_64: Add a description to the RAM driver but quiet it.

Also, some more whitespace cleanup.

Patch-by: profmakx
9 years agokernel/nexus: Tabify the RAM driver.
Sascha Wildner [Sun, 7 Sep 2014 18:00:20 +0000 (20:00 +0200)]
kernel/nexus: Tabify the RAM driver.

9 years agokernel/i386: Add SMAP type constants.
Sascha Wildner [Sun, 7 Sep 2014 18:47:36 +0000 (20:47 +0200)]
kernel/i386: Add SMAP type constants.

9 years agokernel/nexus: Use __func__.
Sascha Wildner [Sun, 7 Sep 2014 17:52:58 +0000 (19:52 +0200)]
kernel/nexus: Use __func__.

9 years agokernel: Use NULL for pointers in DRIVER_MODULE().
Sascha Wildner [Sun, 7 Sep 2014 17:23:07 +0000 (19:23 +0200)]
kernel: Use NULL for pointers in DRIVER_MODULE().

9 years agokernel: Remove some lonely tabs.
Sascha Wildner [Sun, 7 Sep 2014 17:07:03 +0000 (19:07 +0200)]
kernel: Remove some lonely tabs.

9 years agodrm/i915: Add hardware context support
François Tigeot [Sun, 7 Sep 2014 15:52:40 +0000 (17:52 +0200)]
drm/i915: Add hardware context support

This feature is required by Mesa 9.2+

Inspired-by: Jean-Sébastien Pédron's FreeBSD HW context patch
9 years agodrm: Add WARN_ON_ONCE()
François Tigeot [Sun, 7 Sep 2014 15:23:42 +0000 (17:23 +0200)]
drm: Add WARN_ON_ONCE()

Obtained-from: OpenBSD

9 years agoinstaller: Fix unknown REQUIRE in rc.d/pfi which is on the install media.
Sascha Wildner [Sat, 6 Sep 2014 20:22:42 +0000 (22:22 +0200)]
installer: Fix unknown REQUIRE in rc.d/pfi which is on the install media.

Take mountcritremote (no change in rcorder position).

I thought I had done this already but seems not.

9 years agodrm/i915: Add i915_gem_object_wait_rendering__nonblocking()
François Tigeot [Sat, 6 Sep 2014 16:53:00 +0000 (18:53 +0200)]
drm/i915: Add i915_gem_object_wait_rendering__nonblocking()

9 years agodrm/i915: Reduce differences with Linux 3.8.13
François Tigeot [Sat, 6 Sep 2014 09:20:58 +0000 (11:20 +0200)]
drm/i915: Reduce differences with Linux 3.8.13

No functional changes except small bugfixes.

9 years agopf - assign hash even if no queue is specified (2)
Matthew Dillon [Thu, 4 Sep 2014 22:18:20 +0000 (15:18 -0700)]
pf - assign hash even if no queue is specified (2)

* missing file last commit

9 years agosystat - Add -altq display, bug fixes (2)
Matthew Dillon [Thu, 4 Sep 2014 22:11:35 +0000 (15:11 -0700)]
systat - Add -altq display, bug fixes (2)

* Improve formatting of the output.

* Include altq queue length statistics.

* Adjust manual page.

9 years agopf - assign hash even if no queue is specified
Matthew Dillon [Thu, 4 Sep 2014 22:09:52 +0000 (15:09 -0700)]
pf - assign hash even if no queue is specified

* If no queue is specified ALTQ will use the default-flagged queue.
  We must still generate a hash for this case, otherwise FAIRQ won't
  be able to distinguish connection state.

* Fixes fairq latency issues with PF rule sets which do not specify a
  queue in all PASS rules.

9 years agosystat - Add -altq display, bug fixes
Matthew Dillon [Thu, 4 Sep 2014 17:53:28 +0000 (10:53 -0700)]
systat - Add -altq display, bug fixes

* Add systat -altq.  This displays altq packet statistics in a nice
  [ifname x altqname] matrix.  Packets, bytes, and drops are displayed.

  Previously the only way to do this was to use 'pfctl -s queue -vvv'
  which is formatted so horribly that picking information out of it
  at a glance is impossible.

  Example usage:  systat -altq 1

* Correct a bug in -ifstat that caused the statistics to not display
  when switching out and then back into the ifstat display.

9 years agotcp: Fix tcp_drain_oncpu()
Sepherosa Ziehau [Thu, 4 Sep 2014 12:56:53 +0000 (20:56 +0800)]
tcp: Fix tcp_drain_oncpu()

Marker inpcb should always be moved.

9 years agonfsd, mountd - daemonize earlier
Matthew Dillon [Thu, 4 Sep 2014 02:31:13 +0000 (19:31 -0700)]
nfsd, mountd - daemonize earlier

* Daemonize these services earlier so name lookup stalls do
  not stall the system startup.  This is particularly important
  if the server itself is responsible for a local network, we
  don't want the server to fail to boot if the internet is not
  available.

9 years agobuild - Remove csa.4 remainders
Matthew Dillon [Thu, 4 Sep 2014 00:33:11 +0000 (17:33 -0700)]
build - Remove csa.4 remainders

* Remove csa.4 from the MAN variable.  Fixes a buildworld error.

9 years agolocaldaemons should care for scripts dependencies in $local_startup too
Francis GUDIN [Wed, 3 Sep 2014 09:13:03 +0000 (11:13 +0200)]
localdaemons should care for scripts dependencies in $local_startup too

9 years agobpf: Use uint32_t for scratch memory.
Sepherosa Ziehau [Wed, 3 Sep 2014 13:29:43 +0000 (21:29 +0800)]
bpf: Use uint32_t for scratch memory.

It is never used as signed array.

Dragonfly-issue: http://bugs.dragonflybsd.org/issues/2722
Submitted-by: guy
9 years agotools/netrate/netperf: Switch to err(3)
Sepherosa Ziehau [Wed, 3 Sep 2014 13:19:29 +0000 (21:19 +0800)]
tools/netrate/netperf: Switch to err(3)

9 years agoRemove csa.4. It is really snd_csa.4 and a csa.4 MLINK will be created.
Sascha Wildner [Wed, 3 Sep 2014 13:13:20 +0000 (15:13 +0200)]
Remove csa.4. It is really snd_csa.4 and a csa.4 MLINK will be created.

9 years agoudp: Simplify getcred
Sepherosa Ziehau [Wed, 3 Sep 2014 13:01:56 +0000 (21:01 +0800)]
udp: Simplify getcred

- No need to compare cpuid before calling lwkt_migratecpu(), which
  does necessary check itself.
- Streamline the code path a little bit.

9 years agotcp: Fix getcred
Sepherosa Ziehau [Wed, 3 Sep 2014 12:56:59 +0000 (20:56 +0800)]
tcp: Fix getcred

- Migrate to the target cpu before looking up tcp inpcb.
- Save a copy of the ucred then do SYSCTL_OUT, which could block.
  It is not MPSAFE to do the SYSCTL_OUT even on the target CPU;
  the socket might be ripped when SYSCTL_OUT blocked.

9 years agotools/netrate: Use ncpus as # of instance by default
Sepherosa Ziehau [Wed, 3 Sep 2014 12:28:18 +0000 (20:28 +0800)]
tools/netrate: Use ncpus as # of instance by default

9 years agoPF - Force 'sloppy' when establishing conflicting state
Matthew Dillon [Wed, 3 Sep 2014 04:19:15 +0000 (21:19 -0700)]
PF - Force 'sloppy' when establishing conflicting state

* Check whether a PASS IN or PASS OUT conflicts with established translation
  state in the opposite direction.  When this situation is detected, one
  of the PASS rules can establish state (and with recent SMP work, both
  PASS rules will establish state).  This causes problems because the PASS
  rules may only see one direction of the connection due to the RDR or NAT.
  If strict TCP sequence space checking occurs the PASS state can generate
  RSTs.

  To fix this we force the SLOPPY flag to be set for any PASS state being
  established in the face of a conflict against a translation rule.  This
  allows packet flow to short-cut through the state table and is preferable
  to disallowing establishment of the state because that would force a
  full rules scan (and repeated conflict/failure) for every packet.

History

* PASS IN and PASS OUT rules can interfere with a RDR rule when strict
  sequence space tests are made for established TCP state.

  In pre-SMP PF, including in FreeBSD and probably also in other BSDs,
  two active states are generally established, one for RDR and one for the
  PASS IN.  PF attempts to establish state for the PASS OUT but hits a
  conflict against the established RDR state and fails.

  However, in this situation no short-cut state is established in one
  direction and ALL packets that would have matched the failed PASS OUT
  will cause a full rules scan.

* With the SMP work, the PASS OUT conflict was no longer detected because
  the RDR state is on a different RBTREE than the PASS OUT state.  This
  allowed conflicting state for both PASS IN and PASS OUT to be established.

* Conflicting state in either direction is capable of generating spurious
  RSTs against the RDR rule.  One direction for sure, the other will generate
  RSTs but possibly be obscured by the translation rule (that is, the RST
  ends up going somewhere unexpected), so the RDR rule still works.  But
  the problem remains.

9 years agoMake uaudio(4) compilable into the kernel.
Sascha Wildner [Tue, 2 Sep 2014 20:13:08 +0000 (22:13 +0200)]
Make uaudio(4) compilable into the kernel.

9 years agoCreate snd_blah.4 -> blah.4 MLINKS.
Sascha Wildner [Tue, 2 Sep 2014 20:12:30 +0000 (22:12 +0200)]
Create snd_blah.4 -> blah.4 MLINKS.

Suggested-by: profmakx
9 years agosnd_uaudio.4: Sync with FreeBSD for a few changes.
Sascha Wildner [Tue, 2 Sep 2014 20:07:11 +0000 (22:07 +0200)]
snd_uaudio.4: Sync with FreeBSD for a few changes.

9 years agoUpdate devd(8)'s usb.conf for uaudio(4).
Sascha Wildner [Tue, 2 Sep 2014 19:59:33 +0000 (21:59 +0200)]
Update devd(8)'s usb.conf for uaudio(4).

9 years agousb4bsd: make uaudio work
Markus Pfeiffer [Tue, 2 Sep 2014 18:38:05 +0000 (18:38 +0000)]
usb4bsd: make uaudio work

Submitted-By: Vasily Postnicov <shamaz.mazum@gmail.com>
9 years agoFix buildkernel without INVARIANTS.
Sascha Wildner [Tue, 2 Sep 2014 11:05:31 +0000 (13:05 +0200)]
Fix buildkernel without INVARIANTS.

Reported-by: Andrey Oktyabrskiy <ano@bestmx.net>
9 years agoudp: For connected socket, don't rehash sending datagram
Sepherosa Ziehau [Mon, 1 Sep 2014 12:50:24 +0000 (20:50 +0800)]
udp: For connected socket, don't rehash sending datagram

Since it has already been in the correct netisr.

9 years agopf - clear M_HASH in a few more places, cleanups, structure size change!
Matthew Dillon [Mon, 1 Sep 2014 20:30:46 +0000 (13:30 -0700)]
pf - clear M_HASH in a few more places, cleanups, structure size change!

* Clear the M_HASH flag in a few more places where headers get rewritten.

* bzero the key before populating it.  Shouldn't be necessary but add as a
  safety for possible future use cases.

* Add more fields to struct pfsync_state.  This requires pfvar.h to be
  reinstalled, the pf module and the pfctl program to be rebuilt.
  (suggest buildworld + buildkernel).

  pickup_mode and cpuid added.  Also added reserved fields so future
  additions can be made without changing the structure size again.

* Other minor cleanups.

* WARNING ON RDR, PASS IN / PASS OUT combinations.  RDR rules create state
  on the input path.  Further packets on the input path match the RDR
  state on input, but the *return* packet path will match the RDR state on
  output.

  This means that if you have a PASS OUT rule that matches the RDR input path
  on the output side of the translation, it will also create state, and if
  you have a PASS IN rule that matches the RDR return packet path, it will
  also create state on the input path for that packet.

  PF users must be sure that if such rules exist, they are either specified
  to not create keep state, use the default keep state (which allows pickups
  and sloppy tcp tests), or explicitly specify keep state with sloppy tcp
  tests.  This is because these PASS rules will only see one side of the
  TCP connection because the RDR state will suck up the other side.

9 years agokernel/vtnet: Replace recursion with a loop to avoid a stack overflow.
Imre Vadasz [Mon, 1 Sep 2014 12:54:13 +0000 (14:54 +0200)]
kernel/vtnet: Replace recursion with a loop to avoid a stack overflow.

9 years agowpa_supplicant(8): Fix struct ieee80211req_scan_result parsing in driver_bsd.c
Imre Vadasz [Sun, 31 Aug 2014 18:16:49 +0000 (20:16 +0200)]
wpa_supplicant(8): Fix struct ieee80211req_scan_result parsing in driver_bsd.c

* Since commit 32176cfd8803dac7f65c423373f231a378375c86 there is an
  additional isr_meshid_len field in struct ieee80211req_scan_result.
  We have to add this additional offset, when calculating the address
  of the IE data buffer.

9 years agodrm: Stop building the mach64 driver
François Tigeot [Mon, 1 Sep 2014 13:51:31 +0000 (15:51 +0200)]
drm: Stop building the mach64 driver

It doesn't compile anymore with some drm changes from Linux 3.8.

9 years agobuild - Update Makefile.usr to use new pkg-static
Matthew Dillon [Sun, 31 Aug 2014 16:33:56 +0000 (09:33 -0700)]
build - Update Makefile.usr to use new pkg-static

* Update to _02.  The old pkg-static doesn't understand more recent repos.

* Remove the ABIVERS prefix when ABIVERS is not manually specified,
  uname -P doesn't generate the correct results for 3.9 -> 3.10 (it
  says 4.0).

* We still allow ABIVERS to be specified in the make.

9 years agodrm/i915: Reduce differences with Linux 3.8.13
François Tigeot [Sun, 31 Aug 2014 09:44:26 +0000 (11:44 +0200)]
drm/i915: Reduce differences with Linux 3.8.13

No functional changes.

9 years agodrm: struct drm_driver.max_ioctl doesn't exist
François Tigeot [Sun, 31 Aug 2014 09:41:23 +0000 (11:41 +0200)]
drm: struct drm_driver.max_ioctl doesn't exist

Use num_ioctls like in Linux.

9 years agoudp: Make udp pcbinfo and portinfo per-cpu; greatly improve performance
Sepherosa Ziehau [Thu, 3 Jul 2014 13:15:27 +0000 (21:15 +0800)]
udp: Make udp pcbinfo and portinfo per-cpu; greatly improve performance

MAJOR CHANGES:

- Add token to protect pcbinfo's inpcb list and wildcard hash table.
  Currently only udp per-cpu pcbinfo sets this token.  udp serializer
  and netisr barrier are nuked.

  o  udp inpcb list:

     Under most cases, udp inpcb list is operated in its owner netisr.
     However, it is also accessed and modified (no effiective udp inpcb
     will be unlinked though) in netisr0 to adjust multicast options if
     one interface is to be detached.  So protecting udp inpcb list
     accessing and modification w/ token is necessary.

     At udp inpcb detach time, the udp inpcb is first removed from the
     udp inpcb list, then a message will go through all netisrs, which
     makes sure that no netisrs are using or can find this udp inpcb
     from the udp inpcb list.  After all these, this udp inpcb is
     destroyed in its owner netisr.

     In netisrs, it is MP safe to find a udp inpcb from udp inpcb list,
     then release the token and process the found udp inpcb.

     In other threads, it is MP safe to find a udp inpcb from udp inpcb
     list, then release the token and process the found udp inpcb in
     non-blocking fashion.

     See also the usage of inpcb marker.

  o  udp wildcard hash table:

     On input path, udp wildcard hash table is searched in its owner
     netisr.  In order to ease implicit binding (bind during send),
     connect after binding, and disconnect, udp inpcb are inserted
     into and removed from other udp pcbinfos' wildcard hash table in
     its owner netisr.  Thus the udp wildcard hash table must be
     protected w/ token.

     At udp inpcb detach time, a message will go through all netisrs,
     and this udp inpcb will be removed from the udp wildcard hash
     table belonging to the current netisr.  This makes sure that once
     the current netisr runs the message handler, this udp inpcb will
     not be used and be found in the current netisr.  When the message
     reaches the last netisr, this udp inpcb is redispatched to its
     owner netisr to be destroyed.

     In netisrs, it is MP safe to find a udp inpcb from udp wildcard
     hash table, then release the token and process the found udp inpcb,
     e.g. use udp inpcb found by in_pcblookuphash().

     In other threads, it is MP safe to find a udp inpcb from udp
     wildcard hash table, then release the token and process the found
     udp inpcb in non-blocking fashion.

     See also the usage of inpcb container marker.

  o  udp connect hash table:

     It is lockless MP safe, and only accessed and modified in its owner
     netisr.

- During inpcb iteration through inpcb list, use inpcb marker when
  calling functions, which may block, e.g. in_pcbpurgeif0(), so the
  inpcb iteration will not stop prematurely, if the inpcb being
  processed is removed from the inpcb list.

- Use udp inpcb wildcard table and udp inpcb connect hash table to
  dispatch input multicast and broadcast udp datagrams.  Using udp inpcb
  list could be time consume, since we need to check udp inpcb lists on
  all cpus; and secondly, once udp inpcb has a local port, it will be in
  either udp wildcard hash table or udp connect hash table.

  Since the socket buffer operation on input path may block, inpcb
  container marker is used when iterating inpcbs from udp inpcb wildcard
  hash table.  in_pcblookup_pkthash() is adjusted to skip inpcb
  container marker.

- udp socket so_port is no longer fixed to netisr0 msgport
  o  Initial udp socket so_port is the current cpu's netisr msgport.
  o  Bound but unconnected udp socket so_port is selected according to
     local port hash.
  o  Connected udp socket so_port is selected according to the udp hash,
     i.e. laddr/faddr toeplitz hash (exception: multicast laddr or
     multicast faddr, is hashed to netisr0).
  o  Multicast socket options are forced to be handled in netisr0, since
     udp socket so_port may not be netisr0 msgport.

- In order to support asynchronized udp inpcb detach:
  o  EJUSTRETURN from pru_detach method now means protocol will call
     sodiscard() and sofree() for soclose().  udp pru_detach method
     returns EJUSTRETURN as of this commit.
  o  SS_ISCLOSING socket state is set before calling pru_detach method,
     so protocol could avoid certain expensive, unnecessary or
     disallowed operation in pru_disconnect or pru_detach method, e.g.
     udp pru_disconnect method avoids putting udp inpcb back to udp
     wildcard hash table, if SS_ISCLOSING is set.

MISC CHANGES:

- pcbinfo's cpu id must be set now; -1 is disallowed.
- udp pru_abort method should never be called; it panicks now.
- Restore traditional BSD behaviour, if unbound udp socket connect
  fails: if local port of the udp socket has been selected, its inpcb
  should be in wildcard hash table, i.e. the udp inpcb should be visible
  on udp datagrams input path.
- Make sure multicast stuffs are adjusted only in netisr0 for inet6, if
  one interface is about to be detached.

PERFORMANCE IMPROVEMENT:

For 'kq_connect_client -u' test, this commit gives 400% performance
improvement (31Kconns/s -> 160Kconns/s).

9 years agorc.d/moused: Remove wrong stop_cmd.
Sascha Wildner [Sat, 30 Aug 2014 21:08:32 +0000 (23:08 +0200)]
rc.d/moused: Remove wrong stop_cmd.

This was keeping moused(8) from exiting properly when the USB mouse
was unplugged.

9 years agodrm/i915: Add the I915_GEM_WAIT ioctl
François Tigeot [Sat, 30 Aug 2014 15:41:58 +0000 (17:41 +0200)]
drm/i915: Add the I915_GEM_WAIT ioctl

It can be used to implement the GL_ARB_sync OpenGL extension.

9 years agolinux/time.h: Add a few Linux timespec functions
François Tigeot [Sat, 30 Aug 2014 15:28:27 +0000 (17:28 +0200)]
linux/time.h: Add a few Linux timespec functions

Obtained-from: OpenBSD

9 years agoSync ACPICA with Intel's version 20140828.
Sascha Wildner [Sat, 30 Aug 2014 09:50:38 +0000 (11:50 +0200)]
Sync ACPICA with Intel's version 20140828.

* Add support for runtime validation of the _DSD package.

* Add the GICC affinity subtable to the SRAT table.

* Add error detection for illegally named references within control
    methods that would cause runtime failures.

* Add error checking for dependencies related to the _PSx power
    methods.

* Various improvements, bug fixes and cleanups.

For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.

9 years agokernel/devfs: Allow devices to devctl_notify() also during cold boot.
Sascha Wildner [Fri, 29 Aug 2014 08:07:36 +0000 (10:07 +0200)]
kernel/devfs: Allow devices to devctl_notify() also during cold boot.

This fixes the issue that no moused(8) was started if a USB mouse was
plugged in already during booting.

While here, also rename the notify function.

In-collaboration-with: mneumann

9 years agorc.conf: Provide a default for rc_startmsgs and document it.
Sascha Wildner [Fri, 29 Aug 2014 08:03:01 +0000 (10:03 +0200)]
rc.conf: Provide a default for rc_startmsgs and document it.

9 years agonrelease: Do not provide default make.conf files.
Sascha Wildner [Fri, 29 Aug 2014 07:16:50 +0000 (09:16 +0200)]
nrelease: Do not provide default make.conf files.

The git package delivered on the installation media is special in the
sense that it is built with certain options not set to prevent it from
pulling in python and perl as dependencies (to keep the ISOs small,
mainly).

Once the system is installed, storage size is no longer really an issue,
so there is no need to have those options in the make.conf we install.

After this commit, a manually built git package should match the binary
package which we provide.

9 years agoudev - use objcache for struct udev_event_kernel
Michael Neumann [Tue, 26 Aug 2014 23:24:47 +0000 (01:24 +0200)]
udev - use objcache for struct udev_event_kernel

9 years agodrm/i915: Implement GEM GET and SET_CACHING ioctls
François Tigeot [Tue, 26 Aug 2014 16:21:17 +0000 (18:21 +0200)]
drm/i915: Implement GEM GET and SET_CACHING ioctls

They can be used by userspace drivers to accelerate uploads and downloads
from the GPU and also mix CPU and GPU rendering/activity efficiently.

Obtained-from: Linux 3.8.13

9 years agorc.conf.5: Document moused_nondefault_enable (taken from FreeBSD).
Sascha Wildner [Tue, 26 Aug 2014 13:43:05 +0000 (15:43 +0200)]
rc.conf.5: Document moused_nondefault_enable (taken from FreeBSD).

9 years agomoused - Ease usb mouse attach/detach
Michael Neumann [Mon, 25 Aug 2014 16:59:02 +0000 (18:59 +0200)]
moused - Ease usb mouse attach/detach

WARNING: Upgrading will overwrite your /etc/devd.conf.

Extend /etc/rc.d/moused. To attach e.g. ums0, you can now call:

    /etc/rc.d/moused start ums0

To detach:

    /etc/rc.d/moused stop ums0

If moused is called with an explicit device name, it is enabled by default
(moused_nondefault_enable="YES").

You can explicitly override any settings in rc.conf with directives like:

    moused_ums0_enable="YES"
    moused_ums0_type="..."

If you have one or more ums[0-9]+ mouses, you can now make use of them by
simply setting devd_enable="YES" in rc.conf.

9 years agobuild - separate out the rescue initrd
Matthew Dillon [Mon, 25 Aug 2014 16:51:29 +0000 (09:51 -0700)]
build - separate out the rescue initrd

* Multiple issues with users crashing at the end of an installworld because
  initrd kldloads an out-of-date vn device.

* Not a good idea to update the rescue image during an installworld anyway.

* Make it a manual target called 'rescue' and remind the user at the end
  of the installworld that the target is available, but suggest
  rebooting first.

9 years agokernel config - Build 'vn' into the kernel
Matthew Dillon [Mon, 25 Aug 2014 16:40:39 +0000 (09:40 -0700)]
kernel config - Build 'vn' into the kernel

* Build vn into the kernel, we are using it in the build system and
  its not a good idea to kldload it during a buildworld or installworld.

9 years agotest: Add bunch of tests for udp protocol
Sepherosa Ziehau [Mon, 25 Aug 2014 12:55:53 +0000 (20:55 +0800)]
test: Add bunch of tests for udp protocol

They test various combination of bind(2), connect(2) and sendto(2)
for both unicast and multicast.  Unicast tests work w/ udpecho in
tools/netrate.  Multicast tests work w/ mcastsend.

9 years agokernel/spinlock: Add a description to struct spinlock.
Sascha Wildner [Sun, 24 Aug 2014 21:54:16 +0000 (23:54 +0200)]
kernel/spinlock: Add a description to struct spinlock.

And add it to spin_init() and SPINLOCK_INITIALIZER().

Submitted-by: dclink (see <http://bugs.dragonflybsd.org/issues/2714>)
OK'd-by:      dillon

9 years agounifdef.1: Use Mt.
Sascha Wildner [Sun, 24 Aug 2014 21:51:43 +0000 (23:51 +0200)]
unifdef.1: Use Mt.

9 years agoiwn - Sync with FreeBSD up to ffb6d5c3967d1342fa5e2d6f51c8ea8aff1419e2
Michael Neumann [Sat, 23 Aug 2014 23:23:40 +0000 (01:23 +0200)]
iwn - Sync with FreeBSD up to ffb6d5c3967d1342fa5e2d6f51c8ea8aff1419e2

9 years agoucom - Hack unref to fix infinite 1-second wait loop.
Matthew Dillon [Sat, 23 Aug 2014 17:57:13 +0000 (10:57 -0700)]
ucom - Hack unref to fix infinite 1-second wait loop.

* ucom depended on the .tsw_* switch to decomission ports, which we do
  not use currently.  This was preventing the ucom from being properly
  dereferenced and resulted in an infinite 1-second wait loop on close.

* Move the unref elsewhere to hopefully solve the problem.

9 years agokernel - Fix sendfile() bugs / nginx
Matthew Dillon [Sat, 23 Aug 2014 17:53:25 +0000 (10:53 -0700)]
kernel - Fix sendfile() bugs / nginx

* Fix a sendfile() bug tickled by nginx.  When sending partial file bodies the
  nbytes test was improperly included the header bytes in its file body limit
  test.  This caused sendfile() to return 0 (complete success) but not
  actually output the entirety of the requested file segment.

* sendfile() now holds VM pages instead of wiring them.  Wiring the pages
  prevents truncation operations from succeeded and can further cause a
  kernel panic if the underlying file is deleted and the descriptor is
  closed while mbufs related to the sendfile() are still pending on the
  socket.

Massive-debugging-by: joris
9 years ago[iwn] Fix required calibration flags for the Centrino 1000 NIC.
Michael Neumann [Sat, 23 Aug 2014 11:03:58 +0000 (13:03 +0200)]
[iwn] Fix required calibration flags for the Centrino 1000 NIC.

Tested with Intel Centrino Wireless-N 1000.

Obtained-From: FreeBSD (commit dd4e54a1ddf657f080a88c674e12459f404dea61)
Fixes: http://bugs.dragonflybsd.org/issues/2720

9 years agokernel/pci: Use spin_*() functions directly.
Sascha Wildner [Sat, 23 Aug 2014 10:37:59 +0000 (12:37 +0200)]
kernel/pci: Use spin_*() functions directly.

9 years agou4b - Fix panic on certain cell phone connections
Matthew Dillon [Fri, 22 Aug 2014 21:59:46 +0000 (14:59 -0700)]
u4b - Fix panic on certain cell phone connections

* Remove incorrect unlock in ucom_close().

* Add missing usb_callout_stop() to umass_cam_detach_sim(), fixes issue with umass
  if the mass-storage device quickly connects and disconnects from the bus.

Reported-by: Rolinh
9 years agosendmail - pre-fork in daemon mode to avoid stall (2)
Matthew Dillon [Fri, 22 Aug 2014 18:41:54 +0000 (11:41 -0700)]
sendmail - pre-fork in daemon mode to avoid stall (2)

* disconnect() and set CurrentPid on pre-fork.  This fixes an issue where
  the boot console is revoked and enters getty before the backgrounded
  sendmail disconnects from the foreground process and tty, causing sendmail
  to complain in /var/log/maillog.

  This issue can occur due to myhostname() stalls when the internet is not
  available (e.g. /etc/resolv.conf is present but wifi-only system has not
  yet associated), or has other connectivity issues during boot.

Reported-by: Rolinh
9 years agokernel/kern_dup(): Fix comment.
Sascha Wildner [Thu, 21 Aug 2014 20:16:40 +0000 (22:16 +0200)]
kernel/kern_dup(): Fix comment.

9 years agokernel: Fix error for dup2 if the new file descriptor is out of bounds.
Sascha Wildner [Thu, 21 Aug 2014 20:12:01 +0000 (22:12 +0200)]
kernel: Fix error for dup2 if the new file descriptor is out of bounds.

According to POSIX, when using fcntl()'s F_DUPFD or F_DUPFD_CLOEXEC
commands and the new file descriptor is out of bounds, EINVAL must be
returned. But if it is out of bounds when using dup2(), EBADF must be
returned.

So add detection of whether kern_dup() was called from kern_fcntl() or
from sys_dup2() and act accordingly.

9 years agoMove from dns/bind98 on install img/iso to dns/bind-tools.
Justin C. Sherrill [Thu, 21 Aug 2014 06:02:05 +0000 (02:02 -0400)]
Move from dns/bind98 on install img/iso to dns/bind-tools.

BIND 9.8 is reaching EOL in a month.  We don't need a full version of
BIND on the default install, since bind-tools provides dig/nslookup/host
and so on.

9 years agosys/subr_rman: fix some issues
Markus Pfeiffer [Tue, 19 Aug 2014 21:28:53 +0000 (21:28 +0000)]
sys/subr_rman: fix some issues

Some bounds checks were off which lead to bad interactions with the
ram reservation code in nexus.

9 years agosys/platform/pc64: port the ram device from FreeBSD's nexus.c
Markus Pfeiffer [Sun, 17 Aug 2014 15:48:16 +0000 (16:48 +0100)]
sys/platform/pc64: port the ram device from FreeBSD's nexus.c

Our kernel didn't reserve RAM in the IO manager, which lead to
mmaped IO from devices being mapped in the same address space,
most notably this lead to problems with the i915 driver, bug

9 years agokernel/ath: Add missing #ifdef ATH_DEBUG (fixes kernel build).
Sascha Wildner [Wed, 20 Aug 2014 18:49:11 +0000 (20:49 +0200)]
kernel/ath: Add missing #ifdef ATH_DEBUG (fixes kernel build).

Reported-by: Robin Hahling <robin.hahling@gw-computing.net>
9 years agocsh(1): Use iconv().
Sascha Wildner [Wed, 20 Aug 2014 18:45:30 +0000 (20:45 +0200)]
csh(1): Use iconv().

Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2704>
Reported-by: s4
9 years agoath - move kprintf() under debug variable
Matthew Dillon [Wed, 20 Aug 2014 17:42:24 +0000 (10:42 -0700)]
ath - move kprintf() under debug variable

* Move an unconditional debugging kprintf() under a debug variable.

9 years agodhclient - Do not force-up wlan interfaces
Matthew Dillon [Wed, 20 Aug 2014 17:34:14 +0000 (10:34 -0700)]
dhclient - Do not force-up wlan interfaces

* Do not force a wlan interface up, this may interfere with wpa_supplicant
  operation.

* Increase the default timeout for waiting for the interface to become
  active from 10 seconds to 30 seconds.  wlan interfaces can take
  considerably longer than 10 seconds to associate and dhclient operation
  now detaches without waiting so the longer timeout will not interfere
  with the boot sequence.

9 years agoboot - don't wait for wpa_supplicant to associate
Matthew Dillon [Wed, 20 Aug 2014 17:04:09 +0000 (10:04 -0700)]
boot - don't wait for wpa_supplicant to associate

* Do not wait for wpa_supplicant to associate as doing so will prevent
  the machine from finishing the boot sequence if there are no base stations
  in range.

  We can do this now because the new dhclient will not blow up.

9 years agodhclient - Adjust documentation
Matthew Dillon [Wed, 20 Aug 2014 16:56:03 +0000 (09:56 -0700)]
dhclient - Adjust documentation

* Document how the pidfile works.

* Document that executing a dhclient on an interface which already has a
  running dhclient will kill the old dhclient and replace it with a new
  instance.