Commit Graph

201507 Commits

Author SHA1 Message Date
arybchik
3dd4dfa72d MFC r291680
sfxge: remove internal register definitions that should not be used by host code

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:32:21 +00:00
arybchik
bf32eb065c MFC r291679
sfxge: add markers for autogenerated defines

Move use defines outside.

Submitted by:   Guido Barzini <gbarzini at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:31:41 +00:00
arybchik
cd9d66a72c MFC r291678
sfxge: sync TLV layout headers with firmwaresrc for event merging config

Submitted by:   Tom Millington <tmillington at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:30:25 +00:00
arybchik
7486ee1567 MFC r291677
sfxge: add MCDI logging support to common code

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:28:30 +00:00
arybchik
2f48a429c0 MFC r291590
sfxge: retry VF vAdaptor allocation if it fails because of no EVB port yet

After an MC reboot, a VF driver may reset before the PF driver has
finished bringing everything back up. This includes the VFs EVB port.
MC_CMD_VADAPTOR_ALLOC is the first MCDI call after an MC reboot to
require the EVB port, so if it fails with MC_CMD_ERR_NO_EVB_PORT,
retry the command a few times after waiting a while.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:27:20 +00:00
arybchik
00551531b2 MFC r291588
sfxge: add function to query link control privilege

Make link control privilege visible to OS driver to guard updates to
flow control and PHY advertised capabilities.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:25:49 +00:00
arybchik
a0ef5238d3 MFC r291587
sfxge: FPGA and FPGA backup (diagnostic) partitions added to hunt_parttbl

It allows manftest to program them.

Submitted by:   Paul Fox <pfox at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:25:07 +00:00
arybchik
9bd613c0d0 MFC r291586
sfxge: allow VFs to have locally administered MAC addresses

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:24:25 +00:00
arybchik
798c9c4791 MFC r291585
sfxge: support MAC spoofing for 4.2.x firmare

Common code should infer other privileges from Admin privilege to
support firmware that pre-dates introduction of specific privilege
flags.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:23:38 +00:00
arybchik
1ac2f77bc3 MFC r291584
sfxge: parse packets for TSO early in if_transmit

Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:22:16 +00:00
garga
ef0dc64bd3 MFC r293357:
Obsolete inetd related files when WITHOUT_INETD is set

Reviewed by:	bapt
Approved by:	gnn
Sponsored by:	Rubiconn Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D4742
2016-01-14 14:21:43 +00:00
arybchik
2770548411 MFC r291570
sfxge: added setting TSO-related parameters

Submitted by:   Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:20:33 +00:00
arybchik
de3e51454b MFC r291569
sfxge: avoid TSO packets collapses if packet header uses 2 segments

It is really observed in the case of VLAN over sfxge interface.
Also this change makes total value equal to 35 which is default assumed
by the kernel for if_hw_tsomaxsegcount.

Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:19:03 +00:00
garga
e76139f566 MFC r293312:
Make cap_mkdb and services_mkdb file operations sync

Similar fix was done for passwd and group operations in r285050. When a
temporary file is created and then renamed to replace official file there
are no checks to make sure data was written to disk and if a power cycle
happens at this time, system can end up with a 0 length file

Approved by:	bapt
Sponsored by:	Netgate
Differential Revision:	https://reviews.freebsd.org/D2982
2016-01-14 14:18:10 +00:00
arybchik
ba538557c8 MFC r291488
sfxge: avoid TSO packets collapses bacause of not 2K aligned data

Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:17:05 +00:00
arybchik
32c1c2e354 MFC r291436
sfxge: add prefast annotation to common code return types

Using a typedef for common code return types (rather than "int")
allows the Prefast static analyser to understand when a function
has been successful (and thus when its postconditions must hold).

