]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r310298: Improve error handling when I/O split between several BIOs.
mav [Thu, 5 Jan 2017 11:37:46 +0000 (11:37 +0000)]
MFC r310298: Improve error handling when I/O split between several BIOs.

If we get several error codes, handle one with lowest offset.

7 years agoMFC r310285:
mav [Thu, 5 Jan 2017 11:36:08 +0000 (11:36 +0000)]
MFC r310285:
When reporting "Logical block address out of range" error, report the LBA
in sense data INFORMATION field.

7 years agoMFC r310284:
mav [Thu, 5 Jan 2017 11:34:30 +0000 (11:34 +0000)]
MFC r310284:
When writing fixed format sense data, set VALID bit only if provided value
for INFORMATION field fit into available 4 bytes (has no non-zero bytes
except last 4), as explicitly required by SPC-5 specification.

7 years agoMFC r310275: Fix typo in function name.
mav [Thu, 5 Jan 2017 11:32:57 +0000 (11:32 +0000)]
MFC r310275: Fix typo in function name.

7 years agoMFC r310272: Add new bits into Extended Inquiry VPD page.
mav [Thu, 5 Jan 2017 11:31:17 +0000 (11:31 +0000)]
MFC r310272: Add new bits into Extended Inquiry VPD page.

7 years agoMFC r310266: Add support for NUAR bit in Control mode page.
mav [Thu, 5 Jan 2017 11:29:42 +0000 (11:29 +0000)]
MFC r310266: Add support for NUAR bit in Control mode page.

7 years agoMFC r310265: Add set of macros to simplify code access to mode pages fields.
mav [Thu, 5 Jan 2017 11:28:01 +0000 (11:28 +0000)]
MFC r310265: Add set of macros to simplify code access to mode pages fields.

7 years agoMFC r310259:
mav [Thu, 5 Jan 2017 11:27:01 +0000 (11:27 +0000)]
MFC r310259:
Following SPC-5, make REQUEST SENSE report "Logical unit not supported"
in returned parameter data for not accessible LUNs.

7 years agoMFC r310257: Improve support for informational exceptions.
mav [Thu, 5 Jan 2017 11:03:58 +0000 (11:03 +0000)]
MFC r310257: Improve support for informational exceptions.

While CTL still has no real events to report in this way (like SMART),
it is possible to trigger false event by manually setting TEST bit in
Informational Exceptions Control mode page, that can be useful for
initiator testing.  This code supports all flavours of IE reporting:
UNIT ATTENTION, RECOVERED ERROR and NO SENSE sense keys, REQUEST SENSE
command and Informational Exceptions log page.

7 years agoMFC r310230:
mav [Thu, 5 Jan 2017 11:02:27 +0000 (11:02 +0000)]
MFC r310230:
Don't treat informational exceptions (warnings and impending failures)
a.k.a. SCSI SMART events as errors.  Log them to console and continue.

7 years agoMFC r309297: Make SES status updates more aggressive.
mav [Thu, 5 Jan 2017 11:00:27 +0000 (11:00 +0000)]
MFC r309297: Make SES status updates more aggressive.

 - On control request update all status pages, since they may also be
affected if user enables/disables enclosure slots.
 - Periodically update element descriptors too, since there is some
hardware where they are changed dynamically.

7 years agoMFC 310652,310657,310658
sephe [Thu, 5 Jan 2017 08:57:49 +0000 (08:57 +0000)]
MFC 310652,310657,310658

310652
    hyperv/hn: Consolidate hn_{suspend,resume}

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8907

310657
    hyperv/hn: Function renaming; no functional changes.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8908

310658
    hyperv/hn: Factor out function to set rxfilter.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8928

7 years agoMFC 310651
sephe [Thu, 5 Jan 2017 08:42:58 +0000 (08:42 +0000)]
MFC 310651

    hyperv/vmbus: Nuke unnecessary critical sections.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8906

7 years agoMFC 310462,310465
sephe [Thu, 5 Jan 2017 08:41:29 +0000 (08:41 +0000)]
MFC 310462,310465

310462
    hyperv/ic: Fix version4 timesync message format.

    It is not compat w/ the old timesync message format, which the message
    type stays the same as the old timesync message.

    Sponsored by:   Microsoft

310465
    hyperv/ic: Allow applying the samples from hypervisor unconditionally.

    Sponsored by:   Microsoft

7 years agoMFC 310347
sephe [Thu, 5 Jan 2017 08:38:27 +0000 (08:38 +0000)]
MFC 310347

    hyperv/storvsc: The max channel in PDU actually means the max sub-chans.

    Use proper name for local variables. PDU fields' name was not changed yet.
    While I'm here, make # of usable channels tunable. This eases further
    testing.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8851

