]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
5 years agoMFC r344245:
avos [Mon, 4 Mar 2019 03:38:43 +0000 (03:38 +0000)]
MFC r344245:
snmp_hostres(3): fix a typo in sanity checks in handle_chunk()

PR: 204253
Submitted by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@344747 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344244:
avos [Mon, 4 Mar 2019 03:30:39 +0000 (03:30 +0000)]
MFC r344244:
Fix memory / resource leaks in usr.sbin/rpc.ypupdated/update.c

Re-apply r343909 to this file to get the issue fixed.

PR: 204956
Reported by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@344746 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344477:
hselasky [Fri, 1 Mar 2019 08:06:23 +0000 (08:06 +0000)]
MFC r344477:
Add new USB quirk.

PR: 235897
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@344695 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344063,r344088:
mm [Thu, 28 Feb 2019 22:57:09 +0000 (22:57 +0000)]
MFC r344063,r344088:

MFC r344063:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1085: Fix a null pointer dereference bug in zip writer
  PR #1110: ZIP reader added support for XZ, LZMA, PPMD8 and BZIP2
            decopmpression
  PR #1116: Add support for 64-bit ar format
  PR #1120: Fix a 7zip crash [1] and a ISO9660 infinite loop [2]
  PR #1125: RAR5 reader - fix an invalid read and a memory leak
  PR #1131: POSIX reader - do not fail when tree_current_lstat() fails
            due to ENOENT [3]
  PR #1134: Delete unnecessary null pointer checks before calls of free()
  OSS-Fuzz 10843: Force intermediate to uint64_t to make UBSAN happy.
  OSS-Fuzz 11011: Avoid buffer overflow in rar5 reader

MFC r344088:
  archive_read_disk_posix.c: initialize delayed_errno

PR: 233006 [3]
Security: CVE-2019-1000019 [1], CVE-2019-1000020 [2]

git-svn-id: svn://svn.freebsd.org/base/stable/10@344674 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344473:
dab [Wed, 27 Feb 2019 22:29:37 +0000 (22:29 +0000)]
MFC r344473:

CID 1332000: Logically dead code in sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c

A pointer is first tested for NULL. If non-NULL, another pointer is
set equal to the first. The second pointer is then checked for NULL
and an error path taken if so. This second test and the associated
path is dead code as the pointer value, having just been checked for
NULL, cannot be NULL at this point. Remove the dead code.

Sponsored by: Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@344646 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344198:
avos [Thu, 21 Feb 2019 09:54:57 +0000 (09:54 +0000)]
MFC r344198:
GC ATA_REQUEST_TIMEOUT option remnants

It was removed from code in r249083 and from sys/conf/options in r249213.

PR: 193935, 222170

git-svn-id: svn://svn.freebsd.org/base/stable/10@344431 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344024:
dab [Wed, 20 Feb 2019 22:49:09 +0000 (22:49 +0000)]
MFC r344024:

CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c

In `probedone()`, for the `PROBE_REPORT_LUNS` case, all paths that
fall to the bottom of the case set `lp` to `NULL`, so the test for a
non-NULL value of `lp` and call to `free()` if true is dead code as
the test can never be true. Fix by eliminating the whole if
statement. To guard against a possible future change that accidentally
violates this assumption, use a `KASSERT()` to catch if `lp` is
non-NULL.

Sponsored by: Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@344394 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343501:
avos [Sun, 17 Feb 2019 02:58:44 +0000 (02:58 +0000)]
MFC r343501:
Add NO_6_BYTE / NO_SYNC_CACHE quirks for (C|D|E).* Olympus digital cameras

PR: 97472
Submitted by: Fabio Luis Girardi <papelhigienico@gmail.com>
Reviewed by: imp

git-svn-id: svn://svn.freebsd.org/base/stable/10@344221 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343980:
avos [Sat, 16 Feb 2019 01:05:22 +0000 (01:05 +0000)]
MFC r343980:
ifconfig(8): display 802.11n rates correctly for 'roam:rate' parameter

git-svn-id: svn://svn.freebsd.org/base/stable/10@344196 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343909:
avos [Sat, 16 Feb 2019 00:37:08 +0000 (00:37 +0000)]
MFC r343909:
newkey(8): fix 'tmpname' memory leak (always) and input file descriptor leak
when output file cannot be opened

PR: 201732
Reported by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@344193 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343905:
hselasky [Fri, 15 Feb 2019 09:22:23 +0000 (09:22 +0000)]
MFC r343905:
Improve Bluetooth device discovery support for Android and Microsoft devices.

Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
project at github.com.

PR: 210089
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@344146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343591:
cy [Thu, 14 Feb 2019 00:52:03 +0000 (00:52 +0000)]
MFC r343591:

Do not obtain an already held read lock. This causes a witness panic when
ipfs is invoked. This is the second of two panics resolving PR 235110.

