118041 Commits

Author SHA1 Message Date
marius
9eaee5a55c MFC: 1.16
In ofw_parsedev() check the return value of malloc() and protect
against a NULL pointer dereference when ofw_parsedev() is called
with a NULL path argument.
2005-11-30 13:24:53 +00:00
marius
4245a23502 MFC: 1.11
Use an ihandle_t to store the instance handle of an opened device
instead of a phandle_t (package handle). Since both are typedefed
to unsigned int, this is more or less cosmetic.
2005-11-30 13:19:03 +00:00
marius
048eb2b1f9 MFC: elf_freebsd.c 1.10, ofw_console.c 1.11, ofw_memory.c 1.7, openfirm.c 1.12
Remove unused variables.
2005-11-30 13:13:53 +00:00
tmclaugh
f8d191da17 MFC: Revision 1.60
Misspelling in Poul-Henning Kamp's email address under AUTHORS

Approved by:	ade
2005-11-30 04:19:40 +00:00
yongari
7743af4bbc MFC if_hme.c:1.44, if_hmereg.h:1.7, if_hmevar.h:1.9 to RELENG_6:
- Convert hme(4) to use TX side bus_dmamap_load_mbuf_sg(9).
  - Move hardware counter reading/zeroing to hme_tick(). This saves
     8 register access per interrupt. [1]
  - Use imax macro for getting max. argument between two integers.
  - Invoke bus_dmamap_sync(9) first before freeing mbuf.
  - Check driver queue first to reduce locking operation in hme_start_locked()
    and interrupt handler.
  - Simplyfy watchdog timer setup in interrupt handler.
  - Don't log normal errors such as RX overrun. If we have DMA stuck
    condition, reinitialize the driver and log it.
2005-11-30 02:23:53 +00:00
marcel
40404ba331 MFC rev 1.40: Improve inittodr(). 2005-11-29 00:18:56 +00:00
jhb
0629d9c388 MFC: Always print the trap number for fatal traps and add trap messages
for T_XMMFLT and T_RESERVED.
2005-11-28 20:03:15 +00:00
jhb
6e7132f326 MFC: Correctly ask the PCI bridge device for its child PCI bus number
when trying to determine the BIOS IRQ for a given link.
2005-11-28 19:45:30 +00:00
jhb
b37ccdba12 MFC: Let ether_ioctl() handle SIOCSIFMTU. 2005-11-28 19:43:57 +00:00
jhb
eee0b465b9 MFC: More fully setup the ATPICs including setting up spurious interrupt
handlers if 'device atpic' is not in the kernel.
2005-11-28 19:42:10 +00:00
jhb
4d00ca61c0 MFC: Include the size of the DL_serpath structures in the total size used
in the RTLD_DI_SERINFOSIZE and RTLD_DI_SERINFO requests.
2005-11-28 19:19:39 +00:00
ru
51e319ef1f MFC: Added NO_INCS, use it to prevent overwriting of native
headers with i386 copies when installing lib32.
2005-11-28 19:08:51 +00:00
rwatson
fe78d82c95 Merge mbuf.c:1.46 from HEAD to RELENG_6: trim accidentally committed
debugging printfs from netstat -m.
2005-11-28 18:07:36 +00:00
simokawa
ff0e40f217 MFC: revision 1.81
Fix panic when we cannot find self-id of probing nodes.
2005-11-28 06:41:40 +00:00
hrs
29d1e5bb9f MFC: Apply arch= selection to the qandatoc mode. This fixes
link generation with no actual target.