This greatly reduces then number of false positives reported by
prefast for error paths in common code functions.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:16:26 +00:00
arybchik
7d62d26c36 MFC r291434
sfxge: cleanup: fix prefast annotations on mac stats updates

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:15:07 +00:00
arybchik
e2384e74e4 MFC r291432
sfxge: modify nvram update functions for uio platform to support
RFID-selectable presets

Dynamic config partitions on boards that support RFID are divided into
a number of segments, each formatted like a partition, with header,
trailer and end tags. The first segment is the current active
configuration.

The segments are initialised by manftest and each contain a different
configuration e.g. firmware variant. The firmware can be instructed
via RFID to copy a segment over the first segment, hence changing the
active configuration. This allows ops to change the configuration of
a board prior to shipment using RFID.

Changes to the dynamic config may need to be written to all segments (in
particular firmware versions written by manftest) or just the first
segment (changes to the active configuration). See SF-111324-SW.
If only the first segment is written the code still needs to be aware of
the possible presence of subsequent segments as writing to a segment may
cause its size to increase, which would overwrite the subsequent
segments and invalidate them.

Boards that do not support RFID will only have one segment in their
dynamic config partition.

Submitted by:   Paul Fox <pfox at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:14:00 +00:00
arybchik
69ebdbc002 MFC r291398
sfxge: cleanup: report error on failure path in efx_vpd_hunk_verify

If the VPD is corrupt and contains an 'RV' keyword before the
END tag, then this function could return without setting the
return code to report the error.

Found by prefast.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:13:13 +00:00
arybchik
2fa8bdb5b8 MFC r291397
sfxge: cleanup: fix prefast annotations on mac stats updates

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:11:56 +00:00
arybchik
0b1a22e990 MFC r291396
sfxge: fix prefast warning in falconsiena_tx_qcreate

Keep prefast happy by returning the initial queue index
from falconsiena_tx_qcreate(). No change in behaviour, as
etxo_qcreate already zeros *addedp before the call.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:10:28 +00:00
arybchik
4f1dcecf1d MFC r291395
sfxge: cleanup: fix prefast annotations for stats buffers

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:09:40 +00:00
arybchik
10faefa541 MFC r291394
sfxge: unlink PIO buffers from VIs in WC mapping in hunt_nic_fini()

PIO is not yet supported in the FreeBSD driver.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:08:57 +00:00
arybchik
b89aba3427 MFC r291393
sfxge: infer external port numbering for Pavia

Adjust external port mapping table to distinguish Pavia from Monza.
Now the presence of any 40G mode implies at least 2 outputs per
external port.  So Pavia 4x10G ports are now mapped to 1,2,3,4;
Monza 4x10G ports map to 1,1,2,2 as before.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:08:13 +00:00
arybchik
525cc37b2e MFC r291392
sfxge: cleanup: fix prefast annotation

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:05:00 +00:00
arybchik
f09c1e7e67 MFC r291391
sfxge: do not use unnamed union in siena_mc_combo_rom_hdr_t

GCC 4.2.1 used on FreeBSD 8 and 9 branches does not like unnamed
union member in the structure. It is not strictly required in head,
but nice to have to minimize difference with out-of-tree driver.

Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:04:08 +00:00
arybchik
db8842ae5f MFC r291390
sfxge: cleanup: error probe correction

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
2016-01-14 14:03:05 +00:00
gjb
e9becf4ed0 Document EN-16:01, EN-16:02, EN-16:03, SA-15:27, SA-16:01,
SA-16:02, SA-16:03, SA-16:04, SA-16:05, SA-16:06.

Bump copyright date.

Sponsored by:	The FreeBSD Foundation
2016-01-14 11:11:46 +00:00
glebius
924e9fd65e o Fix SCTP ICMPv6 error message vulnerability. [SA-16:01.sctp]
o Fix Linux compatibility layer incorrect futex handling. [SA-16:03.linux]
o Fix Linux compatibility layer setgroups(2) system call. [SA-16:04.linux]
o Fix TCP MD5 signature denial of service. [SA-16:05.tcp]
o Fix insecure default bsnmpd.conf permissions. [SA-16:06.bsnmpd]