PR: 235110
Reported by: David.Boyd49@twc.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@344113 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343871:
avos [Wed, 13 Feb 2019 09:28:48 +0000 (09:28 +0000)]
MFC r343871:
recoverdisk(1): fclose() file supplied via '-r readlist' parameter when
it's no longer needed

PR: 204952
Reported by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@344091 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343870:
avos [Tue, 12 Feb 2019 07:03:37 +0000 (07:03 +0000)]
MFC r343870:
ipcs(1): drop obsolete error checking

This code is unreachable since r77551.

PR: 201728

git-svn-id: svn://svn.freebsd.org/base/stable/10@344044 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343698, r343700:
avos [Sun, 10 Feb 2019 20:42:06 +0000 (20:42 +0000)]
MFC r343698, r343700:
ifconfig(8): display management / multicast wlan(4) rates properly

For 11n / 11ac we are still using non-11n rates for management and
multicast traffic by default; check 'MCS rate' bit to determine how
to print them correctly.

PR: 161035

git-svn-id: svn://svn.freebsd.org/base/stable/10@343974 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343837:
avos [Sun, 10 Feb 2019 20:26:12 +0000 (20:26 +0000)]
MFC r343837:
net80211(4): validate supplied roam:rate values from ifconfig(8)

git-svn-id: svn://svn.freebsd.org/base/stable/10@343973 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343604:
avos [Fri, 8 Feb 2019 14:32:27 +0000 (14:32 +0000)]
MFC r343604:
bwn(4): reuse ieee80211_tx_complete function

git-svn-id: svn://svn.freebsd.org/base/stable/10@343910 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343603:
avos [Fri, 8 Feb 2019 13:57:28 +0000 (13:57 +0000)]
MFC r343603:
ipw(4): reuse ieee80211_tx_complete function

This should partially fix 'netstat -b -I wlan0' output

git-svn-id: svn://svn.freebsd.org/base/stable/10@343907 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343572:
hselasky [Fri, 8 Feb 2019 10:28:13 +0000 (10:28 +0000)]
MFC r343572:
Add support for Audio Sink and Audio Source profiles to sdpd(8).

This allows user-space programs like virtual_oss(8) to act
as a Bluetooth speaker device.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343902 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343683:
avos [Fri, 8 Feb 2019 04:48:12 +0000 (04:48 +0000)]
MFC r343683:
Do not acquire IEEE80211_LOCK twice in cac_timeout(); reuse
locked function instead.

It is externally visible since r257065.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343894 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r337272:
bdrewery [Thu, 7 Feb 2019 23:57:28 +0000 (23:57 +0000)]
MFC r337272:

  Fix some filemon path logging issues.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343886 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343633:
bdrewery [Thu, 7 Feb 2019 21:37:06 +0000 (21:37 +0000)]
MFC r343633:

  Shar files may be seen as binary by grep.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343682:
avos [Wed, 6 Feb 2019 02:35:56 +0000 (02:35 +0000)]
MFC r343682:
sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and
drop unneeded cast.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343823 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343681:
avos [Wed, 6 Feb 2019 02:18:11 +0000 (02:18 +0000)]
MFC r343681:
run(4): fix allocated memory type for ieee80211_node(4)

PR: 177366

git-svn-id: svn://svn.freebsd.org/base/stable/10@343821 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343574:
avos [Wed, 6 Feb 2019 02:07:37 +0000 (02:07 +0000)]
MFC r343574:
Fix compilation with 'option NDISAPI + device ndis' and
without 'device pccard' in the kernel config file.

PR: 171532
Reported by: Robert Bonomi <bonomi@host128.r-bonomi.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@343820 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343697:
avos [Wed, 6 Feb 2019 01:53:01 +0000 (01:53 +0000)]
MFC r343697:
net80211(4): fix rate check when 'roaming' ifconfig(8) option is set to 'auto'

Do not try to clear 'basic rate' bit from roamRate; it cannot be here and,
actually, this operation clears 'MCS rate' bit instead, breaking comparison
for 11n / 11ac modes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343818 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343542:
avos [Wed, 6 Feb 2019 01:42:26 +0000 (01:42 +0000)]
MFC r343542:
upgt(4): unbreak build with UPGT_DEBUG

git-svn-id: svn://svn.freebsd.org/base/stable/10@343816 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343541:
avos [Tue, 5 Feb 2019 03:01:10 +0000 (03:01 +0000)]
MFC r343541:
Drop some unneeded includes from wireless USB drivers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343760 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343576:
avos [Mon, 4 Feb 2019 03:44:07 +0000 (03:44 +0000)]
MFC r343576:
ndiscvt(8): abort if no IDs were found during conversion.

PR: 69268
Submitted by: <darius@dons.net.au>

git-svn-id: svn://svn.freebsd.org/base/stable/10@343730 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343600:
cy [Sun, 3 Feb 2019 00:36:12 +0000 (00:36 +0000)]
MFC r343600:

