Commit Graph

166709 Commits

Author SHA1 Message Date
Hajimu UMEMOTO
525f4cadd0 Don't support OpenLDAP during lib32 build. 2011-12-06 12:03:01 +00:00
Konstantin Belousov
bd4632e6ca Force linker error when created shared library contains a relocation
against text. Provide the override switch to turn off the strict
behaviour. Apparently, openssl libcrypto needs it due to assembler
code not being PIC.

Discussed with:	bf
MFC after:	2 weeks
2011-12-06 11:28:17 +00:00
Konstantin Belousov
93c26de0ad Most users of pipe(2) do not call fstat(2) on the returned pipe descriptors.
Optimize for the case, by lazily allocating the pipe inode number at the
fstat(2) time. If alloc_unr(9) returns failure, do not fail fstat(2), since
uses of inode numbers are even rare then fstat(2), but provide zero inode
forever. Note that alloc_unr() failure is unlikely due to total number
of pipes in the system limited by the number of file descriptors.

Based on the submission by:	gianni
MFC after:	2 weeks
2011-12-06 11:24:03 +00:00
Alexander Motin
2266ba7b12 Mention that Cold Presence Detection feature used for hot-plug detection
when interface power management is enabled.
2011-12-06 09:12:11 +00:00
Hans Petter Selasky
e6ee4f7d33 Correct some bInterval USB template descriptor values.
MFC after:	3 days
2011-12-06 08:08:52 +00:00
Hans Petter Selasky
677034d566 Fix compile warning when using clang to compile the code.
Submitted by:	arundel @
MFC after:	3 days
2011-12-06 07:55:25 +00:00
Mikolaj Golub
9e94d5b83f Really protect kern.proc.ps_strings sysctls with p_candebug(). This
was intended to be in r228288.

Spotted by:	many
MFC after:	1 week
2011-12-06 06:40:14 +00:00
Peter Grehan
336f459c31 Catch up with Bryan Venteicher's virtio Hg repo:
c162516
  Remove vtblk_sector_size

c162515
  Wrap long license lines

c162514
  Remove vtblk_unit

c162513
  Wrap long lines in the license.

c162512
  Remove verbose messages when link goes up/down.

  A similar message is printed elsewhere as a result of
  if_link_state_change().

c162511
  Explicity compare pointer to NULL

c162510
  Allocate the mac filter table at attach time.

c162509
  Add real BSD licenses to the header files copied from Linux.

  The chases upstream changes made in Linux awhile ago.

c162508
  Only notify if we actually dequeued something.

c162507
  Change a couple of if () { KASSERT(...) } to just KASSERTs.

  In non-debug kernels, the if() { } probably get optomized
  away, but I guess this is clearer.

c162506
  Remove VIRTIO_BLK_F_TOPOLOGY fields in the config.

  TOPOLOGY has since been removed from the spec, and the FreeBSD
  didn't really do anything with the fields anyways.

c162505
  Move vtblk_enqueue_request() outside the locks when getting the ident.

c162504
  Remove soon to be uneeded trylock during dump [1].
  http://lists.freebsd.org/pipermail/freebsd-current/2011-November/029226.html

c162503
  Remove emtpy line

c162502
  Drop frame if cannot allocate a vtnet_tx_header.

  If we don't, we set OACTIVE, but if there are no
  other frames in flight, vtnet_txeof() will never
  be called to unset OACTIVE. The interface would
  have to be down/up'ed in order to become usable.

  We could be cuter here and only do this if the
  virtqueue is emtpy, but its probably not worth
  the complication.

c162501
  Start mbuf replacement loop at 1 for clarity

Obtained from:	Bryan Venteicher  bryanv at daemoninthecloset dot org
2011-12-06 06:28:32 +00:00
Pyun YongHyeon
a64788d1bc Make et_probe() return BUS_PROBE_DEFAULT such that allow other
driver that has high precedence for the controller override et(4).
Add missing callout_drain(9) in device detach and rework detach
routine.  While I'm here use rman_get_rid(9) instead of using
cached resource id because bus methods are free to change the
id.
2011-12-06 00:58:42 +00:00
Pyun YongHyeon
d2f7028c11 et(4) supports VLAN oversized frame so correctly set header length.
While I'm here remove initializing if_mtu, it is set by
ether_ifattach(9).  Also move callout_init_mtx(9) to the right below
driver lock initialization.
2011-12-06 00:18:37 +00:00
Pyun YongHyeon
c8b727ce77 Fix alt(4) support. Also add check for number of available TX
descriptors before trying to send frames.  If we're not able to
send a frame, make sure to prepend it to if_snd queue such that
alt(4) should work.