7 years agoMFC 310324
sephe [Thu, 5 Jan 2017 08:34:08 +0000 (08:34 +0000)]
MFC 310324

    hyperv/ic: Rename cleaned up files.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8850

7 years agoMFC 310318
sephe [Thu, 5 Jan 2017 08:27:55 +0000 (08:27 +0000)]
MFC 310318

    hyperv/ic: Cleanup driver glue.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8849

7 years agoMFC 310317
sephe [Thu, 5 Jan 2017 08:21:46 +0000 (08:21 +0000)]
MFC 310317

    hyperv/ic: Rname cleaned up file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8848

7 years agoMFC 310315
sephe [Thu, 5 Jan 2017 08:04:04 +0000 (08:04 +0000)]
MFC 310315

    hyperv/ic: Inclusion cleanup

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8847

7 years agoMFC 310312-310314
sephe [Thu, 5 Jan 2017 08:02:37 +0000 (08:02 +0000)]
MFC 310312-310314

310312
    hyperv/ic: Factor out function to send IC response

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8844

310313
    hyperv/ic: Cleanup common struct and functions.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8845

310314
    hyperv/ic: Rename cleaned up header file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8846

7 years agoMFC 310048,310101,310239
sephe [Thu, 5 Jan 2017 07:42:08 +0000 (07:42 +0000)]
MFC 310048,310101,310239

310048
    hyperv: Implement "enlightened" time counter, which is rdtsc based.

    Reviewed by:    kib
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8763

310101
    hyperv: Allow userland to ro-mmap reference TSC page

    This paves way to implement VDSO for the enlightened time counter.

    Reviewed by:    kib
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8768

310239
    hyperv: Implement userspace gettimeofday(2) with Hyper-V reference TSC

    This 6 times gettimeofday performance, as measured by
    tools/tools/syscall_timing

    Reviewed by:    kib
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8789

7 years agoMFC 309874,309875
sephe [Thu, 5 Jan 2017 06:25:16 +0000 (06:25 +0000)]
MFC 309874,309875

309874
    hyperv/vmbus: Add channel polling support.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8738

309875
    hyperv/hn: Add polling support

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8739

7 years agoMFC 309726,309728
sephe [Thu, 5 Jan 2017 06:21:14 +0000 (06:21 +0000)]
MFC 309726,309728

309726

    hyperv/storvsc: Fix the SCSI disk attachment issue.

    On pre-WS2016 Hyper-V, if the only LUNs > 7 are used, then all disks
    fails to attach.  Mainly because those versions of Hyper-V do not set
    SRB_STATUS properly and deliver junky INQUERY responses.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Reported by:    Hongxiong Xian <v-hoxian microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8724

309728
    hyperv/storvsc: Minor style changes; no functional changes.

    Reported by:    rpokala
    Sponsored by:   Microsoft

7 years agoMFC 309705
sephe [Thu, 5 Jan 2017 06:19:07 +0000 (06:19 +0000)]
MFC 309705

    hyperv/timesync: Support "sent TC" to improve accuracy.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8723

7 years agoMFC 309704
sephe [Thu, 5 Jan 2017 06:15:14 +0000 (06:15 +0000)]
MFC 309704

    hyperv/vmbus: Utilize vmbus_chan_run_task()

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8686

7 years agoMFC 309346,309348,309353
sephe [Thu, 5 Jan 2017 06:11:53 +0000 (06:11 +0000)]
MFC 309346,309348,309353

309346
    hyperv/hn: Add HN_DEBUG kernel option.

    If bufring is used for per-TX ring descs, don't update "available"
    counter, which is only used to help debugging.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8674

309348
    hyperv/hn: Don't hold txdesc, if no BPFs are attached.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8675

309353
    hyperv/hn: Add 'options RSS' support.

    Reviewed by:    adrian
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8676

7 years agoMFC 309320
sephe [Thu, 5 Jan 2017 05:59:15 +0000 (05:59 +0000)]
MFC 309320

    hyperv/storvsc: Don't use timedwait.

    The timeout is unnecessary.

    Reviewed by:    jhb
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8656

7 years agoMFC 309319
sephe [Thu, 5 Jan 2017 05:54:22 +0000 (05:54 +0000)]
MFC 309319

    hypver/vmbus: Remove extra assertion.

    It is asserted by vmbus_chan_gpadl_connect() now.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8660

7 years agoMFC 309310,309311,309316,309318
sephe [Thu, 5 Jan 2017 05:51:00 +0000 (05:51 +0000)]
MFC 309310,309311,309316,309318

