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.
sfxge: sync TLV layout headers with firmwaresrc for event merging config
Submitted by: Tom Millington <tmillington at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
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.
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.
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.
sfxge: allow VFs to have locally administered MAC addresses
Submitted by: Mark Spender <mspender at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
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.
sfxge: parse packets for TSO early in if_transmit
Submitted by: Artem V. Andreev <Artem.Andreev at oktetlabs.ru>
Sponsored by: Solarflare Communications, Inc.
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.
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
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.
sfxge: cleanup: fix prefast annotations on mac stats updates
Submitted by: Andy Moreton <amoreton at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
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.
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.
sfxge: cleanup: fix prefast annotations on mac stats updates
Submitted by: Andy Moreton <amoreton at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
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.
sfxge: cleanup: fix prefast annotations for stats buffers
Submitted by: Andy Moreton <amoreton at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
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.
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.
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.
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
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.
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
- (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.
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
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.
- 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
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()
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.
- 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
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.
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
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
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
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
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