Commit Graph

75292 Commits

Author SHA1 Message Date
Andrew Thompson
cfc42a2785 MFC r202608
Remove a hack to attach TRENDnet TEW-504UB/EU, this has been solved.
2010-04-07 00:25:03 +00:00
Andrew Thompson
a811dd8b64 MFC r205805
Do not sync cache for the PL2506

PR:		usb/144915
Submitted by:	Monty Hall
2010-04-06 23:31:22 +00:00
Andrew Thompson
6b6aaa9fcd MFC r205804
Do not swap Apple keys when detecting Apple-FN keyboards.

Reported by:	Steven Noonan
Submitted by:	Hans Petter Selasky
2010-04-06 23:30:57 +00:00
Andrew Thompson
3224ea55bb MFC r205803
Make sure the bsd_urb_list gets initialised and that new URB's are queued at
 the end of the list.

Submitted by:	Hans Petter Selasky
2010-04-06 23:30:30 +00:00
Andrew Thompson
441f5e4c8a MFC r205802
Add PCI IDs for two more nForce controllers.

Submitted by:	Dmitry Luhtionov @ gmail.com
2010-04-06 23:30:02 +00:00
Andrew Thompson
57023f990c MFC r205801
Add a couple of usb product IDs.

Submitted by:	Dmitry Luhtionov @ gmail.com
2010-04-06 23:29:38 +00:00
Andrew Thompson
67232500cd MFC r205043
Add device ID for the NATURAL4000 keyboard
2010-04-06 23:29:14 +00:00
Andrew Thompson
1e426764e8 MFC r205042
- Integrate latest driver code from OpenBSD
 - Drain our tasks from the ieee80211 taskqueue
 - Add more IDs

Submitted by:	Akinori Furukoshi
2010-04-06 23:28:46 +00:00
Andrew Thompson
963d675e13 MFC r205040
extend search for Apple Function Key.

PR:		usb/144414
Submitted by:	Hans Petter Selasky
2010-04-06 23:28:18 +00:00
Andrew Thompson
10cd601e17 MFC r205039
Add new device ID for the SMC 2514HUB

Submitted by:	Alexander Best
2010-04-06 23:27:55 +00:00
Andrew Thompson
d3a6755914 MFC r205038
add new vendor ID for APACER

Submitted by:	Paul B Mahol
2010-04-06 23:27:31 +00:00
Andrew Thompson
33f167cc00 MFC r205035
Make sure there is a way to reset the endpoint FIFO on transfer errors for
 ISOCHRONOUS transfers

Submitted by:	Hans Petter Selasky
2010-04-06 23:27:04 +00:00
Andrew Thompson
252913a125 MFC r205034
For USS820 driver we need to manually reset TX FIFO at each SETUP transaction
 because the chip doesn't do this by itself.

Submitted by:	Hans Petter Selasky
2010-04-06 23:26:40 +00:00
Andrew Thompson
722095f272 MFC r205033
isochronous endpoint descriptors should have two more bytes which are zero by
 default.

Submitted by:	Hans Petter Selasky
2010-04-06 23:26:17 +00:00
Andrew Thompson
4e4177b3d0 MFC r205032
Add new uvisor(4) device ID.

PR:		usb/144201
2010-04-06 23:25:53 +00:00
Andrew Thompson
15a1f2780d MFC r205031
It appears that some UVISOR devices do not handle when the clear stall command
 is issued at the beginning of the initial IN/OUT data transfers.  Reason
 unknown, probably firmware fault. Now the stall is only cleared on data
 transfer errors.

PR:		usb/144199
Submitted by:	Hans Petter Selasky
2010-04-06 23:25:19 +00:00
Andrew Thompson
18fef95d49 MFC r205030
- make the usb_temp_setup() and usb_temp_unsetup() functions public so that
   other modules can generate USB descriptors.
 - extend the vendor specific request function by one length pointer argument,
   because not all descriptors store the length in the first byte. For example
   HID descriptors.

Submitted by:	Hans Petter Selasky
2010-04-06 23:24:55 +00:00
Andrew Thompson
a8562ad046 MFC r205029
Use wMaxPacketSize for the uftdi input buffer size.

Submitted by:	Hans Petter Selasky
2010-04-06 23:24:29 +00:00
Andrew Thompson
14c9d51098 MFC r205026
Reapply r185998 which was overwritten at some point.
2010-04-06 23:24:07 +00:00
Andrew Thompson
b766264da8 MFC r205005
Wrap the proc wakeup special case for ddb in ifdef DDB.

Submitted by:	Giovanni Trematerra
2010-04-06 23:23:43 +00:00
Andrew Thompson
c96e62bb8a MFC r203906
Add device ID for the FTDI 4232H.

PR:		usb/143832
Submitted by:	UEMURA Tetsuya
2010-04-06 23:23:19 +00:00
Andrew Thompson
5821ad555b MFC r203905
Add support for the E1752 3G modem and the required eject command.

Submitted by:	Milan Obuch
2010-04-06 23:22:47 +00:00
Andrew Thompson
5aab223c3c MFC r203903
Make umodem more tolerant for devices which modem descriptors are misplaced.

Reported by:	Erick Wales
Submitted by:	Hans Petter Selasky
2010-04-06 23:22:19 +00:00
Andrew Thompson
76e18c9128 MFC r203899
Add UQ_KBD_BOOTPROTO quirk needed in r203896
2010-04-06 23:21:54 +00:00
Andrew Thompson
2c50fc457c MFC r203896
Detect when we are polling from kernel via cngetc() in the boot process and
 reserve the keypresses so they do not get passed to syscons.

Submitted by:	Hans Petter Selasky
2010-04-06 23:21:30 +00:00
Andrew Thompson
9081202938 MFC r203693
Disable the use of the IAAD usb doorbell on NVidia controllers as it can cause
 the hardware to stall.

Submitted by:	Hans Petter Selasky
2010-04-06 23:21:06 +00:00
Andrew Thompson
9f524548aa MFC r203507
The ZTE MF633R modem has a different type of cdrom driver disk, add the product
 ID and use a standard scsi eject.

Reported by:	Patrick Lamaiziere
2010-04-06 23:20:41 +00:00
Andrew Thompson
62bd90e5c7 MFC r203506
Properly name the 0x0016 ZTE product as MF633R now that its known.
2010-04-06 23:20:13 +00:00
Andrew Thompson
e6fdf62105 MFC r203146
Rework cam error handling to fix Mitsumi floppy drives.

Submitted by:	mav
2010-04-06 23:19:43 +00:00
Andrew Thompson
7ba8e24410 MFC r203145
Simplify attach for UMASS_PROTO_CBI_I mode and change some switch() returns
 into breaks.

Submitted by:	Hans Petter Selesky
2010-04-06 23:19:11 +00:00
Andrew Thompson
ce176213dd MFC r203144
Add null check on quirk lookup and add a couple of umass quirks.

Submitted by:	Hans Petter Selesky
2010-04-06 23:18:41 +00:00
Andrew Thompson
401b356e9b MFC r203143
Add the Netgear WPN111
2010-04-06 23:18:09 +00:00
Andrew Thompson
fe5c7a4e81 MFC r203142
Sync usb products to perforce.
2010-04-06 23:17:43 +00:00
Andrew Thompson
e7cccdd19a MFC r203141
Attempt to recover on a TX error rather than stopping all transfers.

Submitted by:	Hans Petter Selesky
2010-04-06 23:17:13 +00:00
Andrew Thompson
a678556411 MFC r203140
Optimise EHCI ISOC HS done check.

Submitted by:	Hans Petter Selasky
2010-04-06 23:16:40 +00:00
Andrew Thompson
3f3b0d48a9 MFC r203139
Add device ID.

PR:		usb/142427
2010-04-06 23:16:09 +00:00
Andrew Thompson
7e2c44f008 MFC r203138
Use device_printf rather than printf + device_get_nameunit.
2010-04-06 23:15:44 +00:00
Andrew Thompson
13548b8bd0 MFC r203137
Release the firmware after loading to the device.
2010-04-06 23:15:16 +00:00
Andrew Thompson
0b2d5c2977 MFC r203134
Add run(4), a driver for Ralink RT2700U/RT2800U/RT3000U USB 802.11agn devices.

 This driver was written for OpenBSD by Damien Bergamini and ported over by
 Akinori Furukoshi.
2010-04-06 23:14:43 +00:00
Rick Macklem
9377fe1021 MFC: r205562
When the regular NFS server replied to a UDP client out of the replay
cache, it did not free the request argument mbuf list, resulting in a leak.
This patch fixes that leak.

