Commit Graph

98854 Commits

Author SHA1 Message Date
Alexander Motin
92782c33a6 Introduce new IOCTL CTL_PORT_LIST reporting in more flexible XML format.
Leave old CTL_GET_PORT_LIST in place so far.  Garbage-collect it later.
2014-07-05 05:44:26 +00:00
Alexander Motin
2cfbcb9b3a Improve readability of XML generated by CTL_LUN_LIST. 2014-07-05 04:10:24 +00:00
Alexander Motin
43fb3a65e3 Make options KPI more generic to allow it to be used for ports too,
not only for LUNs.
2014-07-05 03:34:52 +00:00
Alexander Motin
487ddad55e Use proper links field for ports linking. 2014-07-05 01:24:06 +00:00
Rick Macklem
6c7d2293d3 The new NFSv3 server did not generate directory postop attributes for
the reply to ReaddirPlus when the server failed within the loop
that calls VFS_VGET(). This failure is most likely an error
return from VFS_VGET() caused by a bogus d_fileno that was
truncated to 32bits.
This patch fixes the server so that it will return directory postop
attributes for the failure. It does not fix the underlying issue caused
by d_fileno being uint32_t when a file system like ZFS generates
a fileno that is greater than 32bits.

Reported by:	jpaetzel
Reviewed by:	jpaetzel
MFC after:	1 month
2014-07-04 22:47:07 +00:00
Alexander Motin
92168f4c01 Separate concepts of frontend and port.
Before iSCSI implementation CTL had no knowledge about frontend drivers,
it had only frontends, which really were ports (alike to LUNs, if comparing
to backends).  But iSCSI added there ioctl() method, which does not belong
to frontend as a port, but belongs to a frontend driver.
2014-07-04 19:27:06 +00:00
Alexander Motin
2f5be87a14 Remove targ_enable()/targ_disable() frontend methods.
Those methods were never implemented, and I believe that their concept is
wrong, since single frontend (SCSI port) can not handle several targets.
2014-07-04 19:19:03 +00:00
Nathan Whitehorn
1ee0f08975 After EFI support was added to the installer, it needed to allow boot
partitions of types other than "freebsd-boot" (in particular, "efi").
This allows the removal of some nasty hacks for supporting PowerPC systems,
in particular aliasing freebsd-boot to apple-boot on APM and an IBM-specific
code on MBR.

This changes the installer to use the correct names, which also breaks a
degeneracy in the meaning of "freebsd-boot" that allows the addition
of support for some newer IBM systems that can boot from GPT in addition to
MBR. Since I have no idea how to detect which those systems are, leave
the default on IBM PPC systems as MBR for now.
2014-07-04 15:55:32 +00:00
John-Mark Gurney
962ce8cf82 add a hit that you can enable this by default if you want... necessary
if you want the keyboard break to work early in boot..

MFC after:	1 week
2014-07-04 14:49:40 +00:00
John-Mark Gurney
91ed2fec19 BREAK_TO_DEBUGGER is not just serial console anymore, it controls all
console's ability to enter the debugger....  rwatson forgot to document
this when he changed it back in 2011...  There is more docs to write
about this, but at least fix this for now...

Reviewed by:	emaste
MFC after:	1 week
2014-07-04 14:32:15 +00:00
Hiren Panchasara
43630e625a Fix a typo. 2014-07-03 23:12:43 +00:00
Kenneth D. Merry
08df2e3eaf Add persistent reservation support to camcontrol(8).
camcontrol(8) now supports a new 'persist' subcommand that allows users to
issue SCSI PERSISTENT RESERVE IN / OUT commands.

sbin/camcontrol/Makefile:
	Add persist.c.

sbin/camcontrol/persist.c:
	New persistent reservation support for camcontrol(8).

	We have support for all known operation modes for PERSISTENT RESERVE
	IN and PERSISTENT RESERVE OUT.
	exceptions noted above.