While I'm here prefer ETHER_BPF_MTAP to BPF_MTAP.  ETHER_BPF_MTAP
should be used for controllers that support VLAN hardware tag
insertion.  The controller supports VLAN tag insertion but lacks
VLAN tag stripping in RX path though.
2011-12-05 22:55:52 +00:00
Pyun YongHyeon
0442028aaf Implement suspend/resume methods. Driver has no issue with
suspend/resume.
2011-12-05 22:22:39 +00:00
Pyun YongHyeon
7ac1823956 Remove NetBSD license. r199548 removed all bit macros that were
derived from NetBSD.
2011-12-05 22:09:07 +00:00
Marius Strobl
ce0240c26f - In mii_attach(9) just set the driver for a newly added miibus(4) instance
before calling bus_enumerate_hinted_children(9) (which is the minimum for
  this to work) instead of fully probing it so later on we can just call
  bus_generic_attach(9) on the parent of the miibus(4) instance. The latter
  is necessary in order to work around what seems to be a bzzarre race in
  newbus affecting a few machines since r227687, causing no driver being
  probed for the newly added miibus(4) instance. Presumably this is the
  same race that was the motivation for the work around done in r215348.
  Reported and tested by: yongari
- Revert the removal of a static in r221913 in order to help compilers to
  produce more optimal code.
2011-12-05 21:38:45 +00:00
Mikolaj Golub
cc43fe5b46 Don't output a warning if kern.proc.auxv sysctl has returned EPERM.
After r228288 this is rather a normal situation.

MFC after:	1 week
2011-12-05 19:39:15 +00:00
Mikolaj Golub
c65932be9d Protect kern.proc.auxv and kern.proc.ps_strings sysctls with p_candebug().
Citing jilles:

If we are ever going to do ASLR, the AUXV information tells an attacker
where the stack, executable and RTLD are located, which defeats much of
the point of randomizing the addresses in the first place.

Given that the AUXV information seems to be used by debuggers only anyway,
I think it would be good to move it to p_candebug() now.

The full virtual memory maps (KERN_PROC_VMMAP, procstat -v) are already
under p_candebug().

Suggested by:	jilles
Discussed with:	rwatson
MFC after:	1 week
2011-12-05 19:34:02 +00:00
Alan Cox
c68c35372e Introduce vm_reserv_alloc_contig() and teach vm_page_alloc_contig() how to
use superpage reservations.  So, for the first time, kernel virtual memory
that is allocated by contigmalloc(), kmem_alloc_attr(), and
kmem_alloc_contig() can be promoted to superpages.  In fact, even a series
of small contigmalloc() allocations may collectively result in a promoted
superpage.

Eliminate some duplication of code in vm_reserv_alloc_page().

Change the type of vm_reserv_reclaim_contig()'s first parameter in order
that it be consistent with other vm_*_contig() functions.

Tested by:	marius (sparc64)
2011-12-05 18:29:25 +00:00
Pyun YongHyeon
e9d7727e6b Fix off by one error in mbuf access. Previously it caused panic.
While I'm here use NULL to compare mbuf pointer and add additional
check for zero length mbuf before accessing the mbuf.

PR:	kern/162932
2011-12-05 18:10:43 +00:00
Hajimu UMEMOTO
782ed6d3d7 - Make heimdal buildable with WITH_OPENLDAP defined, again.
- Our heimdal uses the deprecated OpenLDAP functions.
2011-12-05 16:38:52 +00:00
Ed Schouten
b66c0c3405 Get rid of kludgy per-descriptor state handling in acpi_apm.
Where i386/bios/apm.c requires no per-descriptor state, the ACPI version
of these device do. Instead of using hackish clone lists that leave
stale device nodes lying around, use the cdevpriv API.
2011-12-05 16:08:18 +00:00
Luigi Rizzo
579a6e3c4e add netmap support for "em", "lem", "igb" and "re".
On my hardware, "em" in netmap mode does about 1.388 Mpps
on one card (on an Asus motherboard), and 1.1 Mpps on another
card (PCIe bus). Both seem to be NIC-limited, because
i have the same rate even with the CPU running at 150 MHz.

On the "re" driver the tx throughput is around 420-450 Kpps
on various (8111C and the like) chipsets. On the Rx side
performance seems much better, and i can receive the full
load generated by the "em" cards.

"igb" is untested as i don't have the hardware.
2011-12-05 15:33:13 +00:00
Luigi Rizzo
02ad408380 revise the implementation of the rings connected to the host stack 2011-12-05 15:21:21 +00:00
John Baldwin
1b202316ec Use the correct volume identifier field when parsing MR_EVT_ARG_LD_STRIP
arguments.