PR:	kern/144330
2010-04-06 23:03:20 +00:00
Rui Paulo
8d3cd908c4 MFC r203422, r205516:
When receiving a management frame, pass the mbuf to bpf before calling
 iv_recv_mgmt(). iv_recv_mgmt() will generate management frame
 responses
 and pass them to bpf before the management frame that triggered the
 response.

 PR:		144323
 Submitted by:	Alexander Egorenkov <egorenar at gmail.com>
 Sponsored by:	iXsystems, inc.
2010-04-06 14:07:48 +00:00
Xin LI
f33c89d1ae MFC r205534:
Add PCI ID for MCS9901's parallel port.

PR:		kern/144713
Submitted by:	gcooper
2010-04-06 00:50:23 +00:00
Navdeep Parhar
ece8cb8889 cxgb(4) MFCs: r204271,r204274,r204348,r204921,r205944,r205945,r205946,r205947,r205948,r205949,r205950,r206109
r204271:
Accessing an mbuf after it has been handed off to the hardware is a bad
race as it could already have been tx'd and freed by that time.  Place
the bpf tap just _before_ writing the gen bit.

This fixes a panic when running tcpdump on a cxgb interface.

r204274:
There is no need to test __FreeBSD_version for features that have
been around for a long time now (7.1-ish or even earlier); assume
they are present.  These includes MSI, TSO, LRO, VLAN, INTR_FILTERS,
FIRMWARE, etc.

Also, eliminate some dead code and clean up in other places as part
of this quick once-over.

r204348:
Support IFCAP_VLANHWTSO in cxgb(4).  It works with or without vlanhwtag.
While here, remove old DPRINTFs and tidy up the capability code a bit.

r204921:
Better TwinAx transceiver detection.

Originally submitted by: <Bruno dot Bittner at isilon dot com>
(This is a rewritten, corrected version of that patch)

r205944:
Refresh the firmware version immediately after it is upgraded (or downgraded).

r205945:
Improved PHY EDC settings.

r205946:
Do not attempt to retrieve interrupt information before it is available.

r205947:
Fix build with "nooptions INET"

r205948:
Fix tx drop statistics.

r205949:
Fix signed/unsigned mix-up that allowed txq->in_use to grow beyond txq->size.

r205950:
Multiple fixes related to queue set sizing and resources:

- Only the tunnelq (TXQ_ETH) requires a buf_ring, an ifq, and the watchdog/timer
  callouts.  Do not allocate these for the other tx queues.

- Use 16k jumbo clusters only on offload capable cards by default.

- Do not allocate a full tx ring for the offload queue if the card is not
  offload capable.

- Slightly better freelist size calculation.

- Fix nmbjumbo4 typo, remove unneeded global variables.

