Commit Graph

5938 Commits

Author SHA1 Message Date
Gavin Atkinson
3a911eccaa MFC r200587:
ifconfig(8) is documented to take a ISO 3166-1 country code to set the
  regulatory domain with the "country" parameter, but will also take a full
  country name.  The man page warns that only the ISO code is unambiguous.
  In reality, however, the first match on either would be accepted, leading
  to "DE" being interpreted as the "DEBUG" country rather than Germany, and
  "MO" selecting Morocco rather than the correct country, Macau.

  Fix this by always checking for an ISO CC match first, and only search on
  the full country name if that fails.

PR:		bin/140571
Tested by:	Dirk Meyer dirk.meyer dinoex.sub.org
Reviewed by:	sam
Approved by:	ed (mentor, implicit)
2010-01-16 15:00:35 +00:00
Alexander Motin
5ae425f88a MFC r201658:
Increase default block size from 4K to 64K. It was reduces 6 yeard ago,
when trees were big and FAST mode was enabled by default.

So small block size doesn't benefits linear I/O operations in FAST and
significantly slowdowns in ECONOMIC (default) mode. For single stream random
I/Os so small block doesn't give much benefits, as access time is usually
bigger then transfer time there. Same time it requires all heads to seek
together for every single request, reducing performance on parallel load.
2010-01-15 23:52:31 +00:00
Konstantin Belousov
847d100007 MFC r201400:
Remove reference to the bug in FreeBSD 2.0.
2010-01-05 12:34:16 +00:00
Alexander Motin
71e7360ed9 MFC r200171, r200182, r200275, r200295, r200359:
Introduce ATA_CAM kernel option, turning ata(4) controller drivers into
cam(4) interface modules. When enabled, this option deprecates all ata(4)
peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers
(ada, cd, ...) and interfaces to be natively used instead.

As side effect of this, ata(4) mode setting code was completely rewritten
to make controller API more strict and permit above change. While doing
this, SATA revision was separated from PATA mode. It allows DMA-incapable
SATA devices to operate and makes hw.ata.(ata|atapi)_dma tunable work again.

Also allow ata(4) controller drivers (except some specific or broken ones)
to handle larger data transfers. Previous constraint of 64K was artificial
and is not really required by PCI ATA BM specification or hardware.

Submitted by:   nwitehorn (powerpc part)
2009-12-12 10:37:31 +00:00
Alexander Motin
1fea06a081 MFC r200282, r200290:
Change gmirror default balance algorithm from "split" to improved "load".
"split" is very ineffective for devices with rotating media as HDDs.
To be effective, it needs that transfer time reduction due to block
splitting was bigger then access time increase due to non-sequential
access. For modern HDDs I was able to reproduce it only with read sizes
of 2MB and above, which is almost not applicable in real life.
"load" algorithm same time is more universal and effective now.
2009-12-10 23:51:24 +00:00
Alexander Motin
b6eb79852e MFC r197044:
Actually component with the greatest priority is used by the prefer balance
algorithm.
2009-12-10 23:46:37 +00:00
Alexander Motin
e99e819fed MFC r196879:
Add support for changing providers priority.
2009-12-08 23:15:48 +00:00
Hiroki Sato
28769e8539 MFC:
r197138:
- The ifconfig(8) command now supports NDP flags which are handled by ndp(8).

r198006:
- Use printb() to display the "nd6 options=" line.
2009-12-07 06:05:36 +00:00
Luigi Rizzo
3a5ce93470 mfc r200056
use qsort_r instead of heapsort;
  staticize two functions.
2009-12-06 19:01:33 +00:00
Alexander Motin
ab4ca9d195 MFC r199644:
Add some missing WDMA/UDMA modes.
2009-12-02 12:26:26 +00:00
Alexander Motin
06a7b83b5e MFC r199822:
Drop USB mass storage devices support from ata(4). It is out of the build as
long as I remember, and completely superseded by better maintained umass(4).
It's main idea was to optionally avoid CAM dependency for such devices, but
with move ATA to CAM, it is not actual any more.