309310
    hyperv/hn: Nuke the unused TX taskqueue CPU binding tunable.

    It was an experimental tunable, and is now deemed to be road blocker
    for further changes.  Time to retire it.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8654

309311
    hyperv/hn: Allow multiple TX taskqueues.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8655

309316
    hyperv/vmbus: Add DEVMETHOD to map cpu to event taskq.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8658

309318
    hyperv/hn: Allow TX to share event taskqueues.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8659

7 years agoMFC 309240,309242,309244,309245,309670
sephe [Thu, 5 Jan 2017 05:46:06 +0000 (05:46 +0000)]
MFC 309240,309242,309244,309245,309670

309240
    hyperv/vmbus: Add result polling support for xact API.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8633

309242
    hyperv/vmbus: Add result polling support for message Hypercall API.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8634

309244
    hyperv/vmbus: Add exec cancel support for message Hypercall API.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8635

309245
    hyperv/vmbus: Use poll/cancel APIs to wait for the CHOPEN response.

    Since hypervisor does not respond CHOPEN to a revoked channel.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8636

309670
    hyperv/vmbus: Use pause if possible.

    This makes booting on Hyper-V w/ small # of vCPUs work properly.

    Reported by:    Hongxiong Xian <v-hoxian microsoft com>, Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft

7 years agoMFC 309236,309237
sephe [Thu, 5 Jan 2017 05:41:33 +0000 (05:41 +0000)]
MFC 309236,309237

309236
    hyperv/vmbus: Make sure that the allocated GPADL is not zero.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8631

309237
    hyperv/vmbus: Stringent GPADL parameter assertion.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8632

7 years agoMFC 309226-309231,309235
sephe [Thu, 5 Jan 2017 05:29:51 +0000 (05:29 +0000)]
MFC 309226-309231,309235

309226
    hyperv/hn: Utilize vmbus_chan_xact_wait

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8612

309227
    hyperv/hn: Fix detach error handling.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8613

309228
    hyperv/hn: Fix multi-packet RNDIS message aggregation size setting.

    Just in case that no chimney sending buffer can be used.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8619

309229
    hyperv/hn: Fix attach error handling

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8620

309230
    hyperv/hn: Enable multi-packet RNDIS message support by default.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8621

309231
    hyperv/hn: Fix vmbus_chan_subidx usage.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8629

309235
    hyperv/hn: Simplify RSS indirect table fixup API

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8630

7 years agoMFC 309128,309129,309131-309136,309138-309140,309224,309225
sephe [Thu, 5 Jan 2017 05:24:30 +0000 (05:24 +0000)]
MFC 309128,309129,309131-309136,309138-309140,309224,309225

309128
    hyperv/vmbus: Commit the GPADL id only after the connection succeeds.

    Minor style change.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8563

309129
    hyperv/vmbus: Minor style changes.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8564

309131
    hyperv/vmbus: Fix sysctl tree leakage, if channel open fails.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8565

309132
    hyperv/vmbus: Don't close unopened channels.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8566

309133
    hyperv/vmbus: GPADL disconnect error on a revoked channel is benign.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8567

309134
    hyperv/vmbus: No stranded bufring GPADL is allowed.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8568

309135
    hyperv/vmbus: Return EISCONN if the bufring GPADL can't be disconnected.

    So that the callers of vmbus_chan_open_br() could handle the passed in
    bufring memory properly.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8569

309136
    hyperv/vmbus: Don't free the bufring if its GPADL can't be disconnected.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8570

309138
    hyperv/vmbus: Always try disconnect/free bufring memory upon channel close

    While I'm here, minor wording and style changes.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8598

309139
    hyperv/vmbus: Propagate close error.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8599

309140
    hyperv/vmbus: Add a simplified version of channel close.

    So that the caller can know the channel close error and react accordingly.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8600

309224
    hyperv/vmbus: Zero out GPADL if error happens.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8601

309225
    hyperv/vmbus: Add supportive transaction wait function.

    This function supports channel revocation properly.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8611

7 years agoMFC 309085
sephe [Thu, 5 Jan 2017 04:59:37 +0000 (04:59 +0000)]
MFC 309085

    hyperv/hn: Fix primary channel revocation

    Since hypervisor will not drain the TX bufring, once the channels are
    revoked:
    - Setup vmbus orphan handler properly.
    - Make sure that suspension will not wait the TX bufring draining
      forever.
    - GC the pending TX descs on detach path, before freeing the busdma
      stuffs.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8559

7 years agoMFC 309030,309039,309080,309081,309083
sephe [Thu, 5 Jan 2017 04:22:03 +0000 (04:22 +0000)]
MFC 309030,309039,309080,309081,309083

309030
    hyperv/vmbus: Set a mark on the revoked channel.

    This will be used to fix device detach DEVMETHOD for revoked primary
    channel.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8522