r206109:
Increase response queue size to avoid starvation, add a counter
to track it when it does occur.
2010-04-05 23:29:27 +00:00
Jack F Vogel
dd75f66126 Add missing module Makefile for ixgbe and em MFCs 2010-04-05 21:43:22 +00:00
Jack F Vogel
d05b20c60c MFC of the em/igb drivers 2010-04-05 20:39:44 +00:00
Jack F Vogel
d4e2e2a53f MFC of version 2.1.7 of the ixgbe driver. 2010-04-05 18:46:29 +00:00
Matt Jacob
be5d0cf413 This is an MFC of 205712.
D'oh- isp_handle_index' logic was reversed (not used in FreeBSD).
2010-04-05 18:36:47 +00:00
Marius Strobl
3d9988b326 MFC: r206086
- Try do deal gracefully with correctable ECC errors.
- Improve the reporting of unhandled kernel and user traps.
2010-04-05 18:25:30 +00:00
Matt Jacob
59a8fbd208 This is an MFC of 205698
Clean up some printing stuff so that we can have a bit finer control
on debug output. Add a new platform function requirement to allow
for printing based upon the ITL nexus instead of the isp unit plus
channel, target and lun. This allows some printouts and error messages
from the core code to appear in the same format as the platform's
subsystem (in FreeBSD's case, CAM path).
2010-04-05 18:22:42 +00:00
Marius Strobl
bd7099bd19 MFC: r206020
Use device_get_nameunit(9) rather than device_get_name(9) so one can
identify the reporting bridge in machines with multiple PCI domains.
2010-04-05 18:04:01 +00:00
Marius Strobl
1592a77552 MFC: r206019
Don't re-implement device_get_nameunit(9).
2010-04-05 17:58:47 +00:00
Marius Strobl
ceb8e6f350 MFC: r206018
- Take advantage of the INTCLR_* macros.
- Right-justify the backslashes as per style(9).
2010-04-05 17:56:40 +00:00
Jung-uk Kim
29f7dafb4c MFC: r205095
Fix a style(9) nit.
2010-04-05 17:37:35 +00:00
Jung-uk Kim
7493cc345a MFC: r205858
Check the pointer to JIT binary filter before its de-allocation.
2010-04-05 17:32:49 +00:00
Alan Cox
02b5123ee3 MFC r204907, r204913, r205402, r205573, r205573
Implement AMD's recommended workaround for Erratum 383 on Family 10h
  processors.

  Enable machine check exceptions by default.
2010-04-05 16:11:42 +00:00
Randall Stewart
54bb41671a MFC of 2 items to fix the csum for v6 issue:
Revision 205075 and 205104:

---------205075----------
With the recent change of the sctp checksum to support offload,
no delayed checksum was added to the ip6 output code. This
causes cards that do not support SCTP checksum offload to
have SCTP packets that are IPv6 NOT have the sctp checksum
performed. Thus you could not communicate with a peer. This
adds the missing bits to make the checksum happen for these cards.
-------------------------
---------205104----------
The proper fix for the delayed SCTP checksum is to
have the delayed function take an argument as to the offset
to the SCTP header. This allows it to work for V4 and V6.
This of course means changing all callers of the function
to either pass the header len, if they have it, or create
it (ip_hl << 2 or sizeof(ip6_hdr)).
-------------------------
PR:		144529
2010-04-05 13:48:23 +00:00
Randall Stewart
9b355dc71d MFC of 204670:
-------------------------
sched_getparam was just plain broke for time-share
processes. It did not return an error but instead
just let garbage be passed back. This I fix so
it actually properly translates the priority the
process is at to a posix's high means more priority.
I also fix it so that if the ULE scheduler has bumped
it up to a realtime process you get back a sane value
i.e. the highest priority (63 for time-share).

sched_setscheduler() had the setting of the
timeshare class priority disabled. With some notes
about rejecting the posix high numbers is greater
priority and use nice instead. This fix also
adjusts that to work, with the cavet that a t-s
process may well get bumped up or down i.e. the
setscheduler() will NOT change the nice value only
the current priority. I think this is reasonable
considering if the user wants to play with nice then
he can. At least all the posix'ish interfaces now
respond sanely.
-----------------------
2010-04-05 13:33:54 +00:00
Robert Noland
ca23c89977 MFC r205120,r205126
Add drm support for Intel Pineview chips.
2010-04-04 15:46:46 +00:00
Robert Noland
616641e987 MFC r203289,r203367
Enable MTRR on all VIA CPUs that claim support
2010-04-04 15:42:52 +00:00
Robert Noland
707a9a4c19 MFC r205096, r205102
Add AGP support for Intel Pineview and Ironlake chipsets.
2010-04-04 15:37:47 +00:00
Marius Strobl
cdf8665e67 MFC: r205269
o Add support for UltraSparc-IV+:
  - Swap the configuration of the first and second large dTLB as with
    US-IV+ these can only hold entries of certain page sizes each, which
    we happened to chose the non-working way around.
  - Additionally ensure that the large iTLB is set up to hold 8k pages
    (currently this happens to be a NOP though).
  - Add a workaround for US-IV+ erratum #2.
  - Turn off dTLB parity error reporting as otherwise we get seemingly
    false positives when copying in the user window by simulating a
    fill trap on return to usermode. Given that these parity errors can
    be avoided by disabling multi issue mode and the problem could be
    reproduced with a second machine this appears to be a silicon bug of
    some sort.
  - Add a membar #Sync also before the stores to ASI_DCACHE_TAG. While
    at it, turn of interrupts across the whole cheetah_cache_flush() for
    simplicity instead of around every flush. This should have next to no
    impact as for cheetah-class machines we typically only need to flush
    the caches a few times during boot when recovering from peeking/poking
    non-existent PCI devices, if at all.
  - Just use KERNBASE for FLUSH as we also do elsewhere as the US-IV+
    documentation doesn't seem to mention that these CPUs also ignore the
    address like previous cheetah-class CPUs do. Again the code changing
    LSU_IC is executed seldom enough that the negligible optimization of
    using %g0 instead should have no real impact.

  With these changes FreeBSD runs stable on V890 equipped with US-IV+
  and -j128 buildworlds in a loop for days are no problem. Unfortunately,
  the performance isn't were it should be as a buildworld on a 4x1.5GHz
  US-IV+ V890 takes nearly 3h while on a V440 with (theoretically) less
  powerfull 4x1.5GHz US-IIIi it takes just over 1h. It's unclear whether
  this is related to the supposed silicon bug mentioned above or due to
  another issue. The documentation (which contains a sever bug in the
  description of the bits added to the context registers though) at least
  doesn't mention any requirements for changes in the CPU handling besides
  those implemented and the cache as well as the TLB configurations and
  handling look fine.
o Re-arrange cheetah_init() so it's easier to add support for SPARC64
  V up to VIIIfx CPUs, which only require parts of this initialization.

Committed from:	EH2010
2010-04-04 14:57:46 +00:00
Alan Cox
c7014073a8 MFC r205652
A ptrace(2) by one process may trigger a page size promotion in the
  address space of another process.  Modify pmap_promote_pde() to handle
  this.
2010-04-03 15:43:28 +00:00
Fabien Thomas
caa4eaacd7 MFC r205998:
If there is multiple PMCs for the same interrupt ignore new post.
This will indirectly fix a bug where the thread will be pinned
forever if the assert is not compiled.
2010-04-03 07:12:35 +00:00
Bjoern A. Zeeb
22177b7279 MFC r205637:
We are holding a write lock here so avoid aquiring it twice calling
  the "locked" version rather than the wrapper function.
2010-04-02 17:52:50 +00:00
Bjoern A. Zeeb
ac28297bce MFC r205789:
When tearing down IPsec as part of a (virtual) network stack,
  do not try to free the same list twice but free both the
  acquiring list and the security policy acquiring list.

  Reviewed by:  anchie
2010-04-02 17:48:01 +00:00
Konstantin Belousov
003465f5f1 MFC r205317:
Remove dead statement.
2010-04-02 13:43:16 +00:00
Konstantin Belousov
131e8de2da MFC r205316:
Fix two style issues.
2010-04-02 13:39:30 +00:00
Gleb Smirnoff
033a5be7fa Merge r205082, r205083 that fix 'netstat -f netgraph' functionality. 2010-04-02 11:07:55 +00:00
Qing Li
f3939d3288 MFC 205268
Set the device capabilities to include dynamic link-state for
those modern drivers.

Reviewed by: imp (and suggested by imp)
2010-04-02 05:15:27 +00:00
Qing Li
94190b3925 MFC 205222
Verify interface up status using its link state only
if the interface has such capability. The interface
capability flag indicates whether such capability
exists. This approach is much more backward compatible.
Physical device driver changes will be part of another
commit.

Also updated the ifconfig utility to show the LINKSTATE
capability if present.

Reviewed by:  rwatson, imp, juli
2010-04-02 05:12:46 +00:00
Qing Li
243785f92f MFC 205024
The if_tap interface is of IFT_ETHERNET type, but it
does not set or update the if_link_state variable.
As such RT_LINK_IS_UP() fails for the if_tap interface.

Also, the RT_LINK_IS_UP() needs to bypass all loopback
interfaces because loopback interfaces are considered
up logically as long as the system is running.

This patch fixes the above issues by setting and updating
the if_link_state variable when the tap interface is
opened or closed respectively. Similary approach is
already done in the if_tun device.
2010-04-02 05:05:51 +00:00
Qing Li
c951da56b4 MFC 204902
One of the advantages of enabling ECMP (a.k.a RADIX_MPATH) is to
allow for connection load balancing across interfaces. Currently
the address alias handling method is colliding with the ECMP code.
For example, when two interfaces are configured on the same prefix,
only one prefix route is installed. So connection load balancing
among the available interfaces is not possible.

The other advantage of ECMP is for failover. The issue with the
current code, is that the interface link-state is not reflected
in the route entry. For example, if there are two interfaces on
the same prefix, the cable on one interface is unplugged, new and
existing connections should switch over to the other interface.
This is not done today and packets go into a black hole.

Also, there is a small bug in the kernel where deleting ECMP routes
in the userland will always return an error even though the command
is successfully executed.
2010-04-02 05:02:50 +00:00
Qing Li
ca2d42b2a1 MFC 201131
introduce a local variable rte acting as a cache of ro->ro_rt
within ip_output, achieving (in random order of importance):
- a reduction of the number of 'r's in the source code;
- improved legibility;
- a reduction of 64 bytes in the .text
2010-04-02 04:58:17 +00:00
Qing Li
01104d862b MFC 205077
The flow-table module retrieves the destination and source
address as well as the transport protocol port information
from the outbound packets. The routing code is generic and
compares every byte in the given sockaddr object. Therefore
the temporary sockaddr objects must be cleared due to padding
bytes. In addition, the port information must be stripped
or the route search will either fail or return the incorrect
route entry.

Unit testing is done using OpenVPN over the if_tun interface.
2010-04-01 20:23:43 +00:00
Marius Strobl
618de50c3f MFC: r205409
- The firmware of Sun Fire V1280 has a misfeature of setting %wstate to
  7 which corresponds to WSTATE_KMIX in OpenSolaris whenever calling into
  it which totally screws us even when restoring %wstate afterwards as
  spill/fill traps can happen while in OFW. The rather hackish OpenBSD
  approach of just setting the equivalent of WSTATE_KERNEL to 7 also is
  no option as we treat %wstate as a bit field. So in order to deal with
  this problem actually implement spill/fill handlers for %wstate 7 which
  just act as the WSTATE_KERNEL ones except of theoretically also handling
  32-bit, turn off interrupts completely so we don't even take IPIs while
  in OFW which should ensure we only take spill/fill traps at most and
  restore %wstate after calling into OFW once we have taken over the trap
  table. While at it, actually set WSTATE_{,PROM}_KMIX before calling into
  OFW just like OpenSolaris does, which should at least help testing this
  change on non-V1280.
- Remove comments referring to the %wstate usage in BSD/OS.
- Remove the no longer used RSF_ALIGN_RETRY macro.
- Correct some trap table addresses in comments.
- Ensure %wstate is set to WSTATE_KERNEL when taking over the trap table.
- Ensure PSTATE_AM is off when entering or exiting to OFW as well as that
  interrupts are also completely off when exiting to OFW as the firmware
  trap table shouldn't be used to handle our interrupts.
2010-04-01 15:17:50 +00:00
Nathan Whitehorn
3c7ec531af MFC r204694,204719,205370
Update the page table locking for the 64-bit PMAP. One of these revisions
largely reverted the other, so there is a small amount of churn and the
addition of some mtx_assert()s.
2010-04-01 13:27:27 +00:00
Nathan Whitehorn
8941979907 MFC r205163:
Fix two small bugs. The PowerPC 970 does not support non-coherent memory
access, and reflects this by autonomously writing LPTE_M into PTE entries.
As such, we should not panic if LPTE_M changes by itself. While here,
fix a harmless typo in moea64_sync_icache().
2010-04-01 13:21:04 +00:00
Marcel Moolenaar
56a526f031 MFC rev 199602, 200739, 203177, 203350, 203352, 205495, 205527,
205535 and 205569:

Sync MPC85xx/Book-E with 9-current.
2010-04-01 02:41:50 +00:00
Kip Macy
e952596a10 MFC 205066, 205069, 205093, 205097, 205488:
r205066:

Log:
 - restructure flowtable to support ipv6
 - add a name argument to flowtable_alloc for printing with ddb commands
 - extend ddb commands to print destination address or 4-tuples
 - don't parse ports in ulp header if FL_HASH_ALL is not passed
 - add kern_flowtable_insert to enable more generic use of flowtable
   (e.g. system calls for adding entries)
 - don't hash loopback addresses
 - cleanup whitespace
 - keep statistics per-cpu for per-cpu flowtables to avoid cache line contention
 - add sysctls to accumulate stats and report aggregate

r205069:
Log:
 fix stats reporting sysctl

r205093:
Log:
 re-update copyright to 2010
 pointed out by danfe@

r205097:

Log:
 flowtable_get_hashkey is only used by a DDB function - move under #ifdef DDB

 pointed out by jkim@

r205488:

Log:
 - boot-time size the ipv4 flowtable and the maximum number of flows
 - increase flow cleaning frequency and decrease flow caching time
   when near the flow limit
 - stop allocating new flows when within 3% of maxflows don't start
   allocating again until below 12.5%
2010-04-01 00:36:40 +00:00
Marius Strobl
39c9b5507e MFC: r205399
Improve the KVA space sizing of r186682; on machines with large dTLBs we
can actually use all of the available lockable entries of the tiny dTLB
for the kernel TSB. With this change the KVA space sizing happens to be
more in line with the MI one so up to at least 24GB machines KVA doesn't
need to be limited manually. This is just another stopgap though, the
real solution is to take advantage of ASI_ATOMIC_QUAD_LDD_PHYS on CPUs
providing it so we don't need to lock the kernel TSB pages into the dTLB
in the first place.
2010-03-31 22:05:49 +00:00
Marius Strobl
265f3f7642 MFC: r205263
Add macros for the VER.impl of SPARC64 II to VIIIfx.
2010-03-31 22:00:22 +00:00
Marius Strobl
c65c70f0f4 MFC: r205258
- Add TTE and context register bits for the additional page sizes supported
  by UltraSparc-IV and -IV+ as well as SPARC64 V, VI, VII and VIIIfx CPUs.
- Replace TLB_PCXR_PGSZ_MASK and TLB_SCXR_PGSZ_MASK with TLB_CXR_PGSZ_MASK
  which just is the complement of TLB_CXR_CTX_MASK instead of trying to
  assemble it from the page size bits which vary across CPUs.
- Add macros for the remainder of the SFSR bits, which are useful for at
  least debugging purposes.
2010-03-31 21:57:48 +00:00
Marius Strobl
94118d2871 MFC: r204153
Starting with UltraSPARC IV CPUs the CPU caches are described with different
OFW properties.
2010-03-31 21:41:00 +00:00
Marius Strobl
bd742eaf9c MFC: r204152, r204164
Some machines can not only consist of CPUs running at different speeds
but also of different types, f.e. Sun Fire V890 can be equipped with a
mix of UltraSPARC IV and IV+ CPUs, requiring different MMU initialization
and different workarounds for model specific errata. Therefore move the
CPU implementation number from a global variable to the per-CPU data.
Functions which are called before the latter is available are passed the
implementation number as a parameter now.
2010-03-31 21:32:52 +00:00
Jung-uk Kim
516a153f98 MFC: r197185
Enable BIOS modes on amd64.
2010-03-31 15:49:10 +00:00
Jung-uk Kim
7058bb70ff MFC: r205557, r205558, r205564, r205566, r205604, r205653
Sync. pixel mode support for VESA and VGA frame buffers with HEAD.

- Map entire video memory again.  Although we do not use them all directly,
it seems VGA renderer may access unmapped memory region and cause kernel
panic.
- Fall back to VGA palette functions if VESA function failed and DAC is
still in 6-bit mode.  Although we have to check non-VGA compatibility bit
here, it seems there are too many broken VESA BIOSes out to rely on it.
- Be careful when we determine bytes per scan line information.  We compare
mode table data against minimum value.  If the mode table does not make
sense, we set the minimum in the mode info.
- Teach VGA framebuffer about 8-bit palette format for VESA.
- Add my copyright here.
2010-03-31 15:45:11 +00:00
Jung-uk Kim
86a2d033e4 MFC: r205550, r205605, r205865
Sync. pixel mode support for syscons(4) with HEAD.

- Separate 24-bit pixel draw from 32-bit case.  Although it is slower, we do
not want to write a useless zero to inaccessible memory region.
- We only want the dummy palette for direct color mode.
2010-03-31 15:39:46 +00:00
Jung-uk Kim
824d100ff7 MFC: r205297, r205347, r205452, r205455, r205649, r205650
Sync. x86bios with HEAD.

- Detect illegal access to unmapped memory within real mode emulator.
- Map EBDA if available and support memory wraparound above 1MB as VM86 does.
- Set initial %ds to 0x40 as X.org int10 handler does.
- Print the initial memory map when bootverbose is set.
- Optimize real mode page table lookup.
- Add strictly aligned memory access for distant future.
- Update copyright date.
2010-03-31 15:32:36 +00:00
Alexander Motin
72208ab4ba MFC r205734:
Fix lock leakage.

PR:             kern/145081
2010-03-31 08:03:49 +00:00
Alexander Motin
e30013ae5c MFC r205413:
Add some more codec IDs.
2010-03-31 08:02:16 +00:00
Alexander Motin
80ebd5b059 MFC r205422:
- Spec tells that CCC interrupt is edge triggered. Acknowledge it as such.
- Do not try to enable CCC if it is not supported.
2010-03-31 07:56:32 +00:00
Alexander Motin
3015ec2db6 MFC r205074:
Mask disk_idx to avoid panic because of extra bits set.

PR:             kern/102211
Submitted by:   yoichi
2010-03-31 07:49:59 +00:00
Marcel Moolenaar
419ee98298 MFC rev 199727, 200888, 201031, 202904, 203054, 203106, 203572, 203884,
204183, 204184, 204185, 204425, 204904, 204905, 205172, 205234, 205357,
205428, 205429, 205431, 205432, 205433, 205434, 205435, 205454, 205665,
205713, 205723, 205726 and 205727:

Bring ia64 machine-dependent changes from 9-current to 8-stable.
2010-03-31 05:05:28 +00:00
Marcel Moolenaar
3559a7713a MFC revs 199502, 199566 and 199574:
Add a seatbelt to the Nested TLB Fault handler to give us a chance
to panic when we have an unexpected TLB fault while interrupt
collection is disabled.
2010-03-31 03:20:14 +00:00
Marcel Moolenaar
e9fa42544e MFC rev 198431:
Have the early USB takeover only enabled for i386 and amd64
by default. This also avoids a panic on PowerPC.
2010-03-31 03:14:40 +00:00
Marcel Moolenaar
dfeca18773 MFC rev 198341 and 198342:
o   Introduce vm_sync_icache() for making the I-cache coherent with
    the memory or D-cache, depending on the semantics of the platform.
    vm_sync_icache() is basically a wrapper around pmap_sync_icache(),
    that translates the vm_map_t argumument to pmap_t.
o   Introduce pmap_sync_icache() to all PMAP implementation. For powerpc
    it replaces the pmap_page_executable() function, added to solve
    the I-cache problem in uiomove_fromphys().
o   In proc_rwmem() call vm_sync_icache() when writing to a page that
    has execute permissions. This assures that when breakpoints are
    written, the I-cache will be coherent and the process will actually
    hit the breakpoint.
o   This also fixes the Book-E PMAP implementation that was missing
    necessary locking while trying to deal with the I-cache coherency
    in pmap_enter() (read: mmu_booke_enter_locked).
2010-03-31 02:43:58 +00:00
Luigi Rizzo
353be77138 A last-minute change in the previous commit broke rule deletion,
so i am fixing it, this time with a more detailed description
of what the code is supposed to do.
2010-03-31 01:51:08 +00:00
Xin LI
73a0004b9d MFC r204533:
Add PCI ID for MCS9901.

Submitted by:	gcooper
PR:		kern/144397
2010-03-31 00:41:32 +00:00
Marius Strobl
8fcbb37733 MFC: r203846
Predict KASSERTs to be true.
2010-03-30 20:46:10 +00:00
Marius Strobl
411fea736d MFC: r203845
- Add the 'cmp' and 'core' pseudo-busses which are used to group CPU cores
  to the exclusion lists as the CPU nodes aren't handled as regular devices
  either. Also add the pseudo-devices found in Sun Fire V1280.
- Allow nexus_attach() and nexus_alloc_resource() to be used by drivers
  derived from nexus(4) for subordinate busses.
- Don't add the zero-sized memory resources of glue devices to the resource
  lists.
2010-03-30 20:44:04 +00:00
Marius Strobl
306d372fa5 MFC: r203843
Resurrect nexusvar.h from r167307.
2010-03-30 20:39:47 +00:00
Marius Strobl
ceaf6ad0fa MFC: r203839
Style fixes
2010-03-30 20:38:18 +00:00
Marius Strobl
9604687663 MFC: r203838
- Search the whole OFW device tree instead of only the children of the
  root nexus device for the CPUs as starting with UltraSPARC IV the 'cpu'
  nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
  or combinations thereof. Also in large UltraSPARC III based machines
  the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
  group snooping-coherency domains together instead of directly from the
  nexus.
  It would be great if we could use newbus to deal with the different ways
  the 'cpu' devices can hang off of pseudo ones but unfortunately both
  cpu_mp_setmaxid() and sparc64_init() have to work prior to regular device
  probing.
- Add support for UltraSPARC IV and IV+ CPUs. Due to the fact that these
  are multi-core each CPU has two Fireplane config registers and thus the
  module/target ID has to be determined differently so the one specific
  to a certain core is used. Similarly, starting with UltraSPARC IV the
  individual cores use a different property in the OFW device tree to
  indicate the CPU/core ID as it no longer is in coincidence with the
  shared slot/socket ID.
  This involves changing the MD KTR code to not directly read the UPA
  module ID either. We use the MID stored in the per-CPU data instead of
  calling cpu_get_mid() as a replacement in order prevent clobbering any
  registers as side-effect in the assembler version. This requires CATR()
  invocations from mp_startup() prior to mapping the per-CPU pages to be
  removed though.
  While at it additionally distinguish between CPUs with Fireplane and
  JBus interconnects as these also use slightly different sizes for the
  JBus/agent/module/target IDs.
- Make sparc64_shutdown_final() static as it's not used outside of
  machdep.c.
2010-03-30 20:29:45 +00:00
Marius Strobl
c4adffba57 MFC: r203833
- At least the trap table of the Sun Fire V1280 firmware apparently has
  no cleanwindows handler so just remove trying to trigger it from _start
  and the AP trampoline code as that leads to a crash there. This should
  be okay as leaking data from the OFW via the CPU registers on start of
  the kernel should be no real concern.
- Make the comments of _start and the AP trampoline code regarding the
  initializations they perform match each other and reality.
- Make the comments of the AP trampoline code regarding iTLB accesses
  refer to the right macro.
2010-03-30 20:12:42 +00:00
Marius Strobl
935f345ea4 MFC: r203830, r203831
Use the SUNW,{d,i}tlb-load methods for entering locked TLB entries like
OpenBSD and OpenSolaris do instead of fiddling with the MMUs ourselves.
Unlike direct access the firmware methods don't automatically use the
next free (?) TLB slot, instead the slot to be used has to be specified.
We allocate the TLB slots for the kernel top-down as OpenSolaris suggests
that the firmware will always allocate the ones for its own use bottom-up.
Besides being simpler, according to OpenBSD using the firmware methods is
required to allow booting on Sun Fire E10K with multi-systemboard domains.
2010-03-30 20:05:20 +00:00
Marius Strobl
0a1e6ecc1f MFC: r203829
- Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware
  of Sun Fire V1280 doesn't round up the size itself but instead lets
  claiming of non page-sized amounts of memory fail.
- Change parameters and variables related to the TLB slots to unsigned
  which is more appropriate.
- Search the whole OFW device tree instead of only the children of the
  root nexus device for the BSP as starting with UltraSPARC IV the 'cpu'
  nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
  or combinations thereof. Also in large UltraSPARC III based machines
  the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
  group snooping-coherency domains together instead of directly from the
  nexus.
- Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these
  are multi-core each CPU has two Fireplane config registers and thus the
  module/target ID has to be determined differently so the one specific
  to a certain core is used. Similarly, starting with UltraSPARC IV the
  individual cores use a different property in the OFW device tree to
  indicate the CPU/core ID as it no longer is in coincidence with the
  shared slot/socket ID.
  While at it additionally distinguish between CPUs with Fireplane and
  JBus interconnects as these also use slightly different sizes for the
  JBus/agent/module/target IDs.
- Check the return value of init_heap(). This requires moving it after
  cons_probe() so we can panic when appropriate. This should be fine as
  the PowerPC OFW loader uses that order for quite some time now.
2010-03-30 20:02:26 +00:00
Marius Strobl
4139c876fa MFC: r203731
Some style(9) fixes
2010-03-30 19:52:45 +00:00
Marius Strobl
e73d23dad8 MFC: r203341
- Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro;
  for UPA it should have fulfilled its purpose by now and Fireplane-
  and JBus-based machines are way to messy in organization to implement
  something equivalent.
- Fix a bunch of style(9) bugs.
2010-03-30 19:37:47 +00:00
Marius Strobl
592227a6e8 MFC: r203335
- Const'ify the bus_stream_asi and bus_type_asi arrays.
- Replace hard-coded functions names missed in bus_machdep.c with __func__.
- Break some long lines.
2010-03-30 19:36:00 +00:00
Marius Strobl
e18f909f8d MFC: r203334
Sync with the other archs and declare the memory location referenced by
the address argument of the bus_space_write_multi_*() familiy as const.
2010-03-30 19:33:09 +00:00
Attilio Rao
6f1f54906a MFC r205167:
Make the code more readable and compiling on 64-bits arch different
than amd64.

Sponsored by:	Sandvine Incorporated
2010-03-30 12:06:18 +00:00
Attilio Rao
58c7715bb0 MFC r205160:
Checkin a facility for specifying a passthrough FIB from userland.
arcconf tool by Adaptec already seems to use for identifying the
Serial Number of the devices.

Sponsored by:	Sandvine Incorporated
2010-03-30 11:46:43 +00:00
Attilio Rao
acde5c5d1d MFC r204641, r204753:
Improving the clocks auto-tunning by firstly checking if the atrtc may be
correctly initialized and just then assign to softclock/profclock.

Sponsored by:   Sandvine Incorporated
2010-03-30 11:19:29 +00:00
Jung-uk Kim
ac39796e38 MFC: r205647
Fix stupid typos.  Some VESA BIOSes directly call BIOS interrupt handlers
within the VBE interrupt handler.  Unfortunately it was causing real mode
page faults because we were fetching instructions from bogus addresses.

PR:		kern/144654
2010-03-29 15:59:37 +00:00
Attilio Rao
7dd1fd87e8 MFC r199852, r202387, r202441, r202534:
Handling all the three clocks with the LAPIC may lead to aliasing for
softclock and profclock.
Revert the change when the LAPIC started taking charge of all three of
them.

Sponsored by:	Sandvine Incorporated
2010-03-29 15:39:17 +00:00
Luigi Rizzo
d15984d46e mfc 205830:
fixes to rule set handling (including potential kernel panics)
2010-03-29 12:32:16 +00:00
Luigi Rizzo
0d3003c0c8 remove a leftover debugging message 2010-03-29 12:29:34 +00:00
Fabien Thomas
44a4e1d8fb MFC r205694:
Handling SIGPIPE will cause deadlock/crash.
Return an error immediatly in case of hard shutdown.
2010-03-29 06:55:38 +00:00
Ed Maste
171dfe111d MFC aac(4) driver changes
r204019:

  Include command type in COMMAND TIMEOUT messages to aid in debugging.

r203885:

  Diff reduction with Adaptec's vendor driver.

  Driver version 2.1.9 chosen as that Adaptec version roughly corresponds
  with the current feature set merged to the in-tree driver.

r203801:

  Garbage collect Falcon/PPC support that has not been used in released
  products, based on discussion with Adaptec.

r198617:

  Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver.
2010-03-29 00:30:44 +00:00
Ed Maste
436405f522 MFC r204264:
Minor diff reduction with Adaptec's driver: in aac_release_command() set
  cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default.  In every place it was
  set, it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow.
2010-03-29 00:14:34 +00:00
Ed Maste
83867e0aa4 MFC r205411:
Avoid holding the VLAN_LOCK() over the parent interface SIOCGIFMEDIA
  ioctl call, as it may sleep.

  Reviewed by:    rwatson
2010-03-29 00:08:58 +00:00
Edward Tomasz Napierala
fddc12138a MFC r200723:
Interpret VAPPEND correctly in vaccess_acl_nfs4(9).
2010-03-27 18:12:00 +00:00
Edward Tomasz Napierala
bf876fcd34 MFC r200273:
Don't add VAPPEND if the file is not being opened for writing.  Note that this
only affects cases where open(2) is being used improperly - i.e. when the user
specifies O_APPEND without O_WRONLY or O_RDWR.

Reviewed by:	rwatson
2010-03-27 18:09:40 +00:00
Edward Tomasz Napierala
89a2dbabba MFC r200058:
Add change that was somehow missed in r192586.  It could manifest by
incorrectly returning EINVAL from acl_valid(3) for applications linked
against pre-8.0 libc.
2010-03-27 18:08:14 +00:00
Edward Tomasz Napierala
3fbc03cc99 MFC r199875:
Provide a set of sysctls and tunables to disable device node creation
for specific "kinds" of disk labels - for example, GPT UUIDs.  Reason
for this is that sometimes, other GEOM classes attach to these device
nodes instead of the proper ones - e.g. they attach to /dev/gptid/XXX
instead of /dev/ada0p2, which is annoying.

Reviewed by:	pjd (earlier version)
2010-03-27 18:04:33 +00:00
Edward Tomasz Napierala
168d1f006b MFC r197945:
Orphaning provider with EXDEV seems weird; perhaps the author meant
ENXIO here?
2010-03-27 17:56:45 +00:00
Bjoern A. Zeeb
2287aa049c MFC r205626:
Print the pointer to the lock with the panic message. The previous
        panic: rw lock not unlocked
  was not really helpful for debugging. Now one can at least call
        show lock <ptr>
  form ddb to learn more about the lock.
2010-03-27 17:54:44 +00:00
Bjoern A. Zeeb
0b93ad54a2 MFC r205276:
Add ddb support to the "new" link layer code ("new-arp"):
   - show all lltables [1] (optional flag to also show the llentries as well)
   - show lltable <struct lltable *>
   - show llentry <struct llentry *>
2010-03-27 17:52:56 +00:00
Bjoern A. Zeeb
397069f2c5 MFC r205251:
Add pcb reference counting to the pcblist sysctl handler functions
  to ensure type stability while caching the pcb pointers for the
  copyout.

  Reviewed by:  rwatson
2010-03-27 17:51:27 +00:00
Bjoern A. Zeeb
62f500d0c2 MFC r204838:
Destroy TCP UMA zones (empty or not) upon network stack teardown
  to not leak them, otherwise making UMA/vmstat unhappy with every
  stoped vnet.
  We will still leak pages (especially for zones marked NOFREE).

  Reshuffle cleanup order in tcp_destroy() to get rid of what we can
  easily free first.

  Reviewed by:  rwatson
2010-03-27 17:50:02 +00:00
Bjoern A. Zeeb
a4f6889460 MFC r204805:
Rework reference counting in case we queue into the netisr,
  or overflow the netisr queue and fall back to the interface
  queue so that we can garuantee that the ifnet pointer stays
  valid.   Formerly we ended up with reference counts <= 0 in
  case the netisr had returned ENOBUFS.  The idea is to track
  any packet in the netisr queue and only change the refount
  on edge operations for the fallback interface queue. This
  also avoids problems in case the if_snd.ifq_len lies to us.

  Also rework refount assertions to make sure they trigger if
  we go below 1. Formerly a negative refence count did not
  trigger the assert as the refcount variable is u_int.
2010-03-27 17:48:13 +00:00
Bjoern A. Zeeb
3662f299d2 MFC r204807:
Destroy UDP UMA zones (empty or not) upon network stack teardown
  to not leak them making UMA/vmstat -z unhappy with every stoped vnet.
  We will still leak pages (especially as zones are marked NOFREE).
2010-03-27 17:46:06 +00:00
Bjoern A. Zeeb
67208dfa16 MFC r204147:
Set curvnet earlier so that it also covers calls to sodisconnect(), which
  before were possibly panicing the system in ULP code in the VIMAGE case.

  Submitted by: Igor (igor ispsystem.com)
2010-03-27 17:42:04 +00:00
Bjoern A. Zeeb
1386abc0a7 MFC r204279:
Use the DB_SHOW_ALL_COMMAND() macro to register the formerly 'show ifnets'
  in the db_show_all_table as 'show all ifnets' and with that follow the
  convention for showing complete lists.

  Submitted by: thompsa
2010-03-27 17:40:28 +00:00
Bjoern A. Zeeb
0519db7239 MFC r204145:
Start to implement ifnet DDB support:
  - 'show ifnets' prints a list of ifnet *s per virtual network stack,
  - 'show ifnet <struct ifnet *>' prints fields matching the given ifp.

  We do not yet print the complete set of fields and might want to
  factor this out to an extra if_debug.c file in case this grows
  a lot[1]. We may also want to grow 'show ifnet <if_xname>' support[1].

  Suggested by: rwatson [1]
  Reviewed by:  rwatson
2010-03-27 17:39:02 +00:00
Bjoern A. Zeeb
1198bd71ba MFC r204143:
Upon virtual network stack teardown properly release the TCP syncache
  resources.

  Reviewed by:  rwatson
2010-03-27 17:36:52 +00:00
Bjoern A. Zeeb
e47658ce90 MFC r204140:
Split up ip_drain() into an outer lock and iterator part and
  a "locked" version that will only handle a single network stack
  instance. The latter is called directly from ip_destroy().

  Hook up an ip_destroy() function to release resources from the
  legacy IP network layer upon virtual network stack teardown.

  Reviewed by:  rwatson
2010-03-27 17:34:57 +00:00
Bjoern A. Zeeb
9bdad32791 MFC r204142:
Enhance a panic string to contain more useful debugging information.
2010-03-27 17:33:19 +00:00
Bjoern A. Zeeb
78ba8b295c MFC r203729:
Add DDB support for printing vnet_sysinit and vnet_sysuninit
  ordered call lists. Try to lookup function/symbol names and print
  those in addition to the pointers, along with the constants for
  subsystem and order.
  This is useful for debugging vnet teardown ordering issues.

  Make it possible to call the actual printing frunction from normal
  code at runtime, ie. from vnet_sysuninit(), if DDB support is there.
2010-03-27 17:31:54 +00:00
Bjoern A. Zeeb
72ec67fcb7 MFC r203727:
Add an SDT provider for "vnet"s along with probes for vnet_alloc
  and vnet_destroy.
  Use the line number rather than NULL as dummy argument.

  Note: the fbt provider does not reliably provide :return probes
  (depending on optimization levels used at compile time) making
  it unusable for scripts to generate complete call-traces with
  well defined boundaries over allocations or destructions of
  virtual network stacks.
2010-03-27 17:29:50 +00:00
Bjoern A. Zeeb
ef18ad7e2d MFC r203724:
Properly free resources when destroying the TCP hostcache while
  tearing down a network stack (in the VIMAGE jail+vnet case).

  For that break out the logic from tcp_hc_purge() into an internal
  function we can call from both, the sysctl handler and the
  tcp_hc_destroy().

  Reviewed by:  silby, lstewart
2010-03-27 17:26:31 +00:00
Edward Tomasz Napierala
bd7ae20991 MFC r197680:
Provide default implementation for VOP_ACCESS(9), so that filesystems which
want to provide VOP_ACCESSX(9) don't have to implement both.  Note that
this commit makes implementation of either of these two mandatory.

Reviewed by:	kib
2010-03-27 17:22:11 +00:00
Bjoern A. Zeeb
f0dd3ce087 MFC r201814:
Generate a second LINT configuration for i386 and amd64 in
  sys/conf/makeLINT.mk, which includes LINT and sets options VIMAGE
  so that we will have VIMAGE LINT builds. For now only do it for
  those two architectures to avoid massive universe times for archs,
  where people will less likely use VIMAGE or not at all.
2010-03-27 17:17:11 +00:00
Bjoern A. Zeeb
1a52f90b23 MFC r201813:
In sys/<arch>/conf/Makefile set TARGET to <arch>. That allows
  sys/conf/makeLINT.mk to only do certain things for certain
  architectures.

  Note that neither arm nor mips have the Makefile there, thus
  essentially not (yet) supporting LINT.  This would enable them
  do add special treatment to sys/conf/makeLINT.mk as well chosing
  one of the many configurations as LINT.
2010-03-27 17:14:55 +00:00
Bjoern A. Zeeb
cbd7567e6b MFC r202123:
Change DDB show prison:
  - name some columns more closely to the user space variables,
    as we do for host.* or allow.* (in the listing) already.
  - print pr_childmax (children.max).
  - prefix hex values with 0x.
2010-03-27 17:11:06 +00:00
Edward Tomasz Napierala
e8db802864 MFC r197650:
Fix typo in the comment.
2010-03-27 16:35:25 +00:00
Edward Tomasz Napierala
78e32164b0 MFC r197405:
Add pieces of infrastructure required for NFSv4 ACL support in UFS.

Reviewed by:	rwatson
2010-03-27 16:31:49 +00:00
Edward Tomasz Napierala
285438bfc0 MFC r201438:
Make mac_lomac(4) able to interpret NFSv4 access bits.

Reviewed by:	rwatson
2010-03-27 15:05:06 +00:00
Edward Tomasz Napierala
ec85a28567 MFC r201818:
Fix array overflow.

Reviewed by:	philip
2010-03-27 15:02:28 +00:00
Edward Tomasz Napierala
c0d73b99f2 MFC r202919:
Fix array overflow.  This routine is only called from procfs,
which is not mounted by default, and I've been unable to trigger
a panic without this fix applied anyway.

Reviewed by:	kib, cperciva
2010-03-27 14:58:28 +00:00
Edward Tomasz Napierala
ae3c92a106 MFC r204408:
Fix panic on invalid 'mdconfig -at preload' usage.

PR:		kern/80136
2010-03-27 14:43:40 +00:00
John Baldwin
d8c0d3dd97 MFC 205332:
Use the same policy for rejecting / not-reject ACPI tables with incorrect
checksums as the base acpi(4) driver.  This fixes a problem where the MADT
parser would reject the MADT table during early boot causing the MP Table
to be, but then the acpi(4) driver would attach and use non-SMP interrupt
routing.
2010-03-26 18:58:22 +00:00
John Baldwin
7bf38446dd MFC 204972:
Make NKPT a kernel option on i386 so that it can be set to a non-default
value from kernel config files.
2010-03-26 18:54:25 +00:00
Ivan Voras
e617a8cfde MFC r204248,r204249 - "fancy snake_saver" with color coded load averages 2010-03-26 14:03:42 +00:00
John Baldwin
c7402c0bbc MFC 205214:
- Extend the machine check record structure to include several fields useful
  for parsing model-specific and other fields in machine check events
  including the global machine check capabilities and status registers,
  CPU identification, and the FreeBSD CPU ID.
- Report these added fields in the console log of a machine check so that
  a record structure can be reconstituted from the console messages.
- Parse new architectural errors including memory controller errors.
2010-03-26 13:49:46 +00:00
John Baldwin
d62da94291 MFC 205210,205448:
Remove unneeded type specifiers from 64-bit constants.  The compiler
infers their natural type from the constants' values.
2010-03-26 13:01:30 +00:00
Maxim Sobolev
7711964246 MFC: workaround no-carrier issue on IBM HS21.
PR:		118238
2010-03-25 23:38:10 +00:00
John Baldwin
b1fc296597 MFC 205013:
Print out the family and model from the cpu_id.  This is especially useful
given the advent of the extended family and extended model fields.  The
values are printed in hex to match their common usage in documentation.
2010-03-25 15:48:23 +00:00
Luigi Rizzo
51aa112a4c typo... 2010-03-24 19:20:49 +00:00
Luigi Rizzo
f818fb9969 make the module loadable
Submitted by:	Marcin Wisnicki
2010-03-24 18:37:58 +00:00
Pyun YongHyeon
5c55bc1bf1 MFC r205161:
It seems PCI_OUR_REG_[1-5] registers are not mapped on PCI
  configuration space on Yukon Ultra(88E8056) such that accesses to
  these registers were NOPs which in turn make msk(4) instable on
  this controller. Use indirect access method to access
  PCI_OUR_REG_[1-5] registers. This should fix a long standing
  instability bug which prevented msk(4) working on Yukon Ultra.
  Special thanks to koitsu who gave me remote access to his system.

  PR:	kern/114631, kern/116853
2010-03-24 17:36:56 +00:00
Pyun YongHyeon
f305cd92af MFC r204975,204978-204979,204981:
r204975:
  Enable hardware fixes for BCM5704 B0 as recommended by data sheet.
r204978:
  Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices.
  Also disable relaxed ordering as recommended by data sheet for
  PCI-X devices. For PCI-X BCM5704, set maximum outstanding split
  transactions to 0 as indicated by data sheet.
  For BCM5703 in PCI-X mode, DMA read watermark should be less than
  or equal to maximum read byte count configuration. Enforce this
  limitation in DMA read watermark configuration.
r204979:
  Fix typo in r204975.
r204981:
  Fix typo in r204978.
2010-03-24 17:29:32 +00:00
Pyun YongHyeon
51e48a8ee4 MFC r204545:
Remove taskqueue based interrupt handling. After r204541 msk(4)
  does not generate excessive interrupts any more so we don't need
  to have two copies of interrupt handler.
  While I'm here remove two STAT_PUT_IDX register accesses in LE
  status event handler. After r204539 msk(4) always sync status LEs
  so there is no need to resort to reading STAT_PUT_IDX register to
  know the end of status LE processing. Just trust status LE's
  ownership bit.
2010-03-24 17:18:44 +00:00
Pyun YongHyeon
51574f1152 MFC r204541:
Implement rudimentary interrupt moderation with programmable
  countdown timer register. The timer resolution may vary among
  controllers but the value would be represented by core clock
  cycles. msk(4) will automatically computes number of required clock
  cycles from given micro-seconds unit.
  The default interrupt holdoff timer value is 100us which will
  ensure less than 10k interrupts under load. The timer value can be
  changed with dev.mskc.0.int_holdoff sysctl node.

  Note, the interrupt moderation is shared resource on dual-port
  controllers so you can't use separate interrupt moderation value
  for each port. This means we can't stop interrupt moderation in
  driver stop routine. Also have msk_tick() reclaim transmitted Tx
  buffers as safety belt. With this change there is no need to check
  missing Tx completion interrupt in watchdog handler, so remove it.
2010-03-24 17:11:01 +00:00
Luigi Rizzo
7da98b8ab6 MFC 205602:
Honor ip.fw.one_pass when a packet comes out of a pipe without being delayed.
I forgot to handle this case when i did the mtag cleanup three months ago.

I am merging immediately because this bugfix is important for
people using RELENG_8.

PR:           145004
2010-03-24 15:19:47 +00:00
Luigi Rizzo
183fd3c950 MFC r200636, list all files needed to build the ipfw module
Submitted by:	Alexander Wittig
2010-03-24 15:11:10 +00:00
Konstantin Belousov
9e211e5715 MFC r204475:
Mark msdosfs as mpsafe.
2010-03-24 14:56:56 +00:00
Konstantin Belousov
3d9ee8abe2 MFC r204589:
Do not leak vnode lock when msdosfs mount is updated and specified
device is different from the device used to the original mount.
2010-03-24 14:53:28 +00:00
Konstantin Belousov
a8428ad0f1 MFC r204474:
Fix the race between dotdot lookup and forced unmount, by using
msdosfs-specific variant of vn_vget_ino(), msdosfs_deget_dotdot().

As was done for UFS, relookup the dotdot denode after the call to
msdosfs_deget_dotdot(), because vnode lock is dropped and directory
might be moved.

MFC r204675:
When returning error from msdosfs_lookup(), make sure that *vpp is NULL.
2010-03-24 14:50:04 +00:00
Konstantin Belousov
7825951721 MFC r204473:
Use pm_fatlock to protect per-filesystem rb tree used to allocate fileno
on the large FAT volumes.
2010-03-24 14:45:50 +00:00
Konstantin Belousov
255ca65791 MFC r204472:
Add assertions for FAT bitmap state.
2010-03-24 14:43:19 +00:00
Konstantin Belousov
05ecce0c28 MFC r204471:
Use pm_fatlock to protect fat bitmap.
2010-03-24 14:37:17 +00:00
Konstantin Belousov
3a141f45c5 MFC r204470:
Add per-mountpoint lockmgr lock for msdosfs.

MFC r204576:
Only destroy pm_fatlock on error if it was initialized.
2010-03-24 14:25:15 +00:00
Konstantin Belousov
670baf9dfe MFC r204469:
In msdosfs deget(), properly handle the case when the vnode is found in hash.
2010-03-24 14:18:10 +00:00
Konstantin Belousov
ac8743bcd3 MFC r204468:
In msdosfs_inactive(), reclaim the vnodes both for SLOT_DELETED and
SLOT_EMPTY deName[0] values.
2010-03-24 14:15:46 +00:00
Konstantin Belousov
b2c1c014b3 MFC r204467:
Remove seemingly unneeded unlock/relock of the dvp in msdosfs_rmdir,
causing LOR.
2010-03-24 14:13:27 +00:00
Konstantin Belousov
1a07617f97 MFC r204466:
Assert that the msdosfs vnode is (e)locked in several places.
Change the check and return on impossible condition into KASSERT().
2010-03-24 14:10:08 +00:00
Konstantin Belousov
99cb1f2430 MFC r204465:
Remove unused global statistic about fat cache usage.
2010-03-24 14:08:01 +00:00
Konstantin Belousov
2dec7615c6 MFC r204957:
Fall back to wbinvd when region for CLFLUSH is >= 2MB.

MFC r205334 (by avg):
Fix a typo in a comment.
2010-03-24 09:45:17 +00:00
Pyun YongHyeon
065ee77712 MFC r204378:
Add TSO support on VLANs. While I'm here remove unnecessary check
  of VLAN hardware checksum offloading. vlan(4) already takes care of
  this.
2010-03-23 22:22:26 +00:00
Pyun YongHyeon
14b52a7e1c MFC r204377:
Add TSO support on VLANs. While I'm here remove unnecessary check
  of VLAN hardware checksum offloading. vlan(4) already takes care of
  this.
2010-03-23 22:19:27 +00:00
Pyun YongHyeon
7b575694a1 MFC r204376:
Disable TSO on BCM5755M controller until I understand better for
  the issue. I still have no idea why TSO does not work on this
  controller. davidch@ also confirmed there is no known TSO related
  issues for this controller.
2010-03-23 22:16:12 +00:00
Pyun YongHyeon
051ea6ca19 MFC r204373-204374:
r204373:
  Move TSO setup to new function bce_tso_setup(). Also remove VLAN
  parsing code in TSO path as the controller requires VLAN hardware
  tagging to make TSO work over VLANs.
  While parsing the mbuf in TSO patch, always perform check for
  writable mbuf as bce(4) have to reset IP length and IP checksum
  field of IP header and make sure to ensure contiguous buffer before
  accessing IP/TCP headers. While I'm here replace magic number 40 to
  more readable sizeof(struct ip) + sizeof(struct tcphdr).

r204374:
  Add TSO support on VLANs. bce(4) controllers require VLAN hardware
  tagging to make TSO work on VLANs so explicitly disable TSO on VLAN
  if VLAN hardware tagging is disabled.
2010-03-23 22:11:39 +00:00
Pyun YongHyeon
2634815492 MFC r204368,204370-204372:
r204368:
  Allow disabling VLAN hardware tag stripping with software work
  around. Management firmware(ASF/IPMI/UMP) requires the VLAN
  hardware tag stripping so don't actually disable VLAN hardware tag
  stripping. If VLAN hardware tag stripping was disabled, bce(4)
  manually reconstruct VLAN frame by appending stripped VLAN tag.
  Also remove unnecessary IFCAP_VLAN_MTU message.

r204370:
  Make sure to stop controller first before changing MTU. And if
  interface is not running don't initialize controller.
  While here remove unnecessary update of error variable.

r204371:
  Make toggling TSO, VLAN hardware checksum offloading work. Also fix
  TX/RX checksum handler to set/clear relavant assist bits which was
  used to cause unexpected results.
  With this change, bce(4) can be bridged with other interfaces that
  lack TSO, VLAN checksum offloading.

r204372:
  Prefer m_collapse(9) over m_defrag(9).
2010-03-23 22:04:18 +00:00
Pyun YongHyeon
5774c1ed84 MFC r204363,204365-204367,204539-204540:
r204363:
  Optimize inserting LE for TX checksum computation. Controller does
  not require checksum LE configuration if checksum start and write
  position is the same as before. So keep track last checksum start
  and write position and insert new LE whenever the position is
  changed. This reduces number of LEs used in TX path as well as
  slightly enhance TX performance.

r204365:
  Don't hardcod register offset to set PCIe max read request size.
  The register offset is not valid on 88E8072 controller. Also don't
  blindly increase max read request size to 4096, instead, use 2048
  which seems to be more sane value and only change the value if the
  hardware default size(512) was used on that register.
  For PCIX controllers, use system defined constant rather than using
  magic value.
  While I'm here stop showing negotiated link width.

r204366:
  Allocate single MSI message. msk(4) used to allocate 2 MSI messages
  for controllers like 88E8053 which reports two MSI messages.
  Because we don't get anything useful things with 2 MSI messages,
  allocating 1 MSI message would be more sane approach.
  While I'm here, enable MSI for dual-port controllers too. Because
  status block is shared for dual-port controllers, I don't think
  msk(4) will encounter problem for using MSI on dual-port
  controllers.

r204367:
  Remove trailing white spaces.

r204539:
  Properly sync status LEs after processing.

r204540:
  Make sure to enable flow-control only if established link is
  full-duplex. Previously msk(4) used to allow flow-control on
  1000baseT half-duplex media. Also GMAC pause is enabled if link
  partner is capable of handling it.
  While I'm here use IFM_OPTIONS instead of using IFM_GMASK to check
  optional flags of link.
2010-03-23 21:51:31 +00:00
Pyun YongHyeon
b951499f98 MFC r204361-204362:
r204361:
  Reuse the configured LE for VLAN if new LE was created for TSO.
  Only old controllers need to create new LE for TSO. This change
  makes TSO work over VLANs.

r204362:
  Add TSO support on VLANs. Controller requires VLAN hardware tagging
  to make TSO work over VLANs.
2010-03-23 21:38:25 +00:00
Pyun YongHyeon
061d3abfa8 MFC r204228,204230:
r204228:
  Add TSO support on VLANs. Also make sure to update TSO capability
  whenever jumbo frame is configured.
  While I'm here remove unnecessary check of VLAN hardware checksum
  offloading. vlan(4) already takes care of this.

r204230:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.
2010-03-23 19:41:43 +00:00
Pyun YongHyeon
ac8ed73502 MFC r204225:
Add TSO support on VLANs. jme(4) controllers do not require VLAN
  hardware tagging to make TSO work over VLANs.
2010-03-23 19:37:15 +00:00
Pyun YongHyeon
d95d4a8336 MFC r204155,204219:
r204155:
  Increase PCIe maximuim read request size to 2048. Because re(4) uses
  Tx DMA burst size 2048, I beleive PCIe maximum read request size
  also should match to the value of Tx DMA burst size. With this
  change I can get more than 800Mbps for TCP bulk transfers.
  Previously I was not able to get more than 700Mbps. If I enable TSO
  it now shows 927Mbps.

r204219:
  Add TSO on VLANs. Because re(4) has a TSO limitation for jumbo
  frame, make sure to update VLAN capabilities whenever jumbo frame
  is configured.
  While I'm here rearrange interface capabilities configuration. The
  controller requires VLAN hardware tagging to make TSO work on VLANs
  so explicitly check this requirement.
2010-03-23 19:30:15 +00:00
Pyun YongHyeon
60a337785e MFC r204151,204223:
r204151:
  Add TSO support on VLAN. Controller requires VLAN hardware tagging
  to make TSO work on VLAN. So if VLAN hardware tagging is disabled
  explicitly clear TSO on VLAN. While I'm here remove duplicated
  VLAN_CAPABILITIES call.

r204223:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.
  While I'm here make sure to pullup IP/TCP headers in the first
  buffer.
2010-03-23 19:16:35 +00:00
Luigi Rizzo
8018e843a3 MFC of a large number of ipfw and dummynet fixes and enhancements
done in CURRENT over the last 4 months.
HEAD and RELENG_8 are almost in sync now for ipfw, dummynet
the pfil hooks and related components.

Among the most noticeable changes:
- r200855 more efficient lookup of skipto rules, and remove O(N)
  blocks from critical sections in the kernel;
- r204591 large restructuring of the dummynet module, with support
  for multiple scheduling algorithms (4 available so far)
See the original commit logs for details.

Changes in the kernel/userland ABI should be harmless because the
kernel is able to understand previous requests from RELENG_8 and
RELENG_7. For this reason, this changeset would be applicable
to RELENG_7 as well, but i am not sure if it is worthwhile.
2010-03-23 09:58:59 +00:00
Pyun YongHyeon
9832320129 MFC r204156:
Add __FBSDID.
2010-03-22 23:23:47 +00:00
Hiroki Sato
7fe6975097 MFC r203272:
- Fix a bug when adding an interface with an invalid MTU sets the
  bridge's MTU if it is the firstly-added one while the addition
  itself fails.

- Allow SIOCSIFMTU only when all members have the same MTU.

- Remove IFT_GIF check when defining the brige MTU by the
  firstly-added interface's one.  The MTU of the gif interface
  has to be the same as the bridge's one.
2010-03-22 22:07:19 +00:00
Jung-uk Kim
a0bc6d1ca6 MFC: r205223
Fix a long standing regression of readdir(3) in fdescfs(5) introduced
in r1.48.  We were stopping at the first null pointer when multiple file
descriptors were opened and one in the middle was closed.  This restores
traditional behaviour of fdescfs.
2010-03-22 20:36:35 +00:00
Jung-uk Kim
1288863fa2 MFC: r205092
Tidy up callout for select(2) and read timeout.

- Add a missing callout_drain(9) before the descriptor deallocation.[1]
- Prefer callout_init_mtx(9) over callout_init(9) and let the callout
subsystem handle the mutex for callout function.

PR:		kern/144453
Submitted by:	Alexander Sack (asack at niksun dot com)[1]
2010-03-22 19:59:00 +00:00
Andrew Gallatin
accbb468d5 MFC 204212: Update mxge to support IFCAP_VLAN_HWTSO. 2010-03-22 14:50:08 +00:00
Andrew Gallatin
c6c73f9880 MFC 205255: Fix 2 bugs in mxge_attach() 2010-03-22 11:18:51 +00:00
Nathan Whitehorn
fca060b9f9 MFC r204297:
Move the OEA64 scratchpage to the end of KVA from the beginning, and set
its PVO to map physical address 0 instead of kernelstart. This fixes a
situation in which a user process could attempt to return this address
via KVM, have it fault while being modified, and then panic the kernel
because (a) it is supposed to map a valid address and (b) it lies in the
no-fault region between VM_MIN_KERNEL_ADDRESS and virtual_avail.

While here, move msgbuf and dpcpu back into regular KVA space for
consistency with other implementations.
2010-03-20 15:27:01 +00:00
Nathan Whitehorn
1f70273a79 MFC r204296:
Provide an implementation of pmap_dev_direct_mapped() on OEA64. This is
required in order to be able to mmap the running kernel, which is turn
required to avoid fstat returning gibberish.
2010-03-20 15:23:06 +00:00
Nathan Whitehorn
59908d2f72 MFC r204269:
Use dcbz instead of word stores for page zeroing, providing a factor of
3-4 speedup.
2010-03-20 15:21:13 +00:00