No objections:  hselasky@, thompsa@, arch@
2009-12-02 10:47:11 +00:00
Alexander Motin
03b5c37446 MFC r199747, r199799, r199821:
- Extend XPT-SIM transfer settings control API. Now it allows to report to
SATA SIM number of tags supported by each device, implement ATA mode and
SATA revision negotiation for both SATA and PATA SIMs.
- Make ahci(4) and siis(4) to use submitted maximum tag number, when
scheduling requests. It allows to support NCQ on devices with lower tags
count then controller supports.
- Make PMP driver to report attached devices connection speeds.
- Implement ATA mode negotiation between user settings, device and
controller capabilities.
- Improve ATA mode/SATA revision control.
2009-12-02 10:32:34 +00:00
Alexander Leidinger
f48f29ede9 MFC r199626:
Fix minor resource leak in a function.

  Reviewed by:        luigi
2009-12-01 12:35:51 +00:00
Alexander Leidinger
96b404c963 MFC r199584:
Fix minor memory leak in a function.
2009-11-27 10:55:28 +00:00
Alexander Leidinger
9f69cbc0cb MFC r199582:
Fix minor resource leak in a function which was introduced by changing an
  err() to a return in r106254.
2009-11-27 10:53:46 +00:00
Jaakko Heinonen
0996e132ae MFC r198491:
Fix parsing of mount options specified with -o in case an option with
value is preceded by an option without value (for example -o
option1,option2=value). Options must be separated before searching for
'='. Also compare pnextopt explicitly against NULL.

PR:		bin/134069
Approved by:	trasz (mentor)
2009-11-26 18:14:03 +00:00
Alexander Motin
0b0242c67c MFC r199079, r199101:
Add support for ATA Power Management.
2009-11-17 21:17:22 +00:00
Alexander Motin
a60c326522 MFC r198897:
- Add support for sector size > 512 bytes and physical sector of several
logical sectors, introduced by ATA-7 specification.
- Remove some obsoleted code.
2009-11-17 21:08:12 +00:00
Alexander Motin
0cfcf828a9 MFC r198709:
Sync connection speed reporting with kernel.
Report speed in identify command, same as done by inquiry.
2009-11-17 20:45:49 +00:00
Alexander Motin
6b1f25ce56 MFC r197545:
Fethch more information from IDENTIFY result.
2009-11-17 19:52:51 +00:00
Alexander Motin
446b7f18f0 MFC r197419:
Reduce code duplication.
2009-11-17 19:51:39 +00:00
John Baldwin
9ad2d73695 MFC 198820:
Ensure 'kvm' is always initialized.  If "-M" was not specified and the
garbage value on the stack was not zero, then 'ddb capture' would try to
use the garbage value as a kvm_t pointer.
2009-11-17 15:28:14 +00:00
John Baldwin
8892395181 MFC 198585:
When extracting the capture buffer from a crashdump, only read the valid
portion of the capture buffer.
2009-11-04 16:03:47 +00:00
Philip Paeps
1ca0e46fdf MFC r198352
Make dhclient use bootpc (68) as the source port for unicast
  DHCPREQUEST packets instead of allowing the protocol stack to pick
  a random source port.

  This fixes the behaviour where dhclient would never transition
  from RENEWING to BOUND without going through REBINDING in networks
  which are paranoid about DHCP spoofing, such as most mainstream
  cable-broadband ISP networks.

Obtained from:	OpenBSD
Reviewed by:	brooks
Approved by:	re (kib)
2009-10-23 14:43:17 +00:00
Rui Paulo
596646aee5 MFC 197975, 197977, 197980, 198027:
Update for latest 802.11s changes in meshconf format.

Approved by:	re (kib)
2009-10-17 13:42:23 +00:00
Rick Macklem
7a8a559822 MFC r197298:
Change the default transport protocol for use by the Mount protocol
and the NFS Null RPC done by mount_nfs from UDP to TCP, so that it is
consistent with the kernel, which already uses NFS over TCP by
default. Without this change, doing an NFS mount
against a server that only supports UDP results in an unusable
mount point if a transport protocol option wasn't specified for the
mount.