Security:	FreeBSD-SA-16:01.sctp, CVE-2016-1879
Security:	FreeBSD-SA-16:03.linux, CVE-2016-1880
Security:	FreeBSD-SA-16:04.linux, CVE-2016-1881
Security:	FreeBSD-SA-16:05.tcp, CVE-2016-1882
Security:	FreeBSD-SA-16:06.bsnmpd, CVE-2015-5677
2016-01-14 09:11:42 +00:00
allanjude
66d55487b9 Convert usr.sbin/sesutil to LPADD/DPADD for stable/10
Direct commit to stable/10

Pointy Hat To: allanjude
2016-01-14 04:25:29 +00:00
pfg
407b5ea098 MFC r293683:
ext4: mount panic from freeing invalid pointers

Initialize the struct with those fields to zeroes on allocation,
preventing the panic.

Patch by:	Damjan Jovanovic.

PR:		206056
2016-01-14 01:50:06 +00:00
allanjude
e37f0a84b3 MFC: r287473
Add the new sesutil(8) utility for managing SCSI Enclosure Services (SES) device.

MFC: r287493
  Fix iteration bug

MFC: r287485, r287494, r287992
  Please the angry gcc 4.2 gods

MFC: r287988
  Improve and expand sesutil(8)

  Return an error if no matching device is found
  Locate can address a slot, in addition to a drive
  Added fault, similar to locate but blinks a different LED
  Added the map command, lists all devices connected to the SES controller
  Added the status command, overall status of the SES controller

MFC: r292092
  sesutil: fix map not printing the status of the LED device in an array

MFC: r292093
  sesutil: pass the correct element type when printing the SES map

MFC: r292121
  sesutil: Add extra information specific to some SES devices to sesutil map

MFC: r292122
  Fix sesutil locate when a sesid is passed to locate command

MFC: r292262
  Show the enclosure name and id in sesutil map

Relnotes:	yes
Sponsored by:	Gandi.net
Sponsored by:	ScaleEngine Inc.
2016-01-14 01:42:09 +00:00
gjb
886662e98e MFC 293452:
Set FORCE_PKG_REGISTER=1 when installing packages to avoid failures
  when re-using build chroot(8) environments.

PR:		205998
Sponsored by:	The FreeBSD Foundation
2016-01-14 00:26:31 +00:00
dumbbell
2ed939d896 drm/i915: Remove "Attempting to unbind pinned buffer" message
This error message is removed in later versions of Linux and currently,
it spams users.

PR:		200712
MFC of:		r289109
2016-01-13 21:56:48 +00:00
marius
7be34d59a5 MFC: r292943, r292960
- (Ab)use udivx for dividing the u_int pc_cpuid when implementing
  CPU_ISSET(), CPU_SET() etc. in sparc64 asm. This approach has the
  benefit of not clobbering %y, allowing to revert r222827 and
  partially r222828.
- In r222828, CATR() already was changed to use the equivalent of
  PCPU_GET(cpuid) instead of the MD module ID for KTR_MASK, so
  belatedly also catch up with KTR_CPU and the C side of ktr(9).
  Originally, in r203838 CATR() was moved away from directly reading
  the module ID or equivalent as that became impractical with other
  CPU types than USI/II supported. With r222828 in place, per-CPU
  data generally is set up soon enough, though, that employing
  PCPU things in ktr(9) also for use during early stages works.
- Unfortunately, an exception to the latter is the ktr(9) use
  in pmap_bootstrap(), which actually is run so early that even
  checking for bootverbose being set via the loader doesn't work.
  Consequently, replace the ktr(9) use in pmap_bootstrap() with
  OF_printf(9) and put it under #ifdef DIAGNOSTIC instead.