309039
    hyperv/vmbus: Merge free/active locks.

    These functions are only used by management stuffs, so there are
    no needs to introduce extra complexity.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8524

309080
    hyperv/vmbus: Implement orphan support for transaction API

    It will be used to fix the primary channel revocation support.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8525

309081
    hyperv/vmbus: Fix the primary channel revoking on vmbus side.

    Drivers can now use vmbus_chan_{is_revoked,set_orphan,unset_orphan}() and
    vmbus_xact_ctx_orphan() to fix their attach/detach DEVMETHODs for revoked
    primary channels.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8545

309083
    hyperv/vmbus: Fix the multi-channel revoking on vmbus side.

    - Reference count the sub-channel when channel offer message is
      processed, so that immediate rescind message on the same channel
      will not race sub-channel open on driver side.
    - Drop the above reference when sub-channel is closed, this closely
      mimics the hypervisor's reaction when primary channel is closed
      on the VM side.  No drivers use sub-channel after primary channel
      is closed.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8546

7 years agoMFC 308908,308909
sephe [Thu, 5 Jan 2017 03:42:29 +0000 (03:42 +0000)]
MFC 308908,308909

308908
    hyperv/hn: Allow enabling IPv6 TX checksum offloading and IPv6 TSO.

    They are still disabled by default.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8490

308909
    hyperv/hn: Don't abuse hn_{tx,rx}_ring_inuse.

    Just in case, the # of TX/RX rings is changed upon synthetic parts
    re-attach.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8520

7 years agoMFC 308907
sephe [Thu, 5 Jan 2017 03:35:51 +0000 (03:35 +0000)]
MFC 308907

    hyperv/hn: Fix WITNESS warnings

    And re-enable SIOCADDMULTI/SIOCDELMULTI, after WITNESS warning is fixed.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8489

7 years agoMFC 308906
sephe [Thu, 5 Jan 2017 03:32:13 +0000 (03:32 +0000)]
MFC 308906

    hyperv/vmbus: Support transction result busy-wait.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8488

7 years agoMFC 308905
sephe [Thu, 5 Jan 2017 03:25:38 +0000 (03:25 +0000)]
MFC 308905

    hyperv/hn: Implement RNDIS multi-packet message support.

    Currently, it is only applied to packet sent through chimney sending
    buffers.  Not enabled by default yet.

    This one gives 20%~30% performance boost for non-TSO usage in both
    bit/packet rate tests and nginx performance test.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8560

7 years agoMFC 308664,308742,308743
sephe [Thu, 5 Jan 2017 03:20:00 +0000 (03:20 +0000)]
MFC 308664,308742,308743

308664
    hyperv/vss: Add driver and tools for VSS

    VSS stands for "Volume Shadow Copy Service".  Unlike virtual machine
    snapshot, it only takes snapshot for the virtual disks, so both
    filesystem and applications have to aware of it, and cooperate the
    whole VSS process.

    This driver exposes two device files to the userland:

        /dev/hv_fsvss_dev

        Normally userland programs should _not_ mess with this device file.
        It is currently used by the hv_vss_daemon(8), which freezes and
        thaws the filesystem.  NOTE: currently only UFS is supported, if
        the system mounts _any_ other filesystems, the hv_vss_daemon(8)
        will veto the VSS process.

        If hv_vss_daemon(8) was disabled, then this device file must be
        opened, and proper ioctls must be issued to keep the VSS working.

        /dev/hv_appvss_dev

        Userland application can opened this device file to receive the
        VSS freeze notification, hold the VSS for a while (mainly to flush
        application data to filesystem), release the VSS process, and
        receive the VSS thaw notification i.e. applications can run again.

        The VSS will still work, even if this device file is not opened.
        However, only filesystem consistency is promised, if this device
        file is not opened or is not operated properly.

    hv_vss_daemon(8) is started by devd(8) by default.  It can be disabled
    by editting /etc/devd/hyperv.conf.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Reviewed by:    kib, mckusick
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8224

308742
    hyperv/vss: Nuke unused variables.

    Submitted by:   markj
    Reported by:    markj
    Sponsored by:   Microsoft

308743
    hyperv/vss: Install the userland daemon to /usr/sbin instead of /

    Submitted by:   markj
    Reported by:    markj
    Sponsored by:   Microsoft

7 years agoMFC r310976:
pfg [Thu, 5 Jan 2017 01:27:53 +0000 (01:27 +0000)]
MFC r310976:
Move __hidden attribute towards the end of the declaration.

Apple had them at the start but moving them to the end is better for
faster reading and fits better what is done in other FreeBSD headers.