sbin/camcontrol/camcontrol.8:
	Document the new 'persist' subcommand.

	In the section on the Transport ID (-I) option, explain what
	Transport IDs for each protocol should look like.  At some point
	some of this information could probably get moved off in a
	separate man page, either on Transport IDs alone or a man page
	documenting the Transport ID parsing code.

	Add a number of examples of persistent reservation commands.
	Persistent Reservations are complex enough that the average user
	probably won't be able to get the commands exactly right by just
	reading the man page.  These examples show a few basic and
	advanced examples of how to use persistent reservations.

sbin/camcontrol/camcontrol.h:
	Move the definition for camcontrol_optret here, so we can use it
	for the persistent reservation code.

	Add a definition for the new scsipersist() function.

sbin/camcontrol/camcontrol.c:
	Add 'persist' to the list of subcommands.

	Document 'persist' in the help text.

sys/cam/scsi/scsi_all.c:
	Add the scsi_persistent_reserve_in() and
	scsi_persistent_reserve_out() CCB building functions.

	Add a new function, scsi_transportid_sbuf().  This takes a
	SCSI Transport ID (documented in SPC-4), and prints it to
	an sbuf(9).  There are some transports (like ATA, USB, and
	SSA) for which there is no transport defined.  We need to
	come up with a reasonable thing to do if we're presented
	with a Transport ID that claims to be for one of those
	protocols.

	Add new routines scsi_get_nv() and scsi_nv_to_str().

	These functions do a table lookup to go between a string and an
	integer.  There are lots of table lookups needed in the
	persistent reservation code in camcontrol(8).

	Add a new function, scsi_parse_transportid(), along with leaf node
	functions to parse:
	FC, 1394 and SAS (scsi_parse_transportid_64bit())
	iSCSI (scsi_parse_transportid_iscsi())
	SPI (scsi_parse_transportid_spi())
	RDMA (scsi_parse_transportid_rdma())
	PCIe (scsi_parse_transportid_sop())

	Transport IDs.  Given a string with the general form proto,id these
	functions create a SCSI Transport ID structure.

sys/cam/scsi/scsi_all.h:
	Update the various persistent reservation data structures to
	SPC4r36l, but also rename some fields that were previously
	obsolete with the proper names from older SCSI specs.  This
	allows using older, obsolete persistent reservation types when
	desired.

	Add function prototypes for the new persistent reservation CCB
	building functions.

	Add a data strucure for the READ FULL STATUS service action
	of the PERSISTENT RESERVE IN command.

	Add Transport ID structures for all protocols described in SPC-4.

	Add a new series of SCSI_PROTO_XXX definitions, and
	redefine other defines in terms of these new definitions.

	Add a prototype for scsi_transportid_sbuf().

	Change a couple of "obsolete" persistent reservation data
	structure fields into something more meaningful, based on
	what the field was called when it was defined in the spec.
	(e.g. SPC, SPC-2, etc.)

	Create a new define, SPRI_MAX_LEN, for the maximum allocation
	length allowed for the PERSISTENT RESERVE IN command.

	Add data structures and enumerations for the new name/value
	translation functions.

	Add data structures for SCSI over PCIe Routing IDs.

	Bring the PERSISTENT RESERVE OUT Register and Move parameter list
	structure (struct scsi_per_res_out_parms) up to date with SPC-4.

	Add a data structure for the transport IDs that can optionally be
	appended to the basic PERSISTENT RESERVE OUT parameter list.

	Move SCSI protocol macro definitions out of the VPD page 0x83
	definition and combine them with the more up to date protocol
	definitions higher in the file.

	Add function prototypes for scsi_nv_to_str(), scsi_get_nv(),
	scsi_parse_transportid_64bit(), scsi_parse_transportid_spi(),
	scsi_parse_transportid_rdma(), scsi_parse_transportid_iscsi(),
	scsi_parse_transportid_sop(), and scsi_parse_transportid().

Sponsored by:	Spectra Logic Corporation
MFC after:	1 week
2014-07-03 23:09:44 +00:00
Luiz Otavio O Souza
4bd2c6a20d Properly advertise that if_arge can handle long frames (if_arge is set to
handle packets up to 1536 bytes)