Reported by:	Tim Witthoeft (tim.witthoeft at gmail.com)
2005-11-28 06:26:56 +00:00
rwatson
c078111780 Merge kern_acct.c:1.76 from HEAD to RELENG_6:
Significant refactoring of the accounting code to improve locking and VFS
  happiness, as well as correct other bugs:

  - Replace notion of current and saved accounting credential/vnode with a
    single credential/vnode and an acct_suspended flag.  This simplifies the
    accounting logic substantially.

  - Replace acct_mtx with acct_sx, a sleepable lock held exclusively during
    reconfiguration and space polling, but shared during log entry
    generation.  This avoids holding a mutex over sleepable VFS operations.

  - Hold the sx lock over the duration of the I/O so that the vnode I/O
    cannot occur after vnode close, which could occur previously if
    accounting was disabled as a process exited.

  - Write the accounting log entry with Giant conditionally acquired based
    on the file system where the log is stored.  Previously, the accounting
    code relied on the caller acquiring Giant.

  - Acquire Giant conditionally in the accounting callout based on the file
    system where the accounting log is stored.  Run the callout MPSAFE.

  - Expose acct_suspended via a read-only sysctl so it is possibly to
    programmatically determine whether accounting is suspended or not without
    attempting to parse logs.

  - Check both acct_vp and acct_suspended lock-free before entering the
    accounting sx lock in acct().

  - When accounting is disabled due to a VBAD vnode (i.e., forceable unmount),
    generate a log message indicating accounting has been disabled.

  - Correct a long-standing bug in how free space is calculated and compared
    to the required space: generate and compare signed results, not unsigned
    results, or negative free space will cause accounting to not be suspended
    when required, or worse, incorrectly resumed once negative free space is
    reached.
2005-11-27 19:09:10 +00:00
hrs
45a58b3568 Bump release documentation version and trim the old relnotes entries. 2005-11-27 17:11:21 +00:00
glebius
7dfb4a556f MFC 1.61:
Check IFF_DRV_RUNNING in the re_intr() loop. It can disappear,
  since re_rxeof() drops the lock for some time.

  Reported & tested by:   XueFeng Deng <dsnofe yahoo.com.cn>
2005-11-27 02:56:42 +00:00
dougb
31c54105ae MFC 1.7, which fixes the failed transfer semantics for BIND 9.3.x,
and cleans up the code slightly.
2005-11-27 00:38:57 +00:00
jdp
9bb59aa42a MFC: Fix a bug that caused some /dev entries to continue to exist after
the underlying drive had been hot-unplugged from the system.

This merges the following revisions:

  Revision  Path
  1.94      src/sys/cam/scsi/scsi_cd.c
  1.181     src/sys/cam/scsi/scsi_da.c
  1.98      src/sys/geom/geom_disk.c
  1.5       src/sys/geom/geom_disk.h
  1.88      src/sys/geom/geom_subr.c
2005-11-26 22:55:20 +00:00
hrs
5c35e8f078 New errata item:
problems of ipfw IPv6 support on 6.0R.
2005-11-26 21:57:27 +00:00
delphij
6d8a6febc5 MFC 1.83: Slightly reorganize to reduce duplicated code.
Reviewed by:	rwatson
2005-11-26 21:20:05 +00:00
delphij
79c28795ba MFC 1.65:
Remove an unneeded "a" from comment.
2005-11-26 21:19:20 +00:00
krion
7ba5cae87f MFC: pkg_info.1:1.55
date: 2005/11/23 10:31:59;  author: krion;  state: Exp;  lines: +4 -1
  Document PKG_PATH enviroment variable.

  Prodded by:     Mark Andrews <Mark_Andrews AT isc DOT org>
2005-11-26 20:58:43 +00:00
jdp
eeb84da771 MFC 1.151: Fix a bug in the loop in sonewconn that makes room on the
incomplete connection queue for a new connection.  It was removing
connections from the wrong list.
2005-11-26 19:32:30 +00:00
marcel
6342c72acc MFC rev 1.203: Fix bug introduced in revision 1.186:
Iterate over the mounted file systems to find the largest time
  stamp and call inittodr() exactly once with that time stamp.
2005-11-26 19:13:41 +00:00
le
703d4d250a MFC:
Finally bring in what was produced during Google SoC 2005:

   Add functions to rename objects and to move a subdisk from one drive
   to another.

   Add manual page (finally).

   Bring up-to-date the online help.

Plus several cleanups and whitespace fixes.
2005-11-26 11:10:37 +00:00
le
6a3b6cb6cd MFC:
Finally bring in what was produced during Google SoC 2005:

  Add functions to rename objects and to move a subdisk from one drive
  to another.

Plus several whitespace/style fixes.
2005-11-26 11:06:11 +00:00
glebius
d0507213b8 Previous commit merged 1.145 and _a part of_ 1.142, and this part
broke ARP in RELENG_6. At this time merge 1.142 entirely.