Document the instance context pointer.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343691 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343502:
avos [Sat, 2 Feb 2019 16:57:49 +0000 (16:57 +0000)]
MFC r343502:
Remove RADIUS-related files when WITHOUT_RADIUS_SUPPORT=true is set
in src.conf(5)

PR: 234041

git-svn-id: svn://svn.freebsd.org/base/stable/10@343685 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343453:
hselasky [Fri, 1 Feb 2019 10:09:54 +0000 (10:09 +0000)]
MFC r343453:
Add new USB quirk.

PR: 235202
Differential Revision: https://reviews.freebsd.org/D18917
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343496:
avos [Fri, 1 Feb 2019 03:26:10 +0000 (03:26 +0000)]
MFC r343496:
pcf(4): fix parentheses in if condition

PR: 210709
Submitted by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@343643 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343495:
avos [Fri, 1 Feb 2019 02:43:13 +0000 (02:43 +0000)]
MFC r343495:
wlan.4: improve wording

PR: 218075
Submitted by: Aaron Taylor <halfnote1004@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@343639 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343473:
avos [Thu, 31 Jan 2019 11:36:28 +0000 (11:36 +0000)]
MFC r343473:
geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced

PR: 203499
Submitted by: <chadf@triularity.org>

MFC r343475:
geom_uzip(4): set 'gp != NULL' assertion on top of the function

There was yet another access to this variable in g_trace() few
lines upper.

PR: 203499
Reported by: cem

git-svn-id: svn://svn.freebsd.org/base/stable/10@343605 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343486:
cy [Wed, 30 Jan 2019 02:39:08 +0000 (02:39 +0000)]
MFC r343486:

Fix a typo.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343341:
avos [Mon, 28 Jan 2019 00:51:26 +0000 (00:51 +0000)]
MFC r343341:
ifconfig: drop unused macros from ifieee80211.c

git-svn-id: svn://svn.freebsd.org/base/stable/10@343506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r342634 (partial)
marius [Sun, 27 Jan 2019 19:05:18 +0000 (19:05 +0000)]
MFC: r342634 (partial)

o Don't allocate resources for SDMA in sdhci(4) if the controller or the
  front-end doesn't support SDMA or the latter implements a platform-
  specific transfer method instead. While at it, factor out allocation
  and freeing of SDMA resources to sdhci_dma_{alloc,free}() in order to
  keep the code more readable when adding support for ADMA variants.

o Base the size of the SDMA bounce buffer on MAXPHYS up to the maximum
  of 512 KiB instead of using a fixed 4-KiB-buffer. With the default
  MAXPHYS of 128 KiB and depending on the controller and medium, this
  reduces the number of SDHCI interrupts by a factor of ~16 to ~32 on
  sequential reads while an increase of throughput of up to ~84 % was
  seen.

  Front-ends for broken controllers that only support an SDMA buffer
  boundary of a specific size may set SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY
  and supply a size via struct sdhci_slot. According to Linux, only -
  unsupported in stable/10 anyway - Qualcomm MSM-type SDHCI controllers
  are affected by this, though.

  Requested by: Shreyank Amartya (unconditional bump to 512 KiB)

o Introduce a SDHCI_DEPEND macro for specifying the dependency of the
  front-end modules on the sdhci(4) one and bump the module version
  of sdhci(4) to 2 via an also newly introduced SDHCI_VERSION in order
  to ensure that all components are in sync WRT struct sdhci_slot.

o In sdhci(4):
  - Make pointers const were applicable, and
  - replace a few device_printf(9) calls with slot_printf() for
    consistency.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343190:
avos [Sat, 26 Jan 2019 12:41:16 +0000 (12:41 +0000)]
MFC r343190:
net80211: drop m_pullup call from ieee80211_crypto_decap.

For most wireless drivers Rx mbuf is allocated as one
contiguous chunk; only few are using chains for allocations -
but even then at least MCLBYTES (minus Rx descriptor size) is
available in the first mbuf.

In addition to the above, m_pullup was never called here - otherwise,
reallocation will break post-crypto_decap logic (ieee80211_decap,
ieee80211_deliver_data...), so just remove it; length check is left
in case if some truncated frame appears here.

PR: 234241

git-svn-id: svn://svn.freebsd.org/base/stable/10@343465 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343103:
cy [Wed, 23 Jan 2019 02:43:49 +0000 (02:43 +0000)]
MFC r343103:

Remove redundant ipfilter version of pcap-bpf.h. As of r214535 it was
no longer needed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343337 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343073:
cy [Wed, 23 Jan 2019 02:40:29 +0000 (02:40 +0000)]
MFC r343073:

Remove an IRIX-only source file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343336 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: 325765 (imp) Add notes about overlapping copies.
rgrimes [Tue, 22 Jan 2019 21:52:07 +0000 (21:52 +0000)]
MFC: 325765 (imp) Add notes about overlapping copies.