Approved by:	re (kib)
2009-10-15 19:50:00 +00:00
Hiroki Sato
b509d7d489 MFC r197142:
Document accept_rev_ethip_ver and send_rev_ethip_ver flags of
EtherIP (gif(4) + if_bridge(4)).

Approved by:	re (kib)
2009-10-12 21:08:38 +00:00
Christian Brueffer
225cdb4e6c MFC: r197312
Fix setfib(1) section number.

Approved by:	re (kib)
2009-10-09 13:52:49 +00:00
Christian Brueffer
9281cc517f MFC: r197275
Fix an xref.

Approved by:	re (kib)
2009-10-09 13:31:36 +00:00
Christian Brueffer
02704da213 MFC: r197274
Fix the example, -w is the right switch for write failure probability.

Approved by:	re (kib)
2009-10-09 13:25:45 +00:00
Pawel Jakub Dawidek
18713ab672 MFC r196456,r196457,r196458,r196662,r196702,r196703,r196919,r196927,r196928,
r196943,r196944,r196947,r196950,r196953,r196954,r196965,r196978,r196979,
r196980,r196982,r196985,r196992,r197131,r197133,r197150,r197151,r197152,
r197153,r197167,r197172,r197177,r197200,r197201:

r196456:
- Give minclsyspri and maxclsyspri real values (consulted with kmacy).
- Honour 'pri' argument for thread_create().

r196457:
Set priority of vdev_geom threads and zvol threads to PRIBIO.

r196458:
- Hide ZFS kernel threads under zfskern process.
- Use better (shorter) threads names:
	'zvol:worker zvol/tank/vol00' -> 'zvol tank/vol00'
	'vdev:worker da0' -> 'vdev da0'

r196662:
Add missing mountpoint vnode locking.
This fixes panic on assertion with DEBUG_VFS_LOCKS and vfs.usermount=1 when
regular user tries to mount dataset owned by him.

r196702:
Remove empty directory.

r196703:
Backport the 'dirtying dbuf' panic fix from newer ZFS version.

Reported by:	Thomas Backman <serenity@exscape.org>

r196919:
bzero() on-stack argument, so mutex_init() won't misinterpret that the
lock is already initialized if we have some garbage on the stack.

PR:	kern/135480
Reported by:	Emil Mikulic <emikulic@gmail.com>

r196927:
Changing provider size is not really supported by GEOM, but doing so when
provider is closed should be ok.
When administrator requests to change ZVOL size do it immediately if ZVOL
is closed or do it on last ZVOL close.

PR:	kern/136942
Requested by:	Bernard Buri <bsd@ask-us.at>

r196928:
Teach zdb(8) how to obtain GEOM provider size.

PR:	kern/133134
Reported by:	Philipp Wuensche <cryx-freebsd@h3q.com>

r196943:
- Avoid holding mutex around M_WAITOK allocations.
- Add locking for mnt_opt field.

r196944:
Don't recheck ownership on update mount. This will eliminate LOR between
vfs_busy() and mount mutex. We check ownership in vfs_domount() anyway.

Noticed by:	kib
Reviewed by:	kib

r196947:
Defer thread start until we set priority.

Reviewed by:	kib

r196950:
Fix detection of file system being shared. Now zfs unshare/destroy/rename
command will properly remove exported file systems.

r196953:
When snapshot mount point is busy (for example we are still in it)
we will fail to unmount it, but it won't be removed from the tree,
so in that case there is no need to reinsert it.

Reported by:	trasz

r196954:
If we have to use avl_find(), optimize a bit and use avl_insert() instead of
avl_add() (the latter is actually a wrapper around avl_find() + avl_insert()).
Fix similar case in the code that is currently commented out.

r196965:
Fix reference count leak for a case where snapshot's mount point is updated.

r196978:
Call ZFS_EXIT() after locking the vnode.

r196979:
On FreeBSD we don't have to look for snapshot's mount point,
because fhtovp method is already called with proper mount point.

r196980:
When we automatically mount snapshot we want to return vnode of the mount point
from the lookup and not covered vnode. This is one of the fixes for using .zfs/
over NFS.

r196982:
We don't export individual snapshots, so mnt_export field in snapshot's
mount point is NULL. That's why when we try to access snapshots over NFS
use mnt_export field from the parent file system.