Pointy hat to:	glebius
2005-11-26 10:51:23 +00:00
njl
35f08adab8 MFC 1.43: Acquire locks around call to acpi_cmbat_get_bif() 2005-11-26 07:37:40 +00:00
glebius
8c795db6e0 MFC 1.34 by yar:
Since carp(4) interfaces presently are kinda fake yet possess
  IP addresses, mark them with LOOPBACK so that routing daemons
  take them easy for link-state routing protocols.

  Reviewed by:    glebius
2005-11-25 14:57:38 +00:00
glebius
219fd02410 MFC 1.24:
Document tunables.
2005-11-25 14:56:03 +00:00
glebius
629ac5c1d2 MFC 1.38: MFOpenBSD 1.62:
Prevent backup CARP hosts from replying to arp requests, fixes strangeness
    with some layer-3 switches. From Bill Marquette.

  Tested by:      Kazuaki Oda <kaakun highway.ne.jp>
2005-11-25 14:54:59 +00:00
glebius
e841eebf3e MFC 1.12:
Xref ng_ether(4) and ng_iface(4) nodes, which are used in examples.
2005-11-25 14:49:04 +00:00
glebius
25e888dc3a MFC 1.23, 1.24:
BCM5752 support
2005-11-25 14:46:42 +00:00
glebius
faad1c3c25 MFC:
Recognize Broadcom BCM5752 chip, that can be found in HP DC7600.

  PR:		kern/88940
  Submitted by:	Alexander Hausner
2005-11-25 14:43:12 +00:00
glebius
b7866a6d78 MFC 1.51:
Force this interface to be RUNNING.
2005-11-25 14:41:31 +00:00
glebius
d4826e3f0a MFC 1.18 - 1.21:
- Document last change to ARP behavior.
  - Document several undocumented sysctl variables.
  - Fix spelling of few diagnostics.
  - Improve the documentation of "proxyall" knob, somewhat: we do not
    proxy for hosts that are reachable through the same interface the
    request came in from.  This feature is mainly for hosts reachable
    through some P2P link, e.g. the gif(4) tunnel.
2005-11-25 14:40:38 +00:00
glebius
630273a7cf MFC 1.145:
Rework ARP retransmission algorythm so that ARP requests are
  retransmitted without suppression, while there is demand for
  such ARP entry. As before, retransmission is rate limited to
  one packet per second. Details:
    - Remove net.link.ether.inet.host_down_time
    - Do not set/clear RTF_REJECT flag on route, to
      avoid rt_check() returning error. We will generate error
      ourselves.
    - Return EWOULDBLOCK on first arp_maxtries failed
      requests , and return EHOSTDOWN/EHOSTUNREACH
      on further requests.
    - Retransmit ARP request always, independently from return
      code. Ratelimit to 1 pps.

MFC 1.142:
  Use monotonic 'time_uptime' instead of 'time_second' as timebase
  for rt->rt_rmx.rmx_expire.
2005-11-25 14:38:19 +00:00
glebius
5baa2f368f MFC 1.89:
- Do not raise IFF_DRV_OACTIVE flag in vlan_start, because this
    can lead to stalled interface
  - Explain this fact in a comment.

  Reviewed by:    rwatson, thompsa, yar
2005-11-25 14:34:05 +00:00
glebius
3da94ed211 MFC 1.157:
Keep locks consistent before goto.

  Reported by:    pho
  Reviewed by:    mohans
2005-11-25 14:32:38 +00:00
glebius
d60eb7f43e MFC 1.70:
Fix several races between socket closure and node/hook
  destruction:
    - Backout 1.62, since it doesn't fix all possible
    problems.
    - Upon node creation, put an additional reference on node.
    - Add a mutex and refcounter to struct ngsock. Netgraph node,
      control socket and data socket all count as references.
    - Introduce ng_socket_free_priv() which removes one reference
      from ngsock, and frees it when all references has gone.
    - No direct pointers between pcbs and node, all pointing
      is done via struct ngsock and protected with mutex.
2005-11-25 14:26:40 +00:00
glebius
f85409be55 Sync with HEAD, merging the following:
revision 1.117
date: 2005/11/02 15:23:47;  author: glebius;  state: Exp;  lines: +47 -8
Fix two races which happen when netgraph is restructuring:
  - Introduce ng_topo_mtx, a mutex to protect topology changes.
  - In ng_destroy_node() protect with ng_topo_mtx the process
    of checking and pointing at ng_deadnode. [1]
  - In ng_con_part2() check that our peer is not a ng_deadnode,
    and protect the check with ng_topo_mtx.
  - Add KASSERTs to ng_acquire_read/write, to make more
    understandible synopsis in case if called on ng_deadnode.