2016-01-13 21:38:52 +00:00
delphij
e357bdb742 MFC r292861:
hyperv: vmbus: run non-blocking message handlers in vmbus_msg_swintr()

We'll remove the per-channel control_work_queue because it can't properly
do serialization of message handling, e.g., when there are 2 NIC devices,
vmbus_channel_on_offer() -> hv_queue_work_item() has a race condition:
for an SMP VM, vmbus_channel_process_offer() can run concurrently on
different CPUs and if the second NIC's
vmbus_channel_process_offer() -> hv_vmbus_child_device_register() runs
first, the second NIC's name will be hn0 and the first NIC's name will
be hn1!

We can fix the race condition by removing the per-channel control_work_queue
and run all the message handlers in the global
hv_vmbus_g_connection.work_queue -- we'll do this in the next patch.

With the coming next patch, we have to run the non-blocking handlers
directly in the kernel thread vmbus_msg_swintr(), because the special
handling of sub-channel: when a sub-channel (e.g., of the storvsc driver)
is received and being handled in vmbus_channel_on_offer() running on the
global hv_vmbus_g_connection.work_queue, vmbus_channel_process_offer()
invokes channel->sc_creation_callback, i.e., storvsc_handle_sc_creation,
and the callback will invoke hv_vmbus_channel_open() -> hv_vmbus_post_message
and expect a further reply from the host, but the handling of the further
messag can't be done because the current message's handling hasn't finished
yet; as result, hv_vmbus_channel_open() -> sema_timedwait() will time out
and th device can't work.

Also renamed the handler type from hv_pfn_channel_msg_handler to
vmbus_msg_handler: the 'pfn' and 'channel' in the old name make no sense.

Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by:  royger
Differential Revision:        https://reviews.freebsd.org/D4596

MFC r292859:

hyperv: vmbus: remove the per-channel control_work_queue

Now vmbus_channel_on_offer() -> vmbus_channel_process_offer() can
safely run on the global hv_vmbus_g_connection.work_queue now.

We remove the per-channel control_work_queue to achieve the proper
serialization of the message handling.

I removed the bogus TODO in vmbus_channel_on_offer(): a vmbus offer
can only come from the parent partition, i.e., the host.

PR:           kern/205156
Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by:  Howard Su <howard0su gmail com>, delphij
Differential Revision:        https://reviews.freebsd.org/D4597
2016-01-13 08:22:53 +00:00
allanjude
e72f532e15 MFC: r293001
Introduce the ZFS Boot Environments menu to the loader menu

MFC: r293414
  Add ZFS Boot Environments menu to userboot

MFC: r293454
  Only call init_zfs_bootenv when the system is booted with ZFS

MFC: r293612
  Fix calling init_zfs_bootenv to early, resulting in empty ZFS BE menu

Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
2016-01-13 01:50:02 +00:00
kevlo
46a82c43e8 MFC r293491:
- Add the definition of CHARCLASS_NAME_MAX, as per POSIX.1-2001.
- Avoid namespace pollution and move definitions of _POSIX2_CHARCLASS_NAME_MAX
  and _POSIX2_COLL_WEIGHTS_MAX into the .2001 section.
  With input from bde.

Reviewed by:	bde
2016-01-13 01:32:04 +00:00
davidcs
66d20fa0dd MFC r292639
Add support for firmware dump (a.k.a grcdump)
2016-01-12 23:16:27 +00:00
davidcs
fe1b4c9498 MFC r292638
Check for packet_length is greater than 60 bytes as well as packet_length is
  greater than len_on_bd, before invoking the routine to handle jumbo over SGL
  (bxe_service_rxsgl()).
  Add counters for number of jumbo_over_SGL packets (rx_bxe_service_rxsgl) and
  erroneous jumbo_over_SGL packets (rx_erroneous_jumbo_sge_pkts)

  Fix formatting in bxe_sysctl_state()