7 years agoMFC r310170, r310492
gonzo [Thu, 5 Jan 2017 00:26:57 +0000 (00:26 +0000)]
MFC r310170, r310492

r310170:
[spigen] Make "data" part of spigen_transfer optional

Make st_data part of spigen_transfer optional by letting pass zero length
and NULL pointer. SPI controller drivers handle this case fine.

r310492:
[spigen] Fix spigen attaching as a driver for SPI devices nodes in FDT

Return BUS_PROBE_NOWILDCARD in probe method to make sure that spigen
attaches only to the device created in identify method.

Before this change spigen probe method used to return 0 which meant it
competed with other drivers to be attached to the devices created for
child nodes of SPI bus node in FDT.

Reported by: Daniel Braniss

7 years agoMFC r309822, r310375
gonzo [Wed, 4 Jan 2017 19:22:42 +0000 (19:22 +0000)]
MFC r309822, r310375

r309822:
[iwn] Perform BUS_DMASYNC_PREREAD when initializing RX buffer

BUS_DMASYNC_PREREAD is required when setting up RX buffer, otherwise
data provided by card can be overwritten by data evicted from cache

Also use proper tag when setting up RX descriptor

Reviewed by: adrian, avos, ivadasz
Differential Revision: https://reviews.freebsd.org/D8717

r310375:
[iwn] Several fixes for DMA part of iwn(4)

- Perform DMS sync when accessing/initializing ICT table
- Fix some DMA sync operations to use matching tags

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D8804

7 years agoMFC r309858
hiren [Wed, 4 Jan 2017 18:03:27 +0000 (18:03 +0000)]
MFC r309858
We currently don't do TSO if ip options are present. In case of IPv6, we look at
in6p_options to check that. That is incorrect as we carry ip options in
in6p_outputopts. Also, just checking for in6p_outputopts being NULL won't
suffice as we combine ip options and ip header fields both in that one field.
The commit fixes this by using ip6_optlen() which correctly calculates length
of only ip options for IPv6.

Sponsored by: Limelight Networks

7 years agoMFC r308216:
fabient [Wed, 4 Jan 2017 16:36:51 +0000 (16:36 +0000)]
MFC r308216:

In rtadvd, interface lookup calls if_indextoname() many times in a loop,
(it takes a long time on systems with many interfaces)
without reason and without checking its return value.

Sponsored by: Stormshield

7 years agoMFC r309666, r310033, r310049, r310100, r310152, and r310807.
np [Wed, 4 Jan 2017 06:54:05 +0000 (06:54 +0000)]
MFC r309666, r310033, r310049, r310100, r310152, and r310807.

r309666:
cxgbe(4): unsigned short isn't large enough to store link speed (which
is in Mbps) for 100Gbps links.

r310033:
cxgbe(4): Retire t4_bus_space_read_8 and t4_bus_space_write_8.

r310049:
cxgbe(4): Fix the tid range shown for T6 cards in misc.tids.

r310100:
cxgbe(4): Deal with compressed error vectors.

r310152:
cxgbe(4): Fix typo in an unused macro.

r310807:
cxgbe(4): Updates to link configuration.

- Update struct link_settings and associated shared code.

- Add tunables to control FEC and autonegotiation.  All ports inherit
  these values as their initial settings.
  hw.cxgbe.fec
  hw.cxgbe.autoneg

- Add per-port sysctls to control FEC and autonegotiation.  These can be
  modified at any time.
  dev.<port>.<n>.fec
  dev.<port>.<n>.autoneg

7 years agoMFC r311005
cy [Wed, 4 Jan 2017 06:53:00 +0000 (06:53 +0000)]
MFC r311005

Fix up grammar.

7 years agoMFC r311012
pfg [Wed, 4 Jan 2017 02:51:39 +0000 (02:51 +0000)]
MFC r311012
Remove some uses of the GCC __nonnull() attribute.

While the checks are considered useful, the attribute does dangerous
optimizations, removing NULL checks where they can be needed. Remove the
uses of this attribute introduced in r281130: the changes were inspired on
Google's bionic where this attribute is not used anymore.

In general, the __nonnull() attribute has fulfilled its roll and will be
replaced with the Clang _Nonnull qualifier in the future.

7 years agoMFC r310705, r310706:
pfg [Wed, 4 Jan 2017 02:42:17 +0000 (02:42 +0000)]
MFC r310705, r310706:
style(9) cleanups.

Just to reduce some of the issues found with indent(1).

7 years agoMFC r310661: loader: use strip -o instead of cp and strip in place
emaste [Wed, 4 Jan 2017 01:23:15 +0000 (01:23 +0000)]
MFC r310661: loader: use strip -o instead of cp and strip in place