Reported by:    Roselyn Lee [1]
----------------------------
revision 1.116
date: 2005/11/02 14:27:24;  author: glebius;  state: Exp;  lines: +106 -121
Rework the ng_item queueing on nodes:
  - Introduce a new flags NGQF_QREADER and NGQF_QWRITER,
    which tell how the item should be actually applied,
    overriding NGQF_READER/NGQF_WRITER flags.
  - Do not differ between pending reader or writer. Use only
    one flag that is raised, when there are pending items.
  - Schedule netgraph ISR in ng_queue_rw(), so that callers
    do not need to do this job.
  - Fix several comments.

Submitted by:   julian

As well as some lesser changes: ng_base.c 1.114, 1.113, 1.107, 1.118.
2005-11-25 14:23:27 +00:00
glebius
9bd69a95f0 Sync em(4) driver with HEAD, merging the following changes:
revision 1.83
date: 2005/11/09 08:43:18;  author: yongari;  state: Exp;  lines: +41 -38
Make em(4) work on big-endian architectures.
 - disable jumbo frame support on strict alignment architectures due
   to the limitation of hardware. The driver needs a fix-up code for
   RX side. The fix will show up in near future.
 - fix endian issue for 82544 on PCI-X bus. I couldn't test this as
   I don't have the NIC/hardware.
 - prefer PCIR_BAR to hardcoded EM_MMBA.
 - Properly checks for for 64bit BAR [1]
 - replace inl/outl with bus_space(9) [1]
 - fix endian issue on VLAN handling.
 - reorder header files and remove unnecessary one.

Reviewed by:		cognet
No response from:	pdeuskar, tackerman
Obtained from:		OpenBSD [1]

revision 1.84
date: 2005/11/09 15:23:54;  author: glebius;  state: Exp;  lines: +7 -3
- Introduce two more stat counters, counting number of RX
  overruns and number of watchdog timeouts.
- Do not log(9) RX overrun events, since this pessimizes
  things under load [1].
- Do not increase if->if_oerrors in em_watchdog(), since
  this leads to counter slipping back, when if->if_oerrors
  is recalculated in em_update_stats_counters(). Instead
  increase watchdog counter in em_watchdog() and take it
  into account in em_update_stats_counters().

revision 1.86
date: 2005/11/11 16:04:51;  author: ru;  state: Exp;  lines: +1 -1
- Store pointer to the link-level address right in "struct ifnet"
  rather than in ifindex_table[]; all (except one) accesses are
  through ifp anyway.  IF_LLADDR() works faster, and all (except
  one) ifaddr_byindex() users were converted to use ifp->if_addr.

- Stop storing a (pointer to) Ethernet address in "struct arpcom",
  and drop the IFP2ENADDR() macro; all users have been converted
  to use IF_LLADDR() instead.

revisions 1.85, 1.87
- Introduce tunables em.hw.txd and em.hw.rxd, which allow administrator
  to configure number of transmit and receive descriptors.
- Check em.hw.txd and em.hw.rxd against hardware limits [*] and require
  them to be multiple of 128.

revision 1.88
date: 2005/11/21 04:17:43;  author: yongari;  state: Exp;  lines: +121 -83
busdma cleanup for em(4).
 - don't force busdma to pre-allocate bounce pages for parent tag.
 - use system supplied roundup2 macro instead of rolling its own version.
 - TX/RX decriptor length should be multiple of 128. There is no
   no need to expand the size with the multiple of 4096.
 - don't create/destroy DMA maps in TX/RX handlers. Use pre-allocated
   DMA maps. Since creating DMA maps on sparc64 is time consuming
   operations(resource mananger overhead), this change should boost
   performance on sparc64. I could get > 2x speedup on Ultra60.
 - TX/RX descriptors could be aligned on 128 boundary. Aligning them
   on PAGE_SIZE is waste of resource.
 - don't blindly create TX DMA tag with size of MCLBYTES * 8. The size
   is only valid under jumbo frame environments. Instead of using the
   hardcoded value, re-compute necessary size on the fly.
 - RX side bus_dmamap_load_mbuf_sg(9) support.
 - remove unused macro EM_ROUNDUP and constant EM_MMBA.