2016-01-12 22:58:46 +00:00
davidcs
3d8a7aed82 MFC r289199
Add support for reading device temperature
2016-01-12 22:52:45 +00:00
dim
8391ee29eb MFC r292950:
Drop the clang patch which adds recognition of 'CC' suffixes as aliases
for --driver-mode=g++, since this was never upstreamed.  For backwards
compatibility, add a wrapper shell script.
2016-01-12 19:33:43 +00:00
ngie
5d45988fef Fix LINT-NOINET kernels
- Generate opt_inet.h appropriately according to MK_INET_SUPPORT
- Only add in_gif.c to SRCS if MK_INET_SUPPORT != no

This is a surgical fix since the build infrastructure has diverged sufficiently
between stable/10 and head.

This change will likely be reverted if and when imp's changes to config.mk have
been backported to ^/stable/10 .

Reviewed by: ae (no serious objections)
Differential Revision: https://reviews.freebsd.org/D4864
MFC after: 1 week
Sponsored by: EMCC / Isilon Storage Division
2016-01-12 18:24:22 +00:00
allanjude
f24fbfc1e1 MFC: r284589
Add the ability to detect ZFS and GELI encrypted file systems to fstyp(8)

MFC: r284644
  Fix GCC Warnings

MFC: r284728
  Only build ZFS support in absense of WITHOUT_ZFS

MFC: r285426
  Remove excess copyrights

MFC: r286569
  Use GELI sentinel constant

MFC: r287937
  Eliminate unneeded copying of vdev data, goto, etc. and add a note
  that checksum of vdev label should be checked (which is not done
  currently).

  No functional change.

  While I'm there, raise WARNS to 2.

MFC: r292757
  Fix order of includes in usr.sbin/fstyp/zfs.c

MFC: r292829
  Eliminate unneeded includes.
2016-01-12 16:38:09 +00:00
trasz
6d8bdedefa Hide the "unmount of /dev failed (BUSY)" warning at shutdown or reboot,
introduced with r293742, just like it was hidden before that commit.

This is a direct commit to 10-STABLE; this special case is not needed
in 11-CURRENT, because devfs supports forced unmounts there.  The forced
unmount could be MFC-ed, but there are some LORs at shutdown, and I have
a weird feelings about it.

Sponsored by:	The FreeBSD Foundation
2016-01-12 14:18:54 +00:00
trasz
8bd7436f2b MFC r290689:
Fix resource leaks in error cases.

Sponsored by:	The FreeBSD Foundation
2016-01-12 10:24:08 +00:00
trasz
3aea2923e9 MFC r290548:
Userspace part of reroot support. This makes it possible to change
the root filesystem without full reboot, using "reboot -r". This can
be used to to eg. boot from a temporary md_image preloaded by loader(8),
setup an iSCSI session, and continue booting from rootfs mounted over
iSCSI.

Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3693
2016-01-12 10:14:57 +00:00
trasz
355c35a189 MFC r287964:
Kernel part of reroot support - a way to change rootfs without reboot.

Note that the mountlist manipulations are somewhat fragile, and not very
pretty.  The reason for this is to avoid changing vfs_mountroot(), which
is (obviously) rather mission-critical, but not very well documented,
and thus hard to test properly.  It might be possible to rework it to use
its own simple root mount mechanism instead of vfs_mountroot().

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2698
2016-01-12 10:11:29 +00:00
trasz
a35cfac66c MFC r287107:
Make vfs_unmountall() unmount /dev after /, not before.  The only
reason this didn't result in an unclean shutdown is that devfs ignores
MNT_FORCE flag.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3467
2016-01-12 10:09:03 +00:00
trasz
51adb09baa MFC r285240:
Remove reboot.S (part of libc).  It's not needed and was actually
broken - returning 0 from reboot(2) resulted in SIGBUS.

Sponsored by:	The FreeBSD Foundation
2016-01-12 09:58:00 +00:00