r196985:
Only log successful commands! Without this fix we log even unsuccessful
commands executed by unprivileged users. Action is not really taken, but it is
logged to pool history, which might be confusing.

Reported by:	Denis Ahrens <denis@h3q.com>

r196992:
Implement __assert() for Solaris-specific code. Until now Solaris code was
using Solaris prototype for __assert(), but FreeBSD's implementation.
Both take different arguments, so we were either core-dumping in assert()
or printing garbage.

Reported by:	avg

r197131:
Tighten up the check for race in zfs_zget() - ZTOV(zp) can not only contain
NULL, but also can point to dead vnode, take that into account.

PR:	kern/132068
Reported by:	Edward Fisk <7ogcg7g02@sneakemail.com>, kris
Fix based on patch from:	Jaakko Heinonen <jh@saunalahti.fi>

r197133:
- Protect reclaim with z_teardown_inactive_lock.
- Be prepared for dbuf to disappear in zfs_reclaim_complete() and check if
  z_dbuf field is NULL - this might happen in case of rollback or forced
  unmount between zfs_freebsd_reclaim() and zfs_reclaim_complete().
- On forced unmount wait for all znodes to be destroyed - destruction can be
  done asynchronously via zfs_reclaim_complete().

r197150:
There is a bug where mze_insert() can trigger an assert() of inserting
the same entry twice. This bug is not fixed yet, but leads to situation
where when try to access corrupted directory the kernel will panic.
Until the bug is properly fixed, try to recover from it and log that it
happened.

Reported by:	marck
OpenSolaris bug:	6709336

r197151:
Be sure not to overflow struct fid.

r197152:
Extend scope of the z_teardown_lock lock for consistency and "just in case".

r197153:
When zfs.ko is compiled with debug, make sure that znode and vnode point at
each other.

r197167:
Work-around READDIRPLUS problem with .zfs/ and .zfs/snapshot/ directories
by just returning EOPNOTSUPP. This will allow NFS server to fall back to
regular READDIR.
Note that converting inode number to snapshot's vnode is expensive operation.
Snapshots are stored in AVL tree, but based on their names, not inode numbers,
so to convert inode to snapshot vnode we have to interate over all snalshots.
This is not a problem in OpenSolaris, because in their READDIRPLUS
implementation they use VOP_LOOKUP() on d_name, instead of VFS_VGET() on
d_fileno as we do.

PR:	kern/125149
Reported by:	Weldon Godfrey <wgodfrey@ena.com>
Analysis by:	Jaakko Heinonen <jh@saunalahti.fi>

r197172:
Add missing \n.

Reported by:	marck

r197177:
Support both case: when snapshot is already mounted and when it is not yet
mounted.

r197200:
Modify mount(8) to skip MNT_IGNORE file systems by default, just like df(1)
does. This is not POLA violation, because there is no single file system in the
base that use MNT_IGNORE currently, although ZFS snapshots will be mounted with
MNT_IGNORE after next commit.

Reviewed by:	kib

r197201:
- Mount ZFS snapshots with MNT_IGNORE flag, so they are not visible in regular
  df(1) and mount(8) output. This is a bit smilar to OpenSolaris and follows
  ZFS route of not listing snapshots by default with 'zfs list' command.
- Add UPDATING entry to note that ZFS snapshots are no longer visible in
  mount(8) and df(1) output by default.

Reviewed by:	kib

Approved by:	re (bz)
2009-09-15 11:13:40 +00:00
Hajimu UMEMOTO
5858b2fdd2 MFC r196929: Suppress an options line when no bit is on.
Approved by:	re (kib)
2009-09-13 11:31:25 +00:00
Alexander Motin
529d728924 MFC r196831:
Add to `camcontrol cmd` support for sending arbitrary ATA commands.

It could be used for broad range of tasks, such as configuring drive
power management, caching, security and any other features and tasks,
not supported by existing drivers.

Approved by:	re (ATA-CAM blanket)
2009-09-06 14:05:01 +00:00
Alexander Motin
be5b3af890 MFC r196657:
ATA_FLUSHCACHE is a 28bit format command, not 48.