MFC after:	2 weeks
2011-12-05 15:11:35 +00:00
Justin Hibbits
23ab37cb82 Fix style(9) issues from r228270.
Approved by:	nwhitehorn (mentor)
2011-12-05 14:13:21 +00:00
Luigi Rizzo
506cc70cce 1. Fix the handling of link reset while in netmap more.
A link reset now is completely transparent for the netmap client:
   even if the NIC resets its own ring (e.g. restarting from 0),
   the client will not see any change in the current rx/tx positions,
   because the driver will keep track of the offset between the two.

2. make the device-specific code more uniform across different drivers
   There were some inconsistencies in the implementation of the netmap
   support routines, now drivers have been aligned to a common
   code structure.

3. import netmap support for ixgbe . This is implemented as a very
   small patch for ixgbe.c (233 lines, 11 chunks, mostly comments:
   in total the patch has only 54 lines of new code) , as most of
   the code is in an external file sys/dev/netmap/ixgbe_netmap.h ,
   following some initial comments from Jack Vogel about making
   changes less intrusive.
   (Note, i have emailed Jack multiple times asking if he had
   comments on this structure of the code; i got no reply so
   i assume he is fine with it).

Support for other drivers (em, lem, re, igb) will come later.

"ixgbe" is now the reference driver for netmap support. Both the
external file (sys/dev/netmap/ixgbe_netmap.h) and the device-specific
patches (in sys/dev/ixgbe/ixgbe.c) are heavily commented and should
serve as a reference for other device drivers.

Tested on i386 and amd64 with the pkt-gen program in tools/tools/netmap,
the sender does 14.88 Mpps at 1050 Mhz and 14.2 Mpps at 900 MHz
on an i7-860 with 4 cores and 82599 card. Haven't tried yet more
aggressive optimizations such as adding 'prefetch' instructions
in the time-critical parts of the code.
2011-12-05 12:06:53 +00:00
Kevin Lo
2b69bb1f27 Add a missing curly bracket 2011-12-05 10:34:52 +00:00
Eitan Adler
0a79dbc6b5 Fix some uninitialized variables in pipe regression tests that result in
failure.

PR:		misc/161175
Submitted by:	gianni@
Approved by:	nwhitehorn@
MFC after:	1 week
2011-12-05 04:20:13 +00:00
Jayachandran C.
d42a1129cb Disable KDB/DDB options for XLP N32 compile.
n32 abi is not supported in KDB/DDB yet, disable the option in
XLPN32 conf.

Reported by:	gonzo, bz
2011-12-05 03:18:40 +00:00
Jayachandran C.
6e065b1baa Fix N32 compilation again for XLP.
Disable DDB/KDB related options for N32, and add back a cast that was
lost during the last set of updates.

Reported by:	gonzo, bz
2011-12-05 03:10:01 +00:00
Jayachandran C.
b10ea0872a Fix XLP compilation.
Add definitions of LSU_DEBUG_ADDR and LSU_DEBUG_DATA0, the code that uses
it was added in r227799

Reported by:	gonzo
2011-12-05 02:56:08 +00:00
Justin Hibbits
6431ede397 Add a devd notification for closing/opening the lid on PowerBooks and iBooks.
Approved by:	nwhitehorn (mentor)
2011-12-05 00:12:10 +00:00
Jilles Tjoelker
54ad8a62ed libc: Eliminate 13 relative relocations in wctype(). 2011-12-05 00:00:47 +00:00
Mikolaj Golub
022eba3410 Protect process environment variables with p_candebug().
Discussed with:	jilles, kib, rwatson
MFC after:	2 weeks
2011-12-04 21:43:13 +00:00
Andriy Gapon
a3295a8b09 zfsboot: print boot.config contents before parsing it
as parsing can be a destructive operation

MFC after:	2 weeks
2011-12-04 21:32:18 +00:00
Andriy Gapon
05b096ff61 zfs boot: allow file vdevs to be used in testing (e.g. with zfsboottest)
MFC after:	1 week
2011-12-04 21:29:56 +00:00
Andriy Gapon
5e27a60372 critical_exit: ignore td_owepreempt if kdb_active is set
calling mi_switch in such a context results in a recursion via
kdb_switch

Suggested by:	jhb
Reviewed by:	jhb
MFC after:	5 weeks
2011-12-04 21:27:41 +00:00
Mikolaj Golub
0f60ecdaa4 In sysctl_kern_proc_ps_strings() there is no much sense in checking
for P_WEXIT and P_SYSTEM flags.

Reviewed by:	kib
2011-12-04 21:24:01 +00:00
Konstantin Belousov
d8e8af3166 Initialize fifoinfo fi_wgen field on open. The only important is the
difference between fi_wgen and f_seqcount, so the change is purely
cosmetic, but it makes the code easier to understand.

Submitted by:	gianni
MFC after:	2 weeks
2011-12-04 19:25:49 +00:00
Konstantin Belousov
97695ad4cd Use explicit information from the kernel to detect the traps due to
syscall entry and leave.

