Commit Graph

75302 Commits

Author SHA1 Message Date
Konstantin Belousov
bbf7989245 MFC r206546:
Remove XXX comment. Add another comment, describing why f_vnode assignment
is useful.
2010-04-16 08:32:08 +00:00
Rick Macklem
4e76f29635 MFC: r206063
For the experimental NFS server, add a call to free the lookup
path buffer for one case where it was missing when doing mkdir.
This could have conceivably resulted in a leak of a buffer, but
a leak was never observed during testing, so I suspect it would
have occurred rarely, if ever, in practice.
2010-04-16 02:16:58 +00:00
Kevin Lo
e83c1c9d1e MFC r206595
Eliminate duplicate comment
2010-04-16 01:54:47 +00:00
Kevin Lo
499a07ef68 MFC r206544
The Quanta Q101 modem has a different type of cdrom driver disk,
add the product id and use a standard scsi eject.

Reviewed by:	thompsa
2010-04-16 01:53:19 +00:00
Rick Macklem
2d2fef10c5 MFC: r206061
Add SAVENAME to the cn_flags for all cases in the experimental
NFS server for the CREATE cn_nameiop where SAVESTART isn't set.
I was not aware that this needed to be done by the caller until
recently.
2010-04-16 01:39:30 +00:00
Pyun YongHyeon
fa7ad760a6 MFC r206268
- Fixed 5708S 2.5G support broken in last commit.
  - Added some new debug helper routines to systcl.
  - Fixed many of the style(9) violations that have crept into the code
    due to my use of a "smart" editor.
2010-04-15 19:29:56 +00:00
Pyun YongHyeon
9c89e97770 MFC r205300:
- Added support for 5709S/5716S PHYs.
  - Update copyright to 2010.
  - Add new debug code for RV2P block.
  - Improve output formatting for various debug functions.

  PR:	kern/134658, kern/136417, kern/139761, kern/140970
2010-04-15 19:26:28 +00:00
Pyun YongHyeon
679953c6bd MFC r205299:
- Added support for 5709S/5716S PHYs.

  Submitted by: pyunyh
  PR:	kern/134658, kern/136417, kern/139761, kern/140970
2010-04-15 19:19:59 +00:00
Alexander Motin
d9b0781af8 MFC r206021, r206032, r206049, r206050:
Remove some more alignment constraints.
2010-04-15 12:46:16 +00:00
Alexander Motin
a35d181273 MFC r206017:
Make ng_ksocket fulfill lower protocol stack layers alignment requirements
on platforms with strict alignment constraints.
This fixes kernel panics on arm and probably other architectures.

PR:             sparc64/80410, sparc/118932, sparc/113556
2010-04-15 12:41:36 +00:00
Alexander Motin
b7261229f9 MFC r206015:
Make ng_l2tp irrelevant to data alignment.
2010-04-15 12:40:02 +00:00
Alexander Motin
f1725d1c1c NFC r206000:
Make ng_ppp fulfill upper protocol stack layers alignment requirements
on platforms with strict alignment constraints.
This fixes kernel panics on arm and probably other architectures.

PR:             sparc64/80410, sparc/118932, sparc/113556
2010-04-15 12:38:55 +00:00
Alexander Motin
48e700702f MFC r206053, r206054:
Fill extended ATA command registers in cPRD to support 48bit commands.
2010-04-15 12:30:46 +00:00
Alexander Motin
fec9df653c MFC r205967:
Include opt_ata.h, as some structures here depending on ATA_CAM option.
This fixes ATA_CAM with atamvsata and probably some other drivers.
2010-04-15 12:26:24 +00:00
Alexander Motin
b1a034ef8e MFC r205680:
Use last 16 bytes of serial number in metadata instead of first ones,
same as Intel MatrixRAID does.

PR:             kern/124064
2010-04-15 12:20:13 +00:00
Konstantin Belousov
b754ab83bc MFC r206395:
Do not leak master pty or ptmx vnode.
2010-04-15 08:17:28 +00:00
Justin T. Gibbs
060c98cc06 MFC 204214:
Enforce stronger bus-dma alignment semantics so bus-dma operates correctly
with Xen's blkfront driver.
2010-04-14 17:01:29 +00:00
Justin T. Gibbs
88b4fd072e MFC revision 205781:
Use standard types in preference to BSD types so that these header files
can be used in applications compiled with only POSIX types visible.
2010-04-14 16:37:34 +00:00
Alan Cox
311d363969 MFC r206409
Introduce the function kmem_alloc_attr(), which allocates kernel virtual
  memory with the specified physical attributes.

  Correct an error in the prototype for kmem_malloc().