MFC r196658:
Improve camcontrol ATA support:
 - Tune protocol version reporting,
 - Add supported DMA/PIO modes reporting.
 - Fix IDENTIFY request for ATAPI devices.
 - Remove confusing "-" for NCQ status.

MFC r196659:
Short ATA command format has 28bit address, not 36bit.
Rename ata_36bit_cmd() into ata_28bit_cmd(), while it didn't become legacy.

Approved by:	re (ATA-CAM blanket)
2009-09-01 12:04:43 +00:00
Marcel Moolenaar
9fdef7744d MFC change 196383:
Remove the dependency on the kernel -- in particular the gctl request to
 the GEOM_BSD class -- to translate the absolute offsets in the label to
 relative ones. This makes bslabel(8) work correctly with GEOM_PART and
 also when the BSD label is nested under arbitrary partitioning schemes.

Inspired by:	Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Approved by:	re (kib)
2009-08-19 16:40:45 +00:00
Pawel Jakub Dawidek
424c75bfe1 MFC r196287:
Be more precise how to get fsids - 'mount -v' doesn't show fsids unless is run
by root.

Approved by:	re (kib)
2009-08-17 07:46:55 +00:00
Marcel Moolenaar
75f5a2286d MFC change 196278:
Emit a proper error message instead of dumping core when 1)
 GEOM_PART does not exist in the kernel, and 2) the GEOM in
 question does not exist.
 Additionally abort in case of programming errors that result
 in neither the class nor geom not being present in the gctl
 request.

Approved by:	re (kib)
2009-08-16 21:32:12 +00:00
Rick Macklem
ef89cb79cc Delete the descriptions of the gssname and allgssname optionss from
mount_nfs.8 since these options are not implemented in FreeBSD8.
This is content change for the man page.

Approved by:	re (kensmith), kib (mentor)
2009-07-29 14:44:09 +00:00
Rui Paulo
3ca80f0dbc Mesh fixes, namely:
* don't clobber proxy entries
* HWMP seq number processing, including discard of old frames
* flush routing table entries based on nexthop
* print route flags in ifconfig
* more debugging messages and comments

Proxy changes submitted by sam.

Approved by:	re (kib)
2009-07-27 14:22:09 +00:00
Bjoern A. Zeeb
00dc5f8e66 Make ifconfig ifN -vnet <jname|jid> actually work:
- fix ifconfig to ignore the non-existent interface in the current
  network stack in case of '-vnet'.
- in ifconfig: actually use the local variables defined for the
  vnet functions rather than modifying the global.

Reviewed by:	rwatson
Approved by:	re (kib)
2009-07-26 11:25:57 +00:00
Sam Leffler
f8c44ada2e Fix the logic to count the number of "live interfaces". With this change
dhclient now terminates when the underlying ifnet is destroyed (e.g.
on card eject).

Reviewed by:	brooks
Approved by:	re (kib)
2009-07-21 15:06:10 +00:00
Rui Paulo
c104cff26e More mesh bits, namely:
* bridge support (sam)
* handling of errors (sam)
* deletion of inactive routing entries
* more debug msgs (sam)
* fixed some inconsistencies with the spec.
* decap is now specific to mesh (sam)
* print mesh seq. no. on ifconfig list mesh
* small perf. improvements

Reviewed by:	sam
Approved by:	re (kib)
2009-07-20 19:12:08 +00:00
Rui Paulo
59aa14a91d Implementation of the upcoming Wireless Mesh standard, 802.11s, on the
net80211 wireless stack. This work is based on the March 2009 D3.0 draft
standard. This standard is expected to become final next year.
This includes two main net80211 modules, ieee80211_mesh.c
which deals with peer link management, link metric calculation,
routing table control and mesh configuration and ieee80211_hwmp.c
which deals with the actually routing process on the mesh network.
HWMP is the mandatory routing protocol on by the mesh standard, but
others, such as RA-OLSR, can be implemented.

Authentication and encryption are not implemented.