Based on submision by:	Dan Nelson <dnelson allantgroup com>
MFC after:	1 month
2011-12-04 18:43:09 +00:00
Rick Macklem
34f2e649d0 This patch adds a sysctl to the NFSv4 server which optionally disables the
check for a UTF-8 compliant file name. Enabling this sysctl results in
an NFSv4 server that is non-RFC3530 compliant, therefore it is not enabled
by default. However, enabling this sysctl results in NFSv3 compatible
behaviour and fixes the problem reported by "dan at sunsaturn.com"
to freebsd-current@ on Nov. 14, 2011 under the subject "NFSV4 readlink_stat".

Tested by:	dan at sunsaturn.com
Reviewed by:	zack
MFC after:	2 weeks
2011-12-04 16:33:04 +00:00
Jean-Sébastien Pédron
409139f051 Support domain-search in dhclient(8)
The "domain-search" option (option 119) allows a DHCP server to publish
a list of implicit domain suffixes used during name lookup. This option
is described in RFC 3397.

For instance, if the domain-search option says:
    ".example.org .example.com"
and one wants to resolve "foobar", the resolver will try:
    1. "foobar.example.org"
    2. "foobar.example.com"

The file /etc/resolv.conf is updated with a "search" directive if the
DHCP server provides "domain-search".

A regression test suite is included in this patch under
tools/regression/sbin/dhclient.

PR:		bin/151940
Sponsored by	Yakaz (http://www.yakaz.com)
2011-12-04 14:44:31 +00:00
Adrian Chadd
935225501b Modify the GPIO i2c bus code to allow for arbitrary data/clock
pins, rather than defaulting to 0 and 1.

This way the pin order can be reversed.  It is reversed with the
TP-Link TL-WR1043nd.

Submitted by:	Stefan Bethke <stb@lassitu.de>
2011-12-04 12:10:24 +00:00
Adrian Chadd
9844b3b3ab Allow the i2c node requirements to be slightly relaxed.
These realtek switch PHYs speak a variant of i2c with some slightly
modified handling.

From the submitter, slightly modified now that some further digging
has been done:

  The I2C framework makes a assumption that the read/not-write bit of the first
  byte (the address) indicates whether reads or writes are to follow.

  The RTL8366 family uses the bus: after sending the address+read/not-write byte,
  two register address bytes are sent, then the 16-bit register value is sent
  or received.  While the register write access can be performed as a 4-byte
  write, the read access requires the read bit to be set, but the first two bytes
  for the register address then need to be transmitted.

This patch maintains the i2c protocol behaviour but allows it to be relaxed
(for these kinds of switch PHYs, and whatever else Realtek may do with this
almost-but-not-quite i2c bus) - by setting the "strict" hint to 0.
The "strict" hint defaults to 1.

Submitted by:	Stefan Bethke <stb@lassitu.de>
2011-12-04 11:55:33 +00:00
Ed Maste
c3369741c2 Add quirk for Micron RealSSD eUSB failing on unsupported SCSI command
It appears this device fails if sent a SYNCHRONIZE_CACHE command, so add
quirk to avoid sending it.

I will follow up with Micron on this issue, and will adjust the quirk if
necessary based on their feedback.

Reviewed by:	hselasky@
2011-12-03 19:56:52 +00:00
Hans Petter Selasky
3f709d07c5 Simplify libusb_open_device_with_vid_pid(): Only set
pdev to non-NULL on success instead of unconditonally
setting it and maybe resetting it later.

Submitted by:	Christoph Mallon
MFC after:	3 days
2011-12-03 16:30:47 +00:00
Hans Petter Selasky
dc93480306 libusb_open() sets the given device handle to NULL if it
fails, so there is no need to do it again after returning.

Submitted by:	Christoph Mallon
MFC after:	3 days
2011-12-03 16:19:07 +00:00
Hans Petter Selasky
494b6fec82 Make sure the description of pause() is
equivalent to its implementation.
No code change.

Suggested by:	Bruce Evans
MFC after:	3 days
2011-12-03 15:51:15 +00:00
Eitan Adler
f565f395c6 - Fix typos s/(more|less) then|\1 than/
Submitted by:	Davide Italiano <davide.italiano@gmail.com>
Approved by:	brucec
MFC after:	3 days
2011-12-03 15:41:37 +00:00
Hans Petter Selasky
87812fcec3 Fix a compile warning with clang.
Reported by:	arundel @
MFC after:	3 days
2011-12-03 14:54:44 +00:00
Justin Hibbits
66e96554af Add myself to the relevant doc files.
Approved by:	nwhitehorn (mentor)
2011-12-03 14:03:53 +00:00