2010-04-14 16:31:59 +00:00
John Baldwin
805de54cfc MFC 205886:
Defer freeing a kevent list until after dropping kqueue locks.
2010-04-14 15:33:15 +00:00
John Baldwin
f70ad5484f MFC 205536:
Reject attempts to create a MAP_ANON mapping with a non-zero offset.
2010-04-14 15:22:58 +00:00
John Baldwin
5f99d9e2ba MFC 205851:
Add a handler for the local APIC error interrupt.  For now it just prints
out the current value of the local APIC error register when the interrupt
fires.
2010-04-14 15:00:46 +00:00
Rick Macklem
066adacfb1 MFC: r205941
This patch should fix handling of byte range locks locally
on the server for the experimental nfs server. When enabled
by setting vfs.newnfs.locallocks_enable to non-zero, the
experimental nfs server will now acquire byte range locks
on the file on behalf of NFSv4 clients, such that lock
conflicts between the NFSv4 clients and processes running
locally on the server, will be recognized and handled correctly.
2010-04-14 03:13:02 +00:00
Pyun YongHyeon
f49339f5cd MFC r206436:
Consistently use capital letters.
2010-04-14 01:22:33 +00:00
Pyun YongHyeon
8451de87b9 MFC r206433:
Add preliminary support for 8168E/8111E PCIe controller.
  While I'm here simplify device description string.

  Tested by:	Michael Beckmann < michael <> apfel dot de >
2010-04-14 01:12:24 +00:00
Pyun YongHyeon
b9b10dc47b MFC r206364:
Partial revert r204545.
  Just relying on status LE ownership of status block seems to cause
  poor performance. Always read current status index register first
  and then check status ownership as we had before. Accessing status
  index register seems to trigger immediate status update if
  controller have pending status updates.

  Reported by:	Andre Albsmeier <Andre.Albsmeier <> siemens dot com>
  Tested by:	Andre Albsmeier <Andre.Albsmeier <> siemens dot com>
2010-04-14 00:50:18 +00:00
Konstantin Belousov
a0e70f3995 MFC r206459:
Handle a case when non-canonical address is loaded into the fsbase or
gsbase MSR.
2010-04-13 10:23:03 +00:00
Warner Losh
4bbe66c93f MFC 205838:
Mark the vtoc.h structure as packed so that it is the right size and
  layout on arm.

  MFC after:	7 days
2010-04-13 00:55:11 +00:00
Andriy Gapon
8eb59aff80 MFC r206128: ffs_mount: remove redundant assignment of to devvp.v_bufobj 2010-04-12 21:07:58 +00:00
Andriy Gapon
8d5ce86fd6 MFC r206098: mountmsdosfs: reject too high value of bytes per cluster 2010-04-12 20:53:17 +00:00
Jaakko Heinonen
e3359a8c1a MFC r205385:
Escape characters unsafe for XML output in GEOM class, instance and
provider names.

- Characters in range 0x01-0x1f except '\t', '\n', and '\r' are replaced
  with '?'. Those characters are disallowed in XML.
- '&', '<', '>', '\'', '"' and characters in range 0x7f-0xff are
  replaced with XML numeric character reference.

If the kern.geom.confxml sysctl provides invalid XML, libgeom
geom_xml2tree() fails and utilities using it do not work. Unsafe
characters are common in msdosfs and cd9660 labels.

PR:		kern/104389
2010-04-10 14:28:58 +00:00
Konstantin Belousov
f2c7b98632 MFC r206094:
Supply default implementation of VOP_RENAME() that does neccessary
unlocks and unreferences for argument vnodes, as expected by
kern_renameat(9), and returns EOPNOTSUPP. This fixes locks and
reference leaks when rename is attempted on fs that does not
implement rename.
2010-04-09 08:45:30 +00:00
Konstantin Belousov
bb9a8424a3 MFC r206093:
Add function vop_rename_fail(9) that performs needed cleanup for locks
and references of the VOP_RENAME(9) arguments. Use vop_rename_fail()
in deadfs_rename().
2010-04-09 08:39:28 +00:00
Alan Cox
55146b83de MFC r206174
vm_reserv_alloc_page() should never be called on an OBJT_SG object, just
  as it is never called on an OBJT_DEVICE object.  (This change should have
  been included in r195840.)
2010-04-09 06:40:30 +00:00
Rick Macklem
5b41805237 MFC: r205663
Patch the experimental NFS server in a manner analagous to r205661
for the regular NFS server, to ensure that ESTALE is
returned to the client for all errors returned by VFS_FHTOVP().
2010-04-09 01:33:12 +00:00
Rick Macklem
ae4539db79 MFC: r205661
Patch the regular NFS server so that it returns ESTALE to the client
for all errors returned by VFS_FHTOVP(). This is required to ensure
that EIO doesn't get returned to the client when ZFS is used as the
server file system.
2010-04-09 01:14:39 +00:00
Matt Jacob
f264739949 This is an MFC of 206029
Add a couple missing basic mode page codes.
2010-04-08 18:33:35 +00:00
Xin LI
e546195f07 MFC r204901
Remove the check for IFF_DRV_OACTIVE right before adding a port into lagg
interface.  The check itself seems to be coming from OpenBSD but does not
seem to be useful for our code.