Reviewed by:	scottl
Tested by:	glebius

revision 1.89
date: 2005/11/24 01:44:48;  author: glebius;  state: Exp;  lines: +131 -77
Merge in new driver version from Intel - 3.2.18.

The most important change is support for adapters based on
82571 and 82572 chips.

Tested on:	82547EI on i386
Tested on:	82540EM on sparc64

revision 1.90
date: 2005/11/24 15:13:47;  author: cognet;  state: Exp;  lines: +3 -1
Remember the bus_dmamap_t where we loaded the mbuf, and sync this map instead
of tx_buffer->map, or we could end up syncing the wrong map.
2005-11-25 14:11:59 +00:00
delphij
88a8009c9a MFC 1.260 (by ps): Fixed a panic that can happen when nfs_lookup() hits
an error.

RELENG_6_0 errata candidate.
2005-11-25 13:27:22 +00:00
cperciva
8cc04de74d Synchronize with version of portsnap in HEAD:
1. make_index no longer coredumps if input has zero lines.
2. phttpget no longer enters an infinite loop if the TCP connection is
closed while phttpget is reading HTTP headers.
2005-11-25 12:56:51 +00:00
rwatson
cd346681fb Merge uipc_usrreq.c:1.159 from HEAD to RELENG_6:
Correct a number of serious and closely related bugs in the UNIX domain
  socket file descriptor garbage collection code, which is intended to
  detect and clear cycles of orphaned file descriptors that are "in-flight"
  in a socket when that socket is closed before they are received.  The
  algorithm present was both run at poor times (resulting in recursion and
  reentrance), and also buggy in the presence of parallelism.  In order to
  fix these problems, make the following changes:

  - When there are in-flight sockets and a UNIX domain socket is destroyed,
    asynchronously schedule the garbage collector, rather than running it
    synchronously in the current context.  This avoids lock order issues
    when the garbage collection code reenters the UNIX domain socket code,
    avoiding lock order reversals, deadlocks, etc.  Run the code
    asynchronously in a task queue.

  - In the garbage collector, when skipping file descriptors that have
    entered a closing state (i.e., have f_count == 0), re-test the FDEFER
    flag, and decrement unp_defer.  As file descriptors can now transition
    to a closed state, while the garbage collector is running, it is no
    longer the case that unp_defer will remain an accurate count of
    deferred sockets in the mark portion of the GC algorithm.  Otherwise,
    the garbage collector will loop waiting waiting for unp_defer to reach
    zero, which it will never do as it is skipping file descriptors that
    were marked in an earlier pass, but now closed.

  - Acquire the UNIX domain socket subsystem lock in unp_discard() when
    modifying the unp_rights counter, or a read/write race is risked with
    other threads also manipulating the counter.

  While here:

  - Remove #if 0'd code regarding acquiring the socket buffer sleep lock in
    the garbage collector, this is not required as we are able to use the
    socket buffer receive lock to protect scanning the receive buffer for
    in-flight file descriptors on the socket buffer.

  - Annotate that the description of the garbage collector implementation
    is increasingly inaccurate and needs to be updated.

  - Add counters of the number of deferred garbage collections and recycled
    file descriptors.  This will be removed and is here temporarily for
    debugging purposes.

  With these changes in place, the unp_passfd regression test now appears
  to be passed consistently on UP and SMP systems for extended runs,
  whereas before it hung quickly or panicked, depending on which bug was
  triggered.

  Reported by:    Philip Kizer <pckizer at nostrum dot com>
2005-11-25 11:22:39 +00:00
njl
1b701f35fa MFC: acpi_battery.c 1.22, acpi_cmbat.c 1.42, acpi_smbat.c 1.2 and 1.3
Cache smbat battery states like cmbat (Original by ume@).  Only re-evaluate
_BIF when there is a notify and on boot.
2005-11-24 05:29:15 +00:00
wilko
432b2f707d sync with HEAD.
fix typo while here
2005-11-23 19:14:19 +00:00
jhb
ee240d82b4 MFC: Check for -1 using 0xffffffff rather than 0xffffff. 2005-11-23 19:06:53 +00:00