It is simpler and cleaner to have strip produce the stripped output
directly than copying the input to the output first.

7 years agoMFC r311003:
ngie [Wed, 4 Jan 2017 00:53:02 +0000 (00:53 +0000)]
MFC r311003:

Fix spelling errors; bump .Dd for the change

7 years agoMFC r310711:
ngie [Wed, 4 Jan 2017 00:43:59 +0000 (00:43 +0000)]
MFC r310711:

Don't explicitly build tcp wrappers support into bsnmpd; make it conditional
on MK_TCP_WRAPPERS != "no"

This likely fixes an issue seen where some of the USE_TCPWRAPPERS code didn't
work as advertised

7 years agoMFC r311001:
ngie [Wed, 4 Jan 2017 00:41:33 +0000 (00:41 +0000)]
MFC r311001:

Bump .Dd for the spelling and .Nm updates

7 years agoMFC r310665:
ngie [Wed, 4 Jan 2017 00:40:53 +0000 (00:40 +0000)]
MFC r310665:

Only build/install usr.sbin/bsnmpd/modules/snmp_hast if MK_HAST != no

7 years agoMFC r310664:
ngie [Wed, 4 Jan 2017 00:39:00 +0000 (00:39 +0000)]
MFC r310664:

Only build/install usr.sbin/bsnmpd/modules/snmp_wlan if MK_WIRELESS != no

7 years agoMFC r310099,r311000,r311002:
ngie [Wed, 4 Jan 2017 00:36:59 +0000 (00:36 +0000)]
MFC r310099,r311000,r311002:

r311000:

Fix spelling errors

r311002:

Install bsnmpclient(3) as snmp_client_{init,set_host,set_port}(3)

7 years agoMFC of r310887:
loos [Wed, 4 Jan 2017 00:25:22 +0000 (00:25 +0000)]
MFC of r310887:

Fix rcc_gpio_modify_bits().  Obviously (1 << 0) is not the same as 0.

Pointy hat to: loos

7 years agoFixes the sensor initialization, always reset the digital outputs on start.
loos [Wed, 4 Jan 2017 00:18:38 +0000 (00:18 +0000)]
Fixes the sensor initialization, always reset the digital outputs on start.

Obtained from: pfSense
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r310025:
bdrewery [Tue, 3 Jan 2017 23:28:07 +0000 (23:28 +0000)]
MFC r310025:

  Take write lock for rtld_bind before modifying obj_list in dl_iterate_phdr().

7 years agoMFC r309478:
bdrewery [Tue, 3 Jan 2017 23:25:55 +0000 (23:25 +0000)]
MFC r309478:

  DIRDEPS_BUILD: Fix '/' in group names creating a bad cookie.

7 years agoMFC r309477:
bdrewery [Tue, 3 Jan 2017 23:22:48 +0000 (23:22 +0000)]
MFC r309477:

  Revert r296585.

7 years agoRevert MFC of r308603.
bdrewery [Tue, 3 Jan 2017 23:21:33 +0000 (23:21 +0000)]
Revert MFC of r308603.

This depends on unmerged r307538 still.

7 years agoMFC r308603:
bdrewery [Tue, 3 Jan 2017 23:10:57 +0000 (23:10 +0000)]
MFC r308603:

  Move libsysdecode-specific hack out of buildworld.

7 years agoMFC r308601:
bdrewery [Tue, 3 Jan 2017 23:09:01 +0000 (23:09 +0000)]
MFC r308601:

  Fix 'rebuild during install' error to only trigger on 'make install'.

7 years agoMFC r308600:
bdrewery [Tue, 3 Jan 2017 23:08:21 +0000 (23:08 +0000)]
MFC r308600:

  DIRDEPS_BUILD: Consolidate some logic for skipping of reading
  Makefile.depend.

7 years agoMFC r308599:
bdrewery [Tue, 3 Jan 2017 23:07:40 +0000 (23:07 +0000)]
MFC r308599:

  Consolidate the "don't build" optimizations into _SKIP_BUILD.

7 years agoMFC r305147:
bdrewery [Tue, 3 Jan 2017 23:06:39 +0000 (23:06 +0000)]
MFC r305147:

  Add a 'make print-dir' that simply traverses all directories and prints them.

7 years agoMFC r308598:
bdrewery [Tue, 3 Jan 2017 23:04:51 +0000 (23:04 +0000)]
MFC r308598:

  DIRDEPS_BUILD: Don't hook 'beforebuild' into 'all' in MAKELEVEL 0.

7 years agoMFC r308597:
bdrewery [Tue, 3 Jan 2017 23:02:08 +0000 (23:02 +0000)]
MFC r308597:

  Always set CLEANFILES, even if not building.

7 years agoMFC r306775:
bdrewery [Tue, 3 Jan 2017 23:01:11 +0000 (23:01 +0000)]
MFC r306775:

  vrefl: Assert that the interlock is held.

7 years agoMFC r305258:
bdrewery [Tue, 3 Jan 2017 22:59:37 +0000 (22:59 +0000)]
MFC r305258:

  DIRDEPS_BUILD: Build crunchide for the host.

7 years agoMFC r305257:
bdrewery [Tue, 3 Jan 2017 22:58:48 +0000 (22:58 +0000)]
MFC r305257:

  DIRDEPS_BUILD: Include crunched object meta files for gendirdeps.

7 years agoMFC r305256:
bdrewery [Tue, 3 Jan 2017 22:57:09 +0000 (22:57 +0000)]
MFC r305256:

  Bump __FreeBSD_version for crunchgen META_MODE fix in r311185.

7 years agoMFC r305254:
bdrewery [Tue, 3 Jan 2017 22:55:10 +0000 (22:55 +0000)]
MFC r305254:

  META_MODE/DIRDEPS_BUILD: Fix various issues with crunch builds.

7 years agoMFC r305303:
bdrewery [Tue, 3 Jan 2017 22:52:24 +0000 (22:52 +0000)]
MFC r305303:

  DIRDEPS_BUILD: Update dependencies after a 'make bootstrap-tools'.

7 years agoMFC r305148:
bdrewery [Tue, 3 Jan 2017 22:51:40 +0000 (22:51 +0000)]
MFC r305148:

  DIRDEPS_BUILD: Add some missing dirctories to the build.

7 years agoMFC r305255:
bdrewery [Tue, 3 Jan 2017 22:49:56 +0000 (22:49 +0000)]
MFC r305255:

  DIRDEPS_BUILD: Fix 'make bootstrap-tools' not using the proper tblgen
  binaries.

7 years agoMFC r305253:
bdrewery [Tue, 3 Jan 2017 22:49:15 +0000 (22:49 +0000)]
MFC r305253:

  META_MODE: Don't expect .meta files for side-effect generated files.

7 years agoMFC r304826:
bdrewery [Tue, 3 Jan 2017 22:48:37 +0000 (22:48 +0000)]
MFC r304826:

  WITH_META_MODE: Don't let subdir traversals for 'make install' re-enable meta
  mode.

7 years agoMFC r305244:
bdrewery [Tue, 3 Jan 2017 22:46:43 +0000 (22:46 +0000)]
MFC r305244:

  DIRDEPS_BUILD: Add missing crunchgen host tool.

7 years agoMFC r305145:
bdrewery [Tue, 3 Jan 2017 22:46:00 +0000 (22:46 +0000)]
MFC r305145:

  DIRDEPS_BUILD: Avoid cyclic dependency with libc++.

7 years agoMFC r305009:
bdrewery [Tue, 3 Jan 2017 22:45:17 +0000 (22:45 +0000)]
MFC r305009:

  Allow parallelizing clean/cleandepend/depend with all.

7 years agoMFC r304647:
bdrewery [Tue, 3 Jan 2017 22:42:27 +0000 (22:42 +0000)]
MFC r304647:

  Rename ORDERED to BOOTSTRAP since no order is respected in the list.

7 years agoMFC r305216:
bdrewery [Tue, 3 Jan 2017 18:05:23 +0000 (18:05 +0000)]
MFC r305216:

  FAST_DEPEND/META_MODE: Fix several issues with SRCS containing '/'.

7 years agoMFC r305095:
bdrewery [Tue, 3 Jan 2017 17:16:13 +0000 (17:16 +0000)]
MFC r305095:

  AUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.

7 years agoMFC r309411: Retire long-broken/unused static rtld support
emaste [Tue, 3 Jan 2017 15:59:39 +0000 (15:59 +0000)]
MFC r309411: Retire long-broken/unused static rtld support

rtld-elf has some vestigial support for building as a static executable.
r45501 introduced a partial implementation with a prescient note that it
"might never be enabled." r153515 introduced ELF symbol versioning
support, and removed part of the unused build infrastructure for static
rtld.

GNU ld populates rela relocation addends and GOT entries with the same
values, and rtld's run-time dynamic executable check relied on this.
Alternate toolchains may not populate the GOT entries, which caused
RTLD_IS_DYNAMIC to return false. Simplify rtld by just removing the
unused check.

If we want to restore static rtld support later on we ought to introduce
a build-time #ifdef flag.

PR: 214972

7 years agoMFC r310634: elfcopy: fix PE object section name corruption and crash
emaste [Tue, 3 Jan 2017 15:57:47 +0000 (15:57 +0000)]
MFC r310634: elfcopy: fix PE object section name corruption and crash

Fixed a bug that the PE object section names are generated incorrectly
using the section name table found in the original input ELF object
instead of the intermediate ELF object.

Ticket: #541

Do not try to copy section content from a NULL d_buf when creating
uninitialized data COFF section for PE object.

Ticket: #540

Obtained from: ELF Tool Chain r3507, r3508

7 years agoMFC r310986:
ngie [Tue, 3 Jan 2017 05:43:17 +0000 (05:43 +0000)]
MFC r310986:

snmp_output_resp: style(9): sort variables by alignment

7 years agoMFC r310647:
markj [Tue, 3 Jan 2017 00:25:47 +0000 (00:25 +0000)]
MFC r310647:
Remove an obsolete pragma from dtrace.h.

7 years agoMFC r310865:
ngie [Mon, 2 Jan 2017 17:40:23 +0000 (17:40 +0000)]
MFC r310865:

Fix whitespace in a comment and fixing a spelling error in a comment

7 years agoMFC r310872, r310874
bapt [Mon, 2 Jan 2017 11:58:54 +0000 (11:58 +0000)]
MFC r310872, r310874

r310872:
Make sdiff --left-column work as expected

r310874:
Remove extra entries from the option enum

7 years agoMFC r310616:
kib [Mon, 2 Jan 2017 08:22:40 +0000 (08:22 +0000)]
MFC r310616:
Remove redundancy in vmtotal().

7 years agoMFC r310613:
kib [Mon, 2 Jan 2017 08:20:26 +0000 (08:20 +0000)]
MFC r310613:
Style.

7 years agoMFC r309300,r309363,r309405,r309523,r309590,r310185,r310623:
mm [Mon, 2 Jan 2017 01:41:31 +0000 (01:41 +0000)]
MFC r309300,r309363,r309405,r309523,r309590,r310185,r310623:

Sync libarchive with vendor.

Fixed vendor issues (relevant to FreeBSD)
#825, #832: Add sanity check of tar "uid, "gid" and "mtime" fields
#830, #831, #833, #846: Spelling fixes
#850: Fix issues with reading certain jar files

Fixed issues found by Google OSS-Fuzz:
OSS-Fuzz #15: Fix heap-buffer-overflow in archive_le16dec()
OSS-Fuzz #16: Fix possible hang in uudecode_filter_read()
OSS-Fuzz #139, #145, #152: Fix heap-buffer-overflow in uudecode_bidder_bid()
OSS-Fuzz #220: Reject an 'ar' filename table larger than 1GB or a filename
               larger than 1MB
OSS-Fuzz #227, #230, #239: Fix possible memory leak in archive_read_free()
OSS-Fuzz #237: Fix heap buffer overflow when reading invalid ar archives
OSS-Fuzz #286: Bugfix in archive_strncat_l()

More information:
https://github.com/libarchive/libarchive/issues/[libarchive_issue_number]
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=[oss_fuzz_issue_number]

7 years agoMFC r310820
arybchik [Sun, 1 Jan 2017 19:46:56 +0000 (19:46 +0000)]
MFC r310820

sfxge(4): move queue size checks to after the NIC config has been populated

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310819
arybchik [Sun, 1 Jan 2017 19:45:17 +0000 (19:45 +0000)]
MFC r310819

sfxge(4): cleanup: add efsys_lock_state_t for type of state param in EFSYS_LOCK()

This allows the common code to use the correct type for the lock state
local variable passed to EFSYS_LOCK() and EFSYS_UNLOCK().

On Windows, this allows warning supression pragmas to be removed.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310812
arybchik [Sun, 1 Jan 2017 19:41:17 +0000 (19:41 +0000)]
MFC r310812

sfxge(4): support non-interrupting event queues creation

Poll-mode driver does not use interrupts and number of used event queues
should not be limitted by the number of interrupts allocated for the
NIC.

Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310811
arybchik [Sun, 1 Jan 2017 19:37:22 +0000 (19:37 +0000)]
MFC r310811

sfxge(4): cleanup: remove now-unused function flags

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310810
arybchik [Sun, 1 Jan 2017 19:35:29 +0000 (19:35 +0000)]
MFC r310810

sfxge(4): cleanup: check deferred packet list tunables once

Sponsored by:   Solarflare Communications, Inc.

7 years agoMFC r310770
arybchik [Sun, 1 Jan 2017 19:33:12 +0000 (19:33 +0000)]
MFC r310770

sfxge(4): cleanup: clarify/unify variable name used for put-list length

get_count is used for get-list.

Sponsored by:   Solarflare Communications, Inc.