Discussed with:	thomasa
2010-04-08 00:52:28 +00:00
Matt Jacob
81b67791ee This is an MFC of 205993
For unhandled actions in xpt_action_default, remember to call
xpt_done for queued requests. This solves the problem of
indefinite hangs for unspecified transports when XPT_SCAN_BUS
is called.

A few minor cosmetics elsewhere.
2010-04-07 17:58:29 +00:00
Rick Macklem
0bbe1d9baa MFC: r205572
Fix the experimental NFS subsystem so that it uses the correct
preprocessor macro name for not requiring strict data alignment.
2010-04-07 15:19:52 +00:00
Rui Paulo
0a62815524 MFC r205986:
Constify vap argument of ieee80211_{note,discard}* functions.
2010-04-07 14:59:07 +00:00
Konstantin Belousov
548ce22832 Regen. 2010-04-07 14:53:49 +00:00
Konstantin Belousov
7f67bb1b41 MFC r205327:
Remove empty line.
2010-04-07 14:52:42 +00:00
Konstantin Belousov
36131b48ed MFC r205326:
Convert aio syscall registration to SYSCALL_INIT_HELPER.
2010-04-07 14:50:58 +00:00
Konstantin Belousov
048575ee75 MFC r205325:
Implement compat32 shims for mqueuefs.
2010-04-07 14:49:35 +00:00
Konstantin Belousov
0aab10e1a8 MFC r205324:
Implement compat32 shims for ksem syscalls.
2010-04-07 14:47:55 +00:00
Konstantin Belousov
db5805dded MFC r205323:
Move SysV IPC freebsd32 compat shims from freebsd32_misc.c to corresponding
sysv_{msg,sem,shm}.c files.

Mark SysV IPC freebsd32 syscalls as NOSTD and add required
SYSCALL_INIT_HELPER/SYSCALL32_INIT_HELPERs to provide auto
register/unregister on module load.

This makes COMPAT_FREEBSD32 functional with SysV IPC compiled and loaded
as modules.
2010-04-07 14:46:28 +00:00
Konstantin Belousov
4ad2ce357a MFC r205322:
Move SysV IPC freebsd32 compat shims helpers from freebsd32_misc.c to
sysv_ipc.c.
2010-04-07 14:35:09 +00:00
Konstantin Belousov
0272ddd8bb MFC r205321:
Introduce SYSCALL_INIT_HELPER and SYSCALL32_INIT_HELPER macros and
neccessary support functions to allow registering dynamically loaded
syscalls from the MOD_LOAD handlers. Helpers handle registration
failures semi-automatically.
2010-04-07 14:28:47 +00:00
Konstantin Belousov
ba4a8a92d1 MFC r205320:
For SYSCALL_MODULE_HELPER, use "sys/<syscallname>" module name.
For SYSCALL32_MODULE_HELPER, use "sys32/<syscallname>" module name.
This avoids modules name conflict when compat32 syscall does not
need shims.
2010-04-07 14:22:38 +00:00
Konstantin Belousov
9fb7bf5584 MFC r205318:
Properly handle compat32 calls to sctp generic sendmsd/recvmsg functions that
take iov.
2010-04-07 14:16:14 +00:00
Konstantin Belousov
6283dea5ca MFC r205319:
Make freebsd32_copyiniov() available outside of freebsd32_misc.
2010-04-07 14:09:29 +00:00
Luigi Rizzo
54d63d7b13 add priority scheduler. 2010-04-07 13:18:58 +00:00
Luigi Rizzo
7b3c0af43e fix breakage in ipfw removal. 2010-04-07 12:42:49 +00:00
Nathan Whitehorn
b47065d16d Regen after MFC of COMPAT_FREEBSD32. 2010-04-07 02:25:36 +00:00
Nathan Whitehorn
4ccf64eb2b MFC r205014,205015:
Provide groundwork for 32-bit binary compatibility on non-x86 platforms,
for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32
option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts
of the kernel and enhances the freebsd32 compatibility code to support
big-endian platforms.

This MFC is required for MFCs of later changes to the freebsd32
compatibility from HEAD.

Requested by:	kib
2010-04-07 02:24:41 +00:00
Andrew Thompson
464b64f6c8 MFC r205036
Implement USB kernel driver detach from userland.

Submitted by:	Hans Petter Selasky
2010-04-07 00:32:59 +00:00
Andrew Thompson
fb8f1e2afc MFC r205681
- add some usb devices (scanner, printer, usb storage)
 - add quirks for the usb storage
2010-04-07 00:30:25 +00:00
Andrew Thompson
3769678a82 MFC r203087
adds sysctl knobs to show rate statistics that it could be useful to
 debug slow TX speed.
2010-04-07 00:27:59 +00:00
Andrew Thompson
1e6c93d364 MFC r202609
Product ID of D-Link DWA-120 after loading the firmware is incorrect.
2010-04-07 00:26:39 +00:00
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