This fixes the need to frag that could happen when using vlans on top of
if_arge (which is a common case for the use the switch ports as individual
NICs).

Previously to this commit any vlan setup with if_arge as parent would have
the MTU of the parent interface reduced by the size of dot1q header
(4 bytes).

Tested on TP-Link 1043ND (where the WAN port is just a switch port setup to
tag packets in a different VLAN than the LAN ports).

Reported and tested by:	Harm Weites (harm at weites.com)
2014-07-03 20:16:48 +00:00
Luiz Otavio O Souza
bfae93299c Initialize the switch vlan table at attachment.
Update some comments on code, specifying the correct vlans used on switch
setup.

Advertise the proper switch operation mode (the rtl8366rb only support
dot1q vlans).

This fixes the breakage that i introduced on r249752 and make the rtl8366rb
switch works again with etherswitchcfg(8).

Tested on TP-Link 1043ND.

Tested by:	me, Harm Weites (harm at weites.com)
2014-07-03 19:50:50 +00:00
Pedro F. Giffuni
99d8c6efbd Merge from OpenSolaris (30-Jun-2009):
6851093 system drops to kmdb with anonymous dtrace probes + kmdb

This has no effect on FreeBSD (code is ifdef'ed) but is useful as
reference for future merges.

MFC after:	1 week
2014-07-03 19:25:24 +00:00
Pedro F. Giffuni
87e109c3e0 Merge from OpenSolaris (22-Apr-2008):
6823388 DTrace ioctl handlers must validate all structure members

MFC after:	1 week
2014-07-03 19:07:37 +00:00
Ed Maste
b560f3ffa1 Display efi framebuffer dimensions on boot
The EFI framebuffer produces corrupted output on certain systems.  For
now display the framebuffer parameters (address, dimensions, etc.) on
boot to aid in tracking down these issues.

Sponsored by:	The FreeBSD Foundation
2014-07-03 17:53:28 +00:00
Pedro F. Giffuni
e099b3a948 Merge from OpenSolaris (20-Apr-2008):
6822482 DOF validation needs to handle loadable sections flagged as unloadable

MFC after:	1 week
2014-07-03 17:36:59 +00:00
Konstantin Belousov
2499a5ccef Micro-manage clang to get the expected inlining for cpu_search().
Mark cpu_search_lowest/cpu_search_highest/cpu_search_both as noinline,
while cpu_search() gets always_inline.  With the attributes set,
cpu_search() is inlined in wrappers, and if()s with constant
conditionals are optimized.

On some tests on many-core machine, the hwpmc reported samples for
cpu_search*() are reduced from 25% total to 9%.

Submitted by:	"Rang, Anton" <anton.rang@isilon.com>
MFC after:	1 week
2014-07-03 11:06:27 +00:00
Hans Petter Selasky
2110950be8 - Disable hardware checksumming until it is properly tested.
- Don't discard frames if the dropped or error flag is set.
- Don't remove the last 4-bytes of every packet.
- Add extra range check for data position offset when receiving data.

MFC after:	1 day
PR:		191432
2014-07-03 10:49:46 +00:00
Justin Hibbits
e42edd4db6 Fix a bug in hwpmc(4) callchain retrieval, for both user and kernel.
The array index for the callchain is getting double-incremented -- both in the
loop and the storing.  It should only be incremented in one location.

Also, constrain the stack pointer range check.

MFC after:	2 weeks
2014-07-03 06:52:26 +00:00
Warner Losh
7ddad071a5 Rework the BIO_DELETE code slightly. Always queue the BIO_DELETE
requests on the trim_queue, even for the CFA ERASE. This allows us, in
the future, to collapse adjacent requests. Since CFA ERASE is only for
CF cards, and it is so restrictive in what it can do, the collapse
code is not presently here. This also brings the ada driver more in
line with the da driver's treatment of BIO_DELETEs.

Reviewed by: mav@
2014-07-03 05:22:13 +00:00
Alexander Motin
22d6cbd4d3 Use separate memory type M_CTLIO for I/Os.
CTL allocate large amount of RAM.  This change give some more stats.

MFC after:	2 weeks
2014-07-03 04:26:53 +00:00
Bryan Venteicher
a88f19d8f1 Remove some write only variables
MFC after:	3 days
2014-07-02 23:28:21 +00:00
Marcel Moolenaar
054b57a740 Drop KTR records when we're in the debugger so that the debugger isn't
changing or overwriting the trace buffer. When KTR is enabled for things
like traps or pmap functions, the amount of logging can be substantial.
2014-07-02 22:13:07 +00:00
Marcel Moolenaar
7cc2e524b5 Improve the KTR logs by naming the values. 2014-07-02 22:09:06 +00:00
Hiren Panchasara
cc412412db 2014-07-02 22:04:14 +00:00
Alexander Motin
5a178afd41 Fix bug in sync control in new "dev" mode of ZVOL (r265678).
Don't check ZVOL_WCE flag, used in Solaris to control device "write cache".
It is not applicable on FreeBSD and by default set to "disable".

MFC after:	3 days
2014-07-02 21:25:32 +00:00
Sergey Kandaurov
59578ee028 Fixed build with DEVICE_POLLING. 2014-07-02 21:08:25 +00:00
Marius Strobl
8ea3ffb13d Remove ofwfb(4) in order to fix the LINT build breakage caused by r268069.
Both vt(4) and ofwfb(4) need a lot of love to be usable on sparc64 and even
then the performance of ofwfb(4) would suck compared to hardware accelerated
drivers like creator(4) and machfb(4).
2014-07-02 19:46:42 +00:00
Marcel Moolenaar
4a81240ca7 Fix off-by-one introduced by the conversion to the driver API.
Submitted by:   Sreekanth Rupavatharam <rupavath@juniper.net>
Obtained from:  Juniper Networks, Inc.
2014-07-02 16:17:48 +00:00
Ed Maste
969d3cc28b Fix typos in VTY constant names from r268158 2014-07-02 14:47:48 +00:00
Ed Maste
018147eef9 Prefer vt(4) for UEFI boot
The UEFI framebuffer driver vt_efifb requires vt(4), so add a mechanism
for the startup routine to set the preferred console.  This change is
ugly because console init happens very early in the boot, making a
cleaner interface difficult.  This change is intended only to facilitate
the sc(4) / vt(4) transition, and can be reverted once vt(4) is the
default.
2014-07-02 13:24:21 +00:00
Luigi Rizzo
d398c8634a Various bugfixes from Stefano Garzarella:
1. oce_multiq_start(): make sure the buffer is consumed even on ENXIO
2. oce_multiq_transmit(): there is an extra call to drbr_enqueue()
  causing the mbuf to be enqueued twice when the NIC's queue is full,
  and potential panics
3. oce_multiq_transmit(): same problem fixed recently in ixgbe (r267187)
   and other drivers: if the mbuf is enqueued, the proper return value is 0

Submitted by:	Stefano Garzarella
MFC after:	3 days
2014-07-02 12:13:11 +00:00
Hans Petter Selasky
98a2cc1f30 Add support for empty data sets. Data set begin and end pointers
should resolve to "NULL" when not present. This is done by declaring
the data set begin and end symbols as "weak".
2014-07-02 08:49:06 +00:00
Hans Petter Selasky
cdd3cd4b29 Define a "__weak" macro for declaring symbols "weak". 2014-07-02 08:45:26 +00:00
Mateusz Guzik
a6bad85e8e Plug gcc warning after r268074 about unitialized newsigacts
Reported by:	Gary Jennejohn <gljennjohn gmail.com>
2014-07-02 05:45:40 +00:00
Marcel Moolenaar
c2df73347b Convert nfe(4) to use the driver API.
Submitted by: Mikhail <mp@lenta.ru>
2014-07-01 23:41:54 +00:00
Pedro F. Giffuni
0b8f286e83 Merge from OpenSolaris (15-Sep-2008):
6735480 race between probe enabling and provider registration

MFC after:	1 week
2014-07-01 23:37:24 +00:00
Xin LI
30324e945a MFV r268122:
4929 want prevsnap property

illumos/illumos-gate@b461c7460e

MFC after:	2 weeks
2014-07-01 22:42:53 +00:00
Xin LI
9cc8a15b2e MFV r268121:
4924 LZ4 Compression for metadata

illumos/illumos-gate@b8289d24d8

MFC after:	2 weeks
2014-07-01 22:31:09 +00:00
Pedro F. Giffuni
f384ec379c Small merges from OpenSolaris:
These have no effect on FreeBSD, in fact they are ifdef'ed,
but make easier future merges:

6699767 panic in spec_open()

6718877 crgetzoneid() use can cause problems when forking processes with
USDT providers in a non global zone

MFC after:	3 days
2014-07-01 22:16:44 +00:00
Xin LI
aa882b9048 MFV r268119:
4914 zfs on-disk bookmark structure should be named *_phys_t

illumos/illumos-gate@7802d7bf98

MFC after:	2 weeks
2014-07-01 21:51:30 +00:00
Rick Macklem
2f9f804d73 Bump __FreeBSD_version since r268115 changed the internal
interfaces used between the NFS related modules, including
the krpc.
2014-07-01 21:12:48 +00:00
Xin LI
55f6421982 - Fix handling of "new" style of ioctl in compatiblity mode [1];
- Reorganize code and reduce diff from upstream;
 - Improve forward compatibility shims for previous kernel;

Reported by:	sbruno [1]
X-MFC-With:	r268075
2014-07-01 20:57:39 +00:00
Rick Macklem
c59e4cc34d Merge the NFSv4.1 server code in projects/nfsv4.1-server over
into head. The code is not believed to have any effect
on the semantics of non-NFSv4.1 server behaviour.
It is a rather large merge, but I am hoping that there will
not be any regressions for the NFS server.

MFC after:	1 month
2014-07-01 20:47:16 +00:00
Bryan Drewery
4fc0f18c20 Change NFS readdir() to only ignore cookies preceding the given offset for
UFS rather than for all but ZFS.  This code was assuming that offsets were
monotonically increasing for all file systems except ZFS and that the
cookies from a previous call may have been rewound to a block boundary.
According to mckusick@ only UFS is known to do this, so only requests against
UFS file systems should remove cookies smaller than the given offset.  This
fixes serving TMPFS over NFS as it too does not have monotonically increasing
offsets.  The comment around the code also indicated it was specific to UFS.

Some of the code using 'not_zfs' is specific to ZFS snapshot handling, so
add a 'is_zfs' variable for those cases.

It's possible that 'is_zfs' check for VFS_VGET() support may not be
specific to ZFS.  This needs more research and testing.

After this fix TMPFS and other file systems can be served over NFS.

To test I compared the results of syncing a /usr/src tree into a tmpfs and
serving that over NFS.  Before the fix 3589 files were missing on the remote
view.  After the fix all files were successfully found.

Reviewed by:	rmacklem
Discussed with:	mckusick, rmacklem via fs@
Discussed at:	http://lists.freebsd.org/pipermail/freebsd-fs/2014-April/019264.html
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2014-07-01 20:00:35 +00:00
Marcel Moolenaar
fba8b10966 Convert bge(4) to use the driver API.
Submitted by:   Sreekanth Rupavatharam <rupavath@juniper.net>
Obtained from:  Juniper Networks, Inc.
2014-07-01 19:50:47 +00:00
John Baldwin
30a13db0c5 Free the static DMA buffer holding the command ring during detach as well
as if attach fails.
2014-07-01 18:24:54 +00:00
Adrian Chadd
81a99d38e9 Remove old reference to IP_RSSCPUID.
Submitted by:	Eggert, Lars <lars@netapp.com>
2014-07-01 17:27:48 +00:00