There are several scripts under tools/tools/net80211/scripts that can be
used to test different mesh network topologies and they also teach you
how to setup a mesh vap (for the impatient: ifconfig wlan0 create
wlandev ... wlanmode mesh).

A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled
by default on GENERIC kernels for i386, amd64, sparc64 and pc98.

Drivers that support mesh networks right now are: ath, ral and mwl.

More information at: http://wiki.freebsd.org/WifiMesh

Please note that this work is experimental. Also, please note that
bridging a mesh vap with another network interface is not yet supported.

Many thanks to the FreeBSD Foundation for sponsoring this project and to
Sam Leffler for his support.
Also, I would like to thank Gateworks Corporation for sending me a
Cambria board which was used during the development of this project.

Reviewed by:	sam
Approved by:	re (kensmith)
Obtained from:	projects/mesh11s
2009-07-11 15:02:45 +00:00
Scott Long
e69811df21 Fix alignment issue with ATA IDENTIFY structure.
Approved by:	re
2009-07-10 17:42:53 +00:00
Scott Long
52c9ce25d8 Separate the parallel scsi knowledge out of the core of the XPT, and
modularize it so that new transports can be created.

Add a transport for SATA

Add a periph+protocol layer for ATA

Add a driver for AHCI-compliant hardware.

Add a maxio field to CAM so that drivers can advertise their max
I/O capability.  Modify various drivers so that they are insulated
from the value of MAXPHYS.

The new ATA/SATA code supports AHCI-compliant hardware, and will override
the classic ATA driver if it is loaded as a module at boot time or compiled
into the kernel.  The stack now support NCQ (tagged queueing) for increased
performance on modern SATA drives.  It also supports port multipliers.

ATA drives are accessed via 'ada' device nodes.  ATAPI drives are
accessed via 'cd' device nodes.  They can all be enumerated and manipulated
via camcontrol, just like SCSI drives.  SCSI commands are not translated to
their ATA equivalents; ATA native commands are used throughout the entire
stack, including camcontrol.  See the camcontrol manpage for further
details.  Testing this code may require that you update your fstab, and
possibly modify your BIOS to enable AHCI functionality, if available.

This code is very experimental at the moment.  The userland ABI/API has
changed, so applications will need to be recompiled.  It may change
further in the near future.  The 'ada' device name may also change as
more infrastructure is completed in this project.  The goal is to
eventually put all CAM busses and devices until newbus, allowing for
interesting topology and management options.

Few functional changes will be seen with existing SCSI/SAS/FC drivers,
though the userland ABI has still changed.  In the future, transports
specific modules for SAS and FC may appear in order to better support
the topologies and capabilities of these technologies.

The modularization of CAM and the addition of the ATA/SATA modules is
meant to break CAM out of the mold of being specific to SCSI, letting it
grow to be a framework for arbitrary transports and protocols.  It also
allows drivers to be written to support discrete hardware without
jeopardizing the stability of non-related hardware.  While only an AHCI
driver is provided now, a Silicon Image driver is also in the works.
Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware
is possible and encouraged.  Help with new transports is also encouraged.

Submitted by:	scottl, mav
Approved by:	re
2009-07-10 08:18:08 +00:00
Oleg Bulyzhin
a6f1444804 - 'burst' description rewritten.
Submitted by:	Ben Kaduk
Approved by:	re (kib)
2009-06-26 19:49:06 +00:00
Maxim Konovalov
067e91e8c2 o Kill grammar nits.
PR:		docs/136061
Submitted by:	Ben Kaduk
MFC after:	1 week
2009-06-26 05:09:00 +00:00
Oleg Bulyzhin
6882bf4d92 - fix dummynet 'fast' mode for WF2Q case.
- fix printing of pipe profile data.
- introduce new pipe parameter: 'burst' - how much data can be sent through
  pipe bypassing bandwidth limit.
2009-06-24 22:57:07 +00:00
Doug Rabson
0775314b63 Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementation
and will be removed.
2009-06-24 18:42:21 +00:00
Jamie Gritton
5061de23fa Add the "vnet" and "-vnet" options, to allow moving interfaces between
jails with VIMAGE.

Approved by:	bz (mentor)
2009-06-24 18:21:37 +00:00