Add notes to each of these that specifically state that results are
undefined if the strings overlap. In the case of memcpy, we document
the overlapping behavior on FreeBSD (pre-existing). For str*, it is
left unspecified, however, since the default (and x86) implementations
do not handle overlapping strings properly.

PR: 223653
Approved by: phk (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@343326 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343023:
pfg [Mon, 21 Jan 2019 14:55:10 +0000 (14:55 +0000)]
MFC r343023:
msun: reduce diff between src/e_j0.c and src/e_j0f.c

PR: 229501

git-svn-id: svn://svn.freebsd.org/base/stable/10@343258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342791: fix a typo in chio(4) (which propagates into chio(1))
joerg [Sun, 20 Jan 2019 21:49:13 +0000 (21:49 +0000)]
MFC r342791: fix a typo in chio(4) (which propagates into chio(1))

git-svn-id: svn://svn.freebsd.org/base/stable/10@343227 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342884:
hselasky [Fri, 18 Jan 2019 08:59:00 +0000 (08:59 +0000)]
MFC r342884:
Fix loopback traffic when using non-lo0 link local IPv6 addresses.

The loopback interface can only receive packets with a single scope ID,
namely the scope ID of the loopback interface itself. To mitigate this
packets which use the scope ID are appearing as received by the real
network interface, see "origifp" in the patch. The current code would
drop packets which are designated for loopback which use a link-local
scope ID in the destination address or source address, because they
won't match the lo0's scope ID. To fix this restore the network
interface pointer from the scope ID in the destination address for
the problematic cases. See comments added in patch for a more detailed
description.

This issue was introduced with route caching by karels@ .

Reviewed by: bz (network)
Differential Revision: https://reviews.freebsd.org/D18769
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342778:
hselasky [Fri, 18 Jan 2019 08:49:10 +0000 (08:49 +0000)]
MFC r342778:
Reduce timeout for reading the USB HUB port status to 1000ms and try to filter
out dead USB HUB devices by implementing an error counter, so that the USB
enumeration thread does not spend all its time reading from non-responding
devices, blocking user-space access in the end.

Tested by: Matthias Apitz <guru@unixarea.de>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343136 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342730:
hselasky [Fri, 18 Jan 2019 08:45:56 +0000 (08:45 +0000)]
MFC r342730:
Improve USB generic debug messages. Print process ID and name when opening
and closing usb/ugenX.Y character device nodes.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343043: scp: disallow empty or current directory
emaste [Wed, 16 Jan 2019 15:19:09 +0000 (15:19 +0000)]
MFC r343043: scp: disallow empty or current directory

Obtained from: OpenBSD scp.c 1.198
Security: CVE-2018-20685
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@343098 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342966:
avos [Tue, 15 Jan 2019 02:26:03 +0000 (02:26 +0000)]
MFC r342966:
net80211: fix possible panic for some drivers after r342465

Check if rate control structures were allocated before trying to
access them in various places; this was possible before on
allocation failure (unlikely), but was revealed after r342211
where allocation was deferred.

The patch was adjusted a bit since file contents are different enough
since r306591.

Also, 'rate_stats' sysctl is not available here, so the panic is
unlikely to happen here even without this patch.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343036 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342810:
avos [Sun, 13 Jan 2019 02:27:10 +0000 (02:27 +0000)]
MFC r342810:
powerd(8): allow to force a method of battery state query

This change allows to determine power source via sysctl or /dev/apm
when devd(8) is running (used by default).

Based on patch from PR; other changes on top of it:
- '-f' (force) -> '-s' (source) parameter renaming;
- allow 'apm' -> 'devd' transition when '-s devd' is set
(if APM is enabled);
- man page update.

PR: 125707
Submitted by: Konstantin Stepanov <milezv@yandex.ru>
Reviewed by: bcr, imp
Differential Revision: https://reviews.freebsd.org/D18742

git-svn-id: svn://svn.freebsd.org/base/stable/10@342983 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342605:
cy [Sun, 6 Jan 2019 00:32:14 +0000 (00:32 +0000)]
MFC r342605:

TCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD
TCP_PAWS_IDLE is defined in netinet/tcp_seq.h, however this header
isn't included explicitly or implicitly at this point therefore
as far ipfilter is concerned TCP_PAWS_IDLE is not defined. Remove
the #ifdef and include netinet/tcp.h unconditionally.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r336610 (partial), r339207, r339267
marius [Sat, 5 Jan 2019 19:35:10 +0000 (19:35 +0000)]
MFC: r336610 (partial), r339207, r339267

- Or in the DMA coalescing Rx threshold so the other bits set in E1000_DMACR
  remain intact as intended in igb_init_dmac(). [1]

- Fix igb corrupting checksums with BPF and VLAN
  In stable/11, this merely syncs the code with head as the problem was
  introduced with r311849 in the latter and then fixed by r339207 with
  a different approach than the code used pre-r311849 and in stable/11.

- Use mbuf defines to construct csum offload masks rather than literals

MF11: r340148

Don't use 9k jumbo clusters

Reported by: Coverity
CID: 1304929 [1]

git-svn-id: svn://svn.freebsd.org/base/stable/10@342790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342549:
hselasky [Thu, 3 Jan 2019 09:28:18 +0000 (09:28 +0000)]
MFC r342549:
Add USB quirk for SPL Crimson Rev 1.

PR: 234380
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@342727 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342456:
hselasky [Thu, 3 Jan 2019 09:25:39 +0000 (09:25 +0000)]
MFC r342456:
Fix reading of USB sample rate descriptor for SPL Crimson Rev 1.

Read first one entry, then try to read the full rate descriptor table.

PR: 234380
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@342724 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC 341800: Don't report stale signal information in ptrace_lwpinfo.
jhb [Wed, 2 Jan 2019 19:11:49 +0000 (19:11 +0000)]
MFC 341800: Don't report stale signal information in ptrace_lwpinfo.

Once a signal's siginfo was copied to 'td_si' as part of the signal
exchange in issignal(), it was never cleared.  This caused future
thread events that are reported as SIGTRAP events without signal
information to report the stale siginfo in 'td_si'.  For example, if a
debugger created a new process and used SIGSTOP to stop it after
PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI
with the SIGSTOP siginfo in pl_siginfo.  This broke 'catch syscall' in
current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP
indicates a breakpoint or single step trap.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342704 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342596:
cy [Wed, 2 Jan 2019 15:13:08 +0000 (15:13 +0000)]
MFC r342596:

Remove duplicate include of sys/mbuf.h.

Reported by: Trond Endrest <Trond.Endrestol@ximalas.info>

git-svn-id: svn://svn.freebsd.org/base/stable/10@342685 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342613: Import tzdata 2018h
philip [Tue, 1 Jan 2019 10:05:36 +0000 (10:05 +0000)]
MFC r342613: Import tzdata 2018h
MFC r342644: Import tzdata 2018i

git-svn-id: svn://svn.freebsd.org/base/stable/10@342669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342385:
cy [Mon, 31 Dec 2018 03:53:33 +0000 (03:53 +0000)]
MFC r342385:

Remove an empty #if block.

The interesting thing is that looking through Darren's commit logs,
the line containing an extern ppsratecheck() definition was removed
from the v5-1-RELEASE branch but not from HEAD (I have taken his
CVS tree and converted it to GIT). There is a commit adding an
additional #if defined to the empty block. I can only assume that
this was intentional for something later. Looking through HEAD the
extern ppsratecheck() is there. However if we put it back it would
conflict with a static ppsratecheck() definition in fil.c when
building ipftest.

Therefore we remove this empty block.

ppsratecheck() is a function in the FreeBSD kernel. However ipftest
cannot call the ppsratecheck() in the kernel. Therefore one exists in
fil.c for use when building the userland ipftest utility which
approximates the packet filter in userland for testing of ipfilter
rules against packets captured with tcpdump.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342641 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342547:
cy [Sun, 30 Dec 2018 04:42:01 +0000 (04:42 +0000)]
MFC r342547:

Remove another empty #ifdef block. This empty block also exists in
the upstream HEAD.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342608 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342377:
cy [Sun, 30 Dec 2018 04:37:49 +0000 (04:37 +0000)]
MFC r342377:

Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9)
framework is available. pfil(9) has been in FreeBSD since FreeBSD 5
and according to svn log was first committed to HEAD in 2000, therefore
it is safe to say the check is no longer needed in FreeBSD.

pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF).
Therefore it is safe to say that it is supported by every NetBSD system
today. The framework also exists in illumos.

As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and
at some point in the future illumos too, and as all three platforms have
pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341279:
cy [Sun, 30 Dec 2018 04:31:51 +0000 (04:31 +0000)]
MFC r341279:

Clean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ
is defined in net/if.h, therefore the condition is never met and
confusing to those who follow.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342374:
cy [Sat, 29 Dec 2018 03:18:16 +0000 (03:18 +0000)]
MFC r342374:

Remove the last vestiges of HP/UX from a FreeBSD-only ipfilter
source file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342588 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when full.
jhb [Sat, 29 Dec 2018 01:19:14 +0000 (01:19 +0000)]
MFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when full.

The off-by-one errors in 332735 weren't actual errors and were
preventing the last MSI interrupt source from being used.  Instead,
the issue is that when all MSI interrupt sources were allocated, the
loop in msix_alloc() would terminate with 'msi' still set to non-null.
The only check for 'i' overflowing was in the 'msi' == NULL case, so
msix_alloc() would try to reuse the last MSI interrupt source instead
of failing.

Fix by moving the check for all sources being in use to just after the
loop.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342587 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342367: ifconfig.8, lagg.4: fix documentation bug: -use_flowid
eugen [Sat, 29 Dec 2018 00:44:11 +0000 (00:44 +0000)]
MFC r342367: ifconfig.8, lagg.4: fix documentation bug: -use_flowid
needs to be used to force local hash computation and disable usage
of RSS hash provided by driver.

PR: 234242

git-svn-id: svn://svn.freebsd.org/base/stable/10@342586 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC 340304: Use tcp_state_change() in the cxgbe(4) TOE module.
jhb [Sat, 29 Dec 2018 00:30:17 +0000 (00:30 +0000)]
MFC 340304: Use tcp_state_change() in the cxgbe(4) TOE module.

r254889 added tcp_state_change() as a centralized place to log state
changes in TCP connections for DTrace.  r294869 and r296881 took
advantage of this central location to manage per-state counters.
However, TOE sockets were still performing some (but not all) state
change updates via direct assignments to t_state.  This resulted in
state counters underflowing when TOE was in use.  Fix by using
tcp_state_change() when changing a TOE connection's state.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342583 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341785
arybchik [Wed, 26 Dec 2018 10:39:34 +0000 (10:39 +0000)]
MFC r341785

sfxge(4): use n Tx queues instead of n + 2 on EF10 HW

On EF10 HW we can avoid sending packets without checksum offload
or with IP-only checksum offload to dedicated queues. Instead, we
can use option descriptors to change offload policy on any queue
during runtime. Thus, we don't need to create two dedicated queues.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18390

git-svn-id: svn://svn.freebsd.org/base/stable/10@342529 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341784
arybchik [Wed, 26 Dec 2018 10:38:51 +0000 (10:38 +0000)]
MFC r341784

sfxge(4): prepare the number of Tx queues on event queue 0 to become
variable

The number of Tx queues on event queue 0 can depend on the NIC family
type, and this property will be leveraged by future patches.
This patch prepares the code for this change.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18389

git-svn-id: svn://svn.freebsd.org/base/stable/10@342527 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341783
arybchik [Wed, 26 Dec 2018 10:37:06 +0000 (10:37 +0000)]
MFC r341783

sfxge(4): report support for Tx checksum op descriptors

FreeBSD driver needs a patch to provide a means for packets
which do not need checksum offload but have flow ID set
to avoid hitting only the first Tx queue (which has been used
for packets not needing checksum offload).

This should be possible on Huntington, Medford or Medford2 chips
since these support toggling checksum offload on any given queue
dynamically by means of pushing option descriptors.

The patch for FreeBSD driver will then need a means to figure out
whether the feature can be used, and testing adapter family might
not be a good solution.

This patch adds a feature bit specifically to indicate support
for checksum option descriptors. The new feature bits may have
more users in future, apart from the mentioned FreeBSD patch.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18388

git-svn-id: svn://svn.freebsd.org/base/stable/10@342524 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341782
arybchik [Wed, 26 Dec 2018 10:35:41 +0000 (10:35 +0000)]
MFC r341782

sfxge(4): populate per-event queue stats in sysctl

In order to find out why the first event queue and corresponding
interrupt is triggered more frequent, it is useful to know which
events go to each event queue.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18418

git-svn-id: svn://svn.freebsd.org/base/stable/10@342523 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341327
arybchik [Wed, 26 Dec 2018 10:28:43 +0000 (10:28 +0000)]
MFC r341327

sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped

Early processing of a packet on transmit may change last seen
VLAN TCI in the queue context. If such a packet is eventually
dropped, last seen VLAN TCI must be set to its previous value.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18288

git-svn-id: svn://svn.freebsd.org/base/stable/10@342522 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341326
arybchik [Wed, 26 Dec 2018 10:28:03 +0000 (10:28 +0000)]
MFC r341326

sfxge(4): ensure EvQ poll stops when abort is requested

If an event handler requested an abort, only the inner loop was
guarenteed to be broken out of - the outer loop could continue
if total == batch.

Fix this by poisoning batch to ensure it is different to total.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18287

git-svn-id: svn://svn.freebsd.org/base/stable/10@342521 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341311
arybchik [Wed, 26 Dec 2018 10:27:24 +0000 (10:27 +0000)]
MFC r341311

sfxge(4): make last byte of module information available

Adjust bounds so the interface supports reading
the last available byte of data.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18273

git-svn-id: svn://svn.freebsd.org/base/stable/10@342520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341309
arybchik [Wed, 26 Dec 2018 10:26:58 +0000 (10:26 +0000)]
MFC r341309

sfxge(4): fix MAC Tx stats for less or equal to 64 bytes

This statistic should include 64byte and smaller frames.
Fix EF10 calculation to match Siena code.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18271

git-svn-id: svn://svn.freebsd.org/base/stable/10@342519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341302
arybchik [Wed, 26 Dec 2018 10:26:24 +0000 (10:26 +0000)]
MFC r341302

sfxge(4): fix a typo in unicast filter insertion comment

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18264

git-svn-id: svn://svn.freebsd.org/base/stable/10@342518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341301
arybchik [Wed, 26 Dec 2018 10:25:55 +0000 (10:25 +0000)]
MFC r341301

sfxge(4): prevent access to the NIC config before probe

NIC config is initialized during NIC probe.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18263

git-svn-id: svn://svn.freebsd.org/base/stable/10@342517 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341297
arybchik [Wed, 26 Dec 2018 10:25:01 +0000 (10:25 +0000)]
MFC r341297

sfxge(4): fix out of bounds read when dereferencing sdup

Introduce and use macro to make sure that MCDI buffers allocated
on stack are rounded up properly.

Submitted by:   Gautam Dawar <gdawar at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18259

git-svn-id: svn://svn.freebsd.org/base/stable/10@342516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341295
arybchik [Wed, 26 Dec 2018 10:23:16 +0000 (10:23 +0000)]
MFC r341295

sfxge(4): avoid usage of too big arrays on stack

Found by PreFAST static analysis.

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18257

git-svn-id: svn://svn.freebsd.org/base/stable/10@342515 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341290
arybchik [Wed, 26 Dec 2018 10:22:49 +0000 (10:22 +0000)]
MFC r341290

sfxge(4): check size of memory to read sensors data to

Size of provided memory should be consistent with specified size.

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18252

git-svn-id: svn://svn.freebsd.org/base/stable/10@342514 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341215
arybchik [Wed, 26 Dec 2018 10:22:18 +0000 (10:22 +0000)]
MFC r341215

sfxge(4): fix build because of no declaration

Functions declared in mcdi_mon.h are implemented in mcdi_mon.c.
The build fails if compiler options require declaration before
definition.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18246

git-svn-id: svn://svn.freebsd.org/base/stable/10@342513 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341214
arybchik [Wed, 26 Dec 2018 10:21:40 +0000 (10:21 +0000)]
MFC r341214

sfxge(4): fix SAL annotation for input buffers

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18245

git-svn-id: svn://svn.freebsd.org/base/stable/10@342512 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341213
arybchik [Wed, 26 Dec 2018 10:20:54 +0000 (10:20 +0000)]
MFC r341213

sfxge(4): fix PreFAST warnings because of unused return

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18244

git-svn-id: svn://svn.freebsd.org/base/stable/10@342511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341197
arybchik [Wed, 26 Dec 2018 10:20:02 +0000 (10:20 +0000)]
MFC r341197

sfxge(4): fix comparison always true warning

Loopback type used as bit index has efx_loopback_type_t type
which is enum. clang complains that it is always true when it
is compared with qword (64 bit) bits number boundary.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18228

git-svn-id: svn://svn.freebsd.org/base/stable/10@342510 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341038
arybchik [Wed, 26 Dec 2018 10:19:12 +0000 (10:19 +0000)]
MFC r341038

sfxge(4): add method to make checksum option descriptors

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18160

git-svn-id: svn://svn.freebsd.org/base/stable/10@342509 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340896
arybchik [Wed, 26 Dec 2018 10:17:44 +0000 (10:17 +0000)]
MFC r340896

sfxge(4): remove Falcon-specific concurrency check

Falcon support has been withdrawn from libefx, however, there is still
an obsolete Falcon-specific assertion that efx_mac_stats_upload()
and efx_port_poll() aren't concurrent. To be consistent with an overall
Falcon support revocation it's desirable to remove it.

Fix debug build invalid assertion failure.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D1813

git-svn-id: svn://svn.freebsd.org/base/stable/10@342508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340895
arybchik [Wed, 26 Dec 2018 10:16:48 +0000 (10:16 +0000)]
MFC r340895

sfxge(4): move BIU test code into Siena-specific file

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18129

git-svn-id: svn://svn.freebsd.org/base/stable/10@342507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340894
arybchik [Wed, 26 Dec 2018 10:16:11 +0000 (10:16 +0000)]
MFC r340894

sfxge(4): fix PreFAST static analysis warning (C6001)

Fix warning
"C6001: Using uninitialized memory '*sensor_maskp'"
which could occur when the npages argument to efx_mcdi_sensor_info()
is less than or equal to zero.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18128

git-svn-id: svn://svn.freebsd.org/base/stable/10@342506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340892
arybchik [Wed, 26 Dec 2018 10:15:31 +0000 (10:15 +0000)]
MFC r340892

sfxge(4): remove obsolete check for pre-Siena hardware

The fail4 label was used twice, so it doesn't need removing.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18126

git-svn-id: svn://svn.freebsd.org/base/stable/10@342505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340891
arybchik [Wed, 26 Dec 2018 10:14:29 +0000 (10:14 +0000)]
MFC r340891

sfxge(4): fix warnings from VS2015 C compiler (C4214)

Fix multiple level 4 warnings
"C4214: nonstandard extension used: bit field types other than int";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18125

git-svn-id: svn://svn.freebsd.org/base/stable/10@342504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340890
arybchik [Wed, 26 Dec 2018 10:13:42 +0000 (10:13 +0000)]
MFC r340890

sfxge(4): fix warnings from VS2015 C compiler (C4057)

Fix two level 4 warnings
"C4057: 'function': 'const uint8_t *' differs in indirection to
slightly different base types from 'caddr_t'"; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18124

git-svn-id: svn://svn.freebsd.org/base/stable/10@342503 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340889
arybchik [Wed, 26 Dec 2018 10:12:15 +0000 (10:12 +0000)]
MFC r340889

sfxge(4): fix warnings from VS2015 C compiler (C4189)

Fix multiple level 4 warnings
"C4189: 'xxx': local variable is initialized but not referenced";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18123

git-svn-id: svn://svn.freebsd.org/base/stable/10@342502 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340888
arybchik [Wed, 26 Dec 2018 10:09:53 +0000 (10:09 +0000)]
MFC r340888

sfxge(4): fix warnings from VS2015 C compiler (C4100)

Fix multiple level 4 warnings
"C4100: 'xxx': unreferenced formal parameter"
no functional changes.

The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual
Studio 2015 C compiler with the following:

  #define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__));
  #define _NOTE(_annotation)   _NOTE_ ## _annotation

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18122

git-svn-id: svn://svn.freebsd.org/base/stable/10@342501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340887
arybchik [Wed, 26 Dec 2018 10:08:28 +0000 (10:08 +0000)]
MFC r340887

sfxge(4): fix warnings from VS2015 C compiler (C4245)

Fix level 4 warning
"C4245: 'initializing': conversion from 'int' to 'uint32_t',
signed/unsigned mismatch" warning; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18121

git-svn-id: svn://svn.freebsd.org/base/stable/10@342500 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340886
arybchik [Wed, 26 Dec 2018 10:07:30 +0000 (10:07 +0000)]
MFC r340886

sfxge(4): fix warnings from VS2015 C compiler (C4244)

Fix level 4 warning
"C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible
loss
of data"; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18120

git-svn-id: svn://svn.freebsd.org/base/stable/10@342499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340885
arybchik [Wed, 26 Dec 2018 10:06:14 +0000 (10:06 +0000)]
MFC r340885

sfxge(4): fix warnings from VS2015 C compiler (C4310)

Fix level 4 warning
"C4310: cast truncates constant value";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18119

git-svn-id: svn://svn.freebsd.org/base/stable/10@342498 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340884
arybchik [Wed, 26 Dec 2018 10:05:36 +0000 (10:05 +0000)]
MFC r340884

sfxge(4): fix probes in licensing support

EFSYS_PROBE1 takes one typed value (in addition to the probe name),
whereas EFSYS_PROBE has just the probe name.

Which to use is determined by the probe name - "fail1" probes are
expected to include the function result.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18118

git-svn-id: svn://svn.freebsd.org/base/stable/10@342497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340883
arybchik [Wed, 26 Dec 2018 10:05:03 +0000 (10:05 +0000)]
MFC r340883

sfxge(4): fix diagnostics support build without Siena

The compilation failed because __efx_sram_pattern_fns was used in
efx_nic.c, but defined in efx_sram.c which is only needed when
supporting Siena.

To fix it move all the code using __efx_sram_pattern_fns into
Siena-specific files (except for the definition in efx_sram.c itself,
as that file only needs to be included in Siena-supporting builds
anyway).

The functions to test registers and tables are unlikely to apply to any
new hardware and so can be moved into Siena files. Since Huntington
such tests have been implemented in firmware.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18117

git-svn-id: svn://svn.freebsd.org/base/stable/10@342496 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340875
arybchik [Wed, 26 Dec 2018 10:03:59 +0000 (10:03 +0000)]
MFC r340875

sfxge(4): fix build issue with PHY LED control enabled

Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and
Medford.

Submitted by:   Vijay Srivastava <vijays at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18110

git-svn-id: svn://svn.freebsd.org/base/stable/10@342495 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340833
arybchik [Wed, 26 Dec 2018 10:03:11 +0000 (10:03 +0000)]
MFC r340833

sfxge(4): support inner checksum offload on transmit

Inner checksum offloads may be used only if firmware supports
these tunnels.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18102

git-svn-id: svn://svn.freebsd.org/base/stable/10@342494 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340831
arybchik [Wed, 26 Dec 2018 10:02:05 +0000 (10:02 +0000)]
MFC r340831

sfxge(4): make MAC naming consistent with other modules

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18101

git-svn-id: svn://svn.freebsd.org/base/stable/10@342493 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340826
arybchik [Wed, 26 Dec 2018 10:01:25 +0000 (10:01 +0000)]
MFC r340826

sfxge(4): fix ignoring function return value

fix PreFAST issue, add missing annotation that function return value
should not be ignored. Fix alignment.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18096

git-svn-id: svn://svn.freebsd.org/base/stable